mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-22 08:18:32 +03:00
Add input interrupt endpoint to all configurations
This commit is contained in:
@@ -157,6 +157,7 @@ const unsigned char *stringDescriptors[] = {
|
|||||||
/* Endpoint numbers */
|
/* Endpoint numbers */
|
||||||
#define DATAOUT 1
|
#define DATAOUT 1
|
||||||
#define DATAIN 2
|
#define DATAIN 2
|
||||||
|
#define INT 3
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
* USB Device descriptors
|
* USB Device descriptors
|
||||||
@@ -165,10 +166,11 @@ const unsigned char *stringDescriptors[] = {
|
|||||||
typedef struct _SIMTraceDriverConfigurationDescriptorSniffer {
|
typedef struct _SIMTraceDriverConfigurationDescriptorSniffer {
|
||||||
|
|
||||||
/** Standard configuration descriptor. */
|
/** Standard configuration descriptor. */
|
||||||
USBConfigurationDescriptor configuration;
|
USBConfigurationDescriptor configuration;
|
||||||
USBInterfaceDescriptor sniffer;
|
USBInterfaceDescriptor sniffer;
|
||||||
USBEndpointDescriptor sniffer_dataOut;
|
USBEndpointDescriptor sniffer_dataOut;
|
||||||
USBEndpointDescriptor sniffer_dataIn;
|
USBEndpointDescriptor sniffer_dataIn;
|
||||||
|
USBEndpointDescriptor sniffer_interruptIn;
|
||||||
|
|
||||||
} __attribute__ ((packed)) SIMTraceDriverConfigurationDescriptorSniffer;
|
} __attribute__ ((packed)) SIMTraceDriverConfigurationDescriptorSniffer;
|
||||||
|
|
||||||
@@ -190,7 +192,7 @@ const SIMTraceDriverConfigurationDescriptorSniffer configurationDescriptorSniffe
|
|||||||
USBGenericDescriptor_INTERFACE,
|
USBGenericDescriptor_INTERFACE,
|
||||||
0, /* This is interface #0 */
|
0, /* This is interface #0 */
|
||||||
0, /* This is alternate setting #0 for this interface */
|
0, /* This is alternate setting #0 for this interface */
|
||||||
2, /* This interface uses 2 endpoints */
|
3, /* This interface uses 3 endpoints */
|
||||||
0xff, /* Descriptor Class: Vendor specific */
|
0xff, /* Descriptor Class: Vendor specific */
|
||||||
0, /* No subclass */
|
0, /* No subclass */
|
||||||
0, /* No l */
|
0, /* No l */
|
||||||
@@ -217,6 +219,16 @@ const SIMTraceDriverConfigurationDescriptorSniffer configurationDescriptorSniffe
|
|||||||
MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(DATAIN),
|
MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(DATAIN),
|
||||||
USBEndpointDescriptor_MAXBULKSIZE_FS),
|
USBEndpointDescriptor_MAXBULKSIZE_FS),
|
||||||
0 /* Must be 0 for full-speed bulk endpoints */
|
0 /* Must be 0 for full-speed bulk endpoints */
|
||||||
|
},
|
||||||
|
// Notification endpoint descriptor
|
||||||
|
{
|
||||||
|
sizeof(USBEndpointDescriptor),
|
||||||
|
USBGenericDescriptor_ENDPOINT,
|
||||||
|
USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, INT ),
|
||||||
|
USBEndpointDescriptor_INTERRUPT,
|
||||||
|
MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(INT),
|
||||||
|
USBEndpointDescriptor_MAXINTERRUPTSIZE_FS),
|
||||||
|
0x10
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -237,11 +249,11 @@ const CCIDDriverConfigurationDescriptorsCCID configurationDescriptorCCID = { 0 }
|
|||||||
typedef struct _SIMTraceDriverConfigurationDescriptorPhone {
|
typedef struct _SIMTraceDriverConfigurationDescriptorPhone {
|
||||||
|
|
||||||
/** Standard configuration descriptor. */
|
/** Standard configuration descriptor. */
|
||||||
USBConfigurationDescriptor configuration;
|
USBConfigurationDescriptor configuration;
|
||||||
USBInterfaceDescriptor sniffer;
|
USBInterfaceDescriptor phone;
|
||||||
USBEndpointDescriptor sniffer_dataOut;
|
USBEndpointDescriptor phone_dataOut;
|
||||||
USBEndpointDescriptor sniffer_dataIn;
|
USBEndpointDescriptor phone_dataIn;
|
||||||
|
USBEndpointDescriptor phone_interruptIn;
|
||||||
} __attribute__ ((packed)) SIMTraceDriverConfigurationDescriptorPhone;
|
} __attribute__ ((packed)) SIMTraceDriverConfigurationDescriptorPhone;
|
||||||
|
|
||||||
const SIMTraceDriverConfigurationDescriptorPhone configurationDescriptorPhone = {
|
const SIMTraceDriverConfigurationDescriptorPhone configurationDescriptorPhone = {
|
||||||
@@ -262,7 +274,7 @@ const SIMTraceDriverConfigurationDescriptorPhone configurationDescriptorPhone =
|
|||||||
USBGenericDescriptor_INTERFACE,
|
USBGenericDescriptor_INTERFACE,
|
||||||
0, /* This is interface #0 */
|
0, /* This is interface #0 */
|
||||||
0, /* This is alternate setting #0 for this interface */
|
0, /* This is alternate setting #0 for this interface */
|
||||||
2, /* This interface uses 2 endpoints */
|
3, /* This interface uses 3 endpoints */
|
||||||
0xff, /* Descriptor Class: Vendor specific */
|
0xff, /* Descriptor Class: Vendor specific */
|
||||||
0, /* No subclass */
|
0, /* No subclass */
|
||||||
0, /* No l */
|
0, /* No l */
|
||||||
@@ -289,6 +301,16 @@ const SIMTraceDriverConfigurationDescriptorPhone configurationDescriptorPhone =
|
|||||||
MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(DATAIN),
|
MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(DATAIN),
|
||||||
USBEndpointDescriptor_MAXBULKSIZE_FS),
|
USBEndpointDescriptor_MAXBULKSIZE_FS),
|
||||||
0 /* Must be 0 for full-speed bulk endpoints */
|
0 /* Must be 0 for full-speed bulk endpoints */
|
||||||
|
},
|
||||||
|
/* Notification endpoint descriptor */
|
||||||
|
{
|
||||||
|
sizeof(USBEndpointDescriptor),
|
||||||
|
USBGenericDescriptor_ENDPOINT,
|
||||||
|
USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, INT ),
|
||||||
|
USBEndpointDescriptor_INTERRUPT,
|
||||||
|
MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(INT),
|
||||||
|
USBEndpointDescriptor_MAXINTERRUPTSIZE_FS),
|
||||||
|
0x10
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -296,13 +318,15 @@ const SIMTraceDriverConfigurationDescriptorPhone configurationDescriptorPhone =
|
|||||||
typedef struct _SIMTraceDriverConfigurationDescriptorMITM {
|
typedef struct _SIMTraceDriverConfigurationDescriptorMITM {
|
||||||
|
|
||||||
/** Standard configuration descriptor. */
|
/** Standard configuration descriptor. */
|
||||||
USBConfigurationDescriptor configuration;
|
USBConfigurationDescriptor configuration;
|
||||||
USBInterfaceDescriptor simcard;
|
USBInterfaceDescriptor simcard;
|
||||||
USBEndpointDescriptor simcard_dataOut;
|
USBEndpointDescriptor simcard_dataOut;
|
||||||
USBEndpointDescriptor simcard_dataIn;
|
USBEndpointDescriptor simcard_dataIn;
|
||||||
USBInterfaceDescriptor phone;
|
USBEndpointDescriptor simcard_interruptIn;
|
||||||
USBEndpointDescriptor phone_dataOut;
|
USBInterfaceDescriptor phone;
|
||||||
USBEndpointDescriptor phone_dataIn;
|
USBEndpointDescriptor phone_dataOut;
|
||||||
|
USBEndpointDescriptor phone_dataIn;
|
||||||
|
USBEndpointDescriptor phone_interruptIn;
|
||||||
|
|
||||||
} __attribute__ ((packed)) SIMTraceDriverConfigurationDescriptorMITM;
|
} __attribute__ ((packed)) SIMTraceDriverConfigurationDescriptorMITM;
|
||||||
|
|
||||||
@@ -324,7 +348,7 @@ const SIMTraceDriverConfigurationDescriptorMITM configurationDescriptorMITM = {
|
|||||||
USBGenericDescriptor_INTERFACE,
|
USBGenericDescriptor_INTERFACE,
|
||||||
0, /* This is interface #0 */
|
0, /* This is interface #0 */
|
||||||
0, /* This is alternate setting #0 for this interface */
|
0, /* This is alternate setting #0 for this interface */
|
||||||
2, /* This interface uses 2 endpoints */
|
3, /* This interface uses 3 endpoints */
|
||||||
//CDCCommunicationInterfaceDescriptor_CLASS,
|
//CDCCommunicationInterfaceDescriptor_CLASS,
|
||||||
0xff,
|
0xff,
|
||||||
// CDCCommunicationInterfaceDescriptor_ABSTRACTCONTROLMODEL,
|
// CDCCommunicationInterfaceDescriptor_ABSTRACTCONTROLMODEL,
|
||||||
@@ -355,13 +379,23 @@ const SIMTraceDriverConfigurationDescriptorMITM configurationDescriptorMITM = {
|
|||||||
USBEndpointDescriptor_MAXBULKSIZE_FS),
|
USBEndpointDescriptor_MAXBULKSIZE_FS),
|
||||||
0 /* Must be 0 for full-speed bulk endpoints */
|
0 /* Must be 0 for full-speed bulk endpoints */
|
||||||
},
|
},
|
||||||
|
/* Notification endpoint descriptor */
|
||||||
|
{
|
||||||
|
sizeof(USBEndpointDescriptor),
|
||||||
|
USBGenericDescriptor_ENDPOINT,
|
||||||
|
USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, INT ),
|
||||||
|
USBEndpointDescriptor_INTERRUPT,
|
||||||
|
MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(INT),
|
||||||
|
USBEndpointDescriptor_MAXINTERRUPTSIZE_FS),
|
||||||
|
0x10
|
||||||
|
},
|
||||||
/* Communication class interface standard descriptor */
|
/* Communication class interface standard descriptor */
|
||||||
{
|
{
|
||||||
sizeof(USBInterfaceDescriptor),
|
sizeof(USBInterfaceDescriptor),
|
||||||
USBGenericDescriptor_INTERFACE,
|
USBGenericDescriptor_INTERFACE,
|
||||||
1, /* This is interface #1 */
|
1, /* This is interface #1 */
|
||||||
0, /* This is alternate setting #0 for this interface */
|
0, /* This is alternate setting #0 for this interface */
|
||||||
2, /* This interface uses 2 endpoints */
|
3, /* This interface uses 3 endpoints */
|
||||||
0xff,
|
0xff,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@@ -388,6 +422,16 @@ const SIMTraceDriverConfigurationDescriptorMITM configurationDescriptorMITM = {
|
|||||||
MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(DATAIN),
|
MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(DATAIN),
|
||||||
USBEndpointDescriptor_MAXBULKSIZE_FS),
|
USBEndpointDescriptor_MAXBULKSIZE_FS),
|
||||||
0 /* Must be 0 for full-speed bulk endpoints */
|
0 /* Must be 0 for full-speed bulk endpoints */
|
||||||
|
},
|
||||||
|
/* Notification endpoint descriptor */
|
||||||
|
{
|
||||||
|
sizeof(USBEndpointDescriptor),
|
||||||
|
USBGenericDescriptor_ENDPOINT,
|
||||||
|
USBEndpointDescriptor_ADDRESS( USBEndpointDescriptor_IN, INT ),
|
||||||
|
USBEndpointDescriptor_INTERRUPT,
|
||||||
|
MIN(BOARD_USB_ENDPOINTS_MAXPACKETSIZE(INT),
|
||||||
|
USBEndpointDescriptor_MAXINTERRUPTSIZE_FS),
|
||||||
|
0x10
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user