diff options
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 8 | ||||
-rw-r--r-- | drivers/hid/usbhid/usbhid.h | 1 | ||||
-rw-r--r-- | drivers/hid/usbhid/usbkbd.c | 8 | ||||
-rw-r--r-- | drivers/input/misc/cm109.c | 12 | ||||
-rw-r--r-- | drivers/input/misc/powermate.c | 9 | ||||
-rw-r--r-- | drivers/input/misc/yealink.c | 11 | ||||
-rw-r--r-- | drivers/usb/core/urb.c | 4 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 18 | ||||
-rw-r--r-- | drivers/usb/misc/usbtest.c | 9 | ||||
-rw-r--r-- | drivers/usb/storage/transport.c | 2 | ||||
-rw-r--r-- | drivers/usb/storage/usb.c | 15 | ||||
-rw-r--r-- | drivers/usb/storage/usb.h | 3 | ||||
-rw-r--r-- | drivers/usb/wusbcore/wa-xfer.c | 2 |
13 files changed, 27 insertions, 75 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 7b85b696fdab..6a510c9675fc 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -787,8 +787,7 @@ static int hid_alloc_buffers(struct usb_device *dev, struct hid_device *hid) | |||
787 | &usbhid->inbuf_dma); | 787 | &usbhid->inbuf_dma); |
788 | usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, | 788 | usbhid->outbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, |
789 | &usbhid->outbuf_dma); | 789 | &usbhid->outbuf_dma); |
790 | usbhid->cr = usb_buffer_alloc(dev, sizeof(*usbhid->cr), GFP_KERNEL, | 790 | usbhid->cr = kmalloc(sizeof(*usbhid->cr), GFP_KERNEL); |
791 | &usbhid->cr_dma); | ||
792 | usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, | 791 | usbhid->ctrlbuf = usb_buffer_alloc(dev, usbhid->bufsize, GFP_KERNEL, |
793 | &usbhid->ctrlbuf_dma); | 792 | &usbhid->ctrlbuf_dma); |
794 | if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr || | 793 | if (!usbhid->inbuf || !usbhid->outbuf || !usbhid->cr || |
@@ -846,7 +845,7 @@ static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid) | |||
846 | 845 | ||
847 | usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma); | 846 | usb_buffer_free(dev, usbhid->bufsize, usbhid->inbuf, usbhid->inbuf_dma); |
848 | usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma); | 847 | usb_buffer_free(dev, usbhid->bufsize, usbhid->outbuf, usbhid->outbuf_dma); |
849 | usb_buffer_free(dev, sizeof(*(usbhid->cr)), usbhid->cr, usbhid->cr_dma); | 848 | kfree(usbhid->cr); |
850 | usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma); | 849 | usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma); |
851 | } | 850 | } |
852 | 851 | ||
@@ -1007,9 +1006,8 @@ static int usbhid_start(struct hid_device *hid) | |||
1007 | 1006 | ||
1008 | usb_fill_control_urb(usbhid->urbctrl, dev, 0, (void *) usbhid->cr, | 1007 | usb_fill_control_urb(usbhid->urbctrl, dev, 0, (void *) usbhid->cr, |
1009 | usbhid->ctrlbuf, 1, hid_ctrl, hid); | 1008 | usbhid->ctrlbuf, 1, hid_ctrl, hid); |
1010 | usbhid->urbctrl->setup_dma = usbhid->cr_dma; | ||
1011 | usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma; | 1009 | usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma; |
1012 | usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); | 1010 | usbhid->urbctrl->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
1013 | 1011 | ||
1014 | if (!(hid->quirks & HID_QUIRK_NO_INIT_REPORTS)) | 1012 | if (!(hid->quirks & HID_QUIRK_NO_INIT_REPORTS)) |
1015 | usbhid_init_reports(hid); | 1013 | usbhid_init_reports(hid); |
diff --git a/drivers/hid/usbhid/usbhid.h b/drivers/hid/usbhid/usbhid.h index ec20400c7f29..693fd3e720df 100644 --- a/drivers/hid/usbhid/usbhid.h +++ b/drivers/hid/usbhid/usbhid.h | |||
@@ -75,7 +75,6 @@ struct usbhid_device { | |||
75 | 75 | ||
76 | struct urb *urbctrl; /* Control URB */ | 76 | struct urb *urbctrl; /* Control URB */ |
77 | struct usb_ctrlrequest *cr; /* Control request struct */ | 77 | struct usb_ctrlrequest *cr; /* Control request struct */ |
78 | dma_addr_t cr_dma; /* Control request struct dma */ | ||
79 | struct hid_control_fifo ctrl[HID_CONTROL_FIFO_SIZE]; /* Control fifo */ | 78 | struct hid_control_fifo ctrl[HID_CONTROL_FIFO_SIZE]; /* Control fifo */ |
80 | unsigned char ctrlhead, ctrltail; /* Control fifo head & tail */ | 79 | unsigned char ctrlhead, ctrltail; /* Control fifo head & tail */ |
81 | char *ctrlbuf; /* Control buffer */ | 80 | char *ctrlbuf; /* Control buffer */ |
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index f843443ba5c3..bdc7b09e8670 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c | |||
@@ -74,7 +74,6 @@ struct usb_kbd { | |||
74 | unsigned char *new; | 74 | unsigned char *new; |
75 | struct usb_ctrlrequest *cr; | 75 | struct usb_ctrlrequest *cr; |
76 | unsigned char *leds; | 76 | unsigned char *leds; |
77 | dma_addr_t cr_dma; | ||
78 | dma_addr_t new_dma; | 77 | dma_addr_t new_dma; |
79 | dma_addr_t leds_dma; | 78 | dma_addr_t leds_dma; |
80 | }; | 79 | }; |
@@ -199,7 +198,7 @@ static int usb_kbd_alloc_mem(struct usb_device *dev, struct usb_kbd *kbd) | |||
199 | return -1; | 198 | return -1; |
200 | if (!(kbd->new = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &kbd->new_dma))) | 199 | if (!(kbd->new = usb_buffer_alloc(dev, 8, GFP_ATOMIC, &kbd->new_dma))) |
201 | return -1; | 200 | return -1; |
202 | if (!(kbd->cr = usb_buffer_alloc(dev, sizeof(struct usb_ctrlrequest), GFP_ATOMIC, &kbd->cr_dma))) | 201 | if (!(kbd->cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL))) |
203 | return -1; | 202 | return -1; |
204 | if (!(kbd->leds = usb_buffer_alloc(dev, 1, GFP_ATOMIC, &kbd->leds_dma))) | 203 | if (!(kbd->leds = usb_buffer_alloc(dev, 1, GFP_ATOMIC, &kbd->leds_dma))) |
205 | return -1; | 204 | return -1; |
@@ -212,7 +211,7 @@ static void usb_kbd_free_mem(struct usb_device *dev, struct usb_kbd *kbd) | |||
212 | usb_free_urb(kbd->irq); | 211 | usb_free_urb(kbd->irq); |
213 | usb_free_urb(kbd->led); | 212 | usb_free_urb(kbd->led); |
214 | usb_buffer_free(dev, 8, kbd->new, kbd->new_dma); | 213 | usb_buffer_free(dev, 8, kbd->new, kbd->new_dma); |
215 | usb_buffer_free(dev, sizeof(struct usb_ctrlrequest), kbd->cr, kbd->cr_dma); | 214 | kfree(kbd->cr); |
216 | usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma); | 215 | usb_buffer_free(dev, 1, kbd->leds, kbd->leds_dma); |
217 | } | 216 | } |
218 | 217 | ||
@@ -304,9 +303,8 @@ static int usb_kbd_probe(struct usb_interface *iface, | |||
304 | usb_fill_control_urb(kbd->led, dev, usb_sndctrlpipe(dev, 0), | 303 | usb_fill_control_urb(kbd->led, dev, usb_sndctrlpipe(dev, 0), |
305 | (void *) kbd->cr, kbd->leds, 1, | 304 | (void *) kbd->cr, kbd->leds, 1, |
306 | usb_kbd_led, kbd); | 305 | usb_kbd_led, kbd); |
307 | kbd->led->setup_dma = kbd->cr_dma; | ||
308 | kbd->led->transfer_dma = kbd->leds_dma; | 306 | kbd->led->transfer_dma = kbd->leds_dma; |
309 | kbd->led->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); | 307 | kbd->led->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
310 | 308 | ||
311 | error = input_register_device(kbd->dev); | 309 | error = input_register_device(kbd->dev); |
312 | if (error) | 310 | if (error) |
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index 86457feccfc4..8d2d291ee508 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c | |||
@@ -102,7 +102,6 @@ struct cm109_dev { | |||
102 | struct cm109_ctl_packet *ctl_data; | 102 | struct cm109_ctl_packet *ctl_data; |
103 | dma_addr_t ctl_dma; | 103 | dma_addr_t ctl_dma; |
104 | struct usb_ctrlrequest *ctl_req; | 104 | struct usb_ctrlrequest *ctl_req; |
105 | dma_addr_t ctl_req_dma; | ||
106 | struct urb *urb_ctl; | 105 | struct urb *urb_ctl; |
107 | /* | 106 | /* |
108 | * The 3 bitfields below are protected by ctl_submit_lock. | 107 | * The 3 bitfields below are protected by ctl_submit_lock. |
@@ -629,9 +628,7 @@ static const struct usb_device_id cm109_usb_table[] = { | |||
629 | 628 | ||
630 | static void cm109_usb_cleanup(struct cm109_dev *dev) | 629 | static void cm109_usb_cleanup(struct cm109_dev *dev) |
631 | { | 630 | { |
632 | if (dev->ctl_req) | 631 | kfree(dev->ctl_req); |
633 | usb_buffer_free(dev->udev, sizeof(*(dev->ctl_req)), | ||
634 | dev->ctl_req, dev->ctl_req_dma); | ||
635 | if (dev->ctl_data) | 632 | if (dev->ctl_data) |
636 | usb_buffer_free(dev->udev, USB_PKT_LEN, | 633 | usb_buffer_free(dev->udev, USB_PKT_LEN, |
637 | dev->ctl_data, dev->ctl_dma); | 634 | dev->ctl_data, dev->ctl_dma); |
@@ -696,8 +693,7 @@ static int cm109_usb_probe(struct usb_interface *intf, | |||
696 | if (!dev->ctl_data) | 693 | if (!dev->ctl_data) |
697 | goto err_out; | 694 | goto err_out; |
698 | 695 | ||
699 | dev->ctl_req = usb_buffer_alloc(udev, sizeof(*(dev->ctl_req)), | 696 | dev->ctl_req = kmalloc(sizeof(*(dev->ctl_req)), GFP_KERNEL); |
700 | GFP_KERNEL, &dev->ctl_req_dma); | ||
701 | if (!dev->ctl_req) | 697 | if (!dev->ctl_req) |
702 | goto err_out; | 698 | goto err_out; |
703 | 699 | ||
@@ -735,10 +731,8 @@ static int cm109_usb_probe(struct usb_interface *intf, | |||
735 | usb_fill_control_urb(dev->urb_ctl, udev, usb_sndctrlpipe(udev, 0), | 731 | usb_fill_control_urb(dev->urb_ctl, udev, usb_sndctrlpipe(udev, 0), |
736 | (void *)dev->ctl_req, dev->ctl_data, USB_PKT_LEN, | 732 | (void *)dev->ctl_req, dev->ctl_data, USB_PKT_LEN, |
737 | cm109_urb_ctl_callback, dev); | 733 | cm109_urb_ctl_callback, dev); |
738 | dev->urb_ctl->setup_dma = dev->ctl_req_dma; | ||
739 | dev->urb_ctl->transfer_dma = dev->ctl_dma; | 734 | dev->urb_ctl->transfer_dma = dev->ctl_dma; |
740 | dev->urb_ctl->transfer_flags |= URB_NO_SETUP_DMA_MAP | | 735 | dev->urb_ctl->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
741 | URB_NO_TRANSFER_DMA_MAP; | ||
742 | dev->urb_ctl->dev = udev; | 736 | dev->urb_ctl->dev = udev; |
743 | 737 | ||
744 | /* find out the physical bus location */ | 738 | /* find out the physical bus location */ |
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c index 668913d12044..7ba4b5f53fc2 100644 --- a/drivers/input/misc/powermate.c +++ b/drivers/input/misc/powermate.c | |||
@@ -64,7 +64,6 @@ struct powermate_device { | |||
64 | dma_addr_t data_dma; | 64 | dma_addr_t data_dma; |
65 | struct urb *irq, *config; | 65 | struct urb *irq, *config; |
66 | struct usb_ctrlrequest *configcr; | 66 | struct usb_ctrlrequest *configcr; |
67 | dma_addr_t configcr_dma; | ||
68 | struct usb_device *udev; | 67 | struct usb_device *udev; |
69 | struct input_dev *input; | 68 | struct input_dev *input; |
70 | spinlock_t lock; | 69 | spinlock_t lock; |
@@ -182,8 +181,6 @@ static void powermate_sync_state(struct powermate_device *pm) | |||
182 | usb_fill_control_urb(pm->config, pm->udev, usb_sndctrlpipe(pm->udev, 0), | 181 | usb_fill_control_urb(pm->config, pm->udev, usb_sndctrlpipe(pm->udev, 0), |
183 | (void *) pm->configcr, NULL, 0, | 182 | (void *) pm->configcr, NULL, 0, |
184 | powermate_config_complete, pm); | 183 | powermate_config_complete, pm); |
185 | pm->config->setup_dma = pm->configcr_dma; | ||
186 | pm->config->transfer_flags |= URB_NO_SETUP_DMA_MAP; | ||
187 | 184 | ||
188 | if (usb_submit_urb(pm->config, GFP_ATOMIC)) | 185 | if (usb_submit_urb(pm->config, GFP_ATOMIC)) |
189 | printk(KERN_ERR "powermate: usb_submit_urb(config) failed"); | 186 | printk(KERN_ERR "powermate: usb_submit_urb(config) failed"); |
@@ -281,8 +278,7 @@ static int powermate_alloc_buffers(struct usb_device *udev, struct powermate_dev | |||
281 | if (!pm->data) | 278 | if (!pm->data) |
282 | return -1; | 279 | return -1; |
283 | 280 | ||
284 | pm->configcr = usb_buffer_alloc(udev, sizeof(*(pm->configcr)), | 281 | pm->configcr = kmalloc(sizeof(*(pm->configcr)), GFP_KERNEL); |
285 | GFP_ATOMIC, &pm->configcr_dma); | ||
286 | if (!pm->configcr) | 282 | if (!pm->configcr) |
287 | return -1; | 283 | return -1; |
288 | 284 | ||
@@ -293,8 +289,7 @@ static void powermate_free_buffers(struct usb_device *udev, struct powermate_dev | |||
293 | { | 289 | { |
294 | usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX, | 290 | usb_buffer_free(udev, POWERMATE_PAYLOAD_SIZE_MAX, |
295 | pm->data, pm->data_dma); | 291 | pm->data, pm->data_dma); |
296 | usb_buffer_free(udev, sizeof(*(pm->configcr)), | 292 | kfree(pm->configcr); |
297 | pm->configcr, pm->configcr_dma); | ||
298 | } | 293 | } |
299 | 294 | ||
300 | /* Called whenever a USB device matching one in our supported devices table is connected */ | 295 | /* Called whenever a USB device matching one in our supported devices table is connected */ |
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c index 93a22ac0f88c..2828328e9dd0 100644 --- a/drivers/input/misc/yealink.c +++ b/drivers/input/misc/yealink.c | |||
@@ -111,7 +111,6 @@ struct yealink_dev { | |||
111 | struct yld_ctl_packet *ctl_data; | 111 | struct yld_ctl_packet *ctl_data; |
112 | dma_addr_t ctl_dma; | 112 | dma_addr_t ctl_dma; |
113 | struct usb_ctrlrequest *ctl_req; | 113 | struct usb_ctrlrequest *ctl_req; |
114 | dma_addr_t ctl_req_dma; | ||
115 | struct urb *urb_ctl; | 114 | struct urb *urb_ctl; |
116 | 115 | ||
117 | char phys[64]; /* physical device path */ | 116 | char phys[64]; /* physical device path */ |
@@ -836,8 +835,7 @@ static int usb_cleanup(struct yealink_dev *yld, int err) | |||
836 | usb_free_urb(yld->urb_irq); | 835 | usb_free_urb(yld->urb_irq); |
837 | usb_free_urb(yld->urb_ctl); | 836 | usb_free_urb(yld->urb_ctl); |
838 | 837 | ||
839 | usb_buffer_free(yld->udev, sizeof(*(yld->ctl_req)), | 838 | kfree(yld->ctl_req); |
840 | yld->ctl_req, yld->ctl_req_dma); | ||
841 | usb_buffer_free(yld->udev, USB_PKT_LEN, | 839 | usb_buffer_free(yld->udev, USB_PKT_LEN, |
842 | yld->ctl_data, yld->ctl_dma); | 840 | yld->ctl_data, yld->ctl_dma); |
843 | usb_buffer_free(yld->udev, USB_PKT_LEN, | 841 | usb_buffer_free(yld->udev, USB_PKT_LEN, |
@@ -896,8 +894,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
896 | if (!yld->ctl_data) | 894 | if (!yld->ctl_data) |
897 | return usb_cleanup(yld, -ENOMEM); | 895 | return usb_cleanup(yld, -ENOMEM); |
898 | 896 | ||
899 | yld->ctl_req = usb_buffer_alloc(udev, sizeof(*(yld->ctl_req)), | 897 | yld->ctl_req = kmalloc(sizeof(*(yld->ctl_req)), GFP_KERNEL); |
900 | GFP_ATOMIC, &yld->ctl_req_dma); | ||
901 | if (yld->ctl_req == NULL) | 898 | if (yld->ctl_req == NULL) |
902 | return usb_cleanup(yld, -ENOMEM); | 899 | return usb_cleanup(yld, -ENOMEM); |
903 | 900 | ||
@@ -936,10 +933,8 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
936 | usb_fill_control_urb(yld->urb_ctl, udev, usb_sndctrlpipe(udev, 0), | 933 | usb_fill_control_urb(yld->urb_ctl, udev, usb_sndctrlpipe(udev, 0), |
937 | (void *)yld->ctl_req, yld->ctl_data, USB_PKT_LEN, | 934 | (void *)yld->ctl_req, yld->ctl_data, USB_PKT_LEN, |
938 | urb_ctl_callback, yld); | 935 | urb_ctl_callback, yld); |
939 | yld->urb_ctl->setup_dma = yld->ctl_req_dma; | ||
940 | yld->urb_ctl->transfer_dma = yld->ctl_dma; | 936 | yld->urb_ctl->transfer_dma = yld->ctl_dma; |
941 | yld->urb_ctl->transfer_flags |= URB_NO_SETUP_DMA_MAP | | 937 | yld->urb_ctl->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
942 | URB_NO_TRANSFER_DMA_MAP; | ||
943 | yld->urb_ctl->dev = udev; | 938 | yld->urb_ctl->dev = udev; |
944 | 939 | ||
945 | /* find out the physical bus location */ | 940 | /* find out the physical bus location */ |
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 09301f4b7225..2532a0917f8c 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -396,8 +396,8 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
396 | return -EPIPE; /* The most suitable error code :-) */ | 396 | return -EPIPE; /* The most suitable error code :-) */ |
397 | 397 | ||
398 | /* enforce simple/standard policy */ | 398 | /* enforce simple/standard policy */ |
399 | allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP | | 399 | allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK | |
400 | URB_NO_INTERRUPT | URB_DIR_MASK | URB_FREE_BUFFER); | 400 | URB_FREE_BUFFER); |
401 | switch (xfertype) { | 401 | switch (xfertype) { |
402 | case USB_ENDPOINT_XFER_BULK: | 402 | case USB_ENDPOINT_XFER_BULK: |
403 | if (is_out) | 403 | if (is_out) |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 1088abb4416c..097172e2ba06 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -775,7 +775,7 @@ EXPORT_SYMBOL_GPL(usb_free_coherent); | |||
775 | * @urb: urb whose transfer_buffer/setup_packet will be mapped | 775 | * @urb: urb whose transfer_buffer/setup_packet will be mapped |
776 | * | 776 | * |
777 | * Return value is either null (indicating no buffer could be mapped), or | 777 | * Return value is either null (indicating no buffer could be mapped), or |
778 | * the parameter. URB_NO_TRANSFER_DMA_MAP and URB_NO_SETUP_DMA_MAP are | 778 | * the parameter. URB_NO_TRANSFER_DMA_MAP is |
779 | * added to urb->transfer_flags if the operation succeeds. If the device | 779 | * added to urb->transfer_flags if the operation succeeds. If the device |
780 | * is connected to this system through a non-DMA controller, this operation | 780 | * is connected to this system through a non-DMA controller, this operation |
781 | * always succeeds. | 781 | * always succeeds. |
@@ -803,17 +803,11 @@ struct urb *usb_buffer_map(struct urb *urb) | |||
803 | urb->transfer_buffer, urb->transfer_buffer_length, | 803 | urb->transfer_buffer, urb->transfer_buffer_length, |
804 | usb_pipein(urb->pipe) | 804 | usb_pipein(urb->pipe) |
805 | ? DMA_FROM_DEVICE : DMA_TO_DEVICE); | 805 | ? DMA_FROM_DEVICE : DMA_TO_DEVICE); |
806 | if (usb_pipecontrol(urb->pipe)) | ||
807 | urb->setup_dma = dma_map_single(controller, | ||
808 | urb->setup_packet, | ||
809 | sizeof(struct usb_ctrlrequest), | ||
810 | DMA_TO_DEVICE); | ||
811 | /* FIXME generic api broken like pci, can't report errors */ | 806 | /* FIXME generic api broken like pci, can't report errors */ |
812 | /* if (urb->transfer_dma == DMA_ADDR_INVALID) return 0; */ | 807 | /* if (urb->transfer_dma == DMA_ADDR_INVALID) return 0; */ |
813 | } else | 808 | } else |
814 | urb->transfer_dma = ~0; | 809 | urb->transfer_dma = ~0; |
815 | urb->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | 810 | urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
816 | | URB_NO_SETUP_DMA_MAP); | ||
817 | return urb; | 811 | return urb; |
818 | } | 812 | } |
819 | EXPORT_SYMBOL_GPL(usb_buffer_map); | 813 | EXPORT_SYMBOL_GPL(usb_buffer_map); |
@@ -881,14 +875,8 @@ void usb_buffer_unmap(struct urb *urb) | |||
881 | urb->transfer_dma, urb->transfer_buffer_length, | 875 | urb->transfer_dma, urb->transfer_buffer_length, |
882 | usb_pipein(urb->pipe) | 876 | usb_pipein(urb->pipe) |
883 | ? DMA_FROM_DEVICE : DMA_TO_DEVICE); | 877 | ? DMA_FROM_DEVICE : DMA_TO_DEVICE); |
884 | if (usb_pipecontrol(urb->pipe)) | ||
885 | dma_unmap_single(controller, | ||
886 | urb->setup_dma, | ||
887 | sizeof(struct usb_ctrlrequest), | ||
888 | DMA_TO_DEVICE); | ||
889 | } | 878 | } |
890 | urb->transfer_flags &= ~(URB_NO_TRANSFER_DMA_MAP | 879 | urb->transfer_flags &= ~URB_NO_TRANSFER_DMA_MAP; |
891 | | URB_NO_SETUP_DMA_MAP); | ||
892 | } | 880 | } |
893 | EXPORT_SYMBOL_GPL(usb_buffer_unmap); | 881 | EXPORT_SYMBOL_GPL(usb_buffer_unmap); |
894 | #endif /* 0 */ | 882 | #endif /* 0 */ |
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index a21cce6f7403..9dcc82337ced 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c | |||
@@ -977,15 +977,13 @@ test_ctrl_queue (struct usbtest_dev *dev, struct usbtest_param *param) | |||
977 | if (!u) | 977 | if (!u) |
978 | goto cleanup; | 978 | goto cleanup; |
979 | 979 | ||
980 | reqp = usb_buffer_alloc (udev, sizeof *reqp, GFP_KERNEL, | 980 | reqp = kmalloc(sizeof *reqp, GFP_KERNEL); |
981 | &u->setup_dma); | ||
982 | if (!reqp) | 981 | if (!reqp) |
983 | goto cleanup; | 982 | goto cleanup; |
984 | reqp->setup = req; | 983 | reqp->setup = req; |
985 | reqp->number = i % NUM_SUBCASES; | 984 | reqp->number = i % NUM_SUBCASES; |
986 | reqp->expected = expected; | 985 | reqp->expected = expected; |
987 | u->setup_packet = (char *) &reqp->setup; | 986 | u->setup_packet = (char *) &reqp->setup; |
988 | u->transfer_flags |= URB_NO_SETUP_DMA_MAP; | ||
989 | 987 | ||
990 | u->context = &context; | 988 | u->context = &context; |
991 | u->complete = ctrl_complete; | 989 | u->complete = ctrl_complete; |
@@ -1017,10 +1015,7 @@ cleanup: | |||
1017 | if (!urb [i]) | 1015 | if (!urb [i]) |
1018 | continue; | 1016 | continue; |
1019 | urb [i]->dev = udev; | 1017 | urb [i]->dev = udev; |
1020 | if (urb [i]->setup_packet) | 1018 | kfree(urb[i]->setup_packet); |
1021 | usb_buffer_free (udev, sizeof (struct usb_ctrlrequest), | ||
1022 | urb [i]->setup_packet, | ||
1023 | urb [i]->setup_dma); | ||
1024 | simple_free_urb (urb [i]); | 1019 | simple_free_urb (urb [i]); |
1025 | } | 1020 | } |
1026 | kfree (urb); | 1021 | kfree (urb); |
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index f253edec3bb8..44716427c51c 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c | |||
@@ -147,11 +147,9 @@ static int usb_stor_msg_common(struct us_data *us, int timeout) | |||
147 | * hasn't been mapped for DMA. Yes, this is clunky, but it's | 147 | * hasn't been mapped for DMA. Yes, this is clunky, but it's |
148 | * easier than always having the caller tell us whether the | 148 | * easier than always having the caller tell us whether the |
149 | * transfer buffer has already been mapped. */ | 149 | * transfer buffer has already been mapped. */ |
150 | us->current_urb->transfer_flags = URB_NO_SETUP_DMA_MAP; | ||
151 | if (us->current_urb->transfer_buffer == us->iobuf) | 150 | if (us->current_urb->transfer_buffer == us->iobuf) |
152 | us->current_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | 151 | us->current_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
153 | us->current_urb->transfer_dma = us->iobuf_dma; | 152 | us->current_urb->transfer_dma = us->iobuf_dma; |
154 | us->current_urb->setup_dma = us->cr_dma; | ||
155 | 153 | ||
156 | /* submit the URB */ | 154 | /* submit the URB */ |
157 | status = usb_submit_urb(us->current_urb, GFP_NOIO); | 155 | status = usb_submit_urb(us->current_urb, GFP_NOIO); |
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index bbeeb92a2131..c54a370c76c5 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
@@ -407,9 +407,8 @@ static int associate_dev(struct us_data *us, struct usb_interface *intf) | |||
407 | /* Store our private data in the interface */ | 407 | /* Store our private data in the interface */ |
408 | usb_set_intfdata(intf, us); | 408 | usb_set_intfdata(intf, us); |
409 | 409 | ||
410 | /* Allocate the device-related DMA-mapped buffers */ | 410 | /* Allocate the control/setup and DMA-mapped buffers */ |
411 | us->cr = usb_buffer_alloc(us->pusb_dev, sizeof(*us->cr), | 411 | us->cr = kmalloc(sizeof(*us->cr), GFP_KERNEL); |
412 | GFP_KERNEL, &us->cr_dma); | ||
413 | if (!us->cr) { | 412 | if (!us->cr) { |
414 | US_DEBUGP("usb_ctrlrequest allocation failed\n"); | 413 | US_DEBUGP("usb_ctrlrequest allocation failed\n"); |
415 | return -ENOMEM; | 414 | return -ENOMEM; |
@@ -757,13 +756,9 @@ static void dissociate_dev(struct us_data *us) | |||
757 | { | 756 | { |
758 | US_DEBUGP("-- %s\n", __func__); | 757 | US_DEBUGP("-- %s\n", __func__); |
759 | 758 | ||
760 | /* Free the device-related DMA-mapped buffers */ | 759 | /* Free the buffers */ |
761 | if (us->cr) | 760 | kfree(us->cr); |
762 | usb_buffer_free(us->pusb_dev, sizeof(*us->cr), us->cr, | 761 | usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf, us->iobuf_dma); |
763 | us->cr_dma); | ||
764 | if (us->iobuf) | ||
765 | usb_buffer_free(us->pusb_dev, US_IOBUF_SIZE, us->iobuf, | ||
766 | us->iobuf_dma); | ||
767 | 762 | ||
768 | /* Remove our private data from the interface */ | 763 | /* Remove our private data from the interface */ |
769 | usb_set_intfdata(us->pusb_intf, NULL); | 764 | usb_set_intfdata(us->pusb_intf, NULL); |
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h index 69717134231b..89d3bfff98df 100644 --- a/drivers/usb/storage/usb.h +++ b/drivers/usb/storage/usb.h | |||
@@ -139,8 +139,7 @@ struct us_data { | |||
139 | struct usb_ctrlrequest *cr; /* control requests */ | 139 | struct usb_ctrlrequest *cr; /* control requests */ |
140 | struct usb_sg_request current_sg; /* scatter-gather req. */ | 140 | struct usb_sg_request current_sg; /* scatter-gather req. */ |
141 | unsigned char *iobuf; /* I/O buffer */ | 141 | unsigned char *iobuf; /* I/O buffer */ |
142 | dma_addr_t cr_dma; /* buffer DMA addresses */ | 142 | dma_addr_t iobuf_dma; /* buffer DMA addresses */ |
143 | dma_addr_t iobuf_dma; | ||
144 | struct task_struct *ctl_thread; /* the control thread */ | 143 | struct task_struct *ctl_thread; /* the control thread */ |
145 | 144 | ||
146 | /* mutual exclusion and synchronization structures */ | 145 | /* mutual exclusion and synchronization structures */ |
diff --git a/drivers/usb/wusbcore/wa-xfer.c b/drivers/usb/wusbcore/wa-xfer.c index 112ef7e26f6b..2ce6b7eccc6a 100644 --- a/drivers/usb/wusbcore/wa-xfer.c +++ b/drivers/usb/wusbcore/wa-xfer.c | |||
@@ -474,8 +474,6 @@ static void __wa_xfer_setup_hdr0(struct wa_xfer *xfer, | |||
474 | struct wa_xfer_ctl *xfer_ctl = | 474 | struct wa_xfer_ctl *xfer_ctl = |
475 | container_of(xfer_hdr0, struct wa_xfer_ctl, hdr); | 475 | container_of(xfer_hdr0, struct wa_xfer_ctl, hdr); |
476 | xfer_ctl->bmAttribute = xfer->is_inbound ? 1 : 0; | 476 | xfer_ctl->bmAttribute = xfer->is_inbound ? 1 : 0; |
477 | BUG_ON(xfer->urb->transfer_flags & URB_NO_SETUP_DMA_MAP | ||
478 | && xfer->urb->setup_packet == NULL); | ||
479 | memcpy(&xfer_ctl->baSetupData, xfer->urb->setup_packet, | 477 | memcpy(&xfer_ctl->baSetupData, xfer->urb->setup_packet, |
480 | sizeof(xfer_ctl->baSetupData)); | 478 | sizeof(xfer_ctl->baSetupData)); |
481 | break; | 479 | break; |