Skip to content

Add support for .ko.zst kernel modules, Dell Alienware AW1022 NIC, and fix udev rules handling #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions autorun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 7 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

4 changes: 4 additions & 0 deletions src/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),

{}
};

Expand Down