MiSTer-devel / Linux-Kernel_MiSTer

Other
13 stars 19 forks source link

Building the rtl8188eu driver against current kernel #4

Closed vanfanel closed 3 years ago

vanfanel commented 3 years ago

Hi there,

First things first, thanks a lot for the continuing work on the MiSTer platform, and the recent developments that brought us the 5.13 kernel!

I have been able to build the rtl8188eu WiFi driver against the old kernel for a long time, but I am unable to do so with the new kernel.

I am configuring the kernel sources like this: make ARCH=arm mrproper && make ARCH=arm MiSTer_defconfig && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- EXTRAVERSION=-MiSTer modules_prepare And then I try to build the driver from these repos: https://github.com/ulli-kroll/rtl8188eu https://github.com/lwfinger/rtl8188eu https://github.com/quickreflex/rtl8188eus

Like this: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean && make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- KSRC=/home/manuel/src/mister/Linux-Kernel_MiSTer modules

But I always end up getting this:


/home/manuel/src/mister/rtl8188eus/os_dep/linux/os_intfs.c:1240:22: error: initialization of ‘u16 (*)(struct net_device *, struct sk_buff *, struct net_device *)’ {aka ‘short unsigned int (*)(struct net_device *, struct sk_buff *, struct net_device *)’} from incompatible pointer type ‘u16 (*)(struct net_device *, struct sk_buff *, struct net_device *, u16 (*)(struct net_device *, struct sk_buff *, struct net_device *))’ {aka ‘short unsigned int (*)(struct net_device *, struct sk_buff *, struct net_device *, short unsigned int (*)(struct net_device *, struct sk_buff *, struct net_device *))’} [-Werror=incompatible-pointer-types]
 1240 |  .ndo_select_queue = rtw_select_queue,
      |                      ^~~~~~~~~~~~~~~~
/home/manuel/src/mister/rtl8188eus/os_dep/linux/os_intfs.c:1240:22: note: (near initialization for ‘rtw_netdev_ops.ndo_select_queue’)

So, maybe I am doing something wrong?

Thanks!

sorgelig commented 3 years ago

i will see if i can compile it as a kernel module. Then it will be included in upcoming release if i will succeed.

vanfanel commented 3 years ago

@sorgelig That would be great! It seems to live on 5.10 kernel as an staging driver.

icelaglace commented 3 years ago

Hi, I did manage to compile a driver for the 5.13 kernel, the issue you're having is due to how the drivers aren't made for the latest kernel, you got to add some more conditions in many parts. You can diff the commit I've posted here.

https://github.com/icelaglace/MiSTer_WiFi_EW-7811UNv2 EDIT2 : Removed the previous issue mentioned on this comment as it was due to the driver being compiled with debug info + power saving.

The 7811UN V2 is 8188eu.

@sorgelig it would be indeed amazing if we can support this chip out of the box as most people actually get the 7811UN expecting the V1 but get the V2. (it's a recommended USB dongle in the wiki)

Thank you!

sorgelig commented 3 years ago

I disagree with popularity of outdated 11n dongles. Guys, don't be cheap! There is support of very new 11ac, even BT+WiFi dongles from Realtek. It's $15-$20. It worths to upgrade.

icelaglace commented 3 years ago

I agree with you that upgrading is definitely something I'd like to do too now that it's possible with much more models available ! Transferring via faster WiFi speed + freeing a USB port sounds great.

But for now, due to some of us not being able to upgrade our current MiSTer set-up for various reasons (could be lockdown related or money or time, etc, I don't really know other people reasons), that's all I can do, continue to use the 7811UN dongle lol.

If it's a hassle to have these supported in the MiSTer Linux kernel, then it's totally fine to me and understandable. It works great right now with the simple extra module. You simply can't just support every single WiFi dongle in the world when we can just add our own after all. Thank you ! :)

sorgelig commented 3 years ago

new release includes this driver

sorgelig commented 3 years ago

after some checks, it's confusing.. device B811 is supposed to be 8188C, nor 8188E

sorgelig commented 3 years ago

i've got 7811UN v2 dongle. Tested. Works in release 20210831.

vanfanel commented 3 years ago

@sorgelig I will test as soon as I get home, too! Thanks for this, Sorgelig! Well, thanks in general... MiSTer is just a dream come true.

icelaglace commented 3 years ago

Works great on my end, no more extra drivers needed. Thank you so much :)