| Electronic Components Datasheet Search |
|
UM0851 Datasheet(PDF) 74 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0851 Datasheet(HTML) 74 Page - STMicroelectronics |
|
74 / 245 page ![]() Communication device drivers UM0851 74/245 Doc ID 16604 Rev 2 ss->function.disable = sourcesink_disable; ss->function.suspend = sourcesink_suspend; ss->function.resume = sourcesink_resume; status = usb_add_function(c, &ss->function); if (status) kfree(ss); return status; } Initializing USB descriptors There are some fields in standard USB descriptors that require inputs from the composite layer for initialization. In almost all descriptors some of these fields are indexed to string tables and to an interface number for the interface descriptors. For this there are some helper routines which are described below. static int zero_bind(struct usb_composite_dev *cdev) { /* get next available string index */ id = usb_string_id(cdev); if (id < 0) return id; strings_dev[STRING_MANUFACTURER_IDX].id = id; device_desc.iManufacturer = id; ... } static int sourcesink_bind(struct usb_configuration *c, struct usb_function *f) { ... /* allocate interface ID(s) */ id = usb_interface_id(c, f); if (id < 0) return id; source_sink_intf.bInterfaceNumber = id; ... } Data and control transfer After completing the registering process, the gadget driver can handle setup requests through setup callbacks. In this way, you can configure other required endpoints and initiate a transfer (of control or data) through Linux gadget framework APIs. You can obtain more details on these APIs through references.The following table summarizes these APIs and their purpose. Table 22. Linux gadget endpoint APIs API Description struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, struct usb_endpoint descriptor *) Allocates a suitable free endpoint described by struct usb_endpoint_descriptor int usb_ep_enable(struct usb_ep *ep, const struct usb_endpoint_descriptor *desc) Enables the endpoint ep, in order to be used for data transfer. The endpoint ep is described in struct usb_endpoint_descriptor struct usb_request *usb_ep_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) Allocates a request for USB transfer |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |