aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/p54common.c
diff options
context:
space:
mode:
authorChr <chunkeey@web.de>2008-08-23 21:15:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-29 16:24:08 -0400
commit031d10ee5a6df5aba6b4ac8bb01dd023cd5efc02 (patch)
treeb40c236fdc870f3f9dc5947f4b84120f3f469431 /drivers/net/wireless/p54/p54common.c
parent154e3af17fdce617605b63f3534dac2c10c90922 (diff)
p54: take tx_queue's lock in rx_frame_sent
p54_rx_frame_sent will alter the tx_queue. Therefore we should hold the lock to protect against concurrent p54_assign_address calls. Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54/p54common.c')
-rw-r--r--drivers/net/wireless/p54/p54common.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index 4a6b5363ea4b..5cd88bcb0280 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -432,7 +432,9 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
432 struct memrecord *range = NULL; 432 struct memrecord *range = NULL;
433 u32 freed = 0; 433 u32 freed = 0;
434 u32 last_addr = priv->rx_start; 434 u32 last_addr = priv->rx_start;
435 unsigned long flags;
435 436
437 spin_lock_irqsave(&priv->tx_queue.lock, flags);
436 while (entry != (struct sk_buff *)&priv->tx_queue) { 438 while (entry != (struct sk_buff *)&priv->tx_queue) {
437 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry); 439 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry);
438 range = (void *)info->driver_data; 440 range = (void *)info->driver_data;
@@ -453,6 +455,8 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
453 455
454 last_addr = range->end_addr; 456 last_addr = range->end_addr;
455 __skb_unlink(entry, &priv->tx_queue); 457 __skb_unlink(entry, &priv->tx_queue);
458 spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
459
456 memset(&info->status, 0, sizeof(info->status)); 460 memset(&info->status, 0, sizeof(info->status));
457 entry_hdr = (struct p54_control_hdr *) entry->data; 461 entry_hdr = (struct p54_control_hdr *) entry->data;
458 entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data; 462 entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data;
@@ -470,12 +474,14 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
470 info->status.ack_signal = le16_to_cpu(payload->ack_rssi); 474 info->status.ack_signal = le16_to_cpu(payload->ack_rssi);
471 skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); 475 skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data));
472 ieee80211_tx_status_irqsafe(dev, entry); 476 ieee80211_tx_status_irqsafe(dev, entry);
473 break; 477 goto out;
474 } else 478 } else
475 last_addr = range->end_addr; 479 last_addr = range->end_addr;
476 entry = entry->next; 480 entry = entry->next;
477 } 481 }
482 spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
478 483
484out:
479 if (freed >= IEEE80211_MAX_RTS_THRESHOLD + 0x170 + 485 if (freed >= IEEE80211_MAX_RTS_THRESHOLD + 0x170 +
480 sizeof(struct p54_control_hdr)) 486 sizeof(struct p54_control_hdr))
481 p54_wake_free_queues(dev); 487 p54_wake_free_queues(dev);