Commit aac1561a authored by David S. Miller's avatar David S. Miller

net: Revert ksettings conversions.

Those were supposed to go into the net-next tree not
the net tree.  Oops...
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b793f081
...@@ -1446,40 +1446,40 @@ static int smc911x_close(struct net_device *dev) ...@@ -1446,40 +1446,40 @@ static int smc911x_close(struct net_device *dev)
* Ethtool support * Ethtool support
*/ */
static int static int
smc911x_ethtool_get_link_ksettings(struct net_device *dev, smc911x_ethtool_getsettings(struct net_device *dev, struct ethtool_cmd *cmd)
struct ethtool_link_ksettings *cmd)
{ {
struct smc911x_local *lp = netdev_priv(dev); struct smc911x_local *lp = netdev_priv(dev);
int ret, status; int ret, status;
unsigned long flags; unsigned long flags;
u32 supported;
DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__); DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__);
cmd->maxtxpkt = 1;
cmd->maxrxpkt = 1;
if (lp->phy_type != 0) { if (lp->phy_type != 0) {
spin_lock_irqsave(&lp->lock, flags); spin_lock_irqsave(&lp->lock, flags);
ret = mii_ethtool_get_link_ksettings(&lp->mii, cmd); ret = mii_ethtool_gset(&lp->mii, cmd);
spin_unlock_irqrestore(&lp->lock, flags); spin_unlock_irqrestore(&lp->lock, flags);
} else { } else {
supported = SUPPORTED_10baseT_Half | cmd->supported = SUPPORTED_10baseT_Half |
SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Full |
SUPPORTED_TP | SUPPORTED_AUI; SUPPORTED_TP | SUPPORTED_AUI;
if (lp->ctl_rspeed == 10) if (lp->ctl_rspeed == 10)
cmd->base.speed = SPEED_10; ethtool_cmd_speed_set(cmd, SPEED_10);
else if (lp->ctl_rspeed == 100) else if (lp->ctl_rspeed == 100)
cmd->base.speed = SPEED_100; ethtool_cmd_speed_set(cmd, SPEED_100);
cmd->base.autoneg = AUTONEG_DISABLE; cmd->autoneg = AUTONEG_DISABLE;
cmd->base.port = 0; if (lp->mii.phy_id==1)
cmd->transceiver = XCVR_INTERNAL;
else
cmd->transceiver = XCVR_EXTERNAL;
cmd->port = 0;
SMC_GET_PHY_SPECIAL(lp, lp->mii.phy_id, status); SMC_GET_PHY_SPECIAL(lp, lp->mii.phy_id, status);
cmd->base.duplex = cmd->duplex =
(status & (PHY_SPECIAL_SPD_10FULL_ | PHY_SPECIAL_SPD_100FULL_)) ? (status & (PHY_SPECIAL_SPD_10FULL_ | PHY_SPECIAL_SPD_100FULL_)) ?
DUPLEX_FULL : DUPLEX_HALF; DUPLEX_FULL : DUPLEX_HALF;
ethtool_convert_legacy_u32_to_link_mode(
cmd->link_modes.supported, supported);
ret = 0; ret = 0;
} }
...@@ -1487,8 +1487,7 @@ smc911x_ethtool_get_link_ksettings(struct net_device *dev, ...@@ -1487,8 +1487,7 @@ smc911x_ethtool_get_link_ksettings(struct net_device *dev,
} }
static int static int
smc911x_ethtool_set_link_ksettings(struct net_device *dev, smc911x_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)
const struct ethtool_link_ksettings *cmd)
{ {
struct smc911x_local *lp = netdev_priv(dev); struct smc911x_local *lp = netdev_priv(dev);
int ret; int ret;
...@@ -1496,18 +1495,16 @@ smc911x_ethtool_set_link_ksettings(struct net_device *dev, ...@@ -1496,18 +1495,16 @@ smc911x_ethtool_set_link_ksettings(struct net_device *dev,
if (lp->phy_type != 0) { if (lp->phy_type != 0) {
spin_lock_irqsave(&lp->lock, flags); spin_lock_irqsave(&lp->lock, flags);
ret = mii_ethtool_set_link_ksettings(&lp->mii, cmd); ret = mii_ethtool_sset(&lp->mii, cmd);
spin_unlock_irqrestore(&lp->lock, flags); spin_unlock_irqrestore(&lp->lock, flags);
} else { } else {
if (cmd->base.autoneg != AUTONEG_DISABLE || if (cmd->autoneg != AUTONEG_DISABLE ||
cmd->base.speed != SPEED_10 || cmd->speed != SPEED_10 ||
(cmd->base.duplex != DUPLEX_HALF && (cmd->duplex != DUPLEX_HALF && cmd->duplex != DUPLEX_FULL) ||
cmd->base.duplex != DUPLEX_FULL) || (cmd->port != PORT_TP && cmd->port != PORT_AUI))
(cmd->base.port != PORT_TP &&
cmd->base.port != PORT_AUI))
return -EINVAL; return -EINVAL;
lp->ctl_rfduplx = cmd->base.duplex == DUPLEX_FULL; lp->ctl_rfduplx = cmd->duplex == DUPLEX_FULL;
ret = 0; ret = 0;
} }
...@@ -1689,6 +1686,8 @@ static int smc911x_ethtool_geteeprom_len(struct net_device *dev) ...@@ -1689,6 +1686,8 @@ static int smc911x_ethtool_geteeprom_len(struct net_device *dev)
} }
static const struct ethtool_ops smc911x_ethtool_ops = { static const struct ethtool_ops smc911x_ethtool_ops = {
.get_settings = smc911x_ethtool_getsettings,
.set_settings = smc911x_ethtool_setsettings,
.get_drvinfo = smc911x_ethtool_getdrvinfo, .get_drvinfo = smc911x_ethtool_getdrvinfo,
.get_msglevel = smc911x_ethtool_getmsglevel, .get_msglevel = smc911x_ethtool_getmsglevel,
.set_msglevel = smc911x_ethtool_setmsglevel, .set_msglevel = smc911x_ethtool_setmsglevel,
...@@ -1699,8 +1698,6 @@ static const struct ethtool_ops smc911x_ethtool_ops = { ...@@ -1699,8 +1698,6 @@ static const struct ethtool_ops smc911x_ethtool_ops = {
.get_eeprom_len = smc911x_ethtool_geteeprom_len, .get_eeprom_len = smc911x_ethtool_geteeprom_len,
.get_eeprom = smc911x_ethtool_geteeprom, .get_eeprom = smc911x_ethtool_geteeprom,
.set_eeprom = smc911x_ethtool_seteeprom, .set_eeprom = smc911x_ethtool_seteeprom,
.get_link_ksettings = smc911x_ethtool_get_link_ksettings,
.set_link_ksettings = smc911x_ethtool_set_link_ksettings,
}; };
/* /*
......
...@@ -691,8 +691,7 @@ static void cas_mif_poll(struct cas *cp, const int enable) ...@@ -691,8 +691,7 @@ static void cas_mif_poll(struct cas *cp, const int enable)
} }
/* Must be invoked under cp->lock */ /* Must be invoked under cp->lock */
static void cas_begin_auto_negotiation(struct cas *cp, static void cas_begin_auto_negotiation(struct cas *cp, struct ethtool_cmd *ep)
const struct ethtool_link_ksettings *ep)
{ {
u16 ctl; u16 ctl;
#if 1 #if 1
...@@ -705,16 +704,16 @@ static void cas_begin_auto_negotiation(struct cas *cp, ...@@ -705,16 +704,16 @@ static void cas_begin_auto_negotiation(struct cas *cp,
if (!ep) if (!ep)
goto start_aneg; goto start_aneg;
lcntl = cp->link_cntl; lcntl = cp->link_cntl;
if (ep->base.autoneg == AUTONEG_ENABLE) { if (ep->autoneg == AUTONEG_ENABLE)
cp->link_cntl = BMCR_ANENABLE; cp->link_cntl = BMCR_ANENABLE;
} else { else {
u32 speed = ep->base.speed; u32 speed = ethtool_cmd_speed(ep);
cp->link_cntl = 0; cp->link_cntl = 0;
if (speed == SPEED_100) if (speed == SPEED_100)
cp->link_cntl |= BMCR_SPEED100; cp->link_cntl |= BMCR_SPEED100;
else if (speed == SPEED_1000) else if (speed == SPEED_1000)
cp->link_cntl |= CAS_BMCR_SPEED1000; cp->link_cntl |= CAS_BMCR_SPEED1000;
if (ep->base.duplex == DUPLEX_FULL) if (ep->duplex == DUPLEX_FULL)
cp->link_cntl |= BMCR_FULLDPLX; cp->link_cntl |= BMCR_FULLDPLX;
} }
#if 1 #if 1
...@@ -4529,21 +4528,19 @@ static void cas_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info ...@@ -4529,21 +4528,19 @@ static void cas_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
strlcpy(info->bus_info, pci_name(cp->pdev), sizeof(info->bus_info)); strlcpy(info->bus_info, pci_name(cp->pdev), sizeof(info->bus_info));
} }
static int cas_get_link_ksettings(struct net_device *dev, static int cas_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
struct ethtool_link_ksettings *cmd)
{ {
struct cas *cp = netdev_priv(dev); struct cas *cp = netdev_priv(dev);
u16 bmcr; u16 bmcr;
int full_duplex, speed, pause; int full_duplex, speed, pause;
unsigned long flags; unsigned long flags;
enum link_state linkstate = link_up; enum link_state linkstate = link_up;
u32 supported, advertising;
advertising = 0; cmd->advertising = 0;
supported = SUPPORTED_Autoneg; cmd->supported = SUPPORTED_Autoneg;
if (cp->cas_flags & CAS_FLAG_1000MB_CAP) { if (cp->cas_flags & CAS_FLAG_1000MB_CAP) {
supported |= SUPPORTED_1000baseT_Full; cmd->supported |= SUPPORTED_1000baseT_Full;
advertising |= ADVERTISED_1000baseT_Full; cmd->advertising |= ADVERTISED_1000baseT_Full;
} }
/* Record PHY settings if HW is on. */ /* Record PHY settings if HW is on. */
...@@ -4551,15 +4548,17 @@ static int cas_get_link_ksettings(struct net_device *dev, ...@@ -4551,15 +4548,17 @@ static int cas_get_link_ksettings(struct net_device *dev,
bmcr = 0; bmcr = 0;
linkstate = cp->lstate; linkstate = cp->lstate;
if (CAS_PHY_MII(cp->phy_type)) { if (CAS_PHY_MII(cp->phy_type)) {
cmd->base.port = PORT_MII; cmd->port = PORT_MII;
cmd->base.phy_address = cp->phy_addr; cmd->transceiver = (cp->cas_flags & CAS_FLAG_SATURN) ?
advertising |= ADVERTISED_TP | ADVERTISED_MII | XCVR_INTERNAL : XCVR_EXTERNAL;
cmd->phy_address = cp->phy_addr;
cmd->advertising |= ADVERTISED_TP | ADVERTISED_MII |
ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Half |
ADVERTISED_10baseT_Full | ADVERTISED_10baseT_Full |
ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Half |
ADVERTISED_100baseT_Full; ADVERTISED_100baseT_Full;
supported |= cmd->supported |=
(SUPPORTED_10baseT_Half | (SUPPORTED_10baseT_Half |
SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Half |
...@@ -4575,10 +4574,11 @@ static int cas_get_link_ksettings(struct net_device *dev, ...@@ -4575,10 +4574,11 @@ static int cas_get_link_ksettings(struct net_device *dev,
} }
} else { } else {
cmd->base.port = PORT_FIBRE; cmd->port = PORT_FIBRE;
cmd->base.phy_address = 0; cmd->transceiver = XCVR_INTERNAL;
supported |= SUPPORTED_FIBRE; cmd->phy_address = 0;
advertising |= ADVERTISED_FIBRE; cmd->supported |= SUPPORTED_FIBRE;
cmd->advertising |= ADVERTISED_FIBRE;
if (cp->hw_running) { if (cp->hw_running) {
/* pcs uses the same bits as mii */ /* pcs uses the same bits as mii */
...@@ -4590,20 +4590,21 @@ static int cas_get_link_ksettings(struct net_device *dev, ...@@ -4590,20 +4590,21 @@ static int cas_get_link_ksettings(struct net_device *dev,
spin_unlock_irqrestore(&cp->lock, flags); spin_unlock_irqrestore(&cp->lock, flags);
if (bmcr & BMCR_ANENABLE) { if (bmcr & BMCR_ANENABLE) {
advertising |= ADVERTISED_Autoneg; cmd->advertising |= ADVERTISED_Autoneg;
cmd->base.autoneg = AUTONEG_ENABLE; cmd->autoneg = AUTONEG_ENABLE;
cmd->base.speed = ((speed == 10) ? ethtool_cmd_speed_set(cmd, ((speed == 10) ?
SPEED_10 : SPEED_10 :
((speed == 1000) ? ((speed == 1000) ?
SPEED_1000 : SPEED_100)); SPEED_1000 : SPEED_100)));
cmd->base.duplex = full_duplex ? DUPLEX_FULL : DUPLEX_HALF; cmd->duplex = full_duplex ? DUPLEX_FULL : DUPLEX_HALF;
} else { } else {
cmd->base.autoneg = AUTONEG_DISABLE; cmd->autoneg = AUTONEG_DISABLE;
cmd->base.speed = ((bmcr & CAS_BMCR_SPEED1000) ? ethtool_cmd_speed_set(cmd, ((bmcr & CAS_BMCR_SPEED1000) ?
SPEED_1000 : SPEED_1000 :
((bmcr & BMCR_SPEED100) ? ((bmcr & BMCR_SPEED100) ?
SPEED_100 : SPEED_10)); SPEED_100 : SPEED_10)));
cmd->base.duplex = (bmcr & BMCR_FULLDPLX) ? cmd->duplex =
(bmcr & BMCR_FULLDPLX) ?
DUPLEX_FULL : DUPLEX_HALF; DUPLEX_FULL : DUPLEX_HALF;
} }
if (linkstate != link_up) { if (linkstate != link_up) {
...@@ -4618,46 +4619,39 @@ static int cas_get_link_ksettings(struct net_device *dev, ...@@ -4618,46 +4619,39 @@ static int cas_get_link_ksettings(struct net_device *dev,
* settings that we configured. * settings that we configured.
*/ */
if (cp->link_cntl & BMCR_ANENABLE) { if (cp->link_cntl & BMCR_ANENABLE) {
cmd->base.speed = 0; ethtool_cmd_speed_set(cmd, 0);
cmd->base.duplex = 0xff; cmd->duplex = 0xff;
} else { } else {
cmd->base.speed = SPEED_10; ethtool_cmd_speed_set(cmd, SPEED_10);
if (cp->link_cntl & BMCR_SPEED100) { if (cp->link_cntl & BMCR_SPEED100) {
cmd->base.speed = SPEED_100; ethtool_cmd_speed_set(cmd, SPEED_100);
} else if (cp->link_cntl & CAS_BMCR_SPEED1000) { } else if (cp->link_cntl & CAS_BMCR_SPEED1000) {
cmd->base.speed = SPEED_1000; ethtool_cmd_speed_set(cmd, SPEED_1000);
} }
cmd->base.duplex = (cp->link_cntl & BMCR_FULLDPLX) ? cmd->duplex = (cp->link_cntl & BMCR_FULLDPLX)?
DUPLEX_FULL : DUPLEX_HALF; DUPLEX_FULL : DUPLEX_HALF;
} }
} }
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
advertising);
return 0; return 0;
} }
static int cas_set_link_ksettings(struct net_device *dev, static int cas_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
const struct ethtool_link_ksettings *cmd)
{ {
struct cas *cp = netdev_priv(dev); struct cas *cp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
u32 speed = cmd->base.speed; u32 speed = ethtool_cmd_speed(cmd);
/* Verify the settings we care about. */ /* Verify the settings we care about. */
if (cmd->base.autoneg != AUTONEG_ENABLE && if (cmd->autoneg != AUTONEG_ENABLE &&
cmd->base.autoneg != AUTONEG_DISABLE) cmd->autoneg != AUTONEG_DISABLE)
return -EINVAL; return -EINVAL;
if (cmd->base.autoneg == AUTONEG_DISABLE && if (cmd->autoneg == AUTONEG_DISABLE &&
((speed != SPEED_1000 && ((speed != SPEED_1000 &&
speed != SPEED_100 && speed != SPEED_100 &&
speed != SPEED_10) || speed != SPEED_10) ||
(cmd->base.duplex != DUPLEX_HALF && (cmd->duplex != DUPLEX_HALF &&
cmd->base.duplex != DUPLEX_FULL))) cmd->duplex != DUPLEX_FULL)))
return -EINVAL; return -EINVAL;
/* Apply settings and restart link process. */ /* Apply settings and restart link process. */
...@@ -4759,6 +4753,8 @@ static void cas_get_ethtool_stats(struct net_device *dev, ...@@ -4759,6 +4753,8 @@ static void cas_get_ethtool_stats(struct net_device *dev,
static const struct ethtool_ops cas_ethtool_ops = { static const struct ethtool_ops cas_ethtool_ops = {
.get_drvinfo = cas_get_drvinfo, .get_drvinfo = cas_get_drvinfo,
.get_settings = cas_get_settings,
.set_settings = cas_set_settings,
.nway_reset = cas_nway_reset, .nway_reset = cas_nway_reset,
.get_link = cas_get_link, .get_link = cas_get_link,
.get_msglevel = cas_get_msglevel, .get_msglevel = cas_get_msglevel,
...@@ -4768,8 +4764,6 @@ static const struct ethtool_ops cas_ethtool_ops = { ...@@ -4768,8 +4764,6 @@ static const struct ethtool_ops cas_ethtool_ops = {
.get_sset_count = cas_get_sset_count, .get_sset_count = cas_get_sset_count,
.get_strings = cas_get_strings, .get_strings = cas_get_strings,
.get_ethtool_stats = cas_get_ethtool_stats, .get_ethtool_stats = cas_get_ethtool_stats,
.get_link_ksettings = cas_get_link_ksettings,
.set_link_ksettings = cas_set_link_ksettings,
}; };
static int cas_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) static int cas_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
......
...@@ -6813,8 +6813,7 @@ static void niu_get_drvinfo(struct net_device *dev, ...@@ -6813,8 +6813,7 @@ static void niu_get_drvinfo(struct net_device *dev,
sizeof(info->bus_info)); sizeof(info->bus_info));
} }
static int niu_get_link_ksettings(struct net_device *dev, static int niu_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
struct ethtool_link_ksettings *cmd)
{ {
struct niu *np = netdev_priv(dev); struct niu *np = netdev_priv(dev);
struct niu_link_config *lp; struct niu_link_config *lp;
...@@ -6822,30 +6821,28 @@ static int niu_get_link_ksettings(struct net_device *dev, ...@@ -6822,30 +6821,28 @@ static int niu_get_link_ksettings(struct net_device *dev,
lp = &np->link_config; lp = &np->link_config;
memset(cmd, 0, sizeof(*cmd)); memset(cmd, 0, sizeof(*cmd));
cmd->base.phy_address = np->phy_addr; cmd->phy_address = np->phy_addr;
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, cmd->supported = lp->supported;
lp->supported); cmd->advertising = lp->active_advertising;
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising, cmd->autoneg = lp->active_autoneg;
lp->active_advertising); ethtool_cmd_speed_set(cmd, lp->active_speed);
cmd->base.autoneg = lp->active_autoneg; cmd->duplex = lp->active_duplex;
cmd->base.speed = lp->active_speed; cmd->port = (np->flags & NIU_FLAGS_FIBER) ? PORT_FIBRE : PORT_TP;
cmd->base.duplex = lp->active_duplex; cmd->transceiver = (np->flags & NIU_FLAGS_XCVR_SERDES) ?
cmd->base.port = (np->flags & NIU_FLAGS_FIBER) ? PORT_FIBRE : PORT_TP; XCVR_EXTERNAL : XCVR_INTERNAL;
return 0; return 0;
} }
static int niu_set_link_ksettings(struct net_device *dev, static int niu_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
const struct ethtool_link_ksettings *cmd)
{ {
struct niu *np = netdev_priv(dev); struct niu *np = netdev_priv(dev);
struct niu_link_config *lp = &np->link_config; struct niu_link_config *lp = &np->link_config;
ethtool_convert_link_mode_to_legacy_u32(&lp->advertising, lp->advertising = cmd->advertising;
cmd->link_modes.advertising); lp->speed = ethtool_cmd_speed(cmd);
lp->speed = cmd->base.speed; lp->duplex = cmd->duplex;
lp->duplex = cmd->base.duplex; lp->autoneg = cmd->autoneg;
lp->autoneg = cmd->base.autoneg;
return niu_init_link(np); return niu_init_link(np);
} }
...@@ -7905,14 +7902,14 @@ static const struct ethtool_ops niu_ethtool_ops = { ...@@ -7905,14 +7902,14 @@ static const struct ethtool_ops niu_ethtool_ops = {
.nway_reset = niu_nway_reset, .nway_reset = niu_nway_reset,
.get_eeprom_len = niu_get_eeprom_len, .get_eeprom_len = niu_get_eeprom_len,
.get_eeprom = niu_get_eeprom, .get_eeprom = niu_get_eeprom,
.get_settings = niu_get_settings,
.set_settings = niu_set_settings,
.get_strings = niu_get_strings, .get_strings = niu_get_strings,
.get_sset_count = niu_get_sset_count, .get_sset_count = niu_get_sset_count,
.get_ethtool_stats = niu_get_ethtool_stats, .get_ethtool_stats = niu_get_ethtool_stats,
.set_phys_id = niu_set_phys_id, .set_phys_id = niu_set_phys_id,
.get_rxnfc = niu_get_nfc, .get_rxnfc = niu_get_nfc,
.set_rxnfc = niu_set_nfc, .set_rxnfc = niu_set_nfc,
.get_link_ksettings = niu_get_link_ksettings,
.set_link_ksettings = niu_set_link_ksettings,
}; };
static int niu_ldg_assign_ldn(struct niu *np, struct niu_parent *parent, static int niu_ldg_assign_ldn(struct niu *np, struct niu_parent *parent,
......
...@@ -1250,17 +1250,12 @@ static void gem_stop_dma(struct gem *gp) ...@@ -1250,17 +1250,12 @@ static void gem_stop_dma(struct gem *gp)
// XXX dbl check what that function should do when called on PCS PHY // XXX dbl check what that function should do when called on PCS PHY
static void gem_begin_auto_negotiation(struct gem *gp, static void gem_begin_auto_negotiation(struct gem *gp, struct ethtool_cmd *ep)
const struct ethtool_link_ksettings *ep)
{ {
u32 advertise, features; u32 advertise, features;
int autoneg; int autoneg;
int speed; int speed;
int duplex; int duplex;
u32 advertising;
ethtool_convert_link_mode_to_legacy_u32(&advertising,
ep->link_modes.advertising);
if (gp->phy_type != phy_mii_mdio0 && if (gp->phy_type != phy_mii_mdio0 &&
gp->phy_type != phy_mii_mdio1) gp->phy_type != phy_mii_mdio1)
...@@ -1283,13 +1278,13 @@ static void gem_begin_auto_negotiation(struct gem *gp, ...@@ -1283,13 +1278,13 @@ static void gem_begin_auto_negotiation(struct gem *gp,
/* Setup link parameters */ /* Setup link parameters */
if (!ep) if (!ep)
goto start_aneg; goto start_aneg;
if (ep->base.autoneg == AUTONEG_ENABLE) { if (ep->autoneg == AUTONEG_ENABLE) {
advertise = advertising; advertise = ep->advertising;
autoneg = 1; autoneg = 1;
} else { } else {
autoneg = 0; autoneg = 0;
speed = ep->base.speed; speed = ethtool_cmd_speed(ep);
duplex = ep->base.duplex; duplex = ep->duplex;
} }
start_aneg: start_aneg:
...@@ -2520,96 +2515,85 @@ static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info ...@@ -2520,96 +2515,85 @@ static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
strlcpy(info->bus_info, pci_name(gp->pdev), sizeof(info->bus_info)); strlcpy(info->bus_info, pci_name(gp->pdev), sizeof(info->bus_info));
} }
static int gem_get_link_ksettings(struct net_device *dev, static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
struct ethtool_link_ksettings *cmd)
{ {
struct gem *gp = netdev_priv(dev); struct gem *gp = netdev_priv(dev);
u32 supported, advertising;
if (gp->phy_type == phy_mii_mdio0 || if (gp->phy_type == phy_mii_mdio0 ||
gp->phy_type == phy_mii_mdio1) { gp->phy_type == phy_mii_mdio1) {
if (gp->phy_mii.def) if (gp->phy_mii.def)
supported = gp->phy_mii.def->features; cmd->supported = gp->phy_mii.def->features;
else else
supported = (SUPPORTED_10baseT_Half | cmd->supported = (SUPPORTED_10baseT_Half |
SUPPORTED_10baseT_Full); SUPPORTED_10baseT_Full);
/* XXX hardcoded stuff for now */ /* XXX hardcoded stuff for now */
cmd->base.port = PORT_MII; cmd->port = PORT_MII;
cmd->base.phy_address = 0; /* XXX fixed PHYAD */ cmd->transceiver = XCVR_EXTERNAL;
cmd->phy_address = 0; /* XXX fixed PHYAD */
/* Return current PHY settings */ /* Return current PHY settings */
cmd->base.autoneg = gp->want_autoneg; cmd->autoneg = gp->want_autoneg;
cmd->base.speed = gp->phy_mii.speed; ethtool_cmd_speed_set(cmd, gp->phy_mii.speed);
cmd->base.duplex = gp->phy_mii.duplex; cmd->duplex = gp->phy_mii.duplex;
advertising = gp->phy_mii.advertising; cmd->advertising = gp->phy_mii.advertising;
/* If we started with a forced mode, we don't have a default /* If we started with a forced mode, we don't have a default
* advertise set, we need to return something sensible so * advertise set, we need to return something sensible so
* userland can re-enable autoneg properly. * userland can re-enable autoneg properly.
*/ */
if (advertising == 0) if (cmd->advertising == 0)
advertising = supported; cmd->advertising = cmd->supported;
} else { // XXX PCS ? } else { // XXX PCS ?
supported = cmd->supported =
(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
SUPPORTED_Autoneg); SUPPORTED_Autoneg);
advertising = supported; cmd->advertising = cmd->supported;
cmd->base.speed = 0; ethtool_cmd_speed_set(cmd, 0);
cmd->base.duplex = 0; cmd->duplex = cmd->port = cmd->phy_address =
cmd->base.port = 0; cmd->transceiver = cmd->autoneg = 0;
cmd->base.phy_address = 0;
cmd->base.autoneg = 0;
/* serdes means usually a Fibre connector, with most fixed */ /* serdes means usually a Fibre connector, with most fixed */
if (gp->phy_type == phy_serdes) { if (gp->phy_type == phy_serdes) {
cmd->base.port = PORT_FIBRE; cmd->port = PORT_FIBRE;
supported = (SUPPORTED_1000baseT_Half | cmd->supported = (SUPPORTED_1000baseT_Half |
SUPPORTED_1000baseT_Full | SUPPORTED_1000baseT_Full |
SUPPORTED_FIBRE | SUPPORTED_Autoneg | SUPPORTED_FIBRE | SUPPORTED_Autoneg |
SUPPORTED_Pause | SUPPORTED_Asym_Pause); SUPPORTED_Pause | SUPPORTED_Asym_Pause);
advertising = supported; cmd->advertising = cmd->supported;
cmd->transceiver = XCVR_INTERNAL;
if (gp->lstate == link_up) if (gp->lstate == link_up)
cmd->base.speed = SPEED_1000; ethtool_cmd_speed_set(cmd, SPEED_1000);
cmd->base.duplex = DUPLEX_FULL; cmd->duplex = DUPLEX_FULL;
cmd->base.autoneg = 1; cmd->autoneg = 1;
} }
} }
cmd->maxtxpkt = cmd->maxrxpkt = 0;
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
advertising);
return 0; return 0;
} }
static int gem_set_link_ksettings(struct net_device *dev, static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
const struct ethtool_link_ksettings *cmd)
{ {
struct gem *gp = netdev_priv(dev); struct gem *gp = netdev_priv(dev);
u32 speed = cmd->base.speed; u32 speed = ethtool_cmd_speed(cmd);
u32 advertising;
ethtool_convert_link_mode_to_legacy_u32(&advertising,
cmd->link_modes.advertising);
/* Verify the settings we care about. */ /* Verify the settings we care about. */
if (cmd->base.autoneg != AUTONEG_ENABLE && if (cmd->autoneg != AUTONEG_ENABLE &&
cmd->base.autoneg != AUTONEG_DISABLE) cmd->autoneg != AUTONEG_DISABLE)
return -EINVAL; return -EINVAL;
if (cmd->base.autoneg == AUTONEG_ENABLE && if (cmd->autoneg == AUTONEG_ENABLE &&
advertising == 0) cmd->advertising == 0)
return -EINVAL; return -EINVAL;
if (cmd->base.autoneg == AUTONEG_DISABLE && if (cmd->autoneg == AUTONEG_DISABLE &&
((speed != SPEED_1000 && ((speed != SPEED_1000 &&
speed != SPEED_100 && speed != SPEED_100 &&
speed != SPEED_10) || speed != SPEED_10) ||
(cmd->base.duplex != DUPLEX_HALF && (cmd->duplex != DUPLEX_HALF &&
cmd->base.duplex != DUPLEX_FULL))) cmd->duplex != DUPLEX_FULL)))
return -EINVAL; return -EINVAL;
/* Apply settings and restart link process. */ /* Apply settings and restart link process. */
...@@ -2682,13 +2666,13 @@ static int gem_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) ...@@ -2682,13 +2666,13 @@ static int gem_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
static const struct ethtool_ops gem_ethtool_ops = { static const struct ethtool_ops gem_ethtool_ops = {
.get_drvinfo = gem_get_drvinfo, .get_drvinfo = gem_get_drvinfo,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_settings = gem_get_settings,
.set_settings = gem_set_settings,
.nway_reset = gem_nway_reset, .nway_reset = gem_nway_reset,
.get_msglevel = gem_get_msglevel, .get_msglevel = gem_get_msglevel,
.set_msglevel = gem_set_msglevel, .set_msglevel = gem_set_msglevel,
.get_wol = gem_get_wol, .get_wol = gem_get_wol,
.set_wol = gem_set_wol, .set_wol = gem_set_wol,
.get_link_ksettings = gem_get_link_ksettings,
.set_link_ksettings = gem_set_link_ksettings,
}; };
static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
......
...@@ -1294,10 +1294,9 @@ static void happy_meal_init_rings(struct happy_meal *hp) ...@@ -1294,10 +1294,9 @@ static void happy_meal_init_rings(struct happy_meal *hp)
} }
/* hp->happy_lock must be held */ /* hp->happy_lock must be held */
static void static void happy_meal_begin_auto_negotiation(struct happy_meal *hp,
happy_meal_begin_auto_negotiation(struct happy_meal *hp, void __iomem *tregs,
void __iomem *tregs, struct ethtool_cmd *ep)
const struct ethtool_link_ksettings *ep)
{ {
int timeout; int timeout;
...@@ -1310,7 +1309,7 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, ...@@ -1310,7 +1309,7 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp,
/* XXX Check BMSR_ANEGCAPABLE, should not be necessary though. */ /* XXX Check BMSR_ANEGCAPABLE, should not be necessary though. */
hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE); hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE);
if (!ep || ep->base.autoneg == AUTONEG_ENABLE) { if (ep == NULL || ep->autoneg == AUTONEG_ENABLE) {
/* Advertise everything we can support. */ /* Advertise everything we can support. */
if (hp->sw_bmsr & BMSR_10HALF) if (hp->sw_bmsr & BMSR_10HALF)
hp->sw_advertise |= (ADVERTISE_10HALF); hp->sw_advertise |= (ADVERTISE_10HALF);
...@@ -1385,14 +1384,14 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp, ...@@ -1385,14 +1384,14 @@ happy_meal_begin_auto_negotiation(struct happy_meal *hp,
/* Disable auto-negotiation in BMCR, enable the duplex and /* Disable auto-negotiation in BMCR, enable the duplex and
* speed setting, init the timer state machine, and fire it off. * speed setting, init the timer state machine, and fire it off.
*/ */
if (!ep || ep->base.autoneg == AUTONEG_ENABLE) { if (ep == NULL || ep->autoneg == AUTONEG_ENABLE) {
hp->sw_bmcr = BMCR_SPEED100; hp->sw_bmcr = BMCR_SPEED100;
} else { } else {
if (ep->base.speed == SPEED_100) if (ethtool_cmd_speed(ep) == SPEED_100)
hp->sw_bmcr = BMCR_SPEED100; hp->sw_bmcr = BMCR_SPEED100;
else else
hp->sw_bmcr = 0; hp->sw_bmcr = 0;
if (ep->base.duplex == DUPLEX_FULL) if (ep->duplex == DUPLEX_FULL)
hp->sw_bmcr |= BMCR_FULLDPLX; hp->sw_bmcr |= BMCR_FULLDPLX;
} }
happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr);
...@@ -2435,21 +2434,20 @@ static void happy_meal_set_multicast(struct net_device *dev) ...@@ -2435,21 +2434,20 @@ static void happy_meal_set_multicast(struct net_device *dev)
} }
/* Ethtool support... */ /* Ethtool support... */
static int hme_get_link_ksettings(struct net_device *dev, static int hme_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
struct ethtool_link_ksettings *cmd)
{ {
struct happy_meal *hp = netdev_priv(dev); struct happy_meal *hp = netdev_priv(dev);
u32 speed; u32 speed;
u32 supported;
supported = cmd->supported =
(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | (SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII); SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII);
/* XXX hardcoded stuff for now */ /* XXX hardcoded stuff for now */
cmd->base.port = PORT_TP; /* XXX no MII support */ cmd->port = PORT_TP; /* XXX no MII support */
cmd->base.phy_address = 0; /* XXX fixed PHYAD */ cmd->transceiver = XCVR_INTERNAL; /* XXX no external xcvr support */
cmd->phy_address = 0; /* XXX fixed PHYAD */
/* Record PHY settings. */ /* Record PHY settings. */
spin_lock_irq(&hp->happy_lock); spin_lock_irq(&hp->happy_lock);
...@@ -2458,45 +2456,41 @@ static int hme_get_link_ksettings(struct net_device *dev, ...@@ -2458,45 +2456,41 @@ static int hme_get_link_ksettings(struct net_device *dev,
spin_unlock_irq(&hp->happy_lock); spin_unlock_irq(&hp->happy_lock);
if (hp->sw_bmcr & BMCR_ANENABLE) { if (hp->sw_bmcr & BMCR_ANENABLE) {
cmd->base.autoneg = AUTONEG_ENABLE; cmd->autoneg = AUTONEG_ENABLE;
speed = ((hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) ? speed = ((hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) ?
SPEED_100 : SPEED_10); SPEED_100 : SPEED_10);
if (speed == SPEED_100) if (speed == SPEED_100)
cmd->base.duplex = cmd->duplex =
(hp->sw_lpa & (LPA_100FULL)) ? (hp->sw_lpa & (LPA_100FULL)) ?
DUPLEX_FULL : DUPLEX_HALF; DUPLEX_FULL : DUPLEX_HALF;
else else
cmd->base.duplex = cmd->duplex =
(hp->sw_lpa & (LPA_10FULL)) ? (hp->sw_lpa & (LPA_10FULL)) ?
DUPLEX_FULL : DUPLEX_HALF; DUPLEX_FULL : DUPLEX_HALF;
} else { } else {
cmd->base.autoneg = AUTONEG_DISABLE; cmd->autoneg = AUTONEG_DISABLE;
speed = (hp->sw_bmcr & BMCR_SPEED100) ? SPEED_100 : SPEED_10; speed = (hp->sw_bmcr & BMCR_SPEED100) ? SPEED_100 : SPEED_10;
cmd->base.duplex = cmd->duplex =
(hp->sw_bmcr & BMCR_FULLDPLX) ? (hp->sw_bmcr & BMCR_FULLDPLX) ?
DUPLEX_FULL : DUPLEX_HALF; DUPLEX_FULL : DUPLEX_HALF;
} }
cmd->base.speed = speed; ethtool_cmd_speed_set(cmd, speed);
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
return 0; return 0;
} }
static int hme_set_link_ksettings(struct net_device *dev, static int hme_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
const struct ethtool_link_ksettings *cmd)
{ {
struct happy_meal *hp = netdev_priv(dev); struct happy_meal *hp = netdev_priv(dev);
/* Verify the settings we care about. */ /* Verify the settings we care about. */
if (cmd->base.autoneg != AUTONEG_ENABLE && if (cmd->autoneg != AUTONEG_ENABLE &&
cmd->base.autoneg != AUTONEG_DISABLE) cmd->autoneg != AUTONEG_DISABLE)
return -EINVAL; return -EINVAL;
if (cmd->base.autoneg == AUTONEG_DISABLE && if (cmd->autoneg == AUTONEG_DISABLE &&
((cmd->base.speed != SPEED_100 && ((ethtool_cmd_speed(cmd) != SPEED_100 &&
cmd->base.speed != SPEED_10) || ethtool_cmd_speed(cmd) != SPEED_10) ||
(cmd->base.duplex != DUPLEX_HALF && (cmd->duplex != DUPLEX_HALF &&
cmd->base.duplex != DUPLEX_FULL))) cmd->duplex != DUPLEX_FULL)))
return -EINVAL; return -EINVAL;
/* Ok, do it to it. */ /* Ok, do it to it. */
...@@ -2543,10 +2537,10 @@ static u32 hme_get_link(struct net_device *dev) ...@@ -2543,10 +2537,10 @@ static u32 hme_get_link(struct net_device *dev)
} }
static const struct ethtool_ops hme_ethtool_ops = { static const struct ethtool_ops hme_ethtool_ops = {
.get_settings = hme_get_settings,
.set_settings = hme_set_settings,
.get_drvinfo = hme_get_drvinfo, .get_drvinfo = hme_get_drvinfo,
.get_link = hme_get_link, .get_link = hme_get_link,
.get_link_ksettings = hme_get_link_ksettings,
.set_link_ksettings = hme_set_link_ksettings,
}; };
static int hme_version_printed; static int hme_version_printed;
......
...@@ -1206,68 +1206,61 @@ void gelic_net_get_drvinfo(struct net_device *netdev, ...@@ -1206,68 +1206,61 @@ void gelic_net_get_drvinfo(struct net_device *netdev,
strlcpy(info->version, DRV_VERSION, sizeof(info->version)); strlcpy(info->version, DRV_VERSION, sizeof(info->version));
} }
static int gelic_ether_get_link_ksettings(struct net_device *netdev, static int gelic_ether_get_settings(struct net_device *netdev,
struct ethtool_link_ksettings *cmd) struct ethtool_cmd *cmd)
{ {
struct gelic_card *card = netdev_card(netdev); struct gelic_card *card = netdev_card(netdev);
u32 supported, advertising;
gelic_card_get_ether_port_status(card, 0); gelic_card_get_ether_port_status(card, 0);
if (card->ether_port_status & GELIC_LV1_ETHER_FULL_DUPLEX) if (card->ether_port_status & GELIC_LV1_ETHER_FULL_DUPLEX)
cmd->base.duplex = DUPLEX_FULL; cmd->duplex = DUPLEX_FULL;
else else
cmd->base.duplex = DUPLEX_HALF; cmd->duplex = DUPLEX_HALF;
switch (card->ether_port_status & GELIC_LV1_ETHER_SPEED_MASK) { switch (card->ether_port_status & GELIC_LV1_ETHER_SPEED_MASK) {
case GELIC_LV1_ETHER_SPEED_10: case GELIC_LV1_ETHER_SPEED_10:
cmd->base.speed = SPEED_10; ethtool_cmd_speed_set(cmd, SPEED_10);
break; break;
case GELIC_LV1_ETHER_SPEED_100: case GELIC_LV1_ETHER_SPEED_100:
cmd->base.speed = SPEED_100; ethtool_cmd_speed_set(cmd, SPEED_100);
break; break;
case GELIC_LV1_ETHER_SPEED_1000: case GELIC_LV1_ETHER_SPEED_1000:
cmd->base.speed = SPEED_1000; ethtool_cmd_speed_set(cmd, SPEED_1000);
break; break;
default: default:
pr_info("%s: speed unknown\n", __func__); pr_info("%s: speed unknown\n", __func__);
cmd->base.speed = SPEED_10; ethtool_cmd_speed_set(cmd, SPEED_10);
break; break;
} }
supported = SUPPORTED_TP | SUPPORTED_Autoneg | cmd->supported = SUPPORTED_TP | SUPPORTED_Autoneg |
SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full | SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
SUPPORTED_1000baseT_Full; SUPPORTED_1000baseT_Full;
advertising = supported; cmd->advertising = cmd->supported;
if (card->link_mode & GELIC_LV1_ETHER_AUTO_NEG) { if (card->link_mode & GELIC_LV1_ETHER_AUTO_NEG) {
cmd->base.autoneg = AUTONEG_ENABLE; cmd->autoneg = AUTONEG_ENABLE;
} else { } else {
cmd->base.autoneg = AUTONEG_DISABLE; cmd->autoneg = AUTONEG_DISABLE;
advertising &= ~ADVERTISED_Autoneg; cmd->advertising &= ~ADVERTISED_Autoneg;
} }
cmd->base.port = PORT_TP; cmd->port = PORT_TP;
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
advertising);
return 0; return 0;
} }
static int static int gelic_ether_set_settings(struct net_device *netdev,
gelic_ether_set_link_ksettings(struct net_device *netdev, struct ethtool_cmd *cmd)
const struct ethtool_link_ksettings *cmd)
{ {
struct gelic_card *card = netdev_card(netdev); struct gelic_card *card = netdev_card(netdev);
u64 mode; u64 mode;
int ret; int ret;
if (cmd->base.autoneg == AUTONEG_ENABLE) { if (cmd->autoneg == AUTONEG_ENABLE) {
mode = GELIC_LV1_ETHER_AUTO_NEG; mode = GELIC_LV1_ETHER_AUTO_NEG;
} else { } else {
switch (cmd->base.speed) { switch (cmd->speed) {
case SPEED_10: case SPEED_10:
mode = GELIC_LV1_ETHER_SPEED_10; mode = GELIC_LV1_ETHER_SPEED_10;
break; break;
...@@ -1280,9 +1273,9 @@ gelic_ether_set_link_ksettings(struct net_device *netdev, ...@@ -1280,9 +1273,9 @@ gelic_ether_set_link_ksettings(struct net_device *netdev,
default: default:
return -EINVAL; return -EINVAL;
} }
if (cmd->base.duplex == DUPLEX_FULL) { if (cmd->duplex == DUPLEX_FULL)
mode |= GELIC_LV1_ETHER_FULL_DUPLEX; mode |= GELIC_LV1_ETHER_FULL_DUPLEX;
} else if (cmd->base.speed == SPEED_1000) { else if (cmd->speed == SPEED_1000) {
pr_info("1000 half duplex is not supported.\n"); pr_info("1000 half duplex is not supported.\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1377,11 +1370,11 @@ static int gelic_net_set_wol(struct net_device *netdev, ...@@ -1377,11 +1370,11 @@ static int gelic_net_set_wol(struct net_device *netdev,
static const struct ethtool_ops gelic_ether_ethtool_ops = { static const struct ethtool_ops gelic_ether_ethtool_ops = {
.get_drvinfo = gelic_net_get_drvinfo, .get_drvinfo = gelic_net_get_drvinfo,
.get_settings = gelic_ether_get_settings,
.set_settings = gelic_ether_set_settings,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_wol = gelic_net_get_wol, .get_wol = gelic_net_get_wol,
.set_wol = gelic_net_set_wol, .set_wol = gelic_net_set_wol,
.get_link_ksettings = gelic_ether_get_link_ksettings,
.set_link_ksettings = gelic_ether_set_link_ksettings,
}; };
/** /**
......
...@@ -47,23 +47,19 @@ static struct { ...@@ -47,23 +47,19 @@ static struct {
}; };
static int static int
spider_net_ethtool_get_link_ksettings(struct net_device *netdev, spider_net_ethtool_get_settings(struct net_device *netdev,
struct ethtool_link_ksettings *cmd) struct ethtool_cmd *cmd)
{ {
struct spider_net_card *card; struct spider_net_card *card;
card = netdev_priv(netdev); card = netdev_priv(netdev);
ethtool_link_ksettings_zero_link_mode(cmd, supported); cmd->supported = (SUPPORTED_1000baseT_Full |
ethtool_link_ksettings_add_link_mode(cmd, supported, 1000baseT_Full); SUPPORTED_FIBRE);
ethtool_link_ksettings_add_link_mode(cmd, supported, FIBRE); cmd->advertising = (ADVERTISED_1000baseT_Full |
ADVERTISED_FIBRE);
ethtool_link_ksettings_zero_link_mode(cmd, advertising); cmd->port = PORT_FIBRE;
ethtool_link_ksettings_add_link_mode(cmd, advertising, 1000baseT_Full); ethtool_cmd_speed_set(cmd, card->phy.speed);
ethtool_link_ksettings_add_link_mode(cmd, advertising, FIBRE); cmd->duplex = DUPLEX_FULL;
cmd->base.port = PORT_FIBRE;
cmd->base.speed = card->phy.speed;
cmd->base.duplex = DUPLEX_FULL;
return 0; return 0;
} }
...@@ -170,6 +166,7 @@ static void spider_net_get_strings(struct net_device *netdev, u32 stringset, ...@@ -170,6 +166,7 @@ static void spider_net_get_strings(struct net_device *netdev, u32 stringset,
} }
const struct ethtool_ops spider_net_ethtool_ops = { const struct ethtool_ops spider_net_ethtool_ops = {
.get_settings = spider_net_ethtool_get_settings,
.get_drvinfo = spider_net_ethtool_get_drvinfo, .get_drvinfo = spider_net_ethtool_get_drvinfo,
.get_wol = spider_net_ethtool_get_wol, .get_wol = spider_net_ethtool_get_wol,
.get_msglevel = spider_net_ethtool_get_msglevel, .get_msglevel = spider_net_ethtool_get_msglevel,
...@@ -180,6 +177,5 @@ const struct ethtool_ops spider_net_ethtool_ops = { ...@@ -180,6 +177,5 @@ const struct ethtool_ops spider_net_ethtool_ops = {
.get_strings = spider_net_get_strings, .get_strings = spider_net_get_strings,
.get_sset_count = spider_net_get_sset_count, .get_sset_count = spider_net_get_sset_count,
.get_ethtool_stats = spider_net_get_ethtool_stats, .get_ethtool_stats = spider_net_get_ethtool_stats,
.get_link_ksettings = spider_net_ethtool_get_link_ksettings,
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment