From 408ef72fb9471c13693c7b9c84c5431035ef9165 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Thu, 30 May 2024 09:48:25 +0100 Subject: [PATCH] net: realtek: Add option to disable drivers The RealTek drivers do not build against all Linux distributions because some Linux distributions have back-ported upstream changes and so the KERNEL_VERSION checks in the driver do not work for these distributions. Add compilation flags for these drivers so that we can skip the building of these drivers for certain Linux distributions. Please note that the RealTek drivers build fine against Linux v5.14 and so we should not prevent these driver being built against all Linux v5.14 kernels. Bug 4729493 Change-Id: I004d61a884c6f01b4629de56ecc17b55d4fa2cd1 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3171274 Reviewed-by: Laxman Dewangan GVS: buildbot_gerritrpt --- drivers/net/ethernet/realtek/Makefile | 10 +++++++--- drivers/net/wireless/realtek/Makefile | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/realtek/Makefile b/drivers/net/ethernet/realtek/Makefile index 6339a8cb..10d3d525 100644 --- a/drivers/net/ethernet/realtek/Makefile +++ b/drivers/net/ethernet/realtek/Makefile @@ -1,6 +1,10 @@ -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. +# SPDX-License-Identifier: GPL-2.0-only +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +ifneq ($(NV_OOT_REALTEK_R8168_SKIP_BUILD),y) obj-m += r8168/ -obj-m += r8126/ +endif +ifneq ($(NV_OOT_REALTEK_R8126_SKIP_BUILD),y) +obj-m += r8126/ +endif diff --git a/drivers/net/wireless/realtek/Makefile b/drivers/net/wireless/realtek/Makefile index 7d4e780c..014ace31 100644 --- a/drivers/net/wireless/realtek/Makefile +++ b/drivers/net/wireless/realtek/Makefile @@ -1,8 +1,10 @@ -# SPDX-License-Identifier: GPL-2.0 -# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. +# SPDX-License-Identifier: GPL-2.0-only +# SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. ifeq ($(findstring ack_src,$(NV_BUILD_KERNEL_OPTIONS)),) ifeq ($(VERSION).$(PATCHLEVEL),5.15) +ifneq ($(NV_OOT_REALTEK_RTL8822CE_SKIP_BUILD),y) obj-m += rtl8822ce/ endif endif +endif