Skip to content
Snippets Groups Projects
  1. Mar 03, 2025
  2. Jan 14, 2025
  3. Sep 17, 2024
  4. Feb 12, 2024
  5. Aug 30, 2022
  6. Aug 19, 2022
    • Thierry GUIBERT's avatar
      USB: cdc-acm: Add Icom PMR F3400 support (0c26:0020) · a10bc717
      Thierry GUIBERT authored
      
      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: default avatarThierry 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a10bc717
  7. Jul 25, 2022
  8. Jun 29, 2022
  9. Dec 21, 2021
  10. Oct 05, 2021
  11. Sep 21, 2021
  12. Sep 14, 2021
  13. Jul 27, 2021
    • Jiri Slaby's avatar
      tty: drop put_tty_driver · 9f90a4dd
      Jiri Slaby authored
      
      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: default avatarAlex Elder <elder@linaro.org>
      Acked-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      Acked-by: default avatarDavid Sterba <dsterba@suse.com>
      Acked-by: default avatarSamuel Iglesias Gonsálvez <siglesias@igalia.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Link: https://lore.kernel.org/r/20210723074317.32690-8-jslaby@suse.cz
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9f90a4dd
    • Jiri Slaby's avatar
      tty: stop using alloc_tty_driver · 39b7b42b
      Jiri Slaby authored
      
      alloc_tty_driver was deprecated by tty_alloc_driver in commit
      7f0bc6a6 (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: default avatarSamuel Iglesias Gonsálvez <siglesias@igalia.com>
      Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      Acked-by: default avatarDavid Sterba <dsterba@suse.com>
      Acked-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Link: https://lore.kernel.org/r/20210723074317.32690-5-jslaby@suse.cz
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      39b7b42b
  14. Jun 24, 2021
  15. Jun 15, 2021
  16. May 13, 2021
    • Jiri Slaby's avatar
      tty: make tty_operations::chars_in_buffer return uint · fff4ef17
      Jiri Slaby authored
      
      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: default avatarJiri Slaby <jslaby@suse.cz>
      Acked-By: default avatarAnton Ivanov <anton.ivanov@cambridgegreys.com>
      Acked-by: default avatarDavid 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fff4ef17
    • Jiri Slaby's avatar
      tty: make tty_operations::write_room return uint · 03b3b1a2
      Jiri Slaby authored
      
      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: default avatarJiri Slaby <jslaby@suse.cz>
      Acked-by: default avatarLaurentiu Tudor <laurentiu.tudor@nxp.com>
      Acked-by: default avatarAlex Elder <elder@linaro.org>
      Acked-by: Max Filippov <jcmvbkbc@gmail.com> # xtensa
      Acked-by: default avatarDavid Sterba <dsterba@suse.com>
      Acked-By: default avatarAnton Ivanov <anton.ivanov@cambridgegreys.com>
      Acked-by: default avatarGeert 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      03b3b1a2
  17. Apr 22, 2021
  18. Apr 13, 2021
  19. Apr 09, 2021
    • Johan Hovold's avatar
      USB: cdc-acm: fix TIOCGSERIAL implementation · 49696027
      Johan Hovold authored
      
      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: 18c75720 ("USB: allow users to run setserial with cdc-acm")
      Acked-by: default avatarOliver Neukum <oneukum@suse.com>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Link: https://lore.kernel.org/r/20210408131602.27956-4-johan@kernel.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      49696027
    • Johan Hovold's avatar
      USB: cdc-acm: fix unprivileged TIOCCSERIAL · dd561958
      Johan Hovold authored
      
      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: ba2d8ce9 ("cdc-acm: implement TIOCSSERIAL to avoid blocking close(2)")
      Acked-by: default avatarOliver Neukum <oneukum@suse.com>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Link: https://lore.kernel.org/r/20210408131602.27956-3-johan@kernel.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dd561958
    • Johan Hovold's avatar
      Revert "USB: cdc-acm: fix rounding error in TIOCSSERIAL" · 729f7955
      Johan Hovold authored
      
      This reverts commit b401f8c4.
      
      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: default avatarOliver Neukum <oneukum@suse.com>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      Link: https://lore.kernel.org/r/20210408131602.27956-2-johan@kernel.org
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      729f7955
  20. Mar 23, 2021
  21. Mar 10, 2021
  22. Jan 21, 2021
  23. Dec 28, 2020
Loading