xref: /dflybsd-src/sys/dev/netif/ix/if_ix.h (revision 189a0ff3761b47cd5d8fa4e38e0c61209c3a91ac)
179251f5eSSepherosa Ziehau /*
279251f5eSSepherosa Ziehau  * Copyright (c) 2001-2013, Intel Corporation
379251f5eSSepherosa Ziehau  * All rights reserved.
479251f5eSSepherosa Ziehau  *
579251f5eSSepherosa Ziehau  * Redistribution and use in source and binary forms, with or without
679251f5eSSepherosa Ziehau  * modification, are permitted provided that the following conditions are met:
779251f5eSSepherosa Ziehau  *
879251f5eSSepherosa Ziehau  *  1. Redistributions of source code must retain the above copyright notice,
979251f5eSSepherosa Ziehau  *     this list of conditions and the following disclaimer.
1079251f5eSSepherosa Ziehau  *
1179251f5eSSepherosa Ziehau  *  2. Redistributions in binary form must reproduce the above copyright
1279251f5eSSepherosa Ziehau  *     notice, this list of conditions and the following disclaimer in the
1379251f5eSSepherosa Ziehau  *     documentation and/or other materials provided with the distribution.
1479251f5eSSepherosa Ziehau  *
1579251f5eSSepherosa Ziehau  *  3. Neither the name of the Intel Corporation nor the names of its
1679251f5eSSepherosa Ziehau  *     contributors may be used to endorse or promote products derived from
1779251f5eSSepherosa Ziehau  *     this software without specific prior written permission.
1879251f5eSSepherosa Ziehau  *
1979251f5eSSepherosa Ziehau  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2079251f5eSSepherosa Ziehau  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2179251f5eSSepherosa Ziehau  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2279251f5eSSepherosa Ziehau  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2379251f5eSSepherosa Ziehau  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2479251f5eSSepherosa Ziehau  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2579251f5eSSepherosa Ziehau  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2679251f5eSSepherosa Ziehau  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2779251f5eSSepherosa Ziehau  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2879251f5eSSepherosa Ziehau  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2979251f5eSSepherosa Ziehau  * POSSIBILITY OF SUCH DAMAGE.
3079251f5eSSepherosa Ziehau  */
3179251f5eSSepherosa Ziehau 
3279251f5eSSepherosa Ziehau #ifndef _IF_IX_H_
3379251f5eSSepherosa Ziehau #define _IF_IX_H_
3479251f5eSSepherosa Ziehau 
3579251f5eSSepherosa Ziehau /* Tunables */
3679251f5eSSepherosa Ziehau 
3779251f5eSSepherosa Ziehau /*
38*189a0ff3SSepherosa Ziehau  * MSI-X count
39*189a0ff3SSepherosa Ziehau  */
40*189a0ff3SSepherosa Ziehau #define IX_MAX_MSIX		64
41*189a0ff3SSepherosa Ziehau #define IX_MAX_MSIX_82598	16
42*189a0ff3SSepherosa Ziehau 
43*189a0ff3SSepherosa Ziehau /*
4479251f5eSSepherosa Ziehau  * RX ring count
4579251f5eSSepherosa Ziehau  */
4679251f5eSSepherosa Ziehau #define IX_MAX_RXRING		16
4779251f5eSSepherosa Ziehau #define IX_MIN_RXRING_RSS	2
4879251f5eSSepherosa Ziehau 
4979251f5eSSepherosa Ziehau /*
50*189a0ff3SSepherosa Ziehau  * TX ring count
51*189a0ff3SSepherosa Ziehau  */
52*189a0ff3SSepherosa Ziehau #define IX_MAX_TXRING_82598	32
53*189a0ff3SSepherosa Ziehau #define IX_MAX_TXRING_82599	64
54*189a0ff3SSepherosa Ziehau #define IX_MAX_TXRING_X540	64
55*189a0ff3SSepherosa Ziehau 
56*189a0ff3SSepherosa Ziehau /*
5779251f5eSSepherosa Ziehau  * Default number of segments received before writing to RX related registers
5879251f5eSSepherosa Ziehau  */
5979251f5eSSepherosa Ziehau #define IX_DEF_RXWREG_NSEGS	32
6079251f5eSSepherosa Ziehau 
6179251f5eSSepherosa Ziehau /*
6279251f5eSSepherosa Ziehau  * Default number of segments sent before writing to TX related registers
6379251f5eSSepherosa Ziehau  */
6479251f5eSSepherosa Ziehau #define IX_DEF_TXWREG_NSEGS	8
6579251f5eSSepherosa Ziehau 
6679251f5eSSepherosa Ziehau /*
6779251f5eSSepherosa Ziehau  * TxDescriptors Valid Range: 64-4096 Default Value: 256 This value is the
6879251f5eSSepherosa Ziehau  * number of transmit descriptors allocated by the driver. Increasing this
6979251f5eSSepherosa Ziehau  * value allows the driver to queue more transmits. Each descriptor is 16
7079251f5eSSepherosa Ziehau  * bytes. Performance tests have show the 2K value to be optimal for top
7179251f5eSSepherosa Ziehau  * performance.
7279251f5eSSepherosa Ziehau  */
7379251f5eSSepherosa Ziehau #define IX_DEF_TXD		1024
7479251f5eSSepherosa Ziehau #define IX_PERF_TXD		2048
7579251f5eSSepherosa Ziehau #define IX_MAX_TXD		4096
7679251f5eSSepherosa Ziehau #define IX_MIN_TXD		64
7779251f5eSSepherosa Ziehau 
7879251f5eSSepherosa Ziehau /*
7979251f5eSSepherosa Ziehau  * RxDescriptors Valid Range: 64-4096 Default Value: 256 This value is the
8079251f5eSSepherosa Ziehau  * number of receive descriptors allocated for each RX queue. Increasing this
8179251f5eSSepherosa Ziehau  * value allows the driver to buffer more incoming packets. Each descriptor
8279251f5eSSepherosa Ziehau  * is 16 bytes.  A receive buffer is also allocated for each descriptor.
8379251f5eSSepherosa Ziehau  *
8479251f5eSSepherosa Ziehau  * Note: with 8 rings and a dual port card, it is possible to bump up
8579251f5eSSepherosa Ziehau  *	against the system mbuf pool limit, you can tune nmbclusters
8679251f5eSSepherosa Ziehau  *	to adjust for this.
8779251f5eSSepherosa Ziehau  */
8879251f5eSSepherosa Ziehau #define IX_DEF_RXD		1024
8979251f5eSSepherosa Ziehau #define IX_PERF_RXD		2048
9079251f5eSSepherosa Ziehau #define IX_MAX_RXD		4096
9179251f5eSSepherosa Ziehau #define IX_MIN_RXD		64
9279251f5eSSepherosa Ziehau 
9379251f5eSSepherosa Ziehau /* Alignment for rings */
9479251f5eSSepherosa Ziehau #define IX_DBA_ALIGN		128
9579251f5eSSepherosa Ziehau 
9679251f5eSSepherosa Ziehau #define IX_MAX_FRAME_SIZE	0x3F00
9779251f5eSSepherosa Ziehau 
9879251f5eSSepherosa Ziehau /* Flow control constants */
9979251f5eSSepherosa Ziehau #define IX_FC_PAUSE		0xFFFF
10079251f5eSSepherosa Ziehau #define IX_FC_HI		0x20000
10179251f5eSSepherosa Ziehau #define IX_FC_LO		0x10000
10279251f5eSSepherosa Ziehau 
10379251f5eSSepherosa Ziehau /*
10479251f5eSSepherosa Ziehau  * RSS related registers
10579251f5eSSepherosa Ziehau  */
10679251f5eSSepherosa Ziehau #define IX_NRSSRK		10
10779251f5eSSepherosa Ziehau #define IX_RSSRK_SIZE		4
10879251f5eSSepherosa Ziehau #define IX_RSSRK_VAL(key, i)	(key[(i) * IX_RSSRK_SIZE] | \
10979251f5eSSepherosa Ziehau 				 key[(i) * IX_RSSRK_SIZE + 1] << 8 | \
11079251f5eSSepherosa Ziehau 				 key[(i) * IX_RSSRK_SIZE + 2] << 16 | \
11179251f5eSSepherosa Ziehau 				 key[(i) * IX_RSSRK_SIZE + 3] << 24)
11279251f5eSSepherosa Ziehau #define IX_NRETA		32
11379251f5eSSepherosa Ziehau #define IX_RETA_SIZE		4
11479251f5eSSepherosa Ziehau 
11579251f5eSSepherosa Ziehau /*
11679251f5eSSepherosa Ziehau  * EITR
11779251f5eSSepherosa Ziehau  */
11879251f5eSSepherosa Ziehau #define IX_EITR_INTVL_MASK_82598 0xffff
11979251f5eSSepherosa Ziehau #define IX_EITR_INTVL_MASK	0x0fff
12079251f5eSSepherosa Ziehau #define IX_EITR_INTVL_RSVD_MASK	0x0007
12179251f5eSSepherosa Ziehau #define IX_EITR_INTVL_MIN	IXGBE_MIN_EITR
12279251f5eSSepherosa Ziehau #define IX_EITR_INTVL_MAX	IXGBE_MAX_EITR
12379251f5eSSepherosa Ziehau 
12479251f5eSSepherosa Ziehau /*
12579251f5eSSepherosa Ziehau  * Used for optimizing small rx mbufs.  Effort is made to keep the copy
12679251f5eSSepherosa Ziehau  * small and aligned for the CPU L1 cache.
12779251f5eSSepherosa Ziehau  *
12879251f5eSSepherosa Ziehau  * MHLEN is typically 168 bytes, giving us 8-byte alignment.  Getting
12979251f5eSSepherosa Ziehau  * 32 byte alignment needed for the fast bcopy results in 8 bytes being
13079251f5eSSepherosa Ziehau  * wasted.  Getting 64 byte alignment, which _should_ be ideal for
13179251f5eSSepherosa Ziehau  * modern Intel CPUs, results in 40 bytes wasted and a significant drop
13279251f5eSSepherosa Ziehau  * in observed efficiency of the optimization, 97.9% -> 81.8%.
13379251f5eSSepherosa Ziehau  */
13479251f5eSSepherosa Ziehau #define IX_RX_COPY_LEN		160
13579251f5eSSepherosa Ziehau #define IX_RX_COPY_ALIGN	(MHLEN - IX_RX_COPY_LEN)
13679251f5eSSepherosa Ziehau 
13779251f5eSSepherosa Ziehau #define IX_MAX_MCASTADDR	128
13879251f5eSSepherosa Ziehau 
139*189a0ff3SSepherosa Ziehau #define IX_MSIX_BAR_82598	3
140*189a0ff3SSepherosa Ziehau #define IX_MSIX_BAR_82599	4
14179251f5eSSepherosa Ziehau 
14279251f5eSSepherosa Ziehau #define IX_TSO_SIZE		(IP_MAXPACKET + \
14379251f5eSSepherosa Ziehau 				 sizeof(struct ether_vlan_header))
14479251f5eSSepherosa Ziehau 
14579251f5eSSepherosa Ziehau /*
14679251f5eSSepherosa Ziehau  * MUST be less than 38.  Though 82598 does not have this limit,
14779251f5eSSepherosa Ziehau  * we don't want long TX chain.  33 should be large enough even
14879251f5eSSepherosa Ziehau  * for 64K TSO (32 x 2K mbuf cluster and 1 x mbuf header).
14979251f5eSSepherosa Ziehau  *
15079251f5eSSepherosa Ziehau  * Reference:
15179251f5eSSepherosa Ziehau  * - 82599 datasheet 7.2.1.1
15279251f5eSSepherosa Ziehau  * - X540 datasheet 7.2.1.1
15379251f5eSSepherosa Ziehau  */
15479251f5eSSepherosa Ziehau #define IX_MAX_SCATTER		33
15579251f5eSSepherosa Ziehau #define IX_TX_RESERVED		3	/* 1 for TX ctx, 2 reserved */
15679251f5eSSepherosa Ziehau 
15779251f5eSSepherosa Ziehau /* MSI and legacy interrupt */
15879251f5eSSepherosa Ziehau #define IX_TX_INTR_VEC		0
15979251f5eSSepherosa Ziehau #define IX_TX_INTR_MASK		(1 << IX_TX_INTR_VEC)
16079251f5eSSepherosa Ziehau #define IX_RX0_INTR_VEC		1
16179251f5eSSepherosa Ziehau #define IX_RX0_INTR_MASK	(1 << IX_RX0_INTR_VEC)
16279251f5eSSepherosa Ziehau #define IX_RX1_INTR_VEC		2
16379251f5eSSepherosa Ziehau #define IX_RX1_INTR_MASK	(1 << IX_RX1_INTR_VEC)
16479251f5eSSepherosa Ziehau 
16579251f5eSSepherosa Ziehau #define IX_INTR_RATE		8000
166*189a0ff3SSepherosa Ziehau #define IX_MSIX_RX_RATE		8000
167*189a0ff3SSepherosa Ziehau #define IX_MSIX_TX_RATE		6000
16879251f5eSSepherosa Ziehau 
16979251f5eSSepherosa Ziehau /* IOCTL define to gather SFP+ Diagnostic data */
17079251f5eSSepherosa Ziehau #define SIOCGI2C		SIOCGIFGENERIC
17179251f5eSSepherosa Ziehau 
17279251f5eSSepherosa Ziehau /* TX checksum offload */
17379251f5eSSepherosa Ziehau #define CSUM_OFFLOAD		(CSUM_IP|CSUM_TCP|CSUM_UDP)
17479251f5eSSepherosa Ziehau 
175*189a0ff3SSepherosa Ziehau #define IX_EICR_STATUS		(IXGBE_EICR_LSC | IXGBE_EICR_ECC | \
176*189a0ff3SSepherosa Ziehau 				 IXGBE_EICR_GPI_SDP1 | IXGBE_EICR_GPI_SDP2 | \
177*189a0ff3SSepherosa Ziehau 				 IXGBE_EICR_TS)
178*189a0ff3SSepherosa Ziehau 
17979251f5eSSepherosa Ziehau /* This is used to get SFP+ module data */
18079251f5eSSepherosa Ziehau struct ix_i2c_req {
18179251f5eSSepherosa Ziehau 	uint8_t		dev_addr;
18279251f5eSSepherosa Ziehau 	uint8_t		offset;
18379251f5eSSepherosa Ziehau 	uint8_t		len;
18479251f5eSSepherosa Ziehau 	uint8_t		data[8];
18579251f5eSSepherosa Ziehau };
18679251f5eSSepherosa Ziehau 
18779251f5eSSepherosa Ziehau struct ix_tx_buf {
18879251f5eSSepherosa Ziehau 	struct mbuf	*m_head;
18979251f5eSSepherosa Ziehau 	bus_dmamap_t	map;
19079251f5eSSepherosa Ziehau };
19179251f5eSSepherosa Ziehau 
19279251f5eSSepherosa Ziehau struct ix_rx_buf {
19379251f5eSSepherosa Ziehau 	struct mbuf	*m_head;
19479251f5eSSepherosa Ziehau 	struct mbuf	*fmp;
19579251f5eSSepherosa Ziehau 	struct mbuf	*lmp;
19679251f5eSSepherosa Ziehau 	bus_dmamap_t	map;
19779251f5eSSepherosa Ziehau 	bus_addr_t	paddr;
19879251f5eSSepherosa Ziehau 	u_int		flags;
19979251f5eSSepherosa Ziehau #define IX_RX_COPY	0x1
20079251f5eSSepherosa Ziehau };
20179251f5eSSepherosa Ziehau 
20279251f5eSSepherosa Ziehau struct ix_softc;
20379251f5eSSepherosa Ziehau 
20479251f5eSSepherosa Ziehau struct ix_tx_ring {
20579251f5eSSepherosa Ziehau 	struct lwkt_serialize	tx_serialize;
20679251f5eSSepherosa Ziehau 	struct ifaltq_subque	*tx_ifsq;
20779251f5eSSepherosa Ziehau 	struct ix_softc		*tx_sc;
20879251f5eSSepherosa Ziehau 	volatile uint32_t	*tx_hdr;
20979251f5eSSepherosa Ziehau 	union ixgbe_adv_tx_desc	*tx_base;
21079251f5eSSepherosa Ziehau 	struct ix_tx_buf	*tx_buf;
21179251f5eSSepherosa Ziehau 	bus_dma_tag_t		tx_tag;
21279251f5eSSepherosa Ziehau 	uint32_t		tx_idx;
21379251f5eSSepherosa Ziehau 	uint16_t		tx_avail;
21479251f5eSSepherosa Ziehau 	uint16_t		tx_next_avail;
21579251f5eSSepherosa Ziehau 	uint16_t		tx_next_clean;
21679251f5eSSepherosa Ziehau 	uint16_t		tx_ndesc;
21779251f5eSSepherosa Ziehau 	uint16_t		tx_wreg_nsegs;
21879251f5eSSepherosa Ziehau 	uint16_t		tx_intr_nsegs;
21979251f5eSSepherosa Ziehau 	uint16_t		tx_nsegs;
22079251f5eSSepherosa Ziehau 	int16_t			tx_intr_vec;
22179251f5eSSepherosa Ziehau 	int			tx_intr_cpuid;
222*189a0ff3SSepherosa Ziehau 	uint32_t		tx_eims;
223*189a0ff3SSepherosa Ziehau 	uint32_t		tx_eims_val;
22479251f5eSSepherosa Ziehau 	struct ifsubq_watchdog	tx_watchdog;
22579251f5eSSepherosa Ziehau 
22679251f5eSSepherosa Ziehau 	bus_dma_tag_t		tx_base_dtag;
22779251f5eSSepherosa Ziehau 	bus_dmamap_t		tx_base_map;
22879251f5eSSepherosa Ziehau 	bus_addr_t		tx_base_paddr;
22979251f5eSSepherosa Ziehau 
23079251f5eSSepherosa Ziehau 	bus_dma_tag_t		tx_hdr_dtag;
23179251f5eSSepherosa Ziehau 	bus_dmamap_t		tx_hdr_map;
23279251f5eSSepherosa Ziehau 	bus_addr_t		tx_hdr_paddr;
23379251f5eSSepherosa Ziehau } __cachealign;
23479251f5eSSepherosa Ziehau 
23579251f5eSSepherosa Ziehau struct ix_rx_ring {
23679251f5eSSepherosa Ziehau 	struct lwkt_serialize	rx_serialize;
23779251f5eSSepherosa Ziehau 	struct ix_softc		*rx_sc;
23879251f5eSSepherosa Ziehau 	union ixgbe_adv_rx_desc	*rx_base;
23979251f5eSSepherosa Ziehau 	struct ix_rx_buf	*rx_buf;
24079251f5eSSepherosa Ziehau 	bus_dma_tag_t		rx_tag;
24179251f5eSSepherosa Ziehau 	bus_dmamap_t		rx_sparemap;
24279251f5eSSepherosa Ziehau 	uint32_t		rx_idx;
24379251f5eSSepherosa Ziehau 	uint16_t		rx_flags;
24479251f5eSSepherosa Ziehau #define IX_RXRING_FLAG_LRO	0x01
24579251f5eSSepherosa Ziehau #define IX_RXRING_FLAG_DISC	0x02
24679251f5eSSepherosa Ziehau 	uint16_t 		rx_next_check;
24779251f5eSSepherosa Ziehau 	uint16_t		rx_ndesc;
24879251f5eSSepherosa Ziehau 	uint16_t		rx_mbuf_sz;
24979251f5eSSepherosa Ziehau 	uint16_t		rx_wreg_nsegs;
25079251f5eSSepherosa Ziehau 	int16_t			rx_intr_vec;
251*189a0ff3SSepherosa Ziehau 	uint32_t		rx_eims;
252*189a0ff3SSepherosa Ziehau 	uint32_t		rx_eims_val;
253*189a0ff3SSepherosa Ziehau 	struct ix_tx_ring	*rx_txr;	/* piggybacked TX ring */
25479251f5eSSepherosa Ziehau 
25579251f5eSSepherosa Ziehau #ifdef IX_RSS_DEBUG
25679251f5eSSepherosa Ziehau 	u_long			rx_pkts;
25779251f5eSSepherosa Ziehau #endif
25879251f5eSSepherosa Ziehau 
25979251f5eSSepherosa Ziehau 	bus_dma_tag_t		rx_base_dtag;
26079251f5eSSepherosa Ziehau 	bus_dmamap_t		rx_base_map;
26179251f5eSSepherosa Ziehau 	bus_addr_t		rx_base_paddr;
26279251f5eSSepherosa Ziehau } __cachealign;
26379251f5eSSepherosa Ziehau 
26479251f5eSSepherosa Ziehau struct ix_intr_data {
26579251f5eSSepherosa Ziehau 	struct lwkt_serialize	*intr_serialize;
26679251f5eSSepherosa Ziehau 	driver_intr_t		*intr_func;
26779251f5eSSepherosa Ziehau 	void			*intr_hand;
26879251f5eSSepherosa Ziehau 	struct resource		*intr_res;
26979251f5eSSepherosa Ziehau 	void			*intr_funcarg;
27079251f5eSSepherosa Ziehau 	int			intr_rid;
27179251f5eSSepherosa Ziehau 	int			intr_cpuid;
27279251f5eSSepherosa Ziehau 	int			intr_rate;
27379251f5eSSepherosa Ziehau 	int			intr_use;
27479251f5eSSepherosa Ziehau #define IX_INTR_USE_RXTX	0
27579251f5eSSepherosa Ziehau #define IX_INTR_USE_STATUS	1
27679251f5eSSepherosa Ziehau #define IX_INTR_USE_RX		2
27779251f5eSSepherosa Ziehau #define IX_INTR_USE_TX		3
27879251f5eSSepherosa Ziehau 	const char		*intr_desc;
27979251f5eSSepherosa Ziehau 	char			intr_desc0[64];
28079251f5eSSepherosa Ziehau };
28179251f5eSSepherosa Ziehau 
28279251f5eSSepherosa Ziehau struct ix_softc {
28379251f5eSSepherosa Ziehau 	struct arpcom		arpcom;
28479251f5eSSepherosa Ziehau 
28579251f5eSSepherosa Ziehau 	struct ixgbe_hw		hw;
28679251f5eSSepherosa Ziehau 	struct ixgbe_osdep	osdep;
28779251f5eSSepherosa Ziehau 
28879251f5eSSepherosa Ziehau 	struct lwkt_serialize	main_serialize;
28979251f5eSSepherosa Ziehau 	uint32_t		intr_mask;
29079251f5eSSepherosa Ziehau 
29179251f5eSSepherosa Ziehau 	boolean_t		link_active;
29279251f5eSSepherosa Ziehau 
29379251f5eSSepherosa Ziehau 	int			rx_ring_inuse;
294*189a0ff3SSepherosa Ziehau 	int			tx_ring_inuse;
295*189a0ff3SSepherosa Ziehau 
29679251f5eSSepherosa Ziehau 	struct ix_rx_ring	*rx_rings;
297*189a0ff3SSepherosa Ziehau 	struct ix_tx_ring	*tx_rings;
29879251f5eSSepherosa Ziehau 
29979251f5eSSepherosa Ziehau 	struct callout		timer;
30079251f5eSSepherosa Ziehau 	int			timer_cpuid;
30179251f5eSSepherosa Ziehau 
30279251f5eSSepherosa Ziehau 	uint32_t		optics;
30379251f5eSSepherosa Ziehau 	uint32_t		fc;		/* local flow ctrl setting */
30479251f5eSSepherosa Ziehau 	uint32_t		link_speed;
30579251f5eSSepherosa Ziehau 	bool			link_up;
30679251f5eSSepherosa Ziehau 	boolean_t		sfp_probe;	/* plyggable optics */
30779251f5eSSepherosa Ziehau 
30879251f5eSSepherosa Ziehau 	struct ixgbe_hw_stats 	stats;
30979251f5eSSepherosa Ziehau 
310*189a0ff3SSepherosa Ziehau 	int			rx_ring_cnt;
311*189a0ff3SSepherosa Ziehau 	int			rx_ring_msix;
312*189a0ff3SSepherosa Ziehau 
313*189a0ff3SSepherosa Ziehau 	int			tx_ring_cnt;
314*189a0ff3SSepherosa Ziehau 	int			tx_ring_msix;
315*189a0ff3SSepherosa Ziehau 
31679251f5eSSepherosa Ziehau 	int			intr_type;
31779251f5eSSepherosa Ziehau 	int			intr_cnt;
31879251f5eSSepherosa Ziehau 	struct ix_intr_data	*intr_data;
31979251f5eSSepherosa Ziehau 
32079251f5eSSepherosa Ziehau 	/* sysctl tree glue */
32179251f5eSSepherosa Ziehau 	struct sysctl_ctx_list	sysctl_ctx;
32279251f5eSSepherosa Ziehau 	struct sysctl_oid	*sysctl_tree;
32379251f5eSSepherosa Ziehau 
32479251f5eSSepherosa Ziehau 	device_t		dev;
32579251f5eSSepherosa Ziehau 	bus_dma_tag_t		parent_tag;
32679251f5eSSepherosa Ziehau 	struct ifmedia		media;
32779251f5eSSepherosa Ziehau 
32879251f5eSSepherosa Ziehau 	struct resource		*mem_res;
32979251f5eSSepherosa Ziehau 	int			mem_rid;
33079251f5eSSepherosa Ziehau 
331*189a0ff3SSepherosa Ziehau 	struct resource 	*msix_mem_res;
332*189a0ff3SSepherosa Ziehau 	int			msix_mem_rid;
333*189a0ff3SSepherosa Ziehau 
33479251f5eSSepherosa Ziehau 	int			nserialize;
33579251f5eSSepherosa Ziehau 	struct lwkt_serialize	**serializes;
33679251f5eSSepherosa Ziehau 
33779251f5eSSepherosa Ziehau 	uint8_t			*mta;		/* Multicast array memory */
33879251f5eSSepherosa Ziehau 
33979251f5eSSepherosa Ziehau 	int			if_flags;
34079251f5eSSepherosa Ziehau 	int			advspeed;	/* advertised link speeds */
34179251f5eSSepherosa Ziehau 	uint16_t		max_frame_size;
342*189a0ff3SSepherosa Ziehau 	int16_t			sts_msix_vec;	/* status MSI-X vector */
34379251f5eSSepherosa Ziehau 
34479251f5eSSepherosa Ziehau #ifdef IX_RSS_DEBUG
34579251f5eSSepherosa Ziehau 	int			rss_debug;
34679251f5eSSepherosa Ziehau #endif
34779251f5eSSepherosa Ziehau };
34879251f5eSSepherosa Ziehau 
34979251f5eSSepherosa Ziehau #define IX_ENABLE_HWRSS(sc)	((sc)->rx_ring_cnt > 1)
35079251f5eSSepherosa Ziehau #define IX_ENABLE_HWTSS(sc)	((sc)->tx_ring_cnt > 1)
35179251f5eSSepherosa Ziehau 
35279251f5eSSepherosa Ziehau #endif /* _IF_IX_H_ */
353