02.08.2013 Views

P4080 PCIe Adapter SDK User Guide Production Release

P4080 PCIe Adapter SDK User Guide Production Release

P4080 PCIe Adapter SDK User Guide Production Release

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Freescale Semiconductor<br />

* PCD Frame Queue callback functions when there is a Rx packet from the<br />

* interface These QMAN invoked callback functions are registered with QMan<br />

* Driver by the Hardware Function library.<br />

* This API initiates the DMA of data from <strong>P4080</strong> to Host memory.<br />

* The completion of the Rx DMA is detected via the DMA poll API<br />

* dma_channel_poll() which then sends an MSI interrupt.<br />

* @qman_fd – FD received from QMan Driver.<br />

* @hw_fn_id – Identifier of Hardware Function. The value is chosen from<br />

* “enum hw_fns”<br />

* @ring_id – Identifier of Rx ring on Host. The range of values is<br />

* “[0, Number of Rx rings - 1]”<br />

*/<br />

The Prototype of this API is as follows.<br />

int pkt_drv_enqueue_host_ring(const struct qm_fd *qman_fd, int hw_fn_id, int ring_id);<br />

/**<br />

* API: pkt_drv_process_command_ring : Dequeues commands from command<br />

* Tx ring * and calls the command ring callback of corresponding Hardware<br />

Function.<br />

* The Hardware Function callback is registered with to the USDPAA <strong>PCIe</strong> Driver<br />

* at the time of registration. This callback implements necessary action<br />

* that is specific to a Hardware Function.<br />

*/<br />

void pkt_drv_process_command_ring(void);<br />

/**<br />

* API: pkt_drv_enqueue_cmd_response : This API enqueues<br />

* command response into * Command ring.<br />

* The “type” and “sub_type” fields of “struct p4080_fd”<br />

* are modified to match the response to a request.<br />

* Every hardware function driver is mandated to invoke this API immediately<br />

* in the context of the cmd_poll_cb to ensure in-order delivery of command<br />

* responses to the host. It should be noted that invocation of this API does<br />

* not signal completion of command processing. It is simply a mechanism to<br />

* enqueue responses in order. Upon completion of a command request, the<br />

* hardware function driver should invoke pkt_drv_confirm_cmd_response().<br />

*<br />

* @cmd_fd – Command request FD that is used to form the command response<br />

*<br />

* @return – Returns pointer to the response FD that is enqueued into<br />

* Rx command ring on Host. This needs to be passed as an argument<br />

* in the pkt_drv_confirm_cmd_response()<br />

to mark the FD as<br />

* “completed request”. This eliminates out-of-order processing of<br />

* command request.<br />

*/<br />

The prototype of this API is as follows.<br />

struct p4080_fd *pkt_drv_enqueue_cmd_response(struct p4080_fd *cmd_fd);<br />

© Freescale Semiconductor, Inc., 2011. All rights reserved.<br />

Freescale Confidential Proprietary Page 58

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!