5.2.5. intel_ssgdma_descriptor.c
Prototype |
intel_ssgdma_return_e intel_ssgdma_fill_h2d_st(intel_ssgdma_dev *dev, uint16_t port_num, uint8_t control, uint32_t length, INTEL_SSGDMA_ADDR_T addr, uint16_t sideband_signal, uint32_t host_interface_control, uint32_t max_length_per_desc, bool irq_en_last_desc) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid device port number or length of data is 0. E_INTEL_SSGDMA_NO_INITI : -2 -> Device port is not setup or port_csr_base is 0. Please check setup or init. E_INTEL_SSGDMA_Q_FULL : -7 -> Queue is full. E_INTEL_SSGDMA_NOT_ENOUGH_DESC : -11 -> q_size is not enough. Please reset and set larger size or reduce the number of descriptors. E_INTEL_SSGDMA_ADDRESS_OVERFLOW : -12 -> Overflow of address would happen, before all data is transferred. Please check start address. |
Description |
Fills the next host to device streaming transfer (h2d_st) descriptor. Please setup the device port (intel_ssgdma_setup_device_port) before using this function. Notes:
|
Prototype |
intel_ssgdma_return_e intel_ssgdma_fill_d2h_st(intel_ssgdma_dev *dev, uint16_t port_num, uint8_t control, uint32_t length, INTEL_SSGDMA_ADDR_T addr, uint32_t host_interface_control, uint32_t max_length_per_desc, bool irq_en_last_desc) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid device port number or length of data is 0. E_INTEL_SSGDMA_NO_INITI : -2 -> Device port is not setup or port_csr_base is 0. Please check setup or init. E_INTEL_SSGDMA_Q_FULL : -7 -> Queue is full. E_INTEL_SSGDMA_NOT_ENOUGH_DESC : -11 -> q_size is not enough. Please reset and set larger size or reduce the number of descriptors. E_INTEL_SSGDMA_ADDRESS_OVERFLOW : -12 -> Overflow of address would happen, before all data is transferred. Please check start address. |
Description |
Fills the next device to host streaming transfer (d2h_st) descriptor. Please setup the device port (intel_ssgdma_setup_device_port) before using this function. Notes:
If max_length_per_desc is zero, the API only fills one descriptor per call. The driver overwrites max_length_per_desc to UINT32_MAX and you set the SOP and EOP for each descriptor manually. If this is not accepted, the transfer is identified as undefined behavior. |
Prototype |
intel_ssgdma_return_e intel_ssgdma_fill_h2d_mem(intel_ssgdma_dev *dev, uint16_t port_num, uint8_t control, uint32_t length, INTEL_SSGDMA_ADDR_T src, INTEL_SSGDMA_ADDR_T dest, uint32_t host_interface_control, uint32_t device_interface_control, uint32_t max_length_per_desc, bool irq_en_last_desc) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid device port number or length of data is 0. E_INTEL_SSGDMA_NO_INITI : -2 -> Device port is not setup or port_csr_base is 0. Please check setup or init. E_INTEL_SSGDMA_Q_FULL : -7 -> Queue is full. E_INTEL_SSGDMA_NOT_ENOUGH_DESC : -11 -> q_size is not enough. Please reset and set larger size or reduce the number of descriptors. E_INTEL_SSGDMA_ADDRESS_OVERFLOW : -12 -> Overflow of address would happen, before all data is transferred. Please check start address. |
Description |
Fills the next descriptor to write from host to external device memory. Please setup the device port (intel_ssgdma_setup_device_port) before using this function. Notes:
|
Prototype |
intel_ssgdma_return_e intel_ssgdma_fill_d2h_mem(intel_ssgdma_dev *dev, uint16_t port_num, uint8_t control, uint32_t length, INTEL_SSGDMA_ADDR_T src, INTEL_SSGDMA_ADDR_T dest, uint32_t host_interface_control, uint32_t device_interface_control, uint32_t max_length_per_desc, bool irq_en_last_desc) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_OK : 0 -> Success. E_INTEL_SSGDMA_INVALID_ARGUMENT : -1 -> Invalid device port number or length of data is 0. E_INTEL_SSGDMA_NO_INITI : -2 -> Device port is not setup or port_csr_base is 0. Please check setup or init. E_INTEL_SSGDMA_Q_FULL : -7 -> Queue is full. E_INTEL_SSGDMA_NOT_ENOUGH_DESC : -11 -> q_size is not enough. Please reset and set larger size or reduce the number of descriptors. E_INTEL_SSGDMA_ADDRESS_OVERFLOW : -12 -> Overflow of address would happen, before all data is transferred. Please check start address. |
Description |
Fills the next descriptor to read from external device to host memory. Please setup the device port (intel_ssgdma_setup_device_port) before using this function. Notes:
|
Prototype |
intel_ssgdma_resp_return_e intel_ssgdma_check_current_resp_for_completion( intel_ssgdma_dev *dev, intel_ssgdma_port_type_e port_type, unsigned int port_num) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
E_INTEL_SSGDMA_RESP_PENDING : 0 -> current responder is still pending E_INTEL_SSGDMA_RESP_COMPLETED : 1 -> current responder is completed. E_INTEL_SSGDMA_RESP_INVALID_PORT : -2 -> device port is invalid. E_INTEL_SSGDMA_RESP_NOT_ENABLED : -3 -> responder is not enabled by driver. E_INTEL_SSGDMA_RESP_NO_PENDING : -4 -> there are no pending dma transfer. |
Description |
This function evaluates current responder to checks if a pending dma transfer is completed. Current responder refers to the first responder, that is still not processed by the software. Current responder tracked internally by the driver. Please do not modify the complete status of responder manually, as this may cause the internal tracking to malfunction. You can use this function to poll for completion, if they did not enable any interrupt for completion. This function does not block. intel_ssgdma_setup_device_port should be called before this function. |
Prototype |
int intel_ssgdma_get_last_completed_desc _hw_idx(intel_ssgdma_dev *dev, intel_ssgdma_port_type_e port_type, uint16_t port_num) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
sw_extract_hw_idx -> Hardware index of last completed descriptor. 0 -> No completed descriptor. INTEL_SSGDMA_ERROR : -1 -> Invalid port_type and port_num. |
Description |
This function returns the hardware index of the last completed descriptor. |
Prototype |
intel_ssgdma_return_e intel_ssgdma_set_resp_ptr_tmp_idx(intel_ssgdma_dev *dev, intel_ssgdma_port_type_e port_type, uint16_t port_num, uint16_t previous_n_resp) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
|
Description |
Set helper index to backtrace previously completed descriptor. The input previous_n_resp defines how many descriptors should be back traced. previous_n_resp can be obtained from intel_ssgdma_complete_callback or intel_ssgdma_device_port_poll_for_completion. After calling this function, please use intel_ssgdma_get_next_tmp_resp to get the next resp_ptr for evaluation. |
Prototype |
const intel_ssgdma_hw_queue_desc *intel_ssgdma_get_next_tmp_resp( intel_ssgdma_dev *dev, intel_ssgdma_port_type_e port_type, uint16_t port_num) |
Include |
<intel_ssgdma.h> |
Parameters |
|
Return |
|
Description |
Before calling this function, please call intel_ssgdma_set_resp_ptr_tmp_idx to set resp_ptr_tmp_idx to the correct position.
Based on the number of completed descriptors, this function should be called in a loop to evaluate the responders. The number of completed descriptors can be obtained from intel_ssgdma_complete_callback or intel_ssgdma_device_port_poll_for_completion.
Note: The driver only clears the complete status of the responder.
Please check the other fields of the responder, for example, DeviceError status or EarlyTermination status. |