Lines Matching refs:desc

55 	struct usb_ssp_isoc_ep_comp_descriptor *desc;  in usb_parse_ssp_isoc_endpoint_companion()  local
61 desc = (struct usb_ssp_isoc_ep_comp_descriptor *) buffer; in usb_parse_ssp_isoc_endpoint_companion()
62 if (desc->bDescriptorType != USB_DT_SSP_ISOC_ENDPOINT_COMP || in usb_parse_ssp_isoc_endpoint_companion()
66 cfgno, inum, asnum, ep->desc.bEndpointAddress); in usb_parse_ssp_isoc_endpoint_companion()
69 memcpy(&ep->ssp_isoc_ep_comp, desc, USB_DT_SSP_ISOC_EP_COMP_SIZE); in usb_parse_ssp_isoc_endpoint_companion()
76 struct usb_ss_ep_comp_descriptor *desc; in usb_parse_ss_endpoint_companion() local
82 desc = (struct usb_ss_ep_comp_descriptor *) buffer; in usb_parse_ss_endpoint_companion()
84 if (desc->bDescriptorType != USB_DT_SS_ENDPOINT_COMP || in usb_parse_ss_endpoint_companion()
89 cfgno, inum, asnum, ep->desc.bEndpointAddress); in usb_parse_ss_endpoint_companion()
100 if (usb_endpoint_xfer_isoc(&ep->desc) || in usb_parse_ss_endpoint_companion()
101 usb_endpoint_xfer_int(&ep->desc)) in usb_parse_ss_endpoint_companion()
103 ep->desc.wMaxPacketSize; in usb_parse_ss_endpoint_companion()
106 buffer += desc->bLength; in usb_parse_ss_endpoint_companion()
107 size -= desc->bLength; in usb_parse_ss_endpoint_companion()
108 memcpy(&ep->ss_ep_comp, desc, USB_DT_SS_EP_COMP_SIZE); in usb_parse_ss_endpoint_companion()
111 if (usb_endpoint_xfer_control(&ep->desc) && desc->bMaxBurst != 0) { in usb_parse_ss_endpoint_companion()
114 "setting to zero\n", desc->bMaxBurst, in usb_parse_ss_endpoint_companion()
115 cfgno, inum, asnum, ep->desc.bEndpointAddress); in usb_parse_ss_endpoint_companion()
117 } else if (desc->bMaxBurst > 15) { in usb_parse_ss_endpoint_companion()
120 "setting to 15\n", desc->bMaxBurst, in usb_parse_ss_endpoint_companion()
121 cfgno, inum, asnum, ep->desc.bEndpointAddress); in usb_parse_ss_endpoint_companion()
125 if ((usb_endpoint_xfer_control(&ep->desc) || in usb_parse_ss_endpoint_companion()
126 usb_endpoint_xfer_int(&ep->desc)) && in usb_parse_ss_endpoint_companion()
127 desc->bmAttributes != 0) { in usb_parse_ss_endpoint_companion()
131 usb_endpoint_xfer_control(&ep->desc) ? "Control" : "Bulk", in usb_parse_ss_endpoint_companion()
132 desc->bmAttributes, in usb_parse_ss_endpoint_companion()
133 cfgno, inum, asnum, ep->desc.bEndpointAddress); in usb_parse_ss_endpoint_companion()
135 } else if (usb_endpoint_xfer_bulk(&ep->desc) && in usb_parse_ss_endpoint_companion()
136 desc->bmAttributes > 16) { in usb_parse_ss_endpoint_companion()
140 cfgno, inum, asnum, ep->desc.bEndpointAddress); in usb_parse_ss_endpoint_companion()
142 } else if (usb_endpoint_xfer_isoc(&ep->desc) && in usb_parse_ss_endpoint_companion()
143 !USB_SS_SSP_ISOC_COMP(desc->bmAttributes) && in usb_parse_ss_endpoint_companion()
144 USB_SS_MULT(desc->bmAttributes) > 3) { in usb_parse_ss_endpoint_companion()
148 USB_SS_MULT(desc->bmAttributes), in usb_parse_ss_endpoint_companion()
149 cfgno, inum, asnum, ep->desc.bEndpointAddress); in usb_parse_ss_endpoint_companion()
153 if (usb_endpoint_xfer_isoc(&ep->desc)) in usb_parse_ss_endpoint_companion()
154 max_tx = (desc->bMaxBurst + 1) * in usb_parse_ss_endpoint_companion()
155 (USB_SS_MULT(desc->bmAttributes)) * in usb_parse_ss_endpoint_companion()
156 usb_endpoint_maxp(&ep->desc); in usb_parse_ss_endpoint_companion()
157 else if (usb_endpoint_xfer_int(&ep->desc)) in usb_parse_ss_endpoint_companion()
158 max_tx = usb_endpoint_maxp(&ep->desc) * in usb_parse_ss_endpoint_companion()
159 (desc->bMaxBurst + 1); in usb_parse_ss_endpoint_companion()
162 if (le16_to_cpu(desc->wBytesPerInterval) > max_tx) { in usb_parse_ss_endpoint_companion()
166 usb_endpoint_xfer_isoc(&ep->desc) ? "Isoc" : "Int", in usb_parse_ss_endpoint_companion()
167 le16_to_cpu(desc->wBytesPerInterval), in usb_parse_ss_endpoint_companion()
168 cfgno, inum, asnum, ep->desc.bEndpointAddress, in usb_parse_ss_endpoint_companion()
173 if (usb_endpoint_xfer_isoc(&ep->desc) && in usb_parse_ss_endpoint_companion()
174 USB_SS_SSP_ISOC_COMP(desc->bmAttributes)) in usb_parse_ss_endpoint_companion()
232 for (i = 0; i < config->desc.bNumInterfaces; ++i) { in config_endpoint_is_duplicate()
238 if (alt->desc.bInterfaceNumber == inum && in config_endpoint_is_duplicate()
239 alt->desc.bAlternateSetting != asnum) in config_endpoint_is_duplicate()
242 for (k = 0; k < alt->desc.bNumEndpoints; ++k) { in config_endpoint_is_duplicate()
243 epd = &alt->endpoint[k].desc; in config_endpoint_is_duplicate()
291 if (ifp->desc.bNumEndpoints >= num_ep) in usb_parse_endpoint()
295 endpoint = &ifp->endpoint[ifp->desc.bNumEndpoints]; in usb_parse_endpoint()
296 memcpy(&endpoint->desc, d, n); in usb_parse_endpoint()
297 d = &endpoint->desc; in usb_parse_endpoint()
305 endpoint->desc.bEndpointAddress = i; in usb_parse_endpoint()
326 ++ifp->desc.bNumEndpoints; in usb_parse_endpoint()
398 endpoint->desc.bInterval = n; in usb_parse_endpoint()
409 endpoint->desc.bmAttributes = USB_ENDPOINT_XFER_INT; in usb_parse_endpoint()
410 endpoint->desc.bInterval = 1; in usb_parse_endpoint()
411 if (usb_endpoint_maxp(&endpoint->desc) > 8) in usb_parse_endpoint()
412 endpoint->desc.wMaxPacketSize = cpu_to_le16(8); in usb_parse_endpoint()
421 maxp = le16_to_cpu(endpoint->desc.wMaxPacketSize); in usb_parse_endpoint()
451 j = maxpacket_maxes[usb_endpoint_type(&endpoint->desc)]; in usb_parse_endpoint()
457 endpoint->desc.wMaxPacketSize = cpu_to_le16(i | maxp); in usb_parse_endpoint()
533 for (i = 0; i < config->desc.bNumInterfaces; ++i) { in usb_parse_interface()
547 if (alt->desc.bAlternateSetting == asnum) { in usb_parse_interface()
556 memcpy(&alt->desc, d, USB_DT_INTERFACE_SIZE); in usb_parse_interface()
571 num_ep = num_ep_orig = alt->desc.bNumEndpoints; in usb_parse_interface()
572 alt->desc.bNumEndpoints = 0; /* Use as a counter */ in usb_parse_interface()
633 memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE); in usb_parse_configuration()
634 nintf = nintf_orig = config->desc.bNumInterfaces; in usb_parse_configuration()
635 config->desc.bNumInterfaces = 0; // Adjusted later in usb_parse_configuration()
637 if (config->desc.bDescriptorType != USB_DT_CONFIG || in usb_parse_configuration()
638 config->desc.bLength < USB_DT_CONFIG_SIZE || in usb_parse_configuration()
639 config->desc.bLength > size) { in usb_parse_configuration()
642 config->desc.bDescriptorType, config->desc.bLength); in usb_parse_configuration()
645 cfgno = config->desc.bConfigurationValue; in usb_parse_configuration()
647 buffer += config->desc.bLength; in usb_parse_configuration()
648 size -= config->desc.bLength; in usb_parse_configuration()
752 config->desc.wTotalLength = cpu_to_le16(buffer2 - buffer0); in usb_parse_configuration()
760 config->desc.bNumInterfaces = nintf = n; in usb_parse_configuration()
821 if (intfc->altsetting[n].desc. in usb_parse_configuration()
856 for (i = 0; i < cf->desc.bNumInterfaces; i++) { in usb_destroy_configuration()
879 struct usb_config_descriptor *desc; in usb_get_configuration() local
903 desc = kmalloc(USB_DT_CONFIG_SIZE, GFP_KERNEL); in usb_get_configuration()
904 if (!desc) in usb_get_configuration()
911 desc, USB_DT_CONFIG_SIZE); in usb_get_configuration()
927 length = max((int) le16_to_cpu(desc->wTotalLength), in usb_get_configuration()
965 kfree(desc); in usb_get_configuration()
974 kfree(dev->bos->desc); in usb_release_bos_descriptor()
1032 dev->bos->desc = (struct usb_bos_descriptor *)buffer; in usb_get_bos_descriptor()
1050 dev->bos->desc->bNumDeviceCaps = i; in usb_get_bos_descriptor()
1056 dev->bos->desc->bNumDeviceCaps = i; in usb_get_bos_descriptor()
1097 dev->bos->desc->wTotalLength = cpu_to_le16(buffer - buffer0); in usb_get_bos_descriptor()