These routines are only used for Control endpoint 0.
This module has APIs for USB Synopsis IP device driver.
Functions | |
| void | dwc_usb3_ep0_activate (volatile dwc_usb3_pcd_t *pcd, int restore) |
| This routine configures EP0 OUT to receive SETUP packets and configures EP0 IN for transmitting packets. More... | |
| void | dwc_usb3_pcd_ep0_out_start (volatile dwc_usb3_pcd_t *pcd) |
| This routine sets up a SETUP stage transfer for EP0 and starts the transfer. More... | |
| void | dwc_usb3_pcd_ep0_start_transfer (volatile dwc_usb3_pcd_t *pcd, volatile dwc_usb3_pcd_req_t *req) |
| This routine sets up a data/status stage transfer for EP0 and starts the transfer. If pcd->ep0->dwc_ep.is_in is 0 it will be an OUT transfer, otherwise it will be an IN transfer. More... | |
| void | dwc_usb3_pcd_ep0_data_stage (volatile dwc_usb3_pcd_t *pcd, int length) |
| This routine starts the data stage of a 3-stage control command. pcd->ep0state must be set to EP0_OUT_DATA_PHASE or EP0_IN_DATA_PHASE, and pcd->ep0->dwc_ep.is_in must be set to 0 or 1 before calling this routine. For IN, the data to be sent must be placed in pcd->ep0_status_buf before the call. More... | |
| void | dwc_usb3_handle_ep0_xfer (volatile dwc_usb3_pcd_t *pcd, u32 event) |
| This routine handles EP0 transfers. More... | |
| static void | dwc_usb3_do_setup (volatile dwc_usb3_pcd_t *pcd) |
| This routine processes SETUP commands. The USB Command processing is done in two places - the first being the PCD and the second being the Gadget driver (for example, the File-Backed Storage Gadget driver). More... | |
| static void | ep0_do_stall (volatile dwc_usb3_pcd_t *pcd, int err_val) |
| This routine stalls EP0. More... | |
| static void | do_clear_halt (volatile dwc_usb3_pcd_t *pcd, volatile dwc_usb3_pcd_ep_t *ep) |
| Clear the EP halt (STALL), and if there are pending requests start the transfer. More... | |
| static void | do_get_status (volatile dwc_usb3_pcd_t *pcd) |
| This routine processes the GET_STATUS Setup Commands. More... | |
| static void | do_clear_feature (volatile dwc_usb3_pcd_t *pcd) |
| This routine processes the CLEAR_FEATURE Setup Commands. More... | |
| static void | do_set_feature (volatile dwc_usb3_pcd_t *pcd) |
| This routine processes the SET_FEATURE Setup Commands. More... | |
| static void | do_set_address (volatile dwc_usb3_pcd_t *pcd) |
| This routine processes the SET_ADDRESS Setup Commands. More... | |
| static void | do_get_descriptor (volatile dwc_usb3_pcd_t *pcd) |
| This routine handles the Get Descriptor request for the BOS descriptor and the OTG descriptor, and passes all other requests to the Gadget driver. More... | |
| static void | ep0_continue_transfer (volatile dwc_usb3_pcd_t *pcd, volatile dwc_usb3_pcd_req_t *req) |
| This routine continues control IN transfers started by ep0_start_transfer, when the transfer does not fit in a single request. More... | |
| static int | ep0_complete_request (volatile dwc_usb3_pcd_t *pcd, volatile dwc_usb3_pcd_req_t *req, dwc_usb3_dma_desc_t *desc, int status) |
| This routine completes the ep0 control transfer. More... | |
| static void | setup_in_status_phase (volatile dwc_usb3_pcd_t *pcd, void *buf, dwc_dma_t dma) |
| This routine starts the Zero-Length Packet for the IN status phase of a control write transfer. More... | |
| static void | setup_out_status_phase (volatile dwc_usb3_pcd_t *pcd, void *buf, dwc_dma_t dma) |
| This routine starts the Zero-Length Packet for the OUT status phase of a control read transfer. More... | |
| static void | dwc_usb3_handle_ep0 (volatile dwc_usb3_pcd_t *pcd, volatile dwc_usb3_pcd_req_t *req, u32 event) |
| This routine handles EP0 Control transfers. More... | |
| void dwc_usb3_ep0_activate | ( | volatile dwc_usb3_pcd_t * | pcd, |
| int | restore | ||
| ) |
This routine configures EP0 OUT to receive SETUP packets and configures EP0 IN for transmitting packets.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| restore | True if restoring endpoint state after hibernation. |
| void dwc_usb3_pcd_ep0_out_start | ( | volatile dwc_usb3_pcd_t * | pcd | ) |
This routine sets up a SETUP stage transfer for EP0 and starts the transfer.
| pcd | Programming view of the PCD. |
| void dwc_usb3_pcd_ep0_start_transfer | ( | volatile dwc_usb3_pcd_t * | pcd, |
| volatile dwc_usb3_pcd_req_t * | req | ||
| ) |
This routine sets up a data/status stage transfer for EP0 and starts the transfer. If pcd->ep0->dwc_ep.is_in is 0 it will be an OUT transfer, otherwise it will be an IN transfer.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| req | The request to start. |
| void dwc_usb3_pcd_ep0_data_stage | ( | volatile dwc_usb3_pcd_t * | pcd, |
| int | length | ||
| ) |
This routine starts the data stage of a 3-stage control command. pcd->ep0state must be set to EP0_OUT_DATA_PHASE or EP0_IN_DATA_PHASE, and pcd->ep0->dwc_ep.is_in must be set to 0 or 1 before calling this routine. For IN, the data to be sent must be placed in pcd->ep0_status_buf before the call.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| length | Length of the data stage transfer. |
| void dwc_usb3_handle_ep0_xfer | ( | volatile dwc_usb3_pcd_t * | pcd, |
| u32 | event | ||
| ) |
This routine handles EP0 transfers.
This routine gets the request corresponding to the current EP0 transfer. If EP0 is in IDLE state, it calls dwc_usb3_do_setup() to begin processing the next Setup request, otherwise it calls dwc_usb3_handle_ep0() to handle the next stage of the current transfer.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| event | The event that triggered the transfer. |
|
static |
This routine processes SETUP commands. The USB Command processing is done in two places - the first being the PCD and the second being the Gadget driver (for example, the File-Backed Storage Gadget driver).
| pcd | Programming view of DWC_usb3 peripheral controller. |
| Command | Driver | Description |
| GET_STATUS | PCD | Command is processed as defined in chapter 9 of the USB 2.0 Specification. |
| SET_FEATURE | PCD / Gadget driver | Device and Endpoint requests are processed by the PCD. Interface requests are passed to the Gadget driver. |
| CLEAR_FEATURE | PCD | Device and Endpoint requests are processed by the PCD. Interface requests are ignored. The only Endpoint feature handled is ENDPOINT_HALT. |
| SET_ADDRESS | PCD | Program the DCFG register with device address received. |
| GET_DESCRIPTOR | Gadget driver | Return the requested descriptor. |
| SET_DESCRIPTOR | Gadget driver | Optional - not implemented by any of the existing Gadget drivers. |
| GET_CONFIGURATION | Gadget driver | Return the current configuration. |
| SET_CONFIGURATION | Gadget driver | Disable all EPs and enable EPs for new configuration. |
| GET_INTERFACE | Gadget driver | Return the current interface. |
| SET_INTERFACE | Gadget driver | Disable all EPs and enable EPs for new interface. |
When the SETUP Phase Done interrupt occurs, the generic SETUP commands are processed by dwc_usb3_do_setup(). Calling the Gadget driver's dwc_usb3_gadget_setup() routine from dwc_usb3_do_setup() processes the gadget-specific SETUP commands.
|
static |
This routine stalls EP0.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| err_val | Error value that triggered the stall |
|
static |
Clear the EP halt (STALL), and if there are pending requests start the transfer.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| ep | Pointer to the endpoint that is being cleared. |
|
static |
This routine processes the GET_STATUS Setup Commands.
| pcd | Programming view of DWC_usb3 peripheral controller. |
|
static |
This routine processes the CLEAR_FEATURE Setup Commands.
| pcd | Programming view of DWC_usb3 peripheral controller. |
|
static |
This routine processes the SET_FEATURE Setup Commands.
| pcd | Programming view of DWC_usb3 peripheral controller. |
|
static |
This routine processes the SET_ADDRESS Setup Commands.
| pcd | Programming view of DWC_usb3 peripheral controller. |
|
static |
This routine handles the Get Descriptor request for the BOS descriptor and the OTG descriptor, and passes all other requests to the Gadget driver.
| pcd | Programming view of DWC_usb3 peripheral controller. |
|
static |
This routine continues control IN transfers started by ep0_start_transfer, when the transfer does not fit in a single request.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| req | The request to continue. |
|
static |
This routine completes the ep0 control transfer.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| req | The request to complete. |
| desc | The DMA descriptor for the transfer. |
| status | The status of the transfer. |
|
static |
This routine starts the Zero-Length Packet for the IN status phase of a control write transfer.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| buf | Pointer to the buffer to be used for the ZLP. |
| dma | DMA address of the buffer to be used for the ZLP. |
|
static |
This routine starts the Zero-Length Packet for the OUT status phase of a control read transfer.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| buf | Pointer to the buffer to be used for the ZLP. |
| dma | DMA address of the buffer to be used for the ZLP. |
|
static |
This routine handles EP0 Control transfers.
The state of the control tranfers are tracked in ep0state.
| pcd | Programming view of DWC_usb3 peripheral controller. |
| req | The request to handle. |
| event | The event that triggered this handler. |