Compiling linux drivers for RD9700 (qf9700.ko) under debian squeeze

I recently bought a USB  to LAN RJ45 Ethernet Network Adapter off ebay.

While it was working fine under Win7 (I had to install the drivers from the small CD), I could not get it to work under Debian Squeeze.

I had to compile the drivers.

On the CD, there were a few folders:

– DM9601

– RD9700

I chose RD9700, this is what worked on Win7.

DM9601 would have worked as well, just follow the same instructions…

Now, copy the contents of the RD9700/Linux to a folder.

What you will need to compile:

Open a shell and get the proper headers for your kernel version

Type: (or copy and paste)

apt-get update

apt-get install linux-headers-`uname -r`

if you type uname -r it is useful to get your kernel version

You probably have the next package installed, it is necessary to compile stuff on your linux box

apt-get build-essential 

You can install those with synaptic package manager.

Now go to the folder where you copied the files and type:

make

This is where I ran into problems…

make[1]: Entering directory `/usr/src/linux-headers-2.6.32-5-686′
  CC [M]  /usr/src/usblan/rd9700/qf9700.o
/usr/src/usblan/rd9700/qf9700.c: In function âqf9700_bindâ:
/usr/src/usblan/rd9700/qf9700.c:380: error: âstruct net_deviceâ has no member named âdo_ioctlâ
/usr/src/usblan/rd9700/qf9700.c:381: error: âstruct net_deviceâ has no member named âset_multicast_listâ
/usr/src/usblan/rd9700/qf9700.c: In function âqf9700_rx_fixupâ:
/usr/src/usblan/rd9700/qf9700.c:443: error: âstruct usbnetâ has no member named âstatsâ
/usr/src/usblan/rd9700/qf9700.c:444: error: âstruct usbnetâ has no member named âstatsâ
/usr/src/usblan/rd9700/qf9700.c:445: error: âstruct usbnetâ has no member named âstatsâ
/usr/src/usblan/rd9700/qf9700.c:446: error: âstruct usbnetâ has no member named âstatsâ
/usr/src/usblan/rd9700/qf9700.c:447: error: âstruct usbnetâ has no member named âstatsâ
make[4]: *** [/usr/src/usblan/rd9700/qf9700.o] Error 1
make[3]: *** [_module_/usr/src/usblan/rd9700] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-5-686′
make: *** [all] Error 2

No matter what I did, I could not get the driver to compile…

After a while, I found these:

http://mquin.livejournal.com/178482.html

http://forum.xda-developers.com/showthread.php?p=30273196

I downloaded QF9700-source.zip from

http://forum.xda-developers.com/attachment.php?s=ee8fb7a410c7e77f3315908fba0ba22b&attachmentid=1263309&d=1345071797 

and extracted the contents into the same folder.

I ran make clean and then make

No errors.

All you need to do now, is to copy the .ko file to /lib/modules/`uname -r`/kernel/drivers/net/usb

then run depmod to register the module,

modprobe usbnet and

insmod /lib/modules/`uname -r`/kernel/drivers/net/usb/qf9700.ko

and voilà the driver should be installed.

You can verify that you have a new network interface with

ifconfig

I got a new eth1 🙂

You then have to configure it the usual way:

nano -w /etc/network/interfaces

auto eth1
iface eth1 inet dhcp

For dhcp. You might have a different eth device, replace eth1 with the proper one such as eth0

Restart networks:

 /etc/init.d/networking restart

or service networking restart

or it is just as easy to reboot

I might have forgotten a few steps, i am writing this off the top of my head. Hope it helped someone!