diff options
Diffstat (limited to 'drivers/usb/class')
| -rw-r--r-- | drivers/usb/class/cdc-wdm.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 1c50baff7725..9734863a3a49 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
| @@ -159,11 +159,9 @@ static void wdm_int_callback(struct urb *urb) | |||
| 159 | int rv = 0; | 159 | int rv = 0; |
| 160 | int status = urb->status; | 160 | int status = urb->status; |
| 161 | struct wdm_device *desc; | 161 | struct wdm_device *desc; |
| 162 | struct usb_ctrlrequest *req; | ||
| 163 | struct usb_cdc_notification *dr; | 162 | struct usb_cdc_notification *dr; |
| 164 | 163 | ||
| 165 | desc = urb->context; | 164 | desc = urb->context; |
| 166 | req = desc->irq; | ||
| 167 | dr = (struct usb_cdc_notification *)desc->sbuf; | 165 | dr = (struct usb_cdc_notification *)desc->sbuf; |
| 168 | 166 | ||
| 169 | if (status) { | 167 | if (status) { |
| @@ -210,24 +208,6 @@ static void wdm_int_callback(struct urb *urb) | |||
| 210 | goto exit; | 208 | goto exit; |
| 211 | } | 209 | } |
| 212 | 210 | ||
| 213 | req->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE); | ||
| 214 | req->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE; | ||
| 215 | req->wValue = 0; | ||
| 216 | req->wIndex = desc->inum; | ||
| 217 | req->wLength = cpu_to_le16(desc->wMaxCommand); | ||
| 218 | |||
| 219 | usb_fill_control_urb( | ||
| 220 | desc->response, | ||
| 221 | interface_to_usbdev(desc->intf), | ||
| 222 | /* using common endpoint 0 */ | ||
| 223 | usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0), | ||
| 224 | (unsigned char *)req, | ||
| 225 | desc->inbuf, | ||
| 226 | desc->wMaxCommand, | ||
| 227 | wdm_in_callback, | ||
| 228 | desc | ||
| 229 | ); | ||
| 230 | desc->response->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | ||
| 231 | spin_lock(&desc->iuspin); | 211 | spin_lock(&desc->iuspin); |
| 232 | clear_bit(WDM_READ, &desc->flags); | 212 | clear_bit(WDM_READ, &desc->flags); |
| 233 | set_bit(WDM_RESPONDING, &desc->flags); | 213 | set_bit(WDM_RESPONDING, &desc->flags); |
| @@ -734,6 +714,25 @@ next_desc: | |||
| 734 | ); | 714 | ); |
| 735 | desc->validity->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | 715 | desc->validity->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
| 736 | 716 | ||
| 717 | desc->irq->bRequestType = (USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE); | ||
| 718 | desc->irq->bRequest = USB_CDC_GET_ENCAPSULATED_RESPONSE; | ||
| 719 | desc->irq->wValue = 0; | ||
| 720 | desc->irq->wIndex = desc->inum; | ||
| 721 | desc->irq->wLength = cpu_to_le16(desc->wMaxCommand); | ||
| 722 | |||
| 723 | usb_fill_control_urb( | ||
| 724 | desc->response, | ||
| 725 | interface_to_usbdev(desc->intf), | ||
| 726 | /* using common endpoint 0 */ | ||
| 727 | usb_rcvctrlpipe(interface_to_usbdev(desc->intf), 0), | ||
| 728 | (unsigned char *)desc->irq, | ||
| 729 | desc->inbuf, | ||
| 730 | desc->wMaxCommand, | ||
| 731 | wdm_in_callback, | ||
| 732 | desc | ||
| 733 | ); | ||
| 734 | desc->response->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | ||
| 735 | |||
| 737 | usb_set_intfdata(intf, desc); | 736 | usb_set_intfdata(intf, desc); |
| 738 | rv = usb_register_dev(intf, &wdm_class); | 737 | rv = usb_register_dev(intf, &wdm_class); |
| 739 | if (rv < 0) | 738 | if (rv < 0) |
