Lines Matching refs:ecmd

53 void mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)  in mii_ethtool_gset()  argument
59 ecmd->supported = in mii_ethtool_gset()
64 ecmd->supported |= SUPPORTED_1000baseT_Half | in mii_ethtool_gset()
68 ecmd->port = PORT_MII; in mii_ethtool_gset()
71 ecmd->transceiver = XCVR_INTERNAL; in mii_ethtool_gset()
74 ecmd->phy_address = mii->phy_id; in mii_ethtool_gset()
75 ecmd->mdio_support = ETH_MDIO_SUPPORTS_C22; in mii_ethtool_gset()
77 ecmd->advertising = ADVERTISED_TP | ADVERTISED_MII; in mii_ethtool_gset()
86 ecmd->advertising |= mii_get_an(mii, MII_ADVERTISE); in mii_ethtool_gset()
88 ecmd->advertising |= in mii_ethtool_gset()
92 ecmd->advertising |= ADVERTISED_Autoneg; in mii_ethtool_gset()
93 ecmd->autoneg = AUTONEG_ENABLE; in mii_ethtool_gset()
96 ecmd->lp_advertising = mii_get_an(mii, MII_LPA); in mii_ethtool_gset()
97 ecmd->lp_advertising |= in mii_ethtool_gset()
100 ecmd->lp_advertising = 0; in mii_ethtool_gset()
103 nego = ecmd->advertising & ecmd->lp_advertising; in mii_ethtool_gset()
107 ethtool_cmd_speed_set(ecmd, SPEED_1000); in mii_ethtool_gset()
108 ecmd->duplex = !!(nego & ADVERTISED_1000baseT_Full); in mii_ethtool_gset()
111 ethtool_cmd_speed_set(ecmd, SPEED_100); in mii_ethtool_gset()
112 ecmd->duplex = !!(nego & ADVERTISED_100baseT_Full); in mii_ethtool_gset()
114 ethtool_cmd_speed_set(ecmd, SPEED_10); in mii_ethtool_gset()
115 ecmd->duplex = !!(nego & ADVERTISED_10baseT_Full); in mii_ethtool_gset()
118 ecmd->autoneg = AUTONEG_DISABLE; in mii_ethtool_gset()
120 ethtool_cmd_speed_set(ecmd, in mii_ethtool_gset()
126 ecmd->duplex = (bmcr & BMCR_FULLDPLX) ? DUPLEX_FULL : DUPLEX_HALF; in mii_ethtool_gset()
129 mii->full_duplex = ecmd->duplex; in mii_ethtool_gset()
235 int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd) in mii_ethtool_sset() argument
238 u32 speed = ethtool_cmd_speed(ecmd); in mii_ethtool_sset()
244 if (ecmd->duplex != DUPLEX_HALF && ecmd->duplex != DUPLEX_FULL) in mii_ethtool_sset()
246 if (ecmd->port != PORT_MII) in mii_ethtool_sset()
248 if (ecmd->transceiver != XCVR_INTERNAL) in mii_ethtool_sset()
250 if (ecmd->phy_address != mii->phy_id) in mii_ethtool_sset()
252 if (ecmd->autoneg != AUTONEG_DISABLE && ecmd->autoneg != AUTONEG_ENABLE) in mii_ethtool_sset()
259 if (ecmd->autoneg == AUTONEG_ENABLE) { in mii_ethtool_sset()
263 if ((ecmd->advertising & (ADVERTISED_10baseT_Half | in mii_ethtool_sset()
278 tmp |= ethtool_adv_to_mii_adv_t(ecmd->advertising); in mii_ethtool_sset()
282 ethtool_adv_to_mii_ctrl1000_t(ecmd->advertising); in mii_ethtool_sset()
307 if (ecmd->duplex == DUPLEX_FULL) { in mii_ethtool_sset()