Lines Matching refs:hw
109 static u32 alx_get_supported_speeds(struct alx_hw *hw) in alx_get_supported_speeds() argument
116 if (alx_hw_giga(hw)) in alx_get_supported_speeds()
131 struct alx_hw *hw = &alx->hw; in alx_get_settings() local
137 if (alx_hw_giga(hw)) in alx_get_settings()
139 ecmd->supported |= alx_get_supported_speeds(hw); in alx_get_settings()
142 if (hw->adv_cfg & ADVERTISED_Autoneg) in alx_get_settings()
143 ecmd->advertising |= hw->adv_cfg; in alx_get_settings()
148 if (hw->adv_cfg & ADVERTISED_Autoneg) in alx_get_settings()
154 if (hw->flowctrl & ALX_FC_ANEG && hw->adv_cfg & ADVERTISED_Autoneg) { in alx_get_settings()
155 if (hw->flowctrl & ALX_FC_RX) { in alx_get_settings()
158 if (!(hw->flowctrl & ALX_FC_TX)) in alx_get_settings()
160 } else if (hw->flowctrl & ALX_FC_TX) { in alx_get_settings()
165 ethtool_cmd_speed_set(ecmd, hw->link_speed); in alx_get_settings()
166 ecmd->duplex = hw->duplex; in alx_get_settings()
174 struct alx_hw *hw = &alx->hw; in alx_set_settings() local
180 if (ecmd->advertising & ~alx_get_supported_speeds(hw)) in alx_set_settings()
191 hw->adv_cfg = adv_cfg; in alx_set_settings()
192 return alx_setup_speed_duplex(hw, adv_cfg, hw->flowctrl); in alx_set_settings()
199 struct alx_hw *hw = &alx->hw; in alx_get_pauseparam() local
201 pause->autoneg = !!(hw->flowctrl & ALX_FC_ANEG && in alx_get_pauseparam()
202 hw->adv_cfg & ADVERTISED_Autoneg); in alx_get_pauseparam()
203 pause->tx_pause = !!(hw->flowctrl & ALX_FC_TX); in alx_get_pauseparam()
204 pause->rx_pause = !!(hw->flowctrl & ALX_FC_RX); in alx_get_pauseparam()
212 struct alx_hw *hw = &alx->hw; in alx_set_pauseparam() local
227 if (hw->adv_cfg & ADVERTISED_Autoneg) { in alx_set_pauseparam()
228 if (!((fc ^ hw->flowctrl) & ALX_FC_ANEG)) in alx_set_pauseparam()
230 if (fc & hw->flowctrl & ALX_FC_ANEG && in alx_set_pauseparam()
231 (fc ^ hw->flowctrl) & (ALX_FC_RX | ALX_FC_TX)) in alx_set_pauseparam()
236 err = alx_setup_speed_duplex(hw, hw->adv_cfg, fc); in alx_set_pauseparam()
242 if ((fc ^ hw->flowctrl) & (ALX_FC_RX | ALX_FC_TX)) in alx_set_pauseparam()
243 alx_cfg_mac_flowcontrol(hw, fc); in alx_set_pauseparam()
245 hw->flowctrl = fc; in alx_set_pauseparam()
268 struct alx_hw *hw = &alx->hw; in alx_get_ethtool_stats() local
272 alx_update_hw_stats(hw); in alx_get_ethtool_stats()
273 BUILD_BUG_ON(sizeof(hw->stats) - offsetof(struct alx_hw_stats, rx_ok) < in alx_get_ethtool_stats()
275 memcpy(data, &hw->stats.rx_ok, ALX_NUM_STATS * sizeof(u64)); in alx_get_ethtool_stats()