diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-03-30 21:01:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-07 23:15:49 -0400 |
commit | e92702b1046a418a562878b22f92433517760921 (patch) | |
tree | 656800b9614b9377f08070b49c1e5dad2b68e015 | |
parent | 57841869197831542f25c739beaeab4465977878 (diff) |
skge: convert to hw_features
just IP_CSUM. This needs testing and so is not changed here.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/skge.c | 53 | ||||
-rw-r--r-- | drivers/net/skge.h | 1 |
2 files changed, 5 insertions, 49 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index e579ff7579ad..310dcbce2519 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -537,46 +537,6 @@ static int skge_nway_reset(struct net_device *dev) | |||
537 | return 0; | 537 | return 0; |
538 | } | 538 | } |
539 | 539 | ||
540 | static int skge_set_sg(struct net_device *dev, u32 data) | ||
541 | { | ||
542 | struct skge_port *skge = netdev_priv(dev); | ||
543 | struct skge_hw *hw = skge->hw; | ||
544 | |||
545 | if (hw->chip_id == CHIP_ID_GENESIS && data) | ||
546 | return -EOPNOTSUPP; | ||
547 | return ethtool_op_set_sg(dev, data); | ||
548 | } | ||
549 | |||
550 | static int skge_set_tx_csum(struct net_device *dev, u32 data) | ||
551 | { | ||
552 | struct skge_port *skge = netdev_priv(dev); | ||
553 | struct skge_hw *hw = skge->hw; | ||
554 | |||
555 | if (hw->chip_id == CHIP_ID_GENESIS && data) | ||
556 | return -EOPNOTSUPP; | ||
557 | |||
558 | return ethtool_op_set_tx_csum(dev, data); | ||
559 | } | ||
560 | |||
561 | static u32 skge_get_rx_csum(struct net_device *dev) | ||
562 | { | ||
563 | struct skge_port *skge = netdev_priv(dev); | ||
564 | |||
565 | return skge->rx_csum; | ||
566 | } | ||
567 | |||
568 | /* Only Yukon supports checksum offload. */ | ||
569 | static int skge_set_rx_csum(struct net_device *dev, u32 data) | ||
570 | { | ||
571 | struct skge_port *skge = netdev_priv(dev); | ||
572 | |||
573 | if (skge->hw->chip_id == CHIP_ID_GENESIS && data) | ||
574 | return -EOPNOTSUPP; | ||
575 | |||
576 | skge->rx_csum = data; | ||
577 | return 0; | ||
578 | } | ||
579 | |||
580 | static void skge_get_pauseparam(struct net_device *dev, | 540 | static void skge_get_pauseparam(struct net_device *dev, |
581 | struct ethtool_pauseparam *ecmd) | 541 | struct ethtool_pauseparam *ecmd) |
582 | { | 542 | { |
@@ -924,10 +884,6 @@ static const struct ethtool_ops skge_ethtool_ops = { | |||
924 | .set_pauseparam = skge_set_pauseparam, | 884 | .set_pauseparam = skge_set_pauseparam, |
925 | .get_coalesce = skge_get_coalesce, | 885 | .get_coalesce = skge_get_coalesce, |
926 | .set_coalesce = skge_set_coalesce, | 886 | .set_coalesce = skge_set_coalesce, |
927 | .set_sg = skge_set_sg, | ||
928 | .set_tx_csum = skge_set_tx_csum, | ||
929 | .get_rx_csum = skge_get_rx_csum, | ||
930 | .set_rx_csum = skge_set_rx_csum, | ||
931 | .get_strings = skge_get_strings, | 887 | .get_strings = skge_get_strings, |
932 | .set_phys_id = skge_set_phys_id, | 888 | .set_phys_id = skge_set_phys_id, |
933 | .get_sset_count = skge_get_sset_count, | 889 | .get_sset_count = skge_get_sset_count, |
@@ -3084,7 +3040,8 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, | |||
3084 | } | 3040 | } |
3085 | 3041 | ||
3086 | skb_put(skb, len); | 3042 | skb_put(skb, len); |
3087 | if (skge->rx_csum) { | 3043 | |
3044 | if (dev->features & NETIF_F_RXCSUM) { | ||
3088 | skb->csum = csum; | 3045 | skb->csum = csum; |
3089 | skb->ip_summed = CHECKSUM_COMPLETE; | 3046 | skb->ip_summed = CHECKSUM_COMPLETE; |
3090 | } | 3047 | } |
@@ -3846,10 +3803,10 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port, | |||
3846 | setup_timer(&skge->link_timer, xm_link_timer, (unsigned long) skge); | 3803 | setup_timer(&skge->link_timer, xm_link_timer, (unsigned long) skge); |
3847 | 3804 | ||
3848 | if (hw->chip_id != CHIP_ID_GENESIS) { | 3805 | if (hw->chip_id != CHIP_ID_GENESIS) { |
3849 | dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; | 3806 | dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG | |
3850 | skge->rx_csum = 1; | 3807 | NETIF_F_RXCSUM; |
3808 | dev->features |= dev->hw_features; | ||
3851 | } | 3809 | } |
3852 | dev->features |= NETIF_F_GRO; | ||
3853 | 3810 | ||
3854 | /* read the mac address */ | 3811 | /* read the mac address */ |
3855 | memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port*8, ETH_ALEN); | 3812 | memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port*8, ETH_ALEN); |
diff --git a/drivers/net/skge.h b/drivers/net/skge.h index 507addcaffa3..f055c47de47e 100644 --- a/drivers/net/skge.h +++ b/drivers/net/skge.h | |||
@@ -2460,7 +2460,6 @@ struct skge_port { | |||
2460 | struct timer_list link_timer; | 2460 | struct timer_list link_timer; |
2461 | enum pause_control flow_control; | 2461 | enum pause_control flow_control; |
2462 | enum pause_status flow_status; | 2462 | enum pause_status flow_status; |
2463 | u8 rx_csum; | ||
2464 | u8 blink_on; | 2463 | u8 blink_on; |
2465 | u8 wol; | 2464 | u8 wol; |
2466 | u8 autoneg; /* AUTONEG_ENABLE, AUTONEG_DISABLE */ | 2465 | u8 autoneg; /* AUTONEG_ENABLE, AUTONEG_DISABLE */ |