Lines Matching +full:- +full:n

2  * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
4 * SPDX-License-Identifier: Apache-2.0
18 // ---------------------------------------- Configuration Descriptor Parsing ----------------------…
26 if (*offset + cur_desc->bLength >= wTotalLength) { in usb_parse_next_descriptor()
30 …tandard_desc_t *ret_desc = (const usb_standard_desc_t *)(((uint32_t)cur_desc) + cur_desc->bLength); in usb_parse_next_descriptor()
31 *offset += cur_desc->bLength; in usb_parse_next_descriptor()
42 if (ret_desc->bDescriptorType == bDescriptorType) { in usb_parse_next_descriptor_of_type()
61 return -1; //bInterfaceNumber not found in usb_parse_interface_number_of_alternate()
65 …descriptor_of_type((const usb_standard_desc_t *)first_intf_desc, config_desc->wTotalLength, USB_B_… in usb_parse_interface_number_of_alternate()
67 if (next_intf_desc->bInterfaceNumber != bInterfaceNumber) { in usb_parse_interface_number_of_alternate()
71 …_descriptor_of_type((const usb_standard_desc_t *)next_intf_desc, config_desc->wTotalLength, USB_B_… in usb_parse_interface_number_of_alternate()
79 if (bInterfaceNumber >= config_desc->bNumInterfaces) { in usb_parse_interface_descriptor()
85 …ext_descriptor_of_type((const usb_standard_desc_t *)config_desc, config_desc->wTotalLength, USB_B_… in usb_parse_interface_descriptor()
87 if (next_intf_desc->bInterfaceNumber == bInterfaceNumber) { in usb_parse_interface_descriptor()
90 …_descriptor_of_type((const usb_standard_desc_t *)next_intf_desc, config_desc->wTotalLength, USB_B_… in usb_parse_interface_descriptor()
98 if (next_intf_desc->bInterfaceNumber == bInterfaceNumber + 1) { in usb_parse_interface_descriptor()
103 if (next_intf_desc->bAlternateSetting == bAlternateSetting) { in usb_parse_interface_descriptor()
108 …_descriptor_of_type((const usb_standard_desc_t *)next_intf_desc, config_desc->wTotalLength, USB_B_… in usb_parse_interface_descriptor()
119 if (index >= intf_desc->bNumEndpoints) { in usb_parse_endpoint_descriptor_by_index()
155 for (int index = 0; index < intf_desc->bNumEndpoints; index++) { in usb_parse_endpoint_descriptor_by_address()
157 …ep_desc = usb_parse_endpoint_descriptor_by_index(intf_desc, index, config_desc->wTotalLength, &off… in usb_parse_endpoint_descriptor_by_address()
161 if (ep_desc->bEndpointAddress == bEndpointAddress) { in usb_parse_endpoint_descriptor_by_address()
172 // ----------------------------------------------- Descriptor Printing ----------------------------…
177 int type = ep_desc->bmAttributes & USB_BM_ATTRIBUTES_XFERTYPE_MASK; in print_ep_desc()
197 printf("\t\t*** Endpoint descriptor ***\n"); in print_ep_desc()
198 printf("\t\tbLength %d\n", ep_desc->bLength); in print_ep_desc()
199 printf("\t\tbDescriptorType %d\n", ep_desc->bDescriptorType); in print_ep_desc()
200 printf("\t\tbEndpointAddress 0x%x\tEP %d %s\n", ep_desc->bEndpointAddress, in print_ep_desc()
203 printf("\t\tbmAttributes 0x%x\t%s\n", ep_desc->bmAttributes, ep_type_str); in print_ep_desc()
204 printf("\t\twMaxPacketSize %d\n", ep_desc->wMaxPacketSize); in print_ep_desc()
205 printf("\t\tbInterval %d\n", ep_desc->bInterval); in print_ep_desc()
210 printf("\t*** Interface descriptor ***\n"); in usbh_print_intf_desc()
211 printf("\tbLength %d\n", intf_desc->bLength); in usbh_print_intf_desc()
212 printf("\tbDescriptorType %d\n", intf_desc->bDescriptorType); in usbh_print_intf_desc()
213 printf("\tbInterfaceNumber %d\n", intf_desc->bInterfaceNumber); in usbh_print_intf_desc()
214 printf("\tbAlternateSetting %d\n", intf_desc->bAlternateSetting); in usbh_print_intf_desc()
215 printf("\tbNumEndpoints %d\n", intf_desc->bNumEndpoints); in usbh_print_intf_desc()
216 printf("\tbInterfaceClass 0x%x\n", intf_desc->bInterfaceProtocol); in usbh_print_intf_desc()
217 printf("\tiInterface %d\n", intf_desc->iInterface); in usbh_print_intf_desc()
222 printf("*** Configuration descriptor ***\n"); in usbh_print_cfg_desc()
223 printf("bLength %d\n", cfg_desc->bLength); in usbh_print_cfg_desc()
224 printf("bDescriptorType %d\n", cfg_desc->bDescriptorType); in usbh_print_cfg_desc()
225 printf("wTotalLength %d\n", cfg_desc->wTotalLength); in usbh_print_cfg_desc()
226 printf("bNumInterfaces %d\n", cfg_desc->bNumInterfaces); in usbh_print_cfg_desc()
227 printf("bConfigurationValue %d\n", cfg_desc->bConfigurationValue); in usbh_print_cfg_desc()
228 printf("iConfiguration %d\n", cfg_desc->iConfiguration); in usbh_print_cfg_desc()
229 printf("bmAttributes 0x%x\n", cfg_desc->bmAttributes); in usbh_print_cfg_desc()
230 printf("bMaxPower %dmA\n", cfg_desc->bMaxPower * 2); in usbh_print_cfg_desc()
239 printf("*** Device descriptor ***\n"); in usb_print_device_descriptor()
240 printf("bLength %d\n", devc_desc->bLength); in usb_print_device_descriptor()
241 printf("bDescriptorType %d\n", devc_desc->bDescriptorType); in usb_print_device_descriptor()
242 printf("bcdUSB %d.%d0\n", ((devc_desc->bcdUSB >> 8) & 0xF), ((devc_desc->bcdUSB >> 4) & 0xF)); in usb_print_device_descriptor()
243 printf("bDeviceClass 0x%x\n", devc_desc->bDeviceClass); in usb_print_device_descriptor()
244 printf("bDeviceSubClass 0x%x\n", devc_desc->bDeviceSubClass); in usb_print_device_descriptor()
245 printf("bDeviceProtocol 0x%x\n", devc_desc->bDeviceProtocol); in usb_print_device_descriptor()
246 printf("bMaxPacketSize0 %d\n", devc_desc->bMaxPacketSize0); in usb_print_device_descriptor()
247 printf("idVendor 0x%x\n", devc_desc->idVendor); in usb_print_device_descriptor()
248 printf("idProduct 0x%x\n", devc_desc->idProduct); in usb_print_device_descriptor()
249 …printf("bcdDevice %d.%d0\n", ((devc_desc->bcdDevice >> 8) & 0xF), ((devc_desc->bcdDevice >> 4) & 0… in usb_print_device_descriptor()
250 printf("iManufacturer %d\n", devc_desc->iManufacturer); in usb_print_device_descriptor()
251 printf("iProduct %d\n", devc_desc->iProduct); in usb_print_device_descriptor()
252 printf("iSerialNumber %d\n", devc_desc->iSerialNumber); in usb_print_device_descriptor()
253 printf("bNumConfigurations %d\n", devc_desc->bNumConfigurations); in usb_print_device_descriptor()
263 uint16_t wTotalLength = cfg_desc->wTotalLength; in usb_print_config_descriptor()
267 switch (next_desc->bDescriptorType) { in usb_print_config_descriptor()
295 for (int i = 0; i < str_desc->bLength/2; i++) { in usb_print_string_descriptor()
297 USB String descriptors of UTF-16. in usb_print_string_descriptor()
298 …Right now We just skip any character larger than 0xFF to stay in BMP Basic Latin and Latin-1 Suppl… in usb_print_string_descriptor()
300 if (str_desc->wData[i] > 0xFF) { in usb_print_string_descriptor()
303 printf("%c", (char)str_desc->wData[i]); in usb_print_string_descriptor()
305 printf("\n"); in usb_print_string_descriptor()