Commit 5097bc46 authored by François Romieu's avatar François Romieu Committed by Jeff Garzik

[netdrvr r8169] DMA api resync.

parent b342ada3
...@@ -1429,19 +1429,22 @@ rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp, ...@@ -1429,19 +1429,22 @@ rtl8169_rx_interrupt(struct net_device *dev, struct rtl8169_private *tp,
struct RxDesc *desc = tp->RxDescArray + entry; struct RxDesc *desc = tp->RxDescArray + entry;
struct sk_buff *skb = tp->Rx_skbuff[entry]; struct sk_buff *skb = tp->Rx_skbuff[entry];
int pkt_size = (status & 0x00001FFF) - 4; int pkt_size = (status & 0x00001FFF) - 4;
void (*pci_action)(struct pci_dev *, dma_addr_t,
size_t, int) = pci_dma_sync_single_for_device;
pci_dma_sync_single(tp->pci_dev,
le32_to_cpu(desc->buf_addr),
RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) { pci_dma_sync_single_for_cpu(tp->pci_dev,
pci_unmap_single(tp->pci_dev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE,
le32_to_cpu(desc->buf_addr),
RX_BUF_SIZE,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) {
pci_action = pci_unmap_single;
tp->Rx_skbuff[entry] = NULL; tp->Rx_skbuff[entry] = NULL;
} }
pci_action(tp->pci_dev, le32_to_cpu(desc->buf_addr),
RX_BUF_SIZE, PCI_DMA_FROMDEVICE);
skb_put(skb, pkt_size); skb_put(skb, pkt_size);
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb); netif_rx(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment