Page MenuHomeFreeBSD

umodem: ignore CDC_CM descriptor for baltech smartcard reader
ClosedPublic

Authored by freebsd_steffen.cc on Jan 4 2023, 9:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 16, 2:56 AM
Unknown Object (File)
Thu, Apr 11, 5:46 AM
Unknown Object (File)
Jan 10 2024, 2:13 AM
Unknown Object (File)
Dec 12 2023, 12:35 PM
Unknown Object (File)
Aug 15 2023, 12:25 AM
Unknown Object (File)
Aug 14 2023, 11:41 PM
Unknown Object (File)
Apr 10 2023, 5:53 AM
Unknown Object (File)
Apr 6 2023, 8:26 AM
Subscribers

Details

Summary

The CDC_CM descriptor points to the wrong data interface. Ignore it to
use the CDC_UNION descriptor.

usbconfig dump:
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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I will try to review this patch tomorrow.

manu added a subscriber: manu.

That should be two commits, one that adds the new quirk and one that adds the device.
Otherwise lgtm.

This revision is now accepted and ready to land.Jan 9 2023, 8:28 AM

The changes look OK. Probably a good idea to split the patch.

  1. adding the new quirk itself
  2. adding the actual quirk (usbdevs and usb_quirk.c)