If I manage to get it working I’d be glad to submit it for inclusion in OSMC. But bear in mind that I have little to no experience tweaking Linux drivers (save for some FPGA lab I fumbled my way through in university). The driver might not be stable if it ever compiles.
Right now I’m hitting the same roadblock no matter which driver modification I try to build. I’ve tried modifying the manufacturer’s original driver, two old versions tweaked by others and posted on GitHub, and one recent version somebody posted on GitHub that allegedly works on a newer kernel than the one the most recent version of OSMC is built on.
Here’s a link to the newest GitHub driver modification I’ll rate “most promising” –
https://github.com/sbarthelmess/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959
That one comes with a pre-compiled driver for kernel version 4.19.58, which I tried installing to no avail. OSMC is currently on 4.19.55.
The issue I’m running into while compiling the driver may be related to the headers. Right now I’m using “rbp2-headers-4.19.55-6-osmc”. I can’t find any for the Pi 3.
apt-cache search rbp3
Yields no results.
For what it’s worth, here’s the output when I try to compile showing all of the errors. It’s the same result no matter which modified driver source I use.
root@KodiLivingRoom:/usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master# make
make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.19.55-6-osmc/build M=/usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master modules
make[1]: Entering directory '/usr/src/rbp2-headers-4.19.55-6-osmc'
CC [M] /usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master/core/rtw_cmd.o
In file included from ./include/linux/srcu.h:33:0,
from ./include/linux/notifier.h:16,
from ./include/linux/memory_hotplug.h:7,
from ./include/linux/mmzone.h:748,
from ./include/linux/gfp.h:6,
from ./include/linux/umh.h:4,
from ./include/linux/kmod.h:22,
from ./include/linux/module.h:13,
from /usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master/include/basic_types.h:76,
from /usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master/include/drv_types.h:26,
from /usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master/core/rtw_cmd.c:17:
./include/linux/netfilter.h: In function ‘nf_hook’:
./include/linux/netfilter.h:211:34: error: dereferencing pointer to incomplete type ‘struct net’
hook_head = rcu_dereference(net->nf.hooks_ipv4[hook]);
^
./include/linux/rcupdate.h:347:10: note: in definition of macro ‘__rcu_dereference_check’
typeof(*p) *________p1 = (typeof(*p) *__force)READ_ONCE(p); \
^
./include/linux/rcupdate.h:542:28: note: in expansion of macro ‘rcu_dereference_check’
#define rcu_dereference(p) rcu_dereference_check(p, 0)
^~~~~~~~~~~~~~~~~~~~~
./include/linux/netfilter.h:211:15: note: in expansion of macro ‘rcu_dereferenc’
hook_head = rcu_dereference(net->nf.hooks_ipv4[hook]);
^~~~~~~~~~~~~~~
In file included from ./arch/arm/include/asm/bug.h:60:0,
from ./include/linux/bug.h:5,
from ./include/linux/thread_info.h:12,
from ./include/asm-generic/preempt.h:5,
from ./arch/arm/include/generated/asm/preempt.h:1,
from ./include/linux/preempt.h:81,
from ./include/linux/spinlock.h:51,
from ./include/linux/seqlock.h:36,
from ./include/linux/time.h:6,
from ./include/linux/stat.h:19,
from ./include/linux/module.h:10,
from /usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master/include/basic_types.h:76,
from /usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master/include/drv_types.h:26,
from /usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master/core/rtw_cmd.c:17:
./include/linux/build_bug.h:29:45: error: bit-field ‘<anonymous>’ width not an integer constant
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:(-!!(e)); }))
^
./include/asm-generic/bug.h:148:27: note: in definition of macro ‘WARN_ON_ONCE’
int __ret_warn_once = !!(condition); \
^~~~~~~~~
./include/linux/compiler-gcc.h:71:28: note: in expansion of macro ‘BUILD_BUG_ON_ZERO’
#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
^~~~~~~~~~~~~~~~~
./include/linux/kernel.h:72:59: note: in expansion of macro ‘__must_be_array’
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
^~~~~~~~~~~~~~~
./include/linux/netfilter.h:218:28: note: in expansion of macro ‘ARRAY_SIZE’
if (WARN_ON_ONCE(hook >= ARRAY_SIZE(net->nf.hooks_arp)))
^~~~~~~~~~
scripts/Makefile.build:303: recipe for target '/usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master/core/rtw_cmd.o' failed
make[2]: *** [/usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master/core/rtw_cmd.o] Error 1
Makefile:1517: recipe for target '_module_/usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master' failed
make[1]: *** [_module_/usr/src/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959-master] Error 2
make[1]: Leaving directory '/usr/src/rbp2-headers-4.19.55-6-osmc'
Makefile:2011: recipe for target 'modules' failed
make: *** [modules] Error 2
Disclaimer: I probably said something wrong in this post. This is all outside my area of expertise.