diff options
Diffstat (limited to 'net/mac80211/agg-tx.c')
| -rw-r--r-- | net/mac80211/agg-tx.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index 5e3a7eccef5a..5538e1b4a697 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
| @@ -58,17 +58,17 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata, | |||
| 58 | 58 | ||
| 59 | if (!skb) { | 59 | if (!skb) { |
| 60 | printk(KERN_ERR "%s: failed to allocate buffer " | 60 | printk(KERN_ERR "%s: failed to allocate buffer " |
| 61 | "for addba request frame\n", sdata->dev->name); | 61 | "for addba request frame\n", sdata->name); |
| 62 | return; | 62 | return; |
| 63 | } | 63 | } |
| 64 | skb_reserve(skb, local->hw.extra_tx_headroom); | 64 | skb_reserve(skb, local->hw.extra_tx_headroom); |
| 65 | mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24); | 65 | mgmt = (struct ieee80211_mgmt *) skb_put(skb, 24); |
| 66 | memset(mgmt, 0, 24); | 66 | memset(mgmt, 0, 24); |
| 67 | memcpy(mgmt->da, da, ETH_ALEN); | 67 | memcpy(mgmt->da, da, ETH_ALEN); |
| 68 | memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); | 68 | memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); |
| 69 | if (sdata->vif.type == NL80211_IFTYPE_AP || | 69 | if (sdata->vif.type == NL80211_IFTYPE_AP || |
| 70 | sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | 70 | sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
| 71 | memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); | 71 | memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); |
| 72 | else if (sdata->vif.type == NL80211_IFTYPE_STATION) | 72 | else if (sdata->vif.type == NL80211_IFTYPE_STATION) |
| 73 | memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN); | 73 | memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN); |
| 74 | 74 | ||
| @@ -104,7 +104,7 @@ void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u1 | |||
| 104 | skb = dev_alloc_skb(sizeof(*bar) + local->hw.extra_tx_headroom); | 104 | skb = dev_alloc_skb(sizeof(*bar) + local->hw.extra_tx_headroom); |
| 105 | if (!skb) { | 105 | if (!skb) { |
| 106 | printk(KERN_ERR "%s: failed to allocate buffer for " | 106 | printk(KERN_ERR "%s: failed to allocate buffer for " |
| 107 | "bar frame\n", sdata->dev->name); | 107 | "bar frame\n", sdata->name); |
| 108 | return; | 108 | return; |
| 109 | } | 109 | } |
| 110 | skb_reserve(skb, local->hw.extra_tx_headroom); | 110 | skb_reserve(skb, local->hw.extra_tx_headroom); |
| @@ -113,7 +113,7 @@ void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u1 | |||
| 113 | bar->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL | | 113 | bar->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL | |
| 114 | IEEE80211_STYPE_BACK_REQ); | 114 | IEEE80211_STYPE_BACK_REQ); |
| 115 | memcpy(bar->ra, ra, ETH_ALEN); | 115 | memcpy(bar->ra, ra, ETH_ALEN); |
| 116 | memcpy(bar->ta, sdata->dev->dev_addr, ETH_ALEN); | 116 | memcpy(bar->ta, sdata->vif.addr, ETH_ALEN); |
| 117 | bar_control |= (u16)IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL; | 117 | bar_control |= (u16)IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL; |
| 118 | bar_control |= (u16)IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA; | 118 | bar_control |= (u16)IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA; |
| 119 | bar_control |= (u16)(tid << 12); | 119 | bar_control |= (u16)(tid << 12); |
| @@ -144,7 +144,7 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
| 144 | *state = HT_AGG_STATE_REQ_STOP_BA_MSK | | 144 | *state = HT_AGG_STATE_REQ_STOP_BA_MSK | |
| 145 | (initiator << HT_AGG_STATE_INITIATOR_SHIFT); | 145 | (initiator << HT_AGG_STATE_INITIATOR_SHIFT); |
| 146 | 146 | ||
| 147 | ret = drv_ampdu_action(local, &sta->sdata->vif, | 147 | ret = drv_ampdu_action(local, sta->sdata, |
| 148 | IEEE80211_AMPDU_TX_STOP, | 148 | IEEE80211_AMPDU_TX_STOP, |
| 149 | &sta->sta, tid, NULL); | 149 | &sta->sta, tid, NULL); |
| 150 | 150 | ||
| @@ -179,7 +179,8 @@ static void sta_addba_resp_timer_expired(unsigned long data) | |||
| 179 | 179 | ||
| 180 | /* check if the TID waits for addBA response */ | 180 | /* check if the TID waits for addBA response */ |
| 181 | spin_lock_bh(&sta->lock); | 181 | spin_lock_bh(&sta->lock); |
| 182 | if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK)) != | 182 | if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK | |
| 183 | HT_AGG_STATE_REQ_STOP_BA_MSK)) != | ||
| 183 | HT_ADDBA_REQUESTED_MSK) { | 184 | HT_ADDBA_REQUESTED_MSK) { |
| 184 | spin_unlock_bh(&sta->lock); | 185 | spin_unlock_bh(&sta->lock); |
| 185 | *state = HT_AGG_STATE_IDLE; | 186 | *state = HT_AGG_STATE_IDLE; |
| @@ -236,6 +237,14 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid) | |||
| 236 | sdata->vif.type != NL80211_IFTYPE_AP) | 237 | sdata->vif.type != NL80211_IFTYPE_AP) |
| 237 | return -EINVAL; | 238 | return -EINVAL; |
| 238 | 239 | ||
| 240 | if (test_sta_flags(sta, WLAN_STA_DISASSOC)) { | ||
| 241 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
| 242 | printk(KERN_DEBUG "Disassociation is in progress. " | ||
| 243 | "Denying BA session request\n"); | ||
| 244 | #endif | ||
| 245 | return -EINVAL; | ||
| 246 | } | ||
| 247 | |||
| 239 | if (test_sta_flags(sta, WLAN_STA_SUSPEND)) { | 248 | if (test_sta_flags(sta, WLAN_STA_SUSPEND)) { |
| 240 | #ifdef CONFIG_MAC80211_HT_DEBUG | 249 | #ifdef CONFIG_MAC80211_HT_DEBUG |
| 241 | printk(KERN_DEBUG "Suspend in progress. " | 250 | printk(KERN_DEBUG "Suspend in progress. " |
| @@ -301,10 +310,9 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid) | |||
| 301 | * call back right away, it must see that the flow has begun */ | 310 | * call back right away, it must see that the flow has begun */ |
| 302 | *state |= HT_ADDBA_REQUESTED_MSK; | 311 | *state |= HT_ADDBA_REQUESTED_MSK; |
| 303 | 312 | ||
| 304 | start_seq_num = sta->tid_seq[tid]; | 313 | start_seq_num = sta->tid_seq[tid] >> 4; |
| 305 | 314 | ||
| 306 | ret = drv_ampdu_action(local, &sdata->vif, | 315 | ret = drv_ampdu_action(local, sdata, IEEE80211_AMPDU_TX_START, |
| 307 | IEEE80211_AMPDU_TX_START, | ||
| 308 | pubsta, tid, &start_seq_num); | 316 | pubsta, tid, &start_seq_num); |
| 309 | 317 | ||
| 310 | if (ret) { | 318 | if (ret) { |
| @@ -420,7 +428,7 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local, | |||
| 420 | ieee80211_agg_splice_finish(local, sta, tid); | 428 | ieee80211_agg_splice_finish(local, sta, tid); |
| 421 | spin_unlock(&local->ampdu_lock); | 429 | spin_unlock(&local->ampdu_lock); |
| 422 | 430 | ||
| 423 | drv_ampdu_action(local, &sta->sdata->vif, | 431 | drv_ampdu_action(local, sta->sdata, |
| 424 | IEEE80211_AMPDU_TX_OPERATIONAL, | 432 | IEEE80211_AMPDU_TX_OPERATIONAL, |
| 425 | &sta->sta, tid, NULL); | 433 | &sta->sta, tid, NULL); |
| 426 | } | 434 | } |
| @@ -441,7 +449,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid) | |||
| 441 | } | 449 | } |
| 442 | 450 | ||
| 443 | rcu_read_lock(); | 451 | rcu_read_lock(); |
| 444 | sta = sta_info_get(local, ra); | 452 | sta = sta_info_get(sdata, ra); |
| 445 | if (!sta) { | 453 | if (!sta) { |
| 446 | rcu_read_unlock(); | 454 | rcu_read_unlock(); |
| 447 | #ifdef CONFIG_MAC80211_HT_DEBUG | 455 | #ifdef CONFIG_MAC80211_HT_DEBUG |
| @@ -489,7 +497,7 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, | |||
| 489 | #ifdef CONFIG_MAC80211_HT_DEBUG | 497 | #ifdef CONFIG_MAC80211_HT_DEBUG |
| 490 | if (net_ratelimit()) | 498 | if (net_ratelimit()) |
| 491 | printk(KERN_WARNING "%s: Not enough memory, " | 499 | printk(KERN_WARNING "%s: Not enough memory, " |
| 492 | "dropping start BA session", skb->dev->name); | 500 | "dropping start BA session", sdata->name); |
| 493 | #endif | 501 | #endif |
| 494 | return; | 502 | return; |
| 495 | } | 503 | } |
| @@ -564,7 +572,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid) | |||
| 564 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | 572 | #endif /* CONFIG_MAC80211_HT_DEBUG */ |
| 565 | 573 | ||
| 566 | rcu_read_lock(); | 574 | rcu_read_lock(); |
| 567 | sta = sta_info_get(local, ra); | 575 | sta = sta_info_get(sdata, ra); |
| 568 | if (!sta) { | 576 | if (!sta) { |
| 569 | #ifdef CONFIG_MAC80211_HT_DEBUG | 577 | #ifdef CONFIG_MAC80211_HT_DEBUG |
| 570 | printk(KERN_DEBUG "Could not find station: %pM\n", ra); | 578 | printk(KERN_DEBUG "Could not find station: %pM\n", ra); |
| @@ -621,7 +629,7 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, | |||
| 621 | #ifdef CONFIG_MAC80211_HT_DEBUG | 629 | #ifdef CONFIG_MAC80211_HT_DEBUG |
| 622 | if (net_ratelimit()) | 630 | if (net_ratelimit()) |
| 623 | printk(KERN_WARNING "%s: Not enough memory, " | 631 | printk(KERN_WARNING "%s: Not enough memory, " |
| 624 | "dropping stop BA session", skb->dev->name); | 632 | "dropping stop BA session", sdata->name); |
| 625 | #endif | 633 | #endif |
| 626 | return; | 634 | return; |
| 627 | } | 635 | } |
