On Wed, 19 Jan 2005 09:08:34 -0800, David Brownell <[EMAIL PROTECTED]> wrote:

> On Wednesday 19 January 2005 7:42 am, Pete Zaitcev wrote:
> >             Relying on pipe makes
> > tests dependant on URB only. No references to bus or HCD, therefore no
> > extra refcounts or worries about oopses. Also, HC drivers zero out the
> > urb->dev in giveback sequence which is a royal pain when trying to identify
> > a root hub.
> 
> That was a 2.4-ism, it should now be gone.  So an inlined function to
> test whether urb->dev is the root hub should suffice; I know there's
> code that does that already.

I do not like to refer to a dev because I do not quite understand where
the necessary usb_dev_get/_put are now. But if you guarantee that the
urb->dev is refcounted properly while urb is processed by usb_hcd_giveback_urb,
I do not mind an extra indirection.

What would be the right test in usb_hcd_giveback_urb, then?
It looks to me that you want me to use this:

urb_is_for_root_hub(urb) {
     return urb->dev == urb->dev->bus->hcpriv->self.root_hub;
}

This is just ... ewwwww. Can we use pipe for now or do you have
a better idea?

-- Pete


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to