I bought a usb wifi dongle for my Raspberry Pi B+ and I can't install it on my RPi with 3.18.3+ kernel (OS: raspbian).
Here are the steps that I follow with no success:
lsusb
give me this output:
Bus 001 Device 004: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter
I downloaded the lastest kernel release on github and extracted it: https://github.com/raspberrypi/linux/rpi-3.18.y.tar.gz
made these instructions into rpi-linux-3.18 folder with no errors
make mrproper
zcat /proc/config.gz > .config
cp .config .config.org
sed -i 's/^CONFIG_CROSS_COMPILE.*/CONFIG_CROSS_COMPILE=""/' .config
make modules_prepare
wget https://raw.github.com/raspberrypi/firmware/master/extra/Module.symvers
then I got the MTU7601U driver from MediaTek (file: DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2 )
extracted it then proceed to make && make install
.
In my first attempts I couldn't run correctly make
because of an error with a struct in the rt_linux.h
.
error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’
error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’
so I made a patch in this file by replacing int
by kuid_t
and kgid_t
respectively (maybe the driver doesn't work cause of it ?)
Then I make && make install
once again and (with lot of warnings) the driver compiled.
I installed by run:
sudo insmod /lib/modules/3.18.3/kernel/drivers/net//wireless/mt7601Usta.ko
And reboot my rpi.. But when i plug my usb wifi dongle I get this error:
[ 642.853612] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 642.965765] usb 1-1.4: New USB device found, idVendor=148f, idProduct=7601
[ 642.965809] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 642.965830] usb 1-1.4: Product: 802.11 n WLAN
[ 642.965849] usb 1-1.4: Manufacturer: MediaTek
[ 642.965866] usb 1-1.4: SerialNumber: 1.0
[ 643.149300] Unable to handle kernel paging request at virtual address 7e319b54
[ 643.164074] pgd = d0660000
[ 643.166813] [7e319b54] *pgd=00000000
[ 643.170516] Internal error: Oops: 5 [#1] PREEMPT ARM
[ 643.175482] Modules linked in: mt7601Usta(O+) snd_soc_pcm512x_i2c snd_soc_tas5713 snd_soc_pcm512x regmap_i2c i2c_dev i2c_bcm2708 snd_bcm2835 snd_soc_bcm2708_i2s regmap_mmio snd_soc_core snd_compress snd_pcm_dmaengine snd_pcm snd_seq snd_seq_device snd_timer snd
[ 643.198715] CPU: 0 PID: 2517 Comm: modprobe Tainted: G O 3.18.3+ #738
[ 643.206190] task: ca412880 ti: d70a8000 task.ti: d70a8000
[ 643.211610] PC is at load_module+0x1948/0x1f1c
[ 643.216056] LR is at load_module+0x1934/0x1f1c
[ 643.220502] pc : [<c008927c>] lr : [<c0089268>] psr: 30000013
[ 643.220502] sp : d70a9e88 ip : bf1a85d8 fp : d70a9f44
[ 643.231964] r10: bf1a8470 r9 : 00000000 r8 : bf1a847c
[ 643.237182] r7 : c0561368 r6 : d065a2e0 r5 : 7e319b40 r4 : d70a9f48
[ 643.243699] r3 : 00000000 r2 : 00000000 r1 : d064c5a0 r0 : c0824000
[ 643.250219] Flags: nzCV IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 643.257345] Control: 00c5387d Table: 10660008 DAC: 00000015
[ 643.263086] Process modprobe (pid: 2517, stack limit = 0xd70a81b0)
[ 643.269258] Stack: (0xd70a9e88 to 0xd70aa000)
[ 643.273619] 9e80: bf1a847c 00007fff c00862c0 c0300708 00000013 00000000
[ 643.281794] 9ea0: da0aa000 d70a9f7c d70a9f50 d70a9eb8 00000000 bf1a847c d70a8008 bf1a84b8
[ 643.289969] 9ec0: bf1a85d8 00000000 b6d30000 d70a8000 00002db0 00000000 00000000 bf1715bc
[ 643.298141] 9ee0: 00000002 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 643.306314] 9f00: 00000000 00000000 00000000 00000000 00000000 00000000 00000080 000f6b01
[ 643.314488] 9f20: b6c49000 b6f64948 00000080 c000eb44 d70a8000 00000000 d70a9fa4 d70a9f48
[ 643.322664] 9f40: c008993c c0087940 da0aa000 000f6b01 da15ff1c da15fd1a da198394 000b3634
[ 643.330837] 9f60: 000c36c4 00000000 00000000 00000000 00000030 00000031 00000026 0000002a
[ 643.339011] 9f80: 00000016 00000000 00000000 00000000 00060000 b7422678 00000000 d70a9fa8
[ 643.347185] 9fa0: c000e8c0 c008985c 00000000 00060000 b6c49000 000f6b01 b6f64948 b6c49000
[ 643.355359] 9fc0: 00000000 00060000 b7422678 00000080 b7421cf8 000f6b01 b6f64948 00000000
[ 643.363534] 9fe0: 00000000 bebc890c b6f5bfb4 b6ec6ac4 60000010 b6c49000 00040014 68c08002
[ 643.371730] [<c008927c>] (load_module) from [<c008993c>] (SyS_init_module+0xec/0x100)
[ 643.379577] [<c008993c>] (SyS_init_module) from [<c000e8c0>] (ret_fast_syscall+0x0/0x48)
[ 643.387671] Code: e51bc084 e15c0005 e2455008 0a000009 (e5953014)
[ 643.677498] ---[ end trace 83e75e278f1e0439 ]---
I tried to recompile again and again but this issue came.
Does anyone know how to compile this driver for my version or know what have I done wrong?
insmod os/linux/mt7601Usta.ko
I get[ 2443.969818] Internal error: Oops: 5 [#1] PREEMPT ARM