Kernel

如何知道實時網路設備的Linux驅動程序是否內置在核心中?

  • June 7, 2012

從這裡:http ://www.xenomai.org/index.php/RTnet:Installation_%26_Testing#Debugging_RTnet

實時網路設備的 Linux 驅動程序內置在核心中並阻塞硬體。

當我執行rmmod 8139too它說該模組不存在於/proc/modules.

核心是2.6.38.8 (64 bit).

我應該為這個問題提供哪些其他資訊?


linux-y3pi:~ # uname -a
Linux linux-y3pi 2.6.38.8-12-desktop #2 SMP PREEMPT Fri Jun 1 17:27:16 IST 2012 x86_64 x86_64 x86_64 GNU/Linux

linux-y3pi:~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:24:8C:D9:D6:2E  
         inet addr:192.168.16.86  Bcast:192.168.16.255  Mask:255.255.255.0
         inet6 addr: fe80::224:8cff:fed9:d62e/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:414 errors:0 dropped:0 overruns:0 frame:0
         TX packets:261 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000 
         RX bytes:118971 (116.1 Kb)  TX bytes:35156 (34.3 Kb)
         Interrupt:17 Base address:0x4000 

lo        Link encap:Local Loopback  
         inet addr:127.0.0.1  Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING  MTU:16436  Metric:1
         RX packets:68 errors:0 dropped:0 overruns:0 frame:0
         TX packets:68 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0 
         RX bytes:4720 (4.6 Kb)  TX bytes:4720 (4.6 Kb)

linux-y3pi:~ # ethtool -i eth0
driver: r8169
version: 2.3LK-NAPI
firmware-version: 
bus-info: 0000:01:00.0

linux-y3pi:~ # rmmod r8169

linux-y3pi:~ # ethtool eth0
Settings for eth0:
Cannot get device settings: No such device
Cannot get wake-on-lan settings: No such device
Cannot get message level: No such device
Cannot get link status: No such device
No data available

linux-y3pi:~ #  lsmod|grep 8169

linux-y3pi:~ #  lsmod|grep 8139

linux-y3pi:~ #                                              

.config 來自 /usr/src/linux-2.6.38.8

CONFIG_R8169=m
CONFIG_R8169_VLAN=y


CONFIG_8139CP=m
CONFIG_8139TOO=m
#CONFIG_8139TOO_PIO is not set                                                                                                                                                   
#CONFIG_8139TOO_TUNE_TWISTER is not set                                                                                                                                          
CONFIG_8139TOO_8129=y
#CONFIG_8139_OLD_RX_RESET is not set 

rmmod 8139too不起作用,因為:

  • 8139支持內置在核心中,驅動無法解除安裝,因為它不是模組。在許多系統上,都有一個/boot/config-2.6.38.8文件(或類似文件)。你可以grep用'8139TOO’之類的東西。如果您看到類似的內容CONFIG_8139TOO=m,則8139too驅動程序被編譯為模組。如果是CONFIG_8139TOO=y,則驅動程序內置在核心中。如果它說的是類似的東西# CONFIG_8139TOO is not set,那麼驅動程序根本沒有被編譯
  • 您的乙太網卡不使用 RTL8139 晶片,因此未載入其驅動程序。您必須找到您想要的乙太網埠的驅動程序並解除安裝驅動程序。如果你有lshw,說sudo lshw | less並尋找eth0:驅動模組將被列出。如果你有systool,試著sudo systool -c net -A uevent eth0尋找DRIVER=零件。右側應顯示為處理設備而載入的驅動程序。dmesg | grep eth0也可以工作,但它不是 100% 可靠的,特別是如果您的系統已經開啟了一段時間(如果有/var/log/dmesg,您可能也想要grep eth0 /var/log/dmesg)。

引用自:https://unix.stackexchange.com/questions/40134