aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-03-11 14:11:11 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-03-11 14:11:11 -0500
commit409ec36c320d580a036045e603f96286c362c609 (patch)
tree3dd9b3569799f7962b523a068052445e2d2c51aa /net/mac80211
parent1b7fe59322bef9e7a2c05b64a07a66b875299736 (diff)
parent8d5eab5aa676378b4c9daa62d10d08a0bca04677 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/key.h1
-rw-r--r--net/mac80211/main.c3
-rw-r--r--net/mac80211/rc80211_minstrel_ht.c19
-rw-r--r--net/mac80211/rc80211_pid.h3
-rw-r--r--net/mac80211/scan.c64
-rw-r--r--net/mac80211/work.c1
6 files changed, 33 insertions, 58 deletions
diff --git a/net/mac80211/key.h b/net/mac80211/key.h
index 8106aa1b7466..4ddbe27eb570 100644
--- a/net/mac80211/key.h
+++ b/net/mac80211/key.h
@@ -21,7 +21,6 @@
21 21
22#define WEP_IV_LEN 4 22#define WEP_IV_LEN 4
23#define WEP_ICV_LEN 4 23#define WEP_ICV_LEN 4
24#define ALG_TKIP_KEY_LEN 32
25#define ALG_CCMP_KEY_LEN 16 24#define ALG_CCMP_KEY_LEN 16
26#define CCMP_HDR_LEN 8 25#define CCMP_HDR_LEN 8
27#define CCMP_MIC_LEN 8 26#define CCMP_MIC_LEN 8
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 2543e48bd813..562d2984c482 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -380,6 +380,9 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw)
380 380
381 trace_api_restart_hw(local); 381 trace_api_restart_hw(local);
382 382
383 wiphy_info(hw->wiphy,
384 "Hardware restart was requested\n");
385
383 /* use this reason, ieee80211_reconfig will unblock it */ 386 /* use this reason, ieee80211_reconfig will unblock it */
384 ieee80211_stop_queues_by_reason(hw, 387 ieee80211_stop_queues_by_reason(hw,
385 IEEE80211_QUEUE_STOP_REASON_SUSPEND); 388 IEEE80211_QUEUE_STOP_REASON_SUSPEND);
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 165a4518bb48..bce14fbfc3b6 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -415,10 +415,8 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
415 mi->sample_count--; 415 mi->sample_count--;
416 } 416 }
417 417
418 if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE) { 418 if (info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)
419 mi->sample_packets += info->status.ampdu_len; 419 mi->sample_packets += info->status.ampdu_len;
420 minstrel_next_sample_idx(mi);
421 }
422 420
423 for (i = 0; !last; i++) { 421 for (i = 0; !last; i++) {
424 last = (i == IEEE80211_TX_MAX_RATES - 1) || 422 last = (i == IEEE80211_TX_MAX_RATES - 1) ||
@@ -519,9 +517,7 @@ minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
519 rate->count = mr->retry_count; 517 rate->count = mr->retry_count;
520 518
521 rate->flags = IEEE80211_TX_RC_MCS | group->flags; 519 rate->flags = IEEE80211_TX_RC_MCS | group->flags;
522 if (txrc->short_preamble) 520 if (rtscts)
523 rate->flags |= IEEE80211_TX_RC_USE_SHORT_PREAMBLE;
524 if (txrc->rts || rtscts)
525 rate->flags |= IEEE80211_TX_RC_USE_RTS_CTS; 521 rate->flags |= IEEE80211_TX_RC_USE_RTS_CTS;
526 rate->idx = index % MCS_GROUP_RATES + (group->streams - 1) * MCS_GROUP_RATES; 522 rate->idx = index % MCS_GROUP_RATES + (group->streams - 1) * MCS_GROUP_RATES;
527} 523}
@@ -553,13 +549,14 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
553 sample_idx = sample_table[mg->column][mg->index]; 549 sample_idx = sample_table[mg->column][mg->index];
554 mr = &mg->rates[sample_idx]; 550 mr = &mg->rates[sample_idx];
555 sample_idx += mi->sample_group * MCS_GROUP_RATES; 551 sample_idx += mi->sample_group * MCS_GROUP_RATES;
552 minstrel_next_sample_idx(mi);
556 553
557 /* 554 /*
558 * When not using MRR, do not sample if the probability is already 555 * When not using MRR, do not sample if the probability is already
559 * higher than 95% to avoid wasting airtime 556 * higher than 95% to avoid wasting airtime
560 */ 557 */
561 if (!mp->has_mrr && (mr->probability > MINSTREL_FRAC(95, 100))) 558 if (!mp->has_mrr && (mr->probability > MINSTREL_FRAC(95, 100)))
562 goto next; 559 return -1;
563 560
564 /* 561 /*
565 * Make sure that lower rates get sampled only occasionally, 562 * Make sure that lower rates get sampled only occasionally,
@@ -568,17 +565,13 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
568 if (minstrel_get_duration(sample_idx) > 565 if (minstrel_get_duration(sample_idx) >
569 minstrel_get_duration(mi->max_tp_rate)) { 566 minstrel_get_duration(mi->max_tp_rate)) {
570 if (mr->sample_skipped < 20) 567 if (mr->sample_skipped < 20)
571 goto next; 568 return -1;
572 569
573 if (mi->sample_slow++ > 2) 570 if (mi->sample_slow++ > 2)
574 goto next; 571 return -1;
575 } 572 }
576 573
577 return sample_idx; 574 return sample_idx;
578
579next:
580 minstrel_next_sample_idx(mi);
581 return -1;
582} 575}
583 576
584static void 577static void
diff --git a/net/mac80211/rc80211_pid.h b/net/mac80211/rc80211_pid.h
index 1a873f00691a..6510f8ee738e 100644
--- a/net/mac80211/rc80211_pid.h
+++ b/net/mac80211/rc80211_pid.h
@@ -24,9 +24,6 @@
24/* Fixed point arithmetic shifting amount. */ 24/* Fixed point arithmetic shifting amount. */
25#define RC_PID_ARITH_SHIFT 8 25#define RC_PID_ARITH_SHIFT 8
26 26
27/* Fixed point arithmetic factor. */
28#define RC_PID_ARITH_FACTOR (1 << RC_PID_ARITH_SHIFT)
29
30/* Proportional PID component coefficient. */ 27/* Proportional PID component coefficient. */
31#define RC_PID_COEFF_P 15 28#define RC_PID_COEFF_P 15
32/* Integral PID component coefficient. */ 29/* Integral PID component coefficient. */
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 842954509925..489b6ad200d4 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -258,10 +258,12 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
258 return true; 258 return true;
259} 259}
260 260
261static bool __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted, 261static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
262 bool was_hw_scan) 262 bool was_hw_scan)
263{ 263{
264 struct ieee80211_local *local = hw_to_local(hw); 264 struct ieee80211_local *local = hw_to_local(hw);
265 bool on_oper_chan;
266 bool enable_beacons = false;
265 267
266 lockdep_assert_held(&local->mtx); 268 lockdep_assert_held(&local->mtx);
267 269
@@ -275,12 +277,12 @@ static bool __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
275 aborted = true; 277 aborted = true;
276 278
277 if (WARN_ON(!local->scan_req)) 279 if (WARN_ON(!local->scan_req))
278 return false; 280 return;
279 281
280 if (was_hw_scan && !aborted && ieee80211_prep_hw_scan(local)) { 282 if (was_hw_scan && !aborted && ieee80211_prep_hw_scan(local)) {
281 int rc = drv_hw_scan(local, local->scan_sdata, local->hw_scan_req); 283 int rc = drv_hw_scan(local, local->scan_sdata, local->hw_scan_req);
282 if (rc == 0) 284 if (rc == 0)
283 return false; 285 return;
284 } 286 }
285 287
286 kfree(local->hw_scan_req); 288 kfree(local->hw_scan_req);
@@ -294,26 +296,11 @@ static bool __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
294 local->scanning = 0; 296 local->scanning = 0;
295 local->scan_channel = NULL; 297 local->scan_channel = NULL;
296 298
297 return true;
298}
299
300static void __ieee80211_scan_completed_finish(struct ieee80211_hw *hw,
301 bool was_hw_scan)
302{
303 struct ieee80211_local *local = hw_to_local(hw);
304 bool on_oper_chan;
305 bool enable_beacons = false;
306
307 mutex_lock(&local->mtx);
308 on_oper_chan = ieee80211_cfg_on_oper_channel(local); 299 on_oper_chan = ieee80211_cfg_on_oper_channel(local);
309 300
310 WARN_ON(local->scanning & (SCAN_SW_SCANNING | SCAN_HW_SCANNING)); 301 if (was_hw_scan || !on_oper_chan)
311
312 if (was_hw_scan || !on_oper_chan) {
313 if (WARN_ON(local->scan_channel))
314 local->scan_channel = NULL;
315 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); 302 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
316 } else 303 else
317 /* Set power back to normal operating levels. */ 304 /* Set power back to normal operating levels. */
318 ieee80211_hw_config(local, 0); 305 ieee80211_hw_config(local, 0);
319 306
@@ -331,7 +318,6 @@ static void __ieee80211_scan_completed_finish(struct ieee80211_hw *hw,
331 } 318 }
332 319
333 ieee80211_recalc_idle(local); 320 ieee80211_recalc_idle(local);
334 mutex_unlock(&local->mtx);
335 321
336 ieee80211_mlme_notify_scan_completed(local); 322 ieee80211_mlme_notify_scan_completed(local);
337 ieee80211_ibss_notify_scan_completed(local); 323 ieee80211_ibss_notify_scan_completed(local);
@@ -686,12 +672,14 @@ void ieee80211_scan_work(struct work_struct *work)
686{ 672{
687 struct ieee80211_local *local = 673 struct ieee80211_local *local =
688 container_of(work, struct ieee80211_local, scan_work.work); 674 container_of(work, struct ieee80211_local, scan_work.work);
689 struct ieee80211_sub_if_data *sdata = local->scan_sdata; 675 struct ieee80211_sub_if_data *sdata;
690 unsigned long next_delay = 0; 676 unsigned long next_delay = 0;
691 bool aborted, hw_scan, finish; 677 bool aborted, hw_scan;
692 678
693 mutex_lock(&local->mtx); 679 mutex_lock(&local->mtx);
694 680
681 sdata = local->scan_sdata;
682
695 if (test_and_clear_bit(SCAN_COMPLETED, &local->scanning)) { 683 if (test_and_clear_bit(SCAN_COMPLETED, &local->scanning)) {
696 aborted = test_and_clear_bit(SCAN_ABORTED, &local->scanning); 684 aborted = test_and_clear_bit(SCAN_ABORTED, &local->scanning);
697 goto out_complete; 685 goto out_complete;
@@ -755,17 +743,11 @@ void ieee80211_scan_work(struct work_struct *work)
755 } while (next_delay == 0); 743 } while (next_delay == 0);
756 744
757 ieee80211_queue_delayed_work(&local->hw, &local->scan_work, next_delay); 745 ieee80211_queue_delayed_work(&local->hw, &local->scan_work, next_delay);
758 mutex_unlock(&local->mtx); 746 goto out;
759 return;
760 747
761out_complete: 748out_complete:
762 hw_scan = test_bit(SCAN_HW_SCANNING, &local->scanning); 749 hw_scan = test_bit(SCAN_HW_SCANNING, &local->scanning);
763 finish = __ieee80211_scan_completed(&local->hw, aborted, hw_scan); 750 __ieee80211_scan_completed(&local->hw, aborted, hw_scan);
764 mutex_unlock(&local->mtx);
765 if (finish)
766 __ieee80211_scan_completed_finish(&local->hw, hw_scan);
767 return;
768
769out: 751out:
770 mutex_unlock(&local->mtx); 752 mutex_unlock(&local->mtx);
771} 753}
@@ -835,7 +817,6 @@ int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata,
835void ieee80211_scan_cancel(struct ieee80211_local *local) 817void ieee80211_scan_cancel(struct ieee80211_local *local)
836{ 818{
837 bool abortscan; 819 bool abortscan;
838 bool finish = false;
839 820
840 /* 821 /*
841 * We are only canceling software scan, or deferred scan that was not 822 * We are only canceling software scan, or deferred scan that was not
@@ -855,14 +836,17 @@ void ieee80211_scan_cancel(struct ieee80211_local *local)
855 836
856 mutex_lock(&local->mtx); 837 mutex_lock(&local->mtx);
857 abortscan = local->scan_req && !test_bit(SCAN_HW_SCANNING, &local->scanning); 838 abortscan = local->scan_req && !test_bit(SCAN_HW_SCANNING, &local->scanning);
858 if (abortscan)
859 finish = __ieee80211_scan_completed(&local->hw, true, false);
860 mutex_unlock(&local->mtx);
861
862 if (abortscan) { 839 if (abortscan) {
863 /* The scan is canceled, but stop work from being pending */ 840 /*
864 cancel_delayed_work_sync(&local->scan_work); 841 * The scan is canceled, but stop work from being pending.
842 *
843 * If the work is currently running, it must be blocked on
844 * the mutex, but we'll set scan_sdata = NULL and it'll
845 * simply exit once it acquires the mutex.
846 */
847 cancel_delayed_work(&local->scan_work);
848 /* and clean up */
849 __ieee80211_scan_completed(&local->hw, true, false);
865 } 850 }
866 if (finish) 851 mutex_unlock(&local->mtx);
867 __ieee80211_scan_completed_finish(&local->hw, false);
868} 852}
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 204f0a4db969..e73c8cae036b 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -30,7 +30,6 @@
30#define IEEE80211_AUTH_MAX_TRIES 3 30#define IEEE80211_AUTH_MAX_TRIES 3
31#define IEEE80211_ASSOC_TIMEOUT (HZ / 5) 31#define IEEE80211_ASSOC_TIMEOUT (HZ / 5)
32#define IEEE80211_ASSOC_MAX_TRIES 3 32#define IEEE80211_ASSOC_MAX_TRIES 3
33#define IEEE80211_MAX_PROBE_TRIES 5
34 33
35enum work_action { 34enum work_action {
36 WORK_ACT_MISMATCH, 35 WORK_ACT_MISMATCH,