FreeBSD kernel IXGBE device code
ixgbe_mbx.c File Reference
#include "ixgbe_type.h"
#include "ixgbe_mbx.h"
Include dependency graph for ixgbe_mbx.c:

Go to the source code of this file.

Functions

s32 ixgbe_read_mbx (struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
 
s32 ixgbe_write_mbx (struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
 
s32 ixgbe_check_for_msg (struct ixgbe_hw *hw, u16 mbx_id)
 
s32 ixgbe_check_for_ack (struct ixgbe_hw *hw, u16 mbx_id)
 
s32 ixgbe_check_for_rst (struct ixgbe_hw *hw, u16 mbx_id)
 
static s32 ixgbe_poll_for_msg (struct ixgbe_hw *hw, u16 mbx_id)
 
static s32 ixgbe_poll_for_ack (struct ixgbe_hw *hw, u16 mbx_id)
 
s32 ixgbe_read_posted_mbx (struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
 
s32 ixgbe_write_posted_mbx (struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
 
void ixgbe_init_mbx_ops_generic (struct ixgbe_hw *hw)
 
static u32 ixgbe_read_v2p_mailbox (struct ixgbe_hw *hw)
 
static s32 ixgbe_check_for_bit_vf (struct ixgbe_hw *hw, u32 mask)
 
static s32 ixgbe_check_for_msg_vf (struct ixgbe_hw *hw, u16 mbx_id)
 
static s32 ixgbe_check_for_ack_vf (struct ixgbe_hw *hw, u16 mbx_id)
 
static s32 ixgbe_check_for_rst_vf (struct ixgbe_hw *hw, u16 mbx_id)
 
static s32 ixgbe_obtain_mbx_lock_vf (struct ixgbe_hw *hw)
 
static s32 ixgbe_write_mbx_vf (struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
 
static s32 ixgbe_read_mbx_vf (struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
 
void ixgbe_init_mbx_params_vf (struct ixgbe_hw *hw)
 
static s32 ixgbe_check_for_bit_pf (struct ixgbe_hw *hw, u32 mask, s32 index)
 
static s32 ixgbe_check_for_msg_pf (struct ixgbe_hw *hw, u16 vf_number)
 
static s32 ixgbe_check_for_ack_pf (struct ixgbe_hw *hw, u16 vf_number)
 
static s32 ixgbe_check_for_rst_pf (struct ixgbe_hw *hw, u16 vf_number)
 
static s32 ixgbe_obtain_mbx_lock_pf (struct ixgbe_hw *hw, u16 vf_number)
 
static s32 ixgbe_write_mbx_pf (struct ixgbe_hw *hw, u32 *msg, u16 size, u16 vf_number)
 
static s32 ixgbe_read_mbx_pf (struct ixgbe_hw *hw, u32 *msg, u16 size, u16 vf_number)
 
void ixgbe_init_mbx_params_pf (struct ixgbe_hw *hw)
 

Function Documentation

◆ ixgbe_check_for_ack()

s32 ixgbe_check_for_ack ( struct ixgbe_hw hw,
u16  mbx_id 
)

ixgbe_check_for_ack - checks to see if someone sent us ACK @hw: pointer to the HW structure @mbx_id: id of mailbox to check

returns SUCCESS if the Status bit was found or else ERR_MBX

Definition at line 118 of file ixgbe_mbx.c.

References ixgbe_mbx_operations::check_for_ack, DEBUGFUNC, IXGBE_ERR_MBX, ixgbe_hw::mbx, and ixgbe_mbx_info::ops.

◆ ixgbe_check_for_ack_pf()

static s32 ixgbe_check_for_ack_pf ( struct ixgbe_hw hw,
u16  vf_number 
)
static

ixgbe_check_for_ack_pf - checks to see if the VF has ACKed @hw: pointer to the HW structure @vf_number: the VF index

returns SUCCESS if the VF has set the Status bit or else ERR_MBX

Definition at line 573 of file ixgbe_mbx.c.

References ixgbe_mbx_stats::acks, DEBUGFUNC, ixgbe_check_for_bit_pf(), IXGBE_ERR_MBX, IXGBE_MBVFICR_INDEX, IXGBE_MBVFICR_VFACK_VF1, IXGBE_SUCCESS, ixgbe_hw::mbx, and ixgbe_mbx_info::stats.

Referenced by ixgbe_init_mbx_params_pf(), and ixgbe_write_mbx_pf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_check_for_ack_vf()

static s32 ixgbe_check_for_ack_vf ( struct ixgbe_hw hw,
u16  mbx_id 
)
static

ixgbe_check_for_ack_vf - checks to see if the PF has ACK'd @hw: pointer to the HW structure @mbx_id: id of mailbox to check

returns SUCCESS if the PF has set the ACK bit or else ERR_MBX

Definition at line 358 of file ixgbe_mbx.c.

References ixgbe_mbx_stats::acks, DEBUGFUNC, ixgbe_check_for_bit_vf(), IXGBE_ERR_MBX, IXGBE_SUCCESS, IXGBE_VFMAILBOX_PFACK, ixgbe_hw::mbx, ixgbe_mbx_info::stats, and UNREFERENCED_1PARAMETER.

Referenced by ixgbe_init_mbx_params_vf(), and ixgbe_write_mbx_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_check_for_bit_pf()

static s32 ixgbe_check_for_bit_pf ( struct ixgbe_hw hw,
u32  mask,
s32  index 
)
static

Definition at line 529 of file ixgbe_mbx.c.

References IXGBE_ERR_MBX, IXGBE_MBVFICR, IXGBE_READ_REG, IXGBE_SUCCESS, and IXGBE_WRITE_REG.

Referenced by ixgbe_check_for_ack_pf(), and ixgbe_check_for_msg_pf().

Here is the caller graph for this function:

◆ ixgbe_check_for_bit_vf()

static s32 ixgbe_check_for_bit_vf ( struct ixgbe_hw hw,
u32  mask 
)
static

ixgbe_check_for_bit_vf - Determine if a status bit was set @hw: pointer to the HW structure @mask: bitmask for bits to be tested and cleared

This function is used to check for the read to clear bits within the V2P mailbox.

Definition at line 316 of file ixgbe_mbx.c.

References IXGBE_ERR_MBX, ixgbe_read_v2p_mailbox(), IXGBE_SUCCESS, ixgbe_hw::mbx, and ixgbe_mbx_info::v2p_mailbox.

Referenced by ixgbe_check_for_ack_vf(), ixgbe_check_for_msg_vf(), and ixgbe_check_for_rst_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_check_for_msg()

s32 ixgbe_check_for_msg ( struct ixgbe_hw hw,
u16  mbx_id 
)

ixgbe_check_for_msg - checks to see if someone sent us mail @hw: pointer to the HW structure @mbx_id: id of mailbox to check

returns SUCCESS if the Status bit was found or else ERR_MBX

Definition at line 98 of file ixgbe_mbx.c.

References ixgbe_mbx_operations::check_for_msg, DEBUGFUNC, IXGBE_ERR_MBX, ixgbe_hw::mbx, and ixgbe_mbx_info::ops.

◆ ixgbe_check_for_msg_pf()

static s32 ixgbe_check_for_msg_pf ( struct ixgbe_hw hw,
u16  vf_number 
)
static

ixgbe_check_for_msg_pf - checks to see if the VF has sent mail @hw: pointer to the HW structure @vf_number: the VF index

returns SUCCESS if the VF has set the Status bit or else ERR_MBX

Definition at line 549 of file ixgbe_mbx.c.

References DEBUGFUNC, ixgbe_check_for_bit_pf(), IXGBE_ERR_MBX, IXGBE_MBVFICR_INDEX, IXGBE_MBVFICR_VFREQ_VF1, IXGBE_SUCCESS, ixgbe_hw::mbx, ixgbe_mbx_stats::reqs, and ixgbe_mbx_info::stats.

Referenced by ixgbe_init_mbx_params_pf(), and ixgbe_write_mbx_pf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_check_for_msg_vf()

static s32 ixgbe_check_for_msg_vf ( struct ixgbe_hw hw,
u16  mbx_id 
)
static

ixgbe_check_for_msg_vf - checks to see if the PF has sent mail @hw: pointer to the HW structure @mbx_id: id of mailbox to check

returns SUCCESS if the PF has set the Status bit or else ERR_MBX

Definition at line 336 of file ixgbe_mbx.c.

References DEBUGFUNC, ixgbe_check_for_bit_vf(), IXGBE_ERR_MBX, IXGBE_SUCCESS, IXGBE_VFMAILBOX_PFSTS, ixgbe_hw::mbx, ixgbe_mbx_stats::reqs, ixgbe_mbx_info::stats, and UNREFERENCED_1PARAMETER.

Referenced by ixgbe_init_mbx_params_vf(), and ixgbe_write_mbx_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_check_for_rst()

s32 ixgbe_check_for_rst ( struct ixgbe_hw hw,
u16  mbx_id 
)

ixgbe_check_for_rst - checks to see if other side has reset @hw: pointer to the HW structure @mbx_id: id of mailbox to check

returns SUCCESS if the Status bit was found or else ERR_MBX

Definition at line 138 of file ixgbe_mbx.c.

References ixgbe_mbx_operations::check_for_rst, DEBUGFUNC, IXGBE_ERR_MBX, ixgbe_hw::mbx, and ixgbe_mbx_info::ops.

◆ ixgbe_check_for_rst_pf()

static s32 ixgbe_check_for_rst_pf ( struct ixgbe_hw hw,
u16  vf_number 
)
static

ixgbe_check_for_rst_pf - checks to see if the VF has reset @hw: pointer to the HW structure @vf_number: the VF index

returns SUCCESS if the VF has set the Status bit or else ERR_MBX

Definition at line 597 of file ixgbe_mbx.c.

References DEBUGFUNC, IXGBE_ERR_MBX, ixgbe_mac_82599EB, ixgbe_mac_X540, ixgbe_mac_X550, ixgbe_mac_X550EM_a, ixgbe_mac_X550EM_x, IXGBE_READ_REG, IXGBE_SUCCESS, IXGBE_VFLRE, IXGBE_VFLREC, IXGBE_WRITE_REG, ixgbe_hw::mac, ixgbe_hw::mbx, ixgbe_mbx_stats::rsts, ixgbe_mbx_info::stats, and ixgbe_mac_info::type.

Referenced by ixgbe_init_mbx_params_pf().

Here is the caller graph for this function:

◆ ixgbe_check_for_rst_vf()

static s32 ixgbe_check_for_rst_vf ( struct ixgbe_hw hw,
u16  mbx_id 
)
static

ixgbe_check_for_rst_vf - checks to see if the PF has reset @hw: pointer to the HW structure @mbx_id: id of mailbox to check

returns true if the PF has set the reset done bit or else false

Definition at line 380 of file ixgbe_mbx.c.

References DEBUGFUNC, ixgbe_check_for_bit_vf(), IXGBE_ERR_MBX, IXGBE_SUCCESS, IXGBE_VFMAILBOX_RSTD, IXGBE_VFMAILBOX_RSTI, ixgbe_hw::mbx, ixgbe_mbx_stats::rsts, ixgbe_mbx_info::stats, and UNREFERENCED_1PARAMETER.

Referenced by ixgbe_init_mbx_params_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_init_mbx_ops_generic()

void ixgbe_init_mbx_ops_generic ( struct ixgbe_hw hw)

ixgbe_init_mbx_ops_generic - Initialize MB function pointers @hw: pointer to the HW structure

Setups up the mailbox read and write message function pointers

Definition at line 283 of file ixgbe_mbx.c.

References ixgbe_read_posted_mbx(), ixgbe_write_posted_mbx(), ixgbe_hw::mbx, ixgbe_mbx_info::ops, ixgbe_mbx_operations::read_posted, and ixgbe_mbx_operations::write_posted.

Here is the call graph for this function:

◆ ixgbe_init_mbx_params_pf()

◆ ixgbe_init_mbx_params_vf()

◆ ixgbe_obtain_mbx_lock_pf()

static s32 ixgbe_obtain_mbx_lock_pf ( struct ixgbe_hw hw,
u16  vf_number 
)
static

ixgbe_obtain_mbx_lock_pf - obtain mailbox lock @hw: pointer to the HW structure @vf_number: the VF index

return SUCCESS if we obtained the mailbox lock

Definition at line 636 of file ixgbe_mbx.c.

References DEBUGFUNC, ERROR_REPORT2, IXGBE_ERR_MBX, IXGBE_ERROR_POLLING, IXGBE_PFMAILBOX, IXGBE_PFMAILBOX_PFU, IXGBE_READ_REG, IXGBE_SUCCESS, and IXGBE_WRITE_REG.

Referenced by ixgbe_read_mbx_pf(), and ixgbe_write_mbx_pf().

Here is the caller graph for this function:

◆ ixgbe_obtain_mbx_lock_vf()

static s32 ixgbe_obtain_mbx_lock_vf ( struct ixgbe_hw hw)
static

ixgbe_obtain_mbx_lock_vf - obtain mailbox lock @hw: pointer to the HW structure

return SUCCESS if we obtained the mailbox lock

Definition at line 402 of file ixgbe_mbx.c.

References DEBUGFUNC, IXGBE_ERR_MBX, ixgbe_read_v2p_mailbox(), IXGBE_SUCCESS, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_VFU, and IXGBE_WRITE_REG.

Referenced by ixgbe_read_mbx_vf(), and ixgbe_write_mbx_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_poll_for_ack()

static s32 ixgbe_poll_for_ack ( struct ixgbe_hw hw,
u16  mbx_id 
)
static

ixgbe_poll_for_ack - Wait for message acknowledgment @hw: pointer to the HW structure @mbx_id: id of mailbox to write

returns SUCCESS if it successfully received a message acknowledgment

Definition at line 190 of file ixgbe_mbx.c.

References ixgbe_mbx_operations::check_for_ack, DEBUGFUNC, ERROR_REPORT2, IXGBE_ERR_MBX, IXGBE_ERROR_POLLING, IXGBE_SUCCESS, ixgbe_hw::mbx, ixgbe_mbx_info::ops, ixgbe_mbx_info::timeout, usec_delay, and ixgbe_mbx_info::usec_delay.

Referenced by ixgbe_write_posted_mbx().

Here is the caller graph for this function:

◆ ixgbe_poll_for_msg()

static s32 ixgbe_poll_for_msg ( struct ixgbe_hw hw,
u16  mbx_id 
)
static

ixgbe_poll_for_msg - Wait for message notification @hw: pointer to the HW structure @mbx_id: id of mailbox to write

returns SUCCESS if it successfully received a message notification

Definition at line 158 of file ixgbe_mbx.c.

References ixgbe_mbx_operations::check_for_msg, DEBUGFUNC, ERROR_REPORT2, IXGBE_ERR_MBX, IXGBE_ERROR_POLLING, IXGBE_SUCCESS, ixgbe_hw::mbx, ixgbe_mbx_info::ops, ixgbe_mbx_info::timeout, usec_delay, and ixgbe_mbx_info::usec_delay.

Referenced by ixgbe_read_posted_mbx().

Here is the caller graph for this function:

◆ ixgbe_read_mbx()

s32 ixgbe_read_mbx ( struct ixgbe_hw hw,
u32 msg,
u16  size,
u16  mbx_id 
)

ixgbe_read_mbx - Reads a message from the mailbox @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @mbx_id: id of mailbox to read

returns SUCCESS if it successfully read message from buffer

Definition at line 48 of file ixgbe_mbx.c.

References DEBUGFUNC, IXGBE_ERR_MBX, ixgbe_hw::mbx, ixgbe_mbx_info::ops, ixgbe_mbx_operations::read, and ixgbe_mbx_info::size.

◆ ixgbe_read_mbx_pf()

static s32 ixgbe_read_mbx_pf ( struct ixgbe_hw hw,
u32 msg,
u16  size,
u16  vf_number 
)
static

ixgbe_read_mbx_pf - Read a message from the mailbox @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @vf_number: the VF index

This function copies a message from the mailbox buffer to the caller's memory buffer. The presumption is that the caller knows that there was a message due to a VF request so no polling for message is needed.

Definition at line 710 of file ixgbe_mbx.c.

References DEBUGFUNC, ixgbe_obtain_mbx_lock_pf(), IXGBE_PFMAILBOX, IXGBE_PFMAILBOX_ACK, IXGBE_PFMBMEM, IXGBE_READ_REG_ARRAY, IXGBE_WRITE_REG, ixgbe_hw::mbx, ixgbe_mbx_stats::msgs_rx, ixgbe_mbx_info::size, and ixgbe_mbx_info::stats.

Referenced by ixgbe_init_mbx_params_pf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_read_mbx_vf()

static s32 ixgbe_read_mbx_vf ( struct ixgbe_hw hw,
u32 msg,
u16  size,
u16  mbx_id 
)
static

ixgbe_read_mbx_vf - Reads a message from the inbox intended for vf @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @mbx_id: id of mailbox to read

returns SUCCESS if it successfully read message from buffer

Definition at line 469 of file ixgbe_mbx.c.

References DEBUGFUNC, ixgbe_obtain_mbx_lock_vf(), IXGBE_READ_REG_ARRAY, IXGBE_SUCCESS, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_ACK, IXGBE_VFMBMEM, IXGBE_WRITE_REG, ixgbe_hw::mbx, ixgbe_mbx_stats::msgs_rx, ixgbe_mbx_info::size, ixgbe_mbx_info::stats, and UNREFERENCED_1PARAMETER.

Referenced by ixgbe_init_mbx_params_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_read_posted_mbx()

s32 ixgbe_read_posted_mbx ( struct ixgbe_hw hw,
u32 msg,
u16  size,
u16  mbx_id 
)

ixgbe_read_posted_mbx - Wait for message notification and receive message @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @mbx_id: id of mailbox to write

returns SUCCESS if it successfully received a message notification and copied it into the receive buffer.

Definition at line 225 of file ixgbe_mbx.c.

References DEBUGFUNC, IXGBE_ERR_MBX, ixgbe_poll_for_msg(), ixgbe_hw::mbx, ixgbe_mbx_info::ops, ixgbe_mbx_operations::read, and ixgbe_mbx_info::size.

Referenced by ixgbe_init_mbx_ops_generic(), ixgbe_init_mbx_params_pf(), and ixgbe_init_mbx_params_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_read_v2p_mailbox()

static u32 ixgbe_read_v2p_mailbox ( struct ixgbe_hw hw)
static

ixgbe_read_v2p_mailbox - read v2p mailbox @hw: pointer to the HW structure

This function is used to read the v2p mailbox without losing the read to clear status bits.

Definition at line 298 of file ixgbe_mbx.c.

References IXGBE_READ_REG, IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_R2C_BITS, ixgbe_hw::mbx, and ixgbe_mbx_info::v2p_mailbox.

Referenced by ixgbe_check_for_bit_vf(), and ixgbe_obtain_mbx_lock_vf().

Here is the caller graph for this function:

◆ ixgbe_write_mbx()

s32 ixgbe_write_mbx ( struct ixgbe_hw hw,
u32 msg,
u16  size,
u16  mbx_id 
)

ixgbe_write_mbx - Write a message to the mailbox @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @mbx_id: id of mailbox to write

returns SUCCESS if it successfully copied message into the buffer

Definition at line 74 of file ixgbe_mbx.c.

References DEBUGFUNC, ERROR_REPORT2, IXGBE_ERR_MBX, IXGBE_ERROR_ARGUMENT, IXGBE_SUCCESS, ixgbe_hw::mbx, ixgbe_mbx_info::ops, ixgbe_mbx_info::size, and ixgbe_mbx_operations::write.

◆ ixgbe_write_mbx_pf()

static s32 ixgbe_write_mbx_pf ( struct ixgbe_hw hw,
u32 msg,
u16  size,
u16  vf_number 
)
static

ixgbe_write_mbx_pf - Places a message in the mailbox @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @vf_number: the VF index

returns SUCCESS if it successfully copied message into the buffer

Definition at line 667 of file ixgbe_mbx.c.

References DEBUGFUNC, ixgbe_check_for_ack_pf(), ixgbe_check_for_msg_pf(), ixgbe_obtain_mbx_lock_pf(), IXGBE_PFMAILBOX, IXGBE_PFMAILBOX_STS, IXGBE_PFMBMEM, IXGBE_WRITE_REG, IXGBE_WRITE_REG_ARRAY, ixgbe_hw::mbx, ixgbe_mbx_stats::msgs_tx, ixgbe_mbx_info::size, and ixgbe_mbx_info::stats.

Referenced by ixgbe_init_mbx_params_pf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_write_mbx_vf()

static s32 ixgbe_write_mbx_vf ( struct ixgbe_hw hw,
u32 msg,
u16  size,
u16  mbx_id 
)
static

ixgbe_write_mbx_vf - Write a message to the mailbox @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @mbx_id: id of mailbox to write

returns SUCCESS if it successfully copied message into the buffer

Definition at line 427 of file ixgbe_mbx.c.

References DEBUGFUNC, ixgbe_check_for_ack_vf(), ixgbe_check_for_msg_vf(), ixgbe_obtain_mbx_lock_vf(), IXGBE_VFMAILBOX, IXGBE_VFMAILBOX_REQ, IXGBE_VFMBMEM, IXGBE_WRITE_REG, IXGBE_WRITE_REG_ARRAY, ixgbe_hw::mbx, ixgbe_mbx_stats::msgs_tx, ixgbe_mbx_info::size, ixgbe_mbx_info::stats, and UNREFERENCED_1PARAMETER.

Referenced by ixgbe_init_mbx_params_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_write_posted_mbx()

s32 ixgbe_write_posted_mbx ( struct ixgbe_hw hw,
u32 msg,
u16  size,
u16  mbx_id 
)

ixgbe_write_posted_mbx - Write a message to the mailbox, wait for ack @hw: pointer to the HW structure @msg: The message buffer @size: Length of buffer @mbx_id: id of mailbox to write

returns SUCCESS if it successfully copied message into the buffer and received an ack to that message within delay * timeout period

Definition at line 255 of file ixgbe_mbx.c.

References DEBUGFUNC, IXGBE_ERR_MBX, ixgbe_poll_for_ack(), ixgbe_hw::mbx, ixgbe_mbx_info::ops, ixgbe_mbx_info::size, ixgbe_mbx_info::timeout, and ixgbe_mbx_operations::write.

Referenced by ixgbe_init_mbx_ops_generic(), ixgbe_init_mbx_params_pf(), and ixgbe_init_mbx_params_vf().

Here is the call graph for this function:
Here is the caller graph for this function: