Lines Matching refs:ecmd

46  * mii_ethtool_gset - get settings that are specified in @ecmd
48 * @ecmd: requested ethtool_cmd
50 * The @ecmd parameter is expected to have been cleared before calling
53 void mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
59 ecmd->supported =
64 ecmd->supported |= SUPPORTED_1000baseT_Half |
68 ecmd->port = PORT_MII;
71 ecmd->transceiver = XCVR_INTERNAL;
74 ecmd->phy_address = mii->phy_id;
75 ecmd->mdio_support = ETH_MDIO_SUPPORTS_C22;
77 ecmd->advertising = ADVERTISED_TP | ADVERTISED_MII;
86 ecmd->advertising |= mii_get_an(mii, MII_ADVERTISE);
88 ecmd->advertising |=
92 ecmd->advertising |= ADVERTISED_Autoneg;
93 ecmd->autoneg = AUTONEG_ENABLE;
96 ecmd->lp_advertising = mii_get_an(mii, MII_LPA);
97 ecmd->lp_advertising |=
100 ecmd->lp_advertising = 0;
103 nego = ecmd->advertising & ecmd->lp_advertising;
107 ethtool_cmd_speed_set(ecmd, SPEED_1000);
108 ecmd->duplex = !!(nego & ADVERTISED_1000baseT_Full);
111 ethtool_cmd_speed_set(ecmd, SPEED_100);
112 ecmd->duplex = !!(nego & ADVERTISED_100baseT_Full);
114 ethtool_cmd_speed_set(ecmd, SPEED_10);
115 ecmd->duplex = !!(nego & ADVERTISED_10baseT_Full);
118 ecmd->autoneg = AUTONEG_DISABLE;
120 ethtool_cmd_speed_set(ecmd,
126 ecmd->duplex = (bmcr & BMCR_FULLDPLX) ? DUPLEX_FULL : DUPLEX_HALF;
129 mii->full_duplex = ecmd->duplex;
232 * mii_ethtool_sset - set settings that are specified in @ecmd
234 * @ecmd: requested ethtool_cmd
238 int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
241 u32 speed = ethtool_cmd_speed(ecmd);
247 if (ecmd->duplex != DUPLEX_HALF && ecmd->duplex != DUPLEX_FULL)
249 if (ecmd->port != PORT_MII)
251 if (ecmd->transceiver != XCVR_INTERNAL)
253 if (ecmd->phy_address != mii->phy_id)
255 if (ecmd->autoneg != AUTONEG_DISABLE && ecmd->autoneg != AUTONEG_ENABLE)
262 if (ecmd->autoneg == AUTONEG_ENABLE) {
266 if ((ecmd->advertising & (ADVERTISED_10baseT_Half |
281 tmp |= ethtool_adv_to_mii_adv_t(ecmd->advertising);
285 ethtool_adv_to_mii_ctrl1000_t(ecmd->advertising);
310 if (ecmd->duplex == DUPLEX_FULL) {