#include "dwc_otg_pcd.h"
Go to the source code of this file.
Functions | |
| dwc_otg_pcd_ep_t * | get_ep_from_handle (dwc_otg_pcd_t *pcd, void *handle) |
| Choose endpoint from ep arrays using usb_ep structure. | |
| void | dwc_otg_request_done (dwc_otg_pcd_ep_t *ep, dwc_otg_pcd_request_t *req, int32_t status) |
| This function completes a request. | |
| void | dwc_otg_request_nuke (dwc_otg_pcd_ep_t *ep) |
| This function terminates all the requsts in the EP request queue. | |
| void | dwc_otg_pcd_start (dwc_otg_pcd_t *pcd, const struct dwc_otg_pcd_function_ops *fops) |
| Call this to bind the function driver to the PCD Core. | |
| int32_t | dwc_otg_pcd_start_cb (void *p) |
| PCD Callback function for initializing the PCD when switching to device mode. | |
| uint8_t * | cfiw_ep_alloc_buffer (dwc_otg_pcd_t *pcd, void *pep, dwc_dma_t *addr, size_t buflen, int flags) |
| CFI-specific buffer allocation function for EP. | |
| int32_t | dwc_otg_pcd_resume_cb (void *p) |
| PCD Callback function for notifying the PCD when resuming from suspend. | |
| int32_t | dwc_otg_pcd_suspend_cb (void *p) |
| PCD Callback function for notifying the PCD device is suspended. | |
| int32_t | dwc_otg_pcd_stop_cb (void *p) |
| PCD Callback function for stopping the PCD when switching to Host mode. | |
| dwc_otg_dev_dma_desc_t * | dwc_otg_ep_alloc_desc_chain (dwc_dma_t *dma_desc_addr, uint32_t count) |
| This function allocates a DMA Descriptor chain for the Endpoint buffer to be used for a transfer to/from the specified endpoint. | |
| void | dwc_otg_ep_free_desc_chain (dwc_otg_dev_dma_desc_t *desc_addr, uint32_t dma_desc_addr, uint32_t count) |
| This function frees a DMA Descriptor chain that was allocated by ep_alloc_desc. | |
| void | dwc_otg_iso_ep_start_ddma_transfer (dwc_otg_core_if_t *core_if, dwc_ep_t *dwc_ep) |
| This function initializes a descriptor chain for Isochronous transfer. | |
| void | dwc_otg_iso_ep_start_buf_transfer (dwc_otg_core_if_t *core_if, dwc_ep_t *ep) |
| This function initializes a descriptor chain for Isochronous transfer. | |
| void | dwc_otg_iso_ep_start_transfer (dwc_otg_core_if_t *core_if, dwc_ep_t *ep) |
| This function does the setup for a data transfer for an EP and starts the transfer. | |
| void | dwc_otg_iso_ep_stop_transfer (dwc_otg_core_if_t *core_if, dwc_ep_t *ep) |
| This function stops transfer for an EP and resets the ep's variables. | |
| int | dwc_otg_pcd_iso_ep_start (dwc_otg_pcd_t *pcd, void *ep_handle, uint8_t *buf0, uint8_t *buf1, dwc_dma_t dma0, dwc_dma_t dma1, int sync_frame, int dp_frame, int data_per_frame, int start_frame, int buf_proc_intrvl, void *req_handle, int atomic_alloc) |
| Start isochronous transfers on the endpoint referenced by ep_handle. | |
| int | dwc_otg_pcd_iso_ep_stop (dwc_otg_pcd_t *pcd, void *ep_handle, void *req_handle) |
| Stop ISOC transfers on endpoint referenced by ep_handle. | |
| void | dwc_otg_iso_buffer_done (dwc_otg_pcd_t *pcd, dwc_otg_pcd_ep_t *ep, void *req_handle) |
| This function is used for perodical data exchnage between PCD and gadget drivers. | |
| int | dwc_otg_pcd_get_iso_packet_count (dwc_otg_pcd_t *pcd, void *ep_handle, void *iso_req_handle) |
| Get ISOC packet count. | |
| void | dwc_otg_pcd_get_iso_packet_params (dwc_otg_pcd_t *pcd, void *ep_handle, void *iso_req_handle, int packet, int *status, int *actual, int *offset) |
| Get ISOC packet status. | |
| void | dwc_otg_pcd_init_ep (dwc_otg_pcd_t *pcd, dwc_otg_pcd_ep_t *pcd_ep, uint32_t is_in, uint32_t ep_num) |
| void | dwc_otg_pcd_reinit (dwc_otg_pcd_t *pcd) |
| Initialize ep's. | |
| void | srp_timeout (void *ptr) |
| This function is called when the SRP timer expires. | |
| void | start_next_request (dwc_otg_pcd_ep_t *ep) |
| Tasklet. | |
| void | start_xfer_tasklet_func (void *data) |
| dwc_otg_pcd_t * | dwc_otg_pcd_init (dwc_otg_core_if_t *core_if) |
| Call this function to get pointer on dwc_otg_pcd_t, this pointer will be used for all PCD API functions. | |
| void | dwc_otg_pcd_remove (dwc_otg_pcd_t *pcd) |
| Frees PCD allocated by dwc_otg_pcd_init. | |
| uint32_t | dwc_otg_pcd_is_dualspeed (dwc_otg_pcd_t *pcd) |
| This function returns whether device is dualspeed. | |
| uint32_t | dwc_otg_pcd_is_otg (dwc_otg_pcd_t *pcd) |
| This function returns whether device is otg. | |
| uint32_t | assign_tx_fifo (dwc_otg_core_if_t *core_if) |
| This function assigns periodic Tx FIFO to an periodic EP in shared Tx FIFO mode. | |
| uint32_t | assign_perio_tx_fifo (dwc_otg_core_if_t *core_if) |
| This function assigns periodic Tx FIFO to an periodic EP in shared Tx FIFO mode. | |
| void | release_perio_tx_fifo (dwc_otg_core_if_t *core_if, uint32_t fifo_num) |
| This function releases periodic Tx FIFO in shared Tx FIFO mode. | |
| void | release_tx_fifo (dwc_otg_core_if_t *core_if, uint32_t fifo_num) |
| This function releases periodic Tx FIFO in shared Tx FIFO mode. | |
| int | dwc_otg_pcd_ep_enable (dwc_otg_pcd_t *pcd, const uint8_t *ep_desc, void *usb_ep) |
| Enables an endpoint for use. | |
| int | dwc_otg_pcd_ep_disable (dwc_otg_pcd_t *pcd, void *ep_handle) |
| Disable the endpoint referenced by ep_handle. | |
| int | dwc_otg_pcd_ep_queue (dwc_otg_pcd_t *pcd, void *ep_handle, uint8_t *buf, dwc_dma_t dma_buf, uint32_t buflen, int zero, void *req_handle, int atomic_alloc) |
| Queue a data transfer request on the endpoint referenced by ep_handle. | |
| int | dwc_otg_pcd_ep_dequeue (dwc_otg_pcd_t *pcd, void *ep_handle, void *req_handle) |
| De-queue the specified data transfer that has not yet completed. | |
| int | dwc_otg_pcd_ep_halt (dwc_otg_pcd_t *pcd, void *ep_handle, int value) |
| Halt (STALL) an endpoint or clear it. | |
| void | dwc_otg_pcd_rem_wkup_from_suspend (dwc_otg_pcd_t *pcd, int set) |
| This function initiates remote wakeup of the host from suspend state. | |
| void | dwc_otg_pcd_remote_wakeup (dwc_otg_pcd_t *pcd, int set) |
| Starts remote wakeup signaling. | |
| void | dwc_otg_pcd_disconnect_us (dwc_otg_pcd_t *pcd, int no_of_usecs) |
| Starts micorsecond soft disconnect. | |
| int | dwc_otg_pcd_wakeup (dwc_otg_pcd_t *pcd) |
| This function starts the SRP Protocol if no session is in progress. | |
| void | dwc_otg_pcd_initiate_srp (dwc_otg_pcd_t *pcd) |
| Initiate SRP. | |
| int | dwc_otg_pcd_get_frame_number (dwc_otg_pcd_t *pcd) |
| This function returns current frame number. | |
| int | dwc_otg_pcd_is_lpm_enabled (dwc_otg_pcd_t *pcd) |
| This function returns 1 if LPM support is enabled, and 0 otherwise. | |
| uint32_t | get_b_hnp_enable (dwc_otg_pcd_t *pcd) |
| These functions allow to get hnp parameters. | |
| uint32_t | get_a_hnp_support (dwc_otg_pcd_t *pcd) |
| uint32_t | get_a_alt_hnp_support (dwc_otg_pcd_t *pcd) |
| int | dwc_otg_pcd_get_rmwkup_enable (dwc_otg_pcd_t *pcd) |
| This function returns 1 if remote wakeup is allowed and 0, otherwise. | |
Variables | |
| dwc_otg_cil_callbacks_t | pcd_callbacks |
| PCD Callback structure for handling mode switching. | |
All code in this file is portable and doesn't use any OS specific functions. PCD Core provides Interface, defined in <dwc_otg_pcd_if.h> header file, which can be used to implement OS specific PCD interface.
An important function of the PCD is managing interrupts generated by the DWC_otg controller. The implementation of the DWC_otg device mode interrupt service routines is in dwc_otg_pcd_intr.c.
Does it work when the request size is greater than DEPTSIZ transfer size
Definition in file dwc_otg_pcd.c.
|
||||||||||||||||
|
This function completes a request. It call's the request call back. Definition at line 81 of file dwc_otg_pcd.c. |
|
||||||||||||
|
Call this to bind the function driver to the PCD Core.
Definition at line 119 of file dwc_otg_pcd.c. |
|
|
PCD Callback function for initializing the PCD when switching to device mode.
Definition at line 131 of file dwc_otg_pcd.c. |
|
|
PCD Callback function for notifying the PCD when resuming from suspend.
Definition at line 173 of file dwc_otg_pcd.c. |
|
|
PCD Callback function for notifying the PCD device is suspended.
Definition at line 197 of file dwc_otg_pcd.c. |
|
|
PCD Callback function for stopping the PCD when switching to Host mode.
Definition at line 216 of file dwc_otg_pcd.c. |
|
||||||||||||
|
This function initializes a descriptor chain for Isochronous transfer.
Allocate descriptors for double buffering ISO OUT EP Buffer 0 descriptors setup Buffer 1 descriptors setup Write dma_ad into DOEPDMA register ISO IN EP Buffer 0 descriptors setup Buffer 1 descriptors setup Write dma_ad into diepdma register Enable endpoint, clear nak Definition at line 266 of file dwc_otg_pcd.c. |
|
||||||||||||
|
This function initializes a descriptor chain for Isochronous transfer.
Enable endpoint, clear nak Definition at line 540 of file dwc_otg_pcd.c. |
|
||||||||||||
|
This function does the setup for a data transfer for an EP and starts the transfer. For an IN transfer, the packets will be loaded into the appropriate Tx FIFO in the ISR. For OUT transfers, the packets are unloaded from the Rx FIFO in the ISR.
Definition at line 623 of file dwc_otg_pcd.c. |
|
||||||||||||
|
This function stops transfer for an EP and resets the ep's variables.
Definition at line 664 of file dwc_otg_pcd.c. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Start isochronous transfers on the endpoint referenced by ep_handle.
Definition at line 708 of file dwc_otg_pcd.c. |
|
||||||||||||||||
|
Stop ISOC transfers on endpoint referenced by ep_handle.
Definition at line 817 of file dwc_otg_pcd.c. |
|
||||||||||||||||
|
This function is used for perodical data exchnage between PCD and gadget drivers. for Isochronous EPs
Definition at line 853 of file dwc_otg_pcd.c. |
|
||||||||||||||||
|
Get ISOC packet count.
Definition at line 873 of file dwc_otg_pcd.c. |
|
||||||||||||||||||||||||||||||||
|
Get ISOC packet status.
Definition at line 889 of file dwc_otg_pcd.c. |
|
|
Initialize ep's. Initialize the EP0 structure.
Definition at line 941 of file dwc_otg_pcd.c. |
|
|
This function is called when the SRP timer expires. The SRP should complete within 6 seconds. Definition at line 1000 of file dwc_otg_pcd.c. |
|
|
Call this function to get pointer on dwc_otg_pcd_t, this pointer will be used for all PCD API functions. Initialize xfer timeout timer. Implemented for 2.93a feature "Device DDMA OUT NAK Enhancement" Definition at line 1110 of file dwc_otg_pcd.c. |
|
|
Frees PCD allocated by dwc_otg_pcd_init.
Definition at line 1309 of file dwc_otg_pcd.c. |
|
||||||||||||||||
|
Enables an endpoint for use. This function enables an endpoint in the PCD. The endpoint is described by the ep_desc which has the same format as a USB ep descriptor. The ep_handle parameter is used to refer to the endpoint from other API functions and in callbacks. Normally this should be called after a SET_CONFIGURATION/SET_INTERFACE to configure the core for that interface. Returns -DWC_E_INVALID if invalid parameters were passed. Returns -DWC_E_SHUTDOWN if any other error ocurred. Returns 0 on success.
Definition at line 1461 of file dwc_otg_pcd.c. |
|
||||||||||||
|
Disable the endpoint referenced by ep_handle. Returns -DWC_E_INVALID if invalid parameters were passed. Returns -DWC_E_SHUTDOWN if any other error occurred. Returns 0 on success. Definition at line 1622 of file dwc_otg_pcd.c. |
|
||||||||||||||||||||||||||||||||||||
|
Queue a data transfer request on the endpoint referenced by ep_handle.
Definition at line 2079 of file dwc_otg_pcd.c. |
|
||||||||||||||||
|
De-queue the specified data transfer that has not yet completed. Returns -DWC_E_INVALID if invalid parameters were passed. Returns -DWC_E_SHUTDOWN if any other error ocurred. Returns 0 on success. Definition at line 2306 of file dwc_otg_pcd.c. |
|
||||||||||||||||
|
Halt (STALL) an endpoint or clear it. Returns -DWC_E_INVALID if invalid parameters were passed. Returns -DWC_E_SHUTDOWN if any other error ocurred. Returns -DWC_E_AGAIN if the STALL cannot be sent and must be tried again later Returns 0 on success. Definition at line 2345 of file dwc_otg_pcd.c. |
|
|
This function starts the SRP Protocol 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 2559 of file dwc_otg_pcd.c. |
|
|
Initiate SRP.
Definition at line 2596 of file dwc_otg_pcd.c. |
|
|
Initial value: {
.start = dwc_otg_pcd_start_cb,
.stop = dwc_otg_pcd_stop_cb,
.suspend = dwc_otg_pcd_suspend_cb,
.resume_wakeup = dwc_otg_pcd_resume_cb,
.p = 0,
}
Definition at line 228 of file dwc_otg_pcd.c. |
1.3.9.1