new subclass,protocol IDs for vendor itf

This commit is contained in:
Triss 2021-08-18 00:15:34 +02:00
parent c9cce0bdf4
commit 7010cd8f85
4 changed files with 6 additions and 6 deletions

View File

@ -26,8 +26,8 @@ class DevConn:
class UsbConn(DevConn): class UsbConn(DevConn):
_USB_DEFAULT_VID = 0xcafe _USB_DEFAULT_VID = 0xcafe
_USB_DEFAULT_PID = 0x1312 _USB_DEFAULT_PID = 0x1312
_SUBCLASS = 42 _SUBCLASS = ord('D')
_PROTOCOL = 69 _PROTOCOL = ord('P')
def _open_dev(dev) -> Union[UsbConn, str]: def _open_dev(dev) -> Union[UsbConn, str]:
import usb, usb.core import usb, usb.core

View File

@ -162,7 +162,7 @@ static const struct usb_device_id i2c_tiny_usb_table[] = {
{ USB_DEVICE(0x1c40, 0x0534) }, /* EZPrototypes */ { USB_DEVICE(0x1c40, 0x0534) }, /* EZPrototypes */
{ /* Dragon Probe: we want the Vendor interface on I2C-enabled ones */ { /* Dragon Probe: we want the Vendor interface on I2C-enabled ones */
.match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION | USB_DEVICE_ID_MATCH_INT_CLASS, .match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION | USB_DEVICE_ID_MATCH_INT_CLASS,
.idVendor = 0xcafe, .idProduct = 0x1312, .idVendor = 0xcafe, .idProduct = 0x1312, /* TODO: match subclass & protocol */
.bcdDevice_lo = 0x6000, .bcdDevice_hi = 0x6fff, .bcdDevice_lo = 0x6000, .bcdDevice_hi = 0x6fff,
.bInterfaceClass = 0 .bInterfaceClass = 0
}, },

View File

@ -571,7 +571,7 @@ static int dp_resume(struct usb_interface *itf)
} }
static const struct usb_device_id dp_table[] = { static const struct usb_device_id dp_table[] = {
{ USB_DEVICE_AND_INTERFACE_INFO(0xcafe, 0x1312, USB_CLASS_VENDOR_SPEC, 42, 69) }, { USB_DEVICE_AND_INTERFACE_INFO(0xcafe, 0x1312, USB_CLASS_VENDOR_SPEC, 'D', 'P') },
{ } { }
}; };
MODULE_DEVICE_TABLE(usb, dp_table); MODULE_DEVICE_TABLE(usb, dp_table);

View File

@ -7,8 +7,8 @@
/* the configuration vendor interface has a specific subclass and protocol /* the configuration vendor interface has a specific subclass and protocol
* number that can be useful for identification */ * number that can be useful for identification */
#define VND_CFG_SUBCLASS 42 #define VND_CFG_SUBCLASS 'D'
#define VND_CFG_PROTOCOL 69 #define VND_CFG_PROTOCOL 'P'
#define TUD_VENDOR_DESCRIPTOR_EX(_itfnum, _stridx, _epout, _epin, _epsize, _subclass, _protocol) \ #define TUD_VENDOR_DESCRIPTOR_EX(_itfnum, _stridx, _epout, _epin, _epsize, _subclass, _protocol) \
/* Interface */\ /* Interface */\
9, TUSB_DESC_INTERFACE, _itfnum, 0, 2, TUSB_CLASS_VENDOR_SPECIFIC, _subclass, _protocol, _stridx,\ 9, TUSB_DESC_INTERFACE, _itfnum, 0, 2, TUSB_CLASS_VENDOR_SPECIFIC, _subclass, _protocol, _stridx,\