#include "dwc_otg_core_if.h"
Go to the source code of this file.
Data Structures | |
| struct | dwc_otg_hcd_function_ops |
HCD Core API | |
| #define | URB_GIVEBACK_ASAP 0x1 |
| #define | URB_SEND_ZERO_PACKET 0x2 |
| dwc_otg_hcd_t * | dwc_otg_hcd_alloc_hcd (void) |
| This function allocates dwc_otg_hcd structure and returns pointer on it. | |
| int | dwc_otg_hcd_init (dwc_otg_hcd_t *hcd, dwc_otg_core_if_t *core_if) |
| This function should be called to initiate HCD Core. | |
| void | dwc_otg_hcd_remove (dwc_otg_hcd_t *hcd) |
| Frees HCD. | |
| int32_t | dwc_otg_hcd_handle_intr (dwc_otg_hcd_t *dwc_otg_hcd) |
| This function should be called on every hardware interrupt. | |
| void * | dwc_otg_hcd_get_priv_data (dwc_otg_hcd_t *hcd) |
| Returns private data set by dwc_otg_hcd_set_priv_data function. | |
| void | dwc_otg_hcd_set_priv_data (dwc_otg_hcd_t *hcd, void *priv_data) |
| Set private data. | |
| int | dwc_otg_hcd_start (dwc_otg_hcd_t *hcd, struct dwc_otg_hcd_function_ops *fops) |
| This function initializes the HCD Core. | |
| void | dwc_otg_hcd_stop (dwc_otg_hcd_t *hcd) |
| Halts the DWC_otg host mode operations in a clean manner. | |
| int | dwc_otg_hcd_hub_control (dwc_otg_hcd_t *dwc_otg_hcd, uint16_t typeReq, uint16_t wValue, uint16_t wIndex, uint8_t *buf, uint16_t wLength) |
| Handles hub class-specific requests. | |
| uint32_t | dwc_otg_hcd_otg_port (dwc_otg_hcd_t *hcd) |
| Returns otg port number. | |
| uint16_t | dwc_otg_get_otg_version (dwc_otg_core_if_t *core_if) |
| Returns OTG version - either 1.3 or 2.0. | |
| uint32_t | dwc_otg_hcd_is_b_host (dwc_otg_hcd_t *hcd) |
| Returns 1 if currently core is acting as B host, and 0 otherwise. | |
| int | dwc_otg_hcd_get_frame_number (dwc_otg_hcd_t *hcd) |
| Returns current frame number. | |
| void | dwc_otg_hcd_dump_state (dwc_otg_hcd_t *hcd) |
| Dumps hcd state. | |
| void | dwc_otg_hcd_dump_frrem (dwc_otg_hcd_t *hcd) |
| Dump the average frame remaining at SOF. | |
| int | dwc_otg_hcd_send_lpm (dwc_otg_hcd_t *hcd, uint8_t devaddr, uint8_t hird, uint8_t bRemoteWake) |
| Sends LPM transaction to the local device. | |
| dwc_otg_hcd_urb_t * | dwc_otg_hcd_urb_alloc (dwc_otg_hcd_t *hcd, int iso_desc_count, int atomic_alloc) |
| Allocates memory for dwc_otg_hcd_urb structure. | |
| void | dwc_otg_hcd_urb_set_pipeinfo (dwc_otg_hcd_urb_t *hcd_urb, uint8_t devaddr, uint8_t ep_num, uint8_t ep_type, uint8_t ep_dir, uint16_t mps) |
| Set pipe information in URB. | |
| void | dwc_otg_hcd_urb_set_params (dwc_otg_hcd_urb_t *urb, void *urb_handle, void *buf, dwc_dma_t dma, uint32_t buflen, void *sp, dwc_dma_t sp_dma, uint32_t flags, uint16_t interval) |
| Sets dwc_otg_hcd_urb parameters. | |
| uint32_t | dwc_otg_hcd_urb_get_status (dwc_otg_hcd_urb_t *dwc_otg_urb) |
| Gets status from dwc_otg_hcd_urb. | |
| uint32_t | dwc_otg_hcd_urb_get_actual_length (dwc_otg_hcd_urb_t *dwc_otg_urb) |
| Gets actual length from dwc_otg_hcd_urb. | |
| uint32_t | dwc_otg_hcd_urb_get_error_count (dwc_otg_hcd_urb_t *dwc_otg_urb) |
| Gets error count from dwc_otg_hcd_urb. | |
| void | dwc_otg_hcd_urb_set_iso_desc_params (dwc_otg_hcd_urb_t *dwc_otg_urb, int desc_num, uint32_t offset, uint32_t length) |
| Set ISOC descriptor offset and length. | |
| uint32_t | dwc_otg_hcd_urb_get_iso_desc_status (dwc_otg_hcd_urb_t *dwc_otg_urb, int desc_num) |
| Get status of ISOC descriptor, specified by desc_num. | |
| uint32_t | dwc_otg_hcd_urb_get_iso_desc_actual_length (dwc_otg_hcd_urb_t *dwc_otg_urb, int desc_num) |
| Get actual length of ISOC descriptor, specified by desc_num. | |
| int | dwc_otg_hcd_urb_enqueue (dwc_otg_hcd_t *dwc_otg_hcd, dwc_otg_hcd_urb_t *dwc_otg_urb, void **ep_handle, int atomic_alloc) |
| Queue URB. | |
| int | dwc_otg_hcd_urb_dequeue (dwc_otg_hcd_t *dwc_otg_hcd, dwc_otg_hcd_urb_t *dwc_otg_urb) |
| De-queue the specified URB. | |
| int | dwc_otg_hcd_endpoint_disable (dwc_otg_hcd_t *hcd, void *ep_handle, int retry) |
| Frees resources in the DWC_otg controller related to a given endpoint. | |
| int | dwc_otg_hcd_endpoint_reset (dwc_otg_hcd_t *hcd, void *ep_handle) |
| int | dwc_otg_hcd_is_status_changed (dwc_otg_hcd_t *hcd, int port) |
| Returns 1 if status of specified port is changed and 0 otherwise. | |
| int | dwc_otg_hcd_is_bandwidth_allocated (dwc_otg_hcd_t *hcd, void *ep_handle) |
| Call this function to check if bandwidth was allocated for specified endpoint. | |
| int | dwc_otg_hcd_is_bandwidth_freed (dwc_otg_hcd_t *hcd, void *ep_handle) |
| Call this function to check if bandwidth was freed for specified endpoint. | |
| uint8_t | dwc_otg_hcd_get_ep_bandwidth (dwc_otg_hcd_t *hcd, void *ep_handle) |
| Returns bandwidth allocated for specified endpoint in microseconds. | |
HCD Function Driver Callbacks | |
| typedef int(* | dwc_otg_hcd_start_cb_t )(dwc_otg_hcd_t *hcd) |
| This function is called whenever core switches to host mode. | |
| typedef int(* | dwc_otg_hcd_disconnect_cb_t )(dwc_otg_hcd_t *hcd) |
| This function is called when device has been disconnected. | |
| typedef int(* | dwc_otg_hcd_hub_info_from_urb_cb_t )(dwc_otg_hcd_t *hcd, void *urb_handle, uint32_t *hub_addr, uint32_t *port_addr) |
| Wrapper provides this function to HCD to core, so it can get hub information to which device is connected. | |
| typedef int(* | dwc_otg_hcd_speed_from_urb_cb_t )(dwc_otg_hcd_t *hcd, void *urb_handle) |
| Via this function HCD core gets device speed. | |
| typedef int(* | dwc_otg_hcd_complete_urb_cb_t )(dwc_otg_hcd_t *hcd, void *urb_handle, dwc_otg_hcd_urb_t *dwc_otg_urb, int32_t status) |
| This function is called when urb is completed. | |
| typedef int(* | dwc_otg_hcd_get_b_hnp_enable )(dwc_otg_hcd_t *hcd) |
| Via this function HCD core gets b_hnp_enable parameter. | |
Typedefs | |
| typedef dwc_otg_hcd | dwc_otg_hcd_t |
| typedef dwc_otg_hcd_urb | dwc_otg_hcd_urb_t |
Definition in file dwc_otg_hcd_if.h.
|
||||||||||||
|
This function should be called to initiate HCD Core.
Definition at line 780 of file dwc_otg_hcd.c. |
|
|
Frees HCD.
Definition at line 879 of file dwc_otg_hcd.c. |
|
|
This function should be called on every hardware interrupt.
Definition at line 43 of file dwc_otg_hcd_intr.c. |
|
|
Returns private data set by dwc_otg_hcd_set_priv_data function.
Definition at line 2958 of file dwc_otg_hcd.c. |
|
||||||||||||
|
Set private data.
Definition at line 2963 of file dwc_otg_hcd.c. |
|
||||||||||||
|
This function initializes the HCD Core.
Definition at line 2942 of file dwc_otg_hcd.c. |
|
|
Halts the DWC_otg host mode operations in a clean manner. USB transfers are stopped. Definition at line 421 of file dwc_otg_hcd.c. |
|
||||||||||||||||||||||||||||
|
Handles hub class-specific requests.
Definition at line 2015 of file dwc_otg_hcd.c. |
|
|
Returns otg port number.
Definition at line 2968 of file dwc_otg_hcd.c. |
|
|
Returns OTG version - either 1.3 or 2.0.
Definition at line 7012 of file dwc_otg_cil.c. |
|
|
Returns 1 if currently core is acting as B host, and 0 otherwise.
Definition at line 2973 of file dwc_otg_hcd.c. |
|
|
Returns current frame number.
Definition at line 2928 of file dwc_otg_hcd.c. |
|
|
Dumps hcd state.
Definition at line 3102 of file dwc_otg_hcd.c. |
|
|
Dump the average frame remaining at SOF. This can be used to determine average interrupt latency. Frame remaining is also shown for start transfer and two additional sample points. Currently this function is not implemented.
Definition at line 3278 of file dwc_otg_hcd.c. |
|
||||||||||||||||||||
|
Sends LPM transaction to the local device.
|
|
||||||||||||||||
|
Allocates memory for dwc_otg_hcd_urb structure. Allocated memory should be freed by call of DWC_FREE.
Definition at line 2985 of file dwc_otg_hcd.c. |
|
||||||||||||||||||||||||||||
|
Set pipe information in URB.
Definition at line 3004 of file dwc_otg_hcd.c. |
|
||||||||||||||||||||||||||||||||||||||||
|
Sets dwc_otg_hcd_urb parameters.
Definition at line 3017 of file dwc_otg_hcd.c. |
|
|
Gets status from dwc_otg_hcd_urb.
Definition at line 3034 of file dwc_otg_hcd.c. |
|
|
Gets actual length from dwc_otg_hcd_urb.
Definition at line 3039 of file dwc_otg_hcd.c. |
|
|
Gets error count from dwc_otg_hcd_urb. Only for ISOC URBs
Definition at line 3044 of file dwc_otg_hcd.c. |
|
||||||||||||||||||||
|
Set ISOC descriptor offset and length.
Definition at line 3049 of file dwc_otg_hcd.c. |
|
||||||||||||
|
Get status of ISOC descriptor, specified by desc_num.
Definition at line 3057 of file dwc_otg_hcd.c. |
|
||||||||||||
|
Get actual length of ISOC descriptor, specified by desc_num.
Definition at line 3063 of file dwc_otg_hcd.c. |
|
||||||||||||||||||||
|
Queue URB. After transfer is completes, the complete callback will be called with the URB status
Definition at line 443 of file dwc_otg_hcd.c. |
|
||||||||||||
|
De-queue the specified URB.
Definition at line 492 of file dwc_otg_hcd.c. |
|
||||||||||||||||
|
Frees resources in the DWC_otg controller related to a given endpoint. Any URBs for the endpoint must already be dequeued.
Definition at line 542 of file dwc_otg_hcd.c. |
|
||||||||||||
|
Returns 1 if status of specified port is changed and 0 otherwise.
Definition at line 2896 of file dwc_otg_hcd.c. |
|
||||||||||||
|
Call this function to check if bandwidth was allocated for specified endpoint. Only for ISOC and INTERRUPT endpoints.
Definition at line 3069 of file dwc_otg_hcd.c. |
|
||||||||||||
|
Call this function to check if bandwidth was freed for specified endpoint.
Definition at line 3082 of file dwc_otg_hcd.c. |
|
||||||||||||
|
Returns bandwidth allocated for specified endpoint in microseconds. Only for ISOC and INTERRUPT endpoints.
Definition at line 3095 of file dwc_otg_hcd.c. |
1.3.9.1