From owner-freebsd-bugs Mon Dec 2 12:42:43 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA12048 for bugs-outgoing; Mon, 2 Dec 1996 12:42:43 -0800 (PST) Received: from george.lbl.gov (george-2.lbl.gov [131.243.2.12]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id MAA12023; Mon, 2 Dec 1996 12:42:37 -0800 (PST) Received: (jin@localhost) by george.lbl.gov (8.6.10/8.6.5) id MAA28760; Mon, 2 Dec 1996 12:42:24 -0800 Date: Mon, 2 Dec 1996 12:42:24 -0800 From: "Jin Guojun[ITG]" Message-Id: <199612022042.MAA28760@george.lbl.gov> To: bugs@freebsd.org Subject: LKM issues Cc: hackers@freebsd.org Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I remember that someone said that the LKM does not work for character device, but the message seems not saying why. I traced the code and found one problem: (1) _lkm_dev(lkmtp, cmd) did not do any thing for LM_DT_CHAR, switch(cmd) { case LKM_E_LOAD: /* don't load twice! */ if (lkmexists(lkmtp)) return(EEXIST); switch(args->lkm_devtype) { ... case LM_DT_CHAR: break; ... so that unload a loaded character device driver will crash at (!!!): case LKM_E_UNLOAD: /* current slot... */ i = args->lkm_offset; switch(args->lkm_devtype) { ... case LM_DT_CHAR: /* replace current slot contents with old contents */ !!! cdevsw_add(&descrip, args->lkm_olddev.cdev,NULL); break; ... } ----------------------------------------------- A separated question: Should a loadable network driver use MOD_MISC(name)? It seems there is a LM_STRMOD slot, but no MOD_STR(...) exists. Should the MOD_STR() be used for network driver ? or will it be used for something else? Thanks, -Jin