1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright (c) 2020, Intel Corporation
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the Intel Corporation nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
34 * @file ice_features.h
35 * @brief device feature controls
37 * Contains a list of various device features which could be enabled or
41 #ifndef _ICE_FEATURES_H_
42 #define _ICE_FEATURES_H_
46 * @brief driver feature enumeration
48 * Enumeration of possible device driver features that can be enabled or
49 * disabled. Each possible value represents a different feature which can be
50 * enabled or disabled.
52 * The driver stores a bitmap of the features that the device and OS are
53 * capable of, as well as another bitmap indicating which features are
54 * currently enabled for that device.
64 ICE_FEATURE_SAFE_MODE,
65 ICE_FEATURE_LENIENT_LINK_MODE,
66 ICE_FEATURE_DEFAULT_OVERRIDE,
67 /* Must be last entry */
72 * ice_disable_unsupported_features - Disable features not enabled by OS
73 * @bitmap: the feature bitmap
75 * Check for OS support of various driver features. Clear the feature bit for
76 * any feature which is not enabled by the OS. This should be called early
77 * during driver attach after setting up the feature bitmap.
79 * @remark the bitmap parameter is marked as unused in order to avoid an
80 * unused parameter warning in case none of the features need to be disabled.
83 ice_disable_unsupported_features(ice_bitmap_t __unused *bitmap)
85 ice_clear_bit(ICE_FEATURE_SRIOV, bitmap);
87 ice_clear_bit(ICE_FEATURE_NETMAP, bitmap);