From: tsai w. y. <wyt...@gm...> - 2008-04-29 08:27:48
|
I am assigned a job to test the loopback functionality of the 82571EB Copper / Fiber interfaces. The spec requires, when the interface is loopbacked, the directly connected interface in the other side should show a link down state. I first try to set the MII_MR_LOOPBACK bit of the Copper interface card and see link state of the directly conneted interface is down. But when I try the same method for the Fiber interface, it seems not work. I replace the simple bit setting with the code snippet (e1000_setup_loopback_test() & e1000_loopback_cleanup()) from e1000_loopback_test(): int setDevLoopback(struct net_device *dev, int enable) { ... if (enable) { switch(adapter->hw.mac_type) { case 82571: if (adapter->hw.media_type == e1000_media_type_fiber) { e1000_setup_loopback_test(adapter); } else { e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &phy_reg); phy_reg |= MII_CR_LOOPBACK; e1000_write_phy_reg(&adapter->hw, PHY_CTRL, phy_reg); } break; } } else { switch(adapter->mac_type) { case 82571: if (adapter->hw.media_type == e1000_media_type_fiber) { e1000_loopback_cleanup(adapter); e1000_reset(adapter); } else { e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &phy_reg); phy_reg &= ~MII_CR_LOOPBACK; e1000_write_phy_reg(&adapter->hw, PHY_CTRL, phy_reg); } break; } } After the Fiber interface is loopbacked, the link state of the directly connected interface is still up. But when I restart the auto-negotiation process of the connected interfce, the process fails, and the link falls to down. Does anyone know how to down the connected interface's link when the Fiber interface is loopbacked ? lspci info of the 82571 Fiber interfaces: 04:00.0 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06) Subsystem: Intel Corporation PRO/1000 PF Dual Port Server Adapter Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- Latency: 0, cache line size 10 Interrupt: pin A routed to IRQ 5 Region 0: Memory at fd8e0000 (32-bit, non-prefetchable) [size=128K] Region 1: Memory at fd8c0000 (32-bit, non-prefetchable) [size=128K] Region 2: I/O ports at 7f00 [size=32] Expansion ROM at <unassigned> [disabled] [size=128K] Capabilities: [c8] Power Management version 2 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=1 PME- Capabilities: [d0] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable- Address: 0000000000000000 Data: 0000 Capabilities: [e0] #10 [0001] 04:00.1 Ethernet controller: Intel Corporation 82571EB Gigabit Ethernet Controller (rev 06) Subsystem: Intel Corporation PRO/1000 PF Dual Port Server Adapter Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- Latency: 0, cache line size 10 Interrupt: pin B routed to IRQ 9 Region 0: Memory at fd8a0000 (32-bit, non-prefetchable) [size=128K] Region 1: Memory at fd880000 (32-bit, non-prefetchable) [size=128K] Region 2: I/O ports at 7e00 [size=32] Expansion ROM at <unassigned> [disabled] [size=128K] Capabilities: [c8] Power Management version 2 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=1 PME- Capabilities: [d0] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable- Address: 0000000000000000 Data: 0000 Capabilities: [e0] #10 [0001] Regards, wenyen |