]> git.hungrycats.org Git - linux/commitdiff
[PATCH] e100: fix for incoherent arches
authorScott Feldman <scott.feldman@intel.com>
Tue, 18 May 2004 16:39:57 +0000 (12:39 -0400)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 18 May 2004 16:39:57 +0000 (12:39 -0400)
* Changed mapping on Rx skb to bi-directional.  skb->data holds both the
  RFD structure and the packet data, and the RFD is read/written by
  HW.  Issue found on Xscale HW that doesn't handle cache syncs auto-
  matically.  Other changes in patch are whitespace/spelling.

drivers/net/e100.c

index a98e843914a269a3d84ef1f895420b7dc1f1fa38..b1fda1b795c02492dc0ddfbfaa145f8535f5099e 100644 (file)
@@ -1392,12 +1392,12 @@ static inline int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
        if(!(rx->skb = dev_alloc_skb(RFD_BUF_LEN + rx_offset)))
                return -ENOMEM;
 
-       /* Align, init, and map the RFA. */
+       /* Align, init, and map the RFD. */
        rx->skb->dev = nic->netdev;
        skb_reserve(rx->skb, rx_offset);
        memcpy(rx->skb->data, &nic->blank_rfd, sizeof(struct rfd));
        rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data,
-               RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
+               RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL);
 
        /* Link the RFD to end of RFA by linking previous RFD to
         * this one, and clearing EL bit of previous.  */
@@ -1408,7 +1408,7 @@ static inline int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
                wmb();
                prev_rfd->command &= ~cpu_to_le16(cb_el);
                pci_dma_sync_single_for_device(nic->pdev, rx->prev->dma_addr,
-                                              sizeof(struct rfd), PCI_DMA_TODEVICE);
+                       sizeof(struct rfd), PCI_DMA_TODEVICE);
        }
 
        return 0;
@@ -1426,7 +1426,7 @@ static inline int e100_rx_indicate(struct nic *nic, struct rx *rx,
 
        /* Need to sync before taking a peek at cb_complete bit */
        pci_dma_sync_single_for_cpu(nic->pdev, rx->dma_addr,
-                                   sizeof(struct rfd), PCI_DMA_FROMDEVICE);
+               sizeof(struct rfd), PCI_DMA_FROMDEVICE);
        rfd_status = le16_to_cpu(rfd->status);
 
        DPRINTK(RX_STATUS, DEBUG, "status=0x%04X\n", rfd_status);
@@ -1442,7 +1442,7 @@ static inline int e100_rx_indicate(struct nic *nic, struct rx *rx,
 
        /* Get data */
        pci_unmap_single(nic->pdev, rx->dma_addr,
-                        RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
+               RFD_BUF_LEN, PCI_DMA_FROMDEVICE);
 
        /* Pull off the RFD and put the actual data (minus eth hdr) */
        skb_reserve(skb, sizeof(struct rfd));