diff options
Diffstat (limited to 'drivers/net/via-velocity.c')
-rw-r--r-- | drivers/net/via-velocity.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 8e5d82051bd4..25b75b615188 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1339,7 +1339,8 @@ static inline int velocity_rx_copy(struct sk_buff **rx_skb, int pkt_size, | |||
1339 | if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) | 1339 | if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) |
1340 | skb_reserve(new_skb, 2); | 1340 | skb_reserve(new_skb, 2); |
1341 | 1341 | ||
1342 | memcpy(new_skb->data, rx_skb[0]->data, pkt_size); | 1342 | skb_copy_from_linear_data(rx_skb[0], new_skb->data, |
1343 | pkt_size); | ||
1343 | *rx_skb = new_skb; | 1344 | *rx_skb = new_skb; |
1344 | ret = 0; | 1345 | ret = 0; |
1345 | } | 1346 | } |
@@ -1398,7 +1399,6 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx) | |||
1398 | vptr->stats.multicast++; | 1399 | vptr->stats.multicast++; |
1399 | 1400 | ||
1400 | skb = rd_info->skb; | 1401 | skb = rd_info->skb; |
1401 | skb->dev = vptr->dev; | ||
1402 | 1402 | ||
1403 | pci_dma_sync_single_for_cpu(vptr->pdev, rd_info->skb_dma, | 1403 | pci_dma_sync_single_for_cpu(vptr->pdev, rd_info->skb_dma, |
1404 | vptr->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1404 | vptr->rx_buf_sz, PCI_DMA_FROMDEVICE); |
@@ -1428,7 +1428,7 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx) | |||
1428 | PCI_DMA_FROMDEVICE); | 1428 | PCI_DMA_FROMDEVICE); |
1429 | 1429 | ||
1430 | skb_put(skb, pkt_len - 4); | 1430 | skb_put(skb, pkt_len - 4); |
1431 | skb->protocol = eth_type_trans(skb, skb->dev); | 1431 | skb->protocol = eth_type_trans(skb, vptr->dev); |
1432 | 1432 | ||
1433 | stats->rx_bytes += pkt_len; | 1433 | stats->rx_bytes += pkt_len; |
1434 | netif_rx(skb); | 1434 | netif_rx(skb); |
@@ -1928,7 +1928,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1928 | if (pktlen < ETH_ZLEN) { | 1928 | if (pktlen < ETH_ZLEN) { |
1929 | /* Cannot occur until ZC support */ | 1929 | /* Cannot occur until ZC support */ |
1930 | pktlen = ETH_ZLEN; | 1930 | pktlen = ETH_ZLEN; |
1931 | memcpy(tdinfo->buf, skb->data, skb->len); | 1931 | skb_copy_from_linear_data(skb, tdinfo->buf, skb->len); |
1932 | memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len); | 1932 | memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len); |
1933 | tdinfo->skb = skb; | 1933 | tdinfo->skb = skb; |
1934 | tdinfo->skb_dma[0] = tdinfo->buf_dma; | 1934 | tdinfo->skb_dma[0] = tdinfo->buf_dma; |
@@ -1944,7 +1944,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1944 | int nfrags = skb_shinfo(skb)->nr_frags; | 1944 | int nfrags = skb_shinfo(skb)->nr_frags; |
1945 | tdinfo->skb = skb; | 1945 | tdinfo->skb = skb; |
1946 | if (nfrags > 6) { | 1946 | if (nfrags > 6) { |
1947 | memcpy(tdinfo->buf, skb->data, skb->len); | 1947 | skb_copy_from_linear_data(skb, tdinfo->buf, skb->len); |
1948 | tdinfo->skb_dma[0] = tdinfo->buf_dma; | 1948 | tdinfo->skb_dma[0] = tdinfo->buf_dma; |
1949 | td_ptr->tdesc0.pktsize = | 1949 | td_ptr->tdesc0.pktsize = |
1950 | td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]); | 1950 | td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]); |
@@ -2007,7 +2007,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2007 | */ | 2007 | */ |
2008 | if ((vptr->flags & VELOCITY_FLAGS_TX_CSUM) | 2008 | if ((vptr->flags & VELOCITY_FLAGS_TX_CSUM) |
2009 | && (skb->ip_summed == CHECKSUM_PARTIAL)) { | 2009 | && (skb->ip_summed == CHECKSUM_PARTIAL)) { |
2010 | struct iphdr *ip = skb->nh.iph; | 2010 | const struct iphdr *ip = ip_hdr(skb); |
2011 | if (ip->protocol == IPPROTO_TCP) | 2011 | if (ip->protocol == IPPROTO_TCP) |
2012 | td_ptr->tdesc1.TCR |= TCR0_TCPCK; | 2012 | td_ptr->tdesc1.TCR |= TCR0_TCPCK; |
2013 | else if (ip->protocol == IPPROTO_UDP) | 2013 | else if (ip->protocol == IPPROTO_UDP) |