Linux debugging
Check our new training course
Linux debugging, tracing, profiling & perf. analysis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
/* usb_descriptor.h - header for common device descriptor */ /* * Copyright (c) 2017 PHYTEC Messtechnik GmbH * * SPDX-License-Identifier: Apache-2.0 */ #ifndef __USB_DESCRIPTOR_H__ #define __USB_DESCRIPTOR_H__ #ifdef CONFIG_USB_CDC_ACM #define NUMOF_IFACES_CDC_ACM 2 #define NUMOF_ENDPOINTS_CDC_ACM 3 #else #define NUMOF_IFACES_CDC_ACM 0 #define NUMOF_ENDPOINTS_CDC_ACM 0 #endif #ifdef CONFIG_USB_MASS_STORAGE #define NUMOF_IFACES_MASS 1 #define NUMOF_ENDPOINTS_MASS 2 #else #define NUMOF_IFACES_MASS 0 #define NUMOF_ENDPOINTS_MASS 0 #endif #ifdef CONFIG_USB_DEVICE_NETWORK_RNDIS #define NUMOF_IFACES_RNDIS 2 #define NUMOF_ENDPOINTS_RNDIS 3 #else #define NUMOF_IFACES_RNDIS 0 #define NUMOF_ENDPOINTS_RNDIS 0 #endif #ifdef CONFIG_USB_DEVICE_NETWORK_ECM #define NUMOF_IFACES_CDC_ECM 2 #define NUMOF_ENDPOINTS_CDC_ECM 3 #else #define NUMOF_IFACES_CDC_ECM 0 #define NUMOF_ENDPOINTS_CDC_ECM 0 #endif #ifdef CONFIG_USB_DEVICE_HID #ifdef CONFIG_USB_DEVICE_HID_BOOTP #define NUMOF_IFACES_HID 2 #define NUMOF_ENDPOINTS_HID 2 #else /* CONFIG_USB_DEVICE_HID_BOOTP */ #define NUMOF_IFACES_HID 1 #define NUMOF_ENDPOINTS_HID 1 #endif /* CONFIG_USB_DEVICE_HID_BOOTP */ #else /* CONFIG_USB_DEVICE_HID */ #define NUMOF_IFACES_HID 0 #define NUMOF_ENDPOINTS_HID 0 #endif /* CONFIG_USB_DEVICE_HID */ #define NUMOF_IFACES (NUMOF_IFACES_CDC_ACM + NUMOF_IFACES_MASS + \ NUMOF_IFACES_RNDIS + NUMOF_IFACES_CDC_ECM + \ NUMOF_IFACES_HID) #define NUMOF_ENDPOINTS (NUMOF_ENDPOINTS_CDC_ACM + NUMOF_ENDPOINTS_MASS + \ NUMOF_ENDPOINTS_RNDIS + NUMOF_ENDPOINTS_CDC_ECM + \ NUMOF_ENDPOINTS_HID) #define FIRST_IFACE_CDC_ACM 0 #define FIRST_IFACE_MASS_STORAGE NUMOF_IFACES_CDC_ACM #define FIRST_IFACE_RNDIS (NUMOF_IFACES_CDC_ACM + \ NUMOF_IFACES_MASS) #define FIRST_IFACE_CDC_ECM (NUMOF_IFACES_CDC_ACM + \ NUMOF_IFACES_MASS + \ NUMOF_IFACES_RNDIS) #define FIRST_IFACE_HID (FIRST_IFACE_CDC_ECM + \ NUMOF_IFACES_CDC_ECM) #define MFR_DESC_LENGTH (sizeof(CONFIG_USB_DEVICE_MANUFACTURER) * 2) #define MFR_UC_IDX_MAX (MFR_DESC_LENGTH - 3) #define MFR_STRING_IDX_MAX (sizeof(CONFIG_USB_DEVICE_MANUFACTURER) - 2) #define PRODUCT_DESC_LENGTH (sizeof(CONFIG_USB_DEVICE_PRODUCT) * 2) #define PRODUCT_UC_IDX_MAX (PRODUCT_DESC_LENGTH - 3) #define PRODUCT_STRING_IDX_MAX (sizeof(CONFIG_USB_DEVICE_PRODUCT) - 2) #define SN_DESC_LENGTH (sizeof(CONFIG_USB_DEVICE_SN) * 2) #define SN_UC_IDX_MAX (SN_DESC_LENGTH - 3) #define SN_STRING_IDX_MAX (sizeof(CONFIG_USB_DEVICE_SN) - 2) #define ECM_MAC_DESC_LENGTH (sizeof(CONFIG_USB_DEVICE_NETWORK_ECM_MAC) * 2) #define ECM_MAC_UC_IDX_MAX (ECM_MAC_DESC_LENGTH - 3) #define ECM_STRING_IDX_MAX (sizeof(CONFIG_USB_DEVICE_NETWORK_ECM_MAC) - 2) void usb_fix_unicode_string(int idx_max, int asci_idx_max, u8_t *buf); u8_t *usb_get_device_descriptor(void); #ifdef CONFIG_USB_DEVICE_HID void usb_set_hid_report_size(u16_t report_desc_size); #endif #endif /* __USB_DESCRIPTOR_H__ */