Re: [RFC] Moving from pipes to usb_host_endpoint pointers

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Wed, 18 Jul 2007, Oliver Neukum wrote:

> Am Mittwoch 18 Juli 2007 schrieb Alan Stern:
> > On Wed, 18 Jul 2007, Oliver Neukum wrote:
> > 
> > > > Am Mittwoch 18 Juli 2007 schrieb Alan Stern:
> > > >  int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
> > > >  {
> > > > -       int                     pipe, temp, max;
> > > > -       struct usb_device       *dev;
> > > > -       int                     is_out;
> > > > +       int                             xfertype, max;
> > > > +       struct usb_device               *dev;
> > > > +       struct usb_host_endpoint        *ep;
> > > > +       int                             is_out;
> > > 
> > > This is a bit odd. Using a pointer the direction info should be included.
> > 
> > I don't understand.  Included where?
> 
> struct usb_host_endpoint

The direction information is part of the endpoint descriptor stored in 
the usb_host_endpoint.  But control endpoints don't have direction bits 
in their descriptors, since they are bidirectional.

> > > Or you could use endpoint numbers, which would remove some issues
> > > with enummeration.
> > 
> > That's essentially the same as using a pipe, since some of the bits in 
> > a pipe _are_ the endpoint number.
> 
> Only some, but yes, it is much closer. Still if you give ep, dev and is_out
> should be implicit.

We currently don't have any way to go from the endpoint structure to 
the usb_device structure, so dev is not implicit.  And while is_out is 
implicit for non-control endpoints, what's wrong with storing it in a 
local variable for convenience?  You may note that I didn't add the 
is_out variable; it has been there for a long time.

>  And how do you submit the first URBs? Are you going
> to fake a struct usb_host_endpoint for endpoint 0 ?

That's exactly what we do right now.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.