公用笔记本的网卡接口坏,老师给配了个USB转RJ45的模块
其在winXP下已驱动好,但在Linux下尚无法工作。
于是想法为其添加驱动

由于该fodora是最小安装 工具太少,又无法上网。
所以先把模块插到我的本子上运行lsusb
得到这个
Bus 004 Device 003: ID 0fe6:9700 Kontron (Industrial Computer Source / ICS Advent)
于是知道其芯片ID 是 0fe6:9700

上google 上搜索 0fe6:9700 linux
得到下面信息

Davicom DM9601 based USB 1.1 10/100 ethernet devices found in drivers/net/usb/Kconfig

The configuration item CONFIG_USB_NET_DM9601:

    prompt: Davicom DM9601 based USB 1.1 10/100 ethernet devices
    type: tristate
    depends on: CONFIG_USB_USBNET
    defined in drivers/net/usb/Kconfig
    found in Linux kernels: 2.6.22–2.6.39, 3.0–3.2, 3.3-rc+HEAD
    modules built: dm9601, dm9601
……
于是得知该芯片需要 dm9601 这个模块的支持
make menuconfig 搜索 dm9601 找到如下信息

 Symbol: USB_NET_DM9601 [=n]   
  │ Type  : tristate          
  │ Prompt: Davicom DM9601 based USB 1.1 10/100 ethernet devices     
  │   Defined at drivers/net/usb/Kconfig:218                        
  │   Depends on: NETDEVICES [=y] && USB [=y] && NET [=y] && USB_USBNET [=n]
  │   Location:                                                            
  │     -> Device Drivers                                                 
  │       -> Network device support (NETDEVICES [=y])                    
  │         -> USB Network Adapters                                     
  │           -> Multi-purpose USB Networking Framework (USB_USBNET [=n])
  │   Selects: CRC32 [=y]    

ok 照著去勾选项
编译完内核发现 没有出来 ethX, 感觉不对.
按说该芯片需要的是 dm9601 dm9601 需要usbnet usbnet需要mii
这几个模块全部编译成模块并手动加载进去了,但还是没有发现新的网络设备。
尝试多次 均没效果。

在google上搜索了半天 有很多有说这个事 貌似它的芯片是qf9700 的
主要是看了这些网页之后确定的,决定用qf9700试一下
http://club.dealextreme.com/forums/Forums.dx/threadid.807273
http://ubuntuforums.org/showthread.php?p=11104624
http://blog.csdn.net/hanhan1988_0150/article/details/6897956
http://blogs.mail.ru/mail/theism/5239EFF6E96DDDEE.html

好在已经有国外友人提供了 qf9700 的源代码。网址是
http://mquin.livejournal.com/178482.html
看了看他使用的内核是2.6.28 和2.6.29,之后又提供了2.6.32 2.6.37等等

我的fedora 14上的内核版本是 2.6.33.20
去/lib 运行file libc-2.12.90.so  
得到的结果是
libc-2.12.90.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped
这说明我的 编译环境 只支持最低编译到2.6.32的内核,(这是被限制死了,因为之前使用该环境编译了个2.6.28的内核,启动后出现
FATAL: kernel too old
Kernel panic: Attempted to kill init!
这个错误,从而得之编译环境对内核版本有限制)

在考虑要不要先编译个2.6.32之前,决定试一下 提供的qf9700-2.6.32.tar.gz 解压
make 生成了qf9700.ko
网上已经说的很清楚该模块需要 usbnet 和 mii ,这些我之前已经编译好了。
于是 modprobe usbnet
(modprobe 会自动加载被关联的mii)
然后 insmod ./qf9700.ko
非常幸运该模块工件正常,系统提示识别到了新的网络设备
运行ifconfig 看到了eth1

------------------------------------------------------------------------------
开始收尾工件
由于原来的网卡已经坏了, 所以 直接把该usb网卡该为eth0
修改 /etc/udev/rules.d/70-persistent-net.rules
和 /etc/sysconfig/network-scripts/ifcfg-eth0
还需要把模块开机自启
由于我还不懂如何把自己编译的模块 去/lib/modules 下注册,好直接modprobe
所以我采用的是下面的方法
把qf9700.ko 复制到 /lib/modules/2.6.33.20/kernel/drivers/net/usb/
在/etc/rc.local 中添加
modprobe usbnet
insmod /lib/modules/2.6.33.20/kernel/drivers/net/usb/qf9700.ko
/etc/init.d/network start

reboot 一切正常