diff options
Diffstat (limited to 'drivers/net/tulip/uli526x.c')
-rw-r--r-- | drivers/net/tulip/uli526x.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c index 229158e8e4be..ca2548eb7d63 100644 --- a/drivers/net/tulip/uli526x.c +++ b/drivers/net/tulip/uli526x.c | |||
@@ -583,7 +583,7 @@ static int uli526x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
583 | 583 | ||
584 | /* transmit this packet */ | 584 | /* transmit this packet */ |
585 | txptr = db->tx_insert_ptr; | 585 | txptr = db->tx_insert_ptr; |
586 | memcpy(txptr->tx_buf_ptr, skb->data, skb->len); | 586 | skb_copy_from_linear_data(skb, txptr->tx_buf_ptr, skb->len); |
587 | txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len); | 587 | txptr->tdes1 = cpu_to_le32(0xe1000000 | skb->len); |
588 | 588 | ||
589 | /* Point to next transmit free descriptor */ | 589 | /* Point to next transmit free descriptor */ |
@@ -828,14 +828,14 @@ static void uli526x_rx_packet(struct net_device *dev, struct uli526x_board_info | |||
828 | ( (skb = dev_alloc_skb(rxlen + 2) ) | 828 | ( (skb = dev_alloc_skb(rxlen + 2) ) |
829 | != NULL) ) { | 829 | != NULL) ) { |
830 | /* size less than COPY_SIZE, allocate a rxlen SKB */ | 830 | /* size less than COPY_SIZE, allocate a rxlen SKB */ |
831 | skb->dev = dev; | ||
832 | skb_reserve(skb, 2); /* 16byte align */ | 831 | skb_reserve(skb, 2); /* 16byte align */ |
833 | memcpy(skb_put(skb, rxlen), rxptr->rx_skb_ptr->tail, rxlen); | 832 | memcpy(skb_put(skb, rxlen), |
833 | skb_tail_pointer(rxptr->rx_skb_ptr), | ||
834 | rxlen); | ||
834 | uli526x_reuse_skb(db, rxptr->rx_skb_ptr); | 835 | uli526x_reuse_skb(db, rxptr->rx_skb_ptr); |
835 | } else { | 836 | } else |
836 | skb->dev = dev; | ||
837 | skb_put(skb, rxlen); | 837 | skb_put(skb, rxlen); |
838 | } | 838 | |
839 | skb->protocol = eth_type_trans(skb, dev); | 839 | skb->protocol = eth_type_trans(skb, dev); |
840 | netif_rx(skb); | 840 | netif_rx(skb); |
841 | dev->last_rx = jiffies; | 841 | dev->last_rx = jiffies; |
@@ -1177,7 +1177,10 @@ static void uli526x_reuse_skb(struct uli526x_board_info *db, struct sk_buff * sk | |||
1177 | 1177 | ||
1178 | if (!(rxptr->rdes0 & cpu_to_le32(0x80000000))) { | 1178 | if (!(rxptr->rdes0 & cpu_to_le32(0x80000000))) { |
1179 | rxptr->rx_skb_ptr = skb; | 1179 | rxptr->rx_skb_ptr = skb; |
1180 | rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->tail, RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) ); | 1180 | rxptr->rdes2 = cpu_to_le32(pci_map_single(db->pdev, |
1181 | skb_tail_pointer(skb), | ||
1182 | RX_ALLOC_SIZE, | ||
1183 | PCI_DMA_FROMDEVICE)); | ||
1181 | wmb(); | 1184 | wmb(); |
1182 | rxptr->rdes0 = cpu_to_le32(0x80000000); | 1185 | rxptr->rdes0 = cpu_to_le32(0x80000000); |
1183 | db->rx_avail_cnt++; | 1186 | db->rx_avail_cnt++; |
@@ -1341,7 +1344,10 @@ static void allocate_rx_buffer(struct uli526x_board_info *db) | |||
1341 | if ( ( skb = dev_alloc_skb(RX_ALLOC_SIZE) ) == NULL ) | 1344 | if ( ( skb = dev_alloc_skb(RX_ALLOC_SIZE) ) == NULL ) |
1342 | break; | 1345 | break; |
1343 | rxptr->rx_skb_ptr = skb; /* FIXME (?) */ | 1346 | rxptr->rx_skb_ptr = skb; /* FIXME (?) */ |
1344 | rxptr->rdes2 = cpu_to_le32( pci_map_single(db->pdev, skb->tail, RX_ALLOC_SIZE, PCI_DMA_FROMDEVICE) ); | 1347 | rxptr->rdes2 = cpu_to_le32(pci_map_single(db->pdev, |
1348 | skb_tail_pointer(skb), | ||
1349 | RX_ALLOC_SIZE, | ||
1350 | PCI_DMA_FROMDEVICE)); | ||
1345 | wmb(); | 1351 | wmb(); |
1346 | rxptr->rdes0 = cpu_to_le32(0x80000000); | 1352 | rxptr->rdes0 = cpu_to_le32(0x80000000); |
1347 | rxptr = rxptr->next_rx_desc; | 1353 | rxptr = rxptr->next_rx_desc; |