opnsense-src/sys/dev/usb
Steffen Dirkwinkel 8580e334b0
umodem: ignore CDC_CM descriptor for baltech smartcard reader
The CDC_CM descriptor points to the wrong interface for serial port use.
Ignore it to use the CDC_UNION descriptor.

usbconfig dump (spec at: https://usb.org/sites/default/files/CDC1.2_WMC1.1_012011.zip):
ugen0.2: <Baltech AG Smartcard Reader> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (300mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x13ad
  idProduct = 0xf019
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <Baltech AG>
  iProduct = 0x0002  <Smartcard Reader>
  iSerialNumber = 0x0003  <45031910>
  bNumConfigurations = 0x0001

 Configuration index 0

    bLength = 0x0009
    bDescriptorType = 0x0002
    wTotalLength = 0x0064
    bNumInterfaces = 0x0003
    bConfigurationValue = 0x0001
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0080
    bMaxPower = 0x0096

    Interface 0
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0000
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0003  <HID device>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x09
      bDescriptorType = 0x21
      bDescriptorSubType = 0x11
       RAW dump:
       0x00 | 0x09, 0x21, 0x11, 0x01, 0x00, 0x01, 0x22, 0xd0,
       0x08 | 0x00

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0081  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0040
        bInterval = 0x0001
        bRefresh = 0x0000
        bSynchAddress = 0x0000

      Additional Descriptor

      bLength = 0x08
      bDescriptorType = 0x0b
      bDescriptorSubType = 0x01
       RAW dump:
       0x00 | 0x08, 0x0b, 0x01, 0x02, 0x02, 0x02, 0x00, 0x00

    Interface 1
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0001
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0001
      bInterfaceClass = 0x0002  <Communication device>
      bInterfaceSubClass = 0x0002
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x00
       RAW dump:
       0x00 | 0x05, 0x24, 0x00, 0x10, 0x01

      Additional Descriptor

      bLength = 0x04
      bDescriptorType = 0x24
      bDescriptorSubType = 0x02
       RAW dump:
       0x00 | 0x04, 0x24, 0x02, 0x00

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x06
       RAW dump:
       0x00 | 0x05, 0x24, 0x06, 0x01, 0x02

      Additional Descriptor

      bLength = 0x05
      bDescriptorType = 0x24
      bDescriptorSubType = 0x01
       RAW dump:
       0x00 | 0x05, 0x24, 0x01, 0x00, 0x01

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0085  <IN>
        bmAttributes = 0x0003  <INTERRUPT>
        wMaxPacketSize = 0x0008
        bInterval = 0x0010
        bRefresh = 0x0000
        bSynchAddress = 0x0000

    Interface 2
      bLength = 0x0009
      bDescriptorType = 0x0004
      bInterfaceNumber = 0x0002
      bAlternateSetting = 0x0000
      bNumEndpoints = 0x0002
      bInterfaceClass = 0x000a  <CDC-data>
      bInterfaceSubClass = 0x0000
      bInterfaceProtocol = 0x0000
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0086  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0040
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

     Endpoint 1
        bLength = 0x0007
        bDescriptorType = 0x0005
        bEndpointAddress = 0x0006  <OUT>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0040
        bInterval = 0x0000
        bRefresh = 0x0000
        bSynchAddress = 0x0000

Reviewed by:		manu
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37942
2023-01-18 12:17:17 +01:00
..
controller xhci(4): Add new USB IDs. 2023-01-17 11:45:35 +01:00
gadget usb: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:46:57 -07:00
input ums(4): Disable vendor usage page button support 2022-12-24 12:01:20 +03:00
misc usb: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:46:57 -07:00
net Add Windows Dev Kit 2023 support to if_ure 2023-01-04 17:12:20 +00:00
quirk umodem: ignore CDC_CM descriptor for baltech smartcard reader 2023-01-18 12:17:17 +01:00
serial umodem: add quirk to ignore CDC_CM descriptor 2023-01-18 12:17:09 +01:00
storage usb: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:46:57 -07:00
template
video usb: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-06 15:46:57 -07:00
wlan if_rsu: Fix mismatches in array bounds. 2022-12-07 12:33:41 -08:00
ufm_ioctl.h
uftdiio.h
uled_ioctl.h
usb.h usb(4): Make the enumeration thread nice time a variable. 2022-10-07 13:41:00 +02:00
usb_bus.h
usb_busdma.c net80211(4): Bring back an accidently reverted grammar correction 2022-09-07 13:35:45 +02:00
usb_busdma.h
usb_cdc.h
usb_controller.h
usb_core.c
usb_core.h
usb_debug.c usb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword. 2022-10-07 13:41:00 +02:00
usb_debug.h usb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword. 2022-10-07 13:41:00 +02:00
usb_dev.c
usb_dev.h
usb_device.c usb(4): Call optional endpoint_uninit() when changing configuration or alternate setting. 2023-01-13 11:18:19 +01:00
usb_device.h
usb_dynamic.c
usb_dynamic.h
usb_endian.h
usb_error.c
usb_fdt_support.c
usb_fdt_support.h
usb_freebsd.h
usb_freebsd_loader.h
usb_generic.c usb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword. 2022-10-07 13:41:00 +02:00
usb_generic.h
usb_handle_request.c
usb_hid.c
usb_hub.c XHCI: clear warm and port reset 2022-06-15 21:10:01 +00:00
usb_hub.h
usb_hub_acpi.c usb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword. 2022-10-07 13:41:00 +02:00
usb_hub_private.h Add USB UEFI locator support 2022-03-01 08:06:42 -07:00
usb_if.m
usb_ioctl.h usb: remove COMPAT_32BIT ifdefs 2021-12-17 21:28:39 +00:00
usb_lookup.c
usb_mbuf.c
usb_mbuf.h
usb_msctest.c usb: Add a __usbdebug_used for variables only used under #ifdef USB_DEBUG. 2022-04-13 16:08:20 -07:00
usb_msctest.h usb(4): Automagically apply all quirks for USB mass storage devices. 2022-02-24 10:28:55 +01:00
usb_parse.c
usb_pci.h
usb_pf.c netlink: add interface notification on link status / flags change. 2022-12-09 11:20:07 +00:00
usb_pf.h
usb_process.c
usb_process.h
usb_request.c usb(4): Quirk for non-compliant USB devices. 2022-08-27 08:52:28 +02:00
usb_request.h
usb_transfer.c usb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword. 2022-10-07 13:41:00 +02:00
usb_transfer.h
usb_util.c usb(4): Factor out the usb_check_request() function. 2022-03-03 10:24:24 +01:00
usb_util.h usb(4): Factor out the usb_check_request() function. 2022-03-03 10:24:24 +01:00
usbdevs umodem: ignore CDC_CM descriptor for baltech smartcard reader 2023-01-18 12:17:17 +01:00
usbdi.h
usbdi_util.h
usbhid.h usb(4): Substitute "unsigned int" using the equivalent and shorter "unsigned" keyword. 2022-10-07 13:41:00 +02:00