mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
net: Use conftest
Instead of relying on kernel version to determine if functions or specific versions of functions are present in the kernel, add compile time tests to the conftest.sh script to determine this at compile time for the kernel being used. This is beneficial for working with 3rd party Linux kernels that may have back-ported upstream changes into their kernel and so the kernel version checks do not work. Bug 4119327 Change-Id: I79e701940ca70ca4d66500c75b5992f9d92b54b0 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985744 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
3dbf9a344e
commit
ece68dd0d1
@@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved */
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <linux/version.h>
|
||||
#include "ether_linux.h"
|
||||
|
||||
@@ -908,7 +910,7 @@ static int ether_get_ts_info(struct net_device *ndev,
|
||||
* @retval 0 on Sucess
|
||||
* @retval "negative value" on failure.
|
||||
*/
|
||||
#if (KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE)
|
||||
#if defined(NV_ETHTOOL_OPS_GET_SET_COALESCE_HAS_COAL_AND_EXTACT_ARGS) /* Linux v5.15 */
|
||||
static int ether_set_coalesce(struct net_device *dev,
|
||||
struct ethtool_coalesce *ec,
|
||||
struct kernel_ethtool_coalesce *kernel_coal,
|
||||
@@ -1049,7 +1051,7 @@ static int ether_set_coalesce(struct net_device *dev,
|
||||
*
|
||||
* @retval 0 on Success.
|
||||
*/
|
||||
#if (KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE)
|
||||
#if defined(NV_ETHTOOL_OPS_GET_SET_COALESCE_HAS_COAL_AND_EXTACT_ARGS) /* Linux v5.15 */
|
||||
static int ether_get_coalesce(struct net_device *dev,
|
||||
struct ethtool_coalesce *ec,
|
||||
struct kernel_ethtool_coalesce *kernel_coal,
|
||||
@@ -1510,7 +1512,7 @@ static int ether_set_rxfh(struct net_device *ndev, const u32 *indir,
|
||||
|
||||
}
|
||||
|
||||
#if (KERNEL_VERSION(5, 17, 0) <= LINUX_VERSION_CODE)
|
||||
#if defined(NV_ETHTOOL_OPS_GET_SET_RINGPARAM_HAS_RINGPARAM_AND_EXTACT_ARGS) /* Linux v5.17 */
|
||||
static void ether_get_ringparam(struct net_device *ndev,
|
||||
struct ethtool_ringparam *ring,
|
||||
struct kernel_ethtool_ringparam *kernel_ring,
|
||||
@@ -1530,7 +1532,7 @@ static void ether_get_ringparam(struct net_device *ndev,
|
||||
ring->tx_pending = osi_dma->tx_ring_sz;
|
||||
}
|
||||
|
||||
#if (KERNEL_VERSION(5, 17, 0) <= LINUX_VERSION_CODE)
|
||||
#if defined(NV_ETHTOOL_OPS_GET_SET_RINGPARAM_HAS_RINGPARAM_AND_EXTACT_ARGS) /* Linux v5.17 */
|
||||
static int ether_set_ringparam(struct net_device *ndev,
|
||||
struct ethtool_ringparam *ring,
|
||||
struct kernel_ethtool_ringparam *kernel_ring,
|
||||
|
||||
Reference in New Issue
Block a user