ethernet: Add dummy driver for r8168

r8168 driver build is disabled on K6.9 and later. This is
causing the packaging failure where module is not available.

Add dummy driver when real driver is not available to make
packaging success.

bug 4628651

Change-Id: I8ade511488fab856f63e84c1ee51986286b2fa2d
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3138401
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
This commit is contained in:
Laxman Dewangan
2024-05-15 11:18:35 +00:00
committed by mobile promotions
parent 8720fe2167
commit 316baa6776
3 changed files with 27 additions and 2 deletions

View File

@@ -1,7 +1,5 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved.
ifeq ($(shell expr \( $(VERSION) \) \* 10000 + \( $(PATCHLEVEL) \) \* 100 + \( $(SUBLEVEL) \) \<= 60804), 1)
obj-m += r8168/ obj-m += r8168/
endif

View File

@@ -30,6 +30,15 @@
# US6,570,884, US6,115,776, and US6,327,625. # US6,570,884, US6,115,776, and US6,327,625.
################################################################################ ################################################################################
LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL))
LINUX_VERSION_6_9 := $(shell expr 6 \* 256 + 9)
# Use dummy R8168 driver for K69 and later
ifeq ($(shell test $(LINUX_VERSION) -ge $(LINUX_VERSION_6_9); echo $$?),0)
obj-m := r8168.o
r8168-objs := r8168_dummy.o
else
CONFIG_SOC_LAN = n CONFIG_SOC_LAN = n
ENABLE_FIBER_SUPPORT = n ENABLE_FIBER_SUPPORT = n
ENABLE_REALWOW_SUPPORT = n ENABLE_REALWOW_SUPPORT = n
@@ -193,3 +202,4 @@ install:
#endif #endif
endif endif
endif

View File

@@ -0,0 +1,17 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*/
#include <linux/module.h>
/* Dummy implementation for module */
static int __init r8168_dummy_dummy_init(void)
{
return 0;
}
device_initcall(r8168_dummy_dummy_init);
MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
MODULE_DESCRIPTION("Dummy R8168 dummy driver");
MODULE_LICENSE("GPL V2");