Lines Matching defs:len
86 static int check(void *_desc, int len, unsigned type, int size)
90 if(len < size) return -1;
92 if(desc[0] > len) return -1;
98 static int filter_usb_device(int fd, char *ptr, int len, int writable,
115 if(check(ptr, len, USB_DT_DEVICE, USB_DT_DEVICE_SIZE))
118 len -= dev->bLength;
121 if(check(ptr, len, USB_DT_CONFIG, USB_DT_CONFIG_SIZE))
124 len -= cfg->bLength;
138 // Keep it short enough because some bootloaders are borked if the URB len is > 255
201 if(check(ptr, len, USB_DT_INTERFACE, USB_DT_INTERFACE_SIZE))
204 len -= ifc->bLength;
214 if(check(ptr, len, USB_DT_ENDPOINT, USB_DT_ENDPOINT_SIZE))
217 len -= ept->bLength;
311 int usb_write(usb_handle *h, const void *_data, int len)
322 if(len == 0) {
324 bulk.len = 0;
337 while(len > 0) {
339 xfer = (len > MAX_USBFS_BULK_SIZE) ? MAX_USBFS_BULK_SIZE : len;
342 bulk.len = xfer;
354 len -= xfer;
361 int usb_read(usb_handle *h, void *_data, int len)
372 while(len > 0) {
373 int xfer = (len > MAX_USBFS_BULK_SIZE) ? MAX_USBFS_BULK_SIZE : len;
376 bulk.len = xfer;
395 len -= n;