ethernet: Add dummy driver for r8126

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

Bug 5312842

Change-Id: I9f0e531f0b9d3353c6f98a3872a4c0dd5cb27934
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3415213
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Revanth Kumar Uppala
2024-06-06 06:50:11 +00:00
committed by mobile promotions
parent 914b98c3ac
commit 009a4a8f5d
2 changed files with 31 additions and 0 deletions

View File

@@ -30,6 +30,19 @@
# 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_16 := $(shell expr 6 \* 256 + 16)
LINUX_VERSION_5_14 := $(shell expr 5 \* 256 + 14)
# Use dummy R8126 driver for Kernel versions greater that K6.16
ifeq ($(shell test $(LINUX_VERSION) -gt $(LINUX_VERSION_6_16); echo $$?),0)
obj-m := r8126.o
r8126-objs := r8126_dummy.o
else ifeq ($(shell test $(LINUX_VERSION) -eq $(LINUX_VERSION_5_14); echo $$?),0)
obj-m := r8126.o
r8126-objs := r8126_dummy.o
else
CONFIG_SOC_LAN = y CONFIG_SOC_LAN = y
ENABLE_FIBER_SUPPORT = n ENABLE_FIBER_SUPPORT = n
ENABLE_REALWOW_SUPPORT = n ENABLE_REALWOW_SUPPORT = n
@@ -136,3 +149,5 @@ endif
# Backward compatibility # Backward compatibility
ccflags-y += $(EXTRA_CFLAGS) ccflags-y += $(EXTRA_CFLAGS)
endif

View File

@@ -0,0 +1,16 @@
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#include <linux/module.h>
/* Dummy implementation for module */
static int __init r8126_dummy_dummy_init(void)
{
return 0;
}
device_initcall(r8126_dummy_dummy_init);
MODULE_AUTHOR("Revanth Kumar Uppala <ruppala@nvidia.com>");
MODULE_DESCRIPTION("Dummy R8126 dummy driver");
MODULE_LICENSE("GPL");