提交 0ba894d4 编写于 作者: F Francois Romieu

8139cp: ring_info removal for the receive path

The ring_info.len field is not used at all. cp_private.rx_skb is
turned into an array of sk_buff *.
Signed-off-by: NFrancois Romieu <romieu@fr.zoreil.com>
上级 c48e9399
......@@ -354,7 +354,7 @@ struct cp_private {
unsigned rx_tail ____cacheline_aligned;
struct cp_desc *rx_ring;
struct ring_info rx_skb[CP_RX_RING_SIZE];
struct sk_buff *rx_skb[CP_RX_RING_SIZE];
unsigned rx_buf_sz;
unsigned tx_head ____cacheline_aligned;
......@@ -541,7 +541,7 @@ static int cp_rx_poll (struct net_device *dev, int *budget)
struct cp_desc *desc;
unsigned buflen;
skb = cp->rx_skb[rx_tail].skb;
skb = cp->rx_skb[rx_tail];
BUG_ON(!skb);
desc = &cp->rx_ring[rx_tail];
......@@ -596,7 +596,7 @@ static int cp_rx_poll (struct net_device *dev, int *budget)
mapping = pci_map_single(cp->pdev, new_skb->data, buflen,
PCI_DMA_FROMDEVICE);
cp->rx_skb[rx_tail].skb = new_skb;
cp->rx_skb[rx_tail] = new_skb;
cp_rx_skb(cp, skb, desc);
rx++;
......@@ -1097,7 +1097,7 @@ static int cp_refill_rx (struct cp_private *cp)
mapping = pci_map_single(cp->pdev, skb->data, cp->rx_buf_sz,
PCI_DMA_FROMDEVICE);
cp->rx_skb[i].skb = skb;
cp->rx_skb[i] = skb;
cp->rx_ring[i].opts2 = 0;
cp->rx_ring[i].addr = cpu_to_le64(mapping);
......@@ -1152,11 +1152,11 @@ static void cp_clean_rings (struct cp_private *cp)
unsigned i;
for (i = 0; i < CP_RX_RING_SIZE; i++) {
if (cp->rx_skb[i].skb) {
if (cp->rx_skb[i]) {
desc = cp->rx_ring + i;
pci_unmap_single(cp->pdev, le64_to_cpu(desc->addr),
cp->rx_buf_sz, PCI_DMA_FROMDEVICE);
dev_kfree_skb(cp->rx_skb[i].skb);
dev_kfree_skb(cp->rx_skb[i]);
}
}
......@@ -1176,7 +1176,7 @@ static void cp_clean_rings (struct cp_private *cp)
memset(cp->rx_ring, 0, sizeof(struct cp_desc) * CP_RX_RING_SIZE);
memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE);
memset(&cp->rx_skb, 0, sizeof(struct ring_info) * CP_RX_RING_SIZE);
memset(cp->rx_skb, 0, sizeof(struct sk_buff *) * CP_RX_RING_SIZE);
memset(&cp->tx_skb, 0, sizeof(struct ring_info) * CP_TX_RING_SIZE);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册