aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-06-11 14:35:23 -0400
committerJeff Garzik <jeff@garzik.org>2007-06-20 19:09:33 -0400
commit3a2c892daaf54b31a70785c2821771e8094188ed (patch)
tree36ff4915ef938d70a398c282d7628a26126c43fb /drivers
parent128c6e2e519fe7d0a15de04f3dde00700145cec4 (diff)
spidernet: checksum and ethtool
It doesn't look like spidernet hardware can really checksum all protocols, the code looks like it does IPV4 only. If so, it should use NETIF_F_IP_CSUM instead of NETIF_F_HW_CSUM. The driver doesn't need it's own get/set for ethtool tx csum, and it should use the standard ethtool_op_get_link. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/spider_net.c4
-rw-r--r--drivers/net/spider_net_ethtool.c21
2 files changed, 5 insertions, 20 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 0e79bacd7870..7a4aa6a9f949 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -718,7 +718,7 @@ spider_net_prepare_tx_descr(struct spider_net_card *card,
718 SPIDER_NET_DESCR_CARDOWNED | SPIDER_NET_DMAC_NOCS; 718 SPIDER_NET_DESCR_CARDOWNED | SPIDER_NET_DMAC_NOCS;
719 spin_unlock_irqrestore(&chain->lock, flags); 719 spin_unlock_irqrestore(&chain->lock, flags);
720 720
721 if (skb->protocol == htons(ETH_P_IP) && skb->ip_summed == CHECKSUM_PARTIAL) 721 if (skb->ip_summed == CHECKSUM_PARTIAL)
722 switch (ip_hdr(skb)->protocol) { 722 switch (ip_hdr(skb)->protocol) {
723 case IPPROTO_TCP: 723 case IPPROTO_TCP:
724 hwdescr->dmac_cmd_status |= SPIDER_NET_DMAC_TCP; 724 hwdescr->dmac_cmd_status |= SPIDER_NET_DMAC_TCP;
@@ -2260,7 +2260,7 @@ spider_net_setup_netdev(struct spider_net_card *card)
2260 2260
2261 spider_net_setup_netdev_ops(netdev); 2261 spider_net_setup_netdev_ops(netdev);
2262 2262
2263 netdev->features = NETIF_F_HW_CSUM | NETIF_F_LLTX; 2263 netdev->features = NETIF_F_IP_CSUM | NETIF_F_LLTX;
2264 /* some time: NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | 2264 /* some time: NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX |
2265 * NETIF_F_HW_VLAN_FILTER */ 2265 * NETIF_F_HW_VLAN_FILTER */
2266 2266
diff --git a/drivers/net/spider_net_ethtool.c b/drivers/net/spider_net_ethtool.c
index 6bcf03fc89be..d940474e024a 100644
--- a/drivers/net/spider_net_ethtool.c
+++ b/drivers/net/spider_net_ethtool.c
@@ -134,22 +134,6 @@ spider_net_ethtool_set_rx_csum(struct net_device *netdev, u32 n)
134 return 0; 134 return 0;
135} 135}
136 136
137static uint32_t
138spider_net_ethtool_get_tx_csum(struct net_device *netdev)
139{
140 return (netdev->features & NETIF_F_HW_CSUM) != 0;
141}
142
143static int
144spider_net_ethtool_set_tx_csum(struct net_device *netdev, uint32_t data)
145{
146 if (data)
147 netdev->features |= NETIF_F_HW_CSUM;
148 else
149 netdev->features &= ~NETIF_F_HW_CSUM;
150
151 return 0;
152}
153 137
154static void 138static void
155spider_net_ethtool_get_ringparam(struct net_device *netdev, 139spider_net_ethtool_get_ringparam(struct net_device *netdev,
@@ -200,11 +184,12 @@ const struct ethtool_ops spider_net_ethtool_ops = {
200 .get_wol = spider_net_ethtool_get_wol, 184 .get_wol = spider_net_ethtool_get_wol,
201 .get_msglevel = spider_net_ethtool_get_msglevel, 185 .get_msglevel = spider_net_ethtool_get_msglevel,
202 .set_msglevel = spider_net_ethtool_set_msglevel, 186 .set_msglevel = spider_net_ethtool_set_msglevel,
187 .get_link = ethtool_op_get_link,
203 .nway_reset = spider_net_ethtool_nway_reset, 188 .nway_reset = spider_net_ethtool_nway_reset,
204 .get_rx_csum = spider_net_ethtool_get_rx_csum, 189 .get_rx_csum = spider_net_ethtool_get_rx_csum,
205 .set_rx_csum = spider_net_ethtool_set_rx_csum, 190 .set_rx_csum = spider_net_ethtool_set_rx_csum,
206 .get_tx_csum = spider_net_ethtool_get_tx_csum, 191 .get_tx_csum = ethtool_op_get_tx_csum,
207 .set_tx_csum = spider_net_ethtool_set_tx_csum, 192 .set_tx_csum = ethtool_op_set_tx_csum,
208 .get_ringparam = spider_net_ethtool_get_ringparam, 193 .get_ringparam = spider_net_ethtool_get_ringparam,
209 .get_strings = spider_net_get_strings, 194 .get_strings = spider_net_get_strings,
210 .get_stats_count = spider_net_get_stats_count, 195 .get_stats_count = spider_net_get_stats_count,