Linuxに特定のデバイス(Realtek NIC)用の特定のドライバをロードさせる。

Linuxに特定のデバイス(Realtek NIC)用の特定のドライバをロードさせる。

これは、Linux 3.11(Mintディストリビューションですが重要ではないと思います)を実行している古いシステム(AMD K8、Nvidiaチップセット)で発生するドライバの問題です。

claudius ~ # uname -a
Linux claudius 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
claudius ~ # lspci
00:00.0 Host bridge: NVIDIA Corporation nForce3 250Gb Host Bridge (rev a1)
00:01.0 ISA bridge: NVIDIA Corporation nForce3 250Gb LPC Bridge (rev a2)
00:01.1 SMBus: NVIDIA Corporation nForce 250Gb PCI System Management (rev a1)
00:02.0 USB controller: NVIDIA Corporation CK8S USB Controller (rev a1)
00:02.1 USB controller: NVIDIA Corporation CK8S USB Controller (rev a1)
00:02.2 USB controller: NVIDIA Corporation nForce3 EHCI USB 2.0 Controller (rev a2)
00:05.0 Bridge: NVIDIA Corporation CK8S Ethernet Controller (rev a2)
00:08.0 IDE interface: NVIDIA Corporation CK8S Parallel ATA Controller (v2.5) (rev a2)
00:0a.0 IDE interface: NVIDIA Corporation nForce3 Serial ATA Controller (rev a2)
00:0b.0 PCI bridge: NVIDIA Corporation nForce3 250Gb AGP Host to PCI Bridge (rev a2)
00:0e.0 PCI bridge: NVIDIA Corporation nForce3 250Gb PCI-to-PCI Bridge (rev a2)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
01:00.0 VGA compatible controller: NVIDIA Corporation NV34 [GeForce FX 5200] (rev a1)
02:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8169 PCI Gigabit Ethernet Controller (rev 10)

リストの最後に表示されるRealtek 8169 PCIイーサネットカード用の代替ドライバをカーネルにロードしたいと思います02:05.0。詳細は次のとおりです。

claudius ~ # lspci -s 02:05.0 -vv -nn
02:05.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8169 PCI Gigabit Ethernet Controller [10ec:8169] (rev 10)
    Subsystem: Realtek Semiconductor Co., Ltd. RTL8169/8110 Family PCI Gigabit Ethernet NIC [10ec:8169]
    Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Interrupt: pin A routed to IRQ 19
    Region 0: I/O ports at e800 [size=256]
    Region 1: Memory at febffc00 (32-bit, non-prefetchable) [size=256]
    Expansion ROM at febc0000 [disabled] [size=128K]
    Capabilities: [dc] Power Management version 2
        Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-

問題は単にr8169動作しないということです。 Linuxがクラッシュする可能性があります。私はそれをブラックリストに載せました/etc/modprobe.d/

解決策は次のとおりです。r8168代わりにドライバを使用してください。 (まだ残っています。このウェブサイトに関する質問.) Realtekからソースコードをダウンロードしてコンパイルしてインストールすることができます。これにより、modprobe r8168ロードはうまくいきますが、ハードウェアに接続されていないため、カードがifconfig

私はこれがmodalias(ハードウェア情報エンコード)と/lib/modules/*/modules.alias

claudius ~ # cat /sys/devices/pci0000\:00/0000\:00\:0e.0/0000\:02\:05.0/modalias 
pci:v000010ECd00008169sv000010ECsd00008169bc02sc00i00

これは私のカードです。以下は、システムのRealtekドライバマッピングです。

claudius ~ # grep r816 /lib/modules/3.11.0-12-generic/modules.alias
alias pci:v00001186d00004300sv00001186sd00004C00bc*sc*i* r8169
alias pci:v000010ECd00008169sv*sd*bc*sc*i* r8169
alias pci:v000010ECd00008167sv*sd*bc*sc*i* r8169
alias pci:v00001186d00004300sv00001186sd00004B10bc*sc*i* r8168
alias pci:v000010ECd00008168sv*sd*bc*sc*i* r8168

ファイルの末尾に次の行を追加してみました(手動編集を実行しないでください)。

alias pci:v000010ECd00008169sv000010ECsd00008169bc02sc00i00 r8168

その後、アンロードして再ロードしますr8168が、カードは構成されませんdmesg

私のネットワークカードをドライバにマッピングする正しい方法は何ですかr8168?カードを処理できると主張するには、ドライバを再構築する必要がありますか?または、一部の構成データを追加する必要がありますか?

ベストアンサー1

バインディングを使用して、特定のデバイスを使用するようにデバイスを強制できます。デバイスがすでに他のドライバによって所有されている場合は、まずバインドを解除する必要があります。

PCIベンダーID(10ecRealtekの場合)とデバイスIDの組み合わせが認識されない場合は、実行時に次のコマンドを使用して識別できます。

# echo 10ec 8169 > /sys/bus/pci/drivers/r8169/new_id

例:

# lspci -s 04: -nnvvv
04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8129 [10ec:8129] (rev 10)
        Subsystem: Coreco Inc RTL8111/8168 PCIe Gigabit Ethernet (misconfigured) [11ec:8129]
        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin A routed to IRQ 3
        Region 0: I/O ports at c000 [size=256]
        Region 1: Memory at f7b40000 (32-bit, non-prefetchable) [size=256]
        [virtual] Expansion ROM at f7b00000 [disabled] [size=256K]
        Capabilities: [dc] Power Management version 1
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0-,D1-,D2-,D3hot-,D3cold+)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Kernel driver in use: pci-stub

# echo 0000:04:00.0 > /sys/bus/pci/drivers/pci-stub/unbind
# echo 0000:04:00.0 > /sys/bus/pci/drivers/r8169/bind
# lspci -s 04: -nnvvv
04:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8129 [10ec:8129] (rev 10)
        Subsystem: Coreco Inc RTL8111/8168 PCIe Gigabit Ethernet (misconfigured) [11ec:8129]
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 32 (8000ns min, 8000ns max), Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 19
        Region 0: I/O ports at c000 [size=256]
        Region 1: Memory at f7b40000 (32-bit, non-prefetchable) [size=256]
        [virtual] Expansion ROM at f7b00000 [disabled] [size=256K]
        Capabilities: [dc] Power Management version 1
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0-,D1-,D2-,D3hot-,D3cold+)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Kernel driver in use: r8169

おすすめ記事