diff options
-rw-r--r-- | drivers/net/mv643xx_eth.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 34425b94452f..29605a34d4c1 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -1575,18 +1575,12 @@ mv643xx_eth_set_ringparam(struct net_device *dev, struct ethtool_ringparam *er) | |||
1575 | return 0; | 1575 | return 0; |
1576 | } | 1576 | } |
1577 | 1577 | ||
1578 | static u32 | ||
1579 | mv643xx_eth_get_rx_csum(struct net_device *dev) | ||
1580 | { | ||
1581 | struct mv643xx_eth_private *mp = netdev_priv(dev); | ||
1582 | |||
1583 | return !!(rdlp(mp, PORT_CONFIG) & 0x02000000); | ||
1584 | } | ||
1585 | 1578 | ||
1586 | static int | 1579 | static int |
1587 | mv643xx_eth_set_rx_csum(struct net_device *dev, u32 rx_csum) | 1580 | mv643xx_eth_set_features(struct net_device *dev, u32 features) |
1588 | { | 1581 | { |
1589 | struct mv643xx_eth_private *mp = netdev_priv(dev); | 1582 | struct mv643xx_eth_private *mp = netdev_priv(dev); |
1583 | u32 rx_csum = features & NETIF_F_RXCSUM; | ||
1590 | 1584 | ||
1591 | wrlp(mp, PORT_CONFIG, rx_csum ? 0x02000000 : 0x00000000); | 1585 | wrlp(mp, PORT_CONFIG, rx_csum ? 0x02000000 : 0x00000000); |
1592 | 1586 | ||
@@ -1634,11 +1628,6 @@ static void mv643xx_eth_get_ethtool_stats(struct net_device *dev, | |||
1634 | } | 1628 | } |
1635 | } | 1629 | } |
1636 | 1630 | ||
1637 | static int mv643xx_eth_set_flags(struct net_device *dev, u32 data) | ||
1638 | { | ||
1639 | return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO); | ||
1640 | } | ||
1641 | |||
1642 | static int mv643xx_eth_get_sset_count(struct net_device *dev, int sset) | 1631 | static int mv643xx_eth_get_sset_count(struct net_device *dev, int sset) |
1643 | { | 1632 | { |
1644 | if (sset == ETH_SS_STATS) | 1633 | if (sset == ETH_SS_STATS) |
@@ -1657,14 +1646,8 @@ static const struct ethtool_ops mv643xx_eth_ethtool_ops = { | |||
1657 | .set_coalesce = mv643xx_eth_set_coalesce, | 1646 | .set_coalesce = mv643xx_eth_set_coalesce, |
1658 | .get_ringparam = mv643xx_eth_get_ringparam, | 1647 | .get_ringparam = mv643xx_eth_get_ringparam, |
1659 | .set_ringparam = mv643xx_eth_set_ringparam, | 1648 | .set_ringparam = mv643xx_eth_set_ringparam, |
1660 | .get_rx_csum = mv643xx_eth_get_rx_csum, | ||
1661 | .set_rx_csum = mv643xx_eth_set_rx_csum, | ||
1662 | .set_tx_csum = ethtool_op_set_tx_csum, | ||
1663 | .set_sg = ethtool_op_set_sg, | ||
1664 | .get_strings = mv643xx_eth_get_strings, | 1649 | .get_strings = mv643xx_eth_get_strings, |
1665 | .get_ethtool_stats = mv643xx_eth_get_ethtool_stats, | 1650 | .get_ethtool_stats = mv643xx_eth_get_ethtool_stats, |
1666 | .get_flags = ethtool_op_get_flags, | ||
1667 | .set_flags = mv643xx_eth_set_flags, | ||
1668 | .get_sset_count = mv643xx_eth_get_sset_count, | 1651 | .get_sset_count = mv643xx_eth_get_sset_count, |
1669 | }; | 1652 | }; |
1670 | 1653 | ||
@@ -2264,7 +2247,7 @@ static void port_start(struct mv643xx_eth_private *mp) | |||
2264 | * frames to RX queue #0, and include the pseudo-header when | 2247 | * frames to RX queue #0, and include the pseudo-header when |
2265 | * calculating receive checksums. | 2248 | * calculating receive checksums. |
2266 | */ | 2249 | */ |
2267 | wrlp(mp, PORT_CONFIG, 0x02000000); | 2250 | mv643xx_eth_set_features(dev, dev->features); |
2268 | 2251 | ||
2269 | /* | 2252 | /* |
2270 | * Treat BPDUs as normal multicasts, and disable partition mode. | 2253 | * Treat BPDUs as normal multicasts, and disable partition mode. |
@@ -2848,6 +2831,7 @@ static const struct net_device_ops mv643xx_eth_netdev_ops = { | |||
2848 | .ndo_validate_addr = eth_validate_addr, | 2831 | .ndo_validate_addr = eth_validate_addr, |
2849 | .ndo_do_ioctl = mv643xx_eth_ioctl, | 2832 | .ndo_do_ioctl = mv643xx_eth_ioctl, |
2850 | .ndo_change_mtu = mv643xx_eth_change_mtu, | 2833 | .ndo_change_mtu = mv643xx_eth_change_mtu, |
2834 | .ndo_set_features = mv643xx_eth_set_features, | ||
2851 | .ndo_tx_timeout = mv643xx_eth_tx_timeout, | 2835 | .ndo_tx_timeout = mv643xx_eth_tx_timeout, |
2852 | .ndo_get_stats = mv643xx_eth_get_stats, | 2836 | .ndo_get_stats = mv643xx_eth_get_stats, |
2853 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2837 | #ifdef CONFIG_NET_POLL_CONTROLLER |
@@ -2930,7 +2914,9 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
2930 | dev->watchdog_timeo = 2 * HZ; | 2914 | dev->watchdog_timeo = 2 * HZ; |
2931 | dev->base_addr = 0; | 2915 | dev->base_addr = 0; |
2932 | 2916 | ||
2933 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM; | 2917 | dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | |
2918 | NETIF_F_RXCSUM | NETIF_F_LRO; | ||
2919 | dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM; | ||
2934 | dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM; | 2920 | dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM; |
2935 | 2921 | ||
2936 | SET_NETDEV_DEV(dev, &pdev->dev); | 2922 | SET_NETDEV_DEV(dev, &pdev->dev); |