|
iPXE
|
Intel 10/100/1000 virtual function network card driver. More...
#include "intel.h"Go to the source code of this file.
Data Structures | |
| struct | intelvf_msg_mac |
| MAC address mailbox message. More... | |
| struct | intelvf_msg_version |
| Version number mailbox message. More... | |
| struct | intelvf_msg_mtu |
| MTU mailbox message. More... | |
| struct | intelvf_msg_queues |
| Queue configuration mailbox message (API v1.1+ only) More... | |
| struct | intelvf_msg_raw |
| Raw mailbox message. More... | |
| union | intelvf_msg |
| Mailbox message. More... | |
Macros | |
| #define | INTELVF_BAR_SIZE ( 16 * 1024 ) |
| Intel VF BAR size. | |
| #define | INTELVF_MBCTRL 0x0c40UL |
| Mailbox Control Register. | |
| #define | INTELVF_MBCTRL_REQ 0x00000001UL |
| Request for PF ready. | |
| #define | INTELVF_MBCTRL_ACK 0x00000002UL |
| PF message received. | |
| #define | INTELVF_MBCTRL_VFU 0x00000004UL |
| Buffer taken by VF. | |
| #define | INTELVF_MBCTRL_PFU 0x00000008UL |
| Buffer taken to PF. | |
| #define | INTELVF_MBCTRL_PFSTS 0x00000010UL |
| PF wrote a message. | |
| #define | INTELVF_MBCTRL_PFACK 0x00000020UL |
| PF acknowledged message. | |
| #define | INTELVF_MBCTRL_RSTI 0x00000040UL |
| PF reset in progress. | |
| #define | INTELVF_MBCTRL_RSTD 0x00000080UL |
| PF reset complete. | |
| #define | INTELVF_MBMEM 0x0800UL |
| Mailbox Memory Register Base. | |
| #define | INTELVF_MSG_TYPE_RESET 0x00000001UL |
| Reset mailbox message. | |
| #define | INTELVF_MSG_TYPE_SET_MAC 0x00000002UL |
| Set MAC address mailbox message. | |
| #define | INTELVF_MSG_TYPE_SET_MTU 0x00000005UL |
| Set MTU mailbox message. | |
| #define | INTELVF_MSG_TYPE_GET_QUEUES 0x00000009UL |
| Get queue configuration message. | |
| #define | INTELVF_MSG_TYPE_CONTROL 0x00000100UL |
| Control ("ping") mailbox message. | |
| #define | INTELVF_MSG_TYPE_MASK 0x0000ffffUL |
| Message type mask. | |
| #define | INTELVF_MSG_NACK 0x40000000UL |
| Message NACK flag. | |
| #define | INTELVF_MSG_ACK 0x80000000UL |
| Message ACK flag. | |
| #define | INTELVF_MSG_RESPONSE ( INTELVF_MSG_ACK | INTELVF_MSG_NACK ) |
| Message is a response. | |
| #define | INTELVF_MBOX_MAX_WAIT_MS 500 |
| Maximum time to wait for mailbox message. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| int | intelvf_mbox_msg (struct intel_nic *intel, union intelvf_msg *msg) |
| Send/receive mailbox message. | |
| int | intelvf_mbox_poll (struct intel_nic *intel) |
| Poll mailbox. | |
| int | intelvf_mbox_wait (struct intel_nic *intel) |
| Wait for PF reset to complete. | |
| int | intelvf_mbox_reset (struct intel_nic *intel, uint8_t *hw_addr) |
| Send reset message and get initial MAC address. | |
| int | intelvf_mbox_set_mac (struct intel_nic *intel, const uint8_t *ll_addr) |
| Send set MAC address message. | |
| int | intelvf_mbox_set_mtu (struct intel_nic *intel, size_t mtu) |
| Send set MTU message. | |
Intel 10/100/1000 virtual function network card driver.
Definition in file intelvf.h.
| #define INTELVF_BAR_SIZE ( 16 * 1024 ) |
| #define INTELVF_MBCTRL_REQ 0x00000001UL |
| #define INTELVF_MBCTRL_ACK 0x00000002UL |
PF message received.
Definition at line 21 of file intelvf.h.
Referenced by intelvf_mbox_msg(), and intelvf_mbox_poll().
| #define INTELVF_MBCTRL_VFU 0x00000004UL |
| #define INTELVF_MBCTRL_PFU 0x00000008UL |
| #define INTELVF_MBCTRL_PFSTS 0x00000010UL |
PF wrote a message.
Definition at line 24 of file intelvf.h.
Referenced by intelvf_mbox_msg(), and intelvf_mbox_poll().
| #define INTELVF_MBCTRL_PFACK 0x00000020UL |
| #define INTELVF_MBCTRL_RSTI 0x00000040UL |
PF reset in progress.
Definition at line 26 of file intelvf.h.
Referenced by intelvf_mbox_msg(), and intelvf_mbox_poll().
| #define INTELVF_MBCTRL_RSTD 0x00000080UL |
| #define INTELVF_MBMEM 0x0800UL |
| #define INTELVF_MSG_TYPE_RESET 0x00000001UL |
| #define INTELVF_MSG_TYPE_SET_MAC 0x00000002UL |
Set MAC address mailbox message.
Definition at line 36 of file intelvf.h.
Referenced by intelvf_mbox_set_mac().
| #define INTELVF_MSG_TYPE_SET_MTU 0x00000005UL |
Set MTU mailbox message.
Definition at line 39 of file intelvf.h.
Referenced by intelvf_mbox_set_mtu().
| #define INTELVF_MSG_TYPE_GET_QUEUES 0x00000009UL |
Get queue configuration message.
Definition at line 42 of file intelvf.h.
Referenced by intelxvf_mbox_queues().
| #define INTELVF_MSG_TYPE_CONTROL 0x00000100UL |
| #define INTELVF_MSG_TYPE_MASK 0x0000ffffUL |
Message type mask.
Definition at line 48 of file intelvf.h.
Referenced by intelvf_mbox_reset(), intelvf_mbox_set_mac(), intelvf_mbox_set_mtu(), intelxvf_mbox_queues(), and intelxvf_mbox_version().
| #define INTELVF_MSG_ACK 0x80000000UL |
Message ACK flag.
Definition at line 54 of file intelvf.h.
Referenced by intelvf_mbox_reset(), intelvf_mbox_set_mac(), intelvf_mbox_set_mtu(), intelxvf_mbox_queues(), and intelxvf_mbox_version().
| #define INTELVF_MSG_RESPONSE ( INTELVF_MSG_ACK | INTELVF_MSG_NACK ) |
| #define INTELVF_MBOX_MAX_WAIT_MS 500 |
Maximum time to wait for mailbox message.
This is a policy decision.
Definition at line 149 of file intelvf.h.
Referenced by intelvf_mbox_msg(), and intelvf_mbox_wait().
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
extern |
Send/receive mailbox message.
| intel | Intel device |
| msg | Message buffer |
| rc | Return status code |
Definition at line 152 of file intelvf.c.
References assert, ctrl, DBGC, EPIPE, ETIMEDOUT, INTELVF_MBCTRL_ACK, INTELVF_MBCTRL_PFACK, INTELVF_MBCTRL_PFSTS, INTELVF_MBCTRL_REQ, INTELVF_MBCTRL_RSTI, INTELVF_MBCTRL_VFU, INTELVF_MBOX_MAX_WAIT_MS, intelvf_mbox_read(), intelvf_mbox_write(), INTELVF_MSG_RESPONSE, intel_nic::mbox, mdelay(), msg(), readl, intel_nic::regs, and writel.
Referenced by intelvf_mbox_reset(), intelvf_mbox_set_mac(), intelvf_mbox_set_mtu(), intelxvf_mbox_queues(), and intelxvf_mbox_version().
|
extern |
Poll mailbox.
| intel | Intel device |
| rc | Return status code |
Note that polling the mailbox may fail if the underlying PF is reset.
Definition at line 99 of file intelvf.c.
References ctrl, EPIPE, INTELVF_MBCTRL_ACK, INTELVF_MBCTRL_PFSTS, INTELVF_MBCTRL_RSTI, intelvf_mbox_read(), intel_nic::mbox, msg(), readl, intel_nic::regs, and writel.
Referenced by intelvf_mbox_wait(), and intelxvf_poll().
|
extern |
Wait for PF reset to complete.
| intel | Intel device |
| rc | Return status code |
Definition at line 126 of file intelvf.c.
References DBGC, ETIMEDOUT, INTELVF_MBOX_MAX_WAIT_MS, intelvf_mbox_poll(), mdelay(), and rc.
Send reset message and get initial MAC address.
| intel | Intel device |
| hw_addr | Hardware address to fill in, or NULL |
| rc | Return status code |
Definition at line 233 of file intelvf.c.
References DBGC, DBGC_HDA, EPROTO, eth_ntoa(), eth_random_addr(), intelvf_mbox_msg(), INTELVF_MSG_ACK, INTELVF_MSG_TYPE_MASK, INTELVF_MSG_TYPE_RESET, memcpy(), memset(), msg(), rc, and strerror().
Referenced by intelxvf_open(), and intelxvf_probe().
Send set MAC address message.
| intel | Intel device |
| ll_addr | Link-layer address |
| rc | Return status code |
Definition at line 276 of file intelvf.c.
References DBGC, DBGC_HDA, EPERM, EPROTO, intelvf_mbox_msg(), INTELVF_MSG_ACK, INTELVF_MSG_TYPE_MASK, INTELVF_MSG_TYPE_SET_MAC, memcpy(), memset(), msg(), rc, and strerror().
Referenced by intelxvf_open().
Send set MTU message.
| intel | Intel device |
| mtu | Maximum packet size |
| rc | Return status code |
Definition at line 314 of file intelvf.c.
References DBGC, DBGC_HDA, EPERM, EPROTO, intelvf_mbox_msg(), INTELVF_MSG_ACK, INTELVF_MSG_TYPE_MASK, INTELVF_MSG_TYPE_SET_MTU, memset(), msg(), mtu, rc, and strerror().
Referenced by intelxvf_open().