59 DBGC2 ( intel,
"INTEL %p sending message", intel );
60 for ( i = 0 ; i < (
sizeof ( *msg ) /
sizeof (
raw->dword[0] ) ) ; i++){
61 DBGC2 ( intel,
"%c%08x", ( i ?
':' :
' ' ),
raw->dword[i] );
63 ( i * sizeof (
raw->dword[0] ) ) ) );
65 DBGC2 ( intel,
"\n" );
80 DBGC2 ( intel,
"INTEL %p received message", intel );
81 for ( i = 0 ; i < (
sizeof ( *msg ) /
sizeof (
raw->dword[0] ) ) ; i++){
83 ( i * sizeof (
raw->dword[0] ) ) );
84 DBGC2 ( intel,
"%c%08x", ( i ?
':' :
' ' ),
raw->dword[i] );
86 DBGC2 ( intel,
"\n" );
140 DBGC ( intel,
"INTEL %p timed out waiting for reset\n", intel );
220 DBGC ( intel,
"INTEL %p timed out waiting for mailbox (seen %08x)\n",
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 ) );
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 );
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 );
#define INTELVF_MSG_TYPE_SET_MAC
Set MAC address mailbox message.
struct arbelprm_rc_send_wqe rc
int intelvf_mbox_set_mtu(struct intel_nic *intel, size_t mtu)
Send set MTU message.
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.
int intelvf_mbox_set_mac(struct intel_nic *intel, const uint8_t *ll_addr)
Send set MAC address message.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
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 EPROTO
Protocol error.
char * strerror(int errno)
Retrieve string representation of error number.
#define INTELVF_MBCTRL_PFSTS
PF wrote a message.
#define INTELVF_MSG_ACK
Message ACK flag.
int intelvf_mbox_msg(struct intel_nic *intel, union intelvf_msg *msg)
Send/receive mailbox message.
An Intel virtual function mailbox.
int intelvf_mbox_reset(struct intel_nic *intel, uint8_t *hw_addr)
Send reset message and get initial MAC address.
const char * eth_ntoa(const void *ll_addr)
Transcribe Ethernet address.
#define INTELVF_MSG_TYPE_SET_MTU
Set MTU mailbox message.
#define INTELVF_MBCTRL_ACK
PF message received.
#define INTELVF_MSG_RESPONSE
Message is a response.
#define INTELVF_MBCTRL_RSTI
PF reset in progress.
unsigned int mem
Mailbox memory base.
#define EPERM
Operation not permitted.
Network device management.
#define INTELVF_MBCTRL_VFU
Buffer taken by VF.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#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.
#define INTELVF_MSG_TYPE_MASK
Message type mask.
static void intelvf_mbox_read(struct intel_nic *intel, union intelvf_msg *msg)
Read message from mailbox.
int intelvf_mbox_poll(struct intel_nic *intel)
Poll mailbox.
#define INTELVF_MSG_TYPE_RESET
Reset mailbox message.
Intel 10/100/1000 virtual function network card driver.
#define ETIMEDOUT
Connection timed out.
void eth_random_addr(void *hw_addr)
Generate random Ethernet address.
int intelvf_mbox_wait(struct intel_nic *intel)
Wait for PF reset to complete.
void * memset(void *dest, int character, size_t len) __nonnull
static void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.