07/31/2008 7:48 AM
post11273
|
Hi,
I have looked a bit more into the unloading code in io-pkt. I also
have looked at the shim layer code which manages to support unloading
of "io-net" drivers among other things. Very nice.
However, I am looking for a simple solution to load and unload a
module which would hook up to the ethernet layer using the
pfil_hooks. The pfil_hooks interface is fine I think. The problem is
being able to register a shutdown function and having the module
unloaded.
One solution would be loading the module as a driver instead of as an
lsm, registering some fake interface and using 'ifconfig ... destroy'
to unload the module. However, this dirties the interface list seen
with ifconfig and is unelegant.
Returning to the lsm approach I miss some kind of API in io-pkt which
would allow me to register a shutdown function, a way of triggering a
call to the registered shutdown function and then having the module
unloaded.
I cannot add such an API in another module loaded on startup before
the other modules that I would like to load/unload, since I would not
have access to its functions. If there is a way of having access to
functions/symbols between modules please tell me since that would be a
viable solution.
The code which calls dlclose() must be in io-pkt and not in the
module, since I guess the module cannot call dlclose() on itself. I
could arrange to get called in the module by calling resmgr_attach()
for a device file but the problem remains that it cannot call
dlclose() on itself.
Thank you for any help,
Peter Engstrom
|
|
|