diff options
Diffstat (limited to 'drivers/net/tokenring/olympic.c')
-rw-r--r-- | drivers/net/tokenring/olympic.c | 18 |
1 files changed, 10 insertions, 8 deletions
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 | ||
1455 | drop_frame: | 1457 | drop_frame: |