Pull USB driver fixes from Greg KH: "Here are some small USB fixes and new device ids for 4.5-rc2. Nothing major here, full details are in the shortlog, and all of these have been in linux-next successfully" * tag 'usb-4.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: USB: option: fix Cinterion AHxx enumeration USB: mxu11x0: fix memory leak on usb_serial private data USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable USB: serial: option: Adding support for Telit LE922 USB: serial: visor: fix crash on detecting device without write_urbs USB: visor: fix null-deref at probe USB: cp210x: add ID for IAI USB to RS485 adaptor usb: hub: do not clear BOS field during reset device cdc-acm:exclude Samsung phone 04e8:685d usb: cdc-acm: send zero packet for intel 7260 modem usb: cdc-acm: handle unlinked urb in acm read callback
Unified · Split
| @@ -428,7 +428,8 @@ static void acm_read_bulk_callback(struct urb *urb) · 427 unmodified lines | ||
| 428 | 428 | set_bit(rb->index, &acm->read_urbs_free); |
| 429 | 429 | dev_dbg(&acm->data->dev, "%s - non-zero urb status: %d\n", |
| 430 | 430 | __func__, status); |
| 431 | − return; | |
| 431 | + if ((status != -ENOENT) || (urb->actual_length == 0)) | |
| 432 | + return; | |
| 432 | 433 | } |
| 433 | 434 | |
| 434 | 435 | usb_mark_last_busy(acm->dev); |
| @@ -1404,6 +1405,8 @@ made_compressed_probe: · 969 unmodified lines | ||
| 1404 | 1405 | usb_sndbulkpipe(usb_dev, epwrite->bEndpointAddress), |
| 1405 | 1406 | NULL, acm->writesize, acm_write_bulk, snd); |
| 1406 | 1407 | snd->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
| 1408 | + if (quirks & SEND_ZERO_PACKET) | |
| 1409 | + snd->urb->transfer_flags |= URB_ZERO_PACKET; | |
| 1407 | 1410 | snd->instance = acm; |
| 1408 | 1411 | } |
| 1409 | 1412 | |
| @@ -1838,6 +1841,11 @@ static const struct usb_device_id acm_ids[] = { · 428 unmodified lines | ||
| 1838 | 1841 | }, |
| 1839 | 1842 | #endif |
| 1840 | 1843 | |
| 1844 | + /*Samsung phone in firmware update mode */ | |
| 1845 | + { USB_DEVICE(0x04e8, 0x685d), | |
| 1846 | + .driver_info = IGNORE_DEVICE, | |
| 1847 | + }, | |
| 1848 | + | |
| 1841 | 1849 | /* Exclude Infineon Flash Loader utility */ |
| 1842 | 1850 | { USB_DEVICE(0x058b, 0x0041), |
| 1843 | 1851 | .driver_info = IGNORE_DEVICE, |
| @@ -1861,6 +1869,10 @@ static const struct usb_device_id acm_ids[] = { · 17 unmodified lines | ||
| 1861 | 1869 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, |
| 1862 | 1870 | USB_CDC_ACM_PROTO_AT_CDMA) }, |
| 1863 | 1871 | |
| 1872 | + { USB_DEVICE(0x1519, 0x0452), /* Intel 7260 modem */ | |
| 1873 | + .driver_info = SEND_ZERO_PACKET, | |
| 1874 | + }, | |
| 1875 | + | |
| 1864 | 1876 | { } |
| 1865 | 1877 | }; |
| 1866 | 1878 | |
| @@ -134,3 +134,4 @@ struct acm { · 133 unmodified lines | ||
| 134 | 134 | #define IGNORE_DEVICE BIT(5) |
| 135 | 135 | #define QUIRK_CONTROL_LINE_STATE BIT(6) |
| 136 | 136 | #define CLEAR_HALT_CONDITIONS BIT(7) |
| 137 | +#define SEND_ZERO_PACKET BIT(8) | |
| @@ -5401,7 +5401,6 @@ static int usb_reset_and_verify_device(struct usb_device *udev) · 5400 unmodified lines | ||
| 5401 | 5401 | } |
| 5402 | 5402 | |
| 5403 | 5403 | bos = udev->bos; |
| 5404 | − udev->bos = NULL; | |
| 5405 | 5404 | |
| 5406 | 5405 | for (i = 0; i < SET_CONFIG_TRIES; ++i) { |
| 5407 | 5406 | |
| @@ -5494,8 +5493,11 @@ done: · 86 unmodified lines | ||
| 5494 | 5493 | usb_set_usb2_hardware_lpm(udev, 1); |
| 5495 | 5494 | usb_unlocked_enable_lpm(udev); |
| 5496 | 5495 | usb_enable_ltm(udev); |
| 5497 | − usb_release_bos_descriptor(udev); | |
| 5498 | − udev->bos = bos; | |
| 5496 | + /* release the new BOS descriptor allocated by hub_port_init() */ | |
| 5497 | + if (udev->bos != bos) { | |
| 5498 | + usb_release_bos_descriptor(udev); | |
| 5499 | + udev->bos = bos; | |
| 5500 | + } | |
| 5499 | 5501 | return 0; |
| 5500 | 5502 | |
| 5501 | 5503 | re_enumerate: |
| @@ -99,6 +99,7 @@ static const struct usb_device_id id_table[] = { · 98 unmodified lines | ||
| 99 | 99 | { USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */ |
| 100 | 100 | { USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */ |
| 101 | 101 | { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ |
| 102 | + { USB_DEVICE(0x10C4, 0x81D7) }, /* IAI Corp. RCB-CV-USB USB to RS485 Adaptor */ | |
| 102 | 103 | { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ |
| 103 | 104 | { USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */ |
| 104 | 105 | { USB_DEVICE(0x10C4, 0x81E8) }, /* Zephyr Bioharness */ |
| @@ -824,6 +824,7 @@ static const struct usb_device_id id_table_combined[] = { · 823 unmodified lines | ||
| 824 | 824 | { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID), |
| 825 | 825 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
| 826 | 826 | { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, |
| 827 | + { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) }, | |
| 827 | 828 | { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) }, |
| 828 | 829 | |
| 829 | 830 | /* Papouch devices based on FTDI chip */ |
| @@ -615,6 +615,7 @@ · 614 unmodified lines | ||
| 615 | 615 | */ |
| 616 | 616 | #define RATOC_VENDOR_ID 0x0584 |
| 617 | 617 | #define RATOC_PRODUCT_ID_USB60F 0xb020 |
| 618 | +#define RATOC_PRODUCT_ID_SCU18 0xb03a | |
| 618 | 619 | |
| 619 | 620 | /* |
| 620 | 621 | * Infineon Technologies |
| @@ -368,6 +368,16 @@ static int mxu1_port_probe(struct usb_serial_port *port) · 367 unmodified lines | ||
| 368 | 368 | return 0; |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | +static int mxu1_port_remove(struct usb_serial_port *port) | |
| 372 | +{ | |
| 373 | + struct mxu1_port *mxport; | |
| 374 | + | |
| 375 | + mxport = usb_get_serial_port_data(port); | |
| 376 | + kfree(mxport); | |
| 377 | + | |
| 378 | + return 0; | |
| 379 | +} | |
| 380 | + | |
| 371 | 381 | static int mxu1_startup(struct usb_serial *serial) |
| 372 | 382 | { |
| 373 | 383 | struct mxu1_device *mxdev; |
| @@ -427,6 +437,14 @@ err_free_mxdev: · 53 unmodified lines | ||
| 427 | 437 | return err; |
| 428 | 438 | } |
| 429 | 439 | |
| 440 | +static void mxu1_release(struct usb_serial *serial) | |
| 441 | +{ | |
| 442 | + struct mxu1_device *mxdev; | |
| 443 | + | |
| 444 | + mxdev = usb_get_serial_data(serial); | |
| 445 | + kfree(mxdev); | |
| 446 | +} | |
| 447 | + | |
| 430 | 448 | static int mxu1_write_byte(struct usb_serial_port *port, u32 addr, |
| 431 | 449 | u8 mask, u8 byte) |
| 432 | 450 | { |
| @@ -957,7 +975,9 @@ static struct usb_serial_driver mxu11x0_device = { · 524 unmodified lines | ||
| 957 | 975 | .id_table = mxu1_idtable, |
| 958 | 976 | .num_ports = 1, |
| 959 | 977 | .port_probe = mxu1_port_probe, |
| 978 | + .port_remove = mxu1_port_remove, | |
| 960 | 979 | .attach = mxu1_startup, |
| 980 | + .release = mxu1_release, | |
| 961 | 981 | .open = mxu1_open, |
| 962 | 982 | .close = mxu1_close, |
| 963 | 983 | .ioctl = mxu1_ioctl, |
| @@ -268,6 +268,8 @@ static void option_instat_callback(struct urb *urb); · 267 unmodified lines | ||
| 268 | 268 | #define TELIT_PRODUCT_CC864_SINGLE 0x1006 |
| 269 | 269 | #define TELIT_PRODUCT_DE910_DUAL 0x1010 |
| 270 | 270 | #define TELIT_PRODUCT_UE910_V2 0x1012 |
| 271 | +#define TELIT_PRODUCT_LE922_USBCFG0 0x1042 | |
| 272 | +#define TELIT_PRODUCT_LE922_USBCFG3 0x1043 | |
| 271 | 273 | #define TELIT_PRODUCT_LE920 0x1200 |
| 272 | 274 | #define TELIT_PRODUCT_LE910 0x1201 |
| 273 | 275 | |
| @@ -615,6 +617,16 @@ static const struct option_blacklist_info telit_le920_blacklist = { · 341 unmodified lines | ||
| 615 | 617 | .reserved = BIT(1) | BIT(5), |
| 616 | 618 | }; |
| 617 | 619 | |
| 620 | +static const struct option_blacklist_info telit_le922_blacklist_usbcfg0 = { | |
| 621 | + .sendsetup = BIT(2), | |
| 622 | + .reserved = BIT(0) | BIT(1) | BIT(3), | |
| 623 | +}; | |
| 624 | + | |
| 625 | +static const struct option_blacklist_info telit_le922_blacklist_usbcfg3 = { | |
| 626 | + .sendsetup = BIT(0), | |
| 627 | + .reserved = BIT(1) | BIT(2) | BIT(3), | |
| 628 | +}; | |
| 629 | + | |
| 618 | 630 | static const struct usb_device_id option_ids[] = { |
| 619 | 631 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, |
| 620 | 632 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, |
| @@ -1160,6 +1172,10 @@ static const struct usb_device_id option_ids[] = { · 539 unmodified lines | ||
| 1160 | 1172 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) }, |
| 1161 | 1173 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) }, |
| 1162 | 1174 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) }, |
| 1175 | + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0), | |
| 1176 | + .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 }, | |
| 1177 | + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG3), | |
| 1178 | + .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, | |
| 1163 | 1179 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), |
| 1164 | 1180 | .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, |
| 1165 | 1181 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920), |
| @@ -1679,7 +1695,7 @@ static const struct usb_device_id option_ids[] = { · 513 unmodified lines | ||
| 1679 | 1695 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, |
| 1680 | 1696 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8), |
| 1681 | 1697 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
| 1682 | − { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) }, | |
| 1698 | + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX, 0xff) }, | |
| 1683 | 1699 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX), |
| 1684 | 1700 | .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, |
| 1685 | 1701 | { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, |
| @@ -544,6 +544,11 @@ static int treo_attach(struct usb_serial *serial) · 543 unmodified lines | ||
| 544 | 544 | (serial->num_interrupt_in == 0)) |
| 545 | 545 | return 0; |
| 546 | 546 | |
| 547 | + if (serial->num_bulk_in < 2 || serial->num_interrupt_in < 2) { | |
| 548 | + dev_err(&serial->interface->dev, "missing endpoints\n"); | |
| 549 | + return -ENODEV; | |
| 550 | + } | |
| 551 | + | |
| 547 | 552 | /* |
| 548 | 553 | * It appears that Treos and Kyoceras want to use the |
| 549 | 554 | * 1st bulk in endpoint to communicate with the 2nd bulk out endpoint, |
| @@ -597,8 +602,10 @@ static int clie_5_attach(struct usb_serial *serial) · 47 unmodified lines | ||
| 597 | 602 | */ |
| 598 | 603 | |
| 599 | 604 | /* some sanity check */ |
| 600 | − if (serial->num_ports < 2) | |
| 601 | − return -1; | |
| 605 | + if (serial->num_bulk_out < 2) { | |
| 606 | + dev_err(&serial->interface->dev, "missing bulk out endpoints\n"); | |
| 607 | + return -ENODEV; | |
| 608 | + } | |
| 602 | 609 | |
| 603 | 610 | /* port 0 now uses the modified endpoint Address */ |
| 604 | 611 | port = serial->port[0]; |