2.5G USB->Ethernet, kmod-usb-net-rtl8152?

Ok interesting, yeah its not really a new kernel, im hoping for a stable with newer kernel soon.

Downloading the r8152.c and compability.c from realtek website and copying it to /drivers/net/usb i think i can manage, but i dont really know what u mean with "from there a got a diff patch"?
Edit: I actually dont know where and when u copied it to /drivers/usb, i thought there were a folder called that after u cloned from git.

I really wanna test this, got any tips for a newbie?
Like i said i have managed to clone from git and know how to make menuconfig and kernel_menuconfig etc, and understand what im doing when i make, but i cant really wrap my head around the entire process, if u could explain more?

Appreciate alot that u did tests and help

Try first installing the kmod-usb-net-rtl8152, if works, then you can build your own firmware.

opkg update
opkg install wget ca-bundle
opkg remove kmod-usb-net-rtl8152
cd /tmp
wget https://github.com/mj22226/openwrt/raw/v19-07-3/64/packages/kmod-usb-net-rtl8152_4.14.180-1_x86_64.ipk
opkg install kmod-usb-net-rtl8152_4.14.180-1_x86_64.ipk
reboot

Yeah thats the reason i made this thread, it doesnt work :frowning: so probably that kmod is old drivers or whatever that doesnt support this 2.5gbit adapter

Openwrt and also mainline Linux use old rtl8152 drivers.

Yeah, so im trying to learn how to compile new drivers before "make" from source
https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software

u know a good guide or can help?

Have a look at this PR that was rejected.

The kmod I posted has the latest realtek driver, can you confirm you installed properly, running this command : dmesg | grep r8152

root@OpenWrt:~# dmesg | grep r8152
[    8.493947] usbcore: registered new interface driver r8152
[    8.752421] r8152 2-1:1.0 eth2: v2.13.0 (2020/04/20)
[    8.759229] r8152 2-1:1.0 eth2: This product is covered by one or more of the following patents:
[   12.469804] r8152 2-1:1.0 eth2: carrier on

Yes, that's the proper way forward.

Only problem is that the diff is huge mostly because the out-of-tree version includes binary fimrware blobs inline in the code. This is not acceptable upstream. It is considered a GPL violation, since all those magic numbers obviously are produced by some compiler and therefore cannot be considered "the preferred form of the work for making modifications".

The blobs in the driver must be replaced by calls to the kernel firmware API, loading the proprietary firmware binaries from /lib/firmware instead. This is what've been done with the existing upstream supported RTL8152/8153 chips.

Will check out after work thank you

[ 873.065303] usbcore: registered new interface driver r8152
[ 873.357132] r8152 2-1:1.0 eth5: v2.13.0 (2020/04/20)
[ 873.362324] r8152 2-1:1.0 eth5: This product is covered by one or more of the following patents:

Listen.. my friend.
Thank you so incredibly much!!!!
I dont know if u like wine or beer but ill send u virtual ones :smiley: amazing my dude

1 Like

Good to know is working, interesting now is know how it performs, have you done some iperf, file transfer speeds tests between the two 2.5 GbE USB adapters?

Yeah, i was/am so happy that it actually works, i have only made quick tests, will do more later on, weekend coming up so.
But the initial tests show basically full 2.5gbit speeds, i did not try download+upload at the same time but 2.5gbit in one direction in initial quick iperf test

Hello mr mj82 aka the savior :smiley:

With openwrt 19.07.4 being released, im assuming this ipk wont work anymore? If im wrong there is no problem, but if im right, i was wondering, can you teach me your workflow to create this ipk as u did please?

Follow these steps to create the .ipk with the same kernel version (19.07.4)

git clone https://github.com/openwrt/openwrt.git
cd openwrt
git checkout v19.07.4
wget https://github.com/mj22226/openwrt/commit/79a572b0d7685d6f44f9a872a2b1aa470ec83225.patch
patch -p 1 -i 79a572b0d7685d6f44f9a872a2b1aa470ec83225.patch
./scripts/feed update -a
./scrripts/feeds install -a
wget -O .config https://downloads.openwrt.org/releases/19.07.4/targets/x86/64/config.buildinfo
make defconfig
make menuconfig

select the packages to build, save and exit.

make download
make -j `getconf _NPROCESSORS_ONLN` 'IGNORE_ERRORS=n m'
1 Like

Thx alot
One question, how do i decide if i select the packages i want as a "(M)odule" or "* kernel(?)"

EDIT: Also, should i find your .ipk in menuconfig after doing these steps?

i selected kmod-usb-net-rtl8152, will that conflict with the new correct .ipk or is the one i selected the correct one?

This process will patch the source code, replacing the open driver with the proprietary one. After building, find the .ipk under bin.

cheers.
so that would be openwrt/bin/targets/x86/64/packages/kmod-usb-net-rtl8152_4.14.195-1_x86_64.ipk in this case?
thats the "new" ipk that has been made because of the patch commands basically?
I want to learn, interesting :slight_smile:

Yes I think it would be there.

thx alot :slight_smile: