xref: /freebsd/sys/dev/ixl/ixl.h (revision ec273ebf3b6aed5fba8c56b6ece5ad8693a48ea7)
1 /******************************************************************************
2 
3   Copyright (c) 2013-2014, Intel Corporation
4   All rights reserved.
5 
6   Redistribution and use in source and binary forms, with or without
7   modification, are permitted provided that the following conditions are met:
8 
9    1. Redistributions of source code must retain the above copyright notice,
10       this list of conditions and the following disclaimer.
11 
12    2. Redistributions in binary form must reproduce the above copyright
13       notice, this list of conditions and the following disclaimer in the
14       documentation and/or other materials provided with the distribution.
15 
16    3. Neither the name of the Intel Corporation nor the names of its
17       contributors may be used to endorse or promote products derived from
18       this software without specific prior written permission.
19 
20   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   POSSIBILITY OF SUCH DAMAGE.
31 
32 ******************************************************************************/
33 /*$FreeBSD$*/
34 
35 
36 #ifndef _IXL_H_
37 #define _IXL_H_
38 
39 
40 #include <sys/param.h>
41 #include <sys/systm.h>
42 #include <sys/buf_ring.h>
43 #include <sys/mbuf.h>
44 #include <sys/protosw.h>
45 #include <sys/socket.h>
46 #include <sys/malloc.h>
47 #include <sys/kernel.h>
48 #include <sys/module.h>
49 #include <sys/sockio.h>
50 #include <sys/eventhandler.h>
51 
52 #include <net/if.h>
53 #include <net/if_var.h>
54 #include <net/if_arp.h>
55 #include <net/bpf.h>
56 #include <net/ethernet.h>
57 #include <net/if_dl.h>
58 #include <net/if_media.h>
59 
60 #include <net/bpf.h>
61 #include <net/if_types.h>
62 #include <net/if_vlan_var.h>
63 
64 #include <netinet/in_systm.h>
65 #include <netinet/in.h>
66 #include <netinet/if_ether.h>
67 #include <netinet/ip.h>
68 #include <netinet/ip6.h>
69 #include <netinet/tcp.h>
70 #include <netinet/tcp_lro.h>
71 #include <netinet/udp.h>
72 #include <netinet/sctp.h>
73 
74 #include <machine/in_cksum.h>
75 
76 #include <sys/bus.h>
77 #include <machine/bus.h>
78 #include <sys/rman.h>
79 #include <machine/resource.h>
80 #include <vm/vm.h>
81 #include <vm/pmap.h>
82 #include <machine/clock.h>
83 #include <dev/pci/pcivar.h>
84 #include <dev/pci/pcireg.h>
85 #include <sys/proc.h>
86 #include <sys/sysctl.h>
87 #include <sys/endian.h>
88 #include <sys/taskqueue.h>
89 #include <sys/pcpu.h>
90 #include <sys/smp.h>
91 #include <machine/smp.h>
92 
93 #include "i40e_type.h"
94 #include "i40e_prototype.h"
95 
96 #if defined(IXL_DEBUG) || defined(IXL_DEBUG_SYSCTL)
97 #include <sys/sbuf.h>
98 
99 #define MAC_FORMAT "%02x:%02x:%02x:%02x:%02x:%02x"
100 #define MAC_FORMAT_ARGS(mac_addr) \
101 	(mac_addr)[0], (mac_addr)[1], (mac_addr)[2], (mac_addr)[3], \
102 	(mac_addr)[4], (mac_addr)[5]
103 #define ON_OFF_STR(is_set) ((is_set) ? "On" : "Off")
104 #endif /* IXL_DEBUG || IXL_DEBUG_SYSCTL */
105 
106 #ifdef IXL_DEBUG
107 /* Enable debug sysctls */
108 #ifndef IXL_DEBUG_SYSCTL
109 #define IXL_DEBUG_SYSCTL 1
110 #endif
111 
112 #define _DBG_PRINTF(S, ...)		printf("%s: " S "\n", __func__, ##__VA_ARGS__)
113 #define _DEV_DBG_PRINTF(dev, S, ...)	device_printf(dev, "%s: " S "\n", __func__, ##__VA_ARGS__)
114 #define _IF_DBG_PRINTF(ifp, S, ...)	if_printf(ifp, "%s: " S "\n", __func__, ##__VA_ARGS__)
115 
116 /* Defines for printing generic debug information */
117 #define DPRINTF(...)			_DBG_PRINTF(__VA_ARGS__)
118 #define DDPRINTF(...)			_DEV_DBG_PRINTF(__VA_ARGS__)
119 #define IDPRINTF(...)			_IF_DBG_PRINTF(__VA_ARGS__)
120 
121 /* Defines for printing specific debug information */
122 #define DEBUG_INIT  1
123 #define DEBUG_IOCTL 1
124 #define DEBUG_HW    1
125 
126 #define INIT_DEBUGOUT(...)		if (DEBUG_INIT) _DBG_PRINTF(__VA_ARGS__)
127 #define INIT_DBG_DEV(...)		if (DEBUG_INIT) _DEV_DBG_PRINTF(__VA_ARGS__)
128 #define INIT_DBG_IF(...)		if (DEBUG_INIT) _IF_DBG_PRINTF(__VA_ARGS__)
129 
130 #define IOCTL_DEBUGOUT(...)		if (DEBUG_IOCTL) _DBG_PRINTF(__VA_ARGS__)
131 #define IOCTL_DBG_IF2(ifp, S, ...)	if (DEBUG_IOCTL) \
132 					    if_printf(ifp, S "\n", ##__VA_ARGS__)
133 #define IOCTL_DBG_IF(...)		if (DEBUG_IOCTL) _IF_DBG_PRINTF(__VA_ARGS__)
134 
135 #define HW_DEBUGOUT(...)		if (DEBUG_HW) _DBG_PRINTF(__VA_ARGS__)
136 
137 #else /* no IXL_DEBUG */
138 #define DEBUG_INIT  0
139 #define DEBUG_IOCTL 0
140 #define DEBUG_HW    0
141 
142 #define DPRINTF(...)
143 #define DDPRINTF(...)
144 #define IDPRINTF(...)
145 
146 #define INIT_DEBUGOUT(...)
147 #define INIT_DBG_DEV(...)
148 #define INIT_DBG_IF(...)
149 #define IOCTL_DEBUGOUT(...)
150 #define IOCTL_DBG_IF2(...)
151 #define IOCTL_DBG_IF(...)
152 #define HW_DEBUGOUT(...)
153 #endif /* IXL_DEBUG */
154 
155 /* Tunables */
156 
157 /*
158  * Ring Descriptors Valid Range: 32-4096 Default Value: 1024 This value is the
159  * number of tx/rx descriptors allocated by the driver. Increasing this
160  * value allows the driver to queue more operations. Each descriptor is 16
161  * or 32 bytes (configurable in FVL)
162  */
163 #define DEFAULT_RING	1024
164 #define PERFORM_RING	2048
165 #define MAX_RING	4096
166 #define MIN_RING	32
167 
168 /*
169 ** Default number of entries in Tx queue buf_ring.
170 */
171 #define SMALL_TXBRSZ 4096
172 /* This may require mbuf cluster tuning */
173 #define DEFAULT_TXBRSZ (SMALL_TXBRSZ * SMALL_TXBRSZ)
174 
175 /* Alignment for rings */
176 #define DBA_ALIGN	128
177 
178 /*
179  * This parameter controls the maximum no of times the driver will loop in
180  * the isr. Minimum Value = 1
181  */
182 #define MAX_LOOP	10
183 
184 /*
185  * This is the max watchdog interval, ie. the time that can
186  * pass between any two TX clean operations, such only happening
187  * when the TX hardware is functioning.
188  */
189 #define IXL_WATCHDOG                   (10 * hz)
190 
191 /*
192  * This parameters control when the driver calls the routine to reclaim
193  * transmit descriptors.
194  */
195 #define IXL_TX_CLEANUP_THRESHOLD	(que->num_desc / 8)
196 #define IXL_TX_OP_THRESHOLD		(que->num_desc / 32)
197 
198 /* Flow control constants */
199 #define IXL_FC_PAUSE		0xFFFF
200 #define IXL_FC_HI		0x20000
201 #define IXL_FC_LO		0x10000
202 
203 #define MAX_MULTICAST_ADDR	128
204 
205 #define IXL_BAR			3
206 #define IXL_ADM_LIMIT		2
207 #define IXL_TSO_SIZE		65535
208 #define IXL_TX_BUF_SZ		((u32) 1514)
209 #define IXL_AQ_BUF_SZ		((u32) 4096)
210 #define IXL_RX_HDR		128
211 #define IXL_AQ_LEN		256
212 #define IXL_AQ_BUFSZ		4096
213 #define IXL_RX_LIMIT		512
214 #define IXL_RX_ITR		0
215 #define IXL_TX_ITR		1
216 #define IXL_ITR_NONE		3
217 #define IXL_QUEUE_EOL		0x7FF
218 #define IXL_MAX_FRAME		0x2600
219 #define IXL_MAX_TX_SEGS		8
220 #define IXL_MAX_TSO_SEGS	66
221 #define IXL_SPARSE_CHAIN	6
222 #define IXL_QUEUE_HUNG		0x80000000
223 #define IXL_KEYSZ		10
224 
225 /* ERJ: hardware can support ~1.5k filters between all functions */
226 #define IXL_MAX_FILTERS	256
227 #define IXL_MAX_TX_BUSY	10
228 
229 #define IXL_NVM_VERSION_LO_SHIFT	0
230 #define IXL_NVM_VERSION_LO_MASK		(0xff << IXL_NVM_VERSION_LO_SHIFT)
231 #define IXL_NVM_VERSION_HI_SHIFT	12
232 #define IXL_NVM_VERSION_HI_MASK		(0xf << IXL_NVM_VERSION_HI_SHIFT)
233 
234 
235 /*
236  * Interrupt Moderation parameters
237  */
238 #define IXL_MAX_ITR		0x07FF
239 #define IXL_ITR_100K		0x0005
240 #define IXL_ITR_20K		0x0019
241 #define IXL_ITR_8K		0x003E
242 #define IXL_ITR_4K		0x007A
243 #define IXL_ITR_DYNAMIC		0x8000
244 #define IXL_LOW_LATENCY		0
245 #define IXL_AVE_LATENCY		1
246 #define IXL_BULK_LATENCY	2
247 
248 /* MacVlan Flags */
249 #define IXL_FILTER_USED		(u16)(1 << 0)
250 #define IXL_FILTER_VLAN		(u16)(1 << 1)
251 #define IXL_FILTER_ADD		(u16)(1 << 2)
252 #define IXL_FILTER_DEL		(u16)(1 << 3)
253 #define IXL_FILTER_MC		(u16)(1 << 4)
254 
255 /* used in the vlan field of the filter when not a vlan */
256 #define IXL_VLAN_ANY		-1
257 
258 #define CSUM_OFFLOAD_IPV4	(CSUM_IP|CSUM_TCP|CSUM_UDP|CSUM_SCTP)
259 #define CSUM_OFFLOAD_IPV6	(CSUM_TCP_IPV6|CSUM_UDP_IPV6|CSUM_SCTP_IPV6)
260 #define CSUM_OFFLOAD		(CSUM_OFFLOAD_IPV4|CSUM_OFFLOAD_IPV6|CSUM_TSO)
261 
262 /* Misc flags for ixl_vsi.flags */
263 #define IXL_FLAGS_KEEP_TSO4	(1 << 0)
264 #define IXL_FLAGS_KEEP_TSO6	(1 << 1)
265 
266 #define IXL_TX_LOCK(_sc)                mtx_lock(&(_sc)->mtx)
267 #define IXL_TX_UNLOCK(_sc)              mtx_unlock(&(_sc)->mtx)
268 #define IXL_TX_LOCK_DESTROY(_sc)        mtx_destroy(&(_sc)->mtx)
269 #define IXL_TX_TRYLOCK(_sc)             mtx_trylock(&(_sc)->mtx)
270 #define IXL_TX_LOCK_ASSERT(_sc)         mtx_assert(&(_sc)->mtx, MA_OWNED)
271 
272 #define IXL_RX_LOCK(_sc)                mtx_lock(&(_sc)->mtx)
273 #define IXL_RX_UNLOCK(_sc)              mtx_unlock(&(_sc)->mtx)
274 #define IXL_RX_LOCK_DESTROY(_sc)        mtx_destroy(&(_sc)->mtx)
275 
276 #if __FreeBSD_version >= 1100000
277 #define IXL_SET_IPACKETS(vsi, count)	(vsi)->ipackets = (count)
278 #define IXL_SET_IERRORS(vsi, count)	(vsi)->ierrors = (count)
279 #define IXL_SET_OPACKETS(vsi, count)	(vsi)->opackets = (count)
280 #define IXL_SET_OERRORS(vsi, count)	(vsi)->oerrors = (count)
281 #define IXL_SET_COLLISIONS(vsi, count)	/* Do nothing; collisions is always 0. */
282 #define IXL_SET_IBYTES(vsi, count)	(vsi)->ibytes = (count)
283 #define IXL_SET_OBYTES(vsi, count)	(vsi)->obytes = (count)
284 #define IXL_SET_IMCASTS(vsi, count)	(vsi)->imcasts = (count)
285 #define IXL_SET_OMCASTS(vsi, count)	(vsi)->omcasts = (count)
286 #define IXL_SET_IQDROPS(vsi, count)	(vsi)->iqdrops = (count)
287 #define IXL_SET_OQDROPS(vsi, count)	(vsi)->iqdrops = (count)
288 #define IXL_SET_NOPROTO(vsi, count)	(vsi)->noproto = (count)
289 #else
290 #define IXL_SET_IPACKETS(vsi, count)	(vsi)->ifp->if_ipackets = (count)
291 #define IXL_SET_IERRORS(vsi, count)	(vsi)->ifp->if_ierrors = (count)
292 #define IXL_SET_OPACKETS(vsi, count)	(vsi)->ifp->if_opackets = (count)
293 #define IXL_SET_OERRORS(vsi, count)	(vsi)->ifp->if_oerrors = (count)
294 #define IXL_SET_COLLISIONS(vsi, count)	(vsi)->ifp->if_collisions = (count)
295 #define IXL_SET_IBYTES(vsi, count)	(vsi)->ifp->if_ibytes = (count)
296 #define IXL_SET_OBYTES(vsi, count)	(vsi)->ifp->if_obytes = (count)
297 #define IXL_SET_IMCASTS(vsi, count)	(vsi)->ifp->if_imcasts = (count)
298 #define IXL_SET_OMCASTS(vsi, count)	(vsi)->ifp->if_omcasts = (count)
299 #define IXL_SET_IQDROPS(vsi, count)	(vsi)->ifp->if_iqdrops = (count)
300 #define IXL_SET_OQDROPS(vsi, odrops)	(vsi)->ifp->if_snd.ifq_drops = (odrops)
301 #define IXL_SET_NOPROTO(vsi, count)	(vsi)->noproto = (count)
302 #endif
303 
304 /*
305  *****************************************************************************
306  * vendor_info_array
307  *
308  * This array contains the list of Subvendor/Subdevice IDs on which the driver
309  * should load.
310  *
311  *****************************************************************************
312  */
313 typedef struct _ixl_vendor_info_t {
314 	unsigned int    vendor_id;
315 	unsigned int    device_id;
316 	unsigned int    subvendor_id;
317 	unsigned int    subdevice_id;
318 	unsigned int    index;
319 } ixl_vendor_info_t;
320 
321 
322 struct ixl_tx_buf {
323 	u32		eop_index;
324 	struct mbuf	*m_head;
325 	bus_dmamap_t	map;
326 	bus_dma_tag_t	tag;
327 };
328 
329 struct ixl_rx_buf {
330 	struct mbuf	*m_head;
331 	struct mbuf	*m_pack;
332 	struct mbuf	*fmp;
333 	bus_dmamap_t	hmap;
334 	bus_dmamap_t	pmap;
335 };
336 
337 /*
338 ** This struct has multiple uses, multicast
339 ** addresses, vlans, and mac filters all use it.
340 */
341 struct ixl_mac_filter {
342 	SLIST_ENTRY(ixl_mac_filter) next;
343 	u8	macaddr[ETHER_ADDR_LEN];
344 	s16	vlan;
345 	u16	flags;
346 };
347 
348 
349 /*
350  * The Transmit ring control struct
351  */
352 struct tx_ring {
353         struct ixl_queue	*que;
354 	struct mtx		mtx;
355 	u32			tail;
356 	struct i40e_tx_desc	*base;
357 	struct i40e_dma_mem	dma;
358 	u16			next_avail;
359 	u16			next_to_clean;
360 	u16			atr_rate;
361 	u16			atr_count;
362 	u16			itr;
363 	u16			latency;
364 	struct ixl_tx_buf	*buffers;
365 	volatile u16		avail;
366 	u32			cmd;
367 	bus_dma_tag_t		tx_tag;
368 	bus_dma_tag_t		tso_tag;
369 	char			mtx_name[16];
370 	struct buf_ring		*br;
371 
372 	/* Used for Dynamic ITR calculation */
373 	u32			packets;
374 	u32 			bytes;
375 
376 	/* Soft Stats */
377 	u64			tx_bytes;
378 	u64			no_desc;
379 	u64			total_packets;
380 };
381 
382 
383 /*
384  * The Receive ring control struct
385  */
386 struct rx_ring {
387         struct ixl_queue	*que;
388 	struct mtx		mtx;
389 	union i40e_rx_desc	*base;
390 	struct i40e_dma_mem	dma;
391 	struct lro_ctrl		lro;
392 	bool			lro_enabled;
393 	bool			hdr_split;
394 	bool			discard;
395         u16			next_refresh;
396         u16 			next_check;
397 	u16			itr;
398 	u16			latency;
399 	char			mtx_name[16];
400 	struct ixl_rx_buf	*buffers;
401 	u32			mbuf_sz;
402 	u32			tail;
403 	bus_dma_tag_t		htag;
404 	bus_dma_tag_t		ptag;
405 
406 	/* Used for Dynamic ITR calculation */
407 	u32			packets;
408 	u32 			bytes;
409 
410 	/* Soft stats */
411 	u64			split;
412 	u64			rx_packets;
413 	u64 			rx_bytes;
414 	u64 			discarded;
415 	u64 			not_done;
416 };
417 
418 /*
419 ** Driver queue struct: this is the interrupt container
420 **  for the associated tx and rx ring pair.
421 */
422 struct ixl_queue {
423 	struct ixl_vsi		*vsi;
424 	u32			me;
425 	u32			msix;           /* This queue's MSIX vector */
426 	u32			eims;           /* This queue's EIMS bit */
427 	struct resource		*res;
428 	void			*tag;
429 	int			num_desc;	/* both tx and rx */
430 	int			busy;
431 	struct tx_ring		txr;
432 	struct rx_ring		rxr;
433 	struct task		task;
434 	struct task		tx_task;
435 	struct taskqueue	*tq;
436 
437 	/* Queue stats */
438 	u64			irqs;
439 	u64			tso;
440 	u64			mbuf_defrag_failed;
441 	u64			mbuf_hdr_failed;
442 	u64			mbuf_pkt_failed;
443 	u64			tx_map_avail;
444 	u64			tx_dma_setup;
445 	u64			dropped_pkts;
446 };
447 
448 /*
449 ** Virtual Station interface:
450 **	there would be one of these per traffic class/type
451 **	for now just one, and its embedded in the pf
452 */
453 SLIST_HEAD(ixl_ftl_head, ixl_mac_filter);
454 struct ixl_vsi {
455 	void 			*back;
456 	struct ifnet		*ifp;
457 	struct device		*dev;
458 	struct i40e_hw		*hw;
459 	struct ifmedia		media;
460 	u64			que_mask;
461 	int			id;
462 	u16			msix_base;	/* station base MSIX vector */
463 	u16			num_queues;
464 	u16			rx_itr_setting;
465 	u16			tx_itr_setting;
466 	struct ixl_queue	*queues;	/* head of queues */
467 	bool			link_active;
468 	u16			seid;
469 	u16			max_frame_size;
470 	u32			link_speed;
471 	bool			link_up;
472 	u32			fc; /* local flow ctrl setting */
473 
474 	/* MAC/VLAN Filter list */
475 	struct ixl_ftl_head ftl;
476 
477 	struct i40e_aqc_vsi_properties_data info;
478 
479 	eventhandler_tag 	vlan_attach;
480 	eventhandler_tag 	vlan_detach;
481 	u16			num_vlans;
482 
483 	/* Per-VSI stats from hardware */
484 	struct i40e_eth_stats	eth_stats;
485 	struct i40e_eth_stats	eth_stats_offsets;
486 	bool 			stat_offsets_loaded;
487 	/* VSI stat counters */
488 	u64			ipackets;
489 	u64			ierrors;
490 	u64			opackets;
491 	u64			oerrors;
492 	u64			ibytes;
493 	u64			obytes;
494 	u64			imcasts;
495 	u64			omcasts;
496 	u64			iqdrops;
497 	u64			oqdrops;
498 	u64			noproto;
499 
500 	/* Driver statistics */
501 	u64			hw_filters_del;
502 	u64			hw_filters_add;
503 
504 	/* Misc. */
505 	u64 			active_queues;
506 	u64 			flags;
507 };
508 
509 /*
510 ** Find the number of unrefreshed RX descriptors
511 */
512 static inline u16
513 ixl_rx_unrefreshed(struct ixl_queue *que)
514 {
515         struct rx_ring	*rxr = &que->rxr;
516 
517 	if (rxr->next_check > rxr->next_refresh)
518 		return (rxr->next_check - rxr->next_refresh - 1);
519 	else
520 		return ((que->num_desc + rxr->next_check) -
521 		    rxr->next_refresh - 1);
522 }
523 
524 /*
525 ** Find the next available unused filter
526 */
527 static inline struct ixl_mac_filter *
528 ixl_get_filter(struct ixl_vsi *vsi)
529 {
530 	struct ixl_mac_filter  *f;
531 
532 	/* create a new empty filter */
533 	f = malloc(sizeof(struct ixl_mac_filter),
534 	    M_DEVBUF, M_NOWAIT | M_ZERO);
535 	if (f)
536 		SLIST_INSERT_HEAD(&vsi->ftl, f, next);
537 
538 	return (f);
539 }
540 
541 /*
542 ** Compare two ethernet addresses
543 */
544 static inline bool
545 cmp_etheraddr(u8 *ea1, u8 *ea2)
546 {
547 	bool cmp = FALSE;
548 
549 	if ((ea1[0] == ea2[0]) && (ea1[1] == ea2[1]) &&
550 	    (ea1[2] == ea2[2]) && (ea1[3] == ea2[3]) &&
551 	    (ea1[4] == ea2[4]) && (ea1[5] == ea2[5]))
552 		cmp = TRUE;
553 
554 	return (cmp);
555 }
556 
557 /*
558  * Info for stats sysctls
559  */
560 struct ixl_sysctl_info {
561 	u64	*stat;
562 	char	*name;
563 	char	*description;
564 };
565 
566 extern int ixl_atr_rate;
567 
568 /*
569 ** ixl_fw_version_str - format the FW and NVM version strings
570 */
571 static inline char *
572 ixl_fw_version_str(struct i40e_hw *hw)
573 {
574 	static char buf[32];
575 
576 	snprintf(buf, sizeof(buf),
577 	    "f%d.%d a%d.%d n%02x.%02x e%08x",
578 	    hw->aq.fw_maj_ver, hw->aq.fw_min_ver,
579 	    hw->aq.api_maj_ver, hw->aq.api_min_ver,
580 	    (hw->nvm.version & IXL_NVM_VERSION_HI_MASK) >>
581 	    IXL_NVM_VERSION_HI_SHIFT,
582 	    (hw->nvm.version & IXL_NVM_VERSION_LO_MASK) >>
583 	    IXL_NVM_VERSION_LO_SHIFT,
584 	    hw->nvm.eetrack);
585 	return buf;
586 }
587 
588 /*********************************************************************
589  *  TXRX Function prototypes
590  *********************************************************************/
591 int	ixl_allocate_tx_data(struct ixl_queue *);
592 int	ixl_allocate_rx_data(struct ixl_queue *);
593 void	ixl_init_tx_ring(struct ixl_queue *);
594 int	ixl_init_rx_ring(struct ixl_queue *);
595 bool	ixl_rxeof(struct ixl_queue *, int);
596 bool	ixl_txeof(struct ixl_queue *);
597 int	ixl_mq_start(struct ifnet *, struct mbuf *);
598 int	ixl_mq_start_locked(struct ifnet *, struct tx_ring *);
599 void	ixl_deferred_mq_start(void *, int);
600 void	ixl_qflush(struct ifnet *);
601 void	ixl_free_vsi(struct ixl_vsi *);
602 void	ixl_free_que_tx(struct ixl_queue *);
603 void	ixl_free_que_rx(struct ixl_queue *);
604 #ifdef IXL_FDIR
605 void	ixl_atr(struct ixl_queue *, struct tcphdr *, int);
606 #endif
607 #if __FreeBSD_version >= 1100000
608 uint64_t ixl_get_counter(if_t ifp, ift_counter cnt);
609 #endif
610 
611 #endif /* _IXL_H_ */
612