aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx')
-rw-r--r--drivers/net/wireless/wl12xx/main.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index a23b394291f2..b06ff0b25de1 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -779,7 +779,13 @@ static void wl12xx_irq_ps_regulate_link(struct wl1271 *wl, u8 hlid, u8 tx_pkts)
779 779
780bool wl1271_is_active_sta(struct wl1271 *wl, u8 hlid) 780bool wl1271_is_active_sta(struct wl1271 *wl, u8 hlid)
781{ 781{
782 int id = hlid - WL1271_AP_STA_HLID_START; 782 int id;
783
784 /* global/broadcast "stations" are always active */
785 if (hlid < WL1271_AP_STA_HLID_START)
786 return true;
787
788 id = hlid - WL1271_AP_STA_HLID_START;
783 return test_bit(id, wl->ap_hlid_map); 789 return test_bit(id, wl->ap_hlid_map);
784} 790}
785 791
@@ -1493,6 +1499,13 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1493 1499
1494 /* queue the packet */ 1500 /* queue the packet */
1495 if (wl->bss_type == BSS_TYPE_AP_BSS) { 1501 if (wl->bss_type == BSS_TYPE_AP_BSS) {
1502 if (!wl1271_is_active_sta(wl, hlid)) {
1503 wl1271_debug(DEBUG_TX, "DROP skb hlid %d q %d",
1504 hlid, q);
1505 dev_kfree_skb(skb);
1506 goto out;
1507 }
1508
1496 wl1271_debug(DEBUG_TX, "queue skb hlid %d q %d", hlid, q); 1509 wl1271_debug(DEBUG_TX, "queue skb hlid %d q %d", hlid, q);
1497 skb_queue_tail(&wl->links[hlid].tx_queue[q], skb); 1510 skb_queue_tail(&wl->links[hlid].tx_queue[q], skb);
1498 } else { 1511 } else {
@@ -1508,6 +1521,7 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1508 !test_bit(WL1271_FLAG_TX_PENDING, &wl->flags)) 1521 !test_bit(WL1271_FLAG_TX_PENDING, &wl->flags))
1509 ieee80211_queue_work(wl->hw, &wl->tx_work); 1522 ieee80211_queue_work(wl->hw, &wl->tx_work);
1510 1523
1524out:
1511 spin_unlock_irqrestore(&wl->wl_lock, flags); 1525 spin_unlock_irqrestore(&wl->wl_lock, flags);
1512} 1526}
1513 1527
@@ -3695,7 +3709,7 @@ static int wl1271_allocate_sta(struct wl1271 *wl,
3695 } 3709 }
3696 3710
3697 wl_sta = (struct wl1271_station *)sta->drv_priv; 3711 wl_sta = (struct wl1271_station *)sta->drv_priv;
3698 __set_bit(id, wl->ap_hlid_map); 3712 set_bit(id, wl->ap_hlid_map);
3699 wl_sta->hlid = WL1271_AP_STA_HLID_START + id; 3713 wl_sta->hlid = WL1271_AP_STA_HLID_START + id;
3700 *hlid = wl_sta->hlid; 3714 *hlid = wl_sta->hlid;
3701 memcpy(wl->links[wl_sta->hlid].addr, sta->addr, ETH_ALEN); 3715 memcpy(wl->links[wl_sta->hlid].addr, sta->addr, ETH_ALEN);
@@ -3709,7 +3723,7 @@ static void wl1271_free_sta(struct wl1271 *wl, u8 hlid)
3709 if (WARN_ON(!test_bit(id, wl->ap_hlid_map))) 3723 if (WARN_ON(!test_bit(id, wl->ap_hlid_map)))
3710 return; 3724 return;
3711 3725
3712 __clear_bit(id, wl->ap_hlid_map); 3726 clear_bit(id, wl->ap_hlid_map);
3713 memset(wl->links[hlid].addr, 0, ETH_ALEN); 3727 memset(wl->links[hlid].addr, 0, ETH_ALEN);
3714 wl->links[hlid].ba_bitmap = 0; 3728 wl->links[hlid].ba_bitmap = 0;
3715 wl1271_tx_reset_link_queues(wl, hlid); 3729 wl1271_tx_reset_link_queues(wl, hlid);