I was looking at the kernel module loader (kmod) for some other
reasons, and it dawned on me that there was really no need to have
a user mode daemon (driven by usbdevfs) to run /etc/usb/policy ...
it's easy enough to do that in the kernel, which already has all
the relevant data and gets such notifications anyway.

Advantages over (usb)devfs based daemons:  overall, it needs much
less code, including less kernel code, as well as less data (no
new processes needed).  Disadvantages:  perhaps that KMOD isn't
enabled by default.


So -- here's a first version of a "KUSBD" feature.  It's a patch
against ac7 (with that one major OHCI bugfix).  To use it:

    - When you configure, enable KMOD and (in the USB section)
      KUSBD.  For the moment, don't make USB itself modular
      (some usbcore symbol ends up undefined).

    - If you get the very latest /etc/usb/policy scripts from
      sourceforge (see the linux-usb project "usbd" CVS; there's
      no release yet), then configuring "usbdevfs" is optional.

    - Go ahead, configure every other USB driver as modular!
      Host Controller drivers too (though this won't modprobe
      them at this time).

    - Rebuild as usual.  Reboot with that new kernel.

Get the /etc/usb shell scripts either from CVS (see above) or,
for a slightly older release that still require "usbdevfs", you
can use the stuff at http://jusb.sourceforge.org/?selected=usbd
(there've been no updates there in many weeks though).  Put them
in /etc/usb, and make sure "policy" is executable.  Plug, unplug.


When I've tried this, plugging in new devices has made the kernel
invoke the policy script, which loads their drivers.  Likely it'll
work for you too.  In case of trouble, disable that config option.
(And if you find bugs in the policy scripts, let us know!!)

- Dave

p.s. This also removes warnings in usb.c about some unused
    functions related to bandwidth allocation, with "#if 0".



kusbd.patch

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to