#include "dwc_otg_hcd.h"
#include "dwc_otg_regs.h"
Go to the source code of this file.
Functions | |
| dwc_otg_hcd_t * | dwc_otg_hcd_alloc_hcd (void) |
| This function allocates dwc_otg_hcd structure and returns pointer on it. | |
| void | dwc_otg_hcd_connect_timeout (void *ptr) |
| Connection timeout function. | |
| void | hcd_start_func (void *_vp) |
| Work queue function for starting the HCD when A-Cable is connected. | |
| void | del_xfer_timers (dwc_otg_hcd_t *hcd) |
| void | del_timers (dwc_otg_hcd_t *hcd) |
| void | kill_urbs_in_qh_list (dwc_otg_hcd_t *hcd, dwc_list_link_t *qh_list) |
| Processes all the URBs in a single list of QHs. | |
| void | kill_all_urbs (dwc_otg_hcd_t *hcd) |
| Responds with an error status of ETIMEDOUT to all URBs in the non-periodic and periodic schedules. | |
| void | dwc_otg_hcd_start_connect_timer (dwc_otg_hcd_t *hcd) |
| Start the connection timer. | |
| int32_t | dwc_otg_hcd_session_start_cb (void *p) |
| HCD Callback function for disconnect of the HCD. | |
| int32_t | dwc_otg_hcd_start_cb (void *p) |
| HCD Callback function for starting the HCD when A-Cable is connected. | |
| int32_t | dwc_otg_hcd_disconnect_cb (void *p) |
| HCD Callback function for disconnect of the HCD. | |
| int32_t | dwc_otg_hcd_stop_cb (void *p) |
| HCD Callback function for stopping the HCD. | |
| int | dwc_otg_hcd_rem_wakeup_cb (void *p) |
| HCD Callback function for Remote Wakeup. | |
| 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_urb_enqueue (dwc_otg_hcd_t *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 *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) |
| void | reset_tasklet_func (void *data) |
| Reset tasklet function. | |
| void | qh_list_free (dwc_otg_hcd_t *hcd, dwc_list_link_t *qh_list) |
| void | dwc_otg_hcd_power_up (void *ptr) |
| Exit from Hibernation if Host did not detect SRP from connected SRP capable Device during SRP time by host power up. | |
| void | dwc_otg_hcd_free (dwc_otg_hcd_t *dwc_otg_hcd) |
| Frees secondary storage associated with the dwc_otg_hcd structure contained in the struct usb_hcd field. | |
| 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. | |
| void | dwc_otg_hcd_reinit (dwc_otg_hcd_t *hcd) |
| Initializes dynamic portions of the DWC_otg HCD state. | |
| void | assign_and_init_hc (dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) |
| Assigns transactions from a QTD to a free host channel and initializes the host channel to perform the transactions. | |
| dwc_otg_transaction_type_e | dwc_otg_hcd_select_transactions (dwc_otg_hcd_t *hcd) |
| This function selects transactions from the HCD transfer schedule and assigns them to available host channels. | |
| int | queue_transaction (dwc_otg_hcd_t *hcd, dwc_hc_t *hc, uint16_t fifo_dwords_avail) |
| Attempts to queue a single transaction request for a host channel associated with either a periodic or non-periodic transfer. | |
| void | process_periodic_channels (dwc_otg_hcd_t *hcd) |
| Processes periodic channels for the next frame and queues transactions for these channels to the DWC_otg controller. | |
| void | process_non_periodic_channels (dwc_otg_hcd_t *hcd) |
| Processes active non-periodic channels and queues transactions for these channels to the DWC_otg controller. | |
| void | dwc_otg_hcd_queue_transactions (dwc_otg_hcd_t *hcd, dwc_otg_transaction_type_e tr_type) |
| This function processes the currently active host channels and queues transactions for these channels to the DWC_otg controller. | |
| 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. | |
| 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_get_frame_number (dwc_otg_hcd_t *dwc_otg_hcd) |
| Returns current frame number. | |
| 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_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. | |
| uint32_t | dwc_otg_hcd_otg_port (dwc_otg_hcd_t *hcd) |
| Returns otg port number. | |
| 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. | |
| 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 *dwc_otg_urb, uint8_t dev_addr, 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 *dwc_otg_urb, void *urb_handle, void *buf, dwc_dma_t dma, uint32_t buflen, void *setup_packet, dwc_dma_t setup_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_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. | |
| 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. | |
Variables | |
| dwc_otg_cil_callbacks_t | hcd_cil_callbacks |
| HCD Callback structure for handling mode switching. | |
All code in this file is portable and doesn't use any OS specific functions. Interface provided by HCD Core is defined in <hcd_if.h> header file.
Definition in file dwc_otg_hcd.c.
|
|
Connection timeout function. An OTG host is required to display a message if the device does not connect within 10 seconds. Definition at line 54 of file dwc_otg_hcd.c. |
|
|
Work queue function for starting the HCD when A-Cable is connected. The hcd_start() must be called in a process context. Definition at line 123 of file dwc_otg_hcd.c. |
|
||||||||||||
|
Processes all the URBs in a single list of QHs. Completes them with -ETIMEDOUT and frees the QTD. Definition at line 154 of file dwc_otg_hcd.c. |
|
|
Responds with an error status of ETIMEDOUT to all URBs in the non-periodic and periodic schedules. The QTD associated with each URB is removed from the schedule and freed. This function may be called when a disconnect is detected or when the HCD is being stopped. Definition at line 181 of file dwc_otg_hcd.c. |
|
|
Start the connection timer. An OTG host is required to display a message if the device does not connect within 10 seconds. The timer is deleted if a port connect interrupt occurs before the timer expires. Definition at line 197 of file dwc_otg_hcd.c. |
|
|
HCD Callback function for disconnect of the HCD.
Definition at line 207 of file dwc_otg_hcd.c. |
|
|
HCD Callback function for starting the HCD when A-Cable is connected.
Definition at line 222 of file dwc_otg_hcd.c. |
|
|
HCD Callback function for disconnect of the HCD.
Definition at line 252 of file dwc_otg_hcd.c. |
|
|
HCD Callback function for stopping the HCD.
Definition at line 372 of file dwc_otg_hcd.c. |
|
|
HCD Callback function for Remote Wakeup.
Definition at line 402 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. |
|
||||||||||||||||||||
|
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. |
|
||||||||||||
|
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. |
|
||||||||||||
|
Assigns transactions from a QTD to a free host channel and initializes the host channel to perform the transactions. The host channel is removed from the free list.
Definition at line 936 of file dwc_otg_hcd.c. |
|
|
This function selects transactions from the HCD transfer schedule and assigns them to available host channels. It is called from HCD interrupt handler functions.
Definition at line 1168 of file dwc_otg_hcd.c. |
|
||||||||||||||||
|
Attempts to queue a single transaction request for a host channel associated with either a periodic or non-periodic transfer. This function assumes that there is space available in the appropriate request queue. For an OUT transfer or SETUP transaction in Slave mode, it checks whether space is available in the appropriate Tx FIFO.
Definition at line 1253 of file dwc_otg_hcd.c. |
|
|
Processes periodic channels for the next frame and queues transactions for these channels to the DWC_otg controller. After queueing transactions, the Periodic Tx FIFO Empty interrupt is enabled if there are more transactions to queue as Periodic Tx FIFO or request queue space becomes available. Otherwise, the Periodic Tx FIFO Empty interrupt is disabled. Definition at line 1313 of file dwc_otg_hcd.c. |
|
|
Processes active non-periodic channels and queues transactions for these channels to the DWC_otg controller. After queueing transactions, the NP Tx FIFO Empty interrupt is enabled if there are more transactions to queue as NP Tx FIFO or request queue space becomes available. Otherwise, the NP Tx FIFO Empty interrupt is disabled. Definition at line 1430 of file dwc_otg_hcd.c. |
|
||||||||||||
|
This function processes the currently active host channels and queues transactions for these channels to the DWC_otg controller. It is called from HCD interrupt handler functions.
Definition at line 1540 of file dwc_otg_hcd.c. |
|
||||||||||||||||||||||||||||
|
Handles hub class-specific requests.
Definition at line 2015 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. |
|
|
Returns current frame number.
Definition at line 2928 of file dwc_otg_hcd.c. |
|
||||||||||||
|
This function initializes the HCD Core.
Definition at line 2942 of file dwc_otg_hcd.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. |
|
|
Returns otg port number.
Definition at line 2968 of file dwc_otg_hcd.c. |
|
|
Returns 1 if currently core is acting as B host, and 0 otherwise.
Definition at line 2973 of file dwc_otg_hcd.c. |
|
||||||||||||||||
|
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. |
|
||||||||||||
|
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. |
|
|
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. |
|
|
Initial value: {
.start = dwc_otg_hcd_start_cb,
.stop = dwc_otg_hcd_stop_cb,
.disconnect = dwc_otg_hcd_disconnect_cb,
.session_start = dwc_otg_hcd_session_start_cb,
.resume_wakeup = dwc_otg_hcd_rem_wakeup_cb,
.p = 0,
}
Definition at line 599 of file dwc_otg_hcd.c. |
1.3.9.1