在 Linux 使用 PCMCIA 網卡 - 補充、備忘 -- Jamyy‘s Weblog

来源:百度文库 编辑:神马文学网 时间:2024/07/03 08:33:47
在 Linux 使用 PCMCIA 網卡 - 補充、備忘
最近家裡的 Linux NAT 一直出問題, 原本以為是 16-bit PC Card 的設定問題, 繞了一大圈之後, 總算對 PCMCIA 網卡有了更進一步的認識.
環境:
Fedora Core 1 eth0: 16-bit PC Card, driver: axnet_cs eth1: 32-bit CardBus, driver: 8139too
相關備忘:
Linux NAT 使用 16-bit PC Card 時, 一段時間後 (使用 P2P 軟體時特別明顯) 會發生 eth0: bogus packet size: 1799, status=0x0 nxpg=0x0. 和 kernel: eth0: Too much work at interrupt, status 0x01 的錯誤訊息, 最後該網卡將無法運作, 但問題發生時另一張 CardBus 網卡不受影響. 此時可用指令 ifdown eth0 ; sleep 3 ; ifup eth0 恢復問題網卡的運作, 當然, 這方法只能治標, 最好還是換好一點的網卡 (或 driver). 此外, 減少 iptables rules 或寫一個 Shell Script 監控問題網卡也是可行的方案.
寫一個 Shell Script 定時 ping 一個有效的 IP, 如果 ping 不到, 表示上述問題又發生了, 自動重新啟動問題網卡:
#!/bin/bash
if [ -z "`ping -c 1 192.168.1.254 | grep ‘1 received‘`" ]; then
ifdown eth0
sleep 3
ifup eth0
echo `date +%D\ %R` >> /var/log/eth0_restart.log
fi
關於 PC Card 介面, CardBus 規格為 32-bit, PC Card 為 16-bit. 在 cardctl config 指令中可看出, 32-bit CardBus interface type 是 "cardbus"; 16-bit PC Card interface type 是 "memory and I/O", 可由 /etc/modules.conf (kernel 2.4) 或 /etc/modprobe.conf (kernel 2.6) 手動指定 IRQ 和 I/O 位址. 如:
alias eth0 axnet_cs
options axnet_cs irq=5 io=0x300
16-bit PC Card 視同 ISA 介面, 在 Linux x86 環境使用時, Kernel 需設定 CONFIG_ISA=y (enable ISA bus support).
首次安裝以及使用 yum update 的 kernel 設定值, 存在於 /boot/config-`uname -r` 檔案中. 其檔案內容如同 kernel source 在 make menuconfig 後所產生的 .config 檔案
由 cfgmaker 所產生的 mrtg.cfg, 若某網卡設定區段出現 "speed of 0" 訊息, 於 cfgmaker 時加上參數: --zero-speed=100000000 (意為 100Mbits) 即可解決. 如果 cfgmaker 沒有 --zero-speed 這個參數, 昇級mrtg 套件即可 (已知 v2.10 的 cfgmaker 未支援本參數)
由 cfgmaker 所產生的 mrtg.cfg, 若某網卡設定區段出現 "operationally DOWN" 訊息, 把這個訊息底下 # 註解的部份解除後 (Target, SetEnv... 這些敘述前面不能有空格), 通常還是能讓 indexmaker、mrtg 讀取運用
/var/log/messages 錯誤訊息備忘:
kernel: eth0: next frame inconsistency, 0x8e
kernel: eth0: next frame inconsistency, 0xd6
kernel: eth0: next frame inconsistency, 0x??
last message repeated 8 times
kernel: eth0: Too much work at interrupt, status 0x01
參考資料:
http://phorum.study-area.org/viewtopic.php?p=111839http://www.pcmcia.org/faq.htmhttp://pcmcia-cs.sourceforge.net/ftp/PCMCIA-HOWTOhttp://www.tldp.org/HOWTO/Ethernet-HOWTO-2.html#ss2.9 (英文)http://www.usinglinux.org/doc/translations/zh/Ethernet-HOWTO.txt (中文)
Jamyy‘s Weblog 相關網頁
在 Linux 使用 PCMCIA 網卡cbq.init 設定手札解決 Linux NAT ip_conntrack: table full 的方法Building Linux NAT with MRTG network monitoring
Posted by Jamyy at 2005年09月13日 21:43
from: http://cha.homeip.net/blog/archives/2005/09/_linux_pcmcia_1.html#more