Hello,
we want to use the L2-switch on our own hardware and found that half-duplex connections are not supported. Comparing with the iMX28 EVK we got the same results.
The L2-switch will be configured inside the kernel config as follows.
Linux Kernel Configuration
-> Device Drivers
--> Network device support
---> Ethernet (10 or 100Mbit)
----> L2 Switch Ethernet Controller (of ColdFire CPUs)
and if we plupped in/off an network cable, we got following.
root@imx28evk ~$ PHY: 0:01 - Link is Up - 10/Half
PHY: 0:01 - Link is Up - 10/Half
PHY: 0:01 - Link is Up - 10/Half
PHY: 0:01 - Link is Up - 10/Half
PHY: 0:01 - Link is Up - 10/Half
PHY: 0:01 - Link is Up - 10/Half
PHY: 0:01 - Link is Up - 10/Half
PHY: 0:01 - Link is Down
PHY: 0:00 - Link is Up - 10/Half
PHY: 0:00 - Link is Up - 10/Half
PHY: 0:00 - Link is Up - 10/Half
PHY: 0:00 - Link is Up - 10/Half
PHY: 0:00 - Link is Up - 10/Half
PHY: 0:00 - Link is Down
Searching for the reason inside the kernel sourcecode, I've added some debug code into drivers/net/phy/phy.c. - void phy_state_machine(struct work_struct *work).
Here I've seen that the state handler for port 1 floated between 6 ond 9, PHY_RUNNING and PHY_CHANGELINK and sends the Link is Up - 10/Half message.
Searching further, I found the missing part inside static fec-switch.c - void switch_adjust_link0(struct net_device *dev)
/* Duplex link change */
if (phy_dev->link) {
if (fep->full_duplex != phy_dev->duplex)
status_change = 1;
}
!!! Here all the time a status_change will be detected !!!
Comparing with fec.c - static void fec_enet_adjust_link(struct net_device *dev)
/* Duplex link change */
if (phy_dev->link) {
if (fep->full_duplex != phy_dev->duplex) {
fec_restart(dev, phy_dev->duplex);
status_change = 1;
}
}
there is no function like fec_restart(dev, phy_dev->duplex) for the L2-switch.
Is there any solution available to use a half-duplex connection together with the L2-switch?
The 10/Half duplex link works fine using normal eth setting without l2-switch
Kind regards,
Birger
Hello, there is a patch from Qiang Li.
Regards,
Birger
Hello,
I have tried to insert the switch_restart function. Than the periodical "PHY: 0:01 - Link is Up - 10/Half" were removed, but no communication were posssible with 10MBit/Half-duplex, so the code inside switch_restart() seams to be wrong.
/* Duplex link change */
if (phy_dev->link) {
if (fep->full_duplex != phy_dev->duplex) {
switch_restart(dev, phy_dev->duplex);
status_change = 1;
}
}
We also found, that 100Mbit/Half-duplex seams to be working in one pc/networkcard/switch combination with the modification above.
Regards,
Birger