iPXE
igbvf_vf.h
Go to the documentation of this file.
1/*******************************************************************************
2
3 Intel(R) 82576 Virtual Function Linux driver
4 Copyright(c) 1999 - 2008 Intel Corporation.
5
6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License,
8 version 2, as published by the Free Software Foundation.
9
10 This program is distributed in the hope it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 more details.
14
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18
19 The full GNU General Public License is included in this distribution in
20 the file called "COPYING".
21
22 Contact Information:
23 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28
29FILE_LICENCE ( GPL2_ONLY );
30
31#ifndef _IGBVF_VF_H_
32#define _IGBVF_VF_H_
33
34#include <stddef.h>
35#include <stdint.h>
36#include <stdlib.h>
37#include <stdio.h>
38#include <string.h>
39#include <unistd.h>
40#include <byteswap.h>
41#include <errno.h>
42#include <ipxe/pci.h>
43#include <ipxe/malloc.h>
44#include <ipxe/if_ether.h>
45#include <ipxe/io.h>
46#include <ipxe/ethernet.h>
47#include <ipxe/iobuf.h>
48#include <ipxe/netdevice.h>
49
50#include "igbvf_osdep.h"
51#include "igbvf_regs.h"
52#include "igbvf_defines.h"
53
54struct e1000_hw;
55
56#define E1000_DEV_ID_82576_VF 0x10CA
57#define E1000_DEV_ID_I350_VF 0x1520
58
59#define E1000_VF_INIT_TIMEOUT 200 /* Number of retries to clear RSTI */
60
61/* Additional Descriptor Control definitions */
62#define E1000_TXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Tx Queue */
63#define E1000_RXDCTL_QUEUE_ENABLE 0x02000000 /* Enable specific Rx Queue */
64
65/* SRRCTL bit definitions */
66#define E1000_SRRCTL_BSIZEPKT_SHIFT 10 /* Shift _right_ */
67#define E1000_SRRCTL_BSIZEHDRSIZE_MASK 0x00000F00
68#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT 2 /* Shift _left_ */
69#define E1000_SRRCTL_DESCTYPE_LEGACY 0x00000000
70#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF 0x02000000
71#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT 0x04000000
72#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS 0x0A000000
73#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION 0x06000000
74#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION_LARGE_PKT 0x08000000
75#define E1000_SRRCTL_DESCTYPE_MASK 0x0E000000
76#define E1000_SRRCTL_DROP_EN 0x80000000
77
78#define E1000_SRRCTL_BSIZEPKT_MASK 0x0000007F
79#define E1000_SRRCTL_BSIZEHDR_MASK 0x00003F00
80
81/* Interrupt Defines */
82#define E1000_EICR 0x01580 /* Ext. Interrupt Cause Read - R/clr */
83#define E1000_EITR(_n) (0x01680 + ((_n) << 2))
84#define E1000_EICS 0x01520 /* Ext. Interrupt Cause Set - W0 */
85#define E1000_EIMS 0x01524 /* Ext. Interrupt Mask Set/Read - RW */
86#define E1000_EIMC 0x01528 /* Ext. Interrupt Mask Clear - WO */
87#define E1000_EIAC 0x0152C /* Ext. Interrupt Auto Clear - RW */
88#define E1000_EIAM 0x01530 /* Ext. Interrupt Ack Auto Clear Mask - RW */
89#define E1000_IVAR0 0x01700 /* Interrupt Vector Allocation (array) - RW */
90#define E1000_IVAR_MISC 0x01740 /* IVAR for "other" causes - RW */
91#define E1000_IVAR_VALID 0x80
92
93/* Receive Descriptor - Advanced */
95 struct {
96 u64 pkt_addr; /* Packet buffer address */
97 u64 hdr_addr; /* Header buffer address */
99 struct {
100 struct {
101 union {
103 struct {
104 u16 pkt_info; /* RSS type, Packet type */
105 u16 hdr_info; /* Split Header,
106 * header buffer length */
109 union {
110 u32 rss; /* RSS Hash */
111 struct {
112 u16 ip_id; /* IP id */
113 u16 csum; /* Packet Checksum */
117 struct {
118 u32 status_error; /* ext status/error */
119 u16 length; /* Packet length */
120 u16 vlan; /* VLAN tag */
122 } wb; /* writeback */
123};
124
125#define E1000_RXDADV_HDRBUFLEN_MASK 0x7FE0
126#define E1000_RXDADV_HDRBUFLEN_SHIFT 5
127
128/* Transmit Descriptor - Advanced */
130 struct {
131 u64 buffer_addr; /* Address of descriptor's data buf */
135 struct {
136 u64 rsvd; /* Reserved */
139 } wb;
140};
141
142/* Adv Transmit Descriptor Config Masks */
143#define E1000_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Descriptor */
144#define E1000_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */
145#define E1000_ADVTXD_DCMD_EOP 0x01000000 /* End of Packet */
146#define E1000_ADVTXD_DCMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */
147#define E1000_ADVTXD_DCMD_RS 0x08000000 /* Report Status */
148#define E1000_ADVTXD_DCMD_DEXT 0x20000000 /* Descriptor extension (1=Adv) */
149#define E1000_ADVTXD_DCMD_VLE 0x40000000 /* VLAN pkt enable */
150#define E1000_ADVTXD_DCMD_TSE 0x80000000 /* TCP Seg enable */
151#define E1000_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */
152
153/* Context descriptors */
160
161#define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */
162#define E1000_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */
163#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */
164#define E1000_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */
165#define E1000_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */
166
170 e1000_num_macs /* List is 1-based, so subtract 1 for true count. */
171};
172
204
205#include "igbvf_mbx.h"
206
208 /* Function pointers for the MAC. */
211 void (*clear_vfta)(struct e1000_hw *);
213 s32 (*get_link_up_info)(struct e1000_hw *, u16 *, u16 *);
214 void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32);
215 s32 (*reset_hw)(struct e1000_hw *);
216 s32 (*init_hw)(struct e1000_hw *);
217 s32 (*setup_link)(struct e1000_hw *);
218 void (*write_vfta)(struct e1000_hw *, u32, u32);
219 void (*mta_set)(struct e1000_hw *, u32);
220 void (*rar_set)(struct e1000_hw *, u8*, u32);
222};
223
236
244
256
267
276
279 s32 (*read)(struct e1000_hw *, u32 *, u16, u16);
280 s32 (*write)(struct e1000_hw *, u32 *, u16, u16);
281 s32 (*read_posted)(struct e1000_hw *, u32 *, u16, u16);
282 s32 (*write_posted)(struct e1000_hw *, u32 *, u16, u16);
286};
287
296
304
309
332
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};
340
341/* These functions must be implemented by drivers */
343void igbvf_vfta_set_vf(struct e1000_hw *, u16, bool);
344void igbvf_rlpml_set_vf(struct e1000_hw *, u16);
346#endif /* _IGBVF_VF_H_ */
pseudo_bit_t value[0x00020]
Definition arbel.h:2
Error codes.
Ethernet protocol.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define u8
Definition igbvf_osdep.h:40
#define __iomem
Definition igbvf_osdep.h:46
e1000_promisc_type
Definition igbvf_vf.h:333
@ e1000_promisc_enabled
Definition igbvf_vf.h:337
@ e1000_promisc_unicast
Definition igbvf_vf.h:335
@ e1000_promisc_disabled
Definition igbvf_vf.h:334
@ e1000_num_promisc_types
Definition igbvf_vf.h:338
@ e1000_promisc_multicast
Definition igbvf_vf.h:336
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 @u...
Definition igbvf_vf.c:348
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...
Definition igbvf_vf.c:331
e1000_bus_width
Definition igbvf_vf.h:257
@ e1000_bus_width_64
Definition igbvf_vf.h:264
@ e1000_bus_width_pcie_x1
Definition igbvf_vf.h:259
@ e1000_bus_width_32
Definition igbvf_vf.h:263
@ e1000_bus_width_pcie_x8
Definition igbvf_vf.h:262
@ e1000_bus_width_pcie_x2
Definition igbvf_vf.h:260
@ e1000_bus_width_unknown
Definition igbvf_vf.h:258
@ e1000_bus_width_reserved
Definition igbvf_vf.h:265
@ e1000_bus_width_pcie_x4
Definition igbvf_vf.h:261
e1000_bus_type
Definition igbvf_vf.h:237
@ e1000_bus_type_reserved
Definition igbvf_vf.h:242
@ e1000_bus_type_pci
Definition igbvf_vf.h:239
@ e1000_bus_type_pcix
Definition igbvf_vf.h:240
@ e1000_bus_type_unknown
Definition igbvf_vf.h:238
@ e1000_bus_type_pci_express
Definition igbvf_vf.h:241
s32 igbvf_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
e1000_bus_speed
Definition igbvf_vf.h:245
@ e1000_bus_speed_5000
Definition igbvf_vf.h:253
@ e1000_bus_speed_reserved
Definition igbvf_vf.h:254
@ e1000_bus_speed_100
Definition igbvf_vf.h:249
@ e1000_bus_speed_120
Definition igbvf_vf.h:250
@ e1000_bus_speed_66
Definition igbvf_vf.h:248
@ e1000_bus_speed_unknown
Definition igbvf_vf.h:246
@ e1000_bus_speed_133
Definition igbvf_vf.h:251
@ e1000_bus_speed_2500
Definition igbvf_vf.h:252
@ e1000_bus_speed_33
Definition igbvf_vf.h:247
e1000_mac_type
Definition igbvf_vf.h:167
@ e1000_num_macs
Definition igbvf_vf.h:170
@ e1000_undefined
Definition igbvf_vf.h:168
@ e1000_vfadapt
Definition igbvf_vf.h:169
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: determ...
Definition igbvf_vf.c:313
iPXE I/O API
uint64_t u64
Definition stdint.h:26
int32_t s32
Definition stdint.h:23
String functions.
I/O buffers.
Dynamic memory allocation.
static unsigned int unsigned int reg
Definition myson.h:162
Network device management.
struct option_descriptor read[1]
Definition nvo_cmd.c:116
PCI bus.
enum e1000_bus_speed speed
Definition igbvf_vf.h:270
enum e1000_bus_type type
Definition igbvf_vf.h:269
enum e1000_bus_width width
Definition igbvf_vf.h:271
u16 vendor_id
Definition igbvf_vf.h:328
void * back
Definition igbvf_vf.h:311
u16 subsystem_device_id
Definition igbvf_vf.h:327
u8 __iomem * flash_address
Definition igbvf_vf.h:314
struct e1000_bus_info bus
Definition igbvf_vf.h:318
u16 subsystem_vendor_id
Definition igbvf_vf.h:326
struct e1000_mac_info mac
Definition igbvf_vf.h:317
union e1000_hw::@233333027026034357014134043306254104203243265040 dev_spec
u8 __iomem * hw_addr
Definition igbvf_vf.h:313
unsigned long io_base
Definition igbvf_vf.h:315
struct e1000_mbx_info mbx
Definition igbvf_vf.h:319
u8 revision_id
Definition igbvf_vf.h:330
u16 device_id
Definition igbvf_vf.h:325
struct e1000_dev_spec_vf vf
Definition igbvf_vf.h:322
u8 perm_addr[6]
Definition igbvf_vf.h:227
enum e1000_mac_type type
Definition igbvf_vf.h:229
bool get_link_status
Definition igbvf_vf.h:234
u16 rar_entry_count
Definition igbvf_vf.h:232
struct e1000_mac_operations ops
Definition igbvf_vf.h:225
void(* mta_set)(struct e1000_hw *, u32)
Definition igbvf_vf.h:219
void(* clear_vfta)(struct e1000_hw *)
Definition igbvf_vf.h:211
s32(* check_for_link)(struct e1000_hw *)
Definition igbvf_vf.h:210
s32(* read_mac_addr)(struct e1000_hw *)
Definition igbvf_vf.h:221
s32(* get_bus_info)(struct e1000_hw *)
Definition igbvf_vf.h:212
void(* update_mc_addr_list)(struct e1000_hw *, u8 *, u32)
Definition igbvf_vf.h:214
s32(* init_params)(struct e1000_hw *)
Definition igbvf_vf.h:209
void(* write_vfta)(struct e1000_hw *, u32, u32)
Definition igbvf_vf.h:218
s32(* reset_hw)(struct e1000_hw *)
Definition igbvf_vf.h:215
s32(* setup_link)(struct e1000_hw *)
Definition igbvf_vf.h:217
void(* rar_set)(struct e1000_hw *, u8 *, u32)
Definition igbvf_vf.h:220
s32(* init_hw)(struct e1000_hw *)
Definition igbvf_vf.h:216
s32(* get_link_up_info)(struct e1000_hw *, u16 *, u16 *)
Definition igbvf_vf.h:213
struct e1000_mbx_stats stats
Definition igbvf_vf.h:299
struct e1000_mbx_operations ops
Definition igbvf_vf.h:298
s32(* write)(struct e1000_hw *, u32 *, u16, u16)
Definition igbvf_vf.h:280
s32(* read_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition igbvf_vf.h:281
s32(* check_for_rst)(struct e1000_hw *, u16)
Definition igbvf_vf.h:285
s32(* init_params)(struct e1000_hw *hw)
Definition igbvf_vf.h:278
s32(* read)(struct e1000_hw *, u32 *, u16, u16)
Definition igbvf_vf.h:279
s32(* check_for_ack)(struct e1000_hw *, u16)
Definition igbvf_vf.h:284
s32(* check_for_msg)(struct e1000_hw *, u16)
Definition igbvf_vf.h:283
s32(* write_posted)(struct e1000_hw *, u32 *, u16, u16)
Definition igbvf_vf.h:282
Definition hw.c:16
struct e1000_adv_rx_desc::@324104077243240211364137173065054016027147265141::@017077222216023375356177101263162117066206113035::@017144142334376246243167211160216300013023264315::@342101011063322373037265373365134061074123164235 csum_ip
struct e1000_adv_rx_desc::@324104077243240211364137173065054016027147265141::@017077222216023375356177101263162117066206113035::@203116207205233330000177172372135142250117225022::@300122332072314246117154107234004167330037324067 hs_rss
struct e1000_adv_rx_desc::@324104077243240211364137173065054016027147265141::@071135136066236263262155133326122220255171234376 upper
struct e1000_adv_rx_desc::@324104077243240211364137173065054016027147265141::@017077222216023375356177101263162117066206113035 lower
struct e1000_adv_rx_desc::@324104077243240211364137173065054016027147265141 wb
union e1000_adv_rx_desc::@324104077243240211364137173065054016027147265141::@017077222216023375356177101263162117066206113035::@203116207205233330000177172372135142250117225022 lo_dword
union e1000_adv_rx_desc::@324104077243240211364137173065054016027147265141::@017077222216023375356177101263162117066206113035::@017144142334376246243167211160216300013023264315 hi_dword
struct e1000_adv_tx_desc::@341340065042306374070130041365162125260313270241 wb
#define u16
Definition vga.h:20
#define u32
Definition vga.h:21