Discussion

how to compile a wifi driver?

11 8047
Post Last Edited by lanwairen123 at 2014-10-9 11:12

lsusb shows:
  1. #lsusb
  2. ID 0bda:8179 Realtek Semiconductor Corp.
Copy the Code



and dmesg shows:
  1. usbcore: registered new interface driver rtl8192cu
Copy the Code



but ifconfig -a can't see my wifi device , so I want to recompile the rtl8192cu driver , and add the device ID to os_dep/linux/usb_intf.c,


  1. git clone --depth 1 https://github.com/Bananian/linux-bananapi.git
Copy the Code




I use this source tree to compile like this
  1. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun7i_defconfig
Copy the Code


  1. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- uImage modules
Copy the Code


  1. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -C /root/linux-bananapi/ SUBDIRS=/root/linux-bananapi/drivers/net/wireless/rtl8192cu modules
Copy the Code




and I got a 8192cu.ko file, and I copy it to my banana pi ,rename it to rtl8192cu.ko ,run rmmod 8192cu to remove the old driver,and then run insmod ./rtl8192cu.ko but it shows
  1. Error: could not insert module rtl8192cu.ko: Invalid module format
Copy the Code




I think it is because the version of kernel is diff,but I clone it from the official site,I don't know why ,anyone can help me?
  1. file rtl8192cu.ko
  2. rtl8192cu.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), BuildID[sha1]=0x67b3f2a2417051d7a3fbd79d487b7c301b8b47e9, not stripped
Copy the Code

  1. file rtl8192cu/8192cu.ko
  2. rtl8192cu/8192cu.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), BuildID[sha1]=0x2f9a3358b448b53f144640e286a064302b63196e, not stripped
Copy the Code



I'm very sorry for my pool english.
igorpec  
https://github.com/dz0ny/rt8192cu

This is the best I could find but I think it's not working in 3.4 ... I was able to use it on 3.14 with only around 5-6% packet lost.

Reply 2# igorpec


   I see os_dep/linux/usb_intf.c file, it does't have ID 0bda:8179 in ,so It may not work on my device, but I want to know How you compile it?

igorpec  
$LINUXSOURCE is path to your kernel source

git clone https://github.com/dz0ny/rt8192cu
cd rt8193cu
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- KSRC=$LINUXSOURCE

cp *.ko somewhere
cp blacklist*.conf to modprobe.d directory

insmod thismodule.ko

Reply 4# igorpec


   I compile it just like you ,but it still shows
  1. Error: could not insert module rtl8192cu.ko: Invalid module format
Copy the Code

Reply 5# igorpec


   I compile it just like you ,but it still shows
  • Error: could not insert module rtl8192cu.ko: Invalid module format

I suggest you replace all the uImage and modules into the system. not just a .ko file

Reply 7# tony_zhang


   all right.I just want to install a wireless driver , but as you said I must compile all the source tree,such as kernel and modules,It may be a large project for me ,why can't like others just compile the driver and install it? any way ,I'll have a try.

As the rtl8192cu,ko depends on something in kernel, so we need replace all files.

igorpec  
Reply 8# lanwairen123


   I recompiled my image (1.3) with this driver included.

You can find it here:
  1. /usr/local/bin/8192cu.ko
Copy the Code

You have to log in before you can reply Login | Sign Up

Points Rules