if (!pdata->phydev)
return -ENODEV;
- spin_lock_irq(&pdata->lock);
-
ret = phy_ethtool_gset(pdata->phydev, cmd);
cmd->transceiver = XCVR_EXTERNAL;
- spin_unlock_irq(&pdata->lock);
-
DBGPR("<--xgbe_get_settings\n");
return ret;
if (!pdata->phydev)
return -ENODEV;
- spin_lock_irq(&pdata->lock);
-
speed = ethtool_cmd_speed(cmd);
- ret = -EINVAL;
if (cmd->phy_address != phydev->addr)
- goto unlock;
+ return -EINVAL;
if ((cmd->autoneg != AUTONEG_ENABLE) &&
(cmd->autoneg != AUTONEG_DISABLE))
- goto unlock;
+ return -EINVAL;
if (cmd->autoneg == AUTONEG_DISABLE) {
switch (speed) {
case SPEED_1000:
break;
default:
- goto unlock;
+ return -EINVAL;
}
if (cmd->duplex != DUPLEX_FULL)
- goto unlock;
+ return -EINVAL;
}
cmd->advertising &= phydev->supported;
if ((cmd->autoneg == AUTONEG_ENABLE) && !cmd->advertising)
- goto unlock;
+ return -EINVAL;
ret = 0;
phydev->autoneg = cmd->autoneg;
if (netif_running(netdev))
ret = phy_start_aneg(phydev);
-unlock:
- spin_unlock_irq(&pdata->lock);
-
DBGPR("<--xgbe_set_settings\n");
return ret;
struct xgbe_prv_data *pdata = netdev_priv(netdev);
struct xgbe_hw_if *hw_if = &pdata->hw_if;
struct phy_device *phydev = pdata->phydev;
- unsigned long flags;
int new_state = 0;
if (phydev == NULL)
DBGPR_MDIO("-->xgbe_adjust_link: address=%d, newlink=%d, curlink=%d\n",
phydev->addr, phydev->link, pdata->phy_link);
- spin_lock_irqsave(&pdata->lock, flags);
-
if (phydev->link) {
/* Flow control support */
if (pdata->pause_autoneg) {
if (new_state)
phy_print_status(phydev);
- spin_unlock_irqrestore(&pdata->lock, flags);
-
DBGPR_MDIO("<--xgbe_adjust_link\n");
}