Original address: http://21500.net /? P = 616
Simple translation and improvement based on the error prompt.
Linux version
#Uname-
Linux Zy-laptop 2.6.28-11-generic # 42-ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux
1. After the USB Nic is inserted,
#Lsusb
....
Bus 005 device 003: Id 0fe6: 8101
....
2. Decompress dm9601.tgz
#Tar xzvf dm9601-2.6.tgz
#Ls dm9601-2.6
Dm9601.c dm9601.h makefile readme.txt
3. Try to compile
#CD dm9601-2.6
#Make
Make-C/lib/modules/2.6.28-11-generic/build M =/root/dm9601-2.6 lddincdir =/root/dm9601-2.6/../include modules
Make [1]: Entering directory '/usr/src/linux-headers-2.6.28-11-generic'
Scripts/makefile. Build: 46: *** cflags was changed in "/root/dm9601-2.6/makefile". Fix it to use extra_cflags. Stop.
Make [1]: *** [_ module _/root/dm9601-2.6] Error 2
Make [1]: Leaving directory '/usr/src/linux-headers-2.6.28-11-generic'
Make: *** [Default] Error 2
4. Modify dm9601.h
#Vim dm9601.h
Add the following two lines at the end
Dm9601_dev ("sunrising USB Ethernet", 0x0fe6, 0x8101,
Default_gpio_reset)
5. Edit makefile
#Vim makefile
Change cflags to extra_cflags.
6. Edit dm9601.c.
#Vim dm9601.c
Change # include <Linux/config. h> to # include <Linux/Autoconf. h>.
7. Start Compilation
#Make
At this time, there are several warnings, regardless of which, the dm9601.ko will be generated.
#Ls
Dm9601.c dm9601.h dm9601.ko dm9601.mod. c dm9601.mod. O dm9601.o makefile module. Markers modules. Order module. symvers readme.txt
8. overwrite the newly generated dm9601.ko to the current kernel dm9601.ko.
#CP dm9601.ko/lib/modules/2.6.28-11-generic/kernel/Drivers/NET/USB/dm9601.ko
I do not know why the dm9601.ko is not started.
If the machine is not started after it is restarted (#Lsmod | grep dm9601), Manually load dm9601.ko
#Insmod/lib/modules/2.6.28-11-generic/kernel/Drivers/NET/USB/dm9601.ko
9. Configure the USB Nic
#Vim/etc/Network/interfaces
Auto eth1
Iface eth1 Inet static
Address 192.168.1.2
Netmask 255.255.255.0
Gateway 192.168.1.1
10. Configure the MAC address for the USB Nic
#Ifconfig eth1 HW ether 01: 23: 45: 67: 89: AB
11. Activate the USB Nic
#Ifconfig eth1 up