Intel 10/100/1000 virtual function network card driver.
Definition in file intelvf.h.
Send/receive mailbox message.
- Parameters
-
intel | Intel device |
msg | Message buffer |
- Return values
-
Definition at line 151 of file intelvf.c.
220 DBGC ( intel,
"INTEL %p timed out waiting for mailbox (seen %08x)\n",
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
static void intelvf_mbox_write(struct intel_nic *intel, const union intelvf_msg *msg)
Write message to mailbox.
struct intel_mailbox mbox
Mailbox.
#define EPIPE
Broken pipe.
uint32_t readl(volatile uint32_t *io_addr)
Read 32-bit dword from memory-mapped device.
#define INTELVF_MBCTRL_PFACK
PF acknowledged message.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
#define INTELVF_MBCTRL_REQ
Request for PF ready.
#define INTELVF_MBCTRL_PFSTS
PF wrote a message.
An Intel virtual function mailbox.
#define INTELVF_MBCTRL_ACK
PF message received.
#define INTELVF_MSG_RESPONSE
Message is a response.
#define INTELVF_MBCTRL_RSTI
PF reset in progress.
#define INTELVF_MBCTRL_VFU
Buffer taken by VF.
#define INTELVF_MBOX_MAX_WAIT_MS
Maximum time to wait for mailbox message.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
static void intelvf_mbox_read(struct intel_nic *intel, union intelvf_msg *msg)
Read message from mailbox.
#define ETIMEDOUT
Connection timed out.
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().
int intelvf_mbox_poll |
( |
struct intel_nic * |
intel | ) |
|
Poll mailbox.
- Parameters
-
- Return values
-
Note that polling the mailbox may fail if the underlying PF is reset.
Definition at line 98 of file intelvf.c.
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
struct intel_mailbox mbox
Mailbox.
#define EPIPE
Broken pipe.
uint32_t readl(volatile uint32_t *io_addr)
Read 32-bit dword from memory-mapped device.
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
#define INTELVF_MBCTRL_PFSTS
PF wrote a message.
An Intel virtual function mailbox.
#define INTELVF_MBCTRL_ACK
PF message received.
#define INTELVF_MBCTRL_RSTI
PF reset in progress.
static void intelvf_mbox_read(struct intel_nic *intel, union intelvf_msg *msg)
Read message from mailbox.
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().
Send reset message and get initial MAC address.
- Parameters
-
intel | Intel device |
hw_addr | Hardware address to fill in, or NULL |
- Return values
-
Definition at line 232 of file intelvf.c.
240 DBGC ( intel,
"INTEL %p reset failed: %s\n",
247 DBGC ( intel,
"INTEL %p reset unexpected response:\n", intel );
255 memcpy ( hw_addr,
msg.mac.mac, sizeof (
msg.mac.mac ) );
256 DBGC ( intel,
"INTEL %p reset assigned MAC address " 257 "%s\n", intel,
eth_ntoa ( hw_addr ) );
260 DBGC ( intel,
"INTEL %p reset generated MAC address " 261 "%s\n", intel,
eth_ntoa ( hw_addr ) );
struct arbelprm_rc_send_wqe rc
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define EPROTO
Protocol error.
char * strerror(int errno)
Retrieve string representation of error number.
#define INTELVF_MSG_ACK
Message ACK flag.
int intelvf_mbox_msg(struct intel_nic *intel, union intelvf_msg *msg)
Send/receive mailbox message.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define INTELVF_MSG_TYPE_MASK
Message type mask.
#define INTELVF_MSG_TYPE_RESET
Reset mailbox message.
void eth_random_addr(void *hw_addr)
Generate random Ethernet address.
void * memset(void *dest, int character, size_t len) __nonnull
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.
- Parameters
-
intel | Intel device |
ll_addr | Link-layer address |
- Return values
-
Definition at line 275 of file intelvf.c.
282 memcpy (
msg.mac.mac, ll_addr, sizeof (
msg.mac.mac ) );
284 DBGC ( intel,
"INTEL %p set MAC address failed: %s\n",
291 DBGC ( intel,
"INTEL %p set MAC address unexpected response:\n",
299 DBGC ( intel,
"INTEL %p set MAC address refused\n", intel );
#define INTELVF_MSG_TYPE_SET_MAC
Set MAC address mailbox message.
struct arbelprm_rc_send_wqe rc
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define EPROTO
Protocol error.
char * strerror(int errno)
Retrieve string representation of error number.
#define INTELVF_MSG_ACK
Message ACK flag.
int intelvf_mbox_msg(struct intel_nic *intel, union intelvf_msg *msg)
Send/receive mailbox message.
#define EPERM
Operation not permitted.
#define INTELVF_MSG_TYPE_MASK
Message type mask.
void * memset(void *dest, int character, size_t len) __nonnull
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.
- Parameters
-
intel | Intel device |
mtu | Maximum packet size |
- Return values
-
Definition at line 313 of file intelvf.c.
322 DBGC ( intel,
"INTEL %p set MTU failed: %s\n",
329 DBGC ( intel,
"INTEL %p set MTU unexpected response:\n",
337 DBGC ( intel,
"INTEL %p set MTU refused\n", intel );
struct arbelprm_rc_send_wqe rc
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
#define EPROTO
Protocol error.
char * strerror(int errno)
Retrieve string representation of error number.
#define INTELVF_MSG_ACK
Message ACK flag.
int intelvf_mbox_msg(struct intel_nic *intel, union intelvf_msg *msg)
Send/receive mailbox message.
#define INTELVF_MSG_TYPE_SET_MTU
Set MTU mailbox message.
#define EPERM
Operation not permitted.
#define INTELVF_MSG_TYPE_MASK
Message type mask.
void * memset(void *dest, int character, size_t len) __nonnull
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().