@@ -167,14 +167,16 @@ static void felix_phylink_validate(struct dsa_switch *ds, int port,
return;
}
- /* No half-duplex. */
phylink_set_port_modes(mask);
phylink_set(mask, Autoneg);
phylink_set(mask, Pause);
phylink_set(mask, Asym_Pause);
phylink_set(mask, 10baseT_Full);
+ phylink_set(mask, 10baseT_Half);
phylink_set(mask, 100baseT_Full);
+ phylink_set(mask, 100baseT_Half);
phylink_set(mask, 1000baseT_Full);
+ phylink_set(mask, 1000baseT_Half);
if (state->interface == PHY_INTERFACE_MODE_INTERNAL ||
state->interface == PHY_INTERFACE_MODE_2500BASEX ||
@@ -875,12 +875,12 @@ static void vsc9959_pcs_init_sgmii(struct phy_device *pcs,
phy_write(pcs, MII_BMCR, BMCR_ANRESTART | BMCR_ANENABLE);
} else {
+ u16 duplex = 0;
int speed;
- if (state->duplex == DUPLEX_HALF) {
- phydev_err(pcs, "Half duplex not supported\n");
- return;
- }
+ if (state->duplex == DUPLEX_FULL)
+ duplex = BMCR_FULLDPLX;
+
switch (state->speed) {
case SPEED_1000:
speed = ENETC_PCS_SPEED_1000;
@@ -906,7 +906,7 @@ static void vsc9959_pcs_init_sgmii(struct phy_device *pcs,
/* Yes, not a mistake: speed is given by IF_MODE. */
phy_write(pcs, MII_BMCR, BMCR_RESET |
BMCR_SPEED1000 |
- BMCR_FULLDPLX);
+ duplex);
}
}
@@ -983,8 +983,11 @@ static void vsc9959_pcs_init(struct ocelot *ocelot, int port,
ARRAY_SIZE(phy_basic_ports_array),
pcs->supported);
linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, pcs->supported);
+ linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, pcs->supported);
linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, pcs->supported);
+ linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, pcs->supported);
linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, pcs->supported);
+ linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, pcs->supported);
if (pcs->interface == PHY_INTERFACE_MODE_2500BASEX ||
pcs->interface == PHY_INTERFACE_MODE_USXGMII)
linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseX_Full_BIT,