e1000_82575.h revision 218530
1176667Sjfv/******************************************************************************
2176667Sjfv
3203049Sjfv  Copyright (c) 2001-2010, Intel Corporation
4176667Sjfv  All rights reserved.
5176667Sjfv
6176667Sjfv  Redistribution and use in source and binary forms, with or without
7176667Sjfv  modification, are permitted provided that the following conditions are met:
8176667Sjfv
9176667Sjfv   1. Redistributions of source code must retain the above copyright notice,
10176667Sjfv      this list of conditions and the following disclaimer.
11176667Sjfv
12176667Sjfv   2. Redistributions in binary form must reproduce the above copyright
13176667Sjfv      notice, this list of conditions and the following disclaimer in the
14176667Sjfv      documentation and/or other materials provided with the distribution.
15176667Sjfv
16176667Sjfv   3. Neither the name of the Intel Corporation nor the names of its
17176667Sjfv      contributors may be used to endorse or promote products derived from
18176667Sjfv      this software without specific prior written permission.
19176667Sjfv
20176667Sjfv  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21176667Sjfv  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22176667Sjfv  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23176667Sjfv  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24176667Sjfv  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25176667Sjfv  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26176667Sjfv  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27176667Sjfv  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28176667Sjfv  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29176667Sjfv  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30176667Sjfv  POSSIBILITY OF SUCH DAMAGE.
31176667Sjfv
32176667Sjfv******************************************************************************/
33176667Sjfv/*$FreeBSD: head/sys/dev/e1000/e1000_82575.h 218530 2011-02-11 01:00:26Z jfv $*/
34176667Sjfv
35176667Sjfv#ifndef _E1000_82575_H_
36176667Sjfv#define _E1000_82575_H_
37176667Sjfv
38181027Sjfv#define ID_LED_DEFAULT_82575_SERDES ((ID_LED_DEF1_DEF2 << 12) | \
39181027Sjfv                                     (ID_LED_DEF1_DEF2 <<  8) | \
40181027Sjfv                                     (ID_LED_DEF1_DEF2 <<  4) | \
41181027Sjfv                                     (ID_LED_OFF1_ON2))
42176667Sjfv/*
43176667Sjfv * Receive Address Register Count
44176667Sjfv * Number of high/low register pairs in the RAR.  The RAR (Receive Address
45176667Sjfv * Registers) holds the directed and multicast addresses that we monitor.
46176667Sjfv * These entries are also used for MAC-based filtering.
47176667Sjfv */
48181027Sjfv/*
49181027Sjfv * For 82576, there are an additional set of RARs that begin at an offset
50181027Sjfv * separate from the first set of RARs.
51181027Sjfv */
52205869Sjfv#define E1000_RAR_ENTRIES_82575        16
53205869Sjfv#define E1000_RAR_ENTRIES_82576        24
54200243Sjfv#define E1000_RAR_ENTRIES_82580        24
55218530Sjfv#define E1000_RAR_ENTRIES_I350         32
56200243Sjfv#define E1000_SW_SYNCH_MB              0x00000100
57200243Sjfv#define E1000_STAT_DEV_RST_SET         0x00100000
58200243Sjfv#define E1000_CTRL_DEV_RST             0x20000000
59176667Sjfv
60176667Sjfv#ifdef E1000_BIT_FIELDS
61176667Sjfvstruct e1000_adv_data_desc {
62200243Sjfv	__le64 buffer_addr;    /* Address of the descriptor's data buffer */
63176667Sjfv	union {
64176667Sjfv		u32 data;
65176667Sjfv		struct {
66176667Sjfv			u32 datalen :16; /* Data buffer length */
67176667Sjfv			u32 rsvd    :4;
68176667Sjfv			u32 dtyp    :4;  /* Descriptor type */
69176667Sjfv			u32 dcmd    :8;  /* Descriptor command */
70176667Sjfv		} config;
71176667Sjfv	} lower;
72176667Sjfv	union {
73176667Sjfv		u32 data;
74176667Sjfv		struct {
75176667Sjfv			u32 status  :4;  /* Descriptor status */
76176667Sjfv			u32 idx     :4;
77176667Sjfv			u32 popts   :6;  /* Packet Options */
78176667Sjfv			u32 paylen  :18; /* Payload length */
79176667Sjfv		} options;
80176667Sjfv	} upper;
81176667Sjfv};
82176667Sjfv
83176667Sjfv#define E1000_TXD_DTYP_ADV_C    0x2  /* Advanced Context Descriptor */
84176667Sjfv#define E1000_TXD_DTYP_ADV_D    0x3  /* Advanced Data Descriptor */
85176667Sjfv#define E1000_ADV_TXD_CMD_DEXT  0x20 /* Descriptor extension (0 = legacy) */
86176667Sjfv#define E1000_ADV_TUCMD_IPV4    0x2  /* IP Packet Type: 1=IPv4 */
87176667Sjfv#define E1000_ADV_TUCMD_IPV6    0x0  /* IP Packet Type: 0=IPv6 */
88176667Sjfv#define E1000_ADV_TUCMD_L4T_UDP 0x0  /* L4 Packet TYPE of UDP */
89176667Sjfv#define E1000_ADV_TUCMD_L4T_TCP 0x4  /* L4 Packet TYPE of TCP */
90176667Sjfv#define E1000_ADV_TUCMD_MKRREQ  0x10 /* Indicates markers are required */
91176667Sjfv#define E1000_ADV_DCMD_EOP      0x1  /* End of Packet */
92176667Sjfv#define E1000_ADV_DCMD_IFCS     0x2  /* Insert FCS (Ethernet CRC) */
93176667Sjfv#define E1000_ADV_DCMD_RS       0x8  /* Report Status */
94176667Sjfv#define E1000_ADV_DCMD_VLE      0x40 /* Add VLAN tag */
95176667Sjfv#define E1000_ADV_DCMD_TSE      0x80 /* TCP Seg enable */
96176667Sjfv/* Extended Device Control */
97176667Sjfv#define E1000_CTRL_EXT_NSICR    0x00000001 /* Disable Intr Clear all on read */
98176667Sjfv
99176667Sjfvstruct e1000_adv_context_desc {
100176667Sjfv	union {
101176667Sjfv		u32 ip_config;
102176667Sjfv		struct {
103176667Sjfv			u32 iplen    :9;
104176667Sjfv			u32 maclen   :7;
105176667Sjfv			u32 vlan_tag :16;
106176667Sjfv		} fields;
107176667Sjfv	} ip_setup;
108176667Sjfv	u32 seq_num;
109176667Sjfv	union {
110176667Sjfv		u64 l4_config;
111176667Sjfv		struct {
112176667Sjfv			u32 mkrloc :9;
113176667Sjfv			u32 tucmd  :11;
114176667Sjfv			u32 dtyp   :4;
115176667Sjfv			u32 adv    :8;
116176667Sjfv			u32 rsvd   :4;
117176667Sjfv			u32 idx    :4;
118176667Sjfv			u32 l4len  :8;
119176667Sjfv			u32 mss    :16;
120176667Sjfv		} fields;
121176667Sjfv	} l4_setup;
122176667Sjfv};
123176667Sjfv#endif
124176667Sjfv
125176667Sjfv/* SRRCTL bit definitions */
126176667Sjfv#define E1000_SRRCTL_BSIZEPKT_SHIFT                     10 /* Shift _right_ */
127176667Sjfv#define E1000_SRRCTL_BSIZEHDRSIZE_MASK                  0x00000F00
128176667Sjfv#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT                 2  /* Shift _left_ */
129176667Sjfv#define E1000_SRRCTL_DESCTYPE_LEGACY                    0x00000000
130176667Sjfv#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF                0x02000000
131176667Sjfv#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT                 0x04000000
132176667Sjfv#define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS          0x0A000000
133176667Sjfv#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION           0x06000000
134176667Sjfv#define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION_LARGE_PKT 0x08000000
135176667Sjfv#define E1000_SRRCTL_DESCTYPE_MASK                      0x0E000000
136200243Sjfv#define E1000_SRRCTL_TIMESTAMP                          0x40000000
137190872Sjfv#define E1000_SRRCTL_DROP_EN                            0x80000000
138176667Sjfv
139176667Sjfv#define E1000_SRRCTL_BSIZEPKT_MASK      0x0000007F
140176667Sjfv#define E1000_SRRCTL_BSIZEHDR_MASK      0x00003F00
141176667Sjfv
142176667Sjfv#define E1000_TX_HEAD_WB_ENABLE   0x1
143176667Sjfv#define E1000_TX_SEQNUM_WB_ENABLE 0x2
144176667Sjfv
145176667Sjfv#define E1000_MRQC_ENABLE_RSS_4Q            0x00000002
146181027Sjfv#define E1000_MRQC_ENABLE_VMDQ              0x00000003
147190872Sjfv#define E1000_MRQC_ENABLE_VMDQ_RSS_2Q       0x00000005
148176667Sjfv#define E1000_MRQC_RSS_FIELD_IPV4_UDP       0x00400000
149176667Sjfv#define E1000_MRQC_RSS_FIELD_IPV6_UDP       0x00800000
150176667Sjfv#define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX    0x01000000
151200243Sjfv#define E1000_MRQC_ENABLE_RSS_8Q            0x00000002
152176667Sjfv
153181027Sjfv#define E1000_VMRCTL_MIRROR_PORT_SHIFT      8
154181027Sjfv#define E1000_VMRCTL_MIRROR_DSTPORT_MASK    (7 << E1000_VMRCTL_MIRROR_PORT_SHIFT)
155181027Sjfv#define E1000_VMRCTL_POOL_MIRROR_ENABLE     (1 << 0)
156181027Sjfv#define E1000_VMRCTL_UPLINK_MIRROR_ENABLE   (1 << 1)
157181027Sjfv#define E1000_VMRCTL_DOWNLINK_MIRROR_ENABLE (1 << 2)
158181027Sjfv
159176667Sjfv#define E1000_EICR_TX_QUEUE ( \
160176667Sjfv    E1000_EICR_TX_QUEUE0 |    \
161176667Sjfv    E1000_EICR_TX_QUEUE1 |    \
162176667Sjfv    E1000_EICR_TX_QUEUE2 |    \
163176667Sjfv    E1000_EICR_TX_QUEUE3)
164176667Sjfv
165176667Sjfv#define E1000_EICR_RX_QUEUE ( \
166176667Sjfv    E1000_EICR_RX_QUEUE0 |    \
167176667Sjfv    E1000_EICR_RX_QUEUE1 |    \
168176667Sjfv    E1000_EICR_RX_QUEUE2 |    \
169176667Sjfv    E1000_EICR_RX_QUEUE3)
170176667Sjfv
171176667Sjfv#define E1000_EIMS_RX_QUEUE E1000_EICR_RX_QUEUE
172176667Sjfv#define E1000_EIMS_TX_QUEUE E1000_EICR_TX_QUEUE
173176667Sjfv
174176667Sjfv#define EIMS_ENABLE_MASK ( \
175176667Sjfv    E1000_EIMS_RX_QUEUE  | \
176176667Sjfv    E1000_EIMS_TX_QUEUE  | \
177176667Sjfv    E1000_EIMS_TCP_TIMER | \
178176667Sjfv    E1000_EIMS_OTHER)
179176667Sjfv
180176667Sjfv/* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */
181176667Sjfv#define E1000_IMIR_PORT_IM_EN     0x00010000  /* TCP port enable */
182176667Sjfv#define E1000_IMIR_PORT_BP        0x00020000  /* TCP port check bypass */
183176667Sjfv#define E1000_IMIREXT_SIZE_BP     0x00001000  /* Packet size bypass */
184176667Sjfv#define E1000_IMIREXT_CTRL_URG    0x00002000  /* Check URG bit in header */
185176667Sjfv#define E1000_IMIREXT_CTRL_ACK    0x00004000  /* Check ACK bit in header */
186176667Sjfv#define E1000_IMIREXT_CTRL_PSH    0x00008000  /* Check PSH bit in header */
187176667Sjfv#define E1000_IMIREXT_CTRL_RST    0x00010000  /* Check RST bit in header */
188176667Sjfv#define E1000_IMIREXT_CTRL_SYN    0x00020000  /* Check SYN bit in header */
189176667Sjfv#define E1000_IMIREXT_CTRL_FIN    0x00040000  /* Check FIN bit in header */
190176667Sjfv#define E1000_IMIREXT_CTRL_BP     0x00080000  /* Bypass check of ctrl bits */
191176667Sjfv
192176667Sjfv/* Receive Descriptor - Advanced */
193176667Sjfvunion e1000_adv_rx_desc {
194176667Sjfv	struct {
195200243Sjfv		__le64 pkt_addr;             /* Packet buffer address */
196200243Sjfv		__le64 hdr_addr;             /* Header buffer address */
197176667Sjfv	} read;
198176667Sjfv	struct {
199176667Sjfv		struct {
200176667Sjfv			union {
201200243Sjfv				__le32 data;
202176667Sjfv				struct {
203200243Sjfv					__le16 pkt_info; /*RSS type, Pkt type*/
204218530Sjfv					/* Split Header, header buffer len */
205218530Sjfv					__le16 hdr_info;
206176667Sjfv				} hs_rss;
207176667Sjfv			} lo_dword;
208176667Sjfv			union {
209200243Sjfv				__le32 rss;          /* RSS Hash */
210176667Sjfv				struct {
211200243Sjfv					__le16 ip_id;    /* IP id */
212200243Sjfv					__le16 csum;     /* Packet Checksum */
213176667Sjfv				} csum_ip;
214176667Sjfv			} hi_dword;
215176667Sjfv		} lower;
216176667Sjfv		struct {
217200243Sjfv			__le32 status_error;     /* ext status/error */
218200243Sjfv			__le16 length;           /* Packet length */
219200243Sjfv			__le16 vlan;             /* VLAN tag */
220176667Sjfv		} upper;
221176667Sjfv	} wb;  /* writeback */
222176667Sjfv};
223176667Sjfv
224194865Sjfv#define E1000_RXDADV_RSSTYPE_MASK        0x0000000F
225176667Sjfv#define E1000_RXDADV_RSSTYPE_SHIFT       12
226176667Sjfv#define E1000_RXDADV_HDRBUFLEN_MASK      0x7FE0
227176667Sjfv#define E1000_RXDADV_HDRBUFLEN_SHIFT     5
228176667Sjfv#define E1000_RXDADV_SPLITHEADER_EN      0x00001000
229176667Sjfv#define E1000_RXDADV_SPH                 0x8000
230200243Sjfv#define E1000_RXDADV_STAT_TS             0x10000 /* Pkt was time stamped */
231200243Sjfv#define E1000_RXDADV_STAT_TSIP           0x08000 /* timestamp in packet */
232181027Sjfv#define E1000_RXDADV_ERR_HBO             0x00800000
233176667Sjfv
234176667Sjfv/* RSS Hash results */
235176667Sjfv#define E1000_RXDADV_RSSTYPE_NONE        0x00000000
236176667Sjfv#define E1000_RXDADV_RSSTYPE_IPV4_TCP    0x00000001
237176667Sjfv#define E1000_RXDADV_RSSTYPE_IPV4        0x00000002
238176667Sjfv#define E1000_RXDADV_RSSTYPE_IPV6_TCP    0x00000003
239176667Sjfv#define E1000_RXDADV_RSSTYPE_IPV6_EX     0x00000004
240176667Sjfv#define E1000_RXDADV_RSSTYPE_IPV6        0x00000005
241176667Sjfv#define E1000_RXDADV_RSSTYPE_IPV6_TCP_EX 0x00000006
242176667Sjfv#define E1000_RXDADV_RSSTYPE_IPV4_UDP    0x00000007
243176667Sjfv#define E1000_RXDADV_RSSTYPE_IPV6_UDP    0x00000008
244176667Sjfv#define E1000_RXDADV_RSSTYPE_IPV6_UDP_EX 0x00000009
245176667Sjfv
246176667Sjfv/* RSS Packet Types as indicated in the receive descriptor */
247176667Sjfv#define E1000_RXDADV_PKTTYPE_NONE        0x00000000
248176667Sjfv#define E1000_RXDADV_PKTTYPE_IPV4        0x00000010 /* IPV4 hdr present */
249176667Sjfv#define E1000_RXDADV_PKTTYPE_IPV4_EX     0x00000020 /* IPV4 hdr + extensions */
250176667Sjfv#define E1000_RXDADV_PKTTYPE_IPV6        0x00000040 /* IPV6 hdr present */
251176667Sjfv#define E1000_RXDADV_PKTTYPE_IPV6_EX     0x00000080 /* IPV6 hdr + extensions */
252176667Sjfv#define E1000_RXDADV_PKTTYPE_TCP         0x00000100 /* TCP hdr present */
253176667Sjfv#define E1000_RXDADV_PKTTYPE_UDP         0x00000200 /* UDP hdr present */
254176667Sjfv#define E1000_RXDADV_PKTTYPE_SCTP        0x00000400 /* SCTP hdr present */
255176667Sjfv#define E1000_RXDADV_PKTTYPE_NFS         0x00000800 /* NFS hdr present */
256176667Sjfv
257181027Sjfv#define E1000_RXDADV_PKTTYPE_IPSEC_ESP   0x00001000 /* IPSec ESP */
258181027Sjfv#define E1000_RXDADV_PKTTYPE_IPSEC_AH    0x00002000 /* IPSec AH */
259181027Sjfv#define E1000_RXDADV_PKTTYPE_LINKSEC     0x00004000 /* LinkSec Encap */
260181027Sjfv#define E1000_RXDADV_PKTTYPE_ETQF        0x00008000 /* PKTTYPE is ETQF index */
261181027Sjfv#define E1000_RXDADV_PKTTYPE_ETQF_MASK   0x00000070 /* ETQF has 8 indices */
262181027Sjfv#define E1000_RXDADV_PKTTYPE_ETQF_SHIFT  4          /* Right-shift 4 bits */
263181027Sjfv
264181027Sjfv/* LinkSec results */
265181027Sjfv/* Security Processing bit Indication */
266181027Sjfv#define E1000_RXDADV_LNKSEC_STATUS_SECP         0x00020000
267181027Sjfv#define E1000_RXDADV_LNKSEC_ERROR_BIT_MASK      0x18000000
268181027Sjfv#define E1000_RXDADV_LNKSEC_ERROR_NO_SA_MATCH   0x08000000
269181027Sjfv#define E1000_RXDADV_LNKSEC_ERROR_REPLAY_ERROR  0x10000000
270181027Sjfv#define E1000_RXDADV_LNKSEC_ERROR_BAD_SIG       0x18000000
271181027Sjfv
272181027Sjfv#define E1000_RXDADV_IPSEC_STATUS_SECP          0x00020000
273181027Sjfv#define E1000_RXDADV_IPSEC_ERROR_BIT_MASK       0x18000000
274181027Sjfv#define E1000_RXDADV_IPSEC_ERROR_INVALID_PROTOCOL       0x08000000
275181027Sjfv#define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH         0x10000000
276181027Sjfv#define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED  0x18000000
277181027Sjfv
278176667Sjfv/* Transmit Descriptor - Advanced */
279176667Sjfvunion e1000_adv_tx_desc {
280176667Sjfv	struct {
281200243Sjfv		__le64 buffer_addr;    /* Address of descriptor's data buf */
282200243Sjfv		__le32 cmd_type_len;
283200243Sjfv		__le32 olinfo_status;
284176667Sjfv	} read;
285176667Sjfv	struct {
286200243Sjfv		__le64 rsvd;       /* Reserved */
287200243Sjfv		__le32 nxtseq_seed;
288200243Sjfv		__le32 status;
289176667Sjfv	} wb;
290176667Sjfv};
291176667Sjfv
292176667Sjfv/* Adv Transmit Descriptor Config Masks */
293176667Sjfv#define E1000_ADVTXD_DTYP_CTXT    0x00200000 /* Advanced Context Descriptor */
294176667Sjfv#define E1000_ADVTXD_DTYP_DATA    0x00300000 /* Advanced Data Descriptor */
295176667Sjfv#define E1000_ADVTXD_DCMD_EOP     0x01000000 /* End of Packet */
296176667Sjfv#define E1000_ADVTXD_DCMD_IFCS    0x02000000 /* Insert FCS (Ethernet CRC) */
297176667Sjfv#define E1000_ADVTXD_DCMD_RS      0x08000000 /* Report Status */
298176667Sjfv#define E1000_ADVTXD_DCMD_DDTYP_ISCSI  0x10000000 /* DDP hdr type or iSCSI */
299176667Sjfv#define E1000_ADVTXD_DCMD_DEXT    0x20000000 /* Descriptor extension (1=Adv) */
300176667Sjfv#define E1000_ADVTXD_DCMD_VLE     0x40000000 /* VLAN pkt enable */
301176667Sjfv#define E1000_ADVTXD_DCMD_TSE     0x80000000 /* TCP Seg enable */
302181027Sjfv#define E1000_ADVTXD_MAC_LINKSEC  0x00040000 /* Apply LinkSec on packet */
303176667Sjfv#define E1000_ADVTXD_MAC_TSTAMP   0x00080000 /* IEEE1588 Timestamp packet */
304176667Sjfv#define E1000_ADVTXD_STAT_SN_CRC  0x00000002 /* NXTSEQ/SEED present in WB */
305176667Sjfv#define E1000_ADVTXD_IDX_SHIFT    4  /* Adv desc Index shift */
306176667Sjfv#define E1000_ADVTXD_POPTS_ISCO_1ST  0x00000000 /* 1st TSO of iSCSI PDU */
307176667Sjfv#define E1000_ADVTXD_POPTS_ISCO_MDL  0x00000800 /* Middle TSO of iSCSI PDU */
308176667Sjfv#define E1000_ADVTXD_POPTS_ISCO_LAST 0x00001000 /* Last TSO of iSCSI PDU */
309176667Sjfv#define E1000_ADVTXD_POPTS_ISCO_FULL 0x00001800 /* 1st&Last TSO-full iSCSI PDU*/
310176667Sjfv#define E1000_ADVTXD_POPTS_IPSEC     0x00000400 /* IPSec offload request */
311176667Sjfv#define E1000_ADVTXD_PAYLEN_SHIFT    14 /* Adv desc PAYLEN shift */
312176667Sjfv
313176667Sjfv/* Context descriptors */
314176667Sjfvstruct e1000_adv_tx_context_desc {
315200243Sjfv	__le32 vlan_macip_lens;
316200243Sjfv	__le32 seqnum_seed;
317200243Sjfv	__le32 type_tucmd_mlhl;
318200243Sjfv	__le32 mss_l4len_idx;
319176667Sjfv};
320176667Sjfv
321176667Sjfv#define E1000_ADVTXD_MACLEN_SHIFT    9  /* Adv ctxt desc mac len shift */
322176667Sjfv#define E1000_ADVTXD_VLAN_SHIFT     16  /* Adv ctxt vlan tag shift */
323176667Sjfv#define E1000_ADVTXD_TUCMD_IPV4    0x00000400  /* IP Packet Type: 1=IPv4 */
324176667Sjfv#define E1000_ADVTXD_TUCMD_IPV6    0x00000000  /* IP Packet Type: 0=IPv6 */
325176667Sjfv#define E1000_ADVTXD_TUCMD_L4T_UDP 0x00000000  /* L4 Packet TYPE of UDP */
326176667Sjfv#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800  /* L4 Packet TYPE of TCP */
327190872Sjfv#define E1000_ADVTXD_TUCMD_L4T_SCTP 0x00001000  /* L4 Packet TYPE of SCTP */
328176667Sjfv#define E1000_ADVTXD_TUCMD_IPSEC_TYPE_ESP    0x00002000 /* IPSec Type ESP */
329176667Sjfv/* IPSec Encrypt Enable for ESP */
330176667Sjfv#define E1000_ADVTXD_TUCMD_IPSEC_ENCRYPT_EN  0x00004000
331176667Sjfv#define E1000_ADVTXD_TUCMD_MKRREQ  0x00002000 /* Req requires Markers and CRC */
332176667Sjfv#define E1000_ADVTXD_L4LEN_SHIFT     8  /* Adv ctxt L4LEN shift */
333176667Sjfv#define E1000_ADVTXD_MSS_SHIFT      16  /* Adv ctxt MSS shift */
334176667Sjfv/* Adv ctxt IPSec SA IDX mask */
335176667Sjfv#define E1000_ADVTXD_IPSEC_SA_INDEX_MASK     0x000000FF
336176667Sjfv/* Adv ctxt IPSec ESP len mask */
337176667Sjfv#define E1000_ADVTXD_IPSEC_ESP_LEN_MASK      0x000000FF
338176667Sjfv
339176667Sjfv/* Additional Transmit Descriptor Control definitions */
340176667Sjfv#define E1000_TXDCTL_QUEUE_ENABLE  0x02000000 /* Enable specific Tx Queue */
341176667Sjfv#define E1000_TXDCTL_SWFLSH        0x04000000 /* Tx Desc. write-back flushing */
342176667Sjfv/* Tx Queue Arbitration Priority 0=low, 1=high */
343176667Sjfv#define E1000_TXDCTL_PRIORITY      0x08000000
344176667Sjfv
345176667Sjfv/* Additional Receive Descriptor Control definitions */
346176667Sjfv#define E1000_RXDCTL_QUEUE_ENABLE  0x02000000 /* Enable specific Rx Queue */
347176667Sjfv#define E1000_RXDCTL_SWFLSH        0x04000000 /* Rx Desc. write-back flushing */
348176667Sjfv
349176667Sjfv/* Direct Cache Access (DCA) definitions */
350176667Sjfv#define E1000_DCA_CTRL_DCA_ENABLE  0x00000000 /* DCA Enable */
351176667Sjfv#define E1000_DCA_CTRL_DCA_DISABLE 0x00000001 /* DCA Disable */
352176667Sjfv
353176667Sjfv#define E1000_DCA_CTRL_DCA_MODE_CB1 0x00 /* DCA Mode CB1 */
354176667Sjfv#define E1000_DCA_CTRL_DCA_MODE_CB2 0x02 /* DCA Mode CB2 */
355176667Sjfv
356176667Sjfv#define E1000_DCA_RXCTRL_CPUID_MASK 0x0000001F /* Rx CPUID Mask */
357176667Sjfv#define E1000_DCA_RXCTRL_DESC_DCA_EN (1 << 5) /* DCA Rx Desc enable */
358176667Sjfv#define E1000_DCA_RXCTRL_HEAD_DCA_EN (1 << 6) /* DCA Rx Desc header enable */
359176667Sjfv#define E1000_DCA_RXCTRL_DATA_DCA_EN (1 << 7) /* DCA Rx Desc payload enable */
360176667Sjfv
361176667Sjfv#define E1000_DCA_TXCTRL_CPUID_MASK 0x0000001F /* Tx CPUID Mask */
362176667Sjfv#define E1000_DCA_TXCTRL_DESC_DCA_EN (1 << 5) /* DCA Tx Desc enable */
363176667Sjfv#define E1000_DCA_TXCTRL_TX_WB_RO_EN (1 << 11) /* Tx Desc writeback RO bit */
364176667Sjfv
365181027Sjfv#define E1000_DCA_TXCTRL_CPUID_MASK_82576 0xFF000000 /* Tx CPUID Mask */
366181027Sjfv#define E1000_DCA_RXCTRL_CPUID_MASK_82576 0xFF000000 /* Rx CPUID Mask */
367185353Sjfv#define E1000_DCA_TXCTRL_CPUID_SHIFT_82576 24 /* Tx CPUID */
368185353Sjfv#define E1000_DCA_RXCTRL_CPUID_SHIFT_82576 24 /* Rx CPUID */
369176667Sjfv
370181027Sjfv/* Additional interrupt register bit definitions */
371181027Sjfv#define E1000_ICR_LSECPNS       0x00000020          /* PN threshold - server */
372181027Sjfv#define E1000_IMS_LSECPNS       E1000_ICR_LSECPNS   /* PN threshold - server */
373181027Sjfv#define E1000_ICS_LSECPNS       E1000_ICR_LSECPNS   /* PN threshold - server */
374176667Sjfv
375181027Sjfv/* ETQF register bit definitions */
376181027Sjfv#define E1000_ETQF_FILTER_ENABLE   (1 << 26)
377181027Sjfv#define E1000_ETQF_IMM_INT         (1 << 29)
378185353Sjfv#define E1000_ETQF_1588            (1 << 30)
379185353Sjfv#define E1000_ETQF_QUEUE_ENABLE    (1 << 31)
380181027Sjfv/*
381181027Sjfv * ETQF filter list: one static filter per filter consumer. This is
382181027Sjfv *                   to avoid filter collisions later. Add new filters
383181027Sjfv *                   here!!
384181027Sjfv *
385181027Sjfv * Current filters:
386181027Sjfv *    EAPOL 802.1x (0x888e): Filter 0
387181027Sjfv */
388181027Sjfv#define E1000_ETQF_FILTER_EAPOL          0
389181027Sjfv
390200243Sjfv#define E1000_FTQF_VF_BP               0x00008000
391200243Sjfv#define E1000_FTQF_1588_TIME_STAMP     0x08000000
392200243Sjfv#define E1000_FTQF_MASK                0xF0000000
393200243Sjfv#define E1000_FTQF_MASK_PROTO_BP       0x10000000
394200243Sjfv#define E1000_FTQF_MASK_SOURCE_ADDR_BP 0x20000000
395200243Sjfv#define E1000_FTQF_MASK_DEST_ADDR_BP   0x40000000
396200243Sjfv#define E1000_FTQF_MASK_SOURCE_PORT_BP 0x80000000
397200243Sjfv
398181027Sjfv#define E1000_NVM_APME_82575          0x0400
399181027Sjfv#define MAX_NUM_VFS                   8
400181027Sjfv
401181027Sjfv#define E1000_DTXSWC_MAC_SPOOF_MASK   0x000000FF /* Per VF MAC spoof control */
402181027Sjfv#define E1000_DTXSWC_VLAN_SPOOF_MASK  0x0000FF00 /* Per VF VLAN spoof control */
403181027Sjfv#define E1000_DTXSWC_LLE_MASK         0x00FF0000 /* Per VF Local LB enables */
404190872Sjfv#define E1000_DTXSWC_VLAN_SPOOF_SHIFT 8
405190872Sjfv#define E1000_DTXSWC_LLE_SHIFT        16
406181027Sjfv#define E1000_DTXSWC_VMDQ_LOOPBACK_EN (1 << 31)  /* global VF LB enable */
407181027Sjfv
408181027Sjfv/* Easy defines for setting default pool, would normally be left a zero */
409181027Sjfv#define E1000_VT_CTL_DEFAULT_POOL_SHIFT 7
410181027Sjfv#define E1000_VT_CTL_DEFAULT_POOL_MASK  (0x7 << E1000_VT_CTL_DEFAULT_POOL_SHIFT)
411181027Sjfv
412181027Sjfv/* Other useful VMD_CTL register defines */
413181027Sjfv#define E1000_VT_CTL_IGNORE_MAC         (1 << 28)
414181027Sjfv#define E1000_VT_CTL_DISABLE_DEF_POOL   (1 << 29)
415181027Sjfv#define E1000_VT_CTL_VM_REPL_EN         (1 << 30)
416181027Sjfv
417181027Sjfv/* Per VM Offload register setup */
418190872Sjfv#define E1000_VMOLR_RLPML_MASK 0x00003FFF /* Long Packet Maximum Length mask */
419181027Sjfv#define E1000_VMOLR_LPE        0x00010000 /* Accept Long packet */
420190872Sjfv#define E1000_VMOLR_RSSE       0x00020000 /* Enable RSS */
421181027Sjfv#define E1000_VMOLR_AUPE       0x01000000 /* Accept untagged packets */
422190872Sjfv#define E1000_VMOLR_ROMPE      0x02000000 /* Accept overflow multicast */
423190872Sjfv#define E1000_VMOLR_ROPE       0x04000000 /* Accept overflow unicast */
424181027Sjfv#define E1000_VMOLR_BAM        0x08000000 /* Accept Broadcast packets */
425181027Sjfv#define E1000_VMOLR_MPME       0x10000000 /* Multicast promiscuous mode */
426181027Sjfv#define E1000_VMOLR_STRVLAN    0x40000000 /* Vlan stripping enable */
427190872Sjfv#define E1000_VMOLR_STRCRC     0x80000000 /* CRC stripping enable */
428181027Sjfv
429218530Sjfv#define E1000_VMOLR_VPE        0x00800000 /* VLAN promiscuous enable */
430218530Sjfv#define E1000_VMOLR_UPE        0x20000000 /* Unicast promisuous enable */
431218530Sjfv#define E1000_DVMOLR_HIDVLAN   0x20000000 /* Vlan hiding enable */
432218530Sjfv#define E1000_DVMOLR_STRVLAN   0x40000000 /* Vlan stripping enable */
433218530Sjfv#define E1000_DVMOLR_STRCRC    0x80000000 /* CRC stripping enable */
434205869Sjfv
435218530Sjfv#define E1000_PBRWAC_WALPB     0x00000007 /* Wrap around event on LAN Rx PB */
436218530Sjfv#define E1000_PBRWAC_PBE       0x00000008 /* Rx packet buffer empty */
437218530Sjfv
438190872Sjfv#define E1000_VLVF_ARRAY_SIZE     32
439190872Sjfv#define E1000_VLVF_VLANID_MASK    0x00000FFF
440190872Sjfv#define E1000_VLVF_POOLSEL_SHIFT  12
441190872Sjfv#define E1000_VLVF_POOLSEL_MASK   (0xFF << E1000_VLVF_POOLSEL_SHIFT)
442190872Sjfv#define E1000_VLVF_LVLAN          0x00100000
443190872Sjfv#define E1000_VLVF_VLANID_ENABLE  0x80000000
444181027Sjfv
445200243Sjfv#define E1000_VMVIR_VLANA_DEFAULT 0x40000000 /* Always use default VLAN */
446200243Sjfv#define E1000_VMVIR_VLANA_NEVER   0x80000000 /* Never insert VLAN tag */
447200243Sjfv
448190872Sjfv#define E1000_VF_INIT_TIMEOUT 200 /* Number of retries to clear RSTI */
449181027Sjfv
450190872Sjfv#define E1000_IOVCTL 0x05BBC
451190872Sjfv#define E1000_IOVCTL_REUSE_VFQ 0x00000001
452181027Sjfv
453194865Sjfv#define E1000_RPLOLR_STRVLAN   0x40000000
454194865Sjfv#define E1000_RPLOLR_STRCRC    0x80000000
455194865Sjfv
456203049Sjfv#define E1000_TCTL_EXT_COLD       0x000FFC00
457203049Sjfv#define E1000_TCTL_EXT_COLD_SHIFT 10
458203049Sjfv
459200243Sjfv#define E1000_DTXCTL_8023LL     0x0004
460200243Sjfv#define E1000_DTXCTL_VLAN_ADDED 0x0008
461200243Sjfv#define E1000_DTXCTL_OOS_ENABLE 0x0010
462200243Sjfv#define E1000_DTXCTL_MDP_EN     0x0020
463200243Sjfv#define E1000_DTXCTL_SPOOF_INT  0x0040
464200243Sjfv
465185353Sjfv#define ALL_QUEUES   0xFFFF
466185353Sjfv
467218530Sjfv/* Rx packet buffer size defines */
468200243Sjfv#define E1000_RXPBS_SIZE_MASK_82576  0x0000007F
469194865Sjfvvoid e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable);
470213234Sjfvvoid e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf);
471194865Sjfvvoid e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable);
472209616Sjfvenum e1000_promisc_type {
473209616Sjfv	e1000_promisc_disabled = 0,   /* all promisc modes disabled */
474209616Sjfv	e1000_promisc_unicast = 1,    /* unicast promiscuous enabled */
475209616Sjfv	e1000_promisc_multicast = 2,  /* multicast promiscuous enabled */
476209616Sjfv	e1000_promisc_enabled = 3,    /* both uni and multicast promisc */
477209616Sjfv	e1000_num_promisc_types
478209616Sjfv};
479209616Sjfv
480209616Sjfvvoid e1000_vfta_set_vf(struct e1000_hw *, u16, bool);
481209616Sjfvvoid e1000_rlpml_set_vf(struct e1000_hw *, u16);
482209616Sjfvs32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type);
483200243Sjfvu16 e1000_rxpbs_adjust_82580(u32 data);
484218530Sjfvs32 e1000_set_eee_i350(struct e1000_hw *);
485190872Sjfv#endif /* _E1000_82575_H_ */
486