diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/sc92031.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/sc92031.c')
-rw-r--r-- | drivers/net/sc92031.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c index 8c4067af32b0..fa74314ef789 100644 --- a/drivers/net/sc92031.c +++ b/drivers/net/sc92031.c | |||
@@ -15,7 +15,7 @@ | |||
15 | * Rewritten for 2.6 by Cesar Eduardo Barros | 15 | * Rewritten for 2.6 by Cesar Eduardo Barros |
16 | * | 16 | * |
17 | * A datasheet for this chip can be found at | 17 | * A datasheet for this chip can be found at |
18 | * http://www.silan.com.cn/english/products/pdf/SC92031AY.pdf | 18 | * http://www.silan.com.cn/english/product/pdf/SC92031AY.pdf |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* Note about set_mac_address: I don't know how to change the hardware | 21 | /* Note about set_mac_address: I don't know how to change the hardware |
@@ -1173,7 +1173,8 @@ static int sc92031_ethtool_get_settings(struct net_device *dev, | |||
1173 | if (phy_ctrl & PhyCtrlAne) | 1173 | if (phy_ctrl & PhyCtrlAne) |
1174 | cmd->advertising |= ADVERTISED_Autoneg; | 1174 | cmd->advertising |= ADVERTISED_Autoneg; |
1175 | 1175 | ||
1176 | cmd->speed = (output_status & 0x2) ? SPEED_100 : SPEED_10; | 1176 | ethtool_cmd_speed_set(cmd, |
1177 | (output_status & 0x2) ? SPEED_100 : SPEED_10); | ||
1177 | cmd->duplex = (output_status & 0x4) ? DUPLEX_FULL : DUPLEX_HALF; | 1178 | cmd->duplex = (output_status & 0x4) ? DUPLEX_FULL : DUPLEX_HALF; |
1178 | cmd->port = PORT_MII; | 1179 | cmd->port = PORT_MII; |
1179 | cmd->phy_address = phy_address; | 1180 | cmd->phy_address = phy_address; |
@@ -1188,10 +1189,11 @@ static int sc92031_ethtool_set_settings(struct net_device *dev, | |||
1188 | { | 1189 | { |
1189 | struct sc92031_priv *priv = netdev_priv(dev); | 1190 | struct sc92031_priv *priv = netdev_priv(dev); |
1190 | void __iomem *port_base = priv->port_base; | 1191 | void __iomem *port_base = priv->port_base; |
1192 | u32 speed = ethtool_cmd_speed(cmd); | ||
1191 | u32 phy_ctrl; | 1193 | u32 phy_ctrl; |
1192 | u32 old_phy_ctrl; | 1194 | u32 old_phy_ctrl; |
1193 | 1195 | ||
1194 | if (!(cmd->speed == SPEED_10 || cmd->speed == SPEED_100)) | 1196 | if (!(speed == SPEED_10 || speed == SPEED_100)) |
1195 | return -EINVAL; | 1197 | return -EINVAL; |
1196 | if (!(cmd->duplex == DUPLEX_HALF || cmd->duplex == DUPLEX_FULL)) | 1198 | if (!(cmd->duplex == DUPLEX_HALF || cmd->duplex == DUPLEX_FULL)) |
1197 | return -EINVAL; | 1199 | return -EINVAL; |
@@ -1229,7 +1231,7 @@ static int sc92031_ethtool_set_settings(struct net_device *dev, | |||
1229 | // FIXME: Whole branch guessed | 1231 | // FIXME: Whole branch guessed |
1230 | phy_ctrl = 0; | 1232 | phy_ctrl = 0; |
1231 | 1233 | ||
1232 | if (cmd->speed == SPEED_10) | 1234 | if (speed == SPEED_10) |
1233 | phy_ctrl |= PhyCtrlSpd10; | 1235 | phy_ctrl |= PhyCtrlSpd10; |
1234 | else /* cmd->speed == SPEED_100 */ | 1236 | else /* cmd->speed == SPEED_100 */ |
1235 | phy_ctrl |= PhyCtrlSpd100; | 1237 | phy_ctrl |= PhyCtrlSpd100; |
@@ -1251,16 +1253,6 @@ static int sc92031_ethtool_set_settings(struct net_device *dev, | |||
1251 | return 0; | 1253 | return 0; |
1252 | } | 1254 | } |
1253 | 1255 | ||
1254 | static void sc92031_ethtool_get_drvinfo(struct net_device *dev, | ||
1255 | struct ethtool_drvinfo *drvinfo) | ||
1256 | { | ||
1257 | struct sc92031_priv *priv = netdev_priv(dev); | ||
1258 | struct pci_dev *pdev = priv->pdev; | ||
1259 | |||
1260 | strcpy(drvinfo->driver, SC92031_NAME); | ||
1261 | strcpy(drvinfo->bus_info, pci_name(pdev)); | ||
1262 | } | ||
1263 | |||
1264 | static void sc92031_ethtool_get_wol(struct net_device *dev, | 1256 | static void sc92031_ethtool_get_wol(struct net_device *dev, |
1265 | struct ethtool_wolinfo *wolinfo) | 1257 | struct ethtool_wolinfo *wolinfo) |
1266 | { | 1258 | { |
@@ -1382,7 +1374,6 @@ static void sc92031_ethtool_get_ethtool_stats(struct net_device *dev, | |||
1382 | static const struct ethtool_ops sc92031_ethtool_ops = { | 1374 | static const struct ethtool_ops sc92031_ethtool_ops = { |
1383 | .get_settings = sc92031_ethtool_get_settings, | 1375 | .get_settings = sc92031_ethtool_get_settings, |
1384 | .set_settings = sc92031_ethtool_set_settings, | 1376 | .set_settings = sc92031_ethtool_set_settings, |
1385 | .get_drvinfo = sc92031_ethtool_get_drvinfo, | ||
1386 | .get_wol = sc92031_ethtool_get_wol, | 1377 | .get_wol = sc92031_ethtool_get_wol, |
1387 | .set_wol = sc92031_ethtool_set_wol, | 1378 | .set_wol = sc92031_ethtool_set_wol, |
1388 | .nway_reset = sc92031_ethtool_nway_reset, | 1379 | .nway_reset = sc92031_ethtool_nway_reset, |
@@ -1460,7 +1451,8 @@ static int __devinit sc92031_probe(struct pci_dev *pdev, | |||
1460 | dev->irq = pdev->irq; | 1451 | dev->irq = pdev->irq; |
1461 | 1452 | ||
1462 | /* faked with skb_copy_and_csum_dev */ | 1453 | /* faked with skb_copy_and_csum_dev */ |
1463 | dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA; | 1454 | dev->features = NETIF_F_SG | NETIF_F_HIGHDMA | |
1455 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | ||
1464 | 1456 | ||
1465 | dev->netdev_ops = &sc92031_netdev_ops; | 1457 | dev->netdev_ops = &sc92031_netdev_ops; |
1466 | dev->watchdog_timeo = TX_TIMEOUT; | 1458 | dev->watchdog_timeo = TX_TIMEOUT; |