iPXE
Data Structures | Macros | Enumerations | Functions
igbvf_vf.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <byteswap.h>
#include <errno.h>
#include <ipxe/pci.h>
#include <ipxe/malloc.h>
#include <ipxe/if_ether.h>
#include <ipxe/io.h>
#include <ipxe/ethernet.h>
#include <ipxe/iobuf.h>
#include <ipxe/netdevice.h>
#include "igbvf_osdep.h"
#include "igbvf_regs.h"
#include "igbvf_defines.h"
#include "igbvf_mbx.h"

Go to the source code of this file.

Data Structures

union  e1000_adv_rx_desc
 
union  e1000_adv_tx_desc
 
struct  e1000_adv_tx_context_desc
 
struct  e1000_vf_stats
 
struct  e1000_mac_operations
 
struct  e1000_mac_info
 
struct  e1000_bus_info
 
struct  e1000_mbx_operations
 
struct  e1000_mbx_stats
 
struct  e1000_mbx_info
 
struct  e1000_dev_spec_vf
 
struct  e1000_hw
 

Macros

#define _IGBVF_VF_H_
 
#define E1000_DEV_ID_82576_VF   0x10CA
 
#define E1000_DEV_ID_I350_VF   0x1520
 
#define E1000_VF_INIT_TIMEOUT   200 /* Number of retries to clear RSTI */
 
#define E1000_TXDCTL_QUEUE_ENABLE   0x02000000 /* Enable specific Tx Queue */
 
#define E1000_RXDCTL_QUEUE_ENABLE   0x02000000 /* Enable specific Rx Queue */
 
#define E1000_SRRCTL_BSIZEPKT_SHIFT   10 /* Shift _right_ */
 
#define E1000_SRRCTL_BSIZEHDRSIZE_MASK   0x00000F00
 
#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT   2 /* Shift _left_ */
 
#define E1000_SRRCTL_DESCTYPE_LEGACY   0x00000000
 
#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF   0x02000000
 
#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT   0x04000000
 
#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS   0x0A000000
 
#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION   0x06000000
 
#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION_LARGE_PKT   0x08000000
 
#define E1000_SRRCTL_DESCTYPE_MASK   0x0E000000
 
#define E1000_SRRCTL_DROP_EN   0x80000000
 
#define E1000_SRRCTL_BSIZEPKT_MASK   0x0000007F
 
#define E1000_SRRCTL_BSIZEHDR_MASK   0x00003F00
 
#define E1000_EICR   0x01580 /* Ext. Interrupt Cause Read - R/clr */
 
#define E1000_EITR(_n)   (0x01680 + ((_n) << 2))
 
#define E1000_EICS   0x01520 /* Ext. Interrupt Cause Set - W0 */
 
#define E1000_EIMS   0x01524 /* Ext. Interrupt Mask Set/Read - RW */
 
#define E1000_EIMC   0x01528 /* Ext. Interrupt Mask Clear - WO */
 
#define E1000_EIAC   0x0152C /* Ext. Interrupt Auto Clear - RW */
 
#define E1000_EIAM   0x01530 /* Ext. Interrupt Ack Auto Clear Mask - RW */
 
#define E1000_IVAR0   0x01700 /* Interrupt Vector Allocation (array) - RW */
 
#define E1000_IVAR_MISC   0x01740 /* IVAR for "other" causes - RW */
 
#define E1000_IVAR_VALID   0x80
 
#define E1000_RXDADV_HDRBUFLEN_MASK   0x7FE0
 
#define E1000_RXDADV_HDRBUFLEN_SHIFT   5
 
#define E1000_ADVTXD_DTYP_CTXT   0x00200000 /* Advanced Context Descriptor */
 
#define E1000_ADVTXD_DTYP_DATA   0x00300000 /* Advanced Data Descriptor */
 
#define E1000_ADVTXD_DCMD_EOP   0x01000000 /* End of Packet */
 
#define E1000_ADVTXD_DCMD_IFCS   0x02000000 /* Insert FCS (Ethernet CRC) */
 
#define E1000_ADVTXD_DCMD_RS   0x08000000 /* Report Status */
 
#define E1000_ADVTXD_DCMD_DEXT   0x20000000 /* Descriptor extension (1=Adv) */
 
#define E1000_ADVTXD_DCMD_VLE   0x40000000 /* VLAN pkt enable */
 
#define E1000_ADVTXD_DCMD_TSE   0x80000000 /* TCP Seg enable */
 
#define E1000_ADVTXD_PAYLEN_SHIFT   14 /* Adv desc PAYLEN shift */
 
#define E1000_ADVTXD_MACLEN_SHIFT   9 /* Adv ctxt desc mac len shift */
 
#define E1000_ADVTXD_TUCMD_IPV4   0x00000400 /* IP Packet Type: 1=IPv4 */
 
#define E1000_ADVTXD_TUCMD_L4T_TCP   0x00000800 /* L4 Packet TYPE of TCP */
 
#define E1000_ADVTXD_L4LEN_SHIFT   8 /* Adv ctxt L4LEN shift */
 
#define E1000_ADVTXD_MSS_SHIFT   16 /* Adv ctxt MSS shift */
 

Enumerations

enum  e1000_mac_type { e1000_undefined = 0, e1000_vfadapt, e1000_num_macs }
 
enum  e1000_bus_type {
  e1000_bus_type_unknown = 0, e1000_bus_type_pci, e1000_bus_type_pcix, e1000_bus_type_pci_express,
  e1000_bus_type_reserved
}
 
enum  e1000_bus_speed {
  e1000_bus_speed_unknown = 0, e1000_bus_speed_33, e1000_bus_speed_66, e1000_bus_speed_100,
  e1000_bus_speed_120, e1000_bus_speed_133, e1000_bus_speed_2500, e1000_bus_speed_5000,
  e1000_bus_speed_reserved
}
 
enum  e1000_bus_width {
  e1000_bus_width_unknown = 0, e1000_bus_width_pcie_x1, e1000_bus_width_pcie_x2, e1000_bus_width_pcie_x4 = 4,
  e1000_bus_width_pcie_x8 = 8, e1000_bus_width_32, e1000_bus_width_64, e1000_bus_width_reserved
}
 
enum  e1000_promisc_type {
  e1000_promisc_disabled = 0, e1000_promisc_unicast = 1, e1000_promisc_multicast = 2, e1000_promisc_enabled = 3,
  e1000_num_promisc_types
}
 

Functions

 FILE_LICENCE (GPL2_ONLY)
 
s32 igbvf_read_pcie_cap_reg (struct e1000_hw *hw, u32 reg, u16 *value)
 
void igbvf_vfta_set_vf (struct e1000_hw *, u16, bool)
 igbvf_vfta_set_vf - Set/Unset vlan filter table address @hw: pointer to the HW structure @vid: determines the vfta register and bit to set/unset @set: if true then set bit, else clear bit More...
 
void igbvf_rlpml_set_vf (struct e1000_hw *, u16)
 igbvf_rlpml_set_vf - Set the maximum receive packet length @hw: pointer to the HW structure @max_size: value to assign to max frame size More...
 
s32 igbvf_promisc_set_vf (struct e1000_hw *, enum e1000_promisc_type)
 igbvf_promisc_set_vf - Set flags for Unicast or Multicast promisc @hw: pointer to the HW structure @uni: boolean indicating unicast promisc status @multi: boolean indicating multicast promisc status More...
 

Macro Definition Documentation

◆ _IGBVF_VF_H_

#define _IGBVF_VF_H_

Definition at line 32 of file igbvf_vf.h.

◆ E1000_DEV_ID_82576_VF

#define E1000_DEV_ID_82576_VF   0x10CA

Definition at line 56 of file igbvf_vf.h.

◆ E1000_DEV_ID_I350_VF

#define E1000_DEV_ID_I350_VF   0x1520

Definition at line 57 of file igbvf_vf.h.

◆ E1000_VF_INIT_TIMEOUT

#define E1000_VF_INIT_TIMEOUT   200 /* Number of retries to clear RSTI */

Definition at line 59 of file igbvf_vf.h.

◆ E1000_TXDCTL_QUEUE_ENABLE

#define E1000_TXDCTL_QUEUE_ENABLE   0x02000000 /* Enable specific Tx Queue */

Definition at line 62 of file igbvf_vf.h.

◆ E1000_RXDCTL_QUEUE_ENABLE

#define E1000_RXDCTL_QUEUE_ENABLE   0x02000000 /* Enable specific Rx Queue */

Definition at line 63 of file igbvf_vf.h.

◆ E1000_SRRCTL_BSIZEPKT_SHIFT

#define E1000_SRRCTL_BSIZEPKT_SHIFT   10 /* Shift _right_ */

Definition at line 66 of file igbvf_vf.h.

◆ E1000_SRRCTL_BSIZEHDRSIZE_MASK

#define E1000_SRRCTL_BSIZEHDRSIZE_MASK   0x00000F00

Definition at line 67 of file igbvf_vf.h.

◆ E1000_SRRCTL_BSIZEHDRSIZE_SHIFT

#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT   2 /* Shift _left_ */

Definition at line 68 of file igbvf_vf.h.

◆ E1000_SRRCTL_DESCTYPE_LEGACY

#define E1000_SRRCTL_DESCTYPE_LEGACY   0x00000000

Definition at line 69 of file igbvf_vf.h.

◆ E1000_SRRCTL_DESCTYPE_ADV_ONEBUF

#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF   0x02000000

Definition at line 70 of file igbvf_vf.h.

◆ E1000_SRRCTL_DESCTYPE_HDR_SPLIT

#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT   0x04000000

Definition at line 71 of file igbvf_vf.h.

◆ E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS

#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS   0x0A000000

Definition at line 72 of file igbvf_vf.h.

◆ E1000_SRRCTL_DESCTYPE_HDR_REPLICATION

#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION   0x06000000

Definition at line 73 of file igbvf_vf.h.

◆ E1000_SRRCTL_DESCTYPE_HDR_REPLICATION_LARGE_PKT

#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION_LARGE_PKT   0x08000000

Definition at line 74 of file igbvf_vf.h.

◆ E1000_SRRCTL_DESCTYPE_MASK

#define E1000_SRRCTL_DESCTYPE_MASK   0x0E000000

Definition at line 75 of file igbvf_vf.h.

◆ E1000_SRRCTL_DROP_EN

#define E1000_SRRCTL_DROP_EN   0x80000000

Definition at line 76 of file igbvf_vf.h.

◆ E1000_SRRCTL_BSIZEPKT_MASK

#define E1000_SRRCTL_BSIZEPKT_MASK   0x0000007F

Definition at line 78 of file igbvf_vf.h.

◆ E1000_SRRCTL_BSIZEHDR_MASK

#define E1000_SRRCTL_BSIZEHDR_MASK   0x00003F00

Definition at line 79 of file igbvf_vf.h.

◆ E1000_EICR

#define E1000_EICR   0x01580 /* Ext. Interrupt Cause Read - R/clr */

Definition at line 82 of file igbvf_vf.h.

◆ E1000_EITR

#define E1000_EITR (   _n)    (0x01680 + ((_n) << 2))

Definition at line 83 of file igbvf_vf.h.

◆ E1000_EICS

#define E1000_EICS   0x01520 /* Ext. Interrupt Cause Set - W0 */

Definition at line 84 of file igbvf_vf.h.

◆ E1000_EIMS

#define E1000_EIMS   0x01524 /* Ext. Interrupt Mask Set/Read - RW */

Definition at line 85 of file igbvf_vf.h.

◆ E1000_EIMC

#define E1000_EIMC   0x01528 /* Ext. Interrupt Mask Clear - WO */

Definition at line 86 of file igbvf_vf.h.

◆ E1000_EIAC

#define E1000_EIAC   0x0152C /* Ext. Interrupt Auto Clear - RW */

Definition at line 87 of file igbvf_vf.h.

◆ E1000_EIAM

#define E1000_EIAM   0x01530 /* Ext. Interrupt Ack Auto Clear Mask - RW */

Definition at line 88 of file igbvf_vf.h.

◆ E1000_IVAR0

#define E1000_IVAR0   0x01700 /* Interrupt Vector Allocation (array) - RW */

Definition at line 89 of file igbvf_vf.h.

◆ E1000_IVAR_MISC

#define E1000_IVAR_MISC   0x01740 /* IVAR for "other" causes - RW */

Definition at line 90 of file igbvf_vf.h.

◆ E1000_IVAR_VALID

#define E1000_IVAR_VALID   0x80

Definition at line 91 of file igbvf_vf.h.

◆ E1000_RXDADV_HDRBUFLEN_MASK

#define E1000_RXDADV_HDRBUFLEN_MASK   0x7FE0

Definition at line 125 of file igbvf_vf.h.

◆ E1000_RXDADV_HDRBUFLEN_SHIFT

#define E1000_RXDADV_HDRBUFLEN_SHIFT   5

Definition at line 126 of file igbvf_vf.h.

◆ E1000_ADVTXD_DTYP_CTXT

#define E1000_ADVTXD_DTYP_CTXT   0x00200000 /* Advanced Context Descriptor */

Definition at line 143 of file igbvf_vf.h.

◆ E1000_ADVTXD_DTYP_DATA

#define E1000_ADVTXD_DTYP_DATA   0x00300000 /* Advanced Data Descriptor */

Definition at line 144 of file igbvf_vf.h.

◆ E1000_ADVTXD_DCMD_EOP

#define E1000_ADVTXD_DCMD_EOP   0x01000000 /* End of Packet */

Definition at line 145 of file igbvf_vf.h.

◆ E1000_ADVTXD_DCMD_IFCS

#define E1000_ADVTXD_DCMD_IFCS   0x02000000 /* Insert FCS (Ethernet CRC) */

Definition at line 146 of file igbvf_vf.h.

◆ E1000_ADVTXD_DCMD_RS

#define E1000_ADVTXD_DCMD_RS   0x08000000 /* Report Status */

Definition at line 147 of file igbvf_vf.h.

◆ E1000_ADVTXD_DCMD_DEXT

#define E1000_ADVTXD_DCMD_DEXT   0x20000000 /* Descriptor extension (1=Adv) */

Definition at line 148 of file igbvf_vf.h.

◆ E1000_ADVTXD_DCMD_VLE

#define E1000_ADVTXD_DCMD_VLE   0x40000000 /* VLAN pkt enable */

Definition at line 149 of file igbvf_vf.h.

◆ E1000_ADVTXD_DCMD_TSE

#define E1000_ADVTXD_DCMD_TSE   0x80000000 /* TCP Seg enable */

Definition at line 150 of file igbvf_vf.h.

◆ E1000_ADVTXD_PAYLEN_SHIFT

#define E1000_ADVTXD_PAYLEN_SHIFT   14 /* Adv desc PAYLEN shift */

Definition at line 151 of file igbvf_vf.h.

◆ E1000_ADVTXD_MACLEN_SHIFT

#define E1000_ADVTXD_MACLEN_SHIFT   9 /* Adv ctxt desc mac len shift */

Definition at line 161 of file igbvf_vf.h.

◆ E1000_ADVTXD_TUCMD_IPV4

#define E1000_ADVTXD_TUCMD_IPV4   0x00000400 /* IP Packet Type: 1=IPv4 */

Definition at line 162 of file igbvf_vf.h.

◆ E1000_ADVTXD_TUCMD_L4T_TCP

#define E1000_ADVTXD_TUCMD_L4T_TCP   0x00000800 /* L4 Packet TYPE of TCP */

Definition at line 163 of file igbvf_vf.h.

◆ E1000_ADVTXD_L4LEN_SHIFT

#define E1000_ADVTXD_L4LEN_SHIFT   8 /* Adv ctxt L4LEN shift */

Definition at line 164 of file igbvf_vf.h.

◆ E1000_ADVTXD_MSS_SHIFT

#define E1000_ADVTXD_MSS_SHIFT   16 /* Adv ctxt MSS shift */

Definition at line 165 of file igbvf_vf.h.

Enumeration Type Documentation

◆ e1000_mac_type

Enumerator
e1000_undefined 
e1000_vfadapt 
e1000_num_macs 

Definition at line 167 of file igbvf_vf.h.

167  {
168  e1000_undefined = 0,
170  e1000_num_macs /* List is 1-based, so subtract 1 for true count. */
171 };

◆ e1000_bus_type

Enumerator
e1000_bus_type_unknown 
e1000_bus_type_pci 
e1000_bus_type_pcix 
e1000_bus_type_pci_express 
e1000_bus_type_reserved 

Definition at line 237 of file igbvf_vf.h.

◆ e1000_bus_speed

Enumerator
e1000_bus_speed_unknown 
e1000_bus_speed_33 
e1000_bus_speed_66 
e1000_bus_speed_100 
e1000_bus_speed_120 
e1000_bus_speed_133 
e1000_bus_speed_2500 
e1000_bus_speed_5000 
e1000_bus_speed_reserved 

Definition at line 245 of file igbvf_vf.h.

◆ e1000_bus_width

Enumerator
e1000_bus_width_unknown 
e1000_bus_width_pcie_x1 
e1000_bus_width_pcie_x2 
e1000_bus_width_pcie_x4 
e1000_bus_width_pcie_x8 
e1000_bus_width_32 
e1000_bus_width_64 
e1000_bus_width_reserved 

Definition at line 257 of file igbvf_vf.h.

◆ e1000_promisc_type

Enumerator
e1000_promisc_disabled 
e1000_promisc_unicast 
e1000_promisc_multicast 
e1000_promisc_enabled 
e1000_num_promisc_types 

Definition at line 333 of file igbvf_vf.h.

333  {
334  e1000_promisc_disabled = 0, /* all promisc modes disabled */
335  e1000_promisc_unicast = 1, /* unicast promiscuous enabled */
336  e1000_promisc_multicast = 2, /* multicast promiscuous enabled */
337  e1000_promisc_enabled = 3, /* both uni and multicast promisc */
339 };

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_ONLY  )

◆ igbvf_read_pcie_cap_reg()

s32 igbvf_read_pcie_cap_reg ( struct e1000_hw hw,
u32  reg,
u16 value 
)

◆ igbvf_vfta_set_vf()

void igbvf_vfta_set_vf ( struct e1000_hw ,
u16  ,
bool   
)

igbvf_vfta_set_vf - Set/Unset vlan filter table address @hw: pointer to the HW structure @vid: determines the vfta register and bit to set/unset @set: if true then set bit, else clear bit

Definition at line 313 of file igbvf_vf.c.

314 {
315  struct e1000_mbx_info *mbx = &hw->mbx;
316  u32 msgbuf[2];
317 
318  msgbuf[0] = E1000_VF_SET_VLAN;
319  msgbuf[1] = vid;
320  /* Setting the 8 bit field MSG INFO to TRUE indicates "add" */
321  if (set)
322  msgbuf[0] |= E1000_VF_SET_VLAN_ADD;
323 
324  mbx->ops.write_posted(hw, msgbuf, 2, 0);
325 }
Definition: hw.c:16
struct e1000_mbx_operations ops
Definition: igbvf_vf.h:298
#define E1000_VF_SET_VLAN
Definition: igbvf_mbx.h:72
static fd_set * set
Definition: posix_io.h:48
s32(* write_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition: igbvf_vf.h:282
uint32_t u32
Definition: stdint.h:23
#define E1000_VF_SET_VLAN_ADD
Definition: igbvf_mbx.h:73

References E1000_VF_SET_VLAN, E1000_VF_SET_VLAN_ADD, e1000_mbx_info::ops, set, and e1000_mbx_operations::write_posted.

◆ igbvf_rlpml_set_vf()

void igbvf_rlpml_set_vf ( struct e1000_hw ,
u16   
)

igbvf_rlpml_set_vf - Set the maximum receive packet length @hw: pointer to the HW structure @max_size: value to assign to max frame size

Definition at line 331 of file igbvf_vf.c.

332 {
333  struct e1000_mbx_info *mbx = &hw->mbx;
334  u32 msgbuf[2];
335 
336  msgbuf[0] = E1000_VF_SET_LPE;
337  msgbuf[1] = max_size;
338 
339  mbx->ops.write_posted(hw, msgbuf, 2, 0);
340 }
Definition: hw.c:16
struct e1000_mbx_operations ops
Definition: igbvf_vf.h:298
#define E1000_VF_SET_LPE
Definition: igbvf_mbx.h:74
s32(* write_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition: igbvf_vf.h:282
uint32_t u32
Definition: stdint.h:23

References E1000_VF_SET_LPE, e1000_mbx_info::ops, and e1000_mbx_operations::write_posted.

Referenced by igbvf_configure_rx().

◆ igbvf_promisc_set_vf()

s32 igbvf_promisc_set_vf ( struct e1000_hw ,
enum  e1000_promisc_type 
)

igbvf_promisc_set_vf - Set flags for Unicast or Multicast promisc @hw: pointer to the HW structure @uni: boolean indicating unicast promisc status @multi: boolean indicating multicast promisc status

Definition at line 348 of file igbvf_vf.c.

349 {
350  struct e1000_mbx_info *mbx = &hw->mbx;
351  u32 msgbuf = E1000_VF_SET_PROMISC;
352  s32 ret_val;
353 
354  switch (type) {
357  break;
360  /* Fall through */
364  break;
365  default:
366  return -E1000_ERR_MAC_INIT;
367  }
368 
369  ret_val = mbx->ops.write_posted(hw, &msgbuf, 1, 0);
370 
371  if (!ret_val)
372  ret_val = mbx->ops.read_posted(hw, &msgbuf, 1, 0);
373 
374  if (!ret_val && !(msgbuf & E1000_VT_MSGTYPE_ACK))
375  ret_val = -E1000_ERR_MAC_INIT;
376 
377  return ret_val;
378 }
#define E1000_VF_SET_PROMISC
Definition: igbvf_mbx.h:75
s32(* read_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition: igbvf_vf.h:281
int32_t s32
Definition: stdint.h:22
uint8_t type
Type.
Definition: ena.h:16
Definition: hw.c:16
struct e1000_mbx_operations ops
Definition: igbvf_vf.h:298
#define E1000_VT_MSGTYPE_ACK
Definition: igbvf_mbx.h:57
#define E1000_VF_SET_PROMISC_UNICAST
Definition: igbvf_mbx.h:76
#define E1000_VF_SET_PROMISC_MULTICAST
Definition: igbvf_mbx.h:77
s32(* write_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition: igbvf_vf.h:282
uint32_t u32
Definition: stdint.h:23
#define E1000_ERR_MAC_INIT

References E1000_ERR_MAC_INIT, e1000_promisc_disabled, e1000_promisc_enabled, e1000_promisc_multicast, e1000_promisc_unicast, E1000_VF_SET_PROMISC, E1000_VF_SET_PROMISC_MULTICAST, E1000_VF_SET_PROMISC_UNICAST, E1000_VT_MSGTYPE_ACK, e1000_mbx_info::ops, e1000_mbx_operations::read_posted, type, and e1000_mbx_operations::write_posted.