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