Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (35 commits)
usb: add PRODUCT, TYPE to usb-interface events
USB: resubmission unusual_devs modification for Nikon D80
usb quirks: Add Canon EOS 5D (PC Connection mode) to the autosuspend blacklist
USB: make EHCI initialize properly on PPC SOCs
UEAGLE: Remove sysfs files on error case
USB: fsl_usb2_udc: fix bug in processing setup requests
USB: g_file_storage: fix bug in DMA buffer handling
USB: update last_busy field correctly
USB: fix DoS in pwc USB video driver
USB: allow retry on descriptor fetch errors
USB: unkill cxacru atm driver
USB: Adding support for HTC Smartphones to ipaq
USB: another quirky device
USB: quirky mass storage device
USB: ohci, fix oddball gcc warning
usb-storage: fix bugs in the disconnect pathway
usb: typo in usb R8A66597 HCD config
USB: accept 1-byte Device Status replies, fixing some b0rken devices
USB: blacklist Samsung ML-2010 printer
usb-serial: fix oti6858.c segfault in termios handling
...

+257 -174
+1
drivers/media/video/em28xx/em28xx-video.c
··· 1772 1772 if (dev->alt_max_pkt_size == NULL) { 1773 1773 em28xx_errdev("out of memory!\n"); 1774 1774 em28xx_devused&=~(1<<nr); 1775 + kfree(dev); 1775 1776 return -ENOMEM; 1776 1777 } 1777 1778
+35 -17
drivers/media/video/pwc/pwc-if.c
··· 1196 1196 return 0; 1197 1197 } 1198 1198 1199 + 1200 + static void pwc_cleanup(struct pwc_device *pdev) 1201 + { 1202 + pwc_remove_sysfs_files(pdev->vdev); 1203 + video_unregister_device(pdev->vdev); 1204 + } 1205 + 1199 1206 /* Note that all cleanup is done in the reverse order as in _open */ 1200 1207 static int pwc_video_close(struct inode *inode, struct file *file) 1201 1208 { 1202 1209 struct video_device *vdev = file->private_data; 1203 1210 struct pwc_device *pdev; 1204 - int i; 1211 + int i, hint; 1205 1212 1206 1213 PWC_DEBUG_OPEN(">> video_close called(vdev = 0x%p).\n", vdev); 1207 1214 ··· 1231 1224 pwc_isoc_cleanup(pdev); 1232 1225 pwc_free_buffers(pdev); 1233 1226 1227 + lock_kernel(); 1234 1228 /* Turn off LEDS and power down camera, but only when not unplugged */ 1235 - if (pdev->error_status != EPIPE) { 1229 + if (!pdev->unplugged) { 1236 1230 /* Turn LEDs off */ 1237 1231 if (pwc_set_leds(pdev, 0, 0) < 0) 1238 1232 PWC_DEBUG_MODULE("Failed to set LED on/off time.\n"); ··· 1242 1234 if (i < 0) 1243 1235 PWC_ERROR("Failed to power down camera (%d)\n", i); 1244 1236 } 1237 + pdev->vopen--; 1238 + PWC_DEBUG_OPEN("<< video_close() vopen=%d\n", i); 1239 + } else { 1240 + pwc_cleanup(pdev); 1241 + /* Free memory (don't set pdev to 0 just yet) */ 1242 + kfree(pdev); 1243 + /* search device_hint[] table if we occupy a slot, by any chance */ 1244 + for (hint = 0; hint < MAX_DEV_HINTS; hint++) 1245 + if (device_hint[hint].pdev == pdev) 1246 + device_hint[hint].pdev = NULL; 1245 1247 } 1246 - pdev->vopen--; 1247 - PWC_DEBUG_OPEN("<< video_close() vopen=%d\n", pdev->vopen); 1248 + unlock_kernel(); 1249 + 1248 1250 return 0; 1249 1251 } 1250 1252 ··· 1809 1791 /* Alert waiting processes */ 1810 1792 wake_up_interruptible(&pdev->frameq); 1811 1793 /* Wait until device is closed */ 1812 - while (pdev->vopen) 1813 - schedule(); 1814 - /* Device is now closed, so we can safely unregister it */ 1815 - PWC_DEBUG_PROBE("Unregistering video device in disconnect().\n"); 1816 - pwc_remove_sysfs_files(pdev->vdev); 1817 - video_unregister_device(pdev->vdev); 1818 - 1819 - /* Free memory (don't set pdev to 0 just yet) */ 1820 - kfree(pdev); 1794 + if(pdev->vopen) { 1795 + pdev->unplugged = 1; 1796 + } else { 1797 + /* Device is closed, so we can safely unregister it */ 1798 + PWC_DEBUG_PROBE("Unregistering video device in disconnect().\n"); 1799 + pwc_cleanup(pdev); 1800 + /* Free memory (don't set pdev to 0 just yet) */ 1801 + kfree(pdev); 1821 1802 1822 1803 disconnect_out: 1823 - /* search device_hint[] table if we occupy a slot, by any chance */ 1824 - for (hint = 0; hint < MAX_DEV_HINTS; hint++) 1825 - if (device_hint[hint].pdev == pdev) 1826 - device_hint[hint].pdev = NULL; 1804 + /* search device_hint[] table if we occupy a slot, by any chance */ 1805 + for (hint = 0; hint < MAX_DEV_HINTS; hint++) 1806 + if (device_hint[hint].pdev == pdev) 1807 + device_hint[hint].pdev = NULL; 1808 + } 1827 1809 1828 1810 unlock_kernel(); 1829 1811 }
+1
drivers/media/video/pwc/pwc.h
··· 193 193 char vsnapshot; /* snapshot mode */ 194 194 char vsync; /* used by isoc handler */ 195 195 char vmirror; /* for ToUCaM series */ 196 + char unplugged; 196 197 197 198 int cmd_len; 198 199 unsigned char cmd_buf[13];
+1
drivers/usb/Kconfig
··· 21 21 default y if USB_ARCH_HAS_EHCI 22 22 default y if PCMCIA && !M32R # sl811_cs 23 23 default y if ARM # SL-811 24 + default y if SUPERH # r8a66597-hcd 24 25 default PCI 25 26 26 27 # many non-PCI SOC chips embed OHCI
+1 -2
drivers/usb/atm/cxacru.c
··· 456 456 int* actual_length) 457 457 { 458 458 struct timer_list timer; 459 - int status = urb->status; 460 459 461 460 init_timer(&timer); 462 461 timer.expires = jiffies + msecs_to_jiffies(CMD_TIMEOUT); ··· 467 468 468 469 if (actual_length) 469 470 *actual_length = urb->actual_length; 470 - return status; 471 + return urb->status; /* must read status after completion */ 471 472 } 472 473 473 474 static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm,
+4 -1
drivers/usb/atm/ueagle-atm.c
··· 1721 1721 1722 1722 ret = uea_boot(sc); 1723 1723 if (ret < 0) 1724 - goto error; 1724 + goto error_rm_grp; 1725 1725 1726 1726 return 0; 1727 + 1728 + error_rm_grp: 1729 + sysfs_remove_group(&intf->dev.kobj, &attr_grp); 1727 1730 error: 1728 1731 kfree(sc); 1729 1732 return ret;
+9 -3
drivers/usb/class/cdc-acm.c
··· 921 921 return -EINVAL; 922 922 } 923 923 } 924 + 925 + /* Accept probe requests only for the control interface */ 926 + if (intf != control_interface) 927 + return -ENODEV; 924 928 925 929 if (usb_interface_claimed(data_interface)) { /* valid in this context */ 926 930 dev_dbg(&intf->dev,"The data interface isn't available"); ··· 1113 1109 return; 1114 1110 } 1115 1111 if (acm->country_codes){ 1116 - device_remove_file(&intf->dev, &dev_attr_wCountryCodes); 1117 - device_remove_file(&intf->dev, &dev_attr_iCountryCodeRelDate); 1112 + device_remove_file(&acm->control->dev, 1113 + &dev_attr_wCountryCodes); 1114 + device_remove_file(&acm->control->dev, 1115 + &dev_attr_iCountryCodeRelDate); 1118 1116 } 1119 - device_remove_file(&intf->dev, &dev_attr_bmCapabilities); 1117 + device_remove_file(&acm->control->dev, &dev_attr_bmCapabilities); 1120 1118 acm->dev = NULL; 1121 1119 usb_set_intfdata(acm->control, NULL); 1122 1120 usb_set_intfdata(acm->data, NULL);
+4 -5
drivers/usb/core/driver.c
··· 1224 1224 udev->auto_pm = 1; 1225 1225 udev->pm_usage_cnt += inc_usage_cnt; 1226 1226 WARN_ON(udev->pm_usage_cnt < 0); 1227 + if (inc_usage_cnt) 1228 + udev->last_busy = jiffies; 1227 1229 if (inc_usage_cnt >= 0 && udev->pm_usage_cnt > 0) { 1228 1230 if (udev->state == USB_STATE_SUSPENDED) 1229 1231 status = usb_resume_both(udev); ··· 1234 1232 else if (inc_usage_cnt) 1235 1233 udev->last_busy = jiffies; 1236 1234 } else if (inc_usage_cnt <= 0 && udev->pm_usage_cnt <= 0) { 1237 - if (inc_usage_cnt) 1238 - udev->last_busy = jiffies; 1239 1235 status = usb_suspend_both(udev, PMSG_SUSPEND); 1240 1236 } 1241 1237 usb_pm_unlock(udev); ··· 1342 1342 else { 1343 1343 udev->auto_pm = 1; 1344 1344 intf->pm_usage_cnt += inc_usage_cnt; 1345 + udev->last_busy = jiffies; 1345 1346 if (inc_usage_cnt >= 0 && intf->pm_usage_cnt > 0) { 1346 1347 if (udev->state == USB_STATE_SUSPENDED) 1347 1348 status = usb_resume_both(udev); 1348 1349 if (status != 0) 1349 1350 intf->pm_usage_cnt -= inc_usage_cnt; 1350 - else if (inc_usage_cnt) 1351 + else 1351 1352 udev->last_busy = jiffies; 1352 1353 } else if (inc_usage_cnt <= 0 && intf->pm_usage_cnt <= 0) { 1353 - if (inc_usage_cnt) 1354 - udev->last_busy = jiffies; 1355 1354 status = usb_suspend_both(udev, PMSG_SUSPEND); 1356 1355 } 1357 1356 }
+2 -1
drivers/usb/core/hub.c
··· 1644 1644 * and device drivers will know about any resume quirks. 1645 1645 */ 1646 1646 if (status == 0) { 1647 + devstatus = 0; 1647 1648 status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); 1648 1649 if (status >= 0) 1649 - status = (status == 2 ? 0 : -ENODEV); 1650 + status = (status > 0 ? 0 : -ENODEV); 1650 1651 } 1651 1652 1652 1653 if (status) {
+26 -2
drivers/usb/core/message.c
··· 637 637 memset(buf,0,size); // Make sure we parse really received data 638 638 639 639 for (i = 0; i < 3; ++i) { 640 - /* retry on length 0 or stall; some devices are flakey */ 640 + /* retry on length 0 or error; some devices are flakey */ 641 641 result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 642 642 USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, 643 643 (type << 8) + index, 0, buf, size, 644 644 USB_CTRL_GET_TIMEOUT); 645 - if (result == 0 || result == -EPIPE) 645 + if (result <= 0 && result != -ETIMEDOUT) 646 646 continue; 647 647 if (result > 1 && ((u8 *)buf)[1] != type) { 648 648 result = -EPROTO; ··· 1357 1357 intf = to_usb_interface(dev); 1358 1358 usb_dev = interface_to_usbdev(intf); 1359 1359 alt = intf->cur_altsetting; 1360 + 1361 + #ifdef CONFIG_USB_DEVICEFS 1362 + if (add_uevent_var(envp, num_envp, &i, 1363 + buffer, buffer_size, &length, 1364 + "DEVICE=/proc/bus/usb/%03d/%03d", 1365 + usb_dev->bus->busnum, usb_dev->devnum)) 1366 + return -ENOMEM; 1367 + #endif 1368 + 1369 + if (add_uevent_var(envp, num_envp, &i, 1370 + buffer, buffer_size, &length, 1371 + "PRODUCT=%x/%x/%x", 1372 + le16_to_cpu(usb_dev->descriptor.idVendor), 1373 + le16_to_cpu(usb_dev->descriptor.idProduct), 1374 + le16_to_cpu(usb_dev->descriptor.bcdDevice))) 1375 + return -ENOMEM; 1376 + 1377 + if (add_uevent_var(envp, num_envp, &i, 1378 + buffer, buffer_size, &length, 1379 + "TYPE=%d/%d/%d", 1380 + usb_dev->descriptor.bDeviceClass, 1381 + usb_dev->descriptor.bDeviceSubClass, 1382 + usb_dev->descriptor.bDeviceProtocol)) 1383 + return -ENOMEM; 1360 1384 1361 1385 if (add_uevent_var(envp, num_envp, &i, 1362 1386 buffer, buffer_size, &length,
+12
drivers/usb/core/quirks.c
··· 30 30 static const struct usb_device_id usb_quirk_list[] = { 31 31 /* HP 5300/5370C scanner */ 32 32 { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, 33 + /* Hewlett-Packard PhotoSmart 720 / PhotoSmart 935 (storage) */ 34 + { USB_DEVICE(0x03f0, 0x4002), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 33 35 /* Acer Peripherals Inc. (now BenQ Corp.) Prisa 640BU */ 34 36 { USB_DEVICE(0x04a5, 0x207e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 35 37 /* Benq S2W 3300U */ ··· 58 56 { USB_DEVICE(0x04b8, 0x0121), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 59 57 /* Seiko Epson Corp.*/ 60 58 { USB_DEVICE(0x04b8, 0x0122), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 59 + /* Samsung ML-2010 printer */ 60 + { USB_DEVICE(0x04e8, 0x326c), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 61 61 /* Samsung ML-2510 Series printer */ 62 62 { USB_DEVICE(0x04e8, 0x327e), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 63 63 /* Elsa MicroLink 56k (V.250) */ ··· 68 64 { USB_DEVICE(0x05d8, 0x4005), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 69 65 /* Agfa Snapscan1212u */ 70 66 { USB_DEVICE(0x06bd, 0x2061), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 67 + /* Seagate RSS LLC */ 68 + { USB_DEVICE(0x0bc2, 0x3000), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 71 69 /* Umax [hex] Astra 3400U */ 72 70 { USB_DEVICE(0x1606, 0x0060), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 73 71 74 72 /* Philips PSC805 audio device */ 75 73 { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, 74 + 75 + /* Alcor multi-card reader */ 76 + { USB_DEVICE(0x058f, 0x6366), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 77 + 78 + /* Canon EOS 5D in PC Connection mode */ 79 + { USB_DEVICE(0x04a9, 0x3101), .driver_info = USB_QUIRK_NO_AUTOSUSPEND }, 76 80 77 81 /* RIM Blackberry */ 78 82 { USB_DEVICE(0x0fca, 0x0001), .driver_info = USB_QUIRK_NO_AUTOSUSPEND },
-2
drivers/usb/gadget/dummy_hcd.c
··· 34 34 * bypassing some hardware (and driver) issues. UML could help too. 35 35 */ 36 36 37 - #define DEBUG 38 - 39 37 #include <linux/module.h> 40 38 #include <linux/kernel.h> 41 39 #include <linux/delay.h>
+4 -6
drivers/usb/gadget/file_storage.c
··· 599 599 600 600 struct fsg_buffhd { 601 601 void *buf; 602 - dma_addr_t dma; 603 602 enum fsg_buffer_state state; 604 603 struct fsg_buffhd *next; 605 604 ··· 1294 1295 struct usb_request *req = fsg->ep0req; 1295 1296 int value = -EOPNOTSUPP; 1296 1297 u16 w_index = le16_to_cpu(ctrl->wIndex); 1298 + u16 w_value = le16_to_cpu(ctrl->wValue); 1297 1299 u16 w_length = le16_to_cpu(ctrl->wLength); 1298 1300 1299 1301 if (!fsg->config) ··· 1308 1308 if (ctrl->bRequestType != (USB_DIR_OUT | 1309 1309 USB_TYPE_CLASS | USB_RECIP_INTERFACE)) 1310 1310 break; 1311 - if (w_index != 0) { 1311 + if (w_index != 0 || w_value != 0) { 1312 1312 value = -EDOM; 1313 1313 break; 1314 1314 } ··· 1324 1324 if (ctrl->bRequestType != (USB_DIR_IN | 1325 1325 USB_TYPE_CLASS | USB_RECIP_INTERFACE)) 1326 1326 break; 1327 - if (w_index != 0) { 1327 + if (w_index != 0 || w_value != 0) { 1328 1328 value = -EDOM; 1329 1329 break; 1330 1330 } ··· 1343 1343 if (ctrl->bRequestType != (USB_DIR_OUT | 1344 1344 USB_TYPE_CLASS | USB_RECIP_INTERFACE)) 1345 1345 break; 1346 - if (w_index != 0) { 1346 + if (w_index != 0 || w_value != 0) { 1347 1347 value = -EDOM; 1348 1348 break; 1349 1349 } ··· 2611 2611 2612 2612 fsg->intr_buffhd = bh; // Point to the right buffhd 2613 2613 fsg->intreq->buf = bh->inreq->buf; 2614 - fsg->intreq->dma = bh->inreq->dma; 2615 2614 fsg->intreq->context = bh; 2616 2615 start_transfer(fsg, fsg->intr_in, fsg->intreq, 2617 2616 &fsg->intreq_busy, &bh->state); ··· 3199 3200 if ((rc = alloc_request(fsg, fsg->bulk_out, &bh->outreq)) != 0) 3200 3201 goto reset; 3201 3202 bh->inreq->buf = bh->outreq->buf = bh->buf; 3202 - bh->inreq->dma = bh->outreq->dma = bh->dma; 3203 3203 bh->inreq->context = bh->outreq->context = bh; 3204 3204 bh->inreq->complete = bulk_in_complete; 3205 3205 bh->outreq->complete = bulk_out_complete;
+41 -36
drivers/usb/gadget/fsl_usb2_udc.c
··· 1277 1277 1278 1278 udc_reset_ep_queue(udc, 0); 1279 1279 1280 + /* We process some stardard setup requests here */ 1280 1281 switch (setup->bRequest) { 1281 - /* Request that need Data+Status phase from udc */ 1282 1282 case USB_REQ_GET_STATUS: 1283 - if ((setup->bRequestType & (USB_DIR_IN | USB_TYPE_STANDARD)) 1283 + /* Data+Status phase from udc */ 1284 + if ((setup->bRequestType & (USB_DIR_IN | USB_TYPE_MASK)) 1284 1285 != (USB_DIR_IN | USB_TYPE_STANDARD)) 1285 1286 break; 1286 1287 ch9getstatus(udc, setup->bRequestType, wValue, wIndex, wLength); 1287 - break; 1288 + return; 1288 1289 1289 - /* Requests that need Status phase from udc */ 1290 1290 case USB_REQ_SET_ADDRESS: 1291 + /* Status phase from udc */ 1291 1292 if (setup->bRequestType != (USB_DIR_OUT | USB_TYPE_STANDARD 1292 1293 | USB_RECIP_DEVICE)) 1293 1294 break; 1294 1295 ch9setaddress(udc, wValue, wIndex, wLength); 1295 - break; 1296 + return; 1296 1297 1297 - /* Handled by udc, no data, status by udc */ 1298 1298 case USB_REQ_CLEAR_FEATURE: 1299 1299 case USB_REQ_SET_FEATURE: 1300 - { /* status transaction */ 1300 + /* Status phase from udc */ 1301 + { 1301 1302 int rc = -EOPNOTSUPP; 1302 1303 1303 - if ((setup->bRequestType & USB_RECIP_MASK) 1304 - == USB_RECIP_ENDPOINT) { 1304 + if ((setup->bRequestType & (USB_RECIP_MASK | USB_TYPE_MASK)) 1305 + == (USB_RECIP_ENDPOINT | USB_TYPE_STANDARD)) { 1305 1306 int pipe = get_pipe_by_windex(wIndex); 1306 1307 struct fsl_ep *ep; 1307 1308 ··· 1316 1315 ? 1 : 0); 1317 1316 spin_lock(&udc->lock); 1318 1317 1319 - } else if ((setup->bRequestType & USB_RECIP_MASK) 1320 - == USB_RECIP_DEVICE) { 1318 + } else if ((setup->bRequestType & (USB_RECIP_MASK 1319 + | USB_TYPE_MASK)) == (USB_RECIP_DEVICE 1320 + | USB_TYPE_STANDARD)) { 1321 1321 /* Note: The driver has not include OTG support yet. 1322 1322 * This will be set when OTG support is added */ 1323 1323 if (!udc->gadget.is_otg) ··· 1331 1329 USB_DEVICE_A_ALT_HNP_SUPPORT) 1332 1330 udc->gadget.a_alt_hnp_support = 1; 1333 1331 rc = 0; 1334 - } 1332 + } else 1333 + break; 1334 + 1335 1335 if (rc == 0) { 1336 1336 if (ep0_prime_status(udc, EP_DIR_IN)) 1337 1337 ep0stall(udc); 1338 1338 } 1339 + return; 1340 + } 1341 + 1342 + default: 1339 1343 break; 1340 1344 } 1341 - /* Requests handled by gadget */ 1342 - default: 1343 - if (wLength) { 1344 - /* Data phase from gadget, status phase from udc */ 1345 - udc->ep0_dir = (setup->bRequestType & USB_DIR_IN) 1346 - ? USB_DIR_IN : USB_DIR_OUT; 1347 - spin_unlock(&udc->lock); 1348 - if (udc->driver->setup(&udc->gadget, 1349 - &udc->local_setup_buff) < 0) 1350 - ep0stall(udc); 1351 - spin_lock(&udc->lock); 1352 - udc->ep0_state = (setup->bRequestType & USB_DIR_IN) 1353 - ? DATA_STATE_XMIT : DATA_STATE_RECV; 1354 1345 1355 - } else { 1356 - /* No data phase, IN status from gadget */ 1357 - udc->ep0_dir = USB_DIR_IN; 1358 - spin_unlock(&udc->lock); 1359 - if (udc->driver->setup(&udc->gadget, 1360 - &udc->local_setup_buff) < 0) 1361 - ep0stall(udc); 1362 - spin_lock(&udc->lock); 1363 - udc->ep0_state = WAIT_FOR_OUT_STATUS; 1364 - } 1365 - break; 1346 + /* Requests handled by gadget */ 1347 + if (wLength) { 1348 + /* Data phase from gadget, status phase from udc */ 1349 + udc->ep0_dir = (setup->bRequestType & USB_DIR_IN) 1350 + ? USB_DIR_IN : USB_DIR_OUT; 1351 + spin_unlock(&udc->lock); 1352 + if (udc->driver->setup(&udc->gadget, 1353 + &udc->local_setup_buff) < 0) 1354 + ep0stall(udc); 1355 + spin_lock(&udc->lock); 1356 + udc->ep0_state = (setup->bRequestType & USB_DIR_IN) 1357 + ? DATA_STATE_XMIT : DATA_STATE_RECV; 1358 + } else { 1359 + /* No data phase, IN status from gadget */ 1360 + udc->ep0_dir = USB_DIR_IN; 1361 + spin_unlock(&udc->lock); 1362 + if (udc->driver->setup(&udc->gadget, 1363 + &udc->local_setup_buff) < 0) 1364 + ep0stall(udc); 1365 + spin_lock(&udc->lock); 1366 + udc->ep0_state = WAIT_FOR_OUT_STATUS; 1366 1367 } 1367 1368 } 1368 1369
+2 -2
drivers/usb/gadget/pxa2xx_udc.c
··· 967 967 udc = container_of(_gadget, struct pxa2xx_udc, gadget); 968 968 969 969 /* not all boards support pullup control */ 970 - if (!udc->mach->udc_command) 970 + if (!udc->mach->gpio_pullup && !udc->mach->udc_command) 971 971 return -EOPNOTSUPP; 972 972 973 973 is_active = (is_active != 0); ··· 2309 2309 { 2310 2310 struct pxa2xx_udc *udc = platform_get_drvdata(dev); 2311 2311 2312 - if (!udc->mach->udc_command) 2312 + if (!udc->mach->gpio_pullup && !udc->mach->udc_command) 2313 2313 WARN("USB host won't detect disconnect!\n"); 2314 2314 pullup(udc, 0); 2315 2315
+1 -1
drivers/usb/host/Kconfig
··· 237 237 module will be called "sl811_cs". 238 238 239 239 config USB_R8A66597_HCD 240 - tristate "R8A66597 HCD suppoort" 240 + tristate "R8A66597 HCD support" 241 241 depends on USB 242 242 help 243 243 The R8A66597 is a USB 2.0 host and peripheral controller.
+3 -2
drivers/usb/host/ehci-au1xxx.c
··· 1 1 /* 2 2 * EHCI HCD (Host Controller Driver) for USB. 3 3 * 4 - * (C) Copyright 2000-2004 David Brownell <dbrownell@users.sourceforge.net> 5 - * 6 4 * Bus Glue for AMD Alchemy Au1xxx 7 5 * 8 6 * Based on "ohci-au1xxx.c" by Matt Porter <mporter@kernel.crashing.org> ··· 194 196 195 197 /* 196 198 * basic lifecycle operations 199 + * 200 + * FIXME -- ehci_init() doesn't do enough here. 201 + * See ehci-ppc-soc for a complete implementation. 197 202 */ 198 203 .reset = ehci_init, 199 204 .start = ehci_run,
+20 -2
drivers/usb/host/ehci-ppc-soc.c
··· 6 6 * Bus Glue for PPC On-Chip EHCI driver 7 7 * Tested on AMCC 440EPx 8 8 * 9 - * Based on "ehci-au12xx.c" by David Brownell <dbrownell@users.sourceforge.net> 9 + * Based on "ehci-au1xxx.c" by K.Boge <karsten.boge@amd.com> 10 10 * 11 11 * This file is licenced under the GPL. 12 12 */ ··· 14 14 #include <linux/platform_device.h> 15 15 16 16 extern int usb_disabled(void); 17 + 18 + /* called during probe() after chip reset completes */ 19 + static int ehci_ppc_soc_setup(struct usb_hcd *hcd) 20 + { 21 + struct ehci_hcd *ehci = hcd_to_ehci(hcd); 22 + int retval; 23 + 24 + retval = ehci_halt(ehci); 25 + if (retval) 26 + return retval; 27 + 28 + retval = ehci_init(hcd); 29 + if (retval) 30 + return retval; 31 + 32 + ehci->sbrn = 0x20; 33 + return ehci_reset(ehci); 34 + } 17 35 18 36 /** 19 37 * usb_ehci_ppc_soc_probe - initialize PPC-SoC-based HCDs ··· 138 120 /* 139 121 * basic lifecycle operations 140 122 */ 141 - .reset = ehci_init, 123 + .reset = ehci_ppc_soc_setup, 142 124 .start = ehci_run, 143 125 .stop = ehci_stop, 144 126 .shutdown = ehci_shutdown,
+1 -1
drivers/usb/host/ohci-dbg.c
··· 74 74 75 75 #define ohci_dbg_sw(ohci, next, size, format, arg...) \ 76 76 do { \ 77 - if (next) { \ 77 + if (next != NULL) { \ 78 78 unsigned s_len; \ 79 79 s_len = scnprintf (*next, *size, format, ## arg ); \ 80 80 *size -= s_len; *next += s_len; \
-2
drivers/usb/host/r8a66597-hcd.c
··· 2208 2208 clean_up: 2209 2209 if (reg) 2210 2210 iounmap(reg); 2211 - if (res) 2212 - release_mem_region(res->start, 1); 2213 2211 2214 2212 return ret; 2215 2213 }
+3
drivers/usb/host/u132-hcd.c
··· 1520 1520 } 1521 1521 } 1522 1522 } 1523 + #ifdef CONFIG_PM 1523 1524 1524 1525 static void port_power(struct u132 *u132, int pn, int is_on) 1525 1526 { 1526 1527 u132->port[pn].power = is_on; 1527 1528 } 1529 + 1530 + #endif 1528 1531 1529 1532 static void u132_power(struct u132 *u132, int is_on) 1530 1533 {
-1
drivers/usb/serial/airprime.c
··· 18 18 19 19 static struct usb_device_id id_table [] = { 20 20 { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ 21 - { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */ 22 21 { }, 23 22 }; 24 23 MODULE_DEVICE_TABLE(usb, id_table);
+4
drivers/usb/serial/belkin_sa.c
··· 383 383 } 384 384 385 385 baud = tty_get_baud_rate(port->tty); 386 + if (baud == 0) { 387 + dbg("%s - tty_get_baud_rate says 0 baud", __FUNCTION__); 388 + return; 389 + } 386 390 urb_value = BELKIN_SA_BAUD(baud); 387 391 /* Clip to maximum speed */ 388 392 if (urb_value == 0)
+2
drivers/usb/serial/ftdi_sio.c
··· 538 538 { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, 539 539 { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, 540 540 { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, 541 + { USB_DEVICE(EVOLUTION_VID, EVO_HYBRID_PID) }, 542 + { USB_DEVICE(EVOLUTION_VID, EVO_RCM4_PID) }, 541 543 { USB_DEVICE(FTDI_VID, FTDI_ARTEMIS_PID) }, 542 544 { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16_PID) }, 543 545 { USB_DEVICE(FTDI_VID, FTDI_ATIK_ATK16C_PID) },
+3
drivers/usb/serial/ftdi_sio.h
··· 430 430 */ 431 431 #define EVOLUTION_VID 0xDEEE /* Vendor ID */ 432 432 #define EVOLUTION_ER1_PID 0x0300 /* ER1 Control Module */ 433 + #define EVO_8U232AM_PID 0x02FF /* Evolution robotics RCM2 (FT232AM)*/ 434 + #define EVO_HYBRID_PID 0x0302 /* Evolution robotics RCM4 PID (FT232BM)*/ 435 + #define EVO_RCM4_PID 0x0303 /* Evolution robotics RCM4 PID */ 433 436 434 437 /* Pyramid Computer GmbH */ 435 438 #define FTDI_PYRAMID_PID 0xE6C8 /* Pyramid Appliance Display */
+49 -48
drivers/usb/serial/garmin_gps.c
··· 1 1 /* 2 2 * Garmin GPS driver 3 3 * 4 - * Copyright (C) 2006 Hermann Kneissel herkne@users.sourceforge.net 4 + * Copyright (C) 2006,2007 Hermann Kneissel herkne@users.sourceforge.net 5 5 * 6 6 * The latest version of the driver can be found at 7 7 * http://sourceforge.net/projects/garmin-gps/ ··· 34 34 #include <linux/module.h> 35 35 #include <linux/spinlock.h> 36 36 #include <asm/uaccess.h> 37 + #include <asm/atomic.h> 37 38 #include <linux/usb.h> 38 39 #include <linux/usb/serial.h> 39 40 ··· 53 52 */ 54 53 55 54 #define VERSION_MAJOR 0 56 - #define VERSION_MINOR 28 55 + #define VERSION_MINOR 31 57 56 58 57 #define _STR(s) #s 59 58 #define _DRIVER_VERSION(a,b) "v" _STR(a) "." _STR(b) ··· 142 141 __u8 inbuffer [GPS_IN_BUFSIZ]; /* tty -> usb */ 143 142 __u8 outbuffer[GPS_OUT_BUFSIZ]; /* usb -> tty */ 144 143 __u8 privpkt[4*6]; 144 + atomic_t req_count; 145 + atomic_t resp_count; 145 146 spinlock_t lock; 146 147 struct list_head pktlist; 147 148 }; ··· 174 171 #define CLEAR_HALT_REQUIRED 0x0001 175 172 176 173 #define FLAGS_QUEUING 0x0100 177 - #define FLAGS_APP_RESP_SEEN 0x0200 178 - #define FLAGS_APP_REQ_SEEN 0x0400 179 174 #define FLAGS_DROP_DATA 0x0800 180 175 181 176 #define FLAGS_GSP_SKIP 0x1000 ··· 187 186 /* function prototypes */ 188 187 static void gsp_next_packet(struct garmin_data * garmin_data_p); 189 188 static int garmin_write_bulk(struct usb_serial_port *port, 190 - const unsigned char *buf, int count); 189 + const unsigned char *buf, int count, 190 + int dismiss_ack); 191 191 192 192 /* some special packets to be send or received */ 193 193 static unsigned char const GARMIN_START_SESSION_REQ[] ··· 235 233 236 234 static inline int noResponseFromAppLayer(struct garmin_data * garmin_data_p) 237 235 { 238 - return ((garmin_data_p->flags 239 - & (FLAGS_APP_REQ_SEEN|FLAGS_APP_RESP_SEEN)) 240 - == FLAGS_APP_REQ_SEEN); 236 + return atomic_read(&garmin_data_p->req_count) == atomic_read(&garmin_data_p->resp_count); 241 237 } 242 238 243 239 ··· 463 463 usbdata[2] = __cpu_to_le32(size); 464 464 465 465 garmin_write_bulk (garmin_data_p->port, garmin_data_p->inbuffer, 466 - GARMIN_PKTHDR_LENGTH+size); 466 + GARMIN_PKTHDR_LENGTH+size, 0); 467 467 468 468 /* if this was an abort-transfer command, flush all 469 469 queued data. */ ··· 818 818 if (garmin_data_p->insize >= len) { 819 819 garmin_write_bulk (garmin_data_p->port, 820 820 garmin_data_p->inbuffer, 821 - len); 821 + len, 0); 822 822 garmin_data_p->insize = 0; 823 823 824 824 /* if this was an abort-transfer command, ··· 893 893 894 894 struct usb_serial_port *port = garmin_data_p->port; 895 895 896 - if (port != NULL && garmin_data_p->flags & FLAGS_APP_RESP_SEEN) { 896 + if (port != NULL && atomic_read(&garmin_data_p->resp_count)) { 897 897 /* send a terminate command */ 898 898 status = garmin_write_bulk(port, GARMIN_STOP_TRANSFER_REQ, 899 - sizeof(GARMIN_STOP_TRANSFER_REQ)); 899 + sizeof(GARMIN_STOP_TRANSFER_REQ), 900 + 1); 900 901 } 901 902 902 903 /* flush all queued data */ ··· 940 939 dbg("%s - starting session ...", __FUNCTION__); 941 940 garmin_data_p->state = STATE_ACTIVE; 942 941 status = garmin_write_bulk(port, GARMIN_START_SESSION_REQ, 943 - sizeof(GARMIN_START_SESSION_REQ)); 942 + sizeof(GARMIN_START_SESSION_REQ), 943 + 0); 944 944 945 945 if (status >= 0) { 946 946 ··· 952 950 /* not needed, but the win32 driver does it too ... */ 953 951 status = garmin_write_bulk(port, 954 952 GARMIN_START_SESSION_REQ2, 955 - sizeof(GARMIN_START_SESSION_REQ2)); 953 + sizeof(GARMIN_START_SESSION_REQ2), 954 + 0); 956 955 if (status >= 0) { 957 956 status = 0; 958 957 spin_lock_irqsave(&garmin_data_p->lock, flags); ··· 990 987 garmin_data_p->mode = initial_mode; 991 988 garmin_data_p->count = 0; 992 989 garmin_data_p->flags = 0; 990 + atomic_set(&garmin_data_p->req_count, 0); 991 + atomic_set(&garmin_data_p->resp_count, 0); 993 992 spin_unlock_irqrestore(&garmin_data_p->lock, flags); 994 993 995 994 /* shutdown any bulk reads that might be going on */ ··· 1040 1035 { 1041 1036 unsigned long flags; 1042 1037 struct usb_serial_port *port = (struct usb_serial_port *)urb->context; 1043 - struct garmin_data * garmin_data_p = usb_get_serial_port_data(port); 1044 1038 int status = urb->status; 1039 + 1040 + if (port) { 1041 + struct garmin_data * garmin_data_p = usb_get_serial_port_data(port); 1042 + 1043 + dbg("%s - port %d", __FUNCTION__, port->number); 1044 + 1045 + if (GARMIN_LAYERID_APPL == getLayerId(urb->transfer_buffer) 1046 + && (garmin_data_p->mode == MODE_GARMIN_SERIAL)) { 1047 + gsp_send_ack(garmin_data_p, ((__u8 *)urb->transfer_buffer)[4]); 1048 + } 1049 + 1050 + if (status) { 1051 + dbg("%s - nonzero write bulk status received: %d", 1052 + __FUNCTION__, urb->status); 1053 + spin_lock_irqsave(&garmin_data_p->lock, flags); 1054 + garmin_data_p->flags |= CLEAR_HALT_REQUIRED; 1055 + spin_unlock_irqrestore(&garmin_data_p->lock, flags); 1056 + } 1057 + 1058 + usb_serial_port_softint(port); 1059 + } 1060 + 1061 + /* Ignore errors that resulted from garmin_write_bulk with dismiss_ack=1 */ 1045 1062 1046 1063 /* free up the transfer buffer, as usb_free_urb() does not do this */ 1047 1064 kfree (urb->transfer_buffer); 1048 - 1049 - dbg("%s - port %d", __FUNCTION__, port->number); 1050 - 1051 - if (status) { 1052 - dbg("%s - nonzero write bulk status received: %d", 1053 - __FUNCTION__, status); 1054 - spin_lock_irqsave(&garmin_data_p->lock, flags); 1055 - garmin_data_p->flags |= CLEAR_HALT_REQUIRED; 1056 - spin_unlock_irqrestore(&garmin_data_p->lock, flags); 1057 - } 1058 - 1059 - usb_serial_port_softint(port); 1060 1065 } 1061 1066 1062 1067 1063 1068 static int garmin_write_bulk (struct usb_serial_port *port, 1064 - const unsigned char *buf, int count) 1069 + const unsigned char *buf, int count, 1070 + int dismiss_ack) 1065 1071 { 1066 1072 unsigned long flags; 1067 1073 struct usb_serial *serial = port->serial; ··· 1109 1093 usb_sndbulkpipe (serial->dev, 1110 1094 port->bulk_out_endpointAddress), 1111 1095 buffer, count, 1112 - garmin_write_bulk_callback, port); 1096 + garmin_write_bulk_callback, 1097 + dismiss_ack ? NULL : port); 1113 1098 urb->transfer_flags |= URB_ZERO_PACKET; 1114 1099 1115 1100 if (GARMIN_LAYERID_APPL == getLayerId(buffer)) { 1116 - spin_lock_irqsave(&garmin_data_p->lock, flags); 1117 - garmin_data_p->flags |= FLAGS_APP_REQ_SEEN; 1118 - spin_unlock_irqrestore(&garmin_data_p->lock, flags); 1101 + atomic_inc(&garmin_data_p->req_count); 1119 1102 if (garmin_data_p->mode == MODE_GARMIN_SERIAL) { 1120 1103 pkt_clear(garmin_data_p); 1121 1104 garmin_data_p->state = STATE_GSP_WAIT_DATA; ··· 1129 1114 "failed with status = %d\n", 1130 1115 __FUNCTION__, status); 1131 1116 count = status; 1132 - } else { 1133 - 1134 - if (GARMIN_LAYERID_APPL == getLayerId(buffer) 1135 - && (garmin_data_p->mode == MODE_GARMIN_SERIAL)) { 1136 - 1137 - gsp_send_ack(garmin_data_p, buffer[4]); 1138 - } 1139 1117 } 1140 1118 1141 1119 /* we are done with this urb, so let the host driver ··· 1143 1135 static int garmin_write (struct usb_serial_port *port, 1144 1136 const unsigned char *buf, int count) 1145 1137 { 1146 - unsigned long flags; 1147 1138 int pktid, pktsiz, len; 1148 1139 struct garmin_data * garmin_data_p = usb_get_serial_port_data(port); 1149 1140 __le32 *privpkt = (__le32 *)garmin_data_p->privpkt; ··· 1193 1186 break; 1194 1187 1195 1188 case PRIV_PKTID_RESET_REQ: 1196 - spin_lock_irqsave(&garmin_data_p->lock, flags); 1197 - garmin_data_p->flags |= FLAGS_APP_REQ_SEEN; 1198 - spin_unlock_irqrestore(&garmin_data_p->lock, flags); 1189 + atomic_inc(&garmin_data_p->req_count); 1199 1190 break; 1200 1191 1201 1192 case PRIV_PKTID_SET_DEF_MODE: ··· 1246 1241 static void garmin_read_process(struct garmin_data * garmin_data_p, 1247 1242 unsigned char *data, unsigned data_length) 1248 1243 { 1249 - unsigned long flags; 1250 - 1251 1244 if (garmin_data_p->flags & FLAGS_DROP_DATA) { 1252 1245 /* abort-transfer cmd is actice */ 1253 1246 dbg("%s - pkt dropped", __FUNCTION__); ··· 1257 1254 the device */ 1258 1255 if (0 == memcmp(data, GARMIN_APP_LAYER_REPLY, 1259 1256 sizeof(GARMIN_APP_LAYER_REPLY))) { 1260 - spin_lock_irqsave(&garmin_data_p->lock, flags); 1261 - garmin_data_p->flags |= FLAGS_APP_RESP_SEEN; 1262 - spin_unlock_irqrestore(&garmin_data_p->lock, flags); 1257 + atomic_inc(&garmin_data_p->resp_count); 1263 1258 } 1264 1259 1265 1260 /* if throttling is active or postprecessing is required
+1
drivers/usb/serial/ipaq.c
··· 545 545 { USB_DEVICE(0x413C, 0x4009) }, /* Dell Axim USB Sync */ 546 546 { USB_DEVICE(0x4505, 0x0010) }, /* Smartphone */ 547 547 { USB_DEVICE(0x5E04, 0xCE00) }, /* SAGEM Wireless Assistant */ 548 + { USB_DEVICE(0x0BB4, 0x00CF) }, /* HTC smartphone modems */ 548 549 { } /* Terminating entry */ 549 550 }; 550 551
+7 -3
drivers/usb/serial/option.c
··· 110 110 #define HUAWEI_PRODUCT_E220 0x1003 111 111 112 112 #define NOVATELWIRELESS_VENDOR_ID 0x1410 113 + #define DELL_VENDOR_ID 0x413C 113 114 114 115 #define ANYDATA_VENDOR_ID 0x16d5 115 116 #define ANYDATA_PRODUCT_ADU_E100A 0x6501 ··· 119 118 #define BANDRICH_VENDOR_ID 0x1A8D 120 119 #define BANDRICH_PRODUCT_C100_1 0x1002 121 120 #define BANDRICH_PRODUCT_C100_2 0x1003 122 - 123 - #define DELL_VENDOR_ID 0x413C 124 121 125 122 static struct usb_device_id option_ids[] = { 126 123 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, ··· 170 171 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ 171 172 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ 172 173 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */ 174 + { USB_DEVICE(DELL_VENDOR_ID, 0x8114) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ 175 + { USB_DEVICE(DELL_VENDOR_ID, 0x8115) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ 176 + { USB_DEVICE(DELL_VENDOR_ID, 0x8116) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ 177 + { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */ 178 + { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */ 179 + { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */ 173 180 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, 174 181 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, 175 182 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, 176 183 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, 177 - { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard */ 178 184 { } /* Terminating entry */ 179 185 }; 180 186 MODULE_DEVICE_TABLE(usb, option_ids);
+4 -6
drivers/usb/serial/oti6858.c
··· 818 818 819 819 switch (cmd) { 820 820 case TCGETS: 821 - if (copy_to_user(user_arg, port->tty->termios, 822 - sizeof(struct ktermios))) { 821 + if (kernel_termios_to_user_termios((struct ktermios __user *)arg, 822 + port->tty->termios)) 823 823 return -EFAULT; 824 - } 825 824 return 0; 826 825 827 826 case TCSETS: 828 827 case TCSETSW: /* FIXME: this is not the same! */ 829 828 case TCSETSF: /* FIXME: this is not the same! */ 830 - if (copy_from_user(port->tty->termios, user_arg, 831 - sizeof(struct ktermios))) { 829 + if (user_termios_to_kernel_termios(port->tty->termios, 830 + (struct ktermios __user *)arg)) 832 831 return -EFAULT; 833 - } 834 832 oti6858_set_termios(port, NULL); 835 833 return 0; 836 834
+3 -3
drivers/usb/serial/safe_serial.c
··· 74 74 #include <linux/usb/serial.h> 75 75 76 76 77 - #ifndef CONFIG_USB_SAFE_PADDED 78 - #define CONFIG_USB_SAFE_PADDED 0 77 + #ifndef CONFIG_USB_SERIAL_SAFE_PADDED 78 + #define CONFIG_USB_SERIAL_SAFE_PADDED 0 79 79 #endif 80 80 81 81 static int debug; 82 82 static int safe = 1; 83 - static int padded = CONFIG_USB_SAFE_PADDED; 83 + static int padded = CONFIG_USB_SERIAL_SAFE_PADDED; 84 84 85 85 #define DRIVER_VERSION "v0.0b" 86 86 #define DRIVER_AUTHOR "sl@lineo.com, tbr@lineo.com"
+2
drivers/usb/serial/visor.c
··· 104 104 .driver_info = (kernel_ulong_t)&palm_os_4_probe }, 105 105 { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_TJ25_ID), 106 106 .driver_info = (kernel_ulong_t)&palm_os_4_probe }, 107 + { USB_DEVICE(ACER_VENDOR_ID, ACER_S10_ID), 108 + .driver_info = (kernel_ulong_t)&palm_os_4_probe }, 107 109 { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID), 108 110 .driver_info = (kernel_ulong_t)&palm_os_4_probe }, 109 111 { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SPH_I500_ID),
+3
drivers/usb/serial/visor.h
··· 48 48 #define SONY_CLIE_UX50_ID 0x0144 49 49 #define SONY_CLIE_TJ25_ID 0x0169 50 50 51 + #define ACER_VENDOR_ID 0x0502 52 + #define ACER_S10_ID 0x0001 53 + 51 54 #define SAMSUNG_VENDOR_ID 0x04E8 52 55 #define SAMSUNG_SCH_I330_ID 0x8001 53 56 #define SAMSUNG_SPH_I500_ID 0x6601
+1 -1
drivers/usb/storage/unusual_devs.h
··· 342 342 US_FL_FIX_CAPACITY), 343 343 344 344 /* Reported by Emil Larsson <emil@swip.net> */ 345 - UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0100, 345 + UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0101, 346 346 "NIKON", 347 347 "NIKON DSC D80", 348 348 US_SC_DEVICE, US_PR_DEVICE, NULL,
+6 -27
drivers/usb/storage/usb.c
··· 112 112 MODULE_PARM_DESC(delay_use, "seconds to delay before using a new device"); 113 113 114 114 115 - /* These are used to make sure the module doesn't unload before all the 116 - * threads have exited. 117 - */ 118 - static atomic_t total_threads = ATOMIC_INIT(0); 119 - static DECLARE_COMPLETION(threads_gone); 120 - 121 - 122 115 /* 123 116 * The entries in this table correspond, line for line, 124 117 * with the entries of us_unusual_dev_list[]. ··· 872 879 usb_stor_stop_transport(us); 873 880 wake_up(&us->delay_wait); 874 881 875 - /* It doesn't matter if the SCSI-scanning thread is still running. 876 - * The thread will exit when it sees the DISCONNECTING flag. */ 877 - 878 882 /* queuecommand won't accept any new commands and the control 879 883 * thread won't execute a previously-queued command. If there 880 884 * is such a command pending, complete it with an error. */ ··· 881 891 scsi_lock(host); 882 892 us->srb->scsi_done(us->srb); 883 893 us->srb = NULL; 894 + complete(&us->notify); /* in case of an abort */ 884 895 scsi_unlock(host); 885 896 } 886 897 mutex_unlock(&us->dev_mutex); 887 898 888 899 /* Now we own no commands so it's safe to remove the SCSI host */ 889 900 scsi_remove_host(host); 901 + 902 + /* Wait for the SCSI-scanning thread to stop */ 903 + wait_for_completion(&us->scanning_done); 890 904 } 891 905 892 906 /* Second stage of disconnect processing: deallocate all resources */ ··· 941 947 /* Should we unbind if no devices were detected? */ 942 948 } 943 949 944 - scsi_host_put(us_to_host(us)); 945 950 usb_autopm_put_interface(us->pusb_intf); 946 - complete_and_exit(&threads_gone, 0); 951 + complete_and_exit(&us->scanning_done, 0); 947 952 } 948 953 949 954 ··· 977 984 init_MUTEX_LOCKED(&(us->sema)); 978 985 init_completion(&(us->notify)); 979 986 init_waitqueue_head(&us->delay_wait); 987 + init_completion(&us->scanning_done); 980 988 981 989 /* Associate the us_data structure with the USB device */ 982 990 result = associate_dev(us, intf); ··· 1027 1033 goto BadDevice; 1028 1034 } 1029 1035 1030 - /* Take a reference to the host for the scanning thread and 1031 - * count it among all the threads we have launched. Then 1032 - * start it up. */ 1033 - scsi_host_get(us_to_host(us)); 1034 - atomic_inc(&total_threads); 1035 1036 usb_autopm_get_interface(intf); /* dropped in the scanning thread */ 1036 1037 wake_up_process(th); 1037 1038 ··· 1092 1103 */ 1093 1104 US_DEBUGP("-- calling usb_deregister()\n"); 1094 1105 usb_deregister(&usb_storage_driver) ; 1095 - 1096 - /* Don't return until all of our control and scanning threads 1097 - * have exited. Since each thread signals threads_gone as its 1098 - * last act, we have to call wait_for_completion the right number 1099 - * of times. 1100 - */ 1101 - while (atomic_read(&total_threads) > 0) { 1102 - wait_for_completion(&threads_gone); 1103 - atomic_dec(&total_threads); 1104 - } 1105 1106 1106 1107 usb_usual_clear_present(USB_US_TYPE_STOR); 1107 1108 }
+1
drivers/usb/storage/usb.h
··· 150 150 struct semaphore sema; /* to sleep thread on */ 151 151 struct completion notify; /* thread begin/end */ 152 152 wait_queue_head_t delay_wait; /* wait during scan, reset */ 153 + struct completion scanning_done; /* wait for scan thread */ 153 154 154 155 /* subdriver information */ 155 156 void *extra; /* Any extra data */