Re: 网卡驱动

11 views
Skip to first unread message

Jianjun Kong

unread,
Mar 26, 2009, 9:32:44 PM3/26/09
to 中文内核开发社区, 陈莉君老师, 王亚刚老师, Xiyou-Linux-Group
On Fri, Mar 27, 2009 at 07:53:17AM +0800, Jianjun Kong wrote:
>
>大家好,最近在学习linux网卡驱动编写,在我的系统(ubuntu8.10)上
>
>$ lsmod
>....
>forcedeth 61328 0
>网卡模块使用数为0
>forcedeth: Ethernet driver for NVIDIA nForce media access controllers.
>....
>
>$ dmesg
>....
>[ 12.373106] forcedeth: Reverse Engineered nForce ethernet driver.
>Version 0.61.
>[ 12.373607] ACPI: PCI Interrupt Link [APCH] enabled at IRQ 20
>[ 12.373616] forcedeth 0000:00:14.0: PCI INT A -> Link[APCH] -> GSI 20
>(level, low) -> IRQ 20
>[ 12.373622] forcedeth 0000:00:14.0: setting latency timer to 64
>[ 12.373648] nv_probe: set workaround bit for reversed mac addr
>[ 12.892584] forcedeth 0000:00:14.0: ifname eth0, PHY OUI 0x5043 @ 1,
>addr 00:15:58:65:3b:fc
>[ 12.892591] forcedeth 0000:00:14.0: highdma pwrctl timirq lnktim
>desc-v3
>....
>
>根据dmesg的结果看,我的网卡驱动模块应该是forcedeth,但为什么网卡正常工作的时候lsmod的使用数目为0呢?
>在drives/net/forcedeth.c文件中,也注释(forcedeth: Ethernet driver for NVIDIA nForce media access controllers.)
>
>在ubuntu下也找不到/etc/modules.conf这个文件。
>
>我如何才能找到网卡使用的驱动模块?

补充一下:
我的主板是:富士康6100M2MA (网络 10/100/1000 以太网, Marvell 88E1116)
http://www.foxconnchannel.com.cn/product/Motherboards/detail_spec.aspx?ID=zh-cn0000147

1。当把forcedeth模块删除,网络中断,重新加载forcedeth模块,则网络恢复正常。

# diff -u a.txt a2.txt (删除模块前后lsmod结果对比)
--- a.txt 2009-03-27 08:13:37.000000000 +0800
+++ a2.txt 2009-03-27 08:14:42.000000000 +0800
@@ -1,12 +1,12 @@
Module Size Used by
-xt_TCPMSS 12160 1
-xt_tcpmss 10112 1
-xt_tcpudp 11008 1
-iptable_mangle 10880 1
-pppoe 18496 2
+xt_TCPMSS 12160 0
+xt_tcpmss 10112 0
+xt_tcpudp 11008 0
+iptable_mangle 10880 0
+pppoe 18496 0
pppox 11276 1 pppoe
-af_packet 25856 2
-ppp_generic 32668 6 pppoe,pppox
+af_packet 25856 0
+ppp_generic 32668 2 pppoe,pppox
slhc 14208 1 ppp_generic
ipv6 264228 12
binfmt_misc 16904 1

---
2。我能否通过下面方法,升级网卡驱动。
# rmmod forcedeth
# make drivers/net/forcedeth.ko
# insmod drivers/net/forcedeth.ko (这里已经有错误)
insmod: error inserting 'drivers/net/forcedeth.ko': -1 Invalid module
format
# cp forcedeth.ko
# /lib/modules/2.6.27-13-generic/kernel/drivers/net/forcedeth.ko
# depmod -a
# modprobe forcedeth
FATAL: Error inserting forcedeth
(/lib/modules/2.6.27-13-generic/kernel/drivers/net/forcedeth.ko):
Invalid module format

这里的格式问题如何解决? 谢谢!


--
http://kongove.cn/

Jianjun Kong

unread,
Mar 26, 2009, 9:36:43 PM3/26/09
to Ming Lei, 中文内核开发社区, 陈莉君老师, 王亚刚老师, Xiyou-Linux-Group
On Fri, Mar 27, 2009 at 09:24:01AM +0800, Ming Lei wrote:

....

>> 根据dmesg的结果看,我的网卡驱动模块应该是forcedeth,但为什么网卡正常工作的时候lsmod的使用数目为0呢?
>
>这个很正常,没有其他module依赖于该模块, 其module reference count即为0.
>类似模块还有ehci-hcd/uhci-hcd/(usb), 你可以在使用这些设备的时候随时
>rmmod .

明白了,我把"Used"理解成模块的使用次数了。那这个应该就是我的网卡驱动。


--
想了很久还是得写点东西
http://kongove.cn/mylove.html

Reply all
Reply to author
Forward
0 new messages