On Sat, 28 Sep 2002, Greg KH wrote:

| On Sat, Sep 28, 2002 at 08:21:54PM -0700, Randy Dunlap wrote:
| > > On Fri, Sep 27, 2002 at 10:45:45PM -0700, Randy.Dunlap wrote:
| > >> Greg,
| > >>
| > >> Here's "nousb" for 2.4.39 if you want it.
| > >
| > > Great!  Yes, I have been wanting this.
| > >
| > >> It only applies to USB when built into a kernel image,
| > >> not as modules.
| > >> [Could be changed, but I didn't see a need for it.]
| > >
| > > No, that looks like the right way to do it.  If the core is built as a
| > > module, it's up to the initscripts to not load USB (conviently some
| > > distros already do this with the "nousb" flag).
| > >
| > > But in looking at what Arjan did for the Red Hat kernel, I think you
| > > also need to test for this when the host controller drivers load to make
| > > sure they can't initialize, and when usb_register() is called.
| >
| > Doh.  I wonder what I was thinking last night.
| > So each HCD's 'init' needs a check for "nousb", right?
| > I just checked and don't really see a cleaner way to do it.
|
| How about in usb_register_bus()?

It would be trivial to make usb_register_bus() fail,
of course.  But not very clean IMO.
It currently is "void", so does return a success/fail value.
OK, that's solvable.

However, HCD's typically call usb_register_bus() fairly late in
in their init code, so changing an untyped function call to one
that may fail at that point leaves lots of cleanup to be done
(or to be left undone, since "nousb" is presumably an unusual case).

I'd rather not have the HCD's allocate memory, map device memory,
enable the device for busmastering, request the interrupt, etc.,
for "nousb".  It would be cleaner just to sprinkle a check for
<nousb> in each HCD and be done with it.
And check for <nousb> in usb_register() so that USB device drivers
will fail also.

Comments?

-- 
~Randy



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to