diff options
Diffstat (limited to 'drivers/net/via-velocity.c')
-rw-r--r-- | drivers/net/via-velocity.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 6b8d882d197b..bcbf2fa9b94a 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -1495,24 +1495,18 @@ static inline void velocity_rx_csum(struct rx_desc *rd, struct sk_buff *skb) | |||
1495 | * enough. This function returns a negative value if the received | 1495 | * enough. This function returns a negative value if the received |
1496 | * packet is too big or if memory is exhausted. | 1496 | * packet is too big or if memory is exhausted. |
1497 | */ | 1497 | */ |
1498 | static inline int velocity_rx_copy(struct sk_buff **rx_skb, int pkt_size, | 1498 | static int velocity_rx_copy(struct sk_buff **rx_skb, int pkt_size, |
1499 | struct velocity_info *vptr) | 1499 | struct velocity_info *vptr) |
1500 | { | 1500 | { |
1501 | int ret = -1; | 1501 | int ret = -1; |
1502 | |||
1503 | if (pkt_size < rx_copybreak) { | 1502 | if (pkt_size < rx_copybreak) { |
1504 | struct sk_buff *new_skb; | 1503 | struct sk_buff *new_skb; |
1505 | 1504 | ||
1506 | new_skb = dev_alloc_skb(pkt_size + 2); | 1505 | new_skb = netdev_alloc_skb(vptr->dev, pkt_size + 2); |
1507 | if (new_skb) { | 1506 | if (new_skb) { |
1508 | new_skb->dev = vptr->dev; | ||
1509 | new_skb->ip_summed = rx_skb[0]->ip_summed; | 1507 | new_skb->ip_summed = rx_skb[0]->ip_summed; |
1510 | 1508 | skb_reserve(new_skb, 2); | |
1511 | if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) | 1509 | skb_copy_from_linear_data(*rx_skb, new_skb->data, pkt_size); |
1512 | skb_reserve(new_skb, 2); | ||
1513 | |||
1514 | skb_copy_from_linear_data(rx_skb[0], new_skb->data, | ||
1515 | pkt_size); | ||
1516 | *rx_skb = new_skb; | 1510 | *rx_skb = new_skb; |
1517 | ret = 0; | 1511 | ret = 0; |
1518 | } | 1512 | } |
@@ -1533,12 +1527,8 @@ static inline int velocity_rx_copy(struct sk_buff **rx_skb, int pkt_size, | |||
1533 | static inline void velocity_iph_realign(struct velocity_info *vptr, | 1527 | static inline void velocity_iph_realign(struct velocity_info *vptr, |
1534 | struct sk_buff *skb, int pkt_size) | 1528 | struct sk_buff *skb, int pkt_size) |
1535 | { | 1529 | { |
1536 | /* FIXME - memmove ? */ | ||
1537 | if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) { | 1530 | if (vptr->flags & VELOCITY_FLAGS_IP_ALIGN) { |
1538 | int i; | 1531 | memmove(skb->data + 2, skb->data, pkt_size); |
1539 | |||
1540 | for (i = pkt_size; i >= 0; i--) | ||
1541 | *(skb->data + i + 2) = *(skb->data + i); | ||
1542 | skb_reserve(skb, 2); | 1532 | skb_reserve(skb, 2); |
1543 | } | 1533 | } |
1544 | } | 1534 | } |
@@ -1629,7 +1619,7 @@ static int velocity_alloc_rx_buf(struct velocity_info *vptr, int idx) | |||
1629 | struct rx_desc *rd = &(vptr->rd_ring[idx]); | 1619 | struct rx_desc *rd = &(vptr->rd_ring[idx]); |
1630 | struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]); | 1620 | struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]); |
1631 | 1621 | ||
1632 | rd_info->skb = dev_alloc_skb(vptr->rx_buf_sz + 64); | 1622 | rd_info->skb = netdev_alloc_skb(vptr->dev, vptr->rx_buf_sz + 64); |
1633 | if (rd_info->skb == NULL) | 1623 | if (rd_info->skb == NULL) |
1634 | return -ENOMEM; | 1624 | return -ENOMEM; |
1635 | 1625 | ||
@@ -1638,7 +1628,6 @@ static int velocity_alloc_rx_buf(struct velocity_info *vptr, int idx) | |||
1638 | * 64byte alignment. | 1628 | * 64byte alignment. |
1639 | */ | 1629 | */ |
1640 | skb_reserve(rd_info->skb, (unsigned long) rd_info->skb->data & 63); | 1630 | skb_reserve(rd_info->skb, (unsigned long) rd_info->skb->data & 63); |
1641 | rd_info->skb->dev = vptr->dev; | ||
1642 | rd_info->skb_dma = pci_map_single(vptr->pdev, rd_info->skb->data, vptr->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1631 | rd_info->skb_dma = pci_map_single(vptr->pdev, rd_info->skb->data, vptr->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1643 | 1632 | ||
1644 | /* | 1633 | /* |