iPXE
Macros | Functions
igbvf_mbx.h File Reference
#include "igbvf_vf.h"

Go to the source code of this file.

Macros

#define _IGBVF_MBX_H_
 
#define E1000_V2PMAILBOX(_n)   (0x00C40 + (4 * (_n)))
 
#define E1000_VMBMEM(_n)   (0x00800 + (64 * (_n)))
 
#define E1000_V2PMAILBOX_REQ   0x00000001 /* Request for PF Ready bit */
 
#define E1000_V2PMAILBOX_ACK   0x00000002 /* Ack PF message received */
 
#define E1000_V2PMAILBOX_VFU   0x00000004 /* VF owns the mailbox buffer */
 
#define E1000_V2PMAILBOX_PFU   0x00000008 /* PF owns the mailbox buffer */
 
#define E1000_V2PMAILBOX_PFSTS   0x00000010 /* PF wrote a message in the MB */
 
#define E1000_V2PMAILBOX_PFACK   0x00000020 /* PF ack the previous VF msg */
 
#define E1000_V2PMAILBOX_RSTI   0x00000040 /* PF has reset indication */
 
#define E1000_V2PMAILBOX_RSTD   0x00000080 /* PF has indicated reset done */
 
#define E1000_V2PMAILBOX_R2C_BITS   0x000000B0 /* All read to clear bits */
 
#define E1000_VFMAILBOX_SIZE   16 /* 16 32 bit words - 64 bytes */
 
#define E1000_VT_MSGTYPE_ACK
 
#define E1000_VT_MSGTYPE_NACK
 
#define E1000_VT_MSGTYPE_CTS
 
#define E1000_VT_MSGINFO_SHIFT   16
 
#define E1000_VT_MSGINFO_MASK   (0xFF << E1000_VT_MSGINFO_SHIFT)
 
#define E1000_VF_RESET   0x01 /* VF requests reset */
 
#define E1000_VF_SET_MAC_ADDR   0x02 /* VF requests to set MAC addr */
 
#define E1000_VF_SET_MULTICAST   0x03 /* VF requests to set MC addr */
 
#define E1000_VF_SET_MULTICAST_COUNT_MASK   (0x1F << E1000_VT_MSGINFO_SHIFT)
 
#define E1000_VF_SET_MULTICAST_OVERFLOW   (0x80 << E1000_VT_MSGINFO_SHIFT)
 
#define E1000_VF_SET_VLAN   0x04 /* VF requests to set VLAN */
 
#define E1000_VF_SET_VLAN_ADD   (0x01 << E1000_VT_MSGINFO_SHIFT)
 
#define E1000_VF_SET_LPE   0x05 /* VF requests to set VMOLR.LPE */
 
#define E1000_VF_SET_PROMISC   0x06 /*VF requests to clear VMOLR.ROPE/MPME*/
 
#define E1000_VF_SET_PROMISC_UNICAST   (0x01 << E1000_VT_MSGINFO_SHIFT)
 
#define E1000_VF_SET_PROMISC_MULTICAST   (0x02 << E1000_VT_MSGINFO_SHIFT)
 
#define E1000_PF_CONTROL_MSG   0x0100 /* PF control message */
 
#define E1000_VF_MBX_INIT_TIMEOUT   2000 /* number of retries on mailbox */
 
#define E1000_VF_MBX_INIT_DELAY   500 /* microseconds between retries */
 

Functions

 FILE_LICENCE (GPL2_ONLY)
 
void igbvf_init_mbx_ops_generic (struct e1000_hw *hw)
 igbvf_init_mbx_ops_generic - Initialize NVM function pointers @hw: pointer to the HW structure More...
 
s32 igbvf_init_mbx_params_vf (struct e1000_hw *)
 igbvf_init_mbx_params_vf - set initial values for vf mailbox @hw: pointer to the HW structure More...
 

Macro Definition Documentation

◆ _IGBVF_MBX_H_

#define _IGBVF_MBX_H_

Definition at line 32 of file igbvf_mbx.h.

◆ E1000_V2PMAILBOX

#define E1000_V2PMAILBOX (   _n)    (0x00C40 + (4 * (_n)))

Definition at line 37 of file igbvf_mbx.h.

◆ E1000_VMBMEM

#define E1000_VMBMEM (   _n)    (0x00800 + (64 * (_n)))

Definition at line 38 of file igbvf_mbx.h.

◆ E1000_V2PMAILBOX_REQ

#define E1000_V2PMAILBOX_REQ   0x00000001 /* Request for PF Ready bit */

Definition at line 41 of file igbvf_mbx.h.

◆ E1000_V2PMAILBOX_ACK

#define E1000_V2PMAILBOX_ACK   0x00000002 /* Ack PF message received */

Definition at line 42 of file igbvf_mbx.h.

◆ E1000_V2PMAILBOX_VFU

#define E1000_V2PMAILBOX_VFU   0x00000004 /* VF owns the mailbox buffer */

Definition at line 43 of file igbvf_mbx.h.

◆ E1000_V2PMAILBOX_PFU

#define E1000_V2PMAILBOX_PFU   0x00000008 /* PF owns the mailbox buffer */

Definition at line 44 of file igbvf_mbx.h.

◆ E1000_V2PMAILBOX_PFSTS

#define E1000_V2PMAILBOX_PFSTS   0x00000010 /* PF wrote a message in the MB */

Definition at line 45 of file igbvf_mbx.h.

◆ E1000_V2PMAILBOX_PFACK

#define E1000_V2PMAILBOX_PFACK   0x00000020 /* PF ack the previous VF msg */

Definition at line 46 of file igbvf_mbx.h.

◆ E1000_V2PMAILBOX_RSTI

#define E1000_V2PMAILBOX_RSTI   0x00000040 /* PF has reset indication */

Definition at line 47 of file igbvf_mbx.h.

◆ E1000_V2PMAILBOX_RSTD

#define E1000_V2PMAILBOX_RSTD   0x00000080 /* PF has indicated reset done */

Definition at line 48 of file igbvf_mbx.h.

◆ E1000_V2PMAILBOX_R2C_BITS

#define E1000_V2PMAILBOX_R2C_BITS   0x000000B0 /* All read to clear bits */

Definition at line 49 of file igbvf_mbx.h.

◆ E1000_VFMAILBOX_SIZE

#define E1000_VFMAILBOX_SIZE   16 /* 16 32 bit words - 64 bytes */

Definition at line 51 of file igbvf_mbx.h.

◆ E1000_VT_MSGTYPE_ACK

#define E1000_VT_MSGTYPE_ACK
Value:
0x80000000 /* Messages below or'd with
* this are the ACK */

Definition at line 57 of file igbvf_mbx.h.

◆ E1000_VT_MSGTYPE_NACK

#define E1000_VT_MSGTYPE_NACK
Value:
0x40000000 /* Messages below or'd with
* this are the NACK */

Definition at line 59 of file igbvf_mbx.h.

◆ E1000_VT_MSGTYPE_CTS

#define E1000_VT_MSGTYPE_CTS
Value:
0x20000000 /* Indicates that VF is still
clear to send requests */

Definition at line 61 of file igbvf_mbx.h.

◆ E1000_VT_MSGINFO_SHIFT

#define E1000_VT_MSGINFO_SHIFT   16

Definition at line 63 of file igbvf_mbx.h.

◆ E1000_VT_MSGINFO_MASK

#define E1000_VT_MSGINFO_MASK   (0xFF << E1000_VT_MSGINFO_SHIFT)

Definition at line 65 of file igbvf_mbx.h.

◆ E1000_VF_RESET

#define E1000_VF_RESET   0x01 /* VF requests reset */

Definition at line 67 of file igbvf_mbx.h.

◆ E1000_VF_SET_MAC_ADDR

#define E1000_VF_SET_MAC_ADDR   0x02 /* VF requests to set MAC addr */

Definition at line 68 of file igbvf_mbx.h.

◆ E1000_VF_SET_MULTICAST

#define E1000_VF_SET_MULTICAST   0x03 /* VF requests to set MC addr */

Definition at line 69 of file igbvf_mbx.h.

◆ E1000_VF_SET_MULTICAST_COUNT_MASK

#define E1000_VF_SET_MULTICAST_COUNT_MASK   (0x1F << E1000_VT_MSGINFO_SHIFT)

Definition at line 70 of file igbvf_mbx.h.

◆ E1000_VF_SET_MULTICAST_OVERFLOW

#define E1000_VF_SET_MULTICAST_OVERFLOW   (0x80 << E1000_VT_MSGINFO_SHIFT)

Definition at line 71 of file igbvf_mbx.h.

◆ E1000_VF_SET_VLAN

#define E1000_VF_SET_VLAN   0x04 /* VF requests to set VLAN */

Definition at line 72 of file igbvf_mbx.h.

◆ E1000_VF_SET_VLAN_ADD

#define E1000_VF_SET_VLAN_ADD   (0x01 << E1000_VT_MSGINFO_SHIFT)

Definition at line 73 of file igbvf_mbx.h.

◆ E1000_VF_SET_LPE

#define E1000_VF_SET_LPE   0x05 /* VF requests to set VMOLR.LPE */

Definition at line 74 of file igbvf_mbx.h.

◆ E1000_VF_SET_PROMISC

#define E1000_VF_SET_PROMISC   0x06 /*VF requests to clear VMOLR.ROPE/MPME*/

Definition at line 75 of file igbvf_mbx.h.

◆ E1000_VF_SET_PROMISC_UNICAST

#define E1000_VF_SET_PROMISC_UNICAST   (0x01 << E1000_VT_MSGINFO_SHIFT)

Definition at line 76 of file igbvf_mbx.h.

◆ E1000_VF_SET_PROMISC_MULTICAST

#define E1000_VF_SET_PROMISC_MULTICAST   (0x02 << E1000_VT_MSGINFO_SHIFT)

Definition at line 77 of file igbvf_mbx.h.

◆ E1000_PF_CONTROL_MSG

#define E1000_PF_CONTROL_MSG   0x0100 /* PF control message */

Definition at line 79 of file igbvf_mbx.h.

◆ E1000_VF_MBX_INIT_TIMEOUT

#define E1000_VF_MBX_INIT_TIMEOUT   2000 /* number of retries on mailbox */

Definition at line 81 of file igbvf_mbx.h.

◆ E1000_VF_MBX_INIT_DELAY

#define E1000_VF_MBX_INIT_DELAY   500 /* microseconds between retries */

Definition at line 82 of file igbvf_mbx.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_ONLY  )

◆ igbvf_init_mbx_ops_generic()

void igbvf_init_mbx_ops_generic ( struct e1000_hw hw)

igbvf_init_mbx_ops_generic - Initialize NVM function pointers @hw: pointer to the HW structure

Setups up the function pointers to no-op functions

Definition at line 163 of file igbvf_mbx.c.

164 {
165  struct e1000_mbx_info *mbx = &hw->mbx;
168 }
s32(* read_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition: igbvf_vf.h:281
Definition: hw.c:16
struct e1000_mbx_operations ops
Definition: igbvf_vf.h:298
static s32 igbvf_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
igbvf_read_posted_mbx - Wait for message notification and receive message @hw: pointer to the HW stru...
Definition: igbvf_mbx.c:105
static s32 igbvf_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
igbvf_write_posted_mbx - Write a message to the mailbox, wait for ack @hw: pointer to the HW structur...
Definition: igbvf_mbx.c:135
s32(* write_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition: igbvf_vf.h:282

References igbvf_read_posted_mbx(), igbvf_write_posted_mbx(), e1000_mbx_info::ops, e1000_mbx_operations::read_posted, and e1000_mbx_operations::write_posted.

◆ igbvf_init_mbx_params_vf()

s32 igbvf_init_mbx_params_vf ( struct e1000_hw hw)

igbvf_init_mbx_params_vf - set initial values for vf mailbox @hw: pointer to the HW structure

Initializes the hw->mbx struct to correct values for vf mailbox

Definition at line 377 of file igbvf_mbx.c.

378 {
379  struct e1000_mbx_info *mbx = &hw->mbx;
380 
381  /* start mailbox as timed out and let the reset_hw call set the timeout
382  * value to begin communications */
383  mbx->timeout = 0;
385 
386  mbx->size = E1000_VFMAILBOX_SIZE;
387 
388  mbx->ops.read = igbvf_read_mbx_vf;
395 
396  mbx->stats.msgs_tx = 0;
397  mbx->stats.msgs_rx = 0;
398  mbx->stats.reqs = 0;
399  mbx->stats.acks = 0;
400  mbx->stats.rsts = 0;
401 
402  return E1000_SUCCESS;
403 }
s32(* read_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition: igbvf_vf.h:281
Definition: hw.c:16
s32(* read)(struct e1000_hw *, u32 *, u16, u16)
Definition: igbvf_vf.h:279
struct e1000_mbx_operations ops
Definition: igbvf_vf.h:298
static s32 igbvf_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
igbvf_read_posted_mbx - Wait for message notification and receive message @hw: pointer to the HW stru...
Definition: igbvf_mbx.c:105
struct e1000_mbx_stats stats
Definition: igbvf_vf.h:299
static s32 igbvf_read_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id __unused)
igbvf_read_mbx_vf - Reads a message from the inbox intended for vf @hw: pointer to the HW structure @...
Definition: igbvf_mbx.c:344
static s32 igbvf_check_for_rst_vf(struct e1000_hw *hw, u16 mbx_id __unused)
igbvf_check_for_rst_vf - checks to see if the PF has reset @hw: pointer to the HW structure @mbx_id: ...
Definition: igbvf_mbx.c:257
static s32 igbvf_check_for_msg_vf(struct e1000_hw *hw, u16 mbx_id __unused)
igbvf_check_for_msg_vf - checks to see if the PF has sent mail @hw: pointer to the HW structure @mbx_...
Definition: igbvf_mbx.c:215
#define E1000_SUCCESS
s32(* write)(struct e1000_hw *, u32 *, u16, u16)
Definition: igbvf_vf.h:280
#define E1000_VFMAILBOX_SIZE
Definition: igbvf_mbx.h:51
s32(* check_for_rst)(struct e1000_hw *, u16)
Definition: igbvf_vf.h:285
static s32 igbvf_check_for_ack_vf(struct e1000_hw *hw, u16 mbx_id __unused)
igbvf_check_for_ack_vf - checks to see if the PF has ACK'd @hw: pointer to the HW structure @mbx_id: ...
Definition: igbvf_mbx.c:236
s32(* check_for_ack)(struct e1000_hw *, u16)
Definition: igbvf_vf.h:284
static s32 igbvf_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id)
igbvf_write_posted_mbx - Write a message to the mailbox, wait for ack @hw: pointer to the HW structur...
Definition: igbvf_mbx.c:135
static s32 igbvf_write_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id __unused)
igbvf_write_mbx_vf - Write a message to the mailbox @hw: pointer to the HW structure @msg: The messag...
Definition: igbvf_mbx.c:303
s32(* write_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition: igbvf_vf.h:282
#define E1000_VF_MBX_INIT_DELAY
Definition: igbvf_mbx.h:82
s32(* check_for_msg)(struct e1000_hw *, u16)
Definition: igbvf_vf.h:283

References e1000_mbx_stats::acks, e1000_mbx_operations::check_for_ack, e1000_mbx_operations::check_for_msg, e1000_mbx_operations::check_for_rst, E1000_SUCCESS, E1000_VF_MBX_INIT_DELAY, E1000_VFMAILBOX_SIZE, igbvf_check_for_ack_vf(), igbvf_check_for_msg_vf(), igbvf_check_for_rst_vf(), igbvf_read_mbx_vf(), igbvf_read_posted_mbx(), igbvf_write_mbx_vf(), igbvf_write_posted_mbx(), e1000_mbx_stats::msgs_rx, e1000_mbx_stats::msgs_tx, e1000_mbx_info::ops, e1000_mbx_operations::read, e1000_mbx_operations::read_posted, e1000_mbx_stats::reqs, e1000_mbx_stats::rsts, e1000_mbx_info::size, e1000_mbx_info::stats, e1000_mbx_info::timeout, e1000_mbx_info::usec_delay, e1000_mbx_operations::write, and e1000_mbx_operations::write_posted.

Referenced by igbvf_init_function_pointers_vf().