Eric Wild | 30f21bd | 2019-10-18 17:58:27 +0200 | [diff] [blame] | 1 | /* |
| 2 | * usb_descriptors.h |
| 3 | * |
| 4 | * Created on: Oct 11, 2019 |
| 5 | * Author: phi |
| 6 | */ |
| 7 | |
| 8 | #ifndef USB_DESCRIPTORS_H_ |
| 9 | #define USB_DESCRIPTORS_H_ |
| 10 | |
| 11 | #define CCID_NUM_CLK_SUPPORTED 4 |
| 12 | |
| 13 | /* aggregate descriptors for the combined CDC-ACM + CCID device that we expose |
| 14 | * from sysmoQMOD */ |
| 15 | |
| 16 | enum str_desc_num { |
| 17 | STR_DESC_MANUF = 1, |
| 18 | STR_DESC_PRODUCT, |
| 19 | STR_DESC_CONFIG, |
| 20 | STR_DESC_INTF_ACM_COMM, |
| 21 | STR_DESC_INTF_ACM_DATA, |
| 22 | STR_DESC_INTF_CCID, |
| 23 | STR_DESC_SERIAL, |
| 24 | }; |
| 25 | |
| 26 | /* a struct of structs representing the concatenated collection of USB descriptors */ |
| 27 | struct usb_desc_collection { |
| 28 | struct usb_dev_desc dev; |
| 29 | struct usb_config_desc cfg; |
| 30 | |
| 31 | /* CDC-ACM: Two interfaces, one with IRQ EP and one with BULK IN + OUT */ |
| 32 | struct { |
| 33 | struct { |
| 34 | struct usb_iface_desc iface; |
| 35 | struct usb_cdc_hdr_desc cdc_hdr; |
| 36 | struct usb_cdc_call_mgmt_desc cdc_call_mgmt; |
| 37 | struct usb_cdc_acm_desc cdc_acm; |
| 38 | struct usb_cdc_union_desc cdc_union; |
| 39 | struct usb_ep_desc ep[1]; |
| 40 | } comm; |
| 41 | struct { |
| 42 | struct usb_iface_desc iface; |
| 43 | struct usb_ep_desc ep[2]; |
| 44 | } data; |
| 45 | } cdc; |
| 46 | |
| 47 | /* CCID: One interface with CCID class descriptor and three endpoints */ |
| 48 | struct { |
| 49 | struct usb_iface_desc iface; |
| 50 | struct usb_ccid_class_descriptor class; |
| 51 | struct usb_ep_desc ep[3]; |
| 52 | } ccid; |
| 53 | uint8_t str[116]; |
| 54 | } __attribute__((packed)); |
| 55 | |
| 56 | #endif /* USB_DESCRIPTORS_H_ */ |