summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/usbhost/usbhost.h5
-rw-r--r--libusbhost/usbhost.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/include/usbhost/usbhost.h b/include/usbhost/usbhost.h
index c330cab..9a6b59c 100644
--- a/include/usbhost/usbhost.h
+++ b/include/usbhost/usbhost.h
@@ -47,6 +47,7 @@ struct usb_request
int actual_length;
int max_packet_size;
void *private_data; /* struct usbdevfs_urb* */
+ int endpoint;
void *client_data; /* free for use by client */
};
@@ -185,7 +186,9 @@ int usb_device_control_transfer(struct usb_device *device,
int length,
unsigned int timeout);
-/* Reads or writes on a bulk endpoint */
+/* Reads or writes on a bulk endpoint.
+ * Returns number of bytes transferred, or negative value for error.
+ */
int usb_device_bulk_transfer(struct usb_device *device,
int endpoint,
void* buffer,
diff --git a/libusbhost/usbhost.c b/libusbhost/usbhost.c
index 576ee00..f5a7c3f 100644
--- a/libusbhost/usbhost.c
+++ b/libusbhost/usbhost.c
@@ -512,6 +512,7 @@ struct usb_request *usb_request_new(struct usb_device *dev,
req->dev = dev;
req->max_packet_size = __le16_to_cpu(ep_desc->wMaxPacketSize);
req->private_data = urb;
+ req->endpoint = urb->endpoint;
urb->usercontext = req;
return req;