aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/p54pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/p54/p54pci.c')
-rw-r--r--drivers/net/wireless/p54/p54pci.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index c28220e401b9..aa367a0ddc49 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -227,7 +227,9 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index,
227 227
228 while (i != idx) { 228 while (i != idx) {
229 desc = &ring[i]; 229 desc = &ring[i];
230 p54_free_skb(dev, tx_buf[i]); 230 if (tx_buf[i])
231 if (FREE_AFTER_TX((struct sk_buff *) tx_buf[i]))
232 p54_free_skb(dev, tx_buf[i]);
231 tx_buf[i] = NULL; 233 tx_buf[i] = NULL;
232 234
233 pci_unmap_single(priv->pdev, le32_to_cpu(desc->host_addr), 235 pci_unmap_single(priv->pdev, le32_to_cpu(desc->host_addr),
@@ -298,8 +300,7 @@ static irqreturn_t p54p_interrupt(int irq, void *dev_id)
298 return reg ? IRQ_HANDLED : IRQ_NONE; 300 return reg ? IRQ_HANDLED : IRQ_NONE;
299} 301}
300 302
301static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb, 303static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
302 int free_on_tx)
303{ 304{
304 struct p54p_priv *priv = dev->priv; 305 struct p54p_priv *priv = dev->priv;
305 struct p54p_ring_control *ring_control = priv->ring_control; 306 struct p54p_ring_control *ring_control = priv->ring_control;
@@ -314,6 +315,7 @@ static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
314 idx = le32_to_cpu(ring_control->host_idx[1]); 315 idx = le32_to_cpu(ring_control->host_idx[1]);
315 i = idx % ARRAY_SIZE(ring_control->tx_data); 316 i = idx % ARRAY_SIZE(ring_control->tx_data);
316 317
318 priv->tx_buf_data[i] = skb;
317 mapping = pci_map_single(priv->pdev, skb->data, skb->len, 319 mapping = pci_map_single(priv->pdev, skb->data, skb->len,
318 PCI_DMA_TODEVICE); 320 PCI_DMA_TODEVICE);
319 desc = &ring_control->tx_data[i]; 321 desc = &ring_control->tx_data[i];
@@ -324,10 +326,6 @@ static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
324 326
325 wmb(); 327 wmb();
326 ring_control->host_idx[1] = cpu_to_le32(idx + 1); 328 ring_control->host_idx[1] = cpu_to_le32(idx + 1);
327
328 if (free_on_tx)
329 priv->tx_buf_data[i] = skb;
330
331 spin_unlock_irqrestore(&priv->lock, flags); 329 spin_unlock_irqrestore(&priv->lock, flags);
332 330
333 P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE)); 331 P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE));