Skip to content

Commit

Permalink
USB: r8a66597-hcd: fix Class or Vendor Request
Browse files Browse the repository at this point in the history
Fixed the problem that does not work in the case of bRequest = 0x05 in
Class or Vendor Request.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Yoshihiro Shimoda authored and Greg Kroah-Hartman committed Oct 12, 2007
1 parent 93b6497 commit e3a0905
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/usb/host/r8a66597-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,14 +1034,23 @@ static void prepare_status_packet(struct r8a66597 *r8a66597,
pipe_start(r8a66597, td->pipe);
}

static int is_set_address(unsigned char *setup_packet)
{
if (((setup_packet[0] & USB_TYPE_MASK) == USB_TYPE_STANDARD) &&
setup_packet[1] == USB_REQ_SET_ADDRESS)
return 1;
else
return 0;
}

/* this function must be called with interrupt disabled */
static int start_transfer(struct r8a66597 *r8a66597, struct r8a66597_td *td)
{
BUG_ON(!td);

switch (td->type) {
case USB_PID_SETUP:
if (td->urb->setup_packet[1] == USB_REQ_SET_ADDRESS) {
if (is_set_address(td->urb->setup_packet)) {
td->set_address = 1;
td->urb->setup_packet[2] = alloc_usb_address(r8a66597,
td->urb);
Expand Down

0 comments on commit e3a0905

Please sign in to comment.