diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-12-20 04:54:54 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-12-20 04:54:54 -0500 |
commit | 93b8eef1c098efbea2f1fc0be7e3c681f259a7e7 (patch) | |
tree | 462cc8c2bc07bbc825dab2a200891a28d8643329 /drivers/usb | |
parent | a2d781fc8d9b16113dd9440107d73c0f21d7cbef (diff) | |
parent | 929096fe9ff1f4b3645cf3919527ab47e8d5e17c (diff) |
Merge commit 'v2.6.28-rc9' into next
Diffstat (limited to 'drivers/usb')
45 files changed, 419 insertions, 199 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 20104443081a..d50a99f70aee 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -158,16 +158,12 @@ static int acm_wb_is_avail(struct acm *acm) | |||
158 | } | 158 | } |
159 | 159 | ||
160 | /* | 160 | /* |
161 | * Finish write. | 161 | * Finish write. Caller must hold acm->write_lock |
162 | */ | 162 | */ |
163 | static void acm_write_done(struct acm *acm, struct acm_wb *wb) | 163 | static void acm_write_done(struct acm *acm, struct acm_wb *wb) |
164 | { | 164 | { |
165 | unsigned long flags; | ||
166 | |||
167 | spin_lock_irqsave(&acm->write_lock, flags); | ||
168 | wb->use = 0; | 165 | wb->use = 0; |
169 | acm->transmitting--; | 166 | acm->transmitting--; |
170 | spin_unlock_irqrestore(&acm->write_lock, flags); | ||
171 | } | 167 | } |
172 | 168 | ||
173 | /* | 169 | /* |
@@ -482,6 +478,7 @@ static void acm_write_bulk(struct urb *urb) | |||
482 | { | 478 | { |
483 | struct acm_wb *wb = urb->context; | 479 | struct acm_wb *wb = urb->context; |
484 | struct acm *acm = wb->instance; | 480 | struct acm *acm = wb->instance; |
481 | unsigned long flags; | ||
485 | 482 | ||
486 | if (verbose || urb->status | 483 | if (verbose || urb->status |
487 | || (urb->actual_length != urb->transfer_buffer_length)) | 484 | || (urb->actual_length != urb->transfer_buffer_length)) |
@@ -490,7 +487,9 @@ static void acm_write_bulk(struct urb *urb) | |||
490 | urb->transfer_buffer_length, | 487 | urb->transfer_buffer_length, |
491 | urb->status); | 488 | urb->status); |
492 | 489 | ||
490 | spin_lock_irqsave(&acm->write_lock, flags); | ||
493 | acm_write_done(acm, wb); | 491 | acm_write_done(acm, wb); |
492 | spin_unlock_irqrestore(&acm->write_lock, flags); | ||
494 | if (ACM_READY(acm)) | 493 | if (ACM_READY(acm)) |
495 | schedule_work(&acm->work); | 494 | schedule_work(&acm->work); |
496 | else | 495 | else |
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 543811f6e6e8..43a863c5cc43 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -51,6 +51,7 @@ static struct usb_device_id usbtmc_devices[] = { | |||
51 | { USB_INTERFACE_INFO(USB_CLASS_APP_SPEC, 3, 0), }, | 51 | { USB_INTERFACE_INFO(USB_CLASS_APP_SPEC, 3, 0), }, |
52 | { 0, } /* terminating entry */ | 52 | { 0, } /* terminating entry */ |
53 | }; | 53 | }; |
54 | MODULE_DEVICE_TABLE(usb, usbtmc_devices); | ||
54 | 55 | ||
55 | /* | 56 | /* |
56 | * This structure is the capabilities for the device | 57 | * This structure is the capabilities for the device |
@@ -133,7 +134,7 @@ static int usbtmc_release(struct inode *inode, struct file *file) | |||
133 | 134 | ||
134 | static int usbtmc_ioctl_abort_bulk_in(struct usbtmc_device_data *data) | 135 | static int usbtmc_ioctl_abort_bulk_in(struct usbtmc_device_data *data) |
135 | { | 136 | { |
136 | char *buffer; | 137 | u8 *buffer; |
137 | struct device *dev; | 138 | struct device *dev; |
138 | int rv; | 139 | int rv; |
139 | int n; | 140 | int n; |
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 3d7793d93031..8c081308b0e2 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -279,7 +279,9 @@ static int usb_unbind_interface(struct device *dev) | |||
279 | * altsetting means creating new endpoint device entries). | 279 | * altsetting means creating new endpoint device entries). |
280 | * When either of these happens, defer the Set-Interface. | 280 | * When either of these happens, defer the Set-Interface. |
281 | */ | 281 | */ |
282 | if (!error && intf->dev.power.status == DPM_ON) | 282 | if (intf->cur_altsetting->desc.bAlternateSetting == 0) |
283 | ; /* Already in altsetting 0 so skip Set-Interface */ | ||
284 | else if (!error && intf->dev.power.status == DPM_ON) | ||
283 | usb_set_interface(udev, intf->altsetting[0]. | 285 | usb_set_interface(udev, intf->altsetting[0]. |
284 | desc.bInterfaceNumber, 0); | 286 | desc.bInterfaceNumber, 0); |
285 | else | 287 | else |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index fc9018e72a09..e1b42626d04d 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -106,6 +106,9 @@ static DEFINE_SPINLOCK(hcd_root_hub_lock); | |||
106 | /* used when updating an endpoint's URB list */ | 106 | /* used when updating an endpoint's URB list */ |
107 | static DEFINE_SPINLOCK(hcd_urb_list_lock); | 107 | static DEFINE_SPINLOCK(hcd_urb_list_lock); |
108 | 108 | ||
109 | /* used to protect against unlinking URBs after the device is gone */ | ||
110 | static DEFINE_SPINLOCK(hcd_urb_unlink_lock); | ||
111 | |||
109 | /* wait queue for synchronous unlinks */ | 112 | /* wait queue for synchronous unlinks */ |
110 | DECLARE_WAIT_QUEUE_HEAD(usb_kill_urb_queue); | 113 | DECLARE_WAIT_QUEUE_HEAD(usb_kill_urb_queue); |
111 | 114 | ||
@@ -1376,10 +1379,25 @@ static int unlink1(struct usb_hcd *hcd, struct urb *urb, int status) | |||
1376 | int usb_hcd_unlink_urb (struct urb *urb, int status) | 1379 | int usb_hcd_unlink_urb (struct urb *urb, int status) |
1377 | { | 1380 | { |
1378 | struct usb_hcd *hcd; | 1381 | struct usb_hcd *hcd; |
1379 | int retval; | 1382 | int retval = -EIDRM; |
1383 | unsigned long flags; | ||
1380 | 1384 | ||
1381 | hcd = bus_to_hcd(urb->dev->bus); | 1385 | /* Prevent the device and bus from going away while |
1382 | retval = unlink1(hcd, urb, status); | 1386 | * the unlink is carried out. If they are already gone |
1387 | * then urb->use_count must be 0, since disconnected | ||
1388 | * devices can't have any active URBs. | ||
1389 | */ | ||
1390 | spin_lock_irqsave(&hcd_urb_unlink_lock, flags); | ||
1391 | if (atomic_read(&urb->use_count) > 0) { | ||
1392 | retval = 0; | ||
1393 | usb_get_dev(urb->dev); | ||
1394 | } | ||
1395 | spin_unlock_irqrestore(&hcd_urb_unlink_lock, flags); | ||
1396 | if (retval == 0) { | ||
1397 | hcd = bus_to_hcd(urb->dev->bus); | ||
1398 | retval = unlink1(hcd, urb, status); | ||
1399 | usb_put_dev(urb->dev); | ||
1400 | } | ||
1383 | 1401 | ||
1384 | if (retval == 0) | 1402 | if (retval == 0) |
1385 | retval = -EINPROGRESS; | 1403 | retval = -EINPROGRESS; |
@@ -1528,6 +1546,17 @@ void usb_hcd_disable_endpoint(struct usb_device *udev, | |||
1528 | hcd->driver->endpoint_disable(hcd, ep); | 1546 | hcd->driver->endpoint_disable(hcd, ep); |
1529 | } | 1547 | } |
1530 | 1548 | ||
1549 | /* Protect against drivers that try to unlink URBs after the device | ||
1550 | * is gone, by waiting until all unlinks for @udev are finished. | ||
1551 | * Since we don't currently track URBs by device, simply wait until | ||
1552 | * nothing is running in the locked region of usb_hcd_unlink_urb(). | ||
1553 | */ | ||
1554 | void usb_hcd_synchronize_unlinks(struct usb_device *udev) | ||
1555 | { | ||
1556 | spin_lock_irq(&hcd_urb_unlink_lock); | ||
1557 | spin_unlock_irq(&hcd_urb_unlink_lock); | ||
1558 | } | ||
1559 | |||
1531 | /*-------------------------------------------------------------------------*/ | 1560 | /*-------------------------------------------------------------------------*/ |
1532 | 1561 | ||
1533 | /* called in any context */ | 1562 | /* called in any context */ |
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index 2dcde61c465e..9465e70f4dd0 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h | |||
@@ -232,6 +232,7 @@ extern void usb_hcd_flush_endpoint(struct usb_device *udev, | |||
232 | struct usb_host_endpoint *ep); | 232 | struct usb_host_endpoint *ep); |
233 | extern void usb_hcd_disable_endpoint(struct usb_device *udev, | 233 | extern void usb_hcd_disable_endpoint(struct usb_device *udev, |
234 | struct usb_host_endpoint *ep); | 234 | struct usb_host_endpoint *ep); |
235 | extern void usb_hcd_synchronize_unlinks(struct usb_device *udev); | ||
235 | extern int usb_hcd_get_frame_number(struct usb_device *udev); | 236 | extern int usb_hcd_get_frame_number(struct usb_device *udev); |
236 | 237 | ||
237 | extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, | 238 | extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 9b3f16bd12cb..b19cbfcd51da 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -659,6 +659,9 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) | |||
659 | PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func2); | 659 | PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func2); |
660 | schedule_delayed_work(&hub->init_work, | 660 | schedule_delayed_work(&hub->init_work, |
661 | msecs_to_jiffies(delay)); | 661 | msecs_to_jiffies(delay)); |
662 | |||
663 | /* Suppress autosuspend until init is done */ | ||
664 | to_usb_interface(hub->intfdev)->pm_usage_cnt = 1; | ||
662 | return; /* Continues at init2: below */ | 665 | return; /* Continues at init2: below */ |
663 | } else { | 666 | } else { |
664 | hub_power_on(hub, true); | 667 | hub_power_on(hub, true); |
@@ -1429,6 +1432,7 @@ void usb_disconnect(struct usb_device **pdev) | |||
1429 | */ | 1432 | */ |
1430 | dev_dbg (&udev->dev, "unregistering device\n"); | 1433 | dev_dbg (&udev->dev, "unregistering device\n"); |
1431 | usb_disable_device(udev, 0); | 1434 | usb_disable_device(udev, 0); |
1435 | usb_hcd_synchronize_unlinks(udev); | ||
1432 | 1436 | ||
1433 | usb_unlock_device(udev); | 1437 | usb_unlock_device(udev); |
1434 | 1438 | ||
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 887738577b28..6d1048faf08e 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1091,6 +1091,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) | |||
1091 | continue; | 1091 | continue; |
1092 | dev_dbg(&dev->dev, "unregistering interface %s\n", | 1092 | dev_dbg(&dev->dev, "unregistering interface %s\n", |
1093 | dev_name(&interface->dev)); | 1093 | dev_name(&interface->dev)); |
1094 | interface->unregistering = 1; | ||
1094 | usb_remove_sysfs_intf_files(interface); | 1095 | usb_remove_sysfs_intf_files(interface); |
1095 | device_del(&interface->dev); | 1096 | device_del(&interface->dev); |
1096 | } | 1097 | } |
diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index f66fba11fbd5..4fb65fdc9dc3 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c | |||
@@ -840,7 +840,7 @@ int usb_create_sysfs_intf_files(struct usb_interface *intf) | |||
840 | struct usb_host_interface *alt = intf->cur_altsetting; | 840 | struct usb_host_interface *alt = intf->cur_altsetting; |
841 | int retval; | 841 | int retval; |
842 | 842 | ||
843 | if (intf->sysfs_files_created) | 843 | if (intf->sysfs_files_created || intf->unregistering) |
844 | return 0; | 844 | return 0; |
845 | 845 | ||
846 | /* The interface string may be present in some altsettings | 846 | /* The interface string may be present in some altsettings |
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index f2638009a464..1f68af9db3f7 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -85,8 +85,8 @@ EXPORT_SYMBOL_GPL(usb_alloc_urb); | |||
85 | * Must be called when a user of a urb is finished with it. When the last user | 85 | * Must be called when a user of a urb is finished with it. When the last user |
86 | * of the urb calls this function, the memory of the urb is freed. | 86 | * of the urb calls this function, the memory of the urb is freed. |
87 | * | 87 | * |
88 | * Note: The transfer buffer associated with the urb is not freed, that must be | 88 | * Note: The transfer buffer associated with the urb is not freed unless the |
89 | * done elsewhere. | 89 | * URB_FREE_BUFFER transfer flag is set. |
90 | */ | 90 | */ |
91 | void usb_free_urb(struct urb *urb) | 91 | void usb_free_urb(struct urb *urb) |
92 | { | 92 | { |
@@ -474,6 +474,12 @@ EXPORT_SYMBOL_GPL(usb_submit_urb); | |||
474 | * indicating that the request has been canceled (rather than any other | 474 | * indicating that the request has been canceled (rather than any other |
475 | * code). | 475 | * code). |
476 | * | 476 | * |
477 | * Drivers should not call this routine or related routines, such as | ||
478 | * usb_kill_urb() or usb_unlink_anchored_urbs(), after their disconnect | ||
479 | * method has returned. The disconnect function should synchronize with | ||
480 | * a driver's I/O routines to insure that all URB-related activity has | ||
481 | * completed before it returns. | ||
482 | * | ||
477 | * This request is always asynchronous. Success is indicated by | 483 | * This request is always asynchronous. Success is indicated by |
478 | * returning -EINPROGRESS, at which time the URB will probably not yet | 484 | * returning -EINPROGRESS, at which time the URB will probably not yet |
479 | * have been given back to the device driver. When it is eventually | 485 | * have been given back to the device driver. When it is eventually |
@@ -550,6 +556,9 @@ EXPORT_SYMBOL_GPL(usb_unlink_urb); | |||
550 | * This routine may not be used in an interrupt context (such as a bottom | 556 | * This routine may not be used in an interrupt context (such as a bottom |
551 | * half or a completion handler), or when holding a spinlock, or in other | 557 | * half or a completion handler), or when holding a spinlock, or in other |
552 | * situations where the caller can't schedule(). | 558 | * situations where the caller can't schedule(). |
559 | * | ||
560 | * This routine should not be called by a driver after its disconnect | ||
561 | * method has returned. | ||
553 | */ | 562 | */ |
554 | void usb_kill_urb(struct urb *urb) | 563 | void usb_kill_urb(struct urb *urb) |
555 | { | 564 | { |
@@ -588,6 +597,9 @@ EXPORT_SYMBOL_GPL(usb_kill_urb); | |||
588 | * This routine may not be used in an interrupt context (such as a bottom | 597 | * This routine may not be used in an interrupt context (such as a bottom |
589 | * half or a completion handler), or when holding a spinlock, or in other | 598 | * half or a completion handler), or when holding a spinlock, or in other |
590 | * situations where the caller can't schedule(). | 599 | * situations where the caller can't schedule(). |
600 | * | ||
601 | * This routine should not be called by a driver after its disconnect | ||
602 | * method has returned. | ||
591 | */ | 603 | */ |
592 | void usb_poison_urb(struct urb *urb) | 604 | void usb_poison_urb(struct urb *urb) |
593 | { | 605 | { |
@@ -622,6 +634,9 @@ EXPORT_SYMBOL_GPL(usb_unpoison_urb); | |||
622 | * | 634 | * |
623 | * this allows all outstanding URBs to be killed starting | 635 | * this allows all outstanding URBs to be killed starting |
624 | * from the back of the queue | 636 | * from the back of the queue |
637 | * | ||
638 | * This routine should not be called by a driver after its disconnect | ||
639 | * method has returned. | ||
625 | */ | 640 | */ |
626 | void usb_kill_anchored_urbs(struct usb_anchor *anchor) | 641 | void usb_kill_anchored_urbs(struct usb_anchor *anchor) |
627 | { | 642 | { |
@@ -651,6 +666,9 @@ EXPORT_SYMBOL_GPL(usb_kill_anchored_urbs); | |||
651 | * this allows all outstanding URBs to be poisoned starting | 666 | * this allows all outstanding URBs to be poisoned starting |
652 | * from the back of the queue. Newly added URBs will also be | 667 | * from the back of the queue. Newly added URBs will also be |
653 | * poisoned | 668 | * poisoned |
669 | * | ||
670 | * This routine should not be called by a driver after its disconnect | ||
671 | * method has returned. | ||
654 | */ | 672 | */ |
655 | void usb_poison_anchored_urbs(struct usb_anchor *anchor) | 673 | void usb_poison_anchored_urbs(struct usb_anchor *anchor) |
656 | { | 674 | { |
@@ -672,6 +690,7 @@ void usb_poison_anchored_urbs(struct usb_anchor *anchor) | |||
672 | spin_unlock_irq(&anchor->lock); | 690 | spin_unlock_irq(&anchor->lock); |
673 | } | 691 | } |
674 | EXPORT_SYMBOL_GPL(usb_poison_anchored_urbs); | 692 | EXPORT_SYMBOL_GPL(usb_poison_anchored_urbs); |
693 | |||
675 | /** | 694 | /** |
676 | * usb_unlink_anchored_urbs - asynchronously cancel transfer requests en masse | 695 | * usb_unlink_anchored_urbs - asynchronously cancel transfer requests en masse |
677 | * @anchor: anchor the requests are bound to | 696 | * @anchor: anchor the requests are bound to |
@@ -680,6 +699,9 @@ EXPORT_SYMBOL_GPL(usb_poison_anchored_urbs); | |||
680 | * from the back of the queue. This function is asynchronous. | 699 | * from the back of the queue. This function is asynchronous. |
681 | * The unlinking is just tiggered. It may happen after this | 700 | * The unlinking is just tiggered. It may happen after this |
682 | * function has returned. | 701 | * function has returned. |
702 | * | ||
703 | * This routine should not be called by a driver after its disconnect | ||
704 | * method has returned. | ||
683 | */ | 705 | */ |
684 | void usb_unlink_anchored_urbs(struct usb_anchor *anchor) | 706 | void usb_unlink_anchored_urbs(struct usb_anchor *anchor) |
685 | { | 707 | { |
diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c index 5ee1590b8e9c..c1d34df0b157 100644 --- a/drivers/usb/gadget/f_acm.c +++ b/drivers/usb/gadget/f_acm.c | |||
@@ -463,7 +463,11 @@ static int acm_cdc_notify(struct f_acm *acm, u8 type, u16 value, | |||
463 | notify->wLength = cpu_to_le16(length); | 463 | notify->wLength = cpu_to_le16(length); |
464 | memcpy(buf, data, length); | 464 | memcpy(buf, data, length); |
465 | 465 | ||
466 | /* ep_queue() can complete immediately if it fills the fifo... */ | ||
467 | spin_unlock(&acm->lock); | ||
466 | status = usb_ep_queue(ep, req, GFP_ATOMIC); | 468 | status = usb_ep_queue(ep, req, GFP_ATOMIC); |
469 | spin_lock(&acm->lock); | ||
470 | |||
467 | if (status < 0) { | 471 | if (status < 0) { |
468 | ERROR(acm->port.func.config->cdev, | 472 | ERROR(acm->port.func.config->cdev, |
469 | "acm ttyGS%d can't notify serial state, %d\n", | 473 | "acm ttyGS%d can't notify serial state, %d\n", |
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 659b3d9671c4..3a8bb53fc473 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c | |||
@@ -172,7 +172,6 @@ static struct usb_interface_descriptor rndis_data_intf __initdata = { | |||
172 | .bDescriptorType = USB_DT_INTERFACE, | 172 | .bDescriptorType = USB_DT_INTERFACE, |
173 | 173 | ||
174 | /* .bInterfaceNumber = DYNAMIC */ | 174 | /* .bInterfaceNumber = DYNAMIC */ |
175 | .bAlternateSetting = 1, | ||
176 | .bNumEndpoints = 2, | 175 | .bNumEndpoints = 2, |
177 | .bInterfaceClass = USB_CLASS_CDC_DATA, | 176 | .bInterfaceClass = USB_CLASS_CDC_DATA, |
178 | .bInterfaceSubClass = 0, | 177 | .bInterfaceSubClass = 0, |
@@ -303,7 +302,7 @@ static void rndis_response_available(void *_rndis) | |||
303 | __le32 *data = req->buf; | 302 | __le32 *data = req->buf; |
304 | int status; | 303 | int status; |
305 | 304 | ||
306 | if (atomic_inc_return(&rndis->notify_count)) | 305 | if (atomic_inc_return(&rndis->notify_count) != 1) |
307 | return; | 306 | return; |
308 | 307 | ||
309 | /* Send RNDIS RESPONSE_AVAILABLE notification; a | 308 | /* Send RNDIS RESPONSE_AVAILABLE notification; a |
@@ -652,6 +651,8 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f) | |||
652 | fs_in_desc.bEndpointAddress; | 651 | fs_in_desc.bEndpointAddress; |
653 | hs_out_desc.bEndpointAddress = | 652 | hs_out_desc.bEndpointAddress = |
654 | fs_out_desc.bEndpointAddress; | 653 | fs_out_desc.bEndpointAddress; |
654 | hs_notify_desc.bEndpointAddress = | ||
655 | fs_notify_desc.bEndpointAddress; | ||
655 | 656 | ||
656 | /* copy descriptors, and track endpoint copies */ | 657 | /* copy descriptors, and track endpoint copies */ |
657 | f->hs_descriptors = usb_copy_descriptors(eth_hs_function); | 658 | f->hs_descriptors = usb_copy_descriptors(eth_hs_function); |
@@ -663,6 +664,8 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f) | |||
663 | f->hs_descriptors, &hs_in_desc); | 664 | f->hs_descriptors, &hs_in_desc); |
664 | rndis->hs.out = usb_find_endpoint(eth_hs_function, | 665 | rndis->hs.out = usb_find_endpoint(eth_hs_function, |
665 | f->hs_descriptors, &hs_out_desc); | 666 | f->hs_descriptors, &hs_out_desc); |
667 | rndis->hs.notify = usb_find_endpoint(eth_hs_function, | ||
668 | f->hs_descriptors, &hs_notify_desc); | ||
666 | } | 669 | } |
667 | 670 | ||
668 | rndis->port.open = rndis_open; | 671 | rndis->port.open = rndis_open; |
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c index 1fe8b44787b3..b3408ff39fba 100644 --- a/drivers/usb/gadget/fsl_qe_udc.c +++ b/drivers/usb/gadget/fsl_qe_udc.c | |||
@@ -2363,6 +2363,9 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
2363 | nuke(loop_ep, -ESHUTDOWN); | 2363 | nuke(loop_ep, -ESHUTDOWN); |
2364 | spin_unlock_irqrestore(&udc_controller->lock, flags); | 2364 | spin_unlock_irqrestore(&udc_controller->lock, flags); |
2365 | 2365 | ||
2366 | /* report disconnect; the controller is already quiesced */ | ||
2367 | driver->disconnect(&udc_controller->gadget); | ||
2368 | |||
2366 | /* unbind gadget and unhook driver. */ | 2369 | /* unbind gadget and unhook driver. */ |
2367 | driver->unbind(&udc_controller->gadget); | 2370 | driver->unbind(&udc_controller->gadget); |
2368 | udc_controller->gadget.dev.driver = NULL; | 2371 | udc_controller->gadget.dev.driver = NULL; |
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c index 091bb55c9aa7..f3c6703cffda 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.c +++ b/drivers/usb/gadget/fsl_usb2_udc.c | |||
@@ -1836,6 +1836,9 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
1836 | nuke(loop_ep, -ESHUTDOWN); | 1836 | nuke(loop_ep, -ESHUTDOWN); |
1837 | spin_unlock_irqrestore(&udc_controller->lock, flags); | 1837 | spin_unlock_irqrestore(&udc_controller->lock, flags); |
1838 | 1838 | ||
1839 | /* report disconnect; the controller is already quiesced */ | ||
1840 | driver->disconnect(&udc_controller->gadget); | ||
1841 | |||
1839 | /* unbind gadget and unhook driver. */ | 1842 | /* unbind gadget and unhook driver. */ |
1840 | driver->unbind(&udc_controller->gadget); | 1843 | driver->unbind(&udc_controller->gadget); |
1841 | udc_controller->gadget.dev.driver = NULL; | 1844 | udc_controller->gadget.dev.driver = NULL; |
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index f4585d3e90d7..eeb26c0f88e5 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
@@ -1251,7 +1251,6 @@ dev_release (struct inode *inode, struct file *fd) | |||
1251 | * alternatively, all host requests will time out. | 1251 | * alternatively, all host requests will time out. |
1252 | */ | 1252 | */ |
1253 | 1253 | ||
1254 | fasync_helper (-1, fd, 0, &dev->fasync); | ||
1255 | kfree (dev->buf); | 1254 | kfree (dev->buf); |
1256 | dev->buf = NULL; | 1255 | dev->buf = NULL; |
1257 | put_dev (dev); | 1256 | put_dev (dev); |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index da6e93c201d2..2dbc0db0b46c 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -141,7 +141,11 @@ static int is_vbus_present(void) | |||
141 | 141 | ||
142 | if (mach->gpio_vbus) { | 142 | if (mach->gpio_vbus) { |
143 | int value = gpio_get_value(mach->gpio_vbus); | 143 | int value = gpio_get_value(mach->gpio_vbus); |
144 | return mach->gpio_vbus_inverted ? !value : value; | 144 | |
145 | if (mach->gpio_vbus_inverted) | ||
146 | return !value; | ||
147 | else | ||
148 | return !!value; | ||
145 | } | 149 | } |
146 | if (mach->udc_is_connected) | 150 | if (mach->udc_is_connected) |
147 | return mach->udc_is_connected(); | 151 | return mach->udc_is_connected(); |
@@ -982,7 +986,7 @@ static int pxa25x_udc_vbus_session(struct usb_gadget *_gadget, int is_active) | |||
982 | struct pxa25x_udc *udc; | 986 | struct pxa25x_udc *udc; |
983 | 987 | ||
984 | udc = container_of(_gadget, struct pxa25x_udc, gadget); | 988 | udc = container_of(_gadget, struct pxa25x_udc, gadget); |
985 | udc->vbus = (is_active != 0); | 989 | udc->vbus = is_active; |
986 | DMSG("vbus %s\n", is_active ? "supplied" : "inactive"); | 990 | DMSG("vbus %s\n", is_active ? "supplied" : "inactive"); |
987 | pullup(udc); | 991 | pullup(udc); |
988 | return 0; | 992 | return 0; |
@@ -1399,12 +1403,8 @@ lubbock_vbus_irq(int irq, void *_dev) | |||
1399 | static irqreturn_t udc_vbus_irq(int irq, void *_dev) | 1403 | static irqreturn_t udc_vbus_irq(int irq, void *_dev) |
1400 | { | 1404 | { |
1401 | struct pxa25x_udc *dev = _dev; | 1405 | struct pxa25x_udc *dev = _dev; |
1402 | int vbus = gpio_get_value(dev->mach->gpio_vbus); | ||
1403 | 1406 | ||
1404 | if (dev->mach->gpio_vbus_inverted) | 1407 | pxa25x_udc_vbus_session(&dev->gadget, is_vbus_present()); |
1405 | vbus = !vbus; | ||
1406 | |||
1407 | pxa25x_udc_vbus_session(&dev->gadget, vbus); | ||
1408 | return IRQ_HANDLED; | 1408 | return IRQ_HANDLED; |
1409 | } | 1409 | } |
1410 | 1410 | ||
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 56f592dc0b36..f3a75a929e0a 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
@@ -110,29 +110,18 @@ config USB_ISP116X_HCD | |||
110 | 110 | ||
111 | config USB_ISP1760_HCD | 111 | config USB_ISP1760_HCD |
112 | tristate "ISP 1760 HCD support" | 112 | tristate "ISP 1760 HCD support" |
113 | depends on USB && EXPERIMENTAL | 113 | depends on USB && EXPERIMENTAL && (PCI || PPC_OF) |
114 | ---help--- | 114 | ---help--- |
115 | The ISP1760 chip is a USB 2.0 host controller. | 115 | The ISP1760 chip is a USB 2.0 host controller. |
116 | 116 | ||
117 | This driver does not support isochronous transfers or OTG. | 117 | This driver does not support isochronous transfers or OTG. |
118 | This USB controller is usually attached to a non-DMA-Master | ||
119 | capable bus. NXP's eval kit brings this chip on PCI card | ||
120 | where the chip itself is behind a PLB to simulate such | ||
121 | a bus. | ||
118 | 122 | ||
119 | To compile this driver as a module, choose M here: the | 123 | To compile this driver as a module, choose M here: the |
120 | module will be called isp1760-hcd. | 124 | module will be called isp1760. |
121 | |||
122 | config USB_ISP1760_PCI | ||
123 | bool "Support for the PCI bus" | ||
124 | depends on USB_ISP1760_HCD && PCI | ||
125 | ---help--- | ||
126 | Enables support for the device present on the PCI bus. | ||
127 | This should only be required if you happen to have the eval kit from | ||
128 | NXP and you are going to test it. | ||
129 | |||
130 | config USB_ISP1760_OF | ||
131 | bool "Support for the OF platform bus" | ||
132 | depends on USB_ISP1760_HCD && PPC_OF | ||
133 | ---help--- | ||
134 | Enables support for the device present on the PowerPC | ||
135 | OpenFirmware platform bus. | ||
136 | 125 | ||
137 | config USB_OHCI_HCD | 126 | config USB_OHCI_HCD |
138 | tristate "OHCI HCD support" | 127 | tristate "OHCI HCD support" |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 15a803b206b8..4725d15d096f 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -643,7 +643,7 @@ static int ehci_run (struct usb_hcd *hcd) | |||
643 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) | 643 | static irqreturn_t ehci_irq (struct usb_hcd *hcd) |
644 | { | 644 | { |
645 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); | 645 | struct ehci_hcd *ehci = hcd_to_ehci (hcd); |
646 | u32 status, pcd_status = 0, cmd; | 646 | u32 status, masked_status, pcd_status = 0, cmd; |
647 | int bh; | 647 | int bh; |
648 | 648 | ||
649 | spin_lock (&ehci->lock); | 649 | spin_lock (&ehci->lock); |
@@ -656,14 +656,14 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) | |||
656 | goto dead; | 656 | goto dead; |
657 | } | 657 | } |
658 | 658 | ||
659 | status &= INTR_MASK; | 659 | masked_status = status & INTR_MASK; |
660 | if (!status) { /* irq sharing? */ | 660 | if (!masked_status) { /* irq sharing? */ |
661 | spin_unlock(&ehci->lock); | 661 | spin_unlock(&ehci->lock); |
662 | return IRQ_NONE; | 662 | return IRQ_NONE; |
663 | } | 663 | } |
664 | 664 | ||
665 | /* clear (just) interrupts */ | 665 | /* clear (just) interrupts */ |
666 | ehci_writel(ehci, status, &ehci->regs->status); | 666 | ehci_writel(ehci, masked_status, &ehci->regs->status); |
667 | cmd = ehci_readl(ehci, &ehci->regs->command); | 667 | cmd = ehci_readl(ehci, &ehci->regs->command); |
668 | bh = 0; | 668 | bh = 0; |
669 | 669 | ||
@@ -734,18 +734,17 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd) | |||
734 | 734 | ||
735 | /* PCI errors [4.15.2.4] */ | 735 | /* PCI errors [4.15.2.4] */ |
736 | if (unlikely ((status & STS_FATAL) != 0)) { | 736 | if (unlikely ((status & STS_FATAL) != 0)) { |
737 | ehci_err(ehci, "fatal error\n"); | ||
737 | dbg_cmd(ehci, "fatal", cmd); | 738 | dbg_cmd(ehci, "fatal", cmd); |
738 | dbg_status(ehci, "fatal", status); | 739 | dbg_status(ehci, "fatal", status); |
739 | if (status & STS_HALT) { | 740 | ehci_halt(ehci); |
740 | ehci_err (ehci, "fatal error\n"); | ||
741 | dead: | 741 | dead: |
742 | ehci_reset (ehci); | 742 | ehci_reset(ehci); |
743 | ehci_writel(ehci, 0, &ehci->regs->configured_flag); | 743 | ehci_writel(ehci, 0, &ehci->regs->configured_flag); |
744 | /* generic layer kills/unlinks all urbs, then | 744 | /* generic layer kills/unlinks all urbs, then |
745 | * uses ehci_stop to clean up the rest | 745 | * uses ehci_stop to clean up the rest |
746 | */ | 746 | */ |
747 | bh = 1; | 747 | bh = 1; |
748 | } | ||
749 | } | 748 | } |
750 | 749 | ||
751 | if (bh) | 750 | if (bh) |
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index c46a58f9181d..36864f958444 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -66,6 +66,8 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
66 | { | 66 | { |
67 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); | 67 | struct ehci_hcd *ehci = hcd_to_ehci(hcd); |
68 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | 68 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); |
69 | struct pci_dev *p_smbus; | ||
70 | u8 rev; | ||
69 | u32 temp; | 71 | u32 temp; |
70 | int retval; | 72 | int retval; |
71 | 73 | ||
@@ -166,6 +168,28 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
166 | pci_write_config_byte(pdev, 0x4b, tmp | 0x20); | 168 | pci_write_config_byte(pdev, 0x4b, tmp | 0x20); |
167 | } | 169 | } |
168 | break; | 170 | break; |
171 | case PCI_VENDOR_ID_ATI: | ||
172 | /* SB600 and old version of SB700 have a bug in EHCI controller, | ||
173 | * which causes usb devices lose response in some cases. | ||
174 | */ | ||
175 | if ((pdev->device == 0x4386) || (pdev->device == 0x4396)) { | ||
176 | p_smbus = pci_get_device(PCI_VENDOR_ID_ATI, | ||
177 | PCI_DEVICE_ID_ATI_SBX00_SMBUS, | ||
178 | NULL); | ||
179 | if (!p_smbus) | ||
180 | break; | ||
181 | rev = p_smbus->revision; | ||
182 | if ((pdev->device == 0x4386) || (rev == 0x3a) | ||
183 | || (rev == 0x3b)) { | ||
184 | u8 tmp; | ||
185 | ehci_info(ehci, "applying AMD SB600/SB700 USB " | ||
186 | "freeze workaround\n"); | ||
187 | pci_read_config_byte(pdev, 0x53, &tmp); | ||
188 | pci_write_config_byte(pdev, 0x53, tmp | (1<<3)); | ||
189 | } | ||
190 | pci_dev_put(p_smbus); | ||
191 | } | ||
192 | break; | ||
169 | } | 193 | } |
170 | 194 | ||
171 | ehci_reset(ehci); | 195 | ehci_reset(ehci); |
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c index 0eba894bcb01..9c9da35abc6c 100644 --- a/drivers/usb/host/ehci-ps3.c +++ b/drivers/usb/host/ehci-ps3.c | |||
@@ -205,6 +205,7 @@ static int ps3_ehci_remove(struct ps3_system_bus_device *dev) | |||
205 | 205 | ||
206 | tmp = hcd->irq; | 206 | tmp = hcd->irq; |
207 | 207 | ||
208 | ehci_shutdown(hcd); | ||
208 | usb_remove_hcd(hcd); | 209 | usb_remove_hcd(hcd); |
209 | 210 | ||
210 | ps3_system_bus_set_driver_data(dev, NULL); | 211 | ps3_system_bus_set_driver_data(dev, NULL); |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 4a0c5a78b2ed..a081ee65bde6 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -918,7 +918,7 @@ iso_stream_init ( | |||
918 | */ | 918 | */ |
919 | stream->usecs = HS_USECS_ISO (maxp); | 919 | stream->usecs = HS_USECS_ISO (maxp); |
920 | bandwidth = stream->usecs * 8; | 920 | bandwidth = stream->usecs * 8; |
921 | bandwidth /= 1 << (interval - 1); | 921 | bandwidth /= interval; |
922 | 922 | ||
923 | } else { | 923 | } else { |
924 | u32 addr; | 924 | u32 addr; |
@@ -951,7 +951,7 @@ iso_stream_init ( | |||
951 | } else | 951 | } else |
952 | stream->raw_mask = smask_out [hs_transfers - 1]; | 952 | stream->raw_mask = smask_out [hs_transfers - 1]; |
953 | bandwidth = stream->usecs + stream->c_usecs; | 953 | bandwidth = stream->usecs + stream->c_usecs; |
954 | bandwidth /= 1 << (interval + 2); | 954 | bandwidth /= interval << 3; |
955 | 955 | ||
956 | /* stream->splits gets created from raw_mask later */ | 956 | /* stream->splits gets created from raw_mask later */ |
957 | stream->address = cpu_to_hc32(ehci, addr); | 957 | stream->address = cpu_to_hc32(ehci, addr); |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index b11798d17ae5..c7d4b5a06bdb 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -183,16 +183,14 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) | |||
183 | * the async ring; just the I/O watchdog. Note that if a | 183 | * the async ring; just the I/O watchdog. Note that if a |
184 | * SHRINK were pending, OFF would never be requested. | 184 | * SHRINK were pending, OFF would never be requested. |
185 | */ | 185 | */ |
186 | enum ehci_timer_action oldactions = ehci->actions; | 186 | if (timer_pending(&ehci->watchdog) |
187 | && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF)) | ||
188 | & ehci->actions)) | ||
189 | return; | ||
187 | 190 | ||
188 | if (!test_and_set_bit (action, &ehci->actions)) { | 191 | if (!test_and_set_bit (action, &ehci->actions)) { |
189 | unsigned long t; | 192 | unsigned long t; |
190 | 193 | ||
191 | if (timer_pending(&ehci->watchdog) | ||
192 | && ((BIT(TIMER_ASYNC_SHRINK) | BIT(TIMER_ASYNC_OFF)) | ||
193 | & oldactions)) | ||
194 | return; | ||
195 | |||
196 | switch (action) { | 194 | switch (action) { |
197 | case TIMER_IO_WATCHDOG: | 195 | case TIMER_IO_WATCHDOG: |
198 | t = EHCI_IO_JIFFIES; | 196 | t = EHCI_IO_JIFFIES; |
@@ -208,7 +206,7 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) | |||
208 | t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1; | 206 | t = DIV_ROUND_UP(EHCI_SHRINK_FRAMES * HZ, 1000) + 1; |
209 | break; | 207 | break; |
210 | } | 208 | } |
211 | mod_timer(&ehci->watchdog, round_jiffies(t + jiffies)); | 209 | mod_timer(&ehci->watchdog, t + jiffies); |
212 | } | 210 | } |
213 | } | 211 | } |
214 | 212 | ||
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index af849f596135..b87ca7cf4b37 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c | |||
@@ -14,16 +14,16 @@ | |||
14 | #include "../core/hcd.h" | 14 | #include "../core/hcd.h" |
15 | #include "isp1760-hcd.h" | 15 | #include "isp1760-hcd.h" |
16 | 16 | ||
17 | #ifdef CONFIG_USB_ISP1760_OF | 17 | #ifdef CONFIG_PPC_OF |
18 | #include <linux/of.h> | 18 | #include <linux/of.h> |
19 | #include <linux/of_platform.h> | 19 | #include <linux/of_platform.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #ifdef CONFIG_USB_ISP1760_PCI | 22 | #ifdef CONFIG_PCI |
23 | #include <linux/pci.h> | 23 | #include <linux/pci.h> |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | #ifdef CONFIG_USB_ISP1760_OF | 26 | #ifdef CONFIG_PPC_OF |
27 | static int of_isp1760_probe(struct of_device *dev, | 27 | static int of_isp1760_probe(struct of_device *dev, |
28 | const struct of_device_id *match) | 28 | const struct of_device_id *match) |
29 | { | 29 | { |
@@ -128,7 +128,7 @@ static struct of_platform_driver isp1760_of_driver = { | |||
128 | }; | 128 | }; |
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | #ifdef CONFIG_USB_ISP1760_PCI | 131 | #ifdef CONFIG_PCI |
132 | static u32 nxp_pci_io_base; | 132 | static u32 nxp_pci_io_base; |
133 | static u32 iolength; | 133 | static u32 iolength; |
134 | static u32 pci_mem_phy0; | 134 | static u32 pci_mem_phy0; |
@@ -288,28 +288,28 @@ static struct pci_driver isp1761_pci_driver = { | |||
288 | 288 | ||
289 | static int __init isp1760_init(void) | 289 | static int __init isp1760_init(void) |
290 | { | 290 | { |
291 | int ret = -ENODEV; | 291 | int ret; |
292 | 292 | ||
293 | init_kmem_once(); | 293 | init_kmem_once(); |
294 | 294 | ||
295 | #ifdef CONFIG_USB_ISP1760_OF | 295 | #ifdef CONFIG_PPC_OF |
296 | ret = of_register_platform_driver(&isp1760_of_driver); | 296 | ret = of_register_platform_driver(&isp1760_of_driver); |
297 | if (ret) { | 297 | if (ret) { |
298 | deinit_kmem_cache(); | 298 | deinit_kmem_cache(); |
299 | return ret; | 299 | return ret; |
300 | } | 300 | } |
301 | #endif | 301 | #endif |
302 | #ifdef CONFIG_USB_ISP1760_PCI | 302 | #ifdef CONFIG_PCI |
303 | ret = pci_register_driver(&isp1761_pci_driver); | 303 | ret = pci_register_driver(&isp1761_pci_driver); |
304 | if (ret) | 304 | if (ret) |
305 | goto unreg_of; | 305 | goto unreg_of; |
306 | #endif | 306 | #endif |
307 | return ret; | 307 | return ret; |
308 | 308 | ||
309 | #ifdef CONFIG_USB_ISP1760_PCI | 309 | #ifdef CONFIG_PCI |
310 | unreg_of: | 310 | unreg_of: |
311 | #endif | 311 | #endif |
312 | #ifdef CONFIG_USB_ISP1760_OF | 312 | #ifdef CONFIG_PPC_OF |
313 | of_unregister_platform_driver(&isp1760_of_driver); | 313 | of_unregister_platform_driver(&isp1760_of_driver); |
314 | #endif | 314 | #endif |
315 | deinit_kmem_cache(); | 315 | deinit_kmem_cache(); |
@@ -319,10 +319,10 @@ module_init(isp1760_init); | |||
319 | 319 | ||
320 | static void __exit isp1760_exit(void) | 320 | static void __exit isp1760_exit(void) |
321 | { | 321 | { |
322 | #ifdef CONFIG_USB_ISP1760_OF | 322 | #ifdef CONFIG_PPC_OF |
323 | of_unregister_platform_driver(&isp1760_of_driver); | 323 | of_unregister_platform_driver(&isp1760_of_driver); |
324 | #endif | 324 | #endif |
325 | #ifdef CONFIG_USB_ISP1760_PCI | 325 | #ifdef CONFIG_PCI |
326 | pci_unregister_driver(&isp1761_pci_driver); | 326 | pci_unregister_driver(&isp1761_pci_driver); |
327 | #endif | 327 | #endif |
328 | deinit_kmem_cache(); | 328 | deinit_kmem_cache(); |
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c index 2089d8a46c4b..3c1a3b5f89f1 100644 --- a/drivers/usb/host/ohci-ps3.c +++ b/drivers/usb/host/ohci-ps3.c | |||
@@ -192,7 +192,7 @@ fail_start: | |||
192 | return result; | 192 | return result; |
193 | } | 193 | } |
194 | 194 | ||
195 | static int ps3_ohci_remove (struct ps3_system_bus_device *dev) | 195 | static int ps3_ohci_remove(struct ps3_system_bus_device *dev) |
196 | { | 196 | { |
197 | unsigned int tmp; | 197 | unsigned int tmp; |
198 | struct usb_hcd *hcd = | 198 | struct usb_hcd *hcd = |
@@ -205,6 +205,7 @@ static int ps3_ohci_remove (struct ps3_system_bus_device *dev) | |||
205 | 205 | ||
206 | tmp = hcd->irq; | 206 | tmp = hcd->irq; |
207 | 207 | ||
208 | ohci_shutdown(hcd); | ||
208 | usb_remove_hcd(hcd); | 209 | usb_remove_hcd(hcd); |
209 | 210 | ||
210 | ps3_system_bus_set_driver_data(dev, NULL); | 211 | ps3_system_bus_set_driver_data(dev, NULL); |
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c index c18d8790c410..2376f24f3c83 100644 --- a/drivers/usb/host/r8a66597-hcd.c +++ b/drivers/usb/host/r8a66597-hcd.c | |||
@@ -1763,11 +1763,12 @@ static void r8a66597_timer(unsigned long _r8a66597) | |||
1763 | { | 1763 | { |
1764 | struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597; | 1764 | struct r8a66597 *r8a66597 = (struct r8a66597 *)_r8a66597; |
1765 | unsigned long flags; | 1765 | unsigned long flags; |
1766 | int port; | ||
1766 | 1767 | ||
1767 | spin_lock_irqsave(&r8a66597->lock, flags); | 1768 | spin_lock_irqsave(&r8a66597->lock, flags); |
1768 | 1769 | ||
1769 | r8a66597_root_hub_control(r8a66597, 0); | 1770 | for (port = 0; port < R8A66597_MAX_ROOT_HUB; port++) |
1770 | r8a66597_root_hub_control(r8a66597, 1); | 1771 | r8a66597_root_hub_control(r8a66597, port); |
1771 | 1772 | ||
1772 | spin_unlock_irqrestore(&r8a66597->lock, flags); | 1773 | spin_unlock_irqrestore(&r8a66597->lock, flags); |
1773 | } | 1774 | } |
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 69c34a58e205..b4ec716de7da 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -3270,6 +3270,7 @@ static struct usb_device_id sisusb_table [] = { | |||
3270 | { USB_DEVICE(0x0711, 0x0900) }, | 3270 | { USB_DEVICE(0x0711, 0x0900) }, |
3271 | { USB_DEVICE(0x0711, 0x0901) }, | 3271 | { USB_DEVICE(0x0711, 0x0901) }, |
3272 | { USB_DEVICE(0x0711, 0x0902) }, | 3272 | { USB_DEVICE(0x0711, 0x0902) }, |
3273 | { USB_DEVICE(0x0711, 0x0903) }, | ||
3273 | { USB_DEVICE(0x0711, 0x0918) }, | 3274 | { USB_DEVICE(0x0711, 0x0918) }, |
3274 | { USB_DEVICE(0x182d, 0x021c) }, | 3275 | { USB_DEVICE(0x182d, 0x021c) }, |
3275 | { USB_DEVICE(0x182d, 0x0269) }, | 3276 | { USB_DEVICE(0x182d, 0x0269) }, |
diff --git a/drivers/usb/misc/vstusb.c b/drivers/usb/misc/vstusb.c index 8648470c81ca..63dff9ba73c5 100644 --- a/drivers/usb/misc/vstusb.c +++ b/drivers/usb/misc/vstusb.c | |||
@@ -620,7 +620,7 @@ static long vstusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
620 | __func__); | 620 | __func__); |
621 | retval = -EFAULT; | 621 | retval = -EFAULT; |
622 | } else { | 622 | } else { |
623 | dev_dbg(&dev->dev, "%s: recv %d bytes from pipe %d\n", | 623 | dev_dbg(&dev->dev, "%s: recv %zd bytes from pipe %d\n", |
624 | __func__, usb_data.count, usb_data.pipe); | 624 | __func__, usb_data.count, usb_data.pipe); |
625 | } | 625 | } |
626 | 626 | ||
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index c9de3f027aab..e06810aef2df 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c | |||
@@ -687,7 +687,10 @@ static ssize_t mon_bin_read(struct file *file, char __user *buf, | |||
687 | } | 687 | } |
688 | 688 | ||
689 | if (rp->b_read >= sizeof(struct mon_bin_hdr)) { | 689 | if (rp->b_read >= sizeof(struct mon_bin_hdr)) { |
690 | step_len = min(nbytes, (size_t)ep->len_cap); | 690 | step_len = ep->len_cap; |
691 | step_len -= rp->b_read - sizeof(struct mon_bin_hdr); | ||
692 | if (step_len > nbytes) | ||
693 | step_len = nbytes; | ||
691 | offset = rp->b_out + PKT_SIZE; | 694 | offset = rp->b_out + PKT_SIZE; |
692 | offset += rp->b_read - sizeof(struct mon_bin_hdr); | 695 | offset += rp->b_read - sizeof(struct mon_bin_hdr); |
693 | if (offset >= rp->b_size) | 696 | if (offset >= rp->b_size) |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 4a35745b30be..5280dba9b1fb 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -114,8 +114,8 @@ | |||
114 | 114 | ||
115 | 115 | ||
116 | 116 | ||
117 | unsigned debug; | 117 | unsigned musb_debug; |
118 | module_param(debug, uint, S_IRUGO | S_IWUSR); | 118 | module_param(musb_debug, uint, S_IRUGO | S_IWUSR); |
119 | MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); | 119 | MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); |
120 | 120 | ||
121 | #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" | 121 | #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" |
@@ -2248,7 +2248,7 @@ static int __init musb_init(void) | |||
2248 | "host" | 2248 | "host" |
2249 | #endif | 2249 | #endif |
2250 | ", debug=%d\n", | 2250 | ", debug=%d\n", |
2251 | musb_driver_name, debug); | 2251 | musb_driver_name, musb_debug); |
2252 | return platform_driver_probe(&musb_driver, musb_probe); | 2252 | return platform_driver_probe(&musb_driver, musb_probe); |
2253 | } | 2253 | } |
2254 | 2254 | ||
diff --git a/drivers/usb/musb/musb_debug.h b/drivers/usb/musb/musb_debug.h index 4d2794441b15..9fc1db44c72c 100644 --- a/drivers/usb/musb/musb_debug.h +++ b/drivers/usb/musb/musb_debug.h | |||
@@ -48,11 +48,11 @@ | |||
48 | __func__, __LINE__ , ## args); \ | 48 | __func__, __LINE__ , ## args); \ |
49 | } } while (0) | 49 | } } while (0) |
50 | 50 | ||
51 | extern unsigned debug; | 51 | extern unsigned musb_debug; |
52 | 52 | ||
53 | static inline int _dbg_level(unsigned l) | 53 | static inline int _dbg_level(unsigned l) |
54 | { | 54 | { |
55 | return debug >= l; | 55 | return musb_debug >= l; |
56 | } | 56 | } |
57 | 57 | ||
58 | #define DBG(level, fmt, args...) xprintk(level, KERN_DEBUG, fmt, ## args) | 58 | #define DBG(level, fmt, args...) xprintk(level, KERN_DEBUG, fmt, ## args) |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 3133990f04ec..cc64462d4c4e 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -378,6 +378,19 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) | |||
378 | 378 | ||
379 | switch (qh->type) { | 379 | switch (qh->type) { |
380 | 380 | ||
381 | case USB_ENDPOINT_XFER_CONTROL: | ||
382 | case USB_ENDPOINT_XFER_BULK: | ||
383 | /* fifo policy for these lists, except that NAKing | ||
384 | * should rotate a qh to the end (for fairness). | ||
385 | */ | ||
386 | if (qh->mux == 1) { | ||
387 | head = qh->ring.prev; | ||
388 | list_del(&qh->ring); | ||
389 | kfree(qh); | ||
390 | qh = first_qh(head); | ||
391 | break; | ||
392 | } | ||
393 | |||
381 | case USB_ENDPOINT_XFER_ISOC: | 394 | case USB_ENDPOINT_XFER_ISOC: |
382 | case USB_ENDPOINT_XFER_INT: | 395 | case USB_ENDPOINT_XFER_INT: |
383 | /* this is where periodic bandwidth should be | 396 | /* this is where periodic bandwidth should be |
@@ -388,17 +401,6 @@ musb_giveback(struct musb_qh *qh, struct urb *urb, int status) | |||
388 | kfree(qh); | 401 | kfree(qh); |
389 | qh = NULL; | 402 | qh = NULL; |
390 | break; | 403 | break; |
391 | |||
392 | case USB_ENDPOINT_XFER_CONTROL: | ||
393 | case USB_ENDPOINT_XFER_BULK: | ||
394 | /* fifo policy for these lists, except that NAKing | ||
395 | * should rotate a qh to the end (for fairness). | ||
396 | */ | ||
397 | head = qh->ring.prev; | ||
398 | list_del(&qh->ring); | ||
399 | kfree(qh); | ||
400 | qh = first_qh(head); | ||
401 | break; | ||
402 | } | 404 | } |
403 | } | 405 | } |
404 | return qh; | 406 | return qh; |
@@ -1507,10 +1509,29 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1507 | musb_writew(hw_ep->regs, MUSB_RXCSR, val); | 1509 | musb_writew(hw_ep->regs, MUSB_RXCSR, val); |
1508 | 1510 | ||
1509 | #ifdef CONFIG_USB_INVENTRA_DMA | 1511 | #ifdef CONFIG_USB_INVENTRA_DMA |
1512 | if (usb_pipeisoc(pipe)) { | ||
1513 | struct usb_iso_packet_descriptor *d; | ||
1514 | |||
1515 | d = urb->iso_frame_desc + qh->iso_idx; | ||
1516 | d->actual_length = xfer_len; | ||
1517 | |||
1518 | /* even if there was an error, we did the dma | ||
1519 | * for iso_frame_desc->length | ||
1520 | */ | ||
1521 | if (d->status != EILSEQ && d->status != -EOVERFLOW) | ||
1522 | d->status = 0; | ||
1523 | |||
1524 | if (++qh->iso_idx >= urb->number_of_packets) | ||
1525 | done = true; | ||
1526 | else | ||
1527 | done = false; | ||
1528 | |||
1529 | } else { | ||
1510 | /* done if urb buffer is full or short packet is recd */ | 1530 | /* done if urb buffer is full or short packet is recd */ |
1511 | done = (urb->actual_length + xfer_len >= | 1531 | done = (urb->actual_length + xfer_len >= |
1512 | urb->transfer_buffer_length | 1532 | urb->transfer_buffer_length |
1513 | || dma->actual_len < qh->maxpacket); | 1533 | || dma->actual_len < qh->maxpacket); |
1534 | } | ||
1514 | 1535 | ||
1515 | /* send IN token for next packet, without AUTOREQ */ | 1536 | /* send IN token for next packet, without AUTOREQ */ |
1516 | if (!done) { | 1537 | if (!done) { |
@@ -1547,7 +1568,8 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1547 | if (dma) { | 1568 | if (dma) { |
1548 | struct dma_controller *c; | 1569 | struct dma_controller *c; |
1549 | u16 rx_count; | 1570 | u16 rx_count; |
1550 | int ret; | 1571 | int ret, length; |
1572 | dma_addr_t buf; | ||
1551 | 1573 | ||
1552 | rx_count = musb_readw(epio, MUSB_RXCOUNT); | 1574 | rx_count = musb_readw(epio, MUSB_RXCOUNT); |
1553 | 1575 | ||
@@ -1560,6 +1582,35 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1560 | 1582 | ||
1561 | c = musb->dma_controller; | 1583 | c = musb->dma_controller; |
1562 | 1584 | ||
1585 | if (usb_pipeisoc(pipe)) { | ||
1586 | int status = 0; | ||
1587 | struct usb_iso_packet_descriptor *d; | ||
1588 | |||
1589 | d = urb->iso_frame_desc + qh->iso_idx; | ||
1590 | |||
1591 | if (iso_err) { | ||
1592 | status = -EILSEQ; | ||
1593 | urb->error_count++; | ||
1594 | } | ||
1595 | if (rx_count > d->length) { | ||
1596 | if (status == 0) { | ||
1597 | status = -EOVERFLOW; | ||
1598 | urb->error_count++; | ||
1599 | } | ||
1600 | DBG(2, "** OVERFLOW %d into %d\n",\ | ||
1601 | rx_count, d->length); | ||
1602 | |||
1603 | length = d->length; | ||
1604 | } else | ||
1605 | length = rx_count; | ||
1606 | d->status = status; | ||
1607 | buf = urb->transfer_dma + d->offset; | ||
1608 | } else { | ||
1609 | length = rx_count; | ||
1610 | buf = urb->transfer_dma + | ||
1611 | urb->actual_length; | ||
1612 | } | ||
1613 | |||
1563 | dma->desired_mode = 0; | 1614 | dma->desired_mode = 0; |
1564 | #ifdef USE_MODE1 | 1615 | #ifdef USE_MODE1 |
1565 | /* because of the issue below, mode 1 will | 1616 | /* because of the issue below, mode 1 will |
@@ -1571,6 +1622,12 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1571 | urb->actual_length) | 1622 | urb->actual_length) |
1572 | > qh->maxpacket) | 1623 | > qh->maxpacket) |
1573 | dma->desired_mode = 1; | 1624 | dma->desired_mode = 1; |
1625 | if (rx_count < hw_ep->max_packet_sz_rx) { | ||
1626 | length = rx_count; | ||
1627 | dma->bDesiredMode = 0; | ||
1628 | } else { | ||
1629 | length = urb->transfer_buffer_length; | ||
1630 | } | ||
1574 | #endif | 1631 | #endif |
1575 | 1632 | ||
1576 | /* Disadvantage of using mode 1: | 1633 | /* Disadvantage of using mode 1: |
@@ -1608,12 +1665,7 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1608 | */ | 1665 | */ |
1609 | ret = c->channel_program( | 1666 | ret = c->channel_program( |
1610 | dma, qh->maxpacket, | 1667 | dma, qh->maxpacket, |
1611 | dma->desired_mode, | 1668 | dma->desired_mode, buf, length); |
1612 | urb->transfer_dma | ||
1613 | + urb->actual_length, | ||
1614 | (dma->desired_mode == 0) | ||
1615 | ? rx_count | ||
1616 | : urb->transfer_buffer_length); | ||
1617 | 1669 | ||
1618 | if (!ret) { | 1670 | if (!ret) { |
1619 | c->channel_release(dma); | 1671 | c->channel_release(dma); |
@@ -1631,19 +1683,6 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1631 | } | 1683 | } |
1632 | } | 1684 | } |
1633 | 1685 | ||
1634 | if (dma && usb_pipeisoc(pipe)) { | ||
1635 | struct usb_iso_packet_descriptor *d; | ||
1636 | int iso_stat = status; | ||
1637 | |||
1638 | d = urb->iso_frame_desc + qh->iso_idx; | ||
1639 | d->actual_length += xfer_len; | ||
1640 | if (iso_err) { | ||
1641 | iso_stat = -EILSEQ; | ||
1642 | urb->error_count++; | ||
1643 | } | ||
1644 | d->status = iso_stat; | ||
1645 | } | ||
1646 | |||
1647 | finish: | 1686 | finish: |
1648 | urb->actual_length += xfer_len; | 1687 | urb->actual_length += xfer_len; |
1649 | qh->offset += xfer_len; | 1688 | qh->offset += xfer_len; |
@@ -1671,22 +1710,9 @@ static int musb_schedule( | |||
1671 | struct list_head *head = NULL; | 1710 | struct list_head *head = NULL; |
1672 | 1711 | ||
1673 | /* use fixed hardware for control and bulk */ | 1712 | /* use fixed hardware for control and bulk */ |
1674 | switch (qh->type) { | 1713 | if (qh->type == USB_ENDPOINT_XFER_CONTROL) { |
1675 | case USB_ENDPOINT_XFER_CONTROL: | ||
1676 | head = &musb->control; | 1714 | head = &musb->control; |
1677 | hw_ep = musb->control_ep; | 1715 | hw_ep = musb->control_ep; |
1678 | break; | ||
1679 | case USB_ENDPOINT_XFER_BULK: | ||
1680 | hw_ep = musb->bulk_ep; | ||
1681 | if (is_in) | ||
1682 | head = &musb->in_bulk; | ||
1683 | else | ||
1684 | head = &musb->out_bulk; | ||
1685 | break; | ||
1686 | } | ||
1687 | if (head) { | ||
1688 | idle = list_empty(head); | ||
1689 | list_add_tail(&qh->ring, head); | ||
1690 | goto success; | 1716 | goto success; |
1691 | } | 1717 | } |
1692 | 1718 | ||
@@ -1725,19 +1751,34 @@ static int musb_schedule( | |||
1725 | else | 1751 | else |
1726 | diff = hw_ep->max_packet_sz_tx - qh->maxpacket; | 1752 | diff = hw_ep->max_packet_sz_tx - qh->maxpacket; |
1727 | 1753 | ||
1728 | if (diff > 0 && best_diff > diff) { | 1754 | if (diff >= 0 && best_diff > diff) { |
1729 | best_diff = diff; | 1755 | best_diff = diff; |
1730 | best_end = epnum; | 1756 | best_end = epnum; |
1731 | } | 1757 | } |
1732 | } | 1758 | } |
1733 | if (best_end < 0) | 1759 | /* use bulk reserved ep1 if no other ep is free */ |
1760 | if (best_end < 0 && qh->type == USB_ENDPOINT_XFER_BULK) { | ||
1761 | hw_ep = musb->bulk_ep; | ||
1762 | if (is_in) | ||
1763 | head = &musb->in_bulk; | ||
1764 | else | ||
1765 | head = &musb->out_bulk; | ||
1766 | goto success; | ||
1767 | } else if (best_end < 0) { | ||
1734 | return -ENOSPC; | 1768 | return -ENOSPC; |
1769 | } | ||
1735 | 1770 | ||
1736 | idle = 1; | 1771 | idle = 1; |
1772 | qh->mux = 0; | ||
1737 | hw_ep = musb->endpoints + best_end; | 1773 | hw_ep = musb->endpoints + best_end; |
1738 | musb->periodic[best_end] = qh; | 1774 | musb->periodic[best_end] = qh; |
1739 | DBG(4, "qh %p periodic slot %d\n", qh, best_end); | 1775 | DBG(4, "qh %p periodic slot %d\n", qh, best_end); |
1740 | success: | 1776 | success: |
1777 | if (head) { | ||
1778 | idle = list_empty(head); | ||
1779 | list_add_tail(&qh->ring, head); | ||
1780 | qh->mux = 1; | ||
1781 | } | ||
1741 | qh->hw_ep = hw_ep; | 1782 | qh->hw_ep = hw_ep; |
1742 | qh->hep->hcpriv = qh; | 1783 | qh->hep->hcpriv = qh; |
1743 | if (idle) | 1784 | if (idle) |
@@ -2015,11 +2056,13 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
2015 | sched = &musb->control; | 2056 | sched = &musb->control; |
2016 | break; | 2057 | break; |
2017 | case USB_ENDPOINT_XFER_BULK: | 2058 | case USB_ENDPOINT_XFER_BULK: |
2018 | if (usb_pipein(urb->pipe)) | 2059 | if (qh->mux == 1) { |
2019 | sched = &musb->in_bulk; | 2060 | if (usb_pipein(urb->pipe)) |
2020 | else | 2061 | sched = &musb->in_bulk; |
2021 | sched = &musb->out_bulk; | 2062 | else |
2022 | break; | 2063 | sched = &musb->out_bulk; |
2064 | break; | ||
2065 | } | ||
2023 | default: | 2066 | default: |
2024 | /* REVISIT when we get a schedule tree, periodic | 2067 | /* REVISIT when we get a schedule tree, periodic |
2025 | * transfers won't always be at the head of a | 2068 | * transfers won't always be at the head of a |
@@ -2067,11 +2110,13 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep) | |||
2067 | sched = &musb->control; | 2110 | sched = &musb->control; |
2068 | break; | 2111 | break; |
2069 | case USB_ENDPOINT_XFER_BULK: | 2112 | case USB_ENDPOINT_XFER_BULK: |
2070 | if (is_in) | 2113 | if (qh->mux == 1) { |
2071 | sched = &musb->in_bulk; | 2114 | if (is_in) |
2072 | else | 2115 | sched = &musb->in_bulk; |
2073 | sched = &musb->out_bulk; | 2116 | else |
2074 | break; | 2117 | sched = &musb->out_bulk; |
2118 | break; | ||
2119 | } | ||
2075 | default: | 2120 | default: |
2076 | /* REVISIT when we get a schedule tree, periodic transfers | 2121 | /* REVISIT when we get a schedule tree, periodic transfers |
2077 | * won't always be at the head of a singleton queue... | 2122 | * won't always be at the head of a singleton queue... |
diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h index 77bcdb9d5b32..0b7fbcd21963 100644 --- a/drivers/usb/musb/musb_host.h +++ b/drivers/usb/musb/musb_host.h | |||
@@ -53,6 +53,7 @@ struct musb_qh { | |||
53 | 53 | ||
54 | struct list_head ring; /* of musb_qh */ | 54 | struct list_head ring; /* of musb_qh */ |
55 | /* struct musb_qh *next; */ /* for periodic tree */ | 55 | /* struct musb_qh *next; */ /* for periodic tree */ |
56 | u8 mux; /* qh multiplexed to hw_ep */ | ||
56 | 57 | ||
57 | unsigned offset; /* in urb->transfer_buffer */ | 58 | unsigned offset; /* in urb->transfer_buffer */ |
58 | unsigned segsize; /* current xfer fragment */ | 59 | unsigned segsize; /* current xfer fragment */ |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 9d2dcb121c5e..ce6c162920f7 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -53,7 +53,9 @@ static void musb_do_idle(unsigned long _musb) | |||
53 | { | 53 | { |
54 | struct musb *musb = (void *)_musb; | 54 | struct musb *musb = (void *)_musb; |
55 | unsigned long flags; | 55 | unsigned long flags; |
56 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | ||
56 | u8 power; | 57 | u8 power; |
58 | #endif | ||
57 | u8 devctl; | 59 | u8 devctl; |
58 | 60 | ||
59 | devctl = musb_readb(musb->mregs, MUSB_DEVCTL); | 61 | devctl = musb_readb(musb->mregs, MUSB_DEVCTL); |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index b73b036f3d77..ee8fca92a4ac 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -605,7 +605,7 @@ void musb_platform_set_mode(struct musb *musb, u8 musb_mode) | |||
605 | 605 | ||
606 | if (musb->board_mode != MUSB_OTG) { | 606 | if (musb->board_mode != MUSB_OTG) { |
607 | ERR("Changing mode currently only supported in OTG mode\n"); | 607 | ERR("Changing mode currently only supported in OTG mode\n"); |
608 | return; | 608 | return -EINVAL; |
609 | } | 609 | } |
610 | 610 | ||
611 | otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT); | 611 | otg_stat = musb_readl(tbase, TUSB_DEV_OTG_STAT); |
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 5b20de130e08..5b95009d2fbb 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c | |||
@@ -135,6 +135,7 @@ static int usb_console_setup(struct console *co, char *options) | |||
135 | err("no more memory"); | 135 | err("no more memory"); |
136 | goto reset_open_count; | 136 | goto reset_open_count; |
137 | } | 137 | } |
138 | kref_init(&tty->kref); | ||
138 | termios = kzalloc(sizeof(*termios), GFP_KERNEL); | 139 | termios = kzalloc(sizeof(*termios), GFP_KERNEL); |
139 | if (!termios) { | 140 | if (!termios) { |
140 | retval = -ENOMEM; | 141 | retval = -ENOMEM; |
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index 8008d0bc80ad..cfaf1f085535 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c | |||
@@ -56,6 +56,7 @@ static void cp2101_shutdown(struct usb_serial *); | |||
56 | static int debug; | 56 | static int debug; |
57 | 57 | ||
58 | static struct usb_device_id id_table [] = { | 58 | static struct usb_device_id id_table [] = { |
59 | { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ | ||
59 | { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ | 60 | { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ |
60 | { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ | 61 | { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ |
61 | { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */ | 62 | { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */ |
@@ -67,6 +68,7 @@ static struct usb_device_id id_table [] = { | |||
67 | { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */ | 68 | { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */ |
68 | { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */ | 69 | { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */ |
69 | { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */ | 70 | { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */ |
71 | { USB_DEVICE(0x10C4, 0x8054) }, /* Enfora GSM2228 */ | ||
70 | { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ | 72 | { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */ |
71 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ | 73 | { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */ |
72 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ | 74 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ |
@@ -85,6 +87,7 @@ static struct usb_device_id id_table [] = { | |||
85 | { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */ | 87 | { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */ |
86 | { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */ | 88 | { USB_DEVICE(0x10c4, 0x8293) }, /* Telegesys ETRX2USB */ |
87 | { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ | 89 | { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */ |
90 | { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ | ||
88 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ | 91 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ |
89 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ | 92 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ |
90 | { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ | 93 | { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 51d7bdea2869..fb6f2933b01b 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -143,6 +143,7 @@ static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = { | |||
143 | static struct usb_device_id id_table_combined [] = { | 143 | static struct usb_device_id id_table_combined [] = { |
144 | { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) }, | 144 | { USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) }, |
145 | { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, | 145 | { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) }, |
146 | { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) }, | ||
146 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, | 147 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) }, |
147 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, | 148 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) }, |
148 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) }, | 149 | { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) }, |
@@ -166,6 +167,7 @@ static struct usb_device_id id_table_combined [] = { | |||
166 | { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) }, | 167 | { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_PID) }, |
167 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, | 168 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, |
168 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, | 169 | { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, |
170 | { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, | ||
169 | { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, | 171 | { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, |
170 | { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) }, | 172 | { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) }, |
171 | { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) }, | 173 | { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) }, |
@@ -1498,7 +1500,7 @@ static int ftdi_open(struct tty_struct *tty, | |||
1498 | priv->interface, buf, 0, WDR_TIMEOUT); | 1500 | priv->interface, buf, 0, WDR_TIMEOUT); |
1499 | 1501 | ||
1500 | /* Termios defaults are set by usb_serial_init. We don't change | 1502 | /* Termios defaults are set by usb_serial_init. We don't change |
1501 | port->tty->termios - this would loose speed settings, etc. | 1503 | port->tty->termios - this would lose speed settings, etc. |
1502 | This is same behaviour as serial.c/rs_open() - Kuba */ | 1504 | This is same behaviour as serial.c/rs_open() - Kuba */ |
1503 | 1505 | ||
1504 | /* ftdi_set_termios will send usb control messages */ | 1506 | /* ftdi_set_termios will send usb control messages */ |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 07a3992abad2..373ee09975bb 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -40,6 +40,9 @@ | |||
40 | /* AlphaMicro Components AMC-232USB01 device */ | 40 | /* AlphaMicro Components AMC-232USB01 device */ |
41 | #define FTDI_AMC232_PID 0xFF00 /* Product Id */ | 41 | #define FTDI_AMC232_PID 0xFF00 /* Product Id */ |
42 | 42 | ||
43 | /* www.candapter.com Ewert Energy Systems CANdapter device */ | ||
44 | #define FTDI_CANDAPTER_PID 0x9F80 /* Product Id */ | ||
45 | |||
43 | /* SCS HF Radio Modems PID's (http://www.scs-ptc.com) */ | 46 | /* SCS HF Radio Modems PID's (http://www.scs-ptc.com) */ |
44 | /* the VID is the standard ftdi vid (FTDI_VID) */ | 47 | /* the VID is the standard ftdi vid (FTDI_VID) */ |
45 | #define FTDI_SCS_DEVICE_0_PID 0xD010 /* SCS PTC-IIusb */ | 48 | #define FTDI_SCS_DEVICE_0_PID 0xD010 /* SCS PTC-IIusb */ |
@@ -75,6 +78,9 @@ | |||
75 | /* OpenDCC (www.opendcc.de) product id */ | 78 | /* OpenDCC (www.opendcc.de) product id */ |
76 | #define FTDI_OPENDCC_PID 0xBFD8 | 79 | #define FTDI_OPENDCC_PID 0xBFD8 |
77 | 80 | ||
81 | /* Sprog II (Andrew Crosland's SprogII DCC interface) */ | ||
82 | #define FTDI_SPROG_II 0xF0C8 | ||
83 | |||
78 | /* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */ | 84 | /* www.crystalfontz.com devices - thanx for providing free devices for evaluation ! */ |
79 | /* they use the ftdi chipset for the USB interface and the vendor id is the same */ | 85 | /* they use the ftdi chipset for the USB interface and the vendor id is the same */ |
80 | #define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */ | 86 | #define FTDI_XF_632_PID 0xFC08 /* 632: 16x2 Character Display */ |
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index b679a556b98d..4e2cda93da59 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c | |||
@@ -26,7 +26,7 @@ | |||
26 | * Introduced common header to be used also in USB Gadget Framework. | 26 | * Introduced common header to be used also in USB Gadget Framework. |
27 | * Still needs some other style fixes. | 27 | * Still needs some other style fixes. |
28 | * | 28 | * |
29 | * 2007_Jun_21 Alan Cox <alan@redhat.com> | 29 | * 2007_Jun_21 Alan Cox <alan@lxorguk.ukuu.org.uk> |
30 | * Minimal cleanups for some of the driver problens and tty layer abuse. | 30 | * Minimal cleanups for some of the driver problens and tty layer abuse. |
31 | * Still needs fixing to allow multiple dongles. | 31 | * Still needs fixing to allow multiple dongles. |
32 | * | 32 | * |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index bd07eaa300b9..809697b3c7fc 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -160,6 +160,11 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
160 | 160 | ||
161 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 | 161 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 |
162 | 162 | ||
163 | /* YISO PRODUCTS */ | ||
164 | |||
165 | #define YISO_VENDOR_ID 0x0EAB | ||
166 | #define YISO_PRODUCT_U893 0xC893 | ||
167 | |||
163 | /* MERLIN EVDO PRODUCTS */ | 168 | /* MERLIN EVDO PRODUCTS */ |
164 | #define NOVATELWIRELESS_PRODUCT_V640 0x1100 | 169 | #define NOVATELWIRELESS_PRODUCT_V640 0x1100 |
165 | #define NOVATELWIRELESS_PRODUCT_V620 0x1110 | 170 | #define NOVATELWIRELESS_PRODUCT_V620 0x1110 |
@@ -219,6 +224,7 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
219 | #define ONDA_VENDOR_ID 0x19d2 | 224 | #define ONDA_VENDOR_ID 0x19d2 |
220 | #define ONDA_PRODUCT_MSA501HS 0x0001 | 225 | #define ONDA_PRODUCT_MSA501HS 0x0001 |
221 | #define ONDA_PRODUCT_ET502HS 0x0002 | 226 | #define ONDA_PRODUCT_ET502HS 0x0002 |
227 | #define ONDA_PRODUCT_MT503HS 0x0200 | ||
222 | 228 | ||
223 | #define BANDRICH_VENDOR_ID 0x1A8D | 229 | #define BANDRICH_VENDOR_ID 0x1A8D |
224 | #define BANDRICH_PRODUCT_C100_1 0x1002 | 230 | #define BANDRICH_PRODUCT_C100_1 0x1002 |
@@ -408,6 +414,41 @@ static struct usb_device_id option_ids[] = { | |||
408 | { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, | 414 | { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, |
409 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) }, | 415 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) }, |
410 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) }, | 416 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) }, |
417 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0003) }, | ||
418 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0004) }, | ||
419 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0005) }, | ||
420 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0006) }, | ||
421 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0007) }, | ||
422 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0008) }, | ||
423 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0009) }, | ||
424 | { USB_DEVICE(ONDA_VENDOR_ID, 0x000a) }, | ||
425 | { USB_DEVICE(ONDA_VENDOR_ID, 0x000b) }, | ||
426 | { USB_DEVICE(ONDA_VENDOR_ID, 0x000c) }, | ||
427 | { USB_DEVICE(ONDA_VENDOR_ID, 0x000d) }, | ||
428 | { USB_DEVICE(ONDA_VENDOR_ID, 0x000e) }, | ||
429 | { USB_DEVICE(ONDA_VENDOR_ID, 0x000f) }, | ||
430 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0010) }, | ||
431 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0011) }, | ||
432 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0012) }, | ||
433 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0013) }, | ||
434 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0014) }, | ||
435 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0015) }, | ||
436 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0016) }, | ||
437 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0017) }, | ||
438 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0018) }, | ||
439 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0019) }, | ||
440 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0020) }, | ||
441 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0021) }, | ||
442 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0022) }, | ||
443 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0023) }, | ||
444 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0024) }, | ||
445 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0025) }, | ||
446 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0026) }, | ||
447 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0027) }, | ||
448 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0028) }, | ||
449 | { USB_DEVICE(ONDA_VENDOR_ID, 0x0029) }, | ||
450 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MT503HS) }, | ||
451 | { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) }, | ||
411 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, | 452 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, |
412 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, | 453 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, |
413 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1004) }, | 454 | { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1004) }, |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 491c8857b644..1aed584be5eb 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
@@ -91,6 +91,8 @@ static struct usb_device_id id_table [] = { | |||
91 | { USB_DEVICE(WS002IN_VENDOR_ID, WS002IN_PRODUCT_ID) }, | 91 | { USB_DEVICE(WS002IN_VENDOR_ID, WS002IN_PRODUCT_ID) }, |
92 | { USB_DEVICE(COREGA_VENDOR_ID, COREGA_PRODUCT_ID) }, | 92 | { USB_DEVICE(COREGA_VENDOR_ID, COREGA_PRODUCT_ID) }, |
93 | { USB_DEVICE(YCCABLE_VENDOR_ID, YCCABLE_PRODUCT_ID) }, | 93 | { USB_DEVICE(YCCABLE_VENDOR_ID, YCCABLE_PRODUCT_ID) }, |
94 | { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) }, | ||
95 | { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) }, | ||
94 | { } /* Terminating entry */ | 96 | { } /* Terminating entry */ |
95 | }; | 97 | }; |
96 | 98 | ||
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index a3bd039c78e9..54974f446a8c 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h | |||
@@ -110,3 +110,11 @@ | |||
110 | /* Y.C. Cable U.S.A., Inc - USB to RS-232 */ | 110 | /* Y.C. Cable U.S.A., Inc - USB to RS-232 */ |
111 | #define YCCABLE_VENDOR_ID 0x05ad | 111 | #define YCCABLE_VENDOR_ID 0x05ad |
112 | #define YCCABLE_PRODUCT_ID 0x0fba | 112 | #define YCCABLE_PRODUCT_ID 0x0fba |
113 | |||
114 | /* "Superial" USB - Serial */ | ||
115 | #define SUPERIAL_VENDOR_ID 0x5372 | ||
116 | #define SUPERIAL_PRODUCT_ID 0x2303 | ||
117 | |||
118 | /* Hewlett-Packard LD220-HP POS Pole Display */ | ||
119 | #define HP_VENDOR_ID 0x03f0 | ||
120 | #define HP_LD220_PRODUCT_ID 0x3524 | ||
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 31c42d1cae13..01d0c70d60e9 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -16,56 +16,6 @@ | |||
16 | * For questions or problems with this driver, contact Texas Instruments | 16 | * For questions or problems with this driver, contact Texas Instruments |
17 | * technical support, or Al Borchers <alborchers@steinerpoint.com>, or | 17 | * technical support, or Al Borchers <alborchers@steinerpoint.com>, or |
18 | * Peter Berger <pberger@brimson.com>. | 18 | * Peter Berger <pberger@brimson.com>. |
19 | * | ||
20 | * This driver needs this hotplug script in /etc/hotplug/usb/ti_usb_3410_5052 | ||
21 | * or in /etc/hotplug.d/usb/ti_usb_3410_5052.hotplug to set the device | ||
22 | * configuration. | ||
23 | * | ||
24 | * #!/bin/bash | ||
25 | * | ||
26 | * BOOT_CONFIG=1 | ||
27 | * ACTIVE_CONFIG=2 | ||
28 | * | ||
29 | * if [[ "$ACTION" != "add" ]] | ||
30 | * then | ||
31 | * exit | ||
32 | * fi | ||
33 | * | ||
34 | * CONFIG_PATH=/sys${DEVPATH%/?*}/bConfigurationValue | ||
35 | * | ||
36 | * if [[ 0`cat $CONFIG_PATH` -ne $BOOT_CONFIG ]] | ||
37 | * then | ||
38 | * exit | ||
39 | * fi | ||
40 | * | ||
41 | * PRODUCT=${PRODUCT%/?*} # delete version | ||
42 | * VENDOR_ID=`printf "%d" 0x${PRODUCT%/?*}` | ||
43 | * PRODUCT_ID=`printf "%d" 0x${PRODUCT#*?/}` | ||
44 | * | ||
45 | * PARAM_PATH=/sys/module/ti_usb_3410_5052/parameters | ||
46 | * | ||
47 | * function scan() { | ||
48 | * s=$1 | ||
49 | * shift | ||
50 | * for i | ||
51 | * do | ||
52 | * if [[ $s -eq $i ]] | ||
53 | * then | ||
54 | * return 0 | ||
55 | * fi | ||
56 | * done | ||
57 | * return 1 | ||
58 | * } | ||
59 | * | ||
60 | * IFS=$IFS, | ||
61 | * | ||
62 | * if (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_3410` && | ||
63 | * scan $PRODUCT_ID 13328 `cat $PARAM_PATH/product_3410`) || | ||
64 | * (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_5052` && | ||
65 | * scan $PRODUCT_ID 20562 20818 20570 20575 `cat $PARAM_PATH/product_5052`) | ||
66 | * then | ||
67 | * echo $ACTIVE_CONFIG > $CONFIG_PATH | ||
68 | * fi | ||
69 | */ | 19 | */ |
70 | 20 | ||
71 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
@@ -457,9 +407,10 @@ static int ti_startup(struct usb_serial *serial) | |||
457 | goto free_tdev; | 407 | goto free_tdev; |
458 | } | 408 | } |
459 | 409 | ||
460 | /* the second configuration must be set (in sysfs by hotplug script) */ | 410 | /* the second configuration must be set */ |
461 | if (dev->actconfig->desc.bConfigurationValue == TI_BOOT_CONFIG) { | 411 | if (dev->actconfig->desc.bConfigurationValue == TI_BOOT_CONFIG) { |
462 | status = -ENODEV; | 412 | status = usb_driver_set_configuration(dev, TI_ACTIVE_CONFIG); |
413 | status = status ? status : -ENODEV; | ||
463 | goto free_tdev; | 414 | goto free_tdev; |
464 | } | 415 | } |
465 | 416 | ||
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 8be3f39891c7..794b5ffe4397 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -281,6 +281,7 @@ static void serial_close(struct tty_struct *tty, struct file *filp) | |||
281 | if (tty->driver_data) | 281 | if (tty->driver_data) |
282 | tty->driver_data = NULL; | 282 | tty->driver_data = NULL; |
283 | tty_port_tty_set(&port->port, NULL); | 283 | tty_port_tty_set(&port->port, NULL); |
284 | tty_kref_put(tty); | ||
284 | } | 285 | } |
285 | } | 286 | } |
286 | 287 | ||
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig index 3d9249632ae1..c68b738900bd 100644 --- a/drivers/usb/storage/Kconfig +++ b/drivers/usb/storage/Kconfig | |||
@@ -2,8 +2,8 @@ | |||
2 | # USB Storage driver configuration | 2 | # USB Storage driver configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | comment "NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'" | 5 | comment "NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;" |
6 | comment "may also be needed; see USB_STORAGE Help for more information" | 6 | comment "see USB_STORAGE Help for more information" |
7 | depends on USB | 7 | depends on USB |
8 | 8 | ||
9 | config USB_STORAGE | 9 | config USB_STORAGE |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index a2b9ebbef38e..bfcc1fe82518 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -167,6 +167,27 @@ UNUSUAL_DEV( 0x0421, 0x005d, 0x0001, 0x0600, | |||
167 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 167 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
168 | US_FL_FIX_CAPACITY ), | 168 | US_FL_FIX_CAPACITY ), |
169 | 169 | ||
170 | /* Reported by Ozan Sener <themgzzy@gmail.com> */ | ||
171 | UNUSUAL_DEV( 0x0421, 0x0060, 0x0551, 0x0551, | ||
172 | "Nokia", | ||
173 | "3500c", | ||
174 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
175 | US_FL_FIX_CAPACITY ), | ||
176 | |||
177 | /* Reported by CSECSY Laszlo <boobaa@frugalware.org> */ | ||
178 | UNUSUAL_DEV( 0x0421, 0x0063, 0x0001, 0x0601, | ||
179 | "Nokia", | ||
180 | "Nokia 3109c", | ||
181 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
182 | US_FL_FIX_CAPACITY ), | ||
183 | |||
184 | /* Patch for Nokia 5310 capacity */ | ||
185 | UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0701, | ||
186 | "Nokia", | ||
187 | "5310", | ||
188 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
189 | US_FL_FIX_CAPACITY ), | ||
190 | |||
170 | /* Reported by Mario Rettig <mariorettig@web.de> */ | 191 | /* Reported by Mario Rettig <mariorettig@web.de> */ |
171 | UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, | 192 | UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100, |
172 | "Nokia", | 193 | "Nokia", |
@@ -233,14 +254,14 @@ UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370, | |||
233 | US_FL_MAX_SECTORS_64 ), | 254 | US_FL_MAX_SECTORS_64 ), |
234 | 255 | ||
235 | /* Reported by Cedric Godin <cedric@belbone.be> */ | 256 | /* Reported by Cedric Godin <cedric@belbone.be> */ |
236 | UNUSUAL_DEV( 0x0421, 0x04b9, 0x0551, 0x0551, | 257 | UNUSUAL_DEV( 0x0421, 0x04b9, 0x0500, 0x0551, |
237 | "Nokia", | 258 | "Nokia", |
238 | "5300", | 259 | "5300", |
239 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 260 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
240 | US_FL_FIX_CAPACITY ), | 261 | US_FL_FIX_CAPACITY ), |
241 | 262 | ||
242 | /* Reported by Richard Nauber <RichardNauber@web.de> */ | 263 | /* Reported by Richard Nauber <RichardNauber@web.de> */ |
243 | UNUSUAL_DEV( 0x0421, 0x04fa, 0x0601, 0x0601, | 264 | UNUSUAL_DEV( 0x0421, 0x04fa, 0x0550, 0x0660, |
244 | "Nokia", | 265 | "Nokia", |
245 | "6300", | 266 | "6300", |
246 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 267 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
@@ -253,6 +274,14 @@ UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0591, | |||
253 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 274 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
254 | US_FL_FIX_CAPACITY ), | 275 | US_FL_FIX_CAPACITY ), |
255 | 276 | ||
277 | /* Submitted by Ricky Wong Yung Fei <evilbladewarrior@gmail.com> */ | ||
278 | /* Nokia 7610 Supernova - Too many sectors reported in usb storage mode */ | ||
279 | UNUSUAL_DEV( 0x0421, 0x00f5, 0x0000, 0x0470, | ||
280 | "Nokia", | ||
281 | "7610 Supernova", | ||
282 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
283 | US_FL_FIX_CAPACITY ), | ||
284 | |||
256 | /* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */ | 285 | /* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */ |
257 | UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210, | 286 | UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210, |
258 | "SMSC", | 287 | "SMSC", |
@@ -303,6 +332,18 @@ UNUSUAL_DEV( 0x045a, 0x5210, 0x0101, 0x0101, | |||
303 | US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0), | 332 | US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0), |
304 | #endif | 333 | #endif |
305 | 334 | ||
335 | /* Reported by Tamas Kerecsen <kerecsen@bigfoot.com> | ||
336 | * Obviously the PROM has not been customized by the VAR; | ||
337 | * the Vendor and Product string descriptors are: | ||
338 | * Generic Mass Storage (PROTOTYPE--Remember to change idVendor) | ||
339 | * Generic Manufacturer (PROTOTYPE--Remember to change idVendor) | ||
340 | */ | ||
341 | UNUSUAL_DEV( 0x045e, 0xffff, 0x0000, 0x0000, | ||
342 | "Mitac", | ||
343 | "GPS", | ||
344 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
345 | US_FL_MAX_SECTORS_64 ), | ||
346 | |||
306 | /* | 347 | /* |
307 | * This virtual floppy is found in Sun equipment (x4600, x4200m2, etc.) | 348 | * This virtual floppy is found in Sun equipment (x4600, x4200m2, etc.) |
308 | * Reported by Pete Zaitcev <zaitcev@redhat.com> | 349 | * Reported by Pete Zaitcev <zaitcev@redhat.com> |
@@ -333,6 +374,13 @@ UNUSUAL_DEV( 0x0482, 0x0103, 0x0100, 0x0100, | |||
333 | "Finecam S5", | 374 | "Finecam S5", |
334 | US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY), | 375 | US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY), |
335 | 376 | ||
377 | /* Patch submitted by Jens Taprogge <jens.taprogge@taprogge.org> */ | ||
378 | UNUSUAL_DEV( 0x0482, 0x0107, 0x0100, 0x0100, | ||
379 | "Kyocera", | ||
380 | "CONTAX SL300R T*", | ||
381 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
382 | US_FL_FIX_CAPACITY | US_FL_NOT_LOCKABLE), | ||
383 | |||
336 | /* Reported by Paul Stewart <stewart@wetlogic.net> | 384 | /* Reported by Paul Stewart <stewart@wetlogic.net> |
337 | * This entry is needed because the device reports Sub=ff */ | 385 | * This entry is needed because the device reports Sub=ff */ |
338 | UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001, | 386 | UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001, |
@@ -355,6 +403,13 @@ UNUSUAL_DEV( 0x04b0, 0x0401, 0x0200, 0x0200, | |||
355 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 403 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
356 | US_FL_FIX_CAPACITY), | 404 | US_FL_FIX_CAPACITY), |
357 | 405 | ||
406 | /* Reported by Tobias Kunze Briseno <t-linux@fictive.com> */ | ||
407 | UNUSUAL_DEV( 0x04b0, 0x0403, 0x0200, 0x0200, | ||
408 | "NIKON", | ||
409 | "NIKON DSC D2H", | ||
410 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
411 | US_FL_FIX_CAPACITY), | ||
412 | |||
358 | /* Reported by Milinevsky Dmitry <niam.niam@gmail.com> */ | 413 | /* Reported by Milinevsky Dmitry <niam.niam@gmail.com> */ |
359 | UNUSUAL_DEV( 0x04b0, 0x0409, 0x0100, 0x0100, | 414 | UNUSUAL_DEV( 0x04b0, 0x0409, 0x0100, 0x0100, |
360 | "NIKON", | 415 | "NIKON", |
@@ -411,6 +466,13 @@ UNUSUAL_DEV( 0x04b0, 0x0417, 0x0100, 0x0100, | |||
411 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 466 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
412 | US_FL_FIX_CAPACITY), | 467 | US_FL_FIX_CAPACITY), |
413 | 468 | ||
469 | /* Reported by paul ready <lxtwin@homecall.co.uk> */ | ||
470 | UNUSUAL_DEV( 0x04b0, 0x0419, 0x0100, 0x0200, | ||
471 | "NIKON", | ||
472 | "NIKON DSC D300", | ||
473 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
474 | US_FL_FIX_CAPACITY), | ||
475 | |||
414 | /* Reported by Doug Maxey (dwm@austin.ibm.com) */ | 476 | /* Reported by Doug Maxey (dwm@austin.ibm.com) */ |
415 | UNUSUAL_DEV( 0x04b3, 0x4001, 0x0110, 0x0110, | 477 | UNUSUAL_DEV( 0x04b3, 0x4001, 0x0110, 0x0110, |
416 | "IBM", | 478 | "IBM", |
@@ -1251,6 +1313,13 @@ UNUSUAL_DEV( 0x0839, 0x000a, 0x0001, 0x0001, | |||
1251 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 1313 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
1252 | US_FL_FIX_INQUIRY), | 1314 | US_FL_FIX_INQUIRY), |
1253 | 1315 | ||
1316 | /* Reported by Luciano Rocha <luciano@eurotux.com> */ | ||
1317 | UNUSUAL_DEV( 0x0840, 0x0082, 0x0001, 0x0001, | ||
1318 | "Argosy", | ||
1319 | "Storage", | ||
1320 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
1321 | US_FL_FIX_CAPACITY), | ||
1322 | |||
1254 | /* Entry and supporting patch by Theodore Kilgore <kilgota@auburn.edu>. | 1323 | /* Entry and supporting patch by Theodore Kilgore <kilgota@auburn.edu>. |
1255 | * Flag will support Bulk devices which use a standards-violating 32-byte | 1324 | * Flag will support Bulk devices which use a standards-violating 32-byte |
1256 | * Command Block Wrapper. Here, the "DC2MEGA" cameras (several brands) with | 1325 | * Command Block Wrapper. Here, the "DC2MEGA" cameras (several brands) with |