Commit Graph

341 Commits

Author SHA1 Message Date
Desnes Nunes 92c74e689f USB: class: CDC-ACM: fix race between get_serial and set_serial
JIRA: https://issues.redhat.com/browse/RHEL-59052

commit b41c1fa155ba56d125885b0191aabaf3c508d0a3
Author: Oliver Neukum <oneukum@suse.com>
Date: Thu, 12 Sep 2024 16:19:06 +0200

  TIOCGSERIAL is an ioctl. Thus it must be atomic. It returns
  two values. Racing with set_serial it can return an inconsistent
  result. The mutex must be taken.

  In terms of logic the bug is as old as the driver. In terms of
  code it goes back to the conversion to the get_serial and
  set_serial methods.

  Signed-off-by: Oliver Neukum <oneukum@suse.com>
  Cc: stable <stable@kernel.org>
  Fixes: 99f75a1fcd ("cdc-acm: switch to ->[sg]et_serial()")
  Link: https://lore.kernel.org/r/20240912141916.1044393-1-oneukum@suse.com
  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2024-12-13 11:26:40 -03:00
Desnes Nunes cea4711377 cdc-acm: Add DISABLE_ECHO quirk for GE HealthCare UI Controller
JIRA: https://issues.redhat.com/browse/RHEL-59051

commit 0b00583ecacb0b51712a5ecd34cf7e6684307c67
Author: Ian Ray <ian.ray@gehealthcare.com>
Date: Wed, 14 Aug 2024 10:29:05 +0300

  USB_DEVICE(0x1901, 0x0006) may send data before cdc_acm is ready, which
  may be misinterpreted in the default N_TTY line discipline.

  Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
  Acked-by: Oliver Neuku <oneukum@suse.com>
  Cc: stable <stable@kernel.org>
  Link: https://lore.kernel.org/r/20240814072905.2501-1-ian.ray@gehealthcare.com
  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2024-11-07 23:01:43 -03:00
Desnes Nunes e165c25833 usb: cdc-acm: return correct error code on unsupported break
JIRA: https://issues.redhat.com/browse/RHEL-34114

commit 66aad7d8d3ec5a3a8ec2023841bcec2ded5f65c9
Author: Oliver Neukum <oneukum@suse.com>
Date: Thu, 7 Dec 2023 14:26:30 +0100

  In ACM support for sending breaks to devices is optional.
  If a device says that it doenot support sending breaks,
  the host must respect that.
  Given the number of optional features providing tty operations
  for each combination is not practical and errors need to be
  returned dynamically if unsupported features are requested.

  In case a device does not support break, we want the tty layer
  to treat that like it treats drivers that statically cannot
  support sending a break. It ignores the inability and does nothing.
  This patch uses EOPNOTSUPP to indicate that.

  Signed-off-by: Oliver Neukum <oneukum@suse.com>
  Fixes: 9e98966c7b ("tty: rework break handling")
  Link: https://lore.kernel.org/r/20231207132639.18250-1-oneukum@suse.com
  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2024-05-20 13:28:46 -03:00
Andrew Halaney a56a61b376 tty: make tty_operations::write()'s count size_t
JIRA: https://issues.redhat.com/browse/RHEL-24205
Conflicts: tty3270 changes had to be applied by hand due
           to driver being out of date in cs9.

commit 95713967ba52389f7cea75704d0cf048080ec218
Author: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Date:   Thu Aug 10 11:15:03 2023 +0200

    tty: make tty_operations::write()'s count size_t

    Unify with the rest of the code. Use size_t for counts and ssize_t for
    retval.

    Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
    Link: https://lore.kernel.org/r/20230810091510.13006-30-jirislaby@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
2024-05-09 11:25:57 -04:00
Andrew Halaney 269e4d489d tty: propagate u8 data to tty_operations::write()
JIRA: https://issues.redhat.com/browse/RHEL-24205
Conflicts: tty3270 changes had to be applied by hand due
           to driver being out of date in cs9.

commit 69851e4ab8feeb369119a44ddca430c0ee15f0d8
Author: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Date:   Thu Aug 10 11:15:01 2023 +0200

    tty: propagate u8 data to tty_operations::write()

    Data are now typed as u8. Propagate this change to
    tty_operations::write().

    Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
    Cc: Richard Henderson <richard.henderson@linaro.org>
    Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
    Cc: Matt Turner <mattst88@gmail.com>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Cc: Richard Weinberger <richard@nod.at>
    Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
    Cc: Johannes Berg <johannes@sipsolutions.net>
    Cc: Chris Zankel <chris@zankel.net>
    Cc: Max Filippov <jcmvbkbc@gmail.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Vaibhav Gupta <vaibhavgupta40@gmail.com>
    Cc: Jens Taprogge <jens.taprogge@taprogge.org>
    Cc: Karsten Keil <isdn@linux-pingi.de>
    Cc: Scott Branden <scott.branden@broadcom.com>
    Cc: Ulf Hansson <ulf.hansson@linaro.org>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Eric Dumazet <edumazet@google.com>
    Cc: Jakub Kicinski <kuba@kernel.org>
    Cc: Paolo Abeni <pabeni@redhat.com>
    Cc: Heiko Carstens <hca@linux.ibm.com>
    Cc: Vasily Gorbik <gor@linux.ibm.com>
    Cc: Alexander Gordeev <agordeev@linux.ibm.com>
    Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
    Cc: Sven Schnelle <svens@linux.ibm.com>
    Cc: David Lin <dtwlin@gmail.com>
    Cc: Johan Hovold <johan@kernel.org>
    Cc: Alex Elder <elder@kernel.org>
    Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com>
    Cc: Jiri Kosina <jikos@kernel.org>
    Cc: David Sterba <dsterba@suse.com>
    Cc: Shawn Guo <shawnguo@kernel.org>
    Cc: Sascha Hauer <s.hauer@pengutronix.de>
    Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
    Cc: Fabio Estevam <festevam@gmail.com>
    Cc: NXP Linux Team <linux-imx@nxp.com>
    Cc: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
    Cc: Oliver Neukum <oneukum@suse.com>
    Cc: Mathias Nyman <mathias.nyman@intel.com>
    Cc: Marcel Holtmann <marcel@holtmann.org>
    Cc: Johan Hedberg <johan.hedberg@gmail.com>
    Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
    Link: https://lore.kernel.org/r/20230810091510.13006-28-jirislaby@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
2024-05-09 11:25:57 -04:00
Andrew Halaney b9b348ac7f tty: Call ->dtr_rts() parameter active consistently
JIRA: https://issues.redhat.com/browse/RHEL-24205

commit 5701cb8bf50e1c723553344b3f731b308da8ea21
Author: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Date:   Tue Jan 17 11:03:57 2023 +0200

    tty: Call ->dtr_rts() parameter active consistently

    Convert various parameter names for ->dtr_rts() and related functions
    from onoff, on, and raise to active.

    Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
    Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://lore.kernel.org/r/20230117090358.4796-12-ilpo.jarvinen@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
2024-05-09 11:25:29 -04:00
Andrew Halaney 1160555197 tty: Convert ->dtr_rts() to take bool argument
JIRA: https://issues.redhat.com/browse/RHEL-24205

commit 5d420399073770134d2b03e004b2c0201c7fa26f
Author: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Date:   Tue Jan 17 11:03:53 2023 +0200

    tty: Convert ->dtr_rts() to take bool argument

    Convert the raise/on parameter in ->dtr_rts() to bool through the
    callchain. The parameter is used like bool. In USB serial, there
    remains a few implicit bool -> larger type conversions because some
    devices use u8 in their control messages.

    In moxa_tiocmget(), dtr variable was reused for line status which
    requires int so use a separate variable for status.

    Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
    Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://lore.kernel.org/r/20230117090358.4796-8-ilpo.jarvinen@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
2024-05-09 11:25:29 -04:00
Andrew Halaney f03616d42b tty: Make ->set_termios() old ktermios const
JIRA: https://issues.redhat.com/browse/RHEL-24205

commit a8c11c1520347be74b02312d10ef686b01b525f1
Author: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Date:   Tue Aug 16 14:57:39 2022 +0300

    tty: Make ->set_termios() old ktermios const

    There should be no reason to adjust old ktermios which is going to get
    discarded anyway.

    Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://lore.kernel.org/r/20220816115739.10928-9-ilpo.jarvinen@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
2024-05-09 11:25:05 -04:00
Andrew Halaney 8811d387ee tty: drop put_tty_driver
JIRA: https://issues.redhat.com/browse/RHEL-24205
Conflicts: Minor context diffs, the replacement of put_tty_driver()
           with tty_driver_kref_put() doesn't depend on any of the
           context diffs to be correct.

commit 9f90a4ddef4e4d3aa4229f6b117d4e57231457b3
Author: Jiri Slaby <jirislaby@kernel.org>
Date:   Fri Jul 23 09:43:16 2021 +0200

    tty: drop put_tty_driver

    put_tty_driver() is an alias for tty_driver_kref_put(). There is no need
    for two exported identical functions, therefore switch all users of
    old put_tty_driver() to new tty_driver_kref_put() and remove the former
    for good.

    Cc: Richard Henderson <rth@twiddle.net>
    Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
    Cc: Matt Turner <mattst88@gmail.com>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Cc: Jeff Dike <jdike@addtoit.com>
    Cc: Richard Weinberger <richard@nod.at>
    Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
    Cc: Chris Zankel <chris@zankel.net>
    Cc: Max Filippov <jcmvbkbc@gmail.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
    Cc: Jens Taprogge <jens.taprogge@taprogge.org>
    Cc: Karsten Keil <isdn@linux-pingi.de>
    Cc: Scott Branden <scott.branden@broadcom.com>
    Cc: Ulf Hansson <ulf.hansson@linaro.org>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Jakub Kicinski <kuba@kernel.org>
    Cc: Heiko Carstens <hca@linux.ibm.com>
    Cc: Vasily Gorbik <gor@linux.ibm.com>
    Cc: Christian Borntraeger <borntraeger@de.ibm.com>
    Cc: David Lin <dtwlin@gmail.com>
    Cc: Johan Hovold <johan@kernel.org>
    Cc: Alex Elder <elder@kernel.org>
    Cc: Jiri Slaby <jirislaby@kernel.org>
    Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com>
    Cc: Jiri Kosina <jikos@kernel.org>
    Cc: David Sterba <dsterba@suse.com>
    Cc: Shawn Guo <shawnguo@kernel.org>
    Cc: Sascha Hauer <s.hauer@pengutronix.de>
    Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
    Cc: Fabio Estevam <festevam@gmail.com>
    Cc: NXP Linux Team <linux-imx@nxp.com>
    Cc: Oliver Neukum <oneukum@suse.com>
    Cc: Felipe Balbi <balbi@kernel.org>
    Cc: Mathias Nyman <mathias.nyman@intel.com>
    Cc: Marcel Holtmann <marcel@holtmann.org>
    Cc: Johan Hedberg <johan.hedberg@gmail.com>
    Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
    Acked-by: Alex Elder <elder@linaro.org>
    Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Acked-by: Max Filippov <jcmvbkbc@gmail.com>
    Acked-by: David Sterba <dsterba@suse.com>
    Acked-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Link: https://lore.kernel.org/r/20210723074317.32690-8-jslaby@suse.cz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
2024-05-09 11:24:13 -04:00
Desnes Nunes aa778ba469 USB: cdc-acm: support flushing write buffers (TCOFLUSH)
JIRA: https://issues.redhat.com/browse/RHEL-28809

commit 09867af36969067d89c96ab1452656977f30e22a
Author: Simon Arlott <simon@octiron.net>
Date: Sun, 20 Aug 2023 20:13:01 +0100

  If the serial device never reads data written to it (because it is "output
  only") then the write buffers will still be waiting for the URB to complete
  on close(), which will hang for 30s until the closing_wait timeout expires.

  This can happen with the ESP32-H2/ESP32-C6 USB serial interface. Changing
  the port closing_wait timeout is a privileged operation but flushing the
  output buffer is not a privileged operation.

  Implement the flush_buffer tty operation to cancel in-progress writes so
  that tcflush(fd, TCOFLUSH) can be used to unblock the serial port before
  close.

  Signed-off-by: Simon Arlott <simon@octiron.net>
  Link: https://lore.kernel.org/r/555fbc4c-043b-8932-fb9b-a208d61ffbe4@0882a8b5-c6c3-11e9-b005-00805fc181fe.uuid.home.arpa
  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2024-03-18 15:42:31 -03:00
Desnes Nunes 6705e420ba usb: cdc-acm: move ldisc dcd notification outside of acm's read lock
JIRA: https://issues.redhat.com/browse/RHEL-28809

commit f72ae60881ff685004d7de7152517607fcd9968f
Author: Dan Drown <dan-netdev@drown.org>
Date: Wed, 16 Aug 2023 20:09:43 -0500

  dcd_change notification call moved outside of the acm->read_lock
  to protect any future tty ldisc that calls wait_serial_change()

  Signed-off-by: Dan Drown <dan-netdev@drown.org>
  Acked-by: Oliver Neukum <oneukum@suse.com>
  Link: https://lore.kernel.org/r/ZN1zV/zjPgpGlHXo@vps3.drown.org
  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2024-03-18 15:42:30 -03:00
Desnes Nunes 6ff6b62535 usb: cdc-acm: add PPS support
JIRA: https://issues.redhat.com/browse/RHEL-28809

commit 3b563b901eefb47ce27a9897dea2739abe70ee5a
Author: Dan Drown <dan-netdev@drown.org>
Date: Sat, 5 Aug 2023 21:26:13 -0500

  This patch adds support for PPS to CDC devices. Changes to the DCD pin
  are monitored and passed to the ldisc system, which is used by
  pps-ldisc.

  Signed-off-by: Dan Drown <dan-netdev@drown.org>
  Link: https://lore.kernel.org/r/ZM8ExV6bAvJtIA1d@vps3.drown.org
  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Desnes Nunes <desnesn@redhat.com>
2024-03-18 15:42:29 -03:00
Wander Lairson Costa 6bda6cbd4a
tty: stop using alloc_tty_driver
JIRA: https://issues.redhat.com/browse/RHEL-19959
CVE: CVE-2023-6546

Conflicts: drop the xtensa hunks as we don't support this architecture.

commit 39b7b42be4a82f036c392abc71724b4b7752ac03
Author: Jiri Slaby <jirislaby@kernel.org>
Date:   Fri Jul 23 09:43:13 2021 +0200

    tty: stop using alloc_tty_driver

    alloc_tty_driver was deprecated by tty_alloc_driver in commit
    7f0bc6a68e (TTY: pass flags to alloc_tty_driver) in 2012.

    I never got into eliminating alloc_tty_driver until now. So we still
    have two functions for allocating drivers which might be confusing. So
    get rid of alloc_tty_driver uses to eliminate it for good in the next
    patch.

    Note we need to switch return value checking as tty_alloc_driver uses
    ERR_PTR. And flags are now a parameter of tty_alloc_driver.

    Cc: Richard Henderson <rth@twiddle.net>(odd fixer:ALPHA PORT)
    Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
    Cc: Matt Turner <mattst88@gmail.com>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
    Cc: Helge Deller <deller@gmx.de>
    Cc: Jeff Dike <jdike@addtoit.com>
    Cc: Richard Weinberger <richard@nod.at>
    Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
    Cc: Chris Zankel <chris@zankel.net>
    Cc: Max Filippov <jcmvbkbc@gmail.com>
    Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
    Cc: Jens Taprogge <jens.taprogge@taprogge.org>
    Cc: Karsten Keil <isdn@linux-pingi.de>
    Cc: Ulf Hansson <ulf.hansson@linaro.org>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Jakub Kicinski <kuba@kernel.org>
    Cc: Heiko Carstens <hca@linux.ibm.com>
    Cc: Vasily Gorbik <gor@linux.ibm.com>
    Cc: Christian Borntraeger <borntraeger@de.ibm.com>
    Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com>
    Cc: Jiri Kosina <jikos@kernel.org>
    Cc: David Sterba <dsterba@suse.com>
    Cc: Shawn Guo <shawnguo@kernel.org>
    Cc: Sascha Hauer <s.hauer@pengutronix.de>
    Cc: Oliver Neukum <oneukum@suse.com>
    Cc: Felipe Balbi <balbi@kernel.org>
    Cc: Johan Hovold <johan@kernel.org>
    Cc: Marcel Holtmann <marcel@holtmann.org>
    Cc: Johan Hedberg <johan.hedberg@gmail.com>
    Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
    Acked-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
    Acked-by: Max Filippov <jcmvbkbc@gmail.com>
    Acked-by: David Sterba <dsterba@suse.com>
    Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    Link: https://lore.kernel.org/r/20210723074317.32690-5-jslaby@suse.cz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
2024-01-24 12:00:11 -03:00
Torez Smith 5c7e4d7d57 USB: cdc-acm: Add Icom PMR F3400 support (0c26:0020)
Bugzilla: http://bugzilla.redhat.com/2113003
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=48723298
Tested: HP ZBook 15 G5/80D5 Laptop
  ThinkPad P1 Gen5  TB4
  HP zBook Fury

commit a10bc71729b236fe36de0d8e4d35c959fd8dec3a
Author: Thierry GUIBERT <thierry.guibert@croix-rouge.fr>
Date:   Fri Aug 19 10:17:02 2022 +0200

    USB: cdc-acm: Add Icom PMR F3400 support (0c26:0020)

    Supports for ICOM F3400 and ICOM F4400 PMR radios in CDC-ACM driver
    enabling the AT serial port.
    The Vendor Id is 0x0C26
    The Product ID is 0x0020

    Output of lsusb :
    Bus 001 Device 009: ID 0c26:0020 Prolific Technology Inc. ICOM Radio
    Couldn't open device, some information will be missing
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass            2 Communications
      bDeviceSubClass         0
      bDeviceProtocol         0
      bMaxPacketSize0        64
      idVendor           0x0c26 Prolific Technology Inc.
      idProduct          0x0020
      bcdDevice            0.00
      iManufacturer           1 ICOM Inc.
      iProduct                2 ICOM Radio
      iSerial                 3 *obfuscated*
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength       0x0030
        bNumInterfaces          2
        bConfigurationValue     1
        iConfiguration          0
        bmAttributes         0xc0
          Self Powered
        MaxPower                0mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         2 Communications
          bInterfaceSubClass      2 Abstract (modem)
          bInterfaceProtocol      1 AT-commands (v.25ter)
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x83  EP 3 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0040  1x 64 bytes
            bInterval              12
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           2
          bInterfaceClass        10 CDC Data
          bInterfaceSubClass      0
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x82  EP 2 IN
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x02  EP 2 OUT
            bmAttributes            2
              Transfer Type            Bulk
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0200  1x 512 bytes
            bInterval               0

    Signed-off-by: Thierry GUIBERT <thierry.guibert@croix-rouge.fr>
    Cc: stable <stable@kernel.org>
    Link: https://lore.kernel.org/r/20220819081702.84118-1-thierry.guibert@croix-rouge.fr
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Torez Smith <torez@redhat.com>
2022-11-01 22:29:09 -04:00
Torez Smith 3c94115a5b USB: cdc-acm: use CDC serial-state defines
Bugzilla: http://bugzilla.redhat.com/2113003
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=48723298
Tested: HP ZBook 15 G5/80D5 Laptop
  ThinkPad P1 Gen5  TB4
  HP zBook Fury

commit 7333c87f7829dee2545fa5ba6476e971973263a0
Author: Johan Hovold <johan@kernel.org>
Date:   Mon Jul 25 09:58:38 2022 +0200

    USB: cdc-acm: use CDC serial-state defines

    Use the new CDC serial-state defines.

    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://lore.kernel.org/r/20220725075841.1187-5-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Torez Smith <torez@redhat.com>
2022-11-01 22:28:55 -04:00
Torez Smith 67de954811 USB: cdc-acm: use CDC control-line defines
Bugzilla: http://bugzilla.redhat.com/2113003
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=48723298
Tested: HP ZBook 15 G5/80D5 Laptop
  ThinkPad P1 Gen5  TB4
  HP zBook Fury

commit 3fb975e66ce2c6eb50e8ad1963c19bee20302757
Author: Johan Hovold <johan@kernel.org>
Date:   Mon Jul 25 09:58:37 2022 +0200

    USB: cdc-acm: use CDC control-line defines

    Use the new CDC control-line defines.

    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://lore.kernel.org/r/20220725075841.1187-4-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Torez Smith <torez@redhat.com>
2022-11-01 22:28:55 -04:00
Torez Smith 30441b58a3 USB: cdc-acm: use define for timeout
Bugzilla: http://bugzilla.redhat.com/2113003
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=48723298
Tested: HP ZBook 15 G5/80D5 Laptop
  ThinkPad P1 Gen5  TB4
  HP zBook Fury

commit df574080fad0d73f7aaf472a0fa45ea3f18230e0
Author: Oliver Neukum <oneukum@suse.com>
Date:   Wed Jun 29 15:26:38 2022 +0200

    USB: cdc-acm: use define for timeout

    We have a symbolic name for the standard timeout.
    Use it. No functional change intended.

    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Link: https://lore.kernel.org/r/20220629132638.31810-1-oneukum@suse.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Torez Smith <torez@redhat.com>
2022-11-01 22:28:41 -04:00
Torez Smith e14b7e3f47 tty: tty_io: Switch to vmalloc() fallback in case of TTY_NO_WRITE_SPLIT
Bugzilla: http://bugzilla.redhat.com/2061784
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=45014530
Tested: HP ZBook 15 G5/80D5 Laptop
 TGL-U(QS) Laptop

commit d6d9d17abac8d337ecb052b47e918ca9c0b4ba1b
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Mon Dec 20 15:32:50 2021 +0200

    tty: tty_io: Switch to vmalloc() fallback in case of TTY_NO_WRITE_SPLIT

    When TTY_NO_WRITE_SPLIT is set and 64 KiB chunks are used, allow
    vmalloc() fallback. Supply __GFP_RETRY_MAYFAIL to make kmalloc()
    preferable over vmalloc() since we may want a better performance.

    Note, both current users copy data to another buffer anyway, so
    the type of our allocation doesn't affect their expectations.

    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Link: https://lore.kernel.org/r/20211220133250.3070-1-andriy.shevchenko@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Torez Smith <torez@redhat.com>
2022-05-02 15:30:31 -04:00
Torez Smith f2e64753aa USB: cdc-acm: fix break reporting
Bugzilla: http://bugzilla.redhat.com/2061784
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=45014530
Tested: HP ZBook 15 G5/80D5 Laptop
 TGL-U(QS) Laptop

commit 58fc1daa4d2e9789b9ffc880907c961ea7c062cc
Author: Johan Hovold <johan@kernel.org>
Date:   Wed Sep 29 11:09:37 2021 +0200

    USB: cdc-acm: fix break reporting

    A recent change that started reporting break events forgot to push the
    event to the line discipline, which meant that a detected break would
    not be reported until further characters had been receive (the port
    could even have been closed and reopened in between).

    Fixes: 08dff274ed ("cdc-acm: fix BREAK rx code path adding necessary calls")
    Cc: stable@vger.kernel.org
    Acked-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://lore.kernel.org/r/20210929090937.7410-3-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Torez Smith <torez@redhat.com>
2022-05-02 15:29:47 -04:00
Torez Smith d3cef3a891 USB: cdc-acm: fix racy tty buffer accesses
Bugzilla: http://bugzilla.redhat.com/2061784
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=45014530
Tested: HP ZBook 15 G5/80D5 Laptop
 TGL-U(QS) Laptop

commit 65a205e6113506e69a503b61d97efec43fc10fd7
Author: Johan Hovold <johan@kernel.org>
Date:   Wed Sep 29 11:09:36 2021 +0200

    USB: cdc-acm: fix racy tty buffer accesses

    A recent change that started reporting break events to the line
    discipline caused the tty-buffer insertions to no longer be serialised
    by inserting events also from the completion handler for the interrupt
    endpoint.

    Completion calls for distinct endpoints are not guaranteed to be
    serialised. For example, in case a host-controller driver uses
    bottom-half completion, the interrupt and bulk-in completion handlers
    can end up running in parallel on two CPUs (high-and low-prio tasklets,
    respectively) thereby breaking the tty layer's single producer
    assumption.

    Fix this by holding the read lock also when inserting characters from
    the bulk endpoint.

    Fixes: 08dff274ed ("cdc-acm: fix BREAK rx code path adding necessary calls")
    Cc: stable@vger.kernel.org
    Acked-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://lore.kernel.org/r/20210929090937.7410-2-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Torez Smith <torez@redhat.com>
2022-05-02 15:29:47 -04:00
Torez Smith c1864c2097 USB: cdc-acm: remove duplicate USB device ID
Bugzilla: http://bugzilla.redhat.com/2061784
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=45014530
Tested: HP ZBook 15 G5/80D5 Laptop
 TGL-U(QS) Laptop

commit c03d36995222400c1bbbb7245a233c4304cfc257
Author: Krzysztof Kozlowski <krzk@kernel.org>
Date:   Fri Sep 17 11:18:49 2021 +0200

    USB: cdc-acm: remove duplicate USB device ID

    The device 0x00e9 (Nokia 5320 XpressMusic) is already on the list.

    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
    Link: https://lore.kernel.org/r/20210917091849.18692-3-krzysztof.kozlowski@canonical.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Torez Smith <torez@redhat.com>
2022-05-02 15:29:30 -04:00
Torez Smith fa69b303d3 USB: cdc-acm: fix minor-number release
Bugzilla: http://bugzilla.redhat.com/2061784
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=45014530
Tested: HP ZBook 15 G5/80D5 Laptop
 TGL-U(QS) Laptop

commit 91fac0741d4817945c6ee0a17591421e7f5ecb86
Author: Johan Hovold <johan@kernel.org>
Date:   Tue Sep 7 10:23:18 2021 +0200

    USB: cdc-acm: fix minor-number release

    If the driver runs out of minor numbers it would release minor 0 and
    allow another device to claim the minor while still in use.

    Fortunately, registering the tty class device of the second device would
    fail (with a stack dump) due to the sysfs name collision so no memory is
    leaked.

    Fixes: cae2bc768d ("usb: cdc-acm: Decrement tty port's refcount if probe() fail")
    Cc: stable@vger.kernel.org      # 4.19
    Cc: Jaejoong Kim <climbbb.kim@gmail.com>
    Acked-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://lore.kernel.org/r/20210907082318.7757-1-johan@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Torez Smith <torez@redhat.com>
2022-05-02 15:29:26 -04:00
Linus Torvalds 79160a603b USB / Thunderbolt patches for 5.14-rc1
Here is the big set of USB and Thunderbolt patches for 5.14-rc1.
 
 Nothing major here just lots of little changes for new hardware and
 features.  Highlights are:
 	- more USB 4 support added to the thunderbolt core
 	- build warning fixes all over the place
 	- usb-serial driver updates and new device support
 	- mtu3 driver updates
 	- gadget driver updates
 	- dwc3 driver updates
 	- dwc2 driver updates
 	- isp1760 host driver updates
 	- musb driver updates
 	- lots of other tiny things.
 
 Full details are in the shortlog.
 
 All of these have been in linux-next for a while now with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYOM3EA8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ynGewCeMg7YvtCnqFBNebC+GfKpFTgWxO4AnAppjSrZ
 RPGQgfZdWmx7daCXWbSK
 =u68a
 -----END PGP SIGNATURE-----

Merge tag 'usb-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB / Thunderbolt updates from Greg KH:
 "Here is the big set of USB and Thunderbolt patches for 5.14-rc1.

  Nothing major here just lots of little changes for new hardware and
  features. Highlights are:

   - more USB 4 support added to the thunderbolt core

   - build warning fixes all over the place

   - usb-serial driver updates and new device support

   - mtu3 driver updates

   - gadget driver updates

   - dwc3 driver updates

   - dwc2 driver updates

   - isp1760 host driver updates

   - musb driver updates

   - lots of other tiny things.

  Full details are in the shortlog.

  All of these have been in linux-next for a while now with no reported
  issues"

* tag 'usb-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (223 commits)
  phy: qcom-qusb2: Add configuration for SM4250 and SM6115
  dt-bindings: phy: qcom,qusb2: document sm4250/6115 compatible
  dt-bindings: usb: qcom,dwc3: Add bindings for sm6115/4250
  USB: cdc-acm: blacklist Heimann USB Appset device
  usb: xhci-mtk: allow multiple Start-Split in a microframe
  usb: ftdi-elan: remove redundant continue statement in a while-loop
  usb: class: cdc-wdm: return the correct errno code
  xhci: remove redundant continue statement
  usb: dwc3: Fix debugfs creation flow
  usb: gadget: hid: fix error return code in hid_bind()
  usb: gadget: eem: fix echo command packet response issue
  usb: gadget: f_hid: fix endianness issue with descriptors
  Revert "USB: misc: Add onboard_usb_hub driver"
  Revert "of/platform: Add stubs for of_platform_device_create/destroy()"
  Revert "usb: host: xhci-plat: Create platform device for onboard hubs in probe()"
  Revert "arm64: dts: qcom: sc7180-trogdor: Add nodes for onboard USB hub"
  xhci: solve a double free problem while doing s4
  xhci: handle failed buffer copy to URB sg list and fix a W=1 copiler warning
  xhci: Add adaptive interrupt rate for isoch TRBs with XHCI_AVOID_BEI quirk
  xhci: Remove unused defines for ERST_SIZE and ERST_ENTRIES
  ...
2021-07-05 14:16:22 -07:00
Hannu Hartikainen 4897807753 USB: cdc-acm: blacklist Heimann USB Appset device
The device (32a7:0000 Heimann Sensor GmbH USB appset demo) claims to be
a CDC-ACM device in its descriptors but in fact is not. If it is run
with echo disabled it returns garbled data, probably due to something
that happens in the TTY layer. And when run with echo enabled (the
default), it will mess up the calibration data of the sensor the first
time any data is sent to the device.

In short, I had a bad time after connecting the sensor and trying to get
it to work. I hope blacklisting it in the cdc-acm driver will save
someone else a bit of trouble.

Signed-off-by: Hannu Hartikainen <hannu@hrtk.in>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210622141454.337948-1-hannu@hrtk.in
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-24 14:31:04 +02:00
Jiri Slaby 3ec2ff3723 tty: make use of tty_get_{char,frame}_size
In the previous patch, we introduced tty_get_char_size() and
tty_get_frame_size() for computing character and frame sizes,
respectively. Here, we make use of them in various tty drivers where
applicable.

The stats look nice: 12 insertions, 169 deletions.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Lin <dtwlin@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alex Elder <elder@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Oliver Neukum <oneukum@suse.com>
Acked-by: Alex Elder <elder@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210610090247.2593-4-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-15 14:03:27 +02:00
Jiri Slaby fff4ef17a9 tty: make tty_operations::chars_in_buffer return uint
tty_operations::chars_in_buffer is another hook which is expected to
return values >= 0. So make it explicit by the return type too -- use
unsigned int.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Acked-by: David Sterba <dsterba@suse.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Cc: Jens Taprogge <jens.taprogge@taprogge.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David Lin <dtwlin@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Alex Elder <elder@kernel.org>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Mathias Nyman <mathias.nyman@intel.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Link: https://lore.kernel.org/r/20210505091928.22010-27-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-13 18:29:11 +02:00
Jiri Slaby 03b3b1a240 tty: make tty_operations::write_room return uint
Line disciplines expect a positive value or zero returned from
tty->ops->write_room (invoked by tty_write_room). So make this
assumption explicit by using unsigned int as a return value. Both of
tty->ops->write_room and tty_write_room.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Alex Elder <elder@linaro.org>
Acked-by: Max Filippov <jcmvbkbc@gmail.com> # xtensa
Acked-by: David Sterba <dsterba@suse.com>
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Chris Zankel <chris@zankel.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Cc: Jens Taprogge <jens.taprogge@taprogge.org>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Scott Branden <scott.branden@broadcom.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David Lin <dtwlin@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Mathias Nyman <mathias.nyman@intel.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Link: https://lore.kernel.org/r/20210505091928.22010-23-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-13 17:03:20 +02:00
Greg Kroah-Hartman 7e25c20df4 USB-serial updates for 5.13-rc1
Here are the USB-serial updates for 5.13-rc1, including:
 
  - better type detection for pl2303
  - support for more line speeds for pl2303 (TA/TB)
  - fixed CSIZE handling for the new xr driver
  - core support for multi-interface functions
  - TIOCGSERIAL and TIOCSSERIAL fixes
  - generic TIOCSSERIAL support (e.g. for closing_wait)
  - fixed return value for unsupported ioctls
  - support for gpio valid masks in cp210x
  - drain-delay fixes and improvements
  - support for multi-port devices for xr
  - generalisation of the xr driver to support three new device classes
    (XR21B142X, XR21B1411 and XR2280X)
 
 Included are also various clean ups.
 
 All have been in linux-next with no reported issues.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQHbPq+cpGvN/peuzMLxc3C7H1lCAUCYIE2iwAKCRALxc3C7H1l
 CFJsAQCd6rX6VyteR6RUmmTjmGDyRwxsXGniw9bf36dzhlKncwEAga2E+47FGHYm
 YiNQzfcETfjGO21usS1BWhNvzf/gsgs=
 =1FU1
 -----END PGP SIGNATURE-----

Merge tag 'usb-serial-5.13-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next

Johan writes:

USB-serial updates for 5.13-rc1

Here are the USB-serial updates for 5.13-rc1, including:

 - better type detection for pl2303
 - support for more line speeds for pl2303 (TA/TB)
 - fixed CSIZE handling for the new xr driver
 - core support for multi-interface functions
 - TIOCGSERIAL and TIOCSSERIAL fixes
 - generic TIOCSSERIAL support (e.g. for closing_wait)
 - fixed return value for unsupported ioctls
 - support for gpio valid masks in cp210x
 - drain-delay fixes and improvements
 - support for multi-port devices for xr
 - generalisation of the xr driver to support three new device classes
   (XR21B142X, XR21B1411 and XR2280X)

Included are also various clean ups.

All have been in linux-next with no reported issues.

* tag 'usb-serial-5.13-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: (72 commits)
  USB: cdc-acm: add more Maxlinear/Exar models to ignore list
  USB: serial: xr: add copyright notice
  USB: serial: xr: reset FIFOs on open
  USB: serial: xr: add support for XR22801, XR22802, XR22804
  USB: serial: xr: add support for XR21B1411
  USB: serial: xr: add support for XR21B1421, XR21B1422 and XR21B1424
  USB: serial: xr: add type abstraction
  USB: serial: xr: drop type prefix from shared defines
  USB: serial: xr: move pin configuration to probe
  USB: serial: xr: rename GPIO-pin defines
  USB: serial: xr: rename GPIO-mode defines
  USB: serial: xr: add support for XR21V1412 and XR21V1414
  USB: serial: ti_usb_3410_5052: clean up termios CSIZE handling
  USB: serial: ti_usb_3410_5052: use kernel types consistently
  USB: serial: ti_usb_3410_5052: add port-command helpers
  USB: serial: ti_usb_3410_5052: clean up vendor-request helpers
  USB: serial: ti_usb_3410_5052: drop unnecessary packed attributes
  USB: serial: io_ti: drop unnecessary packed attributes
  USB: serial: io_ti: use kernel types consistently
  USB: serial: io_ti: add read-port-command helper
  ...
2021-04-22 11:19:49 +02:00
Oliver Neukum a8b3b51961 USB: CDC-ACM: fix poison/unpoison imbalance
suspend() does its poisoning conditionally, resume() does it
unconditionally. On a device with combined interfaces this
will balance, on a device with two interfaces the counter will
go negative and resubmission will fail.

Both actions need to be done conditionally.

Fixes: 6069e3e927 ("USB: cdc-acm: untangle a circular dependency between callback and softint")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210421074513.4327-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-22 10:53:15 +02:00
Mauro Carvalho Chehab 039b81d50a USB: cdc-acm: add more Maxlinear/Exar models to ignore list
Now that the xr_serial got support for other models, add their USB IDs
as well.

The Maxlinear/Exar USB UARTs can be used in either ACM mode using the
cdc-acm driver or in "custom driver" mode in which further features such
as hardware and software flow control, GPIO control and in-band
line-status reporting are available.

In ACM mode the device always enables RTS/CTS flow control, something
which could prevent transmission in case the CTS input isn't wired up
correctly.

Ensure that cdc_acm will not bind to these devices if the custom
USB-serial driver is enabled.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/5155887a764cbc11f8da0217fe08a24a77d120b4.1616571453.git.mchehab+huawei@kernel.org
[ johan: rewrite commit message, clean up entries ]
Cc: Oliver Neukum <oneukum@suse.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2021-04-13 18:37:22 +02:00
Johan Hovold 4969602741 USB: cdc-acm: fix TIOCGSERIAL implementation
TIOCSSERIAL is a horrid, underspecified, legacy interface which for most
serial devices is only useful for setting the close_delay and
closing_wait parameters.

The xmit_fifo_size parameter could be used to set the hardware transmit
fifo size of a legacy UART when it could not be detected, but the
interface is limited to eight bits and should be left unset when it is
not used.

Similarly, baud_base could be used to set the UART base clock when it
could not be detected, but might as well be left unset when it is not
known (which is the case for CDC).

Fix the cdc-acm TIOCGSERIAL implementation by dropping its custom
interpretation of the unused xmit_fifo_size and baud_base fields, which
overflowed the former with the URB buffer size and set the latter to the
current line speed. Also return the port line number, which is the only
other value used besides the close parameters.

Note that the current line speed can still be retrieved through the
standard termios interfaces.

Fixes: 18c75720e6 ("USB: allow users to run setserial with cdc-acm")
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210408131602.27956-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-09 16:08:27 +02:00
Johan Hovold dd5619582d USB: cdc-acm: fix unprivileged TIOCCSERIAL
TIOCSSERIAL is a horrid, underspecified, legacy interface which for most
serial devices is only useful for setting the close_delay and
closing_wait parameters.

A non-privileged user has only ever been able to set the since long
deprecated ASYNC_SPD flags and trying to change any other *supported*
feature should result in -EPERM being returned. Setting the current
values for any supported features should return success.

Fix the cdc-acm implementation which instead indicated that the
TIOCSSERIAL ioctl was not even implemented when a non-privileged user
set the current values.

Fixes: ba2d8ce9db ("cdc-acm: implement TIOCSSERIAL to avoid blocking close(2)")
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210408131602.27956-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-09 16:08:27 +02:00
Johan Hovold 729f7955cb Revert "USB: cdc-acm: fix rounding error in TIOCSSERIAL"
This reverts commit b401f8c4f4.

The offending commit claimed that trying to set the values reported back
by TIOCGSERIAL as a regular user could result in an -EPERM error when HZ
is 250, but that was never the case.

With HZ=250, the default 0.5 second value of close_delay is converted to
125 jiffies when set and is converted back to 50 centiseconds by
TIOCGSERIAL as expected (not 12 cs as was claimed, even if that was the
case before an earlier fix).

Comparing the internal current and new jiffies values is just fine to
determine if the value is about to change so drop the bogus workaround
(which was also backported to stable).

For completeness: With different default values for these parameters or
with a HZ value not divisible by two, the lack of rounding when setting
the default values in tty_port_init() could result in an -EPERM being
returned, but this is hardly something we need to worry about.

Cc: Anthony Mallet <anthony.mallet@laas.fr>
Cc: stable@vger.kernel.org
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210408131602.27956-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-09 16:08:27 +02:00
Johan Hovold 7957941182 USB: cdc-acm: do not log successful probe on later errors
Do not log the successful-probe message until the tty device has been
registered.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322155318.9837-9-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:27:13 +01:00
Johan Hovold 0b2b23ca20 USB: cdc-acm: always claim data interface
Make sure to always claim the data interface and bail out if binding
fails.

Note that the driver had a check to verify that the data interface was
not already bound to a driver but would not detect other failures (e.g.
if the interface was not authorised).

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322155318.9837-8-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:27:13 +01:00
Johan Hovold f8255ee192 USB: cdc-acm: use negation for NULL checks
Use negation consistently throughout the driver for NULL checks.

Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322155318.9837-7-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:27:13 +01:00
Johan Hovold 4cde059acd USB: cdc-acm: clean up probe error labels
Name the probe error labels after what they do rather than using
sequence numbers which is harder to review and maintain (e.g. may
require renaming unrelated labels when a label is added or removed).

Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322155318.9837-6-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:27:13 +01:00
Johan Hovold dda6faaa2b USB: cdc-acm: drop redundant driver-data reset
There's no need to clear the interface driver data on failed probe (and
driver core will clear it anyway).

Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322155318.9837-5-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:27:13 +01:00
Johan Hovold 8111a8cbd5 USB: cdc-acm: drop redundant driver-data assignment
The interface driver data has already been set by
usb_driver_claim_interface() so drop the redundant subsequent
assignment.

Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322155318.9837-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:27:13 +01:00
Johan Hovold 4e49bf376c USB: cdc-acm: fix use-after-free after probe failure
If tty-device registration fails the driver would fail to release the
data interface. When the device is later disconnected, the disconnect
callback would still be called for the data interface and would go about
releasing already freed resources.

Fixes: c93d819550 ("usb: cdc-acm: fix error handling in acm_probe()")
Cc: stable@vger.kernel.org      # 3.9
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322155318.9837-3-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:27:13 +01:00
Johan Hovold 7180495cb3 USB: cdc-acm: fix double free on probe failure
If tty-device registration fails the driver copy of any Country
Selection functional descriptor would end up being freed twice; first
explicitly in the error path and then again in the tty-port destructor.

Drop the first erroneous free that was left when fixing a tty-port
resource leak.

Fixes: cae2bc768d ("usb: cdc-acm: Decrement tty port's refcount if probe() fail")
Cc: stable@vger.kernel.org      # 4.19
Cc: Jaejoong Kim <climbbb.kim@gmail.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210322155318.9837-2-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:27:13 +01:00
Oliver Neukum e4c77070ad USB: cdc-acm: downgrade message to debug
This failure is so common that logging an error here amounts
to spamming log files.

Reviewed-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210311130126.15972-2-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:26:41 +01:00
Oliver Neukum 6069e3e927 USB: cdc-acm: untangle a circular dependency between callback and softint
We have a cycle of callbacks scheduling works which submit
URBs with thos callbacks. This needs to be blocked, stopped
and unblocked to untangle the circle.

The issue leads to faults like:

[   55.068392] Unable to handle kernel paging request at virtual address 6b6b6c03
[   55.075624] pgd = be866494
[   55.078335] [6b6b6c03] *pgd=00000000
[   55.081924] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[   55.087238] Modules linked in: ppp_async crc_ccitt ppp_generic slhc
xt_TCPMSS xt_tcpmss xt_hl nf_log_ipv6 nf_log_ipv4 nf_log_common
xt_policy xt_limit xt_conntrack xt_tcpudp xt_pkttype ip6table_mangle
iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4
iptable_mangle ip6table_filter ip6_tables iptable_filter ip_tables
des_generic md5 sch_fq_codel cdc_mbim cdc_wdm cdc_ncm usbnet mii
cdc_acm usb_storage ip_tunnel xfrm_user xfrm6_tunnel tunnel6
xfrm4_tunnel tunnel4 esp6 esp4 ah6 ah4 xfrm_algo xt_LOG xt_LED
xt_comment x_tables ipv6
[   55.134954] CPU: 0 PID: 82 Comm: kworker/0:2 Tainted: G
   T 5.8.17 #1
[   55.142526] Hardware name: Freescale i.MX7 Dual (Device Tree)
[   55.148304] Workqueue: events acm_softint [cdc_acm]
[   55.153196] PC is at kobject_get+0x10/0xa4
[   55.157302] LR is at usb_get_dev+0x14/0x1c
[   55.161402] pc : [<8047c06c>]    lr : [<80560448>]    psr: 20000193
[   55.167671] sp : bca39ea8  ip : 00007374  fp : bf6cbd80
[   55.172899] r10: 00000000  r9 : bdd92284  r8 : bdd92008
[   55.178128] r7 : 6b6b6b6b  r6 : fffffffe  r5 : 60000113  r4 : 6b6b6be3
[   55.184658] r3 : 6b6b6b6b  r2 : 00000111  r1 : 00000000  r0 : 6b6b6be3
[   55.191191] Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM Segment none
[   55.198417] Control: 10c5387d  Table: bcf0c06a  DAC: 00000051
[   55.204168] Process kworker/0:2 (pid: 82, stack limit = 0x9bdd2a89)
[   55.210439] Stack: (0xbca39ea8 to 0xbca3a000)
[   55.214805] 9ea0:                   bf6cbd80 80769a50 6b6b6b6b 80560448 bdeb0500 8056bfe8
[   55.222991] 9ec0: 00000002 b76da000 00000000 bdeb0500 bdd92448 bca38000 bdeb0510 8056d69c
[   55.231177] 9ee0: bca38000 00000000 80c050fc 00000000 bca39f44 09d42015 00000000 00000001
[   55.239363] 9f00: bdd92448 bdd92438 bdd92000 7f1158c4 bdd92448 bca2ee00 bf6cbd80 bf6cef00
[   55.247549] 9f20: 00000000 00000000 00000000 801412d8 bf6cbd98 80c03d00 bca2ee00 bf6cbd80
[   55.255735] 9f40: bca2ee14 bf6cbd98 80c03d00 00000008 bca38000 80141568 00000000 80c446ae
[   55.263921] 9f60: 00000000 bc9ed880 bc9f0700 bca38000 bc117eb4 80141524 bca2ee00 bc9ed8a4
[   55.272107] 9f80: 00000000 80147cc8 00000000 bc9f0700 80147b84 00000000 00000000 00000000
[   55.280292] 9fa0: 00000000 00000000 00000000 80100148 00000000 00000000 00000000 00000000
[   55.288477] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   55.296662] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[   55.304860] [<8047c06c>] (kobject_get) from [<80560448>] (usb_get_dev+0x14/0x1c)
[   55.312271] [<80560448>] (usb_get_dev) from [<8056bfe8>] (usb_hcd_unlink_urb+0x50/0xd8)
[   55.320286] [<8056bfe8>] (usb_hcd_unlink_urb) from [<8056d69c>] (usb_kill_urb.part.0+0x44/0xd0)
[   55.329004] [<8056d69c>] (usb_kill_urb.part.0) from [<7f1158c4>] (acm_softint+0x4c/0x10c [cdc_acm])
[   55.338082] [<7f1158c4>] (acm_softint [cdc_acm]) from [<801412d8>] (process_one_work+0x19c/0x3e8)
[   55.346969] [<801412d8>] (process_one_work) from [<80141568>] (worker_thread+0x44/0x4dc)
[   55.355072] [<80141568>] (worker_thread) from [<80147cc8>] (kthread+0x144/0x180)
[   55.362481] [<80147cc8>] (kthread) from [<80100148>] (ret_from_fork+0x14/0x2c)
[   55.369706] Exception stack(0xbca39fb0 to 0xbca39ff8)

Tested-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210311130126.15972-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:26:37 +01:00
Oliver Neukum 08dff274ed cdc-acm: fix BREAK rx code path adding necessary calls
Counting break events is nice but we should actually report them to
the tty layer.

Fixes: 5a6a62bdb9 ("cdc-acm: add TIOCMIWAIT")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Link: https://lore.kernel.org/r/20210311133714.31881-1-oneukum@suse.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-23 13:25:41 +01:00
Yorick de Wid 4d8654e81d Goodix Fingerprint device is not a modem
The CDC ACM driver is false matching the Goodix Fingerprint device
against the USB_CDC_ACM_PROTO_AT_V25TER.

The Goodix Fingerprint device is a biometrics sensor that should be
handled in user-space. libfprint has some support for Goodix
fingerprint sensors, although not for this particular one. It is
possible that the vendor allocates a PID per OEM (Lenovo, Dell etc).
If this happens to be the case then more devices from the same vendor
could potentially match the ACM modem module table.

Signed-off-by: Yorick de Wid <ydewid@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210213144901.53199-1-ydewid@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-10 09:36:12 +01:00
Mauro Carvalho Chehab 5f6225a7fb USB: cdc-acm: ignore Exar XR21V141X when serial driver is built
The Exar XR21V141X can be used in either ACM mode using the cdc-acm
driver or in "custom driver" mode in which further features such as
hardware and software flow control, GPIO control and in-band line-status
reporting are available.

In ACM mode the device always enables RTS/CTS flow control, something
which could prevent transmission in case the CTS input isn't wired up
correctly.

Ensure that cdc_acm will not bind to the device if the custom USB-serial
driver is enabled.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://lore.kernel.org/r/20201122170822.21715-4-mani@kernel.org
[ johan: rewrite commit message ]
Signed-off-by: Johan Hovold <johan@kernel.org>
2021-01-21 10:49:45 +01:00
Sean Young 0ffc76539e USB: cdc-acm: blacklist another IR Droid device
This device is supported by the IR Toy driver.

Reported-by: Georgi Bakalski <georgi.bakalski@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Acked-by: Oliver Neukum <oneukum@suse.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201227134502.4548-2-sean@mess.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28 15:39:37 +01:00
Chris Brandt 6d853c9e41 usb: cdc-acm: Add DISABLE_ECHO for Renesas USB Download mode
Renesas R-Car and RZ/G SoCs have a firmware download mode over USB.
However, on reset a banner string is transmitted out which is not expected
to be echoed back and will corrupt the protocol.

Cc: stable <stable@vger.kernel.org>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Link: https://lore.kernel.org/r/20201111131209.3977903-1-chris.brandt@renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-13 15:26:49 +01:00
Jerome Brunet 38203b8385 usb: cdc-acm: fix cooldown mechanism
Commit a4e7279cd1 ("cdc-acm: introduce a cool down") is causing
regression if there is some USB error, such as -EPROTO.

This has been reported on some samples of the Odroid-N2 using the Combee II
Zibgee USB dongle.

> struct acm *acm = container_of(work, struct acm, work)

is incorrect in case of a delayed work and causes warnings, usually from
the workqueue:

> WARNING: CPU: 0 PID: 0 at kernel/workqueue.c:1474 __queue_work+0x480/0x528.

When this happens, USB eventually stops working completely after a while.
Also the ACM_ERROR_DELAY bit is never set, so the cooldown mechanism
previously introduced cannot be triggered and acm_submit_read_urb() is
never called.

This changes makes the cdc-acm driver use a single delayed work, fixing the
pointer arithmetic in acm_softint() and set the ACM_ERROR_DELAY when the
cooldown mechanism appear to be needed.

Fixes: a4e7279cd1 ("cdc-acm: introduce a cool down")
Cc: Oliver Neukum <oneukum@suse.com>
Reported-by: Pascal Vizeli <pascal.vizeli@nabucasa.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20201019170702.150534-1-jbrunet@baylibre.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-28 13:20:21 +01:00
Vincent Mailhol a4f88430af usb: cdc-acm: add quirk to blacklist ETAS ES58X devices
The ES58X devices has a CDC ACM interface (used for debug
purpose). During probing, the device is thus recognized as USB Modem
(CDC ACM), preventing the etas-es58x module to load:
  usbcore: registered new interface driver etas_es58x
  usb 1-1.1: new full-speed USB device number 14 using xhci_hcd
  usb 1-1.1: New USB device found, idVendor=108c, idProduct=0159, bcdDevice= 1.00
  usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  usb 1-1.1: Product: ES581.4
  usb 1-1.1: Manufacturer: ETAS GmbH
  usb 1-1.1: SerialNumber: 2204355
  cdc_acm 1-1.1:1.0: No union descriptor, testing for castrated device
  cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device

Thus, these have been added to the ignore list in
drivers/usb/class/cdc-acm.c

N.B. Future firmware release of the ES58X will remove the CDC-ACM
interface.

`lsusb -v` of the three devices variant (ES581.4, ES582.1 and
ES584.1):

  Bus 001 Device 011: ID 108c:0159 Robert Bosch GmbH ES581.4
  Device Descriptor:
    bLength                18
    bDescriptorType         1
    bcdUSB               1.10
    bDeviceClass            2 Communications
    bDeviceSubClass         0
    bDeviceProtocol         0
    bMaxPacketSize0        64
    idVendor           0x108c Robert Bosch GmbH
    idProduct          0x0159
    bcdDevice            1.00
    iManufacturer           1 ETAS GmbH
    iProduct                2 ES581.4
    iSerial                 3 2204355
    bNumConfigurations      1
    Configuration Descriptor:
      bLength                 9
      bDescriptorType         2
      wTotalLength       0x0035
      bNumInterfaces          1
      bConfigurationValue     1
      iConfiguration          5 Bus Powered Configuration
      bmAttributes         0x80
        (Bus Powered)
      MaxPower              100mA
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        0
        bAlternateSetting       0
        bNumEndpoints           3
        bInterfaceClass         2 Communications
        bInterfaceSubClass      2 Abstract (modem)
        bInterfaceProtocol      0
        iInterface              4 ACM Control Interface
        CDC Header:
          bcdCDC               1.10
        CDC Call Management:
          bmCapabilities       0x01
            call management
          bDataInterface          0
        CDC ACM:
          bmCapabilities       0x06
            sends break
            line coding and serial state
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x81  EP 1 IN
          bmAttributes            3
            Transfer Type            Interrupt
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0010  1x 16 bytes
          bInterval              10
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x82  EP 2 IN
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               0
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x03  EP 3 OUT
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval               0
  Device Status:     0x0000
    (Bus Powered)

  Bus 001 Device 012: ID 108c:0168 Robert Bosch GmbH ES582
  Device Descriptor:
    bLength                18
    bDescriptorType         1
    bcdUSB               2.00
    bDeviceClass            2 Communications
    bDeviceSubClass         0
    bDeviceProtocol         0
    bMaxPacketSize0        64
    idVendor           0x108c Robert Bosch GmbH
    idProduct          0x0168
    bcdDevice            1.00
    iManufacturer           1 ETAS GmbH
    iProduct                2 ES582
    iSerial                 3 0108933
    bNumConfigurations      1
    Configuration Descriptor:
      bLength                 9
      bDescriptorType         2
      wTotalLength       0x0043
      bNumInterfaces          2
      bConfigurationValue     1
      iConfiguration          0
      bmAttributes         0x80
        (Bus Powered)
      MaxPower              500mA
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        0
        bAlternateSetting       0
        bNumEndpoints           1
        bInterfaceClass         2 Communications
        bInterfaceSubClass      2 Abstract (modem)
        bInterfaceProtocol      1 AT-commands (v.25ter)
        iInterface              0
        CDC Header:
          bcdCDC               1.10
        CDC ACM:
          bmCapabilities       0x02
            line coding and serial state
        CDC Union:
          bMasterInterface        0
          bSlaveInterface         1
        CDC Call Management:
          bmCapabilities       0x03
            call management
            use DataInterface
          bDataInterface          1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            3
            Transfer Type            Interrupt
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval              16
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       0
        bNumEndpoints           2
        bInterfaceClass        10 CDC Data
        bInterfaceSubClass      0
        bInterfaceProtocol      0
        iInterface              0
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x81  EP 1 IN
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0200  1x 512 bytes
          bInterval               0
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x02  EP 2 OUT
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0200  1x 512 bytes
          bInterval               0
  Device Qualifier (for other device speed):
    bLength                10
    bDescriptorType         6
    bcdUSB               2.00
    bDeviceClass            2 Communications
    bDeviceSubClass         0
    bDeviceProtocol         0
    bMaxPacketSize0        64
    bNumConfigurations      1
  Device Status:     0x0000
    (Bus Powered)

  Bus 001 Device 013: ID 108c:0169 Robert Bosch GmbH ES584.1
  Device Descriptor:
    bLength                18
    bDescriptorType         1
    bcdUSB               2.00
    bDeviceClass            2 Communications
    bDeviceSubClass         0
    bDeviceProtocol         0
    bMaxPacketSize0        64
    idVendor           0x108c Robert Bosch GmbH
    idProduct          0x0169
    bcdDevice            1.00
    iManufacturer           1 ETAS GmbH
    iProduct                2 ES584.1
    iSerial                 3 0100320
    bNumConfigurations      1
    Configuration Descriptor:
      bLength                 9
      bDescriptorType         2
      wTotalLength       0x0043
      bNumInterfaces          2
      bConfigurationValue     1
      iConfiguration          0
      bmAttributes         0x80
        (Bus Powered)
      MaxPower              500mA
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        0
        bAlternateSetting       0
        bNumEndpoints           1
        bInterfaceClass         2 Communications
        bInterfaceSubClass      2 Abstract (modem)
        bInterfaceProtocol      1 AT-commands (v.25ter)
        iInterface              0
        CDC Header:
          bcdCDC               1.10
        CDC ACM:
          bmCapabilities       0x02
            line coding and serial state
        CDC Union:
          bMasterInterface        0
          bSlaveInterface         1
        CDC Call Management:
          bmCapabilities       0x03
            call management
            use DataInterface
          bDataInterface          1
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x83  EP 3 IN
          bmAttributes            3
            Transfer Type            Interrupt
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0040  1x 64 bytes
          bInterval              16
      Interface Descriptor:
        bLength                 9
        bDescriptorType         4
        bInterfaceNumber        1
        bAlternateSetting       0
        bNumEndpoints           2
        bInterfaceClass        10 CDC Data
        bInterfaceSubClass      0
        bInterfaceProtocol      0
        iInterface              0
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x81  EP 1 IN
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0200  1x 512 bytes
          bInterval               0
        Endpoint Descriptor:
          bLength                 7
          bDescriptorType         5
          bEndpointAddress     0x02  EP 2 OUT
          bmAttributes            2
            Transfer Type            Bulk
            Synch Type               None
            Usage Type               Data
          wMaxPacketSize     0x0200  1x 512 bytes
          bInterval               0
  Device Qualifier (for other device speed):
    bLength                10
    bDescriptorType         6
    bcdUSB               2.00
    bDeviceClass            2 Communications
    bDeviceSubClass         0
    bDeviceProtocol         0
    bMaxPacketSize0        64
    bNumConfigurations      1
  Device Status:     0x0000
    (Bus Powered)

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20201002154219.4887-8-mailhol.vincent@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-05 13:14:44 +02:00