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: [linux-usb-devel] [RFC] USB driver conversion to use "struct device_driver"
Date: Sat, 10 Aug 2002 14:18:35 -0700 [thread overview]
Message-ID: <3D55832B.4040104@pacbell.net> (raw)
In-Reply-To: 20020810001005.GA29490@kroah.com
Good to start seeing "driver model" changes as well as just "driverfs"
changes ...
> Also, the driverfs representation of the USB devices has changed,
> possibly for the worse. Just try the patch to see what I mean :)
Why are devices children of the hub _interface_ now? Today they're
children of the hub device. The hub spec requires only one interface
for all hub devices, so it's safe the way it is today. With devices
as children of hubs devices, things look more familiar ... hubs act
like pci bridges (which they logically resemble).
> +static int usb_device_bind (struct device *dev, struct device_driver *drv)
Minor rough spot, please rename to usb_device_match() since it's
the bus_type->match() callback. Might even be nice to split out
some of the relevant code into "usb-device.c", mirroring what the
"pci-device.c" code does but with bus-specific differences. There's
too much random code in "usb.c" still for my taste! And all code
at this level is usbcore-internal anyway, shouldn't be mixed with
public driver APIs. :)
> struct usb_driver {
> struct module *owner;
> const char *name;
> +
> + int (*new_probe) (struct usb_interface *intf);
> + int (*init) (struct usb_interface *intf);
> + void (*new_disco) (struct usb_interface *intf);
> +
> + struct device_driver driver;
>
> void *(*probe)(
> struct usb_device *dev, /* the device */
I don't see why this isn't done as a transparent wrapper around
the existing probe()/disconnect() routines. PCI did this without
any such major changes to the driver API, and I thought being able
to do that was a (good!) device model design goal.
If we want to change the API to refocus on interfaces, rather
than device plus whichever kind of identifying number is used in
the relevant context, I'd rather start by getting rid of the
APIs that have been problematic (device + number). That'd be
nice for configurations and endpoints too, but I think most of
those calls involve interfaces. Those changes would be a lot
less invasive so far as device drivers are concerned.
Also, the generic driver model calls are probe/disconnect,
suspend/resume, and release. Today, USB has probe/disconnect
but not the others. I'd expect to see suspend/resume in there
before a new init callback ... but I see the init routine is
unused, maybe that just snuck in by accident.
- Dave
next prev parent reply other threads:[~2002-08-10 21:09 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 [this message]
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
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=3D55832B.4040104@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