#include "dwc_otg_core_if.h"
Go to the source code of this file.
Data Structures | |
| struct | dwc_otg_pcd_function_ops |
| Function Driver Ops Data Structure. More... | |
Function Driver Callbacks | |
| typedef int(* | dwc_completion_cb_t )(dwc_otg_pcd_t *pcd, void *ep_handle, void *req_handle, int32_t status, uint32_t actual) |
| This function will be called whenever a previously queued request has completed. | |
| typedef int(* | dwc_isoc_completion_cb_t )(dwc_otg_pcd_t *pcd, void *ep_handle, void *req_handle, int proc_buf_num) |
| This function will be called whenever a previousle queued ISOC request has completed. | |
| typedef int(* | dwc_setup_cb_t )(dwc_otg_pcd_t *pcd, uint8_t *bytes) |
| This function should handle any SETUP request that cannot be handled by the PCD Core. | |
| typedef int(* | dwc_disconnect_cb_t )(dwc_otg_pcd_t *pcd) |
| This is called whenever the device has been disconnected. | |
| typedef int(* | dwc_connect_cb_t )(dwc_otg_pcd_t *pcd, int speed) |
| This function is called when device has been connected. | |
| typedef int(* | dwc_suspend_cb_t )(dwc_otg_pcd_t *pcd) |
| This function is called when device has been suspended. | |
| typedef int(* | dwc_sleep_cb_t )(dwc_otg_pcd_t *pcd) |
| This function is called when device has received LPM tokens, i.e. | |
| typedef int(* | dwc_resume_cb_t )(dwc_otg_pcd_t *pcd) |
| This function is called when device has been resumed from suspend(L2) or L1 sleep state. | |
| typedef int(* | dwc_hnp_params_changed_cb_t )(dwc_otg_pcd_t *pcd) |
| This function is called whenever hnp params has been changed. | |
| typedef int(* | dwc_reset_cb_t )(dwc_otg_pcd_t *pcd) |
| This function is called whenever USB RESET is detected. | |
| typedef int(* | cfi_setup_cb_t )(dwc_otg_pcd_t *pcd, void *ctrl_req_bytes) |
| typedef int(* | xiso_completion_cb_t )(dwc_otg_pcd_t *pcd, void *ep_handle, void *req_handle, int32_t status, void *ereq_port) |
Function Driver Functions | |
| 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. | |
| 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. | |
| 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. | |
| int32_t | dwc_otg_pcd_handle_intr (dwc_otg_pcd_t *pcd) |
| This function should be called on every hardware interrupt. | |
| int | dwc_otg_pcd_get_frame_number (dwc_otg_pcd_t *pcd) |
| This function returns current frame number. | |
| 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_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. | |
| int | dwc_otg_pcd_get_iso_packet_count (dwc_otg_pcd_t *pcd, void *ep_handle, void *iso_req_handle) |
| Get ISOC packet count. | |
| int | dwc_otg_pcd_wakeup (dwc_otg_pcd_t *pcd) |
| This function starts the SRP Protocol if no session is in progress. | |
| int | dwc_otg_pcd_is_lpm_enabled (dwc_otg_pcd_t *pcd) |
| This function returns 1 if LPM support is enabled, and 0 otherwise. | |
| int | dwc_otg_pcd_get_rmwkup_enable (dwc_otg_pcd_t *pcd) |
| This function returns 1 if remote wakeup is allowed and 0, otherwise. | |
| void | dwc_otg_pcd_initiate_srp (dwc_otg_pcd_t *pcd) |
| Initiate SRP. | |
| 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. | |
| 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 | 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) |
| uint8_t * | cfiw_ep_alloc_buffer (dwc_otg_pcd_t *pcd, void *pep, dwc_dma_t *addr, size_t buflen, int flags) |
| Allocate a cfi buffer. | |
Defines | |
| #define | __DWC_PCD_IF_H__ |
| #define | MAX_EP0_SIZE 64 |
| Maxpacket size for EP0. | |
| #define | MAX_PACKET_SIZE 1024 |
| Maxpacket size for any EP. | |
Typedefs | |
| typedef dwc_otg_pcd | dwc_otg_pcd_t |
Definition in file dwc_otg_pcd_if.h.
|
|
This function will be called whenever a previously queued request has completed. The status value will be set to -DWC_E_SHUTDOWN to indicated a failed or aborted transfer, or -DWC_E_RESTART to indicate the device was reset, or -DWC_E_TIMEOUT to indicate it timed out, or -DWC_E_INVALID to indicate invalid parameters. Definition at line 61 of file dwc_otg_pcd_if.h. |
|
|
This function will be called whenever a previousle queued ISOC request has completed. Count of ISOC packets could be read using dwc_otg_pcd_get_iso_packet_count function. The status of each ISOC packet could be read using dwc_otg_pcd_get_iso_packet_* functions. Definition at line 71 of file dwc_otg_pcd_if.h. |
|
|
This function should handle any SETUP request that cannot be handled by the PCD Core. This includes most GET_DESCRIPTORs, SET_CONFIGS, Any class-specific requests, etc. The function must non-blocking. Returns 0 on success. Returns -DWC_E_NOT_SUPPORTED if the request is not supported. Returns -DWC_E_INVALID if the setup request had invalid parameters or bytes. Returns -DWC_E_SHUTDOWN on any other error. Definition at line 81 of file dwc_otg_pcd_if.h. |
|
|
This is called whenever the device has been disconnected. The function driver should take appropriate action to clean up all pending requests in the PCD Core, remove all endpoints (except ep0), and initialize back to reset state. Definition at line 86 of file dwc_otg_pcd_if.h. |
|
|
This function is called when device has received LPM tokens, i.e. device has been sent to sleep state. Definition at line 93 of file dwc_otg_pcd_if.h. |
|
|
This function is called whenever hnp params has been changed. User can call get_b_hnp_enable, get_a_hnp_support, get_a_alt_hnp_support functions to get hnp parameters. Definition at line 100 of file dwc_otg_pcd_if.h. |
|
|
Definition at line 112 of file dwc_otg_pcd_if.h. |
|
|
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. |
|
||||||||||||
|
Call this to bind the function driver to the PCD Core.
Definition at line 119 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 should be called on every hardware interrupt. The PCD handles the device interrupts. Many conditions can cause a device interrupt. When an interrupt occurs, the device interrupt service routine determines the cause of the interrupt and dispatches handling to the appropriate function. These interrupt handling functions are described below. All interrupt registers are processed from LSB to MSB. Definition at line 4702 of file dwc_otg_pcd_intr.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. |
|
||||||||||||||||||||||||||||||||
|
Get ISOC packet status.
Definition at line 889 of file dwc_otg_pcd.c. |
|
||||||||||||||||
|
Get ISOC packet count.
Definition at line 873 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. |
1.3.9.1