xref: /netbsd-src/sys/dev/pci/ixgbe/ixgbe_features.h (revision 8467fefbc1f237841c1a319d1036afcc13ab0e94)
1*8467fefbSmsaitoh /* $NetBSD: ixgbe_features.h,v 1.4 2021/12/24 05:02:11 msaitoh Exp $ */
2dc7f84c8Smsaitoh /******************************************************************************
3dc7f84c8Smsaitoh 
4*8467fefbSmsaitoh   Copyright (c) 2001-2020, Intel Corporation
5dc7f84c8Smsaitoh   All rights reserved.
6dc7f84c8Smsaitoh 
7dc7f84c8Smsaitoh   Redistribution and use in source and binary forms, with or without
8dc7f84c8Smsaitoh   modification, are permitted provided that the following conditions are met:
9dc7f84c8Smsaitoh 
10dc7f84c8Smsaitoh    1. Redistributions of source code must retain the above copyright notice,
11dc7f84c8Smsaitoh       this list of conditions and the following disclaimer.
12dc7f84c8Smsaitoh 
13dc7f84c8Smsaitoh    2. Redistributions in binary form must reproduce the above copyright
14dc7f84c8Smsaitoh       notice, this list of conditions and the following disclaimer in the
15dc7f84c8Smsaitoh       documentation and/or other materials provided with the distribution.
16dc7f84c8Smsaitoh 
17dc7f84c8Smsaitoh    3. Neither the name of the Intel Corporation nor the names of its
18dc7f84c8Smsaitoh       contributors may be used to endorse or promote products derived from
19dc7f84c8Smsaitoh       this software without specific prior written permission.
20dc7f84c8Smsaitoh 
21dc7f84c8Smsaitoh   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22dc7f84c8Smsaitoh   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23dc7f84c8Smsaitoh   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24dc7f84c8Smsaitoh   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25dc7f84c8Smsaitoh   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26dc7f84c8Smsaitoh   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27dc7f84c8Smsaitoh   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28dc7f84c8Smsaitoh   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29dc7f84c8Smsaitoh   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30dc7f84c8Smsaitoh   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31dc7f84c8Smsaitoh   POSSIBILITY OF SUCH DAMAGE.
32dc7f84c8Smsaitoh 
33dc7f84c8Smsaitoh ******************************************************************************/
34dc7f84c8Smsaitoh /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_features.h 320688 2017-07-05 17:27:03Z erj $*/
35dc7f84c8Smsaitoh 
36dc7f84c8Smsaitoh 
37dc7f84c8Smsaitoh #ifndef _IXGBE_FEATURES_H_
38dc7f84c8Smsaitoh #define _IXGBE_FEATURES_H_
39dc7f84c8Smsaitoh 
40dc7f84c8Smsaitoh /*
41dc7f84c8Smsaitoh  * Feature defines.  Eventually, we'd like to get to a point where we
42dc7f84c8Smsaitoh  * can remove MAC/Phy type checks scattered throughout the code in
43dc7f84c8Smsaitoh  * favor of checking these feature flags. If the feature expects OS
44dc7f84c8Smsaitoh  * support, make sure to add an #undef below if expected to run on
45dc7f84c8Smsaitoh  * OSs that don't support said feature.
46dc7f84c8Smsaitoh  */
47dc7f84c8Smsaitoh #define IXGBE_FEATURE_VF                        (u32)(1 << 0)
48dc7f84c8Smsaitoh #define IXGBE_FEATURE_SRIOV                     (u32)(1 << 1)
49dc7f84c8Smsaitoh #define IXGBE_FEATURE_RSS                       (u32)(1 << 2)
50dc7f84c8Smsaitoh #define IXGBE_FEATURE_NETMAP                    (u32)(1 << 3)
51dc7f84c8Smsaitoh #define IXGBE_FEATURE_FAN_FAIL                  (u32)(1 << 4)
52dc7f84c8Smsaitoh #define IXGBE_FEATURE_TEMP_SENSOR               (u32)(1 << 5)
53dc7f84c8Smsaitoh #define IXGBE_FEATURE_BYPASS                    (u32)(1 << 6)
54dc7f84c8Smsaitoh #define IXGBE_FEATURE_LEGACY_TX                 (u32)(1 << 7)
55dc7f84c8Smsaitoh #define IXGBE_FEATURE_FDIR                      (u32)(1 << 8)
56dc7f84c8Smsaitoh #define IXGBE_FEATURE_MSI                       (u32)(1 << 9)
57dc7f84c8Smsaitoh #define IXGBE_FEATURE_MSIX                      (u32)(1 << 10)
58dc7f84c8Smsaitoh #define IXGBE_FEATURE_EEE                       (u32)(1 << 11)
59dc7f84c8Smsaitoh #define IXGBE_FEATURE_LEGACY_IRQ                (u32)(1 << 12)
60dc7f84c8Smsaitoh #define IXGBE_FEATURE_NEEDS_CTXD                (u32)(1 << 13)
6122298f59Smsaitoh #define IXGBE_FEATURE_RECOVERY_MODE             (u32)(1 << 15)
62dc7f84c8Smsaitoh 
63dc7f84c8Smsaitoh #define IXGBE_FEATURE_FLAGS "\20" \
64dc7f84c8Smsaitoh 	"\1" "VF"	"\2" "SRIOV"	"\3" "RSS"	"\4" "NETMAP"	\
65dc7f84c8Smsaitoh 	"\5" "FAN_FAIL"	"\6" "TEMP_SENSOR" "\7" "BYPASS" "\10" "LEGACY_TX" \
66dc7f84c8Smsaitoh 	"\11" "FDIR"	"\12" "MSI"	"\13" "MSIX"	"\14" "EEE"	\
6722298f59Smsaitoh 	"\15" "LEGACY_IRQ" "\16" "NEEDS_CTXD"		"\20" "RECOVERY_MODE"
68dc7f84c8Smsaitoh 
69dc7f84c8Smsaitoh /* Check for OS support.  Undefine features if not included in the OS */
70dc7f84c8Smsaitoh #ifndef PCI_IOV
71dc7f84c8Smsaitoh #undef  IXGBE_FEATURE_SRIOV
72dc7f84c8Smsaitoh #define IXGBE_FEATURE_SRIOV                     0
73dc7f84c8Smsaitoh #endif
74dc7f84c8Smsaitoh 
75dc7f84c8Smsaitoh #ifndef RSS
76dc7f84c8Smsaitoh #undef  IXGBE_FEATURE_RSS
77dc7f84c8Smsaitoh #define IXGBE_FEATURE_RSS                       0
78dc7f84c8Smsaitoh #endif
79dc7f84c8Smsaitoh 
80dc7f84c8Smsaitoh #ifndef DEV_NETMAP
81dc7f84c8Smsaitoh #undef  IXGBE_FEATURE_NETMAP
82dc7f84c8Smsaitoh #define IXGBE_FEATURE_NETMAP                    0
83dc7f84c8Smsaitoh #endif
84dc7f84c8Smsaitoh 
85dc7f84c8Smsaitoh #endif /* _IXGBE_FEATURES_H_ */
86