xref: /freebsd/sys/dev/e1000/e1000_82575.h (revision e9e8876a4d6afc1ad5315faaa191b25121a813d7)
1 /******************************************************************************
2   SPDX-License-Identifier: BSD-3-Clause
3 
4   Copyright (c) 2001-2020, Intel Corporation
5   All rights reserved.
6 
7   Redistribution and use in source and binary forms, with or without
8   modification, are permitted provided that the following conditions are met:
9 
10    1. Redistributions of source code must retain the above copyright notice,
11       this list of conditions and the following disclaimer.
12 
13    2. Redistributions in binary form must reproduce the above copyright
14       notice, this list of conditions and the following disclaimer in the
15       documentation and/or other materials provided with the distribution.
16 
17    3. Neither the name of the Intel Corporation nor the names of its
18       contributors may be used to endorse or promote products derived from
19       this software without specific prior written permission.
20 
21   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31   POSSIBILITY OF SUCH DAMAGE.
32 
33 ******************************************************************************/
34 /*$FreeBSD$*/
35 
36 #ifndef _E1000_82575_H_
37 #define _E1000_82575_H_
38 
39 #define ID_LED_DEFAULT_82575_SERDES	((ID_LED_DEF1_DEF2 << 12) | \
40 					 (ID_LED_DEF1_DEF2 <<  8) | \
41 					 (ID_LED_DEF1_DEF2 <<  4) | \
42 					 (ID_LED_OFF1_ON2))
43 /*
44  * Receive Address Register Count
45  * Number of high/low register pairs in the RAR.  The RAR (Receive Address
46  * Registers) holds the directed and multicast addresses that we monitor.
47  * These entries are also used for MAC-based filtering.
48  */
49 /*
50  * For 82576, there are an additional set of RARs that begin at an offset
51  * separate from the first set of RARs.
52  */
53 #define E1000_RAR_ENTRIES_82575	16
54 #define E1000_RAR_ENTRIES_82576	24
55 #define E1000_RAR_ENTRIES_82580	24
56 #define E1000_RAR_ENTRIES_I350	32
57 #define E1000_SW_SYNCH_MB	0x00000100
58 #define E1000_STAT_DEV_RST_SET	0x00100000
59 
60 struct e1000_adv_data_desc {
61 	__le64 buffer_addr;    /* Address of the descriptor's data buffer */
62 	union {
63 		u32 data;
64 		struct {
65 			u32 datalen:16; /* Data buffer length */
66 			u32 rsvd:4;
67 			u32 dtyp:4;  /* Descriptor type */
68 			u32 dcmd:8;  /* Descriptor command */
69 		} config;
70 	} lower;
71 	union {
72 		u32 data;
73 		struct {
74 			u32 status:4;  /* Descriptor status */
75 			u32 idx:4;
76 			u32 popts:6;  /* Packet Options */
77 			u32 paylen:18; /* Payload length */
78 		} options;
79 	} upper;
80 };
81 
82 #define E1000_TXD_DTYP_ADV_C	0x2  /* Advanced Context Descriptor */
83 #define E1000_TXD_DTYP_ADV_D	0x3  /* Advanced Data Descriptor */
84 #define E1000_ADV_TXD_CMD_DEXT	0x20 /* Descriptor extension (0 = legacy) */
85 #define E1000_ADV_TUCMD_IPV4	0x2  /* IP Packet Type: 1=IPv4 */
86 #define E1000_ADV_TUCMD_IPV6	0x0  /* IP Packet Type: 0=IPv6 */
87 #define E1000_ADV_TUCMD_L4T_UDP	0x0  /* L4 Packet TYPE of UDP */
88 #define E1000_ADV_TUCMD_L4T_TCP	0x4  /* L4 Packet TYPE of TCP */
89 #define E1000_ADV_TUCMD_MKRREQ	0x10 /* Indicates markers are required */
90 #define E1000_ADV_DCMD_EOP	0x1  /* End of Packet */
91 #define E1000_ADV_DCMD_IFCS	0x2  /* Insert FCS (Ethernet CRC) */
92 #define E1000_ADV_DCMD_RS	0x8  /* Report Status */
93 #define E1000_ADV_DCMD_VLE	0x40 /* Add VLAN tag */
94 #define E1000_ADV_DCMD_TSE	0x80 /* TCP Seg enable */
95 /* Extended Device Control */
96 #define E1000_CTRL_EXT_NSICR	0x00000001 /* Disable Intr Clear all on read */
97 
98 struct e1000_adv_context_desc {
99 	union {
100 		u32 ip_config;
101 		struct {
102 			u32 iplen:9;
103 			u32 maclen:7;
104 			u32 vlan_tag:16;
105 		} fields;
106 	} ip_setup;
107 	u32 seq_num;
108 	union {
109 		u64 l4_config;
110 		struct {
111 			u32 mkrloc:9;
112 			u32 tucmd:11;
113 			u32 dtyp:4;
114 			u32 adv:8;
115 			u32 rsvd:4;
116 			u32 idx:4;
117 			u32 l4len:8;
118 			u32 mss:16;
119 		} fields;
120 	} l4_setup;
121 };
122 
123 /* SRRCTL bit definitions */
124 #define E1000_SRRCTL_BSIZEPKT_SHIFT		10 /* Shift _right_ */
125 #define E1000_SRRCTL_BSIZEHDRSIZE_MASK		0x00000F00
126 #define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT		2  /* Shift _left_ */
127 #define E1000_SRRCTL_DESCTYPE_LEGACY		0x00000000
128 #define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF	0x02000000
129 #define E1000_SRRCTL_DESCTYPE_HDR_SPLIT		0x04000000
130 #define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS	0x0A000000
131 #define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION	0x06000000
132 #define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION_LARGE_PKT 0x08000000
133 #define E1000_SRRCTL_DESCTYPE_MASK		0x0E000000
134 #define E1000_SRRCTL_TIMESTAMP			0x40000000
135 #define E1000_SRRCTL_DROP_EN			0x80000000
136 
137 #define E1000_SRRCTL_BSIZEPKT_MASK		0x0000007F
138 #define E1000_SRRCTL_BSIZEHDR_MASK		0x00003F00
139 
140 #define E1000_TX_HEAD_WB_ENABLE		0x1
141 #define E1000_TX_SEQNUM_WB_ENABLE	0x2
142 
143 #define E1000_MRQC_ENABLE_RSS_MQ		0x00000002
144 #define E1000_MRQC_ENABLE_VMDQ			0x00000003
145 #define E1000_MRQC_ENABLE_VMDQ_RSS_2Q		0x00000005
146 #define E1000_MRQC_RSS_FIELD_IPV4_UDP		0x00400000
147 #define E1000_MRQC_RSS_FIELD_IPV6_UDP		0x00800000
148 #define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX	0x01000000
149 
150 #define E1000_VMRCTL_MIRROR_PORT_SHIFT		8
151 #define E1000_VMRCTL_MIRROR_DSTPORT_MASK	(7 << \
152 						 E1000_VMRCTL_MIRROR_PORT_SHIFT)
153 #define E1000_VMRCTL_POOL_MIRROR_ENABLE		(1 << 0)
154 #define E1000_VMRCTL_UPLINK_MIRROR_ENABLE	(1 << 1)
155 #define E1000_VMRCTL_DOWNLINK_MIRROR_ENABLE	(1 << 2)
156 
157 #define E1000_EICR_TX_QUEUE ( \
158 	E1000_EICR_TX_QUEUE0 |    \
159 	E1000_EICR_TX_QUEUE1 |    \
160 	E1000_EICR_TX_QUEUE2 |    \
161 	E1000_EICR_TX_QUEUE3)
162 
163 #define E1000_EICR_RX_QUEUE ( \
164 	E1000_EICR_RX_QUEUE0 |    \
165 	E1000_EICR_RX_QUEUE1 |    \
166 	E1000_EICR_RX_QUEUE2 |    \
167 	E1000_EICR_RX_QUEUE3)
168 
169 #define E1000_EIMS_RX_QUEUE	E1000_EICR_RX_QUEUE
170 #define E1000_EIMS_TX_QUEUE	E1000_EICR_TX_QUEUE
171 
172 #define EIMS_ENABLE_MASK ( \
173 	E1000_EIMS_RX_QUEUE  | \
174 	E1000_EIMS_TX_QUEUE  | \
175 	E1000_EIMS_TCP_TIMER | \
176 	E1000_EIMS_OTHER)
177 
178 /* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */
179 #define E1000_IMIR_PORT_IM_EN	0x00010000  /* TCP port enable */
180 #define E1000_IMIR_PORT_BP	0x00020000  /* TCP port check bypass */
181 #define E1000_IMIREXT_CTRL_URG	0x00002000  /* Check URG bit in header */
182 #define E1000_IMIREXT_CTRL_ACK	0x00004000  /* Check ACK bit in header */
183 #define E1000_IMIREXT_CTRL_PSH	0x00008000  /* Check PSH bit in header */
184 #define E1000_IMIREXT_CTRL_RST	0x00010000  /* Check RST bit in header */
185 #define E1000_IMIREXT_CTRL_SYN	0x00020000  /* Check SYN bit in header */
186 #define E1000_IMIREXT_CTRL_FIN	0x00040000  /* Check FIN bit in header */
187 
188 #define E1000_RXDADV_RSSTYPE_MASK	0x0000000F
189 #define E1000_RXDADV_RSSTYPE_SHIFT	12
190 #define E1000_RXDADV_HDRBUFLEN_MASK	0x7FE0
191 #define E1000_RXDADV_HDRBUFLEN_SHIFT	5
192 #define E1000_RXDADV_SPLITHEADER_EN	0x00001000
193 #define E1000_RXDADV_SPH		0x8000
194 #define E1000_RXDADV_STAT_TS		0x10000 /* Pkt was time stamped */
195 #define E1000_RXDADV_ERR_HBO		0x00800000
196 
197 /* RSS Hash results */
198 #define E1000_RXDADV_RSSTYPE_NONE	0x00000000
199 #define E1000_RXDADV_RSSTYPE_IPV4_TCP	0x00000001
200 #define E1000_RXDADV_RSSTYPE_IPV4	0x00000002
201 #define E1000_RXDADV_RSSTYPE_IPV6_TCP	0x00000003
202 #define E1000_RXDADV_RSSTYPE_IPV6_EX	0x00000004
203 #define E1000_RXDADV_RSSTYPE_IPV6	0x00000005
204 #define E1000_RXDADV_RSSTYPE_IPV6_TCP_EX 0x00000006
205 #define E1000_RXDADV_RSSTYPE_IPV4_UDP	0x00000007
206 #define E1000_RXDADV_RSSTYPE_IPV6_UDP	0x00000008
207 #define E1000_RXDADV_RSSTYPE_IPV6_UDP_EX 0x00000009
208 
209 /* RSS Packet Types as indicated in the receive descriptor */
210 #define E1000_RXDADV_PKTTYPE_ILMASK	0x000000F0
211 #define E1000_RXDADV_PKTTYPE_TLMASK	0x00000F00
212 #define E1000_RXDADV_PKTTYPE_NONE	0x00000000
213 #define E1000_RXDADV_PKTTYPE_IPV4	0x00000010 /* IPV4 hdr present */
214 #define E1000_RXDADV_PKTTYPE_IPV4_EX	0x00000020 /* IPV4 hdr + extensions */
215 #define E1000_RXDADV_PKTTYPE_IPV6	0x00000040 /* IPV6 hdr present */
216 #define E1000_RXDADV_PKTTYPE_IPV6_EX	0x00000080 /* IPV6 hdr + extensions */
217 #define E1000_RXDADV_PKTTYPE_TCP	0x00000100 /* TCP hdr present */
218 #define E1000_RXDADV_PKTTYPE_UDP	0x00000200 /* UDP hdr present */
219 #define E1000_RXDADV_PKTTYPE_SCTP	0x00000400 /* SCTP hdr present */
220 #define E1000_RXDADV_PKTTYPE_NFS	0x00000800 /* NFS hdr present */
221 
222 #define E1000_RXDADV_PKTTYPE_IPSEC_ESP	0x00001000 /* IPSec ESP */
223 #define E1000_RXDADV_PKTTYPE_IPSEC_AH	0x00002000 /* IPSec AH */
224 #define E1000_RXDADV_PKTTYPE_LINKSEC	0x00004000 /* LinkSec Encap */
225 #define E1000_RXDADV_PKTTYPE_ETQF	0x00008000 /* PKTTYPE is ETQF index */
226 #define E1000_RXDADV_PKTTYPE_ETQF_MASK	0x00000070 /* ETQF has 8 indices */
227 #define E1000_RXDADV_PKTTYPE_ETQF_SHIFT	4 /* Right-shift 4 bits */
228 
229 /* LinkSec results */
230 /* Security Processing bit Indication */
231 #define E1000_RXDADV_LNKSEC_STATUS_SECP		0x00020000
232 #define E1000_RXDADV_LNKSEC_ERROR_BIT_MASK	0x18000000
233 #define E1000_RXDADV_LNKSEC_ERROR_NO_SA_MATCH	0x08000000
234 #define E1000_RXDADV_LNKSEC_ERROR_REPLAY_ERROR	0x10000000
235 #define E1000_RXDADV_LNKSEC_ERROR_BAD_SIG	0x18000000
236 
237 #define E1000_RXDADV_IPSEC_STATUS_SECP			0x00020000
238 #define E1000_RXDADV_IPSEC_ERROR_BIT_MASK		0x18000000
239 #define E1000_RXDADV_IPSEC_ERROR_INVALID_PROTOCOL	0x08000000
240 #define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH		0x10000000
241 #define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED	0x18000000
242 
243 /* Adv Transmit Descriptor Config Masks */
244 #define E1000_ADVTXD_DTYP_CTXT	0x00200000 /* Advanced Context Descriptor */
245 #define E1000_ADVTXD_DTYP_DATA	0x00300000 /* Advanced Data Descriptor */
246 #define E1000_ADVTXD_DCMD_EOP	0x01000000 /* End of Packet */
247 #define E1000_ADVTXD_DCMD_IFCS	0x02000000 /* Insert FCS (Ethernet CRC) */
248 #define E1000_ADVTXD_DCMD_RS	0x08000000 /* Report Status */
249 #define E1000_ADVTXD_DCMD_DDTYP_ISCSI	0x10000000 /* DDP hdr type or iSCSI */
250 #define E1000_ADVTXD_DCMD_DEXT	0x20000000 /* Descriptor extension (1=Adv) */
251 #define E1000_ADVTXD_DCMD_VLE	0x40000000 /* VLAN pkt enable */
252 #define E1000_ADVTXD_DCMD_TSE	0x80000000 /* TCP Seg enable */
253 #define E1000_ADVTXD_MAC_LINKSEC	0x00040000 /* Apply LinkSec on pkt */
254 #define E1000_ADVTXD_MAC_TSTAMP		0x00080000 /* IEEE1588 Timestamp pkt */
255 #define E1000_ADVTXD_STAT_SN_CRC	0x00000002 /* NXTSEQ/SEED prsnt in WB */
256 #define E1000_ADVTXD_IDX_SHIFT		4  /* Adv desc Index shift */
257 #define E1000_ADVTXD_POPTS_ISCO_1ST	0x00000000 /* 1st TSO of iSCSI PDU */
258 #define E1000_ADVTXD_POPTS_ISCO_MDL	0x00000800 /* Middle TSO of iSCSI PDU */
259 #define E1000_ADVTXD_POPTS_ISCO_LAST	0x00001000 /* Last TSO of iSCSI PDU */
260 /* 1st & Last TSO-full iSCSI PDU*/
261 #define E1000_ADVTXD_POPTS_ISCO_FULL	0x00001800
262 #define E1000_ADVTXD_POPTS_IPSEC	0x00000400 /* IPSec offload request */
263 #define E1000_ADVTXD_PAYLEN_SHIFT	14 /* Adv desc PAYLEN shift */
264 
265 /* Additional Transmit Descriptor Control definitions */
266 #define E1000_TXDCTL_QUEUE_ENABLE	0x02000000 /* Ena specific Tx Queue */
267 #define E1000_TXDCTL_SWFLSH		0x04000000 /* Tx Desc. wbk flushing */
268 /* Tx Queue Arbitration Priority 0=low, 1=high */
269 #define E1000_TXDCTL_PRIORITY		0x08000000
270 
271 /* Additional Receive Descriptor Control definitions */
272 #define E1000_RXDCTL_QUEUE_ENABLE	0x02000000 /* Ena specific Rx Queue */
273 #define E1000_RXDCTL_SWFLSH		0x04000000 /* Rx Desc. wbk flushing */
274 
275 /* Direct Cache Access (DCA) definitions */
276 #define E1000_DCA_CTRL_DCA_ENABLE	0x00000000 /* DCA Enable */
277 #define E1000_DCA_CTRL_DCA_DISABLE	0x00000001 /* DCA Disable */
278 
279 #define E1000_DCA_CTRL_DCA_MODE_CB1	0x00 /* DCA Mode CB1 */
280 #define E1000_DCA_CTRL_DCA_MODE_CB2	0x02 /* DCA Mode CB2 */
281 
282 #define E1000_DCA_RXCTRL_CPUID_MASK	0x0000001F /* Rx CPUID Mask */
283 #define E1000_DCA_RXCTRL_DESC_DCA_EN	(1 << 5) /* DCA Rx Desc enable */
284 #define E1000_DCA_RXCTRL_HEAD_DCA_EN	(1 << 6) /* DCA Rx Desc header ena */
285 #define E1000_DCA_RXCTRL_DATA_DCA_EN	(1 << 7) /* DCA Rx Desc payload ena */
286 #define E1000_DCA_RXCTRL_DESC_RRO_EN	(1 << 9) /* DCA Rx Desc Relax Order */
287 
288 #define E1000_DCA_TXCTRL_CPUID_MASK	0x0000001F /* Tx CPUID Mask */
289 #define E1000_DCA_TXCTRL_DESC_DCA_EN	(1 << 5) /* DCA Tx Desc enable */
290 #define E1000_DCA_TXCTRL_DESC_RRO_EN	(1 << 9) /* Tx rd Desc Relax Order */
291 #define E1000_DCA_TXCTRL_TX_WB_RO_EN	(1 << 11) /* Tx Desc writeback RO bit */
292 #define E1000_DCA_TXCTRL_DATA_RRO_EN	(1 << 13) /* Tx rd data Relax Order */
293 
294 #define E1000_DCA_TXCTRL_CPUID_MASK_82576	0xFF000000 /* Tx CPUID Mask */
295 #define E1000_DCA_RXCTRL_CPUID_MASK_82576	0xFF000000 /* Rx CPUID Mask */
296 #define E1000_DCA_TXCTRL_CPUID_SHIFT_82576	24 /* Tx CPUID */
297 #define E1000_DCA_RXCTRL_CPUID_SHIFT_82576	24 /* Rx CPUID */
298 
299 /* Additional interrupt register bit definitions */
300 #define E1000_ICR_LSECPNS	0x00000020 /* PN threshold - server */
301 #define E1000_IMS_LSECPNS	E1000_ICR_LSECPNS /* PN threshold - server */
302 #define E1000_ICS_LSECPNS	E1000_ICR_LSECPNS /* PN threshold - server */
303 
304 /*
305  * ETQF filter list: one static filter per filter consumer. This is
306  *                   to avoid filter collisions later. Add new filters
307  *                   here!!
308  *
309  * Current filters:
310  *    EAPOL 802.1x (0x888e): Filter 0
311  */
312 #define E1000_ETQF_FILTER_EAPOL		0
313 
314 #define E1000_FTQF_MASK_SOURCE_ADDR_BP	0x20000000
315 #define E1000_FTQF_MASK_DEST_ADDR_BP	0x40000000
316 #define E1000_FTQF_MASK_SOURCE_PORT_BP	0x80000000
317 
318 #define E1000_NVM_APME_82575		0x0400
319 #define MAX_NUM_VFS			7
320 
321 #define E1000_DTXSWC_MAC_SPOOF_MASK	0x000000FF /* Per VF MAC spoof cntrl */
322 #define E1000_DTXSWC_VLAN_SPOOF_MASK	0x0000FF00 /* Per VF VLAN spoof cntrl */
323 #define E1000_DTXSWC_LLE_MASK		0x00FF0000 /* Per VF Local LB enables */
324 #define E1000_DTXSWC_VLAN_SPOOF_SHIFT	8
325 #define E1000_DTXSWC_LLE_SHIFT		16
326 #define E1000_DTXSWC_VMDQ_LOOPBACK_EN	(1U << 31)  /* global VF LB enable */
327 
328 /* Easy defines for setting default pool, would normally be left a zero */
329 #define E1000_VT_CTL_DEFAULT_POOL_SHIFT	7
330 #define E1000_VT_CTL_DEFAULT_POOL_MASK	(0x7 << E1000_VT_CTL_DEFAULT_POOL_SHIFT)
331 
332 /* Other useful VMD_CTL register defines */
333 #define E1000_VT_CTL_IGNORE_MAC		(1 << 28)
334 #define E1000_VT_CTL_DISABLE_DEF_POOL	(1 << 29)
335 #define E1000_VT_CTL_VM_REPL_EN		(1 << 30)
336 
337 /* Per VM Offload register setup */
338 #define E1000_VMOLR_RLPML_MASK	0x00003FFF /* Long Packet Maximum Length mask */
339 #define E1000_VMOLR_LPE		0x00010000 /* Accept Long packet */
340 #define E1000_VMOLR_RSSE	0x00020000 /* Enable RSS */
341 #define E1000_VMOLR_AUPE	0x01000000 /* Accept untagged packets */
342 #define E1000_VMOLR_ROMPE	0x02000000 /* Accept overflow multicast */
343 #define E1000_VMOLR_ROPE	0x04000000 /* Accept overflow unicast */
344 #define E1000_VMOLR_BAM		0x08000000 /* Accept Broadcast packets */
345 #define E1000_VMOLR_MPME	0x10000000 /* Multicast promiscuous mode */
346 #define E1000_VMOLR_STRVLAN	0x40000000 /* Vlan stripping enable */
347 #define E1000_VMOLR_STRCRC	0x80000000 /* CRC stripping enable */
348 
349 #define E1000_VMOLR_VPE		0x00800000 /* VLAN promiscuous enable */
350 #define E1000_VMOLR_UPE		0x20000000 /* Unicast promisuous enable */
351 #define E1000_DVMOLR_HIDVLAN	0x20000000 /* Vlan hiding enable */
352 #define E1000_DVMOLR_STRVLAN	0x40000000 /* Vlan stripping enable */
353 #define E1000_DVMOLR_STRCRC	0x80000000 /* CRC stripping enable */
354 
355 #define E1000_PBRWAC_WALPB	0x00000007 /* Wrap around event on LAN Rx PB */
356 #define E1000_PBRWAC_PBE	0x00000008 /* Rx packet buffer empty */
357 
358 #define E1000_VLVF_ARRAY_SIZE		32
359 #define E1000_VLVF_VLANID_MASK		0x00000FFF
360 #define E1000_VLVF_POOLSEL_SHIFT	12
361 #define E1000_VLVF_POOLSEL_MASK		(0xFF << E1000_VLVF_POOLSEL_SHIFT)
362 #define E1000_VLVF_LVLAN		0x00100000
363 #define E1000_VLVF_VLANID_ENABLE	0x80000000
364 
365 #define E1000_VMVIR_VLANA_DEFAULT	0x40000000 /* Always use default VLAN */
366 #define E1000_VMVIR_VLANA_NEVER		0x80000000 /* Never insert VLAN tag */
367 
368 #define E1000_VF_INIT_TIMEOUT	200 /* Number of retries to clear RSTI */
369 
370 #define E1000_IOVCTL		0x05BBC
371 #define E1000_IOVCTL_REUSE_VFQ	0x00000001
372 
373 #define E1000_RPLOLR_STRVLAN	0x40000000
374 #define E1000_RPLOLR_STRCRC	0x80000000
375 
376 #define E1000_TCTL_EXT_COLD	0x000FFC00
377 #define E1000_TCTL_EXT_COLD_SHIFT	10
378 
379 #define E1000_DTXCTL_8023LL	0x0004
380 #define E1000_DTXCTL_VLAN_ADDED	0x0008
381 #define E1000_DTXCTL_OOS_ENABLE	0x0010
382 #define E1000_DTXCTL_MDP_EN	0x0020
383 #define E1000_DTXCTL_SPOOF_INT	0x0040
384 
385 #define E1000_EEPROM_PCS_AUTONEG_DISABLE_BIT	(1 << 14)
386 
387 #define ALL_QUEUES		0xFFFF
388 
389 s32 e1000_reset_init_script_82575(struct e1000_hw *hw);
390 s32 e1000_init_nvm_params_82575(struct e1000_hw *hw);
391 
392 /* Rx packet buffer size defines */
393 #define E1000_RXPBS_SIZE_MASK_82576	0x0000007F
394 void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable);
395 void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf);
396 void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable);
397 
398 enum e1000_promisc_type {
399 	e1000_promisc_disabled = 0,   /* all promisc modes disabled */
400 	e1000_promisc_unicast = 1,    /* unicast promiscuous enabled */
401 	e1000_promisc_multicast = 2,  /* multicast promiscuous enabled */
402 	e1000_promisc_enabled = 3,    /* both uni and multicast promisc */
403 	e1000_num_promisc_types
404 };
405 
406 void e1000_vfta_set_vf(struct e1000_hw *, u16, bool);
407 void e1000_rlpml_set_vf(struct e1000_hw *, u16);
408 s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type);
409 void e1000_write_vfta_i350(struct e1000_hw *hw, u32 offset, u32 value);
410 u16 e1000_rxpbs_adjust_82580(u32 data);
411 s32 e1000_read_emi_reg(struct e1000_hw *hw, u16 addr, u16 *data);
412 s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M);
413 s32 e1000_set_eee_i354(struct e1000_hw *hw, bool adv1G, bool adv100M);
414 s32 e1000_get_eee_status_i354(struct e1000_hw *, bool *);
415 s32 e1000_initialize_M88E1512_phy(struct e1000_hw *hw);
416 s32 e1000_initialize_M88E1543_phy(struct e1000_hw *hw);
417 
418 /* I2C SDA and SCL timing parameters for standard mode */
419 #define E1000_I2C_T_HD_STA	4
420 #define E1000_I2C_T_LOW		5
421 #define E1000_I2C_T_HIGH	4
422 #define E1000_I2C_T_SU_STA	5
423 #define E1000_I2C_T_HD_DATA	5
424 #define E1000_I2C_T_SU_DATA	1
425 #define E1000_I2C_T_RISE	1
426 #define E1000_I2C_T_FALL	1
427 #define E1000_I2C_T_SU_STO	4
428 #define E1000_I2C_T_BUF		5
429 
430 s32 e1000_set_i2c_bb(struct e1000_hw *hw);
431 s32 e1000_read_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset,
432 				u8 dev_addr, u8 *data);
433 s32 e1000_write_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset,
434 				 u8 dev_addr, u8 data);
435 void e1000_i2c_bus_clear(struct e1000_hw *hw);
436 #endif /* _E1000_82575_H_ */
437