RPi3 TP-link T1U kernel module build: missing mach/memory.h

Hello everyone!

I’m trying to build the kernel module for the TP-link archer T1U adapter, but I’m getting the error message:
> ./arch/arm/include/asm/memory.h:22:25: fatal error: mach/memory.h: No such file or directory
> #include <mach/memory.h>

I’ve looked but could not find this header file anywhere, even though I have the kernel headers package installed.
System: 4.4.27-9-osmc OSMC 17.1
Did anyone come accross this issue? How should I go about building the module?

Thanks!

Install the full sources package.

Sam

Unfortunately, I still get the same error, even though I installed the sources.

osmc@zakopi:~/archer_t1u/Archer_T1U_V1_150909/Driver$ dpkg -l |grep $(uname -r)
ii rbp2-headers-4.4.27-9-osmc 9 armhf Header files related to Linux kernel, specifically,
ii rbp2-image-4.4.27-9-osmc 9 armhf Linux kernel binary image for version 4.4.27-9-osmc
ii rbp2-source-4.4.27-9-osmc 9 all Linux kernel source for version 4.4.27-9-osmc

I looked into the rbp2-source-4.4.27-9-osmc tar and found quite a few mach/memory.h :

./arch/arm/mach-sa1100/include/mach/memory.h
./arch/arm/mach-bcm2708/include/mach/memory.h
./arch/arm/mach-ebsa110/include/mach/memory.h
./arch/arm/mach-iop13xx/include/mach/memory.h
./arch/arm/mach-realview/include/mach/memory.h
./arch/arm/mach-omap1/include/mach/memory.h
./arch/arm/mach-ks8695/include/mach/memory.h
./arch/arm/mach-rpc/include/mach/memory.h
./arch/arm/mach-footbridge/include/mach/memory.h
./arch/arm/mach-bcm2709/include/mach/memory.h
./arch/unicore32/include/mach/memory.h

Is the mach-bcm2709 what I’m looking for?

2708 == pi0/1
2709 == pi2/3

thanks, I got one step further, I have a whole new problem to solve now. :slight_smile:

@sam_nazarko This might not have been the solution after all, because when building the module with the mach-bcm2709/include/mach/memory.h symlinked to the kernel headers dir, it works all fine but when trying to load the modules (there are 3 of them: mt7650u_sta.ko; -sta_util.ko and -sta_net.ko) I get a sort-of kernel panic with the message “RTUSB_VendorRequest failed” scrolling in endless loop accross the screen.

Can’t really provide advice for that as I don’t know the origins of the driver you’re trying to build, but having had similar issues with MT7610U a year ago prompted me to find the issue in firmware packing.

There’s a reason I don’t include this driver in OSMC: it doesn’t work.

I got the driver from the Asus official driver download site.
Although there it states that the linux driver is for kernel versions 2.6~3.16.
Is it possible that it simply doesn’t work anymore on kernel 4.4?
Will try to find other sources.
Thanks anyway for the help!

There would have been a lot of changes since 3.16, so it likely won’t work without some hacking