From a6526607f35c98e19fb4a192cc1fab811888ecc7 Mon Sep 17 00:00:00 2001 From: phaenomenon Date: Sat, 5 Oct 2024 19:38:10 +0200 Subject: [PATCH] Adding latest Ubuntu and DELL AW1022 2.5G USB support --- autorun.sh | 4 ++-- src/Makefile | 12 +++++++----- src/r8152.c | 4 ++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/autorun.sh b/autorun.sh index 05090ed..aee3e65 100755 --- a/autorun.sh +++ b/autorun.sh @@ -11,8 +11,8 @@ fi echo check=`lsmod | grep r8152` if [ "$check" != "" ]; then - echo "rmmod r8152" - /sbin/rmmod r8152 + echo "modprobe -r r8152" + /usr/sbin/modprobe -r r8152 fi echo "Build the module and install" diff --git a/src/Makefile b/src/Makefile index e6db94e..da8175e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -24,8 +24,9 @@ else PWD :=$(shell pwd) TARGET_PATH := kernel/drivers/net/usb INBOXDRIVER := $(shell find $(subst build,$(TARGET_PATH),$(KERNELDIR)) -name r8152.ko.* -type f) - RULEFILE = 50-usb-realtek-net.rules - RULEDIR = /etc/udev/rules.d/ + MODFILE := /lib/modules/$(shell uname -r)/kernel/drivers/net/usb/r8152.ko + SRC_RULEFILE = ../udev/rules.d/50-usb-realtek-net.rules + TARGET_RULEDIR = /etc/udev/rules.d/ .PHONY: modules modules: @@ -41,20 +42,21 @@ clean: .PHONY: install install: ifneq ($(shell lsmod | grep r8153_ecm),) - rmmod r8153_ecm + modprobe -r r8153_ecm endif ifneq ($(shell lsmod | grep r8152),) - rmmod r8152 + modprobe -r r8152 endif ifneq ($(INBOXDRIVER),) rm -f $(INBOXDRIVER) endif $(MAKE) -C $(KERNELDIR) M=$(PWD) INSTALL_MOD_DIR=$(TARGET_PATH) modules_install + zstd -19 -f $(MODFILE) modprobe r8152 .PHONY: install_rules install_rules: - install --group=root --owner=root --mode=0644 $(RULEFILE) $(RULEDIR) + install --group=root --owner=root --mode=0644 $(SRC_RULEFILE) -t $(TARGET_RULEDIR) endif diff --git a/src/r8152.c b/src/r8152.c index f4034f4..58a5e33 100644 --- a/src/r8152.c +++ b/src/r8152.c @@ -835,6 +835,7 @@ enum rtl8152_flags { #define VENDOR_ID_LINKSYS 0x13b1 #define VENDOR_ID_NVIDIA 0x0955 #define VENDOR_ID_TPLINK 0x2357 +#define VENDOR_ID_DELL 0x413c #define MCU_TYPE_PLA 0x0100 #define MCU_TYPE_USB 0x0000 @@ -25689,6 +25690,9 @@ static const struct usb_device_id rtl8152_table[] = { /* ASUSTek */ REALTEK_USB_DEVICE(0x0b05, 0x1976), + /* DELL */ + REALTEK_USB_DEVICE(VENDOR_ID_DELL, 0xb097), + {} };