usbatm : modprobe & rmmod

Roman Kagan rkagan at mail.ru
Tue Jan 25 04:53:40 EST 2005


  Hi,

Given that the main development now concentrated on usbatm2, I decided
to give usb_atm another try, just for the sake of completing the
experiment.

I've tried to do what Matthieu suggested and marry the best of the two
approaches: the control and flexibility of the former and the subdriver
infrastructure facilitating the code sharing of the latter.

In a few words, the subdriver now registers a struct usbatm_driver with
usbatm_init at probe time, and, once the device is ready for ATM, calls
usbatm_atm_setup to create an ATM device.

The subdriver must provide a ->cleanup function to be called when the last
reference to it is dropped.  Also it may call usbatm_heavy_init to do
lengthy initialization, in which case it must provide a ->heavy_init
function, which will be run in a separate thread.

All the bookkeeping is done in usb_atm, including the refcounting for
the heavy_init thread (I didn't dare to switch to synchronous thread
shutdown).  I also had to play a little trick to make the ATM layer own
the reference to the subdriver, rather than to usb_atm.

The updated cxacru seems to behave well under various conditions,
including disconnect, module unloading, etc.

Please feel free to comment (or to ignore :).

Thanks,
  Roman.



More information about the Usbatm mailing list