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.2 Host PCIE Packet Driver APIs<br />

Initialization and Cleanup<br />

/**<br />

* API: register_hardware_function : Each Upper-level Hardware Function Driver<br />

* (10G Ethernet, PME, Security) on Host invokes<br />

* this API to register itself with the Host Packet Driver.<br />

*<br />

* @func_id – Identifier of a Hardware Function.<br />

* @init_data – Pointer to struct hw_eng_data data structure that is exchanged<br />

* between Hardware Function Driver and Host Packet Driver for initialization.<br />

*<br />

* @return – SUCCESS (0) on successful registration, ERROR (1) on failure.<br />

*/<br />

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

int register_hardware_function(<strong>P4080</strong>_HW_FUNCTIONS func_id, struct hw_eng_data<br />

*init_data);<br />

func_id – This is the identifier for a Hardware Function that is to be registered with the<br />

Host Packet Driver. Its values are taken from “enum <strong>P4080</strong>_HW_FUNCTIONS”.<br />

typedef enum <strong>P4080</strong>_HW_FUNCTIONS {<br />

<strong>P4080</strong>_HW_MIN = 0,<br />

<strong>P4080</strong>_HW_ETH0,<br />

<strong>P4080</strong>_HW_ETH1,<br />

<strong>P4080</strong>_HW_SEC,<br />

<strong>P4080</strong>_HW_PME,<br />

<strong>P4080</strong>_HW_MAX<br />

} <strong>P4080</strong>_HW_FUNCTIONS;<br />

init_data – The initialization data structure that contains various input and output<br />

parameters used by Host Packet Driver during registration.<br />

typedef struct hw_eng_data {<br />

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

Freescale Confidential Proprietary Page 66

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

Saved successfully!

Ooh no, something went wrong!