|
|
|
@ -546,21 +546,23 @@ void urb_append (urb_link * hd, struct urb *urb) |
|
|
|
|
* |
|
|
|
|
* NOTE: endpoint_address MUST contain a direction flag. |
|
|
|
|
*/ |
|
|
|
|
struct urb *usbd_alloc_urb (struct usb_device_instance *device, struct usb_endpoint_instance *endpoint) |
|
|
|
|
struct urb *usbd_alloc_urb (struct usb_device_instance *device, |
|
|
|
|
struct usb_endpoint_instance *endpoint) |
|
|
|
|
{ |
|
|
|
|
struct urb *urb; |
|
|
|
|
|
|
|
|
|
if( !(urb = (struct urb*)malloc(sizeof(struct urb))) ) { |
|
|
|
|
usberr(" F A T A L: malloc(%lu) FAILED!!!!", sizeof(struct urb)); |
|
|
|
|
return NULL; |
|
|
|
|
if (!(urb = (struct urb *) malloc (sizeof (struct urb)))) { |
|
|
|
|
usberr (" F A T A L: malloc(%u) FAILED!!!!", |
|
|
|
|
sizeof (struct urb)); |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Fill in known fields */ |
|
|
|
|
memset(urb, 0, sizeof(struct urb)); |
|
|
|
|
memset (urb, 0, sizeof (struct urb)); |
|
|
|
|
urb->endpoint = endpoint; |
|
|
|
|
urb->device = device; |
|
|
|
|
urb->buffer = (u8*)urb->buffer_data; |
|
|
|
|
urb->buffer_length = sizeof(urb->buffer_data); |
|
|
|
|
urb->buffer = (u8 *) urb->buffer_data; |
|
|
|
|
urb->buffer_length = sizeof (urb->buffer_data); |
|
|
|
|
|
|
|
|
|
urb_link_init (&urb->link); |
|
|
|
|
|
|
|
|
|