On Fri, 6 Jul 2007, Oliver Neukum wrote:

> Hi,
> 
> I tried switching our allocation APIs to:
> 
> struct urb *usb_alloc_urb(struct usb_host_endpoint *ep, size_t alloc_length, 
> gfp_t mem_flags);
> struct urb *usb_alloc_iso_urb(struct usb_host_endpoint *ep, unsigned int 
> iso_packets, gfp_t mem_flags);
> 
> Unfortunately during initialisation ep->ep_dev turns out to be NULL.
> Should I change the allocator or the initialisation?

That's a real problem.  During initial enumeration the usb_device 
hasn't been registered yet, so the ep_device hasn't been created.

One possibility is to add yet another allocator:

struct urb *usb_alloc_ep0_urb(struct usb_device *udev, size_t alloc_length, 
                gfp_t mem_flags);

This could have an additional extra use, since it could leave space for 
the setup packet at the end of the URB (rounded up to the next cache 
line).

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/
_______________________________________________
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