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

/**<br />

* API: enqueue_cmd : Enqueues a command into Command Tx ring.<br />

* Upper-level Hardware Function Drivers on the Host use this API to send<br />

* a command request to their counterparts on <strong>P4080</strong>.<br />

*<br />

* @cmd – Pointer to a Frame Descriptor that is to be enqueued into<br />

* Command ring<br />

*<br />

* @return – SUCCESS (0) on successful enqueue into Command ring, otherwise<br />

* ERROR (1)<br />

*/<br />

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

int enqueue_cmd(struct p4080_fd *cmd);<br />

cmd – FD that needs to be enqueued into Command Tx ring.<br />

struct p4080_fd {<br />

u16 type;<br />

u16 sub_type;<br />

u32 __reserved;<br />

u64 phys_addr_of_buff;<br />

u64 cookie;<br />

struct qm_fd qman_fd;<br />

}<br />

o type – Hardware function type<br />

o sub_type – For denoting sub commands in a Hardware Function<br />

o __reserved – Used for SKB headroom and tail rooms. Also used for marking<br />

command completion status.<br />

o phys_addr_of_buff – Physical address of SKB data<br />

o cookie – Virtual address of the SKB<br />

o qman_fd – Qman File Descriptor.<br />

/**<br />

* API: init_region_rx_shadow_offset : To avoid PCIE Reads from <strong>P4080</strong> of Host<br />

* Rx Descriptor rings, <strong>P4080</strong> PCIE Framework supports use of Rx Shadow Ring<br />

* that the Host driver writes to. This API gets the Rx Shadow ring<br />

* address from<br />

* the INIT region. This address belongs to <strong>P4080</strong> PCIE address domain.<br />

*<br />

* @func_id – Hardware Function identifier<br />

* @ring_id – Rx ring identifier<br />

*<br />

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

Freescale Confidential Proprietary Page 75

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

Saved successfully!

Ooh no, something went wrong!