usbatm : modprobe & rmmod
duncan.sands at math.u-psud.fr
Mon Jan 24 08:08:44 EST 2005
> > I didn't fix up cxacru yet, sorry.
> Don't worry, I'll catch up as soon as the API hits the CVS.
I was planning on giving it a go this afternoon. Why don't we both have
a go, then mix and match? :)
> > Can you give me an example where the
> > usbatm instance data can't be destroyed at disconnect time (excluding code
> > run in the "heavy_init" kernel thread)?
> Given the condition in braces - no, I can't.
The code now shoots down the kernel thread if the usb device is disconnected
(which means you should check kthread_should_stop every now and again during
firmware initialization - see kthread.h), so this is no longer a problem either.
> However, now that you've turned back to the modular structure in
> usbatm2, which looks to me not only much saner than the monolithic
> design, but also far superior to the original usb_atm, I'm all for
> abandoning that effort in favour of your new approach.
For me, the new approach was always about viewing speedtch, cxacru etc as
"mini-drivers" that register themselves with the usbatm core. Since I never
explained that (except to David on IRC), you couldn't be expected to know :)
Also, the other thing I wanted to copy from usbnet was the trick of using the
struct usb_device_id driver_info field to provide a light-weight way of registering
mini-drivers. I initially copied the usbnet static registration because (1) it
was quicker to do it that way, and (2) I couldn't really see the point of making
each mini-driver into its own module. I was wrong about (2), and agree now that
having each guy as its own module and doing dynamic registration is better than
doing static registration. However, since I always knew that flipping between static
and dynamic schemes was trivial (as proved by the rather small patch to do it), this
was always a minor issue to me. As I said to David on IRC, I think you and he were
repelled by the "huge heap of crud in a file" nature of usbnet, while missing the
nice mini-driver aspect and the simple registration scheme (i.e. the driver_info trick,
which is a bit hacky IMHO, but simple).
More information about the Usbatm