iPXE
|
Intel 10/100/1000 virtual function network card driver. More...
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <ipxe/io.h>
#include <ipxe/netdevice.h>
#include <ipxe/ethernet.h>
#include "intelvf.h"
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | intelvf_mbox_write (struct intel_nic *intel, const union intelvf_msg *msg) |
Write message to mailbox. More... | |
static void | intelvf_mbox_read (struct intel_nic *intel, union intelvf_msg *msg) |
Read message from mailbox. More... | |
int | intelvf_mbox_poll (struct intel_nic *intel) |
Poll mailbox. More... | |
int | intelvf_mbox_wait (struct intel_nic *intel) |
Wait for PF reset to complete. More... | |
int | intelvf_mbox_msg (struct intel_nic *intel, union intelvf_msg *msg) |
Send/receive mailbox message. More... | |
int | intelvf_mbox_reset (struct intel_nic *intel, uint8_t *hw_addr) |
Send reset message and get initial MAC address. More... | |
int | intelvf_mbox_set_mac (struct intel_nic *intel, const uint8_t *ll_addr) |
Send set MAC address message. More... | |
int | intelvf_mbox_set_mtu (struct intel_nic *intel, size_t mtu) |
Send set MTU message. More... | |
Intel 10/100/1000 virtual function network card driver.
Definition in file intelvf.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Write message to mailbox.
intel | Intel device |
msg | Message |
Definition at line 53 of file intelvf.c.
References DBGC2, intel_nic::mbox, intel_mailbox::mem, msg(), raw, intel_nic::regs, and writel().
Referenced by intelvf_mbox_msg().
|
static |
Read message from mailbox.
intel | Intel device |
msg | Message |
Definition at line 74 of file intelvf.c.
References DBGC2, intel_nic::mbox, intel_mailbox::mem, msg(), raw, readl(), and intel_nic::regs.
Referenced by intelvf_mbox_msg(), and intelvf_mbox_poll().
int intelvf_mbox_poll | ( | struct intel_nic * | intel | ) |
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 98 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().
int intelvf_mbox_wait | ( | struct intel_nic * | intel | ) |
Wait for PF reset to complete.
intel | Intel device |
rc | Return status code |
Definition at line 125 of file intelvf.c.
References DBGC, ETIMEDOUT, INTELVF_MBOX_MAX_WAIT_MS, intelvf_mbox_poll(), mdelay(), and rc.
int intelvf_mbox_msg | ( | struct intel_nic * | intel, |
union intelvf_msg * | msg | ||
) |
Send/receive mailbox message.
intel | Intel device |
msg | Message buffer |
rc | Return status code |
Definition at line 151 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().
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 232 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 275 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 313 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().