#include "dwc_otg_os_dep.h"
#include "dwc_otg_pcd_if.h"
#include "dwc_otg_pcd.h"
#include "dwc_otg_driver.h"
#include "dwc_otg_dbg.h"
Go to the source code of this file.
Data Structures | |
| struct | gadget_wrapper |
Functions | |
| void | dump_msg (const u8 *buf, unsigned int length) |
| dwc_otg_pcd_ep * | ep_from_handle (dwc_otg_pcd_t *pcd, void *handle) |
| Get the dwc_otg_pcd_ep_t* from usb_ep* pointer - NULL in case if the endpoint is not found. | |
| int | ep_enable (struct usb_ep *usb_ep, const struct usb_endpoint_descriptor *ep_desc) |
| This function is called by the Gadget Driver for each EP to be configured for the current configuration (SET_CONFIGURATION). | |
| int | ep_disable (struct usb_ep *usb_ep) |
| This function is called when an EP is disabled due to disconnect or change in configuration. | |
| usb_request * | dwc_otg_pcd_alloc_request (struct usb_ep *ep, gfp_t gfp_flags) |
| This function allocates a request object to use with the specified endpoint. | |
| void | dwc_otg_pcd_free_request (struct usb_ep *ep, struct usb_request *req) |
| This function frees a request object. | |
| int | ep_queue (struct usb_ep *usb_ep, struct usb_request *usb_req, gfp_t gfp_flags) |
| This function is used to submit an I/O Request to an EP. | |
| int | ep_dequeue (struct usb_ep *usb_ep, struct usb_request *usb_req) |
| This function cancels an I/O request from an EP. | |
| int | ep_halt (struct usb_ep *usb_ep, int value) |
| usb_ep_set_halt stalls an endpoint. | |
| int | iso_ep_start (struct usb_ep *usb_ep, struct usb_iso_request *req, gfp_t gfp_flags) |
| This function is used to submit an ISOC Transfer Request to an EP. | |
| int | iso_ep_stop (struct usb_ep *usb_ep, struct usb_iso_request *req) |
| This function stops ISO EP Periodic Data Transfer. | |
| usb_iso_request * | alloc_iso_request (struct usb_ep *ep, int packets, gfp_t gfp_flags) |
| void | free_iso_request (struct usb_ep *ep, struct usb_iso_request *req) |
| int | get_frame_number (struct usb_gadget *gadget) |
| Gets the USB Frame number of the last SOF. | |
| int | wakeup (struct usb_gadget *gadget) |
| Initiates Session Request Protocol (SRP) to wakeup the host if no session is in progress. | |
| int | _setup (dwc_otg_pcd_t *pcd, uint8_t *bytes) |
| int | _isoc_complete (dwc_otg_pcd_t *pcd, void *ep_handle, void *req_handle, int proc_buf_num) |
| int | _complete (dwc_otg_pcd_t *pcd, void *ep_handle, void *req_handle, int32_t status, uint32_t actual) |
| int | _connect (dwc_otg_pcd_t *pcd, int speed) |
| int | _disconnect (dwc_otg_pcd_t *pcd) |
| int | _resume (dwc_otg_pcd_t *pcd) |
| int | _suspend (dwc_otg_pcd_t *pcd) |
| int | _hnp_changed (dwc_otg_pcd_t *pcd) |
| This function updates the otg values in the gadget structure. | |
| int | _reset (dwc_otg_pcd_t *pcd) |
| irqreturn_t | dwc_otg_pcd_irq (int irq, void *dev) |
| This function is the top level PCD interrupt handler. | |
| void | gadget_add_eps (struct gadget_wrapper *d) |
| This function initialized the usb_ep structures to there default state. | |
| void | dwc_otg_pcd_gadget_release (struct device *dev) |
| This function releases the Gadget device. | |
| gadget_wrapper * | alloc_wrapper () |
| void | free_wrapper (struct gadget_wrapper *d) |
| int | pcd_init () |
| This function initialized the PCD portion of the driver. | |
| void | pcd_remove () |
| Cleanup the PCD. | |
| int | usb_gadget_probe_driver (struct usb_gadget_driver *driver, int(*bind)(struct usb_gadget *)) |
| This function registers a gadget driver with the PCD. | |
| EXPORT_SYMBOL (usb_gadget_probe_driver) | |
| int | usb_gadget_unregister_driver (struct usb_gadget_driver *driver) |
| This function unregisters a gadget driver. | |
| EXPORT_SYMBOL (usb_gadget_unregister_driver) | |
Variables | |
| gadget_wrapper * | gadget_wrapper |
| usb_isoc_ep_ops | dwc_otg_pcd_ep_ops |
| const struct usb_gadget_ops | dwc_otg_pcd_ops |
| const struct dwc_otg_pcd_function_ops | fops |
The Peripheral Controller Driver (PCD) is responsible for translating requests from the Function Driver into the appropriate actions on the DWC_otg controller. It isolates the Function Driver from the specifics of the controller by providing an API to the Function Driver.
The Peripheral Controller Driver for Linux will implement the Gadget API, so that the existing Gadget drivers can be used. (Gadget Driver is the Linux terminology for a Function Driver.)
The Linux Gadget API is defined in the header file <linux/usb_gadget.h>. The USB EP operations API is defined in the structure usb_ep_ops and the USB Controller API is defined in the structure usb_gadget_ops.
Definition in file dwc_otg_pcd_linux.c.
|
||||||||||||
|
This function is called by the Gadget Driver for each EP to be configured for the current configuration (SET_CONFIGURATION). This function initializes the dwc_otg_ep_t data structure, and then calls dwc_otg_ep_activate. Definition at line 121 of file dwc_otg_pcd_linux.c. |
|
|
This function is called when an EP is disabled due to disconnect or change in configuration. Any pending requests will terminate with a status of -ESHUTDOWN. This function modifies the dwc_otg_ep_t data structure for this EP, and then calls dwc_otg_ep_deactivate. Definition at line 177 of file dwc_otg_pcd_linux.c. |
|
||||||||||||
|
This function allocates a request object to use with the specified endpoint.
Definition at line 203 of file dwc_otg_pcd_linux.c. |
|
||||||||||||
|
This function frees a request object.
Definition at line 230 of file dwc_otg_pcd_linux.c. |
|
||||||||||||||||
|
This function is used to submit an I/O Request to an EP.
Definition at line 317 of file dwc_otg_pcd_linux.c. |
|
||||||||||||
|
usb_ep_set_halt stalls an endpoint. usb_ep_clear_halt clears an endpoint halt and resets its data toggle. Both of these functions are implemented with the same underlying function. The behavior depends on the value argument.
Definition at line 430 of file dwc_otg_pcd_linux.c. |
|
||||||||||||||||
|
This function is used to submit an ISOC Transfer Request to an EP.
Definition at line 461 of file dwc_otg_pcd_linux.c. |
|
|
Initiates Session Request Protocol (SRP) to wakeup the host if no session is in progress. If a session is already in progress, but the device is suspended, remote wakeup signaling is started. Definition at line 646 of file dwc_otg_pcd_linux.c. |
|
|
This function initialized the usb_ep structures to there default state.
Initialize the EP0 structure.
Initialize the EP structures. Definition at line 950 of file dwc_otg_pcd_linux.c. |
|
|
This function releases the Gadget device. required by device_unregister().
Definition at line 1067 of file dwc_otg_pcd_linux.c. |
|
||||||||||||
|
This function registers a gadget driver with the PCD. When a driver is successfully registered, it will receive control requests including set_configuration(), which enables non-control requests. then usb traffic follows until a disconnect is reported. then a host may connect again, or the driver might get unbound.
Definition at line 1234 of file dwc_otg_pcd_linux.c. |
|
|
This function unregisters a gadget driver.
Definition at line 1294 of file dwc_otg_pcd_linux.c. |
|
|
Initial value: {
.ep_ops = {
.enable = ep_enable,
.disable = ep_disable,
.alloc_request = dwc_otg_pcd_alloc_request,
.free_request = dwc_otg_pcd_free_request,
.queue = ep_queue,
.dequeue = ep_dequeue,
.set_halt = ep_halt,
.fifo_status = 0,
.fifo_flush = 0,
},
.iso_ep_start = iso_ep_start,
.iso_ep_stop = iso_ep_stop,
.alloc_iso_request = alloc_iso_request,
.free_iso_request = free_iso_request,
}
Definition at line 546 of file dwc_otg_pcd_linux.c. |
|
|
Initial value: {
.get_frame = get_frame_number,
.wakeup = wakeup,
}
Definition at line 661 of file dwc_otg_pcd_linux.c. |
|
|
Initial value: {
.complete = _complete,
.isoc_complete = _isoc_complete,
.setup = _setup,
.disconnect = _disconnect,
.connect = _connect,
.resume = _resume,
.suspend = _suspend,
.hnp_changed = _hnp_changed,
.reset = _reset,
}
Definition at line 909 of file dwc_otg_pcd_linux.c. |
1.3.9.1