From 7010cd8f85539cffb8700f842b9247fab462d626 Mon Sep 17 00:00:00 2001 From: sys64738 Date: Wed, 18 Aug 2021 00:15:34 +0200 Subject: [PATCH] new subclass,protocol IDs for vendor itf --- host/dpctl/connection.py | 4 ++-- host/i2c-tiny-usb-misc/i2c-tiny-usb.c | 2 +- host/modules/dragonprobe.c | 2 +- src/vnd_cfg.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/host/dpctl/connection.py b/host/dpctl/connection.py index 4639dfa..4c4f31d 100644 --- a/host/dpctl/connection.py +++ b/host/dpctl/connection.py @@ -26,8 +26,8 @@ class DevConn: class UsbConn(DevConn): _USB_DEFAULT_VID = 0xcafe _USB_DEFAULT_PID = 0x1312 - _SUBCLASS = 42 - _PROTOCOL = 69 + _SUBCLASS = ord('D') + _PROTOCOL = ord('P') def _open_dev(dev) -> Union[UsbConn, str]: import usb, usb.core diff --git a/host/i2c-tiny-usb-misc/i2c-tiny-usb.c b/host/i2c-tiny-usb-misc/i2c-tiny-usb.c index f1303ec..a4ad310 100644 --- a/host/i2c-tiny-usb-misc/i2c-tiny-usb.c +++ b/host/i2c-tiny-usb-misc/i2c-tiny-usb.c @@ -162,7 +162,7 @@ static const struct usb_device_id i2c_tiny_usb_table[] = { { USB_DEVICE(0x1c40, 0x0534) }, /* EZPrototypes */ { /* 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, - .idVendor = 0xcafe, .idProduct = 0x1312, + .idVendor = 0xcafe, .idProduct = 0x1312, /* TODO: match subclass & protocol */ .bcdDevice_lo = 0x6000, .bcdDevice_hi = 0x6fff, .bInterfaceClass = 0 }, diff --git a/host/modules/dragonprobe.c b/host/modules/dragonprobe.c index 74ac0d6..d7ef0c4 100644 --- a/host/modules/dragonprobe.c +++ b/host/modules/dragonprobe.c @@ -571,7 +571,7 @@ static int dp_resume(struct usb_interface *itf) } 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); diff --git a/src/vnd_cfg.h b/src/vnd_cfg.h index 9314291..c6dd08b 100644 --- a/src/vnd_cfg.h +++ b/src/vnd_cfg.h @@ -7,8 +7,8 @@ /* the configuration vendor interface has a specific subclass and protocol * number that can be useful for identification */ -#define VND_CFG_SUBCLASS 42 -#define VND_CFG_PROTOCOL 69 +#define VND_CFG_SUBCLASS 'D' +#define VND_CFG_PROTOCOL 'P' #define TUD_VENDOR_DESCRIPTOR_EX(_itfnum, _stridx, _epout, _epin, _epsize, _subclass, _protocol) \ /* Interface */\ 9, TUSB_DESC_INTERFACE, _itfnum, 0, 2, TUSB_CLASS_VENDOR_SPECIFIC, _subclass, _protocol, _stridx,\