From 054216d94d5e772c01daee554ce7067580c13a35 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 6 Mar 2017 10:06:32 +0100 Subject: [PATCH] usb: Use different SubClass values for card-emulation and sniffer This way, host code can dynamically detect which interface supports which functionality. The related #defines should be moved to a header file that's shared with the host application code. --- firmware/libcommon/source/usb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/firmware/libcommon/source/usb.c b/firmware/libcommon/source/usb.c index db4d1c8d..1321fe1e 100644 --- a/firmware/libcommon/source/usb.c +++ b/firmware/libcommon/source/usb.c @@ -39,6 +39,9 @@ #include #include +#define SIMTRACE_SUBCLASS_SNIFFER 1 +#define SIMTRACE_SUBCLASS_CARDEM 2 + /*------------------------------------------------------------------------------ * USB String descriptors *------------------------------------------------------------------------------*/ @@ -92,7 +95,7 @@ static const SIMTraceDriverConfigurationDescriptorSniffer .bAlternateSetting = 0, .bNumEndpoints = 3, .bInterfaceClass = 0xff, - .bInterfaceSubClass = 0, + .bInterfaceSubClass = SIMTRACE_SUBCLASS_SNIFFER, .bInterfaceProtocol = 0, .iInterface = SNIFFER_CONF_STR, }, @@ -280,7 +283,7 @@ static const SIMTraceDriverConfigurationDescriptorPhone .bAlternateSetting = 0, .bNumEndpoints = 3, .bInterfaceClass = 0xff, - .bInterfaceSubClass = 0, + .bInterfaceSubClass = SIMTRACE_SUBCLASS_CARDEM, .bInterfaceProtocol = 0, .iInterface = CARDEM_USIM1_INTF_STR, }, @@ -329,7 +332,7 @@ static const SIMTraceDriverConfigurationDescriptorPhone .bAlternateSetting = 0, .bNumEndpoints = 3, .bInterfaceClass = 0xff, - .bInterfaceSubClass = 0, + .bInterfaceSubClass = SIMTRACE_SUBCLASS_CARDEM, .bInterfaceProtocol = 0, .iInterface = CARDEM_USIM2_INTF_STR, }, @@ -503,7 +506,7 @@ static const SIMTraceDriverConfigurationDescriptorMITM .bAlternateSetting = 0, .bNumEndpoints = 3, .bInterfaceClass = 0xff, - .bInterfaceSubClass = 0, + .bInterfaceSubClass = SIMTRAC_SUBCLASS_CARDEM, .bInterfaceProtocol = 0, .iInterface = PHONE_CONF_STR, },