aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ar9170/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ar9170/main.c')
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c70
1 files changed, 36 insertions, 34 deletions
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 91797cb6e0e8..8a964f130367 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -2329,54 +2329,55 @@ out:
2329 return err; 2329 return err;
2330} 2330}
2331 2331
2332static void ar9170_sta_notify(struct ieee80211_hw *hw, 2332static int ar9170_sta_add(struct ieee80211_hw *hw,
2333 struct ieee80211_vif *vif, 2333 struct ieee80211_vif *vif,
2334 enum sta_notify_cmd cmd, 2334 struct ieee80211_sta *sta)
2335 struct ieee80211_sta *sta)
2336{ 2335{
2337 struct ar9170 *ar = hw->priv; 2336 struct ar9170 *ar = hw->priv;
2338 struct ar9170_sta_info *sta_info = (void *) sta->drv_priv; 2337 struct ar9170_sta_info *sta_info = (void *) sta->drv_priv;
2339 unsigned int i; 2338 unsigned int i;
2340 2339
2341 switch (cmd) { 2340 memset(sta_info, 0, sizeof(*sta_info));
2342 case STA_NOTIFY_ADD:
2343 memset(sta_info, 0, sizeof(*sta_info));
2344 2341
2345 if (!sta->ht_cap.ht_supported) 2342 if (!sta->ht_cap.ht_supported)
2346 break; 2343 return 0;
2347 2344
2348 if (sta->ht_cap.ampdu_density > ar->global_ampdu_density) 2345 if (sta->ht_cap.ampdu_density > ar->global_ampdu_density)
2349 ar->global_ampdu_density = sta->ht_cap.ampdu_density; 2346 ar->global_ampdu_density = sta->ht_cap.ampdu_density;
2350 2347
2351 if (sta->ht_cap.ampdu_factor < ar->global_ampdu_factor) 2348 if (sta->ht_cap.ampdu_factor < ar->global_ampdu_factor)
2352 ar->global_ampdu_factor = sta->ht_cap.ampdu_factor; 2349 ar->global_ampdu_factor = sta->ht_cap.ampdu_factor;
2353 2350
2354 for (i = 0; i < AR9170_NUM_TID; i++) { 2351 for (i = 0; i < AR9170_NUM_TID; i++) {
2355 sta_info->agg[i].state = AR9170_TID_STATE_SHUTDOWN; 2352 sta_info->agg[i].state = AR9170_TID_STATE_SHUTDOWN;
2356 sta_info->agg[i].active = false; 2353 sta_info->agg[i].active = false;
2357 sta_info->agg[i].ssn = 0; 2354 sta_info->agg[i].ssn = 0;
2358 sta_info->agg[i].tid = i; 2355 sta_info->agg[i].tid = i;
2359 INIT_LIST_HEAD(&sta_info->agg[i].list); 2356 INIT_LIST_HEAD(&sta_info->agg[i].list);
2360 skb_queue_head_init(&sta_info->agg[i].queue); 2357 skb_queue_head_init(&sta_info->agg[i].queue);
2361 } 2358 }
2362 2359
2363 sta_info->ampdu_max_len = 1 << (3 + sta->ht_cap.ampdu_factor); 2360 sta_info->ampdu_max_len = 1 << (3 + sta->ht_cap.ampdu_factor);
2364 break;
2365 2361
2366 case STA_NOTIFY_REMOVE: 2362 return 0;
2367 if (!sta->ht_cap.ht_supported) 2363}
2368 break;
2369 2364
2370 for (i = 0; i < AR9170_NUM_TID; i++) { 2365static int ar9170_sta_remove(struct ieee80211_hw *hw,
2371 sta_info->agg[i].state = AR9170_TID_STATE_INVALID; 2366 struct ieee80211_vif *vif,
2372 skb_queue_purge(&sta_info->agg[i].queue); 2367 struct ieee80211_sta *sta)
2373 } 2368{
2369 struct ar9170_sta_info *sta_info = (void *) sta->drv_priv;
2370 unsigned int i;
2374 2371
2375 break; 2372 if (!sta->ht_cap.ht_supported)
2373 return 0;
2376 2374
2377 default: 2375 for (i = 0; i < AR9170_NUM_TID; i++) {
2378 break; 2376 sta_info->agg[i].state = AR9170_TID_STATE_INVALID;
2377 skb_queue_purge(&sta_info->agg[i].queue);
2379 } 2378 }
2379
2380 return 0;
2380} 2381}
2381 2382
2382static int ar9170_get_stats(struct ieee80211_hw *hw, 2383static int ar9170_get_stats(struct ieee80211_hw *hw,
@@ -2495,7 +2496,8 @@ static const struct ieee80211_ops ar9170_ops = {
2495 .bss_info_changed = ar9170_op_bss_info_changed, 2496 .bss_info_changed = ar9170_op_bss_info_changed,
2496 .get_tsf = ar9170_op_get_tsf, 2497 .get_tsf = ar9170_op_get_tsf,
2497 .set_key = ar9170_set_key, 2498 .set_key = ar9170_set_key,
2498 .sta_notify = ar9170_sta_notify, 2499 .sta_add = ar9170_sta_add,
2500 .sta_remove = ar9170_sta_remove,
2499 .get_stats = ar9170_get_stats, 2501 .get_stats = ar9170_get_stats,
2500 .ampdu_action = ar9170_ampdu_action, 2502 .ampdu_action = ar9170_ampdu_action,
2501}; 2503};