aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/r8a66597-hcd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index fd00f1e33fb..0a699efe6c9 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -1034,6 +1034,15 @@ static void prepare_status_packet(struct r8a66597 *r8a66597,
1034 pipe_start(r8a66597, td->pipe); 1034 pipe_start(r8a66597, td->pipe);
1035} 1035}
1036 1036
1037static int is_set_address(unsigned char *setup_packet)
1038{
1039 if (((setup_packet[0] & USB_TYPE_MASK) == USB_TYPE_STANDARD) &&
1040 setup_packet[1] == USB_REQ_SET_ADDRESS)
1041 return 1;
1042 else
1043 return 0;
1044}
1045
1037/* this function must be called with interrupt disabled */ 1046/* this function must be called with interrupt disabled */
1038static int start_transfer(struct r8a66597 *r8a66597, struct r8a66597_td *td) 1047static int start_transfer(struct r8a66597 *r8a66597, struct r8a66597_td *td)
1039{ 1048{
@@ -1041,7 +1050,7 @@ static int start_transfer(struct r8a66597 *r8a66597, struct r8a66597_td *td)
1041 1050
1042 switch (td->type) { 1051 switch (td->type) {
1043 case USB_PID_SETUP: 1052 case USB_PID_SETUP:
1044 if (td->urb->setup_packet[1] == USB_REQ_SET_ADDRESS) { 1053 if (is_set_address(td->urb->setup_packet)) {
1045 td->set_address = 1; 1054 td->set_address = 1;
1046 td->urb->setup_packet[2] = alloc_usb_address(r8a66597, 1055 td->urb->setup_packet[2] = alloc_usb_address(r8a66597,
1047 td->urb); 1056 td->urb);