Lines Matching +full:full +full:- +full:size
1 // SPDX-License-Identifier: GPL-2.0+
3 * epautoconf.c -- endpoint autoconfiguration for usb gadget drivers
20 * usb_ep_autoconfig_ss() - choose an endpoint matching the ep
25 * size must also be initialized. This is modified on
44 * Also, high and full speed descriptors will be different.
54 * is initialized as if the endpoint were used at full speed and
59 * assigning ep->claimed to true.
71 if (gadget->ops->match_ep) { in usb_ep_autoconfig_ss()
72 ep = gadget->ops->match_ep(gadget, desc, ep_comp); in usb_ep_autoconfig_ss()
78 list_for_each_entry (ep, &gadget->ep_list, ep_list) { in usb_ep_autoconfig_ss()
91 if (desc->wMaxPacketSize == 0) in usb_ep_autoconfig_ss()
92 desc->wMaxPacketSize = cpu_to_le16(ep->maxpacket_limit); in usb_ep_autoconfig_ss()
95 desc->bEndpointAddress &= USB_DIR_IN; in usb_ep_autoconfig_ss()
96 if (isdigit(ep->name[2])) { in usb_ep_autoconfig_ss()
97 u8 num = simple_strtoul(&ep->name[2], NULL, 10); in usb_ep_autoconfig_ss()
98 desc->bEndpointAddress |= num; in usb_ep_autoconfig_ss()
99 } else if (desc->bEndpointAddress & USB_DIR_IN) { in usb_ep_autoconfig_ss()
100 if (++gadget->in_epnum > 15) in usb_ep_autoconfig_ss()
102 desc->bEndpointAddress = USB_DIR_IN | gadget->in_epnum; in usb_ep_autoconfig_ss()
104 if (++gadget->out_epnum > 15) in usb_ep_autoconfig_ss()
106 desc->bEndpointAddress |= gadget->out_epnum; in usb_ep_autoconfig_ss()
109 ep->address = desc->bEndpointAddress; in usb_ep_autoconfig_ss()
110 ep->desc = NULL; in usb_ep_autoconfig_ss()
111 ep->comp_desc = NULL; in usb_ep_autoconfig_ss()
112 ep->claimed = true; in usb_ep_autoconfig_ss()
118 * usb_ep_autoconfig() - choose an endpoint matching the
123 * size must also be initialized. This is modified on success.
133 * Also, high and full speed descriptors will be different.
142 * is initialized as if the endpoint were used at full speed. Because of
145 * claims it by assigning ep->claimed to true.
161 type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; in usb_ep_autoconfig()
163 /* report (variable) full speed bulk maxpacket */ in usb_ep_autoconfig()
165 int size = ep->maxpacket_limit; in usb_ep_autoconfig() local
167 /* min() doesn't work on bitfields with gcc-3.5 */ in usb_ep_autoconfig()
168 if (size > 64) in usb_ep_autoconfig()
169 size = 64; in usb_ep_autoconfig()
170 desc->wMaxPacketSize = cpu_to_le16(size); in usb_ep_autoconfig()
178 * usb_ep_autoconfig_release - releases endpoint and set it to initial state
189 ep->claimed = false; in usb_ep_autoconfig_release()
190 ep->driver_data = NULL; in usb_ep_autoconfig_release()
195 * usb_ep_autoconfig_reset - reset endpoint autoconfig state
200 * state such as ep->claimed and the record of assigned endpoints
207 list_for_each_entry (ep, &gadget->ep_list, ep_list) { in usb_ep_autoconfig_reset()
208 ep->claimed = false; in usb_ep_autoconfig_reset()
209 ep->driver_data = NULL; in usb_ep_autoconfig_reset()
211 gadget->in_epnum = 0; in usb_ep_autoconfig_reset()
212 gadget->out_epnum = 0; in usb_ep_autoconfig_reset()