From: David Brownell <david-b@pacbell.net>
To: Greg KH <greg@kroah.com>
Cc: linux-usb-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, Patrick Mochel <mochel@osdl.org>
Subject: Re: [RFC] USB driver conversion to use "struct device_driver"
Date: Mon, 12 Aug 2002 16:36:51 -0700 [thread overview]
Message-ID: <3D584693.1020000@pacbell.net> (raw)
In-Reply-To: 20020812213020.GB16872@kroah.com
>> usb_set_configuration(struct usb_device *dev, int);
>> usb_set_interface(struct usb_device *dev, int, int);
>>
>> usb_find_interface_driver_for_ifnum(struct usb_device *dev, int);
>>
>> usb_bind_driver(struct usb_driver *,struct usb_device *, int);
>> // usb_unbind_driver takes interface handle already!!
>>
>> usb_ifnum_to_ifpos(struct usb_device *dev, int);
>> usb_ifnum_to_if(struct usb_device *dev, int);
>> // basically, abolish the need for these calls
>>
>> usb_epnum_to_ep_desc(struct usb_device *dev, int);
>>
>>Plus I'm strongly tempted to group all the "dev + pipe" calls
>>the same way ... better to just pass the endpoint descriptor
>>than to encode descriptor values as bitfields and then later
>>waste time (repeateadly) tearing apart those bitfields.
>
>
> Agreed, I'll look into fixing up the above functions, unless someone
> wants to send me a patch doing it first :)
Maybe when Linus' release is a bit closer to the USB tree I could help
with that. Right now it's sufficiently divergent to make usb patches
against usbcore be rather helpful in general (though maybe not in that
particular case). I'll certainly be glad to take a whack at that.
>>Related issue to the suspend/resume code ... I recently noticed
>>(again) that the hub code was disconnecting top-down rather than
>>bottom up. That should eventually get delegated to the driver
>>framework ... any idea whether there was a reason not to do that
>>bottom-up in the first place? At what point does the driver model
>>kick in to handle that part of what the hub driver now does? If
>>the patch you sent around did that, my quick look missed it ... :)
>
>
> Hm, I didn't realize it was going top-down at all. What changes caused
> that? And no, I don't think I changed it, as I didn't realize it had
> been changed in the first place :)
I think it's just been that way for ages, no changes. It's actually
usb_disconnect(), not the hub driver, that goes top down, disconnecting
children only _after_ the parent is disconnected. (Might be nice to
flag all devices as "dead" before disconnecting in such cases, but we
don't have a way to flag devices as "dead" AFAIK. That'd make it easy
to fail new urb submissions for now-gone devices.)
If the current changes don't automagically make disconnection work
according to the device tree, something needs to change to make that
work correctly. But I'm not sure what it'd be; seems like the converse
of the probe() changes you started.
- Dave
prev parent reply other threads:[~2002-08-12 23:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-10 0:10 [RFC] USB driver conversion to use "struct device_driver" Greg KH
2002-08-10 9:57 ` [linux-usb-devel] " Oliver Neukum
2002-08-10 15:40 ` Greg KH
2002-08-10 21:18 ` David Brownell
2002-08-12 16:45 ` Greg KH
2002-08-12 18:30 ` David Brownell
2002-08-12 21:30 ` Greg KH
2002-08-12 23:36 ` David Brownell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D584693.1020000@pacbell.net \
--to=david-b@pacbell.net \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=mochel@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox