Skip to content

Commit

Permalink
libusbhost: Save endpoint ID in usb_request struct
Browse files Browse the repository at this point in the history
Change-Id: I2cf189cee67c2efbcf919c8bae1447a6cb112f02
Signed-off-by: Mike Lockwood <lockwood@android.com>
  • Loading branch information
mikeandroid committed Feb 14, 2011
1 parent 99038f9 commit b5d68a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/usbhost/usbhost.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
};

Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions libusbhost/usbhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b5d68a3

Please sign in to comment.