{
struct usb_skel *dev;
int retval = 0;
+ int bytes_read;
dev = (struct usb_skel *)file->private_data;
usb_rcvbulkpipe(dev->udev, dev->bulk_in_endpointAddr),
dev->bulk_in_buffer,
min(dev->bulk_in_size, count),
- &count, HZ*10);
+ &bytes_read, 10000);
/* if the read was successful, copy the data to userspace */
if (!retval) {
- if (copy_to_user(buffer, dev->bulk_in_buffer, count))
+ if (copy_to_user(buffer, dev->bulk_in_buffer, bytes_read))
retval = -EFAULT;
else
- retval = count;
+ retval = bytes_read;
}
return retval;
}
if (!dev->bulk_out_endpointAddr &&
- !(endpoint->bEndpointAddress & USB_DIR_IN) &&
+ !(endpoint->bEndpointAddress & USB_DIR_OUT) &&
((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
== USB_ENDPOINT_XFER_BULK)) {
/* we found a bulk out endpoint */