LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 908|回复: 0

强制网卡工作模式的问题!

[复制链接]
发表于 2003-3-24 17:42:17 | 显示全部楼层 |阅读模式
曾经 在 本站 发表过 这个 问题的,,等了 好长时候 都没有得到正确的答复,即使一些回复也都是些皮毛。。。。现在我唯一没有解决的问题就是 我在 编译内核的时候把网卡的驱动也打进去后 在 内核启动的时候怎么强制 网卡的工作模式,如 让网卡工作在 100M的 全双工或 半双工,10M的 全双工或 半双工,还有 自动(auto),系统默认的网卡工作模式是 自动(auto)。现在是 怎么让 内核在启动的时候 把 网卡 的参数 传递到 网卡的驱动程序里去强制网卡的工作模式。是用 lilo 吗?我用了的,这个不行。还是修改 /etc/modules.conf 文件。这个我测试了,如果 把网卡驱动编到内核里去的。不行,如果是用的 insmod 或 deprobe 方式 把网卡驱动模块 插到内核里去就可以。,。,如我的 d-link 530 就是这样的。(我强制的是 100M 半双工模式)

1、手工命令模式:
insmod rhinefet speed_duplex=1

2、系统自动装载
   在 /etc/modules.conf 里应该有如下语句
   alias eth0 rhinefet speed_duplex=1

还要 保证 内核找的到 网卡驱动模块,我的 /lib/modules/2.4.20/modules.dep 文件内容如下:
/lib/modules/2.4.20/kernel/drivers/net/rhinefet.o:

参数需要参考网卡驱动程序里的 帮助文件,下面的是节选的帮助文件里关于参数的一部分!

Module Parameter:
=================
The following parameters can be set when we install the driver module. You can add this parameters when
you execute 'insmod' or 'modprobe' command to install the driver (as below).
    insmod rhinefet.o parameter=value1,value2,value3,...
For example, if you have 3 NIC cards, and you want to set the speed_duplex paramter value of them .
You can type the following command to set it.
    insmod rhinefet.o speed_duplex=1,2,3
Then, the parameter value of first card will be 1 (100Mbps half duplex mode), the second card will
be 2 (100Mbps full duplex mode), and the third card will be 3 (10Mbps half duplex mode).
Remember, our driver only support 8 cards parameter setting.

1) speed_duplex
   speed_duplex[] is used for setting the speed and duplex mode of NIC.
   Value:
       0: indicate autonegotiation for both speed and duplex mode (Default).
       1: indicate 100Mbps half duplex mode
       2: indicate 100Mbps full duplex mode
       3: indicate 10Mbps half duplex mode
       4: indicate 10Mbps full duplex mode

2) enable_tagging (For management adapter only)
   enable_tagging[] is used for enabling VLAN ID setting and enabling
   priority transmit.
   Value:
       0: disable VID setting and priority transmit (Default).
       1: enable VID setting and priority transmit.

3) VID_setting (For management adapter only)
   VID_setting[] is used for setting the VLAN ID of NIC.
   Value:
       0: default VID.
       1-4094: other VIDs.

4) csum_offload (For management adapter only)
   csum_offload[] is used for setting the checksum offload ability of NIC.
   Value:
       0: disable csum_offload (Default).
       1: enable checksum offload. (We only support RX checksum offload now)

5) txcsum_offload (For management adapter only)
   csum_offload[] is used for setting the checksum offload ability of NIC.
   Value:
       0: disable (default)
       1: enable


6) flow_control
   flow_control[] is used for setting the flow control ability of NIC.
   Value:
       1: hardware deafult (Default). Use Hardware default value in ANAR.
       2: disable PAUSE in ANAR.
       3: enable PAUSE in ANAR.


7) IP_byte_align
   IP_byte_align[] is used for IP header DWORD byte aligned (For IPVS environment).
   (In some enviroment, the IP header should be DWORD byte aligned,or the packet
   will be droped when we receive it. (eg: IPVS))
   Value:
       0: indicate the IP header won't be DWORD byte aligned (Default).
       1: indicate the IP header will be DWORD byte aligned.


8) tx_thresh
   tx_thresh[] is used for controlling the transmit fifo threshold.
   Value:
       0: indicate the txfifo threshold is 128 bytes (Default).
       1: indicate the txfifo threshold is 256 bytes.
       2: indicate the txfifo threshold is 512 bytes.
       3: indicate the txfifo threshold is 1024 bytes.
       4: indicate that we use store and forward

9) rx_thresh
   rx_thresh[] is used for controlling the receive fifo threshold.
   Value:
       0: indicate the rxfifo threshold is 64 bytes (Default).
       1: indicate the rxfifo threshold is 32 bytes.
       2: indicate the rxfifo threshold is 128 bytes.
       3: indicate the rxfifo threshold is 256 bytes.
       4: indicate the rxfifo threshold is 512 bytes.
       5: indicate the rxfifo threshold is 768 bytes.
       6: indicate the rxfifo threshold is 1024 bytes.   
       7: indicate that we use store and forward
      
10) DMA_length
   DMA_length[] is used for controlling the DMA length.
   Value:
       0: 8 DWORDs
       1: 16 DWORDs (Deafult)
       2: 32 DWORDs
       3: 64 DWORDs
       4: 128 DWORDs
       5: 256 DWORDs
       6: SF(flush till emply)
       7: SF(flush till emply)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表