Lines Matching refs:urb
61 struct urb *urb, int index, int requesttype) in ep0_get_status() argument
65 urb->actual_length = 2; in ep0_get_status()
66 cp = (char*)urb->buffer; in ep0_get_status()
79 urb->actual_length = 0; in ep0_get_status()
96 static int ep0_get_one (struct usb_device_instance *device, struct urb *urb, in ep0_get_one() argument
99 urb->actual_length = 1; /* XXX 2? */ in ep0_get_one()
100 ((char *) urb->buffer)[0] = result; in ep0_get_one()
112 void copy_config (struct urb *urb, void *data, int max_length, in copy_config() argument
136 /*urb->buffer_length */ max_buf - urb->actual_length) <= 0) { in copy_config()
148 memcpy (urb->buffer + urb->actual_length, data, length); in copy_config()
149 urb->actual_length += length; in copy_config()
153 urb->actual_length, urb->buffer_length, max_buf, max_length, in copy_config()
170 struct urb *urb, int max, int descriptor_type, in ep0_get_descriptor() argument
177 if (!urb || !urb->buffer || !urb->buffer_length in ep0_get_descriptor()
178 || (urb->buffer_length < 255)) { in ep0_get_descriptor()
179 dbg_ep0 (2, "invalid urb %p", urb); in ep0_get_descriptor()
184 urb->actual_length = 0; in ep0_get_descriptor()
198 copy_config (urb, device_descriptor, in ep0_get_descriptor()
204 (struct usb_device_descriptor *) urb->buffer; in ep0_get_descriptor()
207 dbg_ep0(3, "copied device configuration, actual_length: 0x%x", urb->actual_length); in ep0_get_descriptor()
239 copy_config (urb, configuration_descriptor, in ep0_get_descriptor()
255 copy_config (urb, string_descriptor, string_descriptor->bLength, max); in ep0_get_descriptor()
270 le16_to_cpu (urb->device_request.wIndex); in ep0_get_descriptor()
287 copy_config (urb, class_descriptor, in ep0_get_descriptor()
299 le16_to_cpu (urb->device_request.wIndex); in ep0_get_descriptor()
316 if (max - urb->actual_length > 0) { in ep0_get_descriptor()
319 max - urb->actual_length); in ep0_get_descriptor()
320 memcpy (urb->buffer + urb->actual_length, in ep0_get_descriptor()
322 urb->actual_length += length; in ep0_get_descriptor()
337 copy_config(urb, qualifier_descriptor, in ep0_get_descriptor()
343 urb->actual_length); in ep0_get_descriptor()
355 urb->buffer, urb->buffer_length, urb->actual_length, in ep0_get_descriptor()
378 int ep0_recv_setup (struct urb *urb) in ep0_recv_setup() argument
388 if (!urb || !urb->device) { in ep0_recv_setup()
389 dbg_ep0 (3, "invalid URB %p", urb); in ep0_recv_setup()
393 request = &urb->device_request; in ep0_recv_setup()
394 device = urb->device; in ep0_recv_setup()
396 dbg_ep0 (3, "urb: %p device: %p", urb, urb->device); in ep0_recv_setup()
414 return device->cdc_recv_setup(request,urb); in ep0_recv_setup()
477 return ep0_get_status (device, urb, request->wIndex, in ep0_recv_setup()
482 return ep0_get_descriptor (device, urb, in ep0_recv_setup()
489 return ep0_get_one (device, urb, in ep0_recv_setup()
493 return ep0_get_one (device, urb, device->alternate); in ep0_recv_setup()