aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
commit49e1900d4cc2e7bcecb681fe60f0990bec2dcce8 (patch)
tree253801ebf57e0a23856a2c7be129c2c178f62fdf /drivers/net/tokenring
parent34f6d749c0a328817d5e36274e53121c1db734dc (diff)
parentb9099ff63c75216d6ca10bce5a1abcd9293c27e6 (diff)
Merge branch 'linux-2.6' into for-2.6.22
Diffstat (limited to 'drivers/net/tokenring')
-rw-r--r--drivers/net/tokenring/3c359.c11
-rw-r--r--drivers/net/tokenring/ibmtr.c1
-rw-r--r--drivers/net/tokenring/lanstreamer.c7
-rw-r--r--drivers/net/tokenring/olympic.c18
-rw-r--r--drivers/net/tokenring/smctr.c6
-rw-r--r--drivers/net/tokenring/tms380tr.c6
6 files changed, 22 insertions, 27 deletions
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index 7580bdeacadc..e22a3f5333ef 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -933,20 +933,21 @@ static void xl_rx(struct net_device *dev)
933 return ; 933 return ;
934 } 934 }
935 935
936 skb->dev = dev ;
937
938 while (xl_priv->rx_ring_tail != temp_ring_loc) { 936 while (xl_priv->rx_ring_tail != temp_ring_loc) {
939 copy_len = xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen & 0x7FFF ; 937 copy_len = xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen & 0x7FFF ;
940 frame_length -= copy_len ; 938 frame_length -= copy_len ;
941 pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 939 pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
942 memcpy(skb_put(skb,copy_len), xl_priv->rx_ring_skb[xl_priv->rx_ring_tail]->data, copy_len) ; 940 skb_copy_from_linear_data(xl_priv->rx_ring_skb[xl_priv->rx_ring_tail],
941 skb_put(skb, copy_len),
942 copy_len);
943 pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 943 pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
944 adv_rx_ring(dev) ; 944 adv_rx_ring(dev) ;
945 } 945 }
946 946
947 /* Now we have found the last fragment */ 947 /* Now we have found the last fragment */
948 pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 948 pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
949 memcpy(skb_put(skb,copy_len), xl_priv->rx_ring_skb[xl_priv->rx_ring_tail]->data, frame_length) ; 949 skb_copy_from_linear_data(xl_priv->rx_ring_skb[xl_priv->rx_ring_tail],
950 skb_put(skb,copy_len), frame_length);
950/* memcpy(skb_put(skb,frame_length), bus_to_virt(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr), frame_length) ; */ 951/* memcpy(skb_put(skb,frame_length), bus_to_virt(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr), frame_length) ; */
951 pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 952 pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
952 adv_rx_ring(dev) ; 953 adv_rx_ring(dev) ;
@@ -967,8 +968,6 @@ static void xl_rx(struct net_device *dev)
967 return ; 968 return ;
968 } 969 }
969 970
970 skb->dev = dev ;
971
972 skb2 = xl_priv->rx_ring_skb[xl_priv->rx_ring_tail] ; 971 skb2 = xl_priv->rx_ring_skb[xl_priv->rx_ring_tail] ;
973 pci_unmap_single(xl_priv->pdev, xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr, xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 972 pci_unmap_single(xl_priv->pdev, xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr, xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
974 skb_put(skb2, frame_length) ; 973 skb_put(skb2, frame_length) ;
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index 01d55315ee8c..1e8958ee2d0a 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -1771,7 +1771,6 @@ static void tr_rx(struct net_device *dev)
1771 /*BMS again, if she comes in with few but leaves with many */ 1771 /*BMS again, if she comes in with few but leaves with many */
1772 skb_reserve(skb, sizeof(struct trh_hdr) - lan_hdr_len); 1772 skb_reserve(skb, sizeof(struct trh_hdr) - lan_hdr_len);
1773 skb_put(skb, length); 1773 skb_put(skb, length);
1774 skb->dev = dev;
1775 data = skb->data; 1774 data = skb->data;
1776 rbuffer_len = ntohs(readw(rbuf + offsetof(struct rec_buf, buf_len))); 1775 rbuffer_len = ntohs(readw(rbuf + offsetof(struct rec_buf, buf_len)));
1777 rbufdata = rbuf + offsetof(struct rec_buf, data); 1776 rbufdata = rbuf + offsetof(struct rec_buf, data);
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index e999feb8c0bb..5d849c089a3b 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -944,8 +944,6 @@ static void streamer_rx(struct net_device *dev)
944 printk(KERN_WARNING "%s: Not enough memory to copy packet to upper layers. \n", dev->name); 944 printk(KERN_WARNING "%s: Not enough memory to copy packet to upper layers. \n", dev->name);
945 streamer_priv->streamer_stats.rx_dropped++; 945 streamer_priv->streamer_stats.rx_dropped++;
946 } else { /* we allocated an skb OK */ 946 } else { /* we allocated an skb OK */
947 skb->dev = dev;
948
949 if (buffer_cnt == 1) { 947 if (buffer_cnt == 1) {
950 /* release the DMA mapping */ 948 /* release the DMA mapping */
951 pci_unmap_single(streamer_priv->pci_dev, 949 pci_unmap_single(streamer_priv->pci_dev,
@@ -1607,10 +1605,11 @@ static void streamer_arb_cmd(struct net_device *dev)
1607 frame_data, buffer_len); 1605 frame_data, buffer_len);
1608 } while (next_ptr && (buff_off = next_ptr)); 1606 } while (next_ptr && (buff_off = next_ptr));
1609 1607
1608 mac_frame->protocol = tr_type_trans(mac_frame, dev);
1610#if STREAMER_NETWORK_MONITOR 1609#if STREAMER_NETWORK_MONITOR
1611 printk(KERN_WARNING "%s: Received MAC Frame, details: \n", 1610 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",
1612 dev->name); 1611 dev->name);
1613 mac_hdr = (struct trh_hdr *) mac_frame->data; 1612 mac_hdr = tr_hdr(mac_frame);
1614 printk(KERN_WARNING 1613 printk(KERN_WARNING
1615 "%s: MAC Frame Dest. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n", 1614 "%s: MAC Frame Dest. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n",
1616 dev->name, mac_hdr->daddr[0], mac_hdr->daddr[1], 1615 dev->name, mac_hdr->daddr[0], mac_hdr->daddr[1],
@@ -1622,8 +1621,6 @@ static void streamer_arb_cmd(struct net_device *dev)
1622 mac_hdr->saddr[2], mac_hdr->saddr[3], 1621 mac_hdr->saddr[2], mac_hdr->saddr[3],
1623 mac_hdr->saddr[4], mac_hdr->saddr[5]); 1622 mac_hdr->saddr[4], mac_hdr->saddr[5]);
1624#endif 1623#endif
1625 mac_frame->dev = dev;
1626 mac_frame->protocol = tr_type_trans(mac_frame, dev);
1627 netif_rx(mac_frame); 1624 netif_rx(mac_frame);
1628 1625
1629 /* Now tell the card we have dealt with the received frame */ 1626 /* Now tell the card we have dealt with the received frame */
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index 8f4ecc1109cb..09b3cfb8e809 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -814,8 +814,6 @@ static void olympic_rx(struct net_device *dev)
814 olympic_priv->rx_ring_last_received += i ; 814 olympic_priv->rx_ring_last_received += i ;
815 olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ; 815 olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ;
816 } else { 816 } else {
817 skb->dev = dev ;
818
819 /* Optimise based upon number of buffers used. 817 /* Optimise based upon number of buffers used.
820 If only one buffer is used we can simply swap the buffers around. 818 If only one buffer is used we can simply swap the buffers around.
821 If more than one then we must use the new buffer and copy the information 819 If more than one then we must use the new buffer and copy the information
@@ -847,7 +845,9 @@ static void olympic_rx(struct net_device *dev)
847 pci_dma_sync_single_for_cpu(olympic_priv->pdev, 845 pci_dma_sync_single_for_cpu(olympic_priv->pdev,
848 le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), 846 le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer),
849 olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 847 olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
850 memcpy(skb_put(skb,length-4),olympic_priv->rx_ring_skb[rx_ring_last_received]->data,length-4) ; 848 skb_copy_from_linear_data(olympic_priv->rx_ring_skb[rx_ring_last_received],
849 skb_put(skb,length - 4),
850 length - 4);
851 pci_dma_sync_single_for_device(olympic_priv->pdev, 851 pci_dma_sync_single_for_device(olympic_priv->pdev,
852 le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), 852 le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer),
853 olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 853 olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
@@ -864,7 +864,9 @@ static void olympic_rx(struct net_device *dev)
864 olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 864 olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
865 rx_desc = &(olympic_priv->olympic_rx_ring[rx_ring_last_received]); 865 rx_desc = &(olympic_priv->olympic_rx_ring[rx_ring_last_received]);
866 cpy_length = (i == 1 ? frag_len : le32_to_cpu(rx_desc->res_length)); 866 cpy_length = (i == 1 ? frag_len : le32_to_cpu(rx_desc->res_length));
867 memcpy(skb_put(skb, cpy_length), olympic_priv->rx_ring_skb[rx_ring_last_received]->data, cpy_length) ; 867 skb_copy_from_linear_data(olympic_priv->rx_ring_skb[rx_ring_last_received],
868 skb_put(skb, cpy_length),
869 cpy_length);
868 pci_dma_sync_single_for_device(olympic_priv->pdev, 870 pci_dma_sync_single_for_device(olympic_priv->pdev,
869 le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer), 871 le32_to_cpu(olympic_priv->olympic_rx_ring[rx_ring_last_received].buffer),
870 olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ; 872 olympic_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
@@ -1440,16 +1442,16 @@ static void olympic_arb_cmd(struct net_device *dev)
1440 next_ptr=readw(buf_ptr+offsetof(struct mac_receive_buffer,next)); 1442 next_ptr=readw(buf_ptr+offsetof(struct mac_receive_buffer,next));
1441 } while (next_ptr && (buf_ptr=olympic_priv->olympic_lap + ntohs(next_ptr))); 1443 } while (next_ptr && (buf_ptr=olympic_priv->olympic_lap + ntohs(next_ptr)));
1442 1444
1445 mac_frame->protocol = tr_type_trans(mac_frame, dev);
1446
1443 if (olympic_priv->olympic_network_monitor) { 1447 if (olympic_priv->olympic_network_monitor) {
1444 struct trh_hdr *mac_hdr ; 1448 struct trh_hdr *mac_hdr ;
1445 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name) ; 1449 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name) ;
1446 mac_hdr = (struct trh_hdr *)mac_frame->data ; 1450 mac_hdr = tr_hdr(mac_frame);
1447 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n", dev->name , mac_hdr->daddr[0], mac_hdr->daddr[1], mac_hdr->daddr[2], mac_hdr->daddr[3], mac_hdr->daddr[4], mac_hdr->daddr[5]) ; 1451 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n", dev->name , mac_hdr->daddr[0], mac_hdr->daddr[1], mac_hdr->daddr[2], mac_hdr->daddr[3], mac_hdr->daddr[4], mac_hdr->daddr[5]) ;
1448 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n", dev->name , mac_hdr->saddr[0], mac_hdr->saddr[1], mac_hdr->saddr[2], mac_hdr->saddr[3], mac_hdr->saddr[4], mac_hdr->saddr[5]) ; 1452 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %02x:%02x:%02x:%02x:%02x:%02x \n", dev->name , mac_hdr->saddr[0], mac_hdr->saddr[1], mac_hdr->saddr[2], mac_hdr->saddr[3], mac_hdr->saddr[4], mac_hdr->saddr[5]) ;
1449 } 1453 }
1450 mac_frame->dev = dev ; 1454 netif_rx(mac_frame);
1451 mac_frame->protocol = tr_type_trans(mac_frame,dev);
1452 netif_rx(mac_frame) ;
1453 dev->last_rx = jiffies; 1455 dev->last_rx = jiffies;
1454 1456
1455drop_frame: 1457drop_frame:
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index cec282a6f62d..9bbea5c8acf4 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -3889,14 +3889,13 @@ static int smctr_process_rx_packet(MAC_HEADER *rmf, __u16 size,
3889 3889
3890 /* Slide data into a sleek skb. */ 3890 /* Slide data into a sleek skb. */
3891 skb_put(skb, skb->len); 3891 skb_put(skb, skb->len);
3892 memcpy(skb->data, rmf, skb->len); 3892 skb_copy_to_linear_data(skb, rmf, skb->len);
3893 3893
3894 /* Update Counters */ 3894 /* Update Counters */
3895 tp->MacStat.rx_packets++; 3895 tp->MacStat.rx_packets++;
3896 tp->MacStat.rx_bytes += skb->len; 3896 tp->MacStat.rx_bytes += skb->len;
3897 3897
3898 /* Kick the packet on up. */ 3898 /* Kick the packet on up. */
3899 skb->dev = dev;
3900 skb->protocol = tr_type_trans(skb, dev); 3899 skb->protocol = tr_type_trans(skb, dev);
3901 netif_rx(skb); 3900 netif_rx(skb);
3902 dev->last_rx = jiffies; 3901 dev->last_rx = jiffies;
@@ -4476,14 +4475,13 @@ static int smctr_rx_frame(struct net_device *dev)
4476 if (skb) { 4475 if (skb) {
4477 skb_put(skb, rx_size); 4476 skb_put(skb, rx_size);
4478 4477
4479 memcpy(skb->data, pbuff, rx_size); 4478 skb_copy_to_linear_data(skb, pbuff, rx_size);
4480 4479
4481 /* Update Counters */ 4480 /* Update Counters */
4482 tp->MacStat.rx_packets++; 4481 tp->MacStat.rx_packets++;
4483 tp->MacStat.rx_bytes += skb->len; 4482 tp->MacStat.rx_bytes += skb->len;
4484 4483
4485 /* Kick the packet on up. */ 4484 /* Kick the packet on up. */
4486 skb->dev = dev;
4487 skb->protocol = tr_type_trans(skb, dev); 4485 skb->protocol = tr_type_trans(skb, dev);
4488 netif_rx(skb); 4486 netif_rx(skb);
4489 dev->last_rx = jiffies; 4487 dev->last_rx = jiffies;
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index ea797ca2b988..12bd294045a7 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -644,7 +644,7 @@ static int tms380tr_hardware_send_packet(struct sk_buff *skb, struct net_device
644 dmabuf = 0; 644 dmabuf = 0;
645 i = tp->TplFree->TPLIndex; 645 i = tp->TplFree->TPLIndex;
646 buf = tp->LocalTxBuffers[i]; 646 buf = tp->LocalTxBuffers[i];
647 memcpy(buf, skb->data, length); 647 skb_copy_from_linear_data(skb, buf, length);
648 newbuf = ((char *)buf - (char *)tp) + tp->dmabuffer; 648 newbuf = ((char *)buf - (char *)tp) + tp->dmabuffer;
649 } 649 }
650 else { 650 else {
@@ -2168,7 +2168,6 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
2168 } 2168 }
2169 else 2169 else
2170 { 2170 {
2171 skb->dev = dev;
2172 skb_put(skb, tp->MaxPacketSize); 2171 skb_put(skb, tp->MaxPacketSize);
2173 rpl->SkbStat = SKB_DATA_COPY; 2172 rpl->SkbStat = SKB_DATA_COPY;
2174 ReceiveDataPtr = rpl->MData; 2173 ReceiveDataPtr = rpl->MData;
@@ -2179,7 +2178,8 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
2179 || rpl->SkbStat == SKB_DMA_DIRECT)) 2178 || rpl->SkbStat == SKB_DMA_DIRECT))
2180 { 2179 {
2181 if(rpl->SkbStat == SKB_DATA_COPY) 2180 if(rpl->SkbStat == SKB_DATA_COPY)
2182 memcpy(skb->data, ReceiveDataPtr, Length); 2181 skb_copy_to_linear_data(skb, ReceiveDataPtr,
2182 Length);
2183 2183
2184 /* Deliver frame to system */ 2184 /* Deliver frame to system */
2185 rpl->Skb = NULL; 2185 rpl->Skb = NULL;