diff options
Diffstat (limited to 'drivers/net/ioc3-eth.c')
-rw-r--r-- | drivers/net/ioc3-eth.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index 4ad780719a84..f749e07c6425 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c | |||
@@ -633,8 +633,6 @@ static inline void ioc3_rx(struct ioc3_private *ip) | |||
633 | 633 | ||
634 | ip->rx_skbs[rx_entry] = NULL; /* Poison */ | 634 | ip->rx_skbs[rx_entry] = NULL; /* Poison */ |
635 | 635 | ||
636 | new_skb->dev = priv_netdev(ip); | ||
637 | |||
638 | /* Because we reserve afterwards. */ | 636 | /* Because we reserve afterwards. */ |
639 | skb_put(new_skb, (1664 + RX_OFFSET)); | 637 | skb_put(new_skb, (1664 + RX_OFFSET)); |
640 | rxb = (struct ioc3_erxbuf *) new_skb->data; | 638 | rxb = (struct ioc3_erxbuf *) new_skb->data; |
@@ -940,7 +938,6 @@ static void ioc3_alloc_rings(struct net_device *dev) | |||
940 | } | 938 | } |
941 | 939 | ||
942 | ip->rx_skbs[i] = skb; | 940 | ip->rx_skbs[i] = skb; |
943 | skb->dev = dev; | ||
944 | 941 | ||
945 | /* Because we reserve afterwards. */ | 942 | /* Because we reserve afterwards. */ |
946 | skb_put(skb, (1664 + RX_OFFSET)); | 943 | skb_put(skb, (1664 + RX_OFFSET)); |
@@ -1396,9 +1393,9 @@ static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1396 | * manually. | 1393 | * manually. |
1397 | */ | 1394 | */ |
1398 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1395 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1399 | int proto = ntohs(skb->nh.iph->protocol); | 1396 | const struct iphdr *ih = ip_hdr(skb); |
1397 | const int proto = ntohs(ih->protocol); | ||
1400 | unsigned int csoff; | 1398 | unsigned int csoff; |
1401 | struct iphdr *ih = skb->nh.iph; | ||
1402 | uint32_t csum, ehsum; | 1399 | uint32_t csum, ehsum; |
1403 | uint16_t *eh; | 1400 | uint16_t *eh; |
1404 | 1401 | ||
@@ -1425,11 +1422,11 @@ static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1425 | csoff = ETH_HLEN + (ih->ihl << 2); | 1422 | csoff = ETH_HLEN + (ih->ihl << 2); |
1426 | if (proto == IPPROTO_UDP) { | 1423 | if (proto == IPPROTO_UDP) { |
1427 | csoff += offsetof(struct udphdr, check); | 1424 | csoff += offsetof(struct udphdr, check); |
1428 | skb->h.uh->check = csum; | 1425 | udp_hdr(skb)->check = csum; |
1429 | } | 1426 | } |
1430 | if (proto == IPPROTO_TCP) { | 1427 | if (proto == IPPROTO_TCP) { |
1431 | csoff += offsetof(struct tcphdr, check); | 1428 | csoff += offsetof(struct tcphdr, check); |
1432 | skb->h.th->check = csum; | 1429 | tcp_hdr(skb)->check = csum; |
1433 | } | 1430 | } |
1434 | 1431 | ||
1435 | w0 = ETXD_DOCHECKSUM | (csoff << ETXD_CHKOFF_SHIFT); | 1432 | w0 = ETXD_DOCHECKSUM | (csoff << ETXD_CHKOFF_SHIFT); |
@@ -1446,7 +1443,7 @@ static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1446 | 1443 | ||
1447 | if (len <= 104) { | 1444 | if (len <= 104) { |
1448 | /* Short packet, let's copy it directly into the ring. */ | 1445 | /* Short packet, let's copy it directly into the ring. */ |
1449 | memcpy(desc->data, skb->data, skb->len); | 1446 | skb_copy_from_linear_data(skb, desc->data, skb->len); |
1450 | if (len < ETH_ZLEN) { | 1447 | if (len < ETH_ZLEN) { |
1451 | /* Very short packet, pad with zeros at the end. */ | 1448 | /* Very short packet, pad with zeros at the end. */ |
1452 | memset(desc->data + len, 0, ETH_ZLEN - len); | 1449 | memset(desc->data + len, 0, ETH_ZLEN - len); |