Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Apr 1997 20:05:42 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        avalon@coombs.anu.edu.au, msmith@atrad.adelaide.edu.au
Cc:        hackers@freebsd.org
Subject:   Re: Unloading LKMs (was Re: A Desparate Plea for Help...)
Message-ID:  <199704301005.UAA15798@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>Hmm, I didn't see that before.  It doesn't look like it's used
>correctly though; eg. the qcam module hooks itself in rather than
>letting _lkm_dev() do it.
>
>Then when its load function returns happily, the bogus entries its
>made in the cdevsw are saved as the 'old' values, and thus when it's 
>unloaded the saved values are restored and everything is spam.

Right (except _lkm_dev() shouldn't do it).

The olddev stuff is bogus except in 2.1.x.  The `old' pointer is
guaranteed to be null, or at least should have been null (SYSINIT() is
misused to initiate the devsw entries for unattached drivers).  There
are no functions to remove devsw entries, but "add"ing null entries
works.

_lkm_dev() shouldn't be touching the devsw's.  Drivers need to manage
the devsw's directly for the non-LKM case and should use identical
code for the LKM case.

Bruce



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