xref: /freebsd-src/sys/dev/ice/ice_lib.h (revision 6e5650896fe47398e49e3d81af60cc60dbb09e6e)
171d10453SEric Joyner /* SPDX-License-Identifier: BSD-3-Clause */
2015f8cc5SEric Joyner /*  Copyright (c) 2024, Intel Corporation
371d10453SEric Joyner  *  All rights reserved.
471d10453SEric Joyner  *
571d10453SEric Joyner  *  Redistribution and use in source and binary forms, with or without
671d10453SEric Joyner  *  modification, are permitted provided that the following conditions are met:
771d10453SEric Joyner  *
871d10453SEric Joyner  *   1. Redistributions of source code must retain the above copyright notice,
971d10453SEric Joyner  *      this list of conditions and the following disclaimer.
1071d10453SEric Joyner  *
1171d10453SEric Joyner  *   2. Redistributions in binary form must reproduce the above copyright
1271d10453SEric Joyner  *      notice, this list of conditions and the following disclaimer in the
1371d10453SEric Joyner  *      documentation and/or other materials provided with the distribution.
1471d10453SEric Joyner  *
1571d10453SEric Joyner  *   3. Neither the name of the Intel Corporation nor the names of its
1671d10453SEric Joyner  *      contributors may be used to endorse or promote products derived from
1771d10453SEric Joyner  *      this software without specific prior written permission.
1871d10453SEric Joyner  *
1971d10453SEric Joyner  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2071d10453SEric Joyner  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2171d10453SEric Joyner  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2271d10453SEric Joyner  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2371d10453SEric Joyner  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2471d10453SEric Joyner  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2571d10453SEric Joyner  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2671d10453SEric Joyner  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2771d10453SEric Joyner  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2871d10453SEric Joyner  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2971d10453SEric Joyner  *  POSSIBILITY OF SUCH DAMAGE.
3071d10453SEric Joyner  */
3171d10453SEric Joyner 
3271d10453SEric Joyner /**
3371d10453SEric Joyner  * @file ice_lib.h
3471d10453SEric Joyner  * @brief header for generic device and sysctl functions
3571d10453SEric Joyner  *
3671d10453SEric Joyner  * Contains definitions and function declarations for the ice_lib.c file. It
3771d10453SEric Joyner  * does not depend on the iflib networking stack.
3871d10453SEric Joyner  */
3971d10453SEric Joyner 
4071d10453SEric Joyner #ifndef _ICE_LIB_H_
4171d10453SEric Joyner #define _ICE_LIB_H_
4271d10453SEric Joyner 
43*6e565089SBrian Poole /* include kernel options first */
44*6e565089SBrian Poole #include "ice_opts.h"
45*6e565089SBrian Poole 
4671d10453SEric Joyner #include <sys/types.h>
4771d10453SEric Joyner #include <sys/bus.h>
4871d10453SEric Joyner #include <sys/rman.h>
4971d10453SEric Joyner #include <sys/socket.h>
5071d10453SEric Joyner #include <sys/sbuf.h>
5171d10453SEric Joyner #include <sys/sysctl.h>
5271d10453SEric Joyner #include <sys/syslog.h>
5371d10453SEric Joyner #include <sys/module.h>
5471d10453SEric Joyner #include <sys/proc.h>
5571d10453SEric Joyner 
5671d10453SEric Joyner #include <net/if.h>
5771d10453SEric Joyner #include <net/if_var.h>
5871d10453SEric Joyner #include <net/if_media.h>
5971d10453SEric Joyner #include <net/ethernet.h>
609e54973fSEric Joyner #include <net/if_types.h>
6171d10453SEric Joyner 
6271d10453SEric Joyner #include <sys/bitstring.h>
6371d10453SEric Joyner 
6471d10453SEric Joyner #include "ice_dcb.h"
6571d10453SEric Joyner #include "ice_type.h"
6671d10453SEric Joyner #include "ice_common.h"
6771d10453SEric Joyner #include "ice_flow.h"
6871d10453SEric Joyner #include "ice_sched.h"
6971d10453SEric Joyner #include "ice_resmgr.h"
7071d10453SEric Joyner 
718a13362dSEric Joyner #include "ice_rdma_internal.h"
728a13362dSEric Joyner 
7371d10453SEric Joyner #include "ice_rss.h"
7471d10453SEric Joyner 
7571d10453SEric Joyner /* Hide debug sysctls unless INVARIANTS is enabled */
7671d10453SEric Joyner #ifdef INVARIANTS
7771d10453SEric Joyner #define ICE_CTLFLAG_DEBUG 0
7871d10453SEric Joyner #else
7971d10453SEric Joyner #define ICE_CTLFLAG_DEBUG CTLFLAG_SKIP
8071d10453SEric Joyner #endif
8171d10453SEric Joyner 
8271d10453SEric Joyner /**
8371d10453SEric Joyner  * for_each_set_bit - For loop over each set bit in a bit string
8471d10453SEric Joyner  * @bit: storage for the bit index
8571d10453SEric Joyner  * @data: address of data block to loop over
8671d10453SEric Joyner  * @nbits: maximum number of bits to loop over
8771d10453SEric Joyner  *
8871d10453SEric Joyner  * macro to create a for loop over a bit string, which runs the body once for
8971d10453SEric Joyner  * each bit that is set in the string. The bit variable will be set to the
9071d10453SEric Joyner  * index of each set bit in the string, with zero representing the first bit.
9171d10453SEric Joyner  */
9271d10453SEric Joyner #define for_each_set_bit(bit, data, nbits) \
9371d10453SEric Joyner 	for (bit_ffs((bitstr_t *)(data), (nbits), &(bit)); \
9471d10453SEric Joyner 	     (bit) != -1; \
9571d10453SEric Joyner 	     bit_ffs_at((bitstr_t *)(data), (bit) + 1, (nbits), &(bit)))
9671d10453SEric Joyner 
9771d10453SEric Joyner /**
9871d10453SEric Joyner  * @var broadcastaddr
9971d10453SEric Joyner  * @brief broadcast MAC address
10071d10453SEric Joyner  *
10171d10453SEric Joyner  * constant defining the broadcast MAC address, used for programming the
10271d10453SEric Joyner  * broadcast address as a MAC filter for the PF VSI.
10371d10453SEric Joyner  */
10471d10453SEric Joyner static const u8 broadcastaddr[ETHER_ADDR_LEN] = {
10571d10453SEric Joyner 	0xff, 0xff, 0xff, 0xff, 0xff, 0xff
10671d10453SEric Joyner };
10771d10453SEric Joyner 
10871d10453SEric Joyner MALLOC_DECLARE(M_ICE);
10971d10453SEric Joyner 
11071d10453SEric Joyner extern const char ice_driver_version[];
11171d10453SEric Joyner extern const uint8_t ice_major_version;
11271d10453SEric Joyner extern const uint8_t ice_minor_version;
11371d10453SEric Joyner extern const uint8_t ice_patch_version;
11471d10453SEric Joyner extern const uint8_t ice_rc_version;
11571d10453SEric Joyner 
11671d10453SEric Joyner /* global sysctl indicating whether the Tx FC filter should be enabled */
11771d10453SEric Joyner extern bool ice_enable_tx_fc_filter;
11871d10453SEric Joyner 
11971d10453SEric Joyner /* global sysctl indicating whether the Tx LLDP filter should be enabled */
12071d10453SEric Joyner extern bool ice_enable_tx_lldp_filter;
12171d10453SEric Joyner 
1229cf1841cSEric Joyner /* global sysctl indicating whether FW health status events should be enabled */
1239cf1841cSEric Joyner extern bool ice_enable_health_events;
1249cf1841cSEric Joyner 
1258923de59SPiotr Kubaj /* global sysctl indicating whether to enable 5-layer scheduler topology */
1268923de59SPiotr Kubaj extern bool ice_tx_balance_en;
1278923de59SPiotr Kubaj 
12871d10453SEric Joyner /**
12971d10453SEric Joyner  * @struct ice_bar_info
13071d10453SEric Joyner  * @brief PCI BAR mapping information
13171d10453SEric Joyner  *
13271d10453SEric Joyner  * Contains data about a PCI BAR that the driver has mapped for use.
13371d10453SEric Joyner  */
13471d10453SEric Joyner struct ice_bar_info {
13571d10453SEric Joyner 	struct resource		*res;
13671d10453SEric Joyner 	bus_space_tag_t		tag;
13771d10453SEric Joyner 	bus_space_handle_t	handle;
13871d10453SEric Joyner 	bus_size_t		size;
13971d10453SEric Joyner 	int			rid;
14071d10453SEric Joyner };
14171d10453SEric Joyner 
14271d10453SEric Joyner /* Alignment for queues */
14371d10453SEric Joyner #define DBA_ALIGN		128
14471d10453SEric Joyner 
14571d10453SEric Joyner /* Maximum TSO size is (256K)-1 */
14671d10453SEric Joyner #define ICE_TSO_SIZE		((256*1024) - 1)
14771d10453SEric Joyner 
14871d10453SEric Joyner /* Minimum size for TSO MSS */
14971d10453SEric Joyner #define ICE_MIN_TSO_MSS		64
15071d10453SEric Joyner 
15171d10453SEric Joyner #define ICE_MAX_TX_SEGS		8
15271d10453SEric Joyner #define ICE_MAX_TSO_SEGS	128
15371d10453SEric Joyner 
15471d10453SEric Joyner #define ICE_MAX_DMA_SEG_SIZE	((16*1024) - 1)
15571d10453SEric Joyner 
15671d10453SEric Joyner #define ICE_MAX_RX_SEGS		5
15771d10453SEric Joyner 
15871d10453SEric Joyner #define ICE_MAX_TSO_HDR_SEGS	3
15971d10453SEric Joyner 
16071d10453SEric Joyner #define ICE_MSIX_BAR		3
161f2635e84SEric Joyner #define ICE_MAX_MSIX_VECTORS	(GLINT_DYN_CTL_MAX_INDEX + 1)
16271d10453SEric Joyner 
16371d10453SEric Joyner #define ICE_DEFAULT_DESC_COUNT	1024
16471d10453SEric Joyner #define ICE_MAX_DESC_COUNT	8160
16571d10453SEric Joyner #define ICE_MIN_DESC_COUNT	64
16671d10453SEric Joyner #define ICE_DESC_COUNT_INCR	32
16771d10453SEric Joyner 
16871d10453SEric Joyner /* List of hardware offloads we support */
16971d10453SEric Joyner #define ICE_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_TCP | CSUM_IP_UDP | CSUM_IP_SCTP |	\
17071d10453SEric Joyner 			  CSUM_IP6_TCP| CSUM_IP6_UDP | CSUM_IP6_SCTP |		\
17171d10453SEric Joyner 			  CSUM_IP_TSO | CSUM_IP6_TSO)
17271d10453SEric Joyner 
17371d10453SEric Joyner /* Macros to decide what kind of hardware offload to enable */
17471d10453SEric Joyner #define ICE_CSUM_TCP (CSUM_IP_TCP|CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP6_TCP)
17571d10453SEric Joyner #define ICE_CSUM_UDP (CSUM_IP_UDP|CSUM_IP6_UDP)
17671d10453SEric Joyner #define ICE_CSUM_SCTP (CSUM_IP_SCTP|CSUM_IP6_SCTP)
17771d10453SEric Joyner #define ICE_CSUM_IP (CSUM_IP|CSUM_IP_TSO)
17871d10453SEric Joyner 
17971d10453SEric Joyner /* List of known RX CSUM offload flags */
18071d10453SEric Joyner #define ICE_RX_CSUM_FLAGS (CSUM_L3_CALC | CSUM_L3_VALID | CSUM_L4_CALC | \
18171d10453SEric Joyner 			   CSUM_L4_VALID | CSUM_L5_CALC | CSUM_L5_VALID | \
18271d10453SEric Joyner 			   CSUM_COALESCED)
18371d10453SEric Joyner 
18471d10453SEric Joyner /* List of interface capabilities supported by ice hardware */
18571d10453SEric Joyner #define ICE_FULL_CAPS \
18671d10453SEric Joyner 	(IFCAP_TSO4 | IFCAP_TSO6 | \
18771d10453SEric Joyner 	 IFCAP_TXCSUM | IFCAP_TXCSUM_IPV6 | \
18871d10453SEric Joyner 	 IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6 | \
18971d10453SEric Joyner 	 IFCAP_VLAN_HWFILTER | IFCAP_VLAN_HWTSO | \
19071d10453SEric Joyner 	 IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTSO | \
19171d10453SEric Joyner 	 IFCAP_VLAN_MTU | IFCAP_JUMBO_MTU | IFCAP_LRO)
19271d10453SEric Joyner 
19371d10453SEric Joyner /* Safe mode disables support for hardware checksums and TSO */
19471d10453SEric Joyner #define ICE_SAFE_CAPS \
19571d10453SEric Joyner 	(ICE_FULL_CAPS & ~(IFCAP_HWCSUM | IFCAP_TSO | \
19671d10453SEric Joyner 			   IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM))
19771d10453SEric Joyner 
19871d10453SEric Joyner #define ICE_CAPS(sc) \
19971d10453SEric Joyner 	(ice_is_bit_set(sc->feat_en, ICE_FEATURE_SAFE_MODE) ? ICE_SAFE_CAPS : ICE_FULL_CAPS)
20071d10453SEric Joyner 
20171d10453SEric Joyner /**
20271d10453SEric Joyner  * ICE_NVM_ACCESS
20371d10453SEric Joyner  * @brief Private ioctl command number for NVM access ioctls
20471d10453SEric Joyner  *
20571d10453SEric Joyner  * The ioctl command number used by NVM update for accessing the driver for
20671d10453SEric Joyner  * NVM access commands.
20771d10453SEric Joyner  */
20871d10453SEric Joyner #define ICE_NVM_ACCESS \
20971d10453SEric Joyner 	(((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 5)
21071d10453SEric Joyner 
2118923de59SPiotr Kubaj /**
2128923de59SPiotr Kubaj  * ICE_DEBUG_DUMP
2138923de59SPiotr Kubaj  * @brief Private ioctl command number for retrieving debug dump data
2148923de59SPiotr Kubaj  *
2158923de59SPiotr Kubaj  * The ioctl command number used by a userspace tool for accessing the driver for
2168923de59SPiotr Kubaj  * getting debug dump data from the firmware.
2178923de59SPiotr Kubaj  */
2188923de59SPiotr Kubaj #define ICE_DEBUG_DUMP \
2198923de59SPiotr Kubaj 	(((((((('E' << 4) + '1') << 4) + 'K') << 4) + 'G') << 4) | 6)
2208923de59SPiotr Kubaj 
22156429daeSEric Joyner #define ICE_AQ_LEN		1023
22271d10453SEric Joyner #define ICE_MBXQ_LEN		512
22371d10453SEric Joyner #define ICE_SBQ_LEN		512
22471d10453SEric Joyner 
22571d10453SEric Joyner #define ICE_CTRLQ_WORK_LIMIT 256
22671d10453SEric Joyner 
22771d10453SEric Joyner #define ICE_DFLT_TRAFFIC_CLASS BIT(0)
22871d10453SEric Joyner 
22971d10453SEric Joyner /* wait up to 50 microseconds for queue state change */
23071d10453SEric Joyner #define ICE_Q_WAIT_RETRY_LIMIT	5
23171d10453SEric Joyner 
23271d10453SEric Joyner #define ICE_UP_TABLE_TRANSLATE(val, i) \
23371d10453SEric Joyner 		(((val) << ICE_AQ_VSI_UP_TABLE_UP##i##_S) & \
23471d10453SEric Joyner 		ICE_AQ_VSI_UP_TABLE_UP##i##_M)
23571d10453SEric Joyner 
23671d10453SEric Joyner /*
23771d10453SEric Joyner  * For now, set this to the hardware maximum. Each function gets a smaller
23871d10453SEric Joyner  * number assigned to it in hw->func_caps.guar_num_vsi, though there
23971d10453SEric Joyner  * appears to be no guarantee that is the maximum number that a function
24071d10453SEric Joyner  * can use.
24171d10453SEric Joyner  */
24271d10453SEric Joyner #define ICE_MAX_VSI_AVAILABLE	768
24371d10453SEric Joyner 
24471d10453SEric Joyner /* Maximum size of a single frame (for Tx and Rx) */
24571d10453SEric Joyner #define ICE_MAX_FRAME_SIZE ICE_AQ_SET_MAC_FRAME_SIZE_MAX
24671d10453SEric Joyner 
24771d10453SEric Joyner /* Maximum MTU size */
24871d10453SEric Joyner #define ICE_MAX_MTU (ICE_MAX_FRAME_SIZE - \
24971d10453SEric Joyner 		     ETHER_HDR_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)
25071d10453SEric Joyner 
25171d10453SEric Joyner /*
25271d10453SEric Joyner  * Hardware requires that TSO packets have an segment size of at least 64
25371d10453SEric Joyner  * bytes. To avoid sending bad frames to the hardware, the driver forces the
25471d10453SEric Joyner  * MSS for all TSO packets to have a segment size of at least 64 bytes.
25571d10453SEric Joyner  *
25671d10453SEric Joyner  * However, if the MTU is reduced below a certain size, then the resulting
25771d10453SEric Joyner  * larger MSS can result in transmitting segmented frames with a packet size
25871d10453SEric Joyner  * larger than the MTU.
25971d10453SEric Joyner  *
26071d10453SEric Joyner  * Avoid this by preventing the MTU from being lowered below this limit.
26171d10453SEric Joyner  * Alternative solutions require changing the TCP stack to disable offloading
26271d10453SEric Joyner  * the segmentation when the requested segment size goes below 64 bytes.
26371d10453SEric Joyner  */
26471d10453SEric Joyner #define ICE_MIN_MTU 112
26571d10453SEric Joyner 
2669dc2f6e2SEric Joyner /*
2679dc2f6e2SEric Joyner  * The default number of queues reserved for a VF is 4, according to the
2689dc2f6e2SEric Joyner  * AVF Base Mode specification.
2699dc2f6e2SEric Joyner  */
27071d10453SEric Joyner #define ICE_DEFAULT_VF_QUEUES	4
27171d10453SEric Joyner 
2729cf1841cSEric Joyner /*
2739e54973fSEric Joyner  * An invalid VSI number to indicate that mirroring should be disabled.
2749e54973fSEric Joyner  */
2759e54973fSEric Joyner #define ICE_INVALID_MIRROR_VSI	((u16)-1)
2769e54973fSEric Joyner /*
27756429daeSEric Joyner  * The maximum number of RX queues allowed per TC in a VSI.
27856429daeSEric Joyner  */
27956429daeSEric Joyner #define ICE_MAX_RXQS_PER_TC	256
28056429daeSEric Joyner 
28156429daeSEric Joyner /*
2829cf1841cSEric Joyner  * There are three settings that can be updated independently or
2839cf1841cSEric Joyner  * altogether: Link speed, FEC, and Flow Control.  These macros allow
2849cf1841cSEric Joyner  * the caller to specify which setting(s) to update.
2859cf1841cSEric Joyner  */
2869cf1841cSEric Joyner #define ICE_APPLY_LS        BIT(0)
2879cf1841cSEric Joyner #define ICE_APPLY_FEC       BIT(1)
2889cf1841cSEric Joyner #define ICE_APPLY_FC        BIT(2)
2899cf1841cSEric Joyner #define ICE_APPLY_LS_FEC    (ICE_APPLY_LS | ICE_APPLY_FEC)
2909cf1841cSEric Joyner #define ICE_APPLY_LS_FC     (ICE_APPLY_LS | ICE_APPLY_FC)
2919cf1841cSEric Joyner #define ICE_APPLY_FEC_FC    (ICE_APPLY_FEC | ICE_APPLY_FC)
2929cf1841cSEric Joyner #define ICE_APPLY_LS_FEC_FC (ICE_APPLY_LS_FEC | ICE_APPLY_FC)
2939cf1841cSEric Joyner 
294f2635e84SEric Joyner /*
295f2635e84SEric Joyner  * Mask of valid flags that can be used as an input for the
296f2635e84SEric Joyner  * advertise_speed sysctl.
297f2635e84SEric Joyner  */
298f2635e84SEric Joyner #define ICE_SYSCTL_SPEEDS_VALID_RANGE	0xFFF
299f2635e84SEric Joyner 
30071d10453SEric Joyner /**
30171d10453SEric Joyner  * @enum ice_dyn_idx_t
30271d10453SEric Joyner  * @brief Dynamic Control ITR indexes
30371d10453SEric Joyner  *
30471d10453SEric Joyner  * This enum matches hardware bits and is meant to be used by DYN_CTLN
30571d10453SEric Joyner  * registers and QINT registers or more generally anywhere in the manual
30671d10453SEric Joyner  * mentioning ITR_INDX, ITR_NONE cannot be used as an index 'n' into any
30771d10453SEric Joyner  * register but instead is a special value meaning "don't update" ITR0/1/2.
30871d10453SEric Joyner  */
30971d10453SEric Joyner enum ice_dyn_idx_t {
31071d10453SEric Joyner 	ICE_IDX_ITR0 = 0,
31171d10453SEric Joyner 	ICE_IDX_ITR1 = 1,
31271d10453SEric Joyner 	ICE_IDX_ITR2 = 2,
31371d10453SEric Joyner 	ICE_ITR_NONE = 3	/* ITR_NONE must not be used as an index */
31471d10453SEric Joyner };
31571d10453SEric Joyner 
31671d10453SEric Joyner /* By convenction ITR0 is used for RX, and ITR1 is used for TX */
31771d10453SEric Joyner #define ICE_RX_ITR ICE_IDX_ITR0
31871d10453SEric Joyner #define ICE_TX_ITR ICE_IDX_ITR1
31971d10453SEric Joyner 
32071d10453SEric Joyner #define ICE_ITR_MAX		8160
32171d10453SEric Joyner 
32271d10453SEric Joyner /* Define the default Tx and Rx ITR as 50us (translates to ~20k int/sec max) */
32371d10453SEric Joyner #define ICE_DFLT_TX_ITR		50
32471d10453SEric Joyner #define ICE_DFLT_RX_ITR		50
32571d10453SEric Joyner 
326f2635e84SEric Joyner /* RS FEC register values */
327f2635e84SEric Joyner #define ICE_RS_FEC_REG_SHIFT			2
328f2635e84SEric Joyner #define ICE_RS_FEC_RECV_ID_SHIFT		4
329f2635e84SEric Joyner #define ICE_RS_FEC_CORR_LOW_REG_PORT0		(0x02 << ICE_RS_FEC_REG_SHIFT)
330f2635e84SEric Joyner #define ICE_RS_FEC_CORR_HIGH_REG_PORT0		(0x03 << ICE_RS_FEC_REG_SHIFT)
331f2635e84SEric Joyner #define ICE_RS_FEC_UNCORR_LOW_REG_PORT0		(0x04 << ICE_RS_FEC_REG_SHIFT)
332f2635e84SEric Joyner #define ICE_RS_FEC_UNCORR_HIGH_REG_PORT0	(0x05 << ICE_RS_FEC_REG_SHIFT)
333f2635e84SEric Joyner #define ICE_RS_FEC_CORR_LOW_REG_PORT1		(0x42 << ICE_RS_FEC_REG_SHIFT)
334f2635e84SEric Joyner #define ICE_RS_FEC_CORR_HIGH_REG_PORT1		(0x43 << ICE_RS_FEC_REG_SHIFT)
335f2635e84SEric Joyner #define ICE_RS_FEC_UNCORR_LOW_REG_PORT1		(0x44 << ICE_RS_FEC_REG_SHIFT)
336f2635e84SEric Joyner #define ICE_RS_FEC_UNCORR_HIGH_REG_PORT1	(0x45 << ICE_RS_FEC_REG_SHIFT)
337f2635e84SEric Joyner #define ICE_RS_FEC_CORR_LOW_REG_PORT2		(0x4A << ICE_RS_FEC_REG_SHIFT)
338f2635e84SEric Joyner #define ICE_RS_FEC_CORR_HIGH_REG_PORT2		(0x4B << ICE_RS_FEC_REG_SHIFT)
339f2635e84SEric Joyner #define ICE_RS_FEC_UNCORR_LOW_REG_PORT2		(0x4C << ICE_RS_FEC_REG_SHIFT)
340f2635e84SEric Joyner #define ICE_RS_FEC_UNCORR_HIGH_REG_PORT2	(0x4D << ICE_RS_FEC_REG_SHIFT)
341f2635e84SEric Joyner #define ICE_RS_FEC_CORR_LOW_REG_PORT3		(0x52 << ICE_RS_FEC_REG_SHIFT)
342f2635e84SEric Joyner #define ICE_RS_FEC_CORR_HIGH_REG_PORT3		(0x53 << ICE_RS_FEC_REG_SHIFT)
343f2635e84SEric Joyner #define ICE_RS_FEC_UNCORR_LOW_REG_PORT3		(0x54 << ICE_RS_FEC_REG_SHIFT)
344f2635e84SEric Joyner #define ICE_RS_FEC_UNCORR_HIGH_REG_PORT3	(0x55 << ICE_RS_FEC_REG_SHIFT)
345f2635e84SEric Joyner #define ICE_RS_FEC_RECEIVER_ID_PCS0		(0x33 << ICE_RS_FEC_RECV_ID_SHIFT)
346f2635e84SEric Joyner #define ICE_RS_FEC_RECEIVER_ID_PCS1		(0x34 << ICE_RS_FEC_RECV_ID_SHIFT)
347f2635e84SEric Joyner 
34871d10453SEric Joyner /**
34971d10453SEric Joyner  * ice_itr_to_reg - Convert an ITR setting into its register equivalent
35071d10453SEric Joyner  * @hw: The device HW structure
35171d10453SEric Joyner  * @itr_setting: the ITR setting to convert
35271d10453SEric Joyner  *
35371d10453SEric Joyner  * Based on the hardware ITR granularity, convert an ITR setting into the
35471d10453SEric Joyner  * correct value to prepare programming to the HW.
35571d10453SEric Joyner  */
35671d10453SEric Joyner static inline u16 ice_itr_to_reg(struct ice_hw *hw, u16 itr_setting)
35771d10453SEric Joyner {
35871d10453SEric Joyner 	return itr_setting / hw->itr_gran;
35971d10453SEric Joyner }
36071d10453SEric Joyner 
36171d10453SEric Joyner /**
36271d10453SEric Joyner  * @enum ice_rx_dtype
36371d10453SEric Joyner  * @brief DTYPE header split options
36471d10453SEric Joyner  *
36571d10453SEric Joyner  * This enum matches the Rx context bits to define whether header split is
36671d10453SEric Joyner  * enabled or not.
36771d10453SEric Joyner  */
36871d10453SEric Joyner enum ice_rx_dtype {
36971d10453SEric Joyner 	ICE_RX_DTYPE_NO_SPLIT		= 0,
37071d10453SEric Joyner 	ICE_RX_DTYPE_HEADER_SPLIT	= 1,
37171d10453SEric Joyner 	ICE_RX_DTYPE_SPLIT_ALWAYS	= 2,
37271d10453SEric Joyner };
37371d10453SEric Joyner 
37471d10453SEric Joyner /* Strings used for displaying FEC mode
37571d10453SEric Joyner  *
37671d10453SEric Joyner  * Use ice_fec_str() to get these unless these need to be embedded in a
37771d10453SEric Joyner  * string constant.
37871d10453SEric Joyner  */
37971d10453SEric Joyner #define ICE_FEC_STRING_AUTO	"Auto"
38071d10453SEric Joyner #define ICE_FEC_STRING_RS	"RS-FEC"
38171d10453SEric Joyner #define ICE_FEC_STRING_BASER	"FC-FEC/BASE-R"
38271d10453SEric Joyner #define ICE_FEC_STRING_NONE	"None"
3838923de59SPiotr Kubaj #define ICE_FEC_STRING_DIS_AUTO	"Auto (w/ No-FEC)"
38471d10453SEric Joyner 
38571d10453SEric Joyner /* Strings used for displaying Flow Control mode
38671d10453SEric Joyner  *
38771d10453SEric Joyner  * Use ice_fc_str() to get these unless these need to be embedded in a
38871d10453SEric Joyner  * string constant.
38971d10453SEric Joyner  */
39071d10453SEric Joyner #define ICE_FC_STRING_FULL	"Full"
39171d10453SEric Joyner #define ICE_FC_STRING_TX	"Tx"
39271d10453SEric Joyner #define ICE_FC_STRING_RX	"Rx"
39371d10453SEric Joyner #define ICE_FC_STRING_NONE	"None"
39471d10453SEric Joyner 
39571d10453SEric Joyner /*
39671d10453SEric Joyner  * The number of times the ice_handle_i2c_req function will retry reading
39771d10453SEric Joyner  * I2C data via the Admin Queue before returning EBUSY.
39871d10453SEric Joyner  */
39971d10453SEric Joyner #define ICE_I2C_MAX_RETRIES		10
40071d10453SEric Joyner 
40171d10453SEric Joyner /*
402f377a0c7SEric Joyner  * The Get Link Status AQ command and other link commands can return
403f377a0c7SEric Joyner  * EAGAIN, indicating that the FW Link Management engine is busy.
404f377a0c7SEric Joyner  * Define the number of times that the driver should retry sending these
405f377a0c7SEric Joyner  * commands and the amount of time it should wait between those retries
406f377a0c7SEric Joyner  * (in milliseconds) here.
407f377a0c7SEric Joyner  */
408f377a0c7SEric Joyner #define ICE_LINK_AQ_MAX_RETRIES		10
409f377a0c7SEric Joyner #define ICE_LINK_RETRY_DELAY		17
410f377a0c7SEric Joyner 
411f377a0c7SEric Joyner /*
41271d10453SEric Joyner  * The Start LLDP Agent AQ command will fail if it's sent too soon after
41371d10453SEric Joyner  * the LLDP agent is stopped. The period between the stop and start
41471d10453SEric Joyner  * commands must currently be at least 2 seconds.
41571d10453SEric Joyner  */
41671d10453SEric Joyner #define ICE_START_LLDP_RETRY_WAIT	(2 * hz)
41771d10453SEric Joyner 
41871d10453SEric Joyner /*
419f2635e84SEric Joyner  * Only certain clusters are valid for certain devices for the FW debug dump
420f2635e84SEric Joyner  * functionality, so define masks of those here.
4218923de59SPiotr Kubaj  */
422f2635e84SEric Joyner #define ICE_FW_DEBUG_DUMP_VALID_CLUSTER_MASK_E810	0x4001AF
423f2635e84SEric Joyner #define ICE_FW_DEBUG_DUMP_VALID_CLUSTER_MASK_E830	0x1AF
4248923de59SPiotr Kubaj 
42571d10453SEric Joyner struct ice_softc;
42671d10453SEric Joyner 
42771d10453SEric Joyner /**
42871d10453SEric Joyner  * @enum ice_rx_cso_stat
42971d10453SEric Joyner  * @brief software checksum offload statistics
43071d10453SEric Joyner  *
43171d10453SEric Joyner  * Enumeration of possible checksum offload statistics captured by software
43271d10453SEric Joyner  * during the Rx path.
43371d10453SEric Joyner  */
43471d10453SEric Joyner enum ice_rx_cso_stat {
43571d10453SEric Joyner 	ICE_CSO_STAT_RX_IP4_ERR,
43671d10453SEric Joyner 	ICE_CSO_STAT_RX_IP6_ERR,
43771d10453SEric Joyner 	ICE_CSO_STAT_RX_L3_ERR,
43871d10453SEric Joyner 	ICE_CSO_STAT_RX_TCP_ERR,
43971d10453SEric Joyner 	ICE_CSO_STAT_RX_UDP_ERR,
44071d10453SEric Joyner 	ICE_CSO_STAT_RX_SCTP_ERR,
44171d10453SEric Joyner 	ICE_CSO_STAT_RX_L4_ERR,
44271d10453SEric Joyner 	ICE_CSO_STAT_RX_COUNT
44371d10453SEric Joyner };
44471d10453SEric Joyner 
44571d10453SEric Joyner /**
44671d10453SEric Joyner  * @enum ice_tx_cso_stat
44771d10453SEric Joyner  * @brief software checksum offload statistics
44871d10453SEric Joyner  *
44971d10453SEric Joyner  * Enumeration of possible checksum offload statistics captured by software
45071d10453SEric Joyner  * during the Tx path.
45171d10453SEric Joyner  */
45271d10453SEric Joyner enum ice_tx_cso_stat {
45371d10453SEric Joyner 	ICE_CSO_STAT_TX_TCP,
45471d10453SEric Joyner 	ICE_CSO_STAT_TX_UDP,
45571d10453SEric Joyner 	ICE_CSO_STAT_TX_SCTP,
45671d10453SEric Joyner 	ICE_CSO_STAT_TX_IP4,
45771d10453SEric Joyner 	ICE_CSO_STAT_TX_IP6,
45871d10453SEric Joyner 	ICE_CSO_STAT_TX_L3_ERR,
45971d10453SEric Joyner 	ICE_CSO_STAT_TX_L4_ERR,
46071d10453SEric Joyner 	ICE_CSO_STAT_TX_COUNT
46171d10453SEric Joyner };
46271d10453SEric Joyner 
46371d10453SEric Joyner /**
46471d10453SEric Joyner  * @struct tx_stats
46571d10453SEric Joyner  * @brief software Tx statistics
46671d10453SEric Joyner  *
46771d10453SEric Joyner  * Contains software counted Tx statistics for a single queue
46871d10453SEric Joyner  */
46971d10453SEric Joyner struct tx_stats {
47071d10453SEric Joyner 	/* Soft Stats */
47171d10453SEric Joyner 	u64			tx_bytes;
47271d10453SEric Joyner 	u64			tx_packets;
47371d10453SEric Joyner 	u64			mss_too_small;
474f2635e84SEric Joyner 	u64			tso;
47571d10453SEric Joyner 	u64			cso[ICE_CSO_STAT_TX_COUNT];
47671d10453SEric Joyner };
47771d10453SEric Joyner 
47871d10453SEric Joyner /**
47971d10453SEric Joyner  * @struct rx_stats
48071d10453SEric Joyner  * @brief software Rx statistics
48171d10453SEric Joyner  *
48271d10453SEric Joyner  * Contains software counted Rx statistics for a single queue
48371d10453SEric Joyner  */
48471d10453SEric Joyner struct rx_stats {
48571d10453SEric Joyner 	/* Soft Stats */
48671d10453SEric Joyner 	u64			rx_packets;
48771d10453SEric Joyner 	u64			rx_bytes;
48871d10453SEric Joyner 	u64			desc_errs;
48971d10453SEric Joyner 	u64			cso[ICE_CSO_STAT_RX_COUNT];
49071d10453SEric Joyner };
49171d10453SEric Joyner 
49271d10453SEric Joyner /**
49371d10453SEric Joyner  * @struct ice_vsi_hw_stats
49471d10453SEric Joyner  * @brief hardware statistics for a VSI
49571d10453SEric Joyner  *
49671d10453SEric Joyner  * Stores statistics that are generated by hardware for a VSI.
49771d10453SEric Joyner  */
49871d10453SEric Joyner struct ice_vsi_hw_stats {
49971d10453SEric Joyner 	struct ice_eth_stats prev;
50071d10453SEric Joyner 	struct ice_eth_stats cur;
50171d10453SEric Joyner 	bool offsets_loaded;
50271d10453SEric Joyner };
50371d10453SEric Joyner 
50471d10453SEric Joyner /**
50571d10453SEric Joyner  * @struct ice_pf_hw_stats
50671d10453SEric Joyner  * @brief hardware statistics for a PF
50771d10453SEric Joyner  *
50871d10453SEric Joyner  * Stores statistics that are generated by hardware for each PF.
50971d10453SEric Joyner  */
51071d10453SEric Joyner struct ice_pf_hw_stats {
51171d10453SEric Joyner 	struct ice_hw_port_stats prev;
51271d10453SEric Joyner 	struct ice_hw_port_stats cur;
51371d10453SEric Joyner 	bool offsets_loaded;
51471d10453SEric Joyner };
51571d10453SEric Joyner 
51671d10453SEric Joyner /**
51771d10453SEric Joyner  * @struct ice_pf_sw_stats
51871d10453SEric Joyner  * @brief software statistics for a PF
51971d10453SEric Joyner  *
52071d10453SEric Joyner  * Contains software generated statistics relevant to a PF.
52171d10453SEric Joyner  */
52271d10453SEric Joyner struct ice_pf_sw_stats {
52371d10453SEric Joyner 	/* # of reset events handled, by type */
52471d10453SEric Joyner 	u32 corer_count;
52571d10453SEric Joyner 	u32 globr_count;
52671d10453SEric Joyner 	u32 empr_count;
52771d10453SEric Joyner 	u32 pfr_count;
52871d10453SEric Joyner 
52971d10453SEric Joyner 	/* # of detected MDD events for Tx and Rx */
53071d10453SEric Joyner 	u32 tx_mdd_count;
53171d10453SEric Joyner 	u32 rx_mdd_count;
532f2635e84SEric Joyner 
533f2635e84SEric Joyner 	u64 rx_roc_error;	/* port oversize packet stats, error_cnt \
534f2635e84SEric Joyner 				   from GLV_REPC VSI register + RxOversize */
53571d10453SEric Joyner };
53671d10453SEric Joyner 
53771d10453SEric Joyner /**
53856429daeSEric Joyner  * @struct ice_tc_info
53956429daeSEric Joyner  * @brief Traffic class information for a VSI
54056429daeSEric Joyner  *
54156429daeSEric Joyner  * Stores traffic class information used in configuring
54256429daeSEric Joyner  * a VSI.
54356429daeSEric Joyner  */
54456429daeSEric Joyner struct ice_tc_info {
54556429daeSEric Joyner 	u16 qoffset;	/* Offset in VSI queue space */
54656429daeSEric Joyner 	u16 qcount_tx;	/* TX queues for this Traffic Class */
54756429daeSEric Joyner 	u16 qcount_rx;	/* RX queues */
54856429daeSEric Joyner };
54956429daeSEric Joyner 
55056429daeSEric Joyner /**
55171d10453SEric Joyner  * @struct ice_vsi
55271d10453SEric Joyner  * @brief VSI structure
55371d10453SEric Joyner  *
55471d10453SEric Joyner  * Contains data relevant to a single VSI
55571d10453SEric Joyner  */
55671d10453SEric Joyner struct ice_vsi {
55771d10453SEric Joyner 	/* back pointer to the softc */
55871d10453SEric Joyner 	struct ice_softc	*sc;
55971d10453SEric Joyner 
56071d10453SEric Joyner 	bool dynamic;		/* if true, dynamically allocated */
56171d10453SEric Joyner 
56271d10453SEric Joyner 	enum ice_vsi_type type;	/* type of this VSI */
56371d10453SEric Joyner 	u16 idx;		/* software index to sc->all_vsi[] */
56471d10453SEric Joyner 
56571d10453SEric Joyner 	u16 *tx_qmap; /* Tx VSI to PF queue mapping */
56671d10453SEric Joyner 	u16 *rx_qmap; /* Rx VSI to PF queue mapping */
56771d10453SEric Joyner 
56871d10453SEric Joyner 	enum ice_resmgr_alloc_type qmap_type;
56971d10453SEric Joyner 
57071d10453SEric Joyner 	struct ice_tx_queue *tx_queues;	/* Tx queue array */
57171d10453SEric Joyner 	struct ice_rx_queue *rx_queues;	/* Rx queue array */
57271d10453SEric Joyner 
57371d10453SEric Joyner 	int num_tx_queues;
57471d10453SEric Joyner 	int num_rx_queues;
57571d10453SEric Joyner 	int num_vectors;
57671d10453SEric Joyner 
57771d10453SEric Joyner 	int16_t rx_itr;
57871d10453SEric Joyner 	int16_t tx_itr;
57971d10453SEric Joyner 
58071d10453SEric Joyner 	/* RSS configuration */
58171d10453SEric Joyner 	u16 rss_table_size; /* HW RSS table size */
58271d10453SEric Joyner 	u8 rss_lut_type; /* Used to configure Get/Set RSS LUT AQ call */
58371d10453SEric Joyner 
58471d10453SEric Joyner 	int max_frame_size;
58571d10453SEric Joyner 	u16 mbuf_sz;
58671d10453SEric Joyner 
58771d10453SEric Joyner 	struct ice_aqc_vsi_props info;
58871d10453SEric Joyner 
58956429daeSEric Joyner 	/* DCB configuration */
59056429daeSEric Joyner 	u8 num_tcs;	/* Total number of enabled TCs */
59156429daeSEric Joyner 	u16 tc_map;	/* bitmap of enabled Traffic Classes */
59256429daeSEric Joyner 	/* Information for each traffic class */
59356429daeSEric Joyner 	struct ice_tc_info tc_info[ICE_MAX_TRAFFIC_CLASS];
59456429daeSEric Joyner 
59571d10453SEric Joyner 	/* context for per-VSI sysctls */
59671d10453SEric Joyner 	struct sysctl_ctx_list ctx;
59771d10453SEric Joyner 	struct sysctl_oid *vsi_node;
59871d10453SEric Joyner 
59971d10453SEric Joyner 	/* context for per-txq sysctls */
60071d10453SEric Joyner 	struct sysctl_ctx_list txqs_ctx;
60171d10453SEric Joyner 	struct sysctl_oid *txqs_node;
60271d10453SEric Joyner 
60371d10453SEric Joyner 	/* context for per-rxq sysctls */
60471d10453SEric Joyner 	struct sysctl_ctx_list rxqs_ctx;
60571d10453SEric Joyner 	struct sysctl_oid *rxqs_node;
60671d10453SEric Joyner 
60771d10453SEric Joyner 	/* VSI-level stats */
60871d10453SEric Joyner 	struct ice_vsi_hw_stats hw_stats;
6099e54973fSEric Joyner 
6109e54973fSEric Joyner 	/* VSI mirroring details */
6119e54973fSEric Joyner 	u16 mirror_src_vsi;
6129e54973fSEric Joyner 	u16 rule_mir_ingress;
6139e54973fSEric Joyner 	u16 rule_mir_egress;
61471d10453SEric Joyner };
61571d10453SEric Joyner 
61671d10453SEric Joyner /**
6178923de59SPiotr Kubaj  * @struct ice_debug_dump_cmd
6188923de59SPiotr Kubaj  * @brief arguments/return value for debug dump ioctl
6198923de59SPiotr Kubaj  */
6208923de59SPiotr Kubaj struct ice_debug_dump_cmd {
6218923de59SPiotr Kubaj 	u32 offset;		/* offset to read/write from table, in bytes */
6229e54973fSEric Joyner 	u16 cluster_id;		/* also used to get next cluster id */
6238923de59SPiotr Kubaj 	u16 table_id;
6248923de59SPiotr Kubaj 	u16 data_size;		/* size of data field, in bytes */
6258923de59SPiotr Kubaj 	u16 reserved1;
6268923de59SPiotr Kubaj 	u32 reserved2;
6278923de59SPiotr Kubaj 	u8 data[];
6288923de59SPiotr Kubaj };
6298923de59SPiotr Kubaj 
6308923de59SPiotr Kubaj /**
631f2635e84SEric Joyner  * @struct ice_serdes_equalization
632f2635e84SEric Joyner  * @brief serdes equalization info
633f2635e84SEric Joyner  */
634f2635e84SEric Joyner struct ice_serdes_equalization {
635f2635e84SEric Joyner 	int rx_equalization_pre1;
636f2635e84SEric Joyner 	int rx_equalization_pre2;
637f2635e84SEric Joyner 	int rx_equalization_post1;
638f2635e84SEric Joyner 	int rx_equalization_bflf;
639f2635e84SEric Joyner 	int rx_equalization_bfhf;
640f2635e84SEric Joyner 	int rx_equalization_drate;
641f2635e84SEric Joyner 	int tx_equalization_pre1;
642f2635e84SEric Joyner 	int tx_equalization_pre2;
643f2635e84SEric Joyner 	int tx_equalization_pre3;
644f2635e84SEric Joyner 	int tx_equalization_atten;
645f2635e84SEric Joyner 	int tx_equalization_post1;
646f2635e84SEric Joyner };
647f2635e84SEric Joyner 
648f2635e84SEric Joyner /**
649f2635e84SEric Joyner  * @struct ice_fec_stats_to_sysctl
650f2635e84SEric Joyner  * @brief FEC stats register value of port
651f2635e84SEric Joyner  */
652f2635e84SEric Joyner struct ice_fec_stats_to_sysctl {
653f2635e84SEric Joyner 	u16 fec_corr_cnt_low;
654f2635e84SEric Joyner 	u16 fec_corr_cnt_high;
655f2635e84SEric Joyner 	u16 fec_uncorr_cnt_low;
656f2635e84SEric Joyner 	u16 fec_uncorr_cnt_high;
657f2635e84SEric Joyner };
658f2635e84SEric Joyner 
659f2635e84SEric Joyner #define ICE_MAX_SERDES_LANE_COUNT	4
660f2635e84SEric Joyner 
661f2635e84SEric Joyner /**
662f2635e84SEric Joyner  * @struct ice_regdump_to_sysctl
663f2635e84SEric Joyner  * @brief PHY stats of port
664f2635e84SEric Joyner  */
665f2635e84SEric Joyner struct ice_regdump_to_sysctl {
666f2635e84SEric Joyner 	/* A multilane port can have max 4 serdes */
667f2635e84SEric Joyner 	struct ice_serdes_equalization equalization[ICE_MAX_SERDES_LANE_COUNT];
668f2635e84SEric Joyner 	struct ice_fec_stats_to_sysctl stats;
669f2635e84SEric Joyner };
670f2635e84SEric Joyner 
671f2635e84SEric Joyner /**
672f2635e84SEric Joyner  * @struct ice_port_topology
673f2635e84SEric Joyner  * @brief Port topology from lport i.e. serdes mapping, pcsquad, macport, cage
674f2635e84SEric Joyner  */
675f2635e84SEric Joyner struct ice_port_topology {
676f2635e84SEric Joyner 	u16 pcs_port;
677f2635e84SEric Joyner 	u16 primary_serdes_lane;
678f2635e84SEric Joyner 	u16 serdes_lane_count;
679f2635e84SEric Joyner 	u16 pcs_quad_select;
680f2635e84SEric Joyner };
681f2635e84SEric Joyner 
682f2635e84SEric Joyner /**
68371d10453SEric Joyner  * @enum ice_state
68471d10453SEric Joyner  * @brief Driver state flags
68571d10453SEric Joyner  *
68671d10453SEric Joyner  * Used to indicate the status of various driver events. Intended to be
68771d10453SEric Joyner  * modified only using atomic operations, so that we can use it even in places
68871d10453SEric Joyner  * which aren't locked.
68971d10453SEric Joyner  */
69071d10453SEric Joyner enum ice_state {
69171d10453SEric Joyner 	ICE_STATE_CONTROLQ_EVENT_PENDING,
69271d10453SEric Joyner 	ICE_STATE_VFLR_PENDING,
69371d10453SEric Joyner 	ICE_STATE_MDD_PENDING,
69471d10453SEric Joyner 	ICE_STATE_RESET_OICR_RECV,
69571d10453SEric Joyner 	ICE_STATE_RESET_PFR_REQ,
69671d10453SEric Joyner 	ICE_STATE_PREPARED_FOR_RESET,
6979e54973fSEric Joyner 	ICE_STATE_SUBIF_NEEDS_REINIT,
69871d10453SEric Joyner 	ICE_STATE_RESET_FAILED,
69971d10453SEric Joyner 	ICE_STATE_DRIVER_INITIALIZED,
70071d10453SEric Joyner 	ICE_STATE_NO_MEDIA,
70171d10453SEric Joyner 	ICE_STATE_RECOVERY_MODE,
70271d10453SEric Joyner 	ICE_STATE_ROLLBACK_MODE,
70371d10453SEric Joyner 	ICE_STATE_LINK_STATUS_REPORTED,
70456429daeSEric Joyner 	ICE_STATE_ATTACHING,
70571d10453SEric Joyner 	ICE_STATE_DETACHING,
70671d10453SEric Joyner 	ICE_STATE_LINK_DEFAULT_OVERRIDE_PENDING,
7077d7af7f8SEric Joyner 	ICE_STATE_LLDP_RX_FLTR_FROM_DRIVER,
70856429daeSEric Joyner 	ICE_STATE_MULTIPLE_TCS,
7098923de59SPiotr Kubaj 	ICE_STATE_DO_FW_DEBUG_DUMP,
7109c30461dSEric Joyner 	ICE_STATE_LINK_ACTIVE_ON_DOWN,
7119c30461dSEric Joyner 	ICE_STATE_FIRST_INIT_LINK,
7129e54973fSEric Joyner 	ICE_STATE_DO_CREATE_MIRR_INTFC,
7139e54973fSEric Joyner 	ICE_STATE_DO_DESTROY_MIRR_INTFC,
714f377a0c7SEric Joyner 	ICE_STATE_PHY_FW_INIT_PENDING,
71571d10453SEric Joyner 	/* This entry must be last */
71671d10453SEric Joyner 	ICE_STATE_LAST,
71771d10453SEric Joyner };
71871d10453SEric Joyner 
71971d10453SEric Joyner /* Functions for setting and checking driver state. Note the functions take
72071d10453SEric Joyner  * bit positions, not bitmasks. The atomic_testandset_32 and
72171d10453SEric Joyner  * atomic_testandclear_32 operations require bit positions, while the
72271d10453SEric Joyner  * atomic_set_32 and atomic_clear_32 require bitmasks. This can easily lead to
72371d10453SEric Joyner  * programming error, so we provide wrapper functions to avoid this.
72471d10453SEric Joyner  */
72571d10453SEric Joyner 
72671d10453SEric Joyner /**
72771d10453SEric Joyner  * ice_set_state - Set the specified state
72871d10453SEric Joyner  * @s: the state bitmap
72971d10453SEric Joyner  * @bit: the state to set
73071d10453SEric Joyner  *
73171d10453SEric Joyner  * Atomically update the state bitmap with the specified bit set.
73271d10453SEric Joyner  */
73371d10453SEric Joyner static inline void
73471d10453SEric Joyner ice_set_state(volatile u32 *s, enum ice_state bit)
73571d10453SEric Joyner {
73671d10453SEric Joyner 	/* atomic_set_32 expects a bitmask */
73771d10453SEric Joyner 	atomic_set_32(s, BIT(bit));
73871d10453SEric Joyner }
73971d10453SEric Joyner 
74071d10453SEric Joyner /**
74171d10453SEric Joyner  * ice_clear_state - Clear the specified state
74271d10453SEric Joyner  * @s: the state bitmap
74371d10453SEric Joyner  * @bit: the state to clear
74471d10453SEric Joyner  *
74571d10453SEric Joyner  * Atomically update the state bitmap with the specified bit cleared.
74671d10453SEric Joyner  */
74771d10453SEric Joyner static inline void
74871d10453SEric Joyner ice_clear_state(volatile u32 *s, enum ice_state bit)
74971d10453SEric Joyner {
75071d10453SEric Joyner 	/* atomic_clear_32 expects a bitmask */
75171d10453SEric Joyner 	atomic_clear_32(s, BIT(bit));
75271d10453SEric Joyner }
75371d10453SEric Joyner 
75471d10453SEric Joyner /**
75571d10453SEric Joyner  * ice_testandset_state - Test and set the specified state
75671d10453SEric Joyner  * @s: the state bitmap
75771d10453SEric Joyner  * @bit: the bit to test
75871d10453SEric Joyner  *
75971d10453SEric Joyner  * Atomically update the state bitmap, setting the specified bit. Returns the
76071d10453SEric Joyner  * previous value of the bit.
76171d10453SEric Joyner  */
76271d10453SEric Joyner static inline u32
76371d10453SEric Joyner ice_testandset_state(volatile u32 *s, enum ice_state bit)
76471d10453SEric Joyner {
76571d10453SEric Joyner 	/* atomic_testandset_32 expects a bit position */
76671d10453SEric Joyner 	return atomic_testandset_32(s, bit);
76771d10453SEric Joyner }
76871d10453SEric Joyner 
76971d10453SEric Joyner /**
77071d10453SEric Joyner  * ice_testandclear_state - Test and clear the specified state
77171d10453SEric Joyner  * @s: the state bitmap
77271d10453SEric Joyner  * @bit: the bit to test
77371d10453SEric Joyner  *
77471d10453SEric Joyner  * Atomically update the state bitmap, clearing the specified bit. Returns the
77571d10453SEric Joyner  * previous value of the bit.
77671d10453SEric Joyner  */
77771d10453SEric Joyner static inline u32
77871d10453SEric Joyner ice_testandclear_state(volatile u32 *s, enum ice_state bit)
77971d10453SEric Joyner {
78071d10453SEric Joyner 	/* atomic_testandclear_32 expects a bit position */
78171d10453SEric Joyner 	return atomic_testandclear_32(s, bit);
78271d10453SEric Joyner }
78371d10453SEric Joyner 
78471d10453SEric Joyner /**
78571d10453SEric Joyner  * ice_test_state - Test the specified state
78671d10453SEric Joyner  * @s: the state bitmap
78771d10453SEric Joyner  * @bit: the bit to test
78871d10453SEric Joyner  *
78971d10453SEric Joyner  * Return true if the state is set, false otherwise. Use this only if the flow
79071d10453SEric Joyner  * does not need to update the state. If you must update the state as well,
79171d10453SEric Joyner  * prefer ice_testandset_state or ice_testandclear_state.
79271d10453SEric Joyner  */
79371d10453SEric Joyner static inline u32
79471d10453SEric Joyner ice_test_state(volatile u32 *s, enum ice_state bit)
79571d10453SEric Joyner {
79671d10453SEric Joyner 	return (*s & BIT(bit)) ? true : false;
79771d10453SEric Joyner }
79871d10453SEric Joyner 
79971d10453SEric Joyner /**
80071d10453SEric Joyner  * @struct ice_str_buf
80171d10453SEric Joyner  * @brief static length buffer for string returning
80271d10453SEric Joyner  *
80371d10453SEric Joyner  * Structure containing a fixed size string buffer, used to implement
80471d10453SEric Joyner  * numeric->string conversion functions that may want to return non-constant
80571d10453SEric Joyner  * strings.
80671d10453SEric Joyner  *
80771d10453SEric Joyner  * This allows returning a fixed size string that is generated by a conversion
80871d10453SEric Joyner  * function, and then copied to the used location without needing to use an
80971d10453SEric Joyner  * explicit local variable passed by reference.
81071d10453SEric Joyner  */
81171d10453SEric Joyner struct ice_str_buf {
81271d10453SEric Joyner 	char str[ICE_STR_BUF_LEN];
81371d10453SEric Joyner };
81471d10453SEric Joyner 
81571d10453SEric Joyner struct ice_str_buf _ice_aq_str(enum ice_aq_err aq_err);
816f2635e84SEric Joyner struct ice_str_buf _ice_status_str(int status);
81771d10453SEric Joyner struct ice_str_buf _ice_err_str(int err);
81871d10453SEric Joyner struct ice_str_buf _ice_fltr_flag_str(u16 flag);
81956429daeSEric Joyner struct ice_str_buf _ice_log_sev_str(u8 log_level);
82071d10453SEric Joyner struct ice_str_buf _ice_mdd_tx_tclan_str(u8 event);
82171d10453SEric Joyner struct ice_str_buf _ice_mdd_tx_pqm_str(u8 event);
82271d10453SEric Joyner struct ice_str_buf _ice_mdd_rx_str(u8 event);
82371d10453SEric Joyner struct ice_str_buf _ice_fw_lldp_status(u32 lldp_status);
82471d10453SEric Joyner 
82571d10453SEric Joyner #define ice_aq_str(err)		_ice_aq_str(err).str
82671d10453SEric Joyner #define ice_status_str(err)	_ice_status_str(err).str
82771d10453SEric Joyner #define ice_err_str(err)	_ice_err_str(err).str
82871d10453SEric Joyner #define ice_fltr_flag_str(flag)	_ice_fltr_flag_str(flag).str
82971d10453SEric Joyner 
83071d10453SEric Joyner #define ice_mdd_tx_tclan_str(event)	_ice_mdd_tx_tclan_str(event).str
83171d10453SEric Joyner #define ice_mdd_tx_pqm_str(event)	_ice_mdd_tx_pqm_str(event).str
83271d10453SEric Joyner #define ice_mdd_rx_str(event)		_ice_mdd_rx_str(event).str
83371d10453SEric Joyner 
83456429daeSEric Joyner #define ice_log_sev_str(log_level)	_ice_log_sev_str(log_level).str
83571d10453SEric Joyner #define ice_fw_lldp_status(lldp_status) _ice_fw_lldp_status(lldp_status).str
83671d10453SEric Joyner 
83771d10453SEric Joyner /**
83871d10453SEric Joyner  * ice_enable_intr - Enable interrupts for given vector
83971d10453SEric Joyner  * @hw: the device private HW structure
84071d10453SEric Joyner  * @vector: the interrupt index in PF space
84171d10453SEric Joyner  *
84271d10453SEric Joyner  * In MSI or Legacy interrupt mode, interrupt 0 is the only valid index.
84371d10453SEric Joyner  */
84471d10453SEric Joyner static inline void
84571d10453SEric Joyner ice_enable_intr(struct ice_hw *hw, int vector)
84671d10453SEric Joyner {
84771d10453SEric Joyner 	u32 dyn_ctl;
84871d10453SEric Joyner 
84971d10453SEric Joyner 	/* Use ITR_NONE so that ITR configuration is not changed. */
85071d10453SEric Joyner 	dyn_ctl = GLINT_DYN_CTL_INTENA_M | GLINT_DYN_CTL_CLEARPBA_M |
85171d10453SEric Joyner 		  (ICE_ITR_NONE << GLINT_DYN_CTL_ITR_INDX_S);
85271d10453SEric Joyner 	wr32(hw, GLINT_DYN_CTL(vector), dyn_ctl);
85371d10453SEric Joyner }
85471d10453SEric Joyner 
85571d10453SEric Joyner /**
85671d10453SEric Joyner  * ice_disable_intr - Disable interrupts for given vector
85771d10453SEric Joyner  * @hw: the device private HW structure
85871d10453SEric Joyner  * @vector: the interrupt index in PF space
85971d10453SEric Joyner  *
86071d10453SEric Joyner  * In MSI or Legacy interrupt mode, interrupt 0 is the only valid index.
86171d10453SEric Joyner  */
86271d10453SEric Joyner static inline void
86371d10453SEric Joyner ice_disable_intr(struct ice_hw *hw, int vector)
86471d10453SEric Joyner {
86571d10453SEric Joyner 	u32 dyn_ctl;
86671d10453SEric Joyner 
86771d10453SEric Joyner 	/* Use ITR_NONE so that ITR configuration is not changed. */
86871d10453SEric Joyner 	dyn_ctl = ICE_ITR_NONE << GLINT_DYN_CTL_ITR_INDX_S;
86971d10453SEric Joyner 	wr32(hw, GLINT_DYN_CTL(vector), dyn_ctl);
87071d10453SEric Joyner }
87171d10453SEric Joyner 
87271d10453SEric Joyner /**
87371d10453SEric Joyner  * ice_is_tx_desc_done - determine if a Tx descriptor is done
87471d10453SEric Joyner  * @txd: the Tx descriptor to check
87571d10453SEric Joyner  *
87671d10453SEric Joyner  * Returns true if hardware is done with a Tx descriptor and software is
87771d10453SEric Joyner  * capable of re-using it.
87871d10453SEric Joyner  */
87971d10453SEric Joyner static inline bool
88071d10453SEric Joyner ice_is_tx_desc_done(struct ice_tx_desc *txd)
88171d10453SEric Joyner {
88271d10453SEric Joyner 	return (((txd->cmd_type_offset_bsz & ICE_TXD_QW1_DTYPE_M)
88371d10453SEric Joyner 		 >> ICE_TXD_QW1_DTYPE_S) == ICE_TX_DESC_DTYPE_DESC_DONE);
88471d10453SEric Joyner }
88571d10453SEric Joyner 
88671d10453SEric Joyner /**
88771d10453SEric Joyner  * ice_get_pf_id - Get the PF id from the hardware registers
88871d10453SEric Joyner  * @hw: the ice hardware structure
88971d10453SEric Joyner  *
89071d10453SEric Joyner  * Reads the PF_FUNC_RID register and extracts the function number from it.
89171d10453SEric Joyner  * Intended to be used in cases where hw->pf_id hasn't yet been assigned by
89271d10453SEric Joyner  * ice_init_hw.
89371d10453SEric Joyner  *
89471d10453SEric Joyner  * @pre this function should be called only after PCI register access has been
89571d10453SEric Joyner  * setup, and prior to ice_init_hw. After hardware has been initialized, the
89671d10453SEric Joyner  * cached hw->pf_id value can be used.
89771d10453SEric Joyner  */
89871d10453SEric Joyner static inline u8
89971d10453SEric Joyner ice_get_pf_id(struct ice_hw *hw)
90071d10453SEric Joyner {
90171d10453SEric Joyner 	return (u8)((rd32(hw, PF_FUNC_RID) & PF_FUNC_RID_FUNCTION_NUMBER_M) >>
90271d10453SEric Joyner 		    PF_FUNC_RID_FUNCTION_NUMBER_S);
90371d10453SEric Joyner }
90471d10453SEric Joyner 
90571d10453SEric Joyner /* Details of how to re-initialize depend on the networking stack */
90671d10453SEric Joyner void ice_request_stack_reinit(struct ice_softc *sc);
90771d10453SEric Joyner 
90871d10453SEric Joyner /* Details of how to check if the network stack is detaching us */
90971d10453SEric Joyner bool ice_driver_is_detaching(struct ice_softc *sc);
91071d10453SEric Joyner 
9119e54973fSEric Joyner /* Details of how to setup/teardown a mirror interface */
9129e54973fSEric Joyner /**
9139e54973fSEric Joyner  * @brief Create an interface for mirroring
9149e54973fSEric Joyner  */
9159e54973fSEric Joyner int ice_create_mirror_interface(struct ice_softc *sc);
9169e54973fSEric Joyner /**
9179e54973fSEric Joyner  * @brief Destroy created mirroring interface
9189e54973fSEric Joyner  */
9199e54973fSEric Joyner void ice_destroy_mirror_interface(struct ice_softc *sc);
9209e54973fSEric Joyner 
92156429daeSEric Joyner const char * ice_fw_module_str(enum ice_aqc_fw_logging_mod module);
92256429daeSEric Joyner void ice_add_fw_logging_tunables(struct ice_softc *sc,
92356429daeSEric Joyner 				 struct sysctl_oid *parent);
92456429daeSEric Joyner void ice_handle_fw_log_event(struct ice_softc *sc, struct ice_aq_desc *desc,
92556429daeSEric Joyner 			     void *buf);
92656429daeSEric Joyner 
92771d10453SEric Joyner int  ice_process_ctrlq(struct ice_softc *sc, enum ice_ctl_q q_type, u16 *pending);
92871d10453SEric Joyner int  ice_map_bar(device_t dev, struct ice_bar_info *bar, int bar_num);
92971d10453SEric Joyner void ice_free_bar(device_t dev, struct ice_bar_info *bar);
93071d10453SEric Joyner void ice_set_ctrlq_len(struct ice_hw *hw);
93171d10453SEric Joyner void ice_release_vsi(struct ice_vsi *vsi);
93271d10453SEric Joyner struct ice_vsi *ice_alloc_vsi(struct ice_softc *sc, enum ice_vsi_type type);
9335f97656fSZhenlei Huang void ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues,
93471d10453SEric Joyner 		       const int max_rx_queues);
93571d10453SEric Joyner void ice_free_vsi_qmaps(struct ice_vsi *vsi);
93671d10453SEric Joyner int  ice_initialize_vsi(struct ice_vsi *vsi);
93771d10453SEric Joyner void ice_deinit_vsi(struct ice_vsi *vsi);
93871d10453SEric Joyner uint64_t ice_aq_speed_to_rate(struct ice_port_info *pi);
93971d10453SEric Joyner int  ice_get_phy_type_low(uint64_t phy_type_low);
94071d10453SEric Joyner int  ice_get_phy_type_high(uint64_t phy_type_high);
941f2635e84SEric Joyner int ice_add_media_types(struct ice_softc *sc, struct ifmedia *media);
9429dc2f6e2SEric Joyner void ice_configure_rxq_interrupt(struct ice_hw *hw, u16 rxqid, u16 vector, u8 itr_idx);
9439dc2f6e2SEric Joyner void ice_configure_all_rxq_interrupts(struct ice_vsi *vsi);
9449dc2f6e2SEric Joyner void ice_configure_txq_interrupt(struct ice_hw *hw, u16 txqid, u16 vector, u8 itr_idx);
9459dc2f6e2SEric Joyner void ice_configure_all_txq_interrupts(struct ice_vsi *vsi);
94671d10453SEric Joyner void ice_flush_rxq_interrupts(struct ice_vsi *vsi);
94771d10453SEric Joyner void ice_flush_txq_interrupts(struct ice_vsi *vsi);
94871d10453SEric Joyner int  ice_cfg_vsi_for_tx(struct ice_vsi *vsi);
94971d10453SEric Joyner int  ice_cfg_vsi_for_rx(struct ice_vsi *vsi);
9509dc2f6e2SEric Joyner int  ice_control_rx_queue(struct ice_vsi *vsi, u16 qidx, bool enable);
9519dc2f6e2SEric Joyner int  ice_control_all_rx_queues(struct ice_vsi *vsi, bool enable);
95271d10453SEric Joyner int  ice_cfg_pf_default_mac_filters(struct ice_softc *sc);
95371d10453SEric Joyner int  ice_rm_pf_default_mac_filters(struct ice_softc *sc);
95471d10453SEric Joyner void ice_print_nvm_version(struct ice_softc *sc);
95571d10453SEric Joyner void ice_update_vsi_hw_stats(struct ice_vsi *vsi);
95671d10453SEric Joyner void ice_reset_vsi_stats(struct ice_vsi *vsi);
95771d10453SEric Joyner void ice_update_pf_stats(struct ice_softc *sc);
95871d10453SEric Joyner void ice_reset_pf_stats(struct ice_softc *sc);
95971d10453SEric Joyner void ice_add_device_sysctls(struct ice_softc *sc);
96071d10453SEric Joyner void ice_log_hmc_error(struct ice_hw *hw, device_t dev);
96171d10453SEric Joyner void ice_add_sysctls_eth_stats(struct sysctl_ctx_list *ctx,
96271d10453SEric Joyner 			       struct sysctl_oid *parent,
96371d10453SEric Joyner 			       struct ice_eth_stats *stats);
96471d10453SEric Joyner void ice_add_vsi_sysctls(struct ice_vsi *vsi);
96571d10453SEric Joyner void ice_add_sysctls_mac_stats(struct sysctl_ctx_list *ctx,
96671d10453SEric Joyner 			       struct sysctl_oid *parent,
967f2635e84SEric Joyner 			       struct ice_softc *sc);
96871d10453SEric Joyner void ice_configure_misc_interrupts(struct ice_softc *sc);
96971d10453SEric Joyner int  ice_sync_multicast_filters(struct ice_softc *sc);
970f2635e84SEric Joyner int ice_add_vlan_hw_filters(struct ice_vsi *vsi, u16 *vid,
9719dc2f6e2SEric Joyner 					u16 length);
972f2635e84SEric Joyner int ice_add_vlan_hw_filter(struct ice_vsi *vsi, u16 vid);
973f2635e84SEric Joyner int ice_remove_vlan_hw_filters(struct ice_vsi *vsi, u16 *vid,
9749dc2f6e2SEric Joyner 					   u16 length);
975f2635e84SEric Joyner int ice_remove_vlan_hw_filter(struct ice_vsi *vsi, u16 vid);
97671d10453SEric Joyner void ice_add_vsi_tunables(struct ice_vsi *vsi, struct sysctl_oid *parent);
97771d10453SEric Joyner void ice_del_vsi_sysctl_ctx(struct ice_vsi *vsi);
97871d10453SEric Joyner void ice_add_device_tunables(struct ice_softc *sc);
97971d10453SEric Joyner int  ice_add_vsi_mac_filter(struct ice_vsi *vsi, const u8 *addr);
98071d10453SEric Joyner int  ice_remove_vsi_mac_filter(struct ice_vsi *vsi, const u8 *addr);
98171d10453SEric Joyner int  ice_vsi_disable_tx(struct ice_vsi *vsi);
98271d10453SEric Joyner void ice_vsi_add_txqs_ctx(struct ice_vsi *vsi);
98371d10453SEric Joyner void ice_vsi_add_rxqs_ctx(struct ice_vsi *vsi);
98471d10453SEric Joyner void ice_vsi_del_txqs_ctx(struct ice_vsi *vsi);
98571d10453SEric Joyner void ice_vsi_del_rxqs_ctx(struct ice_vsi *vsi);
98671d10453SEric Joyner void ice_add_txq_sysctls(struct ice_tx_queue *txq);
98771d10453SEric Joyner void ice_add_rxq_sysctls(struct ice_rx_queue *rxq);
98871d10453SEric Joyner int  ice_config_rss(struct ice_vsi *vsi);
98971d10453SEric Joyner void ice_clean_all_vsi_rss_cfg(struct ice_softc *sc);
990f2635e84SEric Joyner int ice_load_pkg_file(struct ice_softc *sc);
9918923de59SPiotr Kubaj void ice_log_pkg_init(struct ice_softc *sc, enum ice_ddp_state pkg_status);
99271d10453SEric Joyner uint64_t ice_get_ifnet_counter(struct ice_vsi *vsi, ift_counter counter);
99371d10453SEric Joyner void ice_save_pci_info(struct ice_hw *hw, device_t dev);
99471d10453SEric Joyner int  ice_replay_all_vsi_cfg(struct ice_softc *sc);
99571d10453SEric Joyner void ice_link_up_msg(struct ice_softc *sc);
99671d10453SEric Joyner int  ice_update_laa_mac(struct ice_softc *sc);
99771d10453SEric Joyner void ice_get_and_print_bus_info(struct ice_softc *sc);
99871d10453SEric Joyner const char *ice_fec_str(enum ice_fec_mode mode);
99971d10453SEric Joyner const char *ice_fc_str(enum ice_fc_mode mode);
100071d10453SEric Joyner const char *ice_fwd_act_str(enum ice_sw_fwd_act_type action);
100171d10453SEric Joyner const char *ice_state_to_str(enum ice_state state);
100271d10453SEric Joyner int  ice_init_link_events(struct ice_softc *sc);
100371d10453SEric Joyner void ice_configure_rx_itr(struct ice_vsi *vsi);
100471d10453SEric Joyner void ice_configure_tx_itr(struct ice_vsi *vsi);
100571d10453SEric Joyner void ice_setup_pf_vsi(struct ice_softc *sc);
100671d10453SEric Joyner void ice_handle_mdd_event(struct ice_softc *sc);
100771d10453SEric Joyner void ice_init_dcb_setup(struct ice_softc *sc);
100871d10453SEric Joyner int  ice_send_version(struct ice_softc *sc);
100971d10453SEric Joyner int  ice_cfg_pf_ethertype_filters(struct ice_softc *sc);
101071d10453SEric Joyner void ice_init_link_configuration(struct ice_softc *sc);
101171d10453SEric Joyner void ice_init_saved_phy_cfg(struct ice_softc *sc);
10129cf1841cSEric Joyner int  ice_apply_saved_phy_cfg(struct ice_softc *sc, u8 settings);
101371d10453SEric Joyner void ice_set_link_management_mode(struct ice_softc *sc);
101471d10453SEric Joyner int  ice_module_event_handler(module_t mod, int what, void *arg);
101571d10453SEric Joyner int  ice_handle_nvm_access_ioctl(struct ice_softc *sc, struct ifdrv *ifd);
101671d10453SEric Joyner int  ice_handle_i2c_req(struct ice_softc *sc, struct ifi2creq *req);
101771d10453SEric Joyner int  ice_read_sff_eeprom(struct ice_softc *sc, u16 dev_addr, u16 offset, u8* data, u16 length);
101871d10453SEric Joyner int  ice_alloc_intr_tracking(struct ice_softc *sc);
101971d10453SEric Joyner void ice_free_intr_tracking(struct ice_softc *sc);
10207d7af7f8SEric Joyner void ice_set_default_local_lldp_mib(struct ice_softc *sc);
10219c30461dSEric Joyner void ice_set_link(struct ice_softc *sc, bool enabled);
10229c30461dSEric Joyner void ice_add_rx_lldp_filter(struct ice_softc *sc);
10239cf1841cSEric Joyner void ice_init_health_events(struct ice_softc *sc);
102456429daeSEric Joyner void ice_cfg_pba_num(struct ice_softc *sc);
10258923de59SPiotr Kubaj int ice_handle_debug_dump_ioctl(struct ice_softc *sc, struct ifdrv *ifd);
10268923de59SPiotr Kubaj u8 ice_dcb_get_tc_map(const struct ice_dcbx_cfg *dcbcfg);
10279c30461dSEric Joyner void ice_do_dcb_reconfig(struct ice_softc *sc, bool pending_mib);
10289e54973fSEric Joyner int ice_setup_vsi_mirroring(struct ice_vsi *vsi);
102971d10453SEric Joyner 
103071d10453SEric Joyner #endif /* _ICE_LIB_H_ */
1031