Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Dec 1996 12:42:24 -0800
From:      "Jin Guojun[ITG]" <jin@george.lbl.gov>
To:        bugs@freebsd.org
Cc:        hackers@freebsd.org
Subject:   LKM issues
Message-ID:  <199612022042.MAA28760@george.lbl.gov>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612022042.MAA28760>