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

10 C-API<br />

10.1 <strong>P4080</strong> USDPAA <strong>PCIe</strong> Packet Driver API<br />

Initialization and Cleanup<br />

/**<br />

* API: pkt_drv_register_hw_function : Each Hardware Function<br />

* (10G Ethernet/Security Engine/PME) has to register<br />

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

* context of Hardware Function initialization function<br />

* (such as hw_fn_init_eth()).<br />

* This API copies the Hardware function's Tx callback function and command<br />

* callback function into <strong>PCIe</strong> Driver context. The Tx callback function is<br />

* invoked by the <strong>PCIe</strong> Driver when it receives a Tx packet from Host. The<br />

* Command callback function is invoked when there is a command to the Hardware<br />

* Function from Host.<br />

*<br />

* @hw_fns - Hardware Function identifier<br />

* @hw_data - Pointer to Tx and command callback function pointers<br />

*<br />

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

*/<br />

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

int pkt_drv_register_hw_function(enum hw_fn hw_fns, struct hw_fn_data *hw_data);<br />

hw_fns – Identifier for a hardware function<br />

enum hw_fns {<br />

}<br />

HW_FUNC_CMD,<br />

HW_FUNC_ETH0,<br />

HW_FUNC_ETH1,<br />

HW_FUNC_SEC,<br />

HW_FUNC_PME<br />

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

Freescale Confidential Proprietary Page 54

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

Saved successfully!

Ooh no, something went wrong!