Birger Bauch

missing half-duplex support with L2-switch

Discussion created by Birger Bauch on Mar 23, 2012
Latest reply on Apr 25, 2012 by Birger Bauch

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

Outcomes