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 />

hw_data – Hardware function specific data that is exchanged with the <strong>P4080</strong> Packet<br />

Driver.<br />

struct hw_fn_data {<br />

};<br />

hw_fn_tx_cb tx_cb;<br />

hw_fn_cmd_cb cmd_cb;<br />

The prototype of Tx and command ring callback functions are as follows<br />

typedef int (*hw_fn_tx_cb)(struct qm_fd *fd, int cpu_id, int ring_id);<br />

typedef int (*hw_fn_cmd_cb)(struct p4080_fd *fd);<br />

/**<br />

* Callback: hw_fn_tx_cb : Callback function that is registered with <strong>PCIe</strong><br />

* Driver and is invoked in dma_channel_poll() API when DMA transfer for<br />

* a Tx packet is successful<br />

*<br />

* @qm_fd – Qman FD that has to be enqueued into one of the<br />

* Tx Frame Queues.<br />

* @cpu_id – Core on which the Tx packet has come. This is used to select<br />

* the Tx Frame<br />

* Queue.<br />

* @ring_id – Used as an index into flow table to get the Frame Queue ID<br />

* and Ethernet port ID.<br />

*<br />

* @return - SUCCESS (0) on successful registration otherwise ERROR (1)<br />

*/<br />

/**<br />

* Callback: hw_fn_cmd_cb : Callback function that is registered with <strong>PCIe</strong><br />

* Driver and is invoked in pkt_drv_process_command_ring() API when a<br />

* command is received from Host Packet Driver or Host Hardware Function<br />

* Driver.<br />

*<br />

* @p4080_fd– <strong>P4080</strong> FD that holds command data<br />

*<br />

* @return - SUCCESS (0) on successful registration otherwise ERROR (1)<br />

*/<br />

/**<br />

* API: pkt_drv_unregister_hw_function : Each Hardware Function has to<br />

* unregister with <strong>PCIe</strong> Driver using this API. This API has to be<br />

* invoked in the context of Hardware Function cleanup<br />

* function (such hw_fn_clean_eth()). This API clears the Tx callback<br />

* function and command callback function of the <strong>PCIe</strong> Driver context.<br />

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

Freescale Confidential Proprietary Page 55

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

Saved successfully!

Ooh no, something went wrong!