diff options
Diffstat (limited to 'drivers/net/meth.c')
-rw-r--r-- | drivers/net/meth.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/meth.c b/drivers/net/meth.c index 7e69ca6edd91..0343ea12b299 100644 --- a/drivers/net/meth.c +++ b/drivers/net/meth.c | |||
@@ -421,7 +421,6 @@ static void meth_rx(struct net_device* dev, unsigned long int_status) | |||
421 | /* Write metadata, and then pass to the receive level */ | 421 | /* Write metadata, and then pass to the receive level */ |
422 | skb_put(skb_c, len); | 422 | skb_put(skb_c, len); |
423 | priv->rx_skbs[priv->rx_write] = skb; | 423 | priv->rx_skbs[priv->rx_write] = skb; |
424 | skb_c->dev = dev; | ||
425 | skb_c->protocol = eth_type_trans(skb_c, dev); | 424 | skb_c->protocol = eth_type_trans(skb_c, dev); |
426 | dev->last_rx = jiffies; | 425 | dev->last_rx = jiffies; |
427 | priv->stats.rx_packets++; | 426 | priv->stats.rx_packets++; |
@@ -609,7 +608,7 @@ static void meth_tx_short_prepare(struct meth_private *priv, | |||
609 | 608 | ||
610 | desc->header.raw = METH_TX_CMD_INT_EN | (len-1) | ((128-len) << 16); | 609 | desc->header.raw = METH_TX_CMD_INT_EN | (len-1) | ((128-len) << 16); |
611 | /* maybe I should set whole thing to 0 first... */ | 610 | /* maybe I should set whole thing to 0 first... */ |
612 | memcpy(desc->data.dt + (120 - len), skb->data, skb->len); | 611 | skb_copy_from_linear_data(skb, desc->data.dt + (120 - len), skb->len); |
613 | if (skb->len < len) | 612 | if (skb->len < len) |
614 | memset(desc->data.dt + 120 - len + skb->len, 0, len-skb->len); | 613 | memset(desc->data.dt + 120 - len + skb->len, 0, len-skb->len); |
615 | } | 614 | } |
@@ -627,8 +626,8 @@ static void meth_tx_1page_prepare(struct meth_private *priv, | |||
627 | 626 | ||
628 | /* unaligned part */ | 627 | /* unaligned part */ |
629 | if (unaligned_len) { | 628 | if (unaligned_len) { |
630 | memcpy(desc->data.dt + (120 - unaligned_len), | 629 | skb_copy_from_linear_data(skb, desc->data.dt + (120 - unaligned_len), |
631 | skb->data, unaligned_len); | 630 | unaligned_len); |
632 | desc->header.raw |= (128 - unaligned_len) << 16; | 631 | desc->header.raw |= (128 - unaligned_len) << 16; |
633 | } | 632 | } |
634 | 633 | ||
@@ -653,8 +652,8 @@ static void meth_tx_2page_prepare(struct meth_private *priv, | |||
653 | desc->header.raw = METH_TX_CMD_INT_EN | TX_CATBUF1 | TX_CATBUF2| (skb->len - 1); | 652 | desc->header.raw = METH_TX_CMD_INT_EN | TX_CATBUF1 | TX_CATBUF2| (skb->len - 1); |
654 | /* unaligned part */ | 653 | /* unaligned part */ |
655 | if (unaligned_len){ | 654 | if (unaligned_len){ |
656 | memcpy(desc->data.dt + (120 - unaligned_len), | 655 | skb_copy_from_linear_data(skb, desc->data.dt + (120 - unaligned_len), |
657 | skb->data, unaligned_len); | 656 | unaligned_len); |
658 | desc->header.raw |= (128 - unaligned_len) << 16; | 657 | desc->header.raw |= (128 - unaligned_len) << 16; |
659 | } | 658 | } |
660 | 659 | ||