diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 302 |
1 files changed, 151 insertions, 151 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 2ed0bd28ffb..dacf97afe76 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -140,11 +140,11 @@ static void ath_update_txpow(struct ath_softc *sc) | |||
140 | struct ath_hal *ah = sc->sc_ah; | 140 | struct ath_hal *ah = sc->sc_ah; |
141 | u32 txpow; | 141 | u32 txpow; |
142 | 142 | ||
143 | if (sc->sc_curtxpow != sc->sc_config.txpowlimit) { | 143 | if (sc->curtxpow != sc->config.txpowlimit) { |
144 | ath9k_hw_set_txpowerlimit(ah, sc->sc_config.txpowlimit); | 144 | ath9k_hw_set_txpowerlimit(ah, sc->config.txpowlimit); |
145 | /* read back in case value is clamped */ | 145 | /* read back in case value is clamped */ |
146 | ath9k_hw_getcapability(ah, ATH9K_CAP_TXPOW, 1, &txpow); | 146 | ath9k_hw_getcapability(ah, ATH9K_CAP_TXPOW, 1, &txpow); |
147 | sc->sc_curtxpow = txpow; | 147 | sc->curtxpow = txpow; |
148 | } | 148 | } |
149 | } | 149 | } |
150 | 150 | ||
@@ -294,7 +294,7 @@ static int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan) | |||
294 | 294 | ||
295 | ath_cache_conf_rate(sc, &hw->conf); | 295 | ath_cache_conf_rate(sc, &hw->conf); |
296 | ath_update_txpow(sc); | 296 | ath_update_txpow(sc); |
297 | ath9k_hw_set_interrupts(ah, sc->sc_imask); | 297 | ath9k_hw_set_interrupts(ah, sc->imask); |
298 | ath9k_ps_restore(sc); | 298 | ath9k_ps_restore(sc); |
299 | return 0; | 299 | return 0; |
300 | } | 300 | } |
@@ -327,42 +327,42 @@ static void ath_ani_calibrate(unsigned long data) | |||
327 | return; | 327 | return; |
328 | 328 | ||
329 | /* Long calibration runs independently of short calibration. */ | 329 | /* Long calibration runs independently of short calibration. */ |
330 | if ((timestamp - sc->sc_ani.sc_longcal_timer) >= ATH_LONG_CALINTERVAL) { | 330 | if ((timestamp - sc->ani.longcal_timer) >= ATH_LONG_CALINTERVAL) { |
331 | longcal = true; | 331 | longcal = true; |
332 | DPRINTF(sc, ATH_DBG_ANI, "longcal @%lu\n", jiffies); | 332 | DPRINTF(sc, ATH_DBG_ANI, "longcal @%lu\n", jiffies); |
333 | sc->sc_ani.sc_longcal_timer = timestamp; | 333 | sc->ani.longcal_timer = timestamp; |
334 | } | 334 | } |
335 | 335 | ||
336 | /* Short calibration applies only while sc_caldone is false */ | 336 | /* Short calibration applies only while caldone is false */ |
337 | if (!sc->sc_ani.sc_caldone) { | 337 | if (!sc->ani.caldone) { |
338 | if ((timestamp - sc->sc_ani.sc_shortcal_timer) >= | 338 | if ((timestamp - sc->ani.shortcal_timer) >= |
339 | ATH_SHORT_CALINTERVAL) { | 339 | ATH_SHORT_CALINTERVAL) { |
340 | shortcal = true; | 340 | shortcal = true; |
341 | DPRINTF(sc, ATH_DBG_ANI, "shortcal @%lu\n", jiffies); | 341 | DPRINTF(sc, ATH_DBG_ANI, "shortcal @%lu\n", jiffies); |
342 | sc->sc_ani.sc_shortcal_timer = timestamp; | 342 | sc->ani.shortcal_timer = timestamp; |
343 | sc->sc_ani.sc_resetcal_timer = timestamp; | 343 | sc->ani.resetcal_timer = timestamp; |
344 | } | 344 | } |
345 | } else { | 345 | } else { |
346 | if ((timestamp - sc->sc_ani.sc_resetcal_timer) >= | 346 | if ((timestamp - sc->ani.resetcal_timer) >= |
347 | ATH_RESTART_CALINTERVAL) { | 347 | ATH_RESTART_CALINTERVAL) { |
348 | sc->sc_ani.sc_caldone = ath9k_hw_reset_calvalid(ah); | 348 | sc->ani.caldone = ath9k_hw_reset_calvalid(ah); |
349 | if (sc->sc_ani.sc_caldone) | 349 | if (sc->ani.caldone) |
350 | sc->sc_ani.sc_resetcal_timer = timestamp; | 350 | sc->ani.resetcal_timer = timestamp; |
351 | } | 351 | } |
352 | } | 352 | } |
353 | 353 | ||
354 | /* Verify whether we must check ANI */ | 354 | /* Verify whether we must check ANI */ |
355 | if ((timestamp - sc->sc_ani.sc_checkani_timer) >= | 355 | if ((timestamp - sc->ani.checkani_timer) >= |
356 | ATH_ANI_POLLINTERVAL) { | 356 | ATH_ANI_POLLINTERVAL) { |
357 | aniflag = true; | 357 | aniflag = true; |
358 | sc->sc_ani.sc_checkani_timer = timestamp; | 358 | sc->ani.checkani_timer = timestamp; |
359 | } | 359 | } |
360 | 360 | ||
361 | /* Skip all processing if there's nothing to do. */ | 361 | /* Skip all processing if there's nothing to do. */ |
362 | if (longcal || shortcal || aniflag) { | 362 | if (longcal || shortcal || aniflag) { |
363 | /* Call ANI routine if necessary */ | 363 | /* Call ANI routine if necessary */ |
364 | if (aniflag) | 364 | if (aniflag) |
365 | ath9k_hw_ani_monitor(ah, &sc->sc_halstats, | 365 | ath9k_hw_ani_monitor(ah, &sc->nodestats, |
366 | ah->ah_curchan); | 366 | ah->ah_curchan); |
367 | 367 | ||
368 | /* Perform calibration if necessary */ | 368 | /* Perform calibration if necessary */ |
@@ -370,10 +370,10 @@ static void ath_ani_calibrate(unsigned long data) | |||
370 | bool iscaldone = false; | 370 | bool iscaldone = false; |
371 | 371 | ||
372 | if (ath9k_hw_calibrate(ah, ah->ah_curchan, | 372 | if (ath9k_hw_calibrate(ah, ah->ah_curchan, |
373 | sc->sc_rx_chainmask, longcal, | 373 | sc->rx_chainmask, longcal, |
374 | &iscaldone)) { | 374 | &iscaldone)) { |
375 | if (longcal) | 375 | if (longcal) |
376 | sc->sc_ani.sc_noise_floor = | 376 | sc->ani.noise_floor = |
377 | ath9k_hw_getchan_noise(ah, | 377 | ath9k_hw_getchan_noise(ah, |
378 | ah->ah_curchan); | 378 | ah->ah_curchan); |
379 | 379 | ||
@@ -381,14 +381,14 @@ static void ath_ani_calibrate(unsigned long data) | |||
381 | "calibrate chan %u/%x nf: %d\n", | 381 | "calibrate chan %u/%x nf: %d\n", |
382 | ah->ah_curchan->channel, | 382 | ah->ah_curchan->channel, |
383 | ah->ah_curchan->channelFlags, | 383 | ah->ah_curchan->channelFlags, |
384 | sc->sc_ani.sc_noise_floor); | 384 | sc->ani.noise_floor); |
385 | } else { | 385 | } else { |
386 | DPRINTF(sc, ATH_DBG_ANY, | 386 | DPRINTF(sc, ATH_DBG_ANY, |
387 | "calibrate chan %u/%x failed\n", | 387 | "calibrate chan %u/%x failed\n", |
388 | ah->ah_curchan->channel, | 388 | ah->ah_curchan->channel, |
389 | ah->ah_curchan->channelFlags); | 389 | ah->ah_curchan->channelFlags); |
390 | } | 390 | } |
391 | sc->sc_ani.sc_caldone = iscaldone; | 391 | sc->ani.caldone = iscaldone; |
392 | } | 392 | } |
393 | } | 393 | } |
394 | 394 | ||
@@ -400,10 +400,10 @@ static void ath_ani_calibrate(unsigned long data) | |||
400 | cal_interval = ATH_LONG_CALINTERVAL; | 400 | cal_interval = ATH_LONG_CALINTERVAL; |
401 | if (sc->sc_ah->ah_config.enable_ani) | 401 | if (sc->sc_ah->ah_config.enable_ani) |
402 | cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL); | 402 | cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL); |
403 | if (!sc->sc_ani.sc_caldone) | 403 | if (!sc->ani.caldone) |
404 | cal_interval = min(cal_interval, (u32)ATH_SHORT_CALINTERVAL); | 404 | cal_interval = min(cal_interval, (u32)ATH_SHORT_CALINTERVAL); |
405 | 405 | ||
406 | mod_timer(&sc->sc_ani.timer, jiffies + msecs_to_jiffies(cal_interval)); | 406 | mod_timer(&sc->ani.timer, jiffies + msecs_to_jiffies(cal_interval)); |
407 | } | 407 | } |
408 | 408 | ||
409 | /* | 409 | /* |
@@ -417,15 +417,15 @@ static void ath_update_chainmask(struct ath_softc *sc, int is_ht) | |||
417 | sc->sc_flags |= SC_OP_CHAINMASK_UPDATE; | 417 | sc->sc_flags |= SC_OP_CHAINMASK_UPDATE; |
418 | if (is_ht || | 418 | if (is_ht || |
419 | (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_BT_COEX)) { | 419 | (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_BT_COEX)) { |
420 | sc->sc_tx_chainmask = sc->sc_ah->ah_caps.tx_chainmask; | 420 | sc->tx_chainmask = sc->sc_ah->ah_caps.tx_chainmask; |
421 | sc->sc_rx_chainmask = sc->sc_ah->ah_caps.rx_chainmask; | 421 | sc->rx_chainmask = sc->sc_ah->ah_caps.rx_chainmask; |
422 | } else { | 422 | } else { |
423 | sc->sc_tx_chainmask = 1; | 423 | sc->tx_chainmask = 1; |
424 | sc->sc_rx_chainmask = 1; | 424 | sc->rx_chainmask = 1; |
425 | } | 425 | } |
426 | 426 | ||
427 | DPRINTF(sc, ATH_DBG_CONFIG, "tx chmask: %d, rx chmask: %d\n", | 427 | DPRINTF(sc, ATH_DBG_CONFIG, "tx chmask: %d, rx chmask: %d\n", |
428 | sc->sc_tx_chainmask, sc->sc_rx_chainmask); | 428 | sc->tx_chainmask, sc->rx_chainmask); |
429 | } | 429 | } |
430 | 430 | ||
431 | static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta) | 431 | static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta) |
@@ -453,7 +453,7 @@ static void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta) | |||
453 | static void ath9k_tasklet(unsigned long data) | 453 | static void ath9k_tasklet(unsigned long data) |
454 | { | 454 | { |
455 | struct ath_softc *sc = (struct ath_softc *)data; | 455 | struct ath_softc *sc = (struct ath_softc *)data; |
456 | u32 status = sc->sc_intrstatus; | 456 | u32 status = sc->intrstatus; |
457 | 457 | ||
458 | if (status & ATH9K_INT_FATAL) { | 458 | if (status & ATH9K_INT_FATAL) { |
459 | /* need a chip reset */ | 459 | /* need a chip reset */ |
@@ -473,7 +473,7 @@ static void ath9k_tasklet(unsigned long data) | |||
473 | } | 473 | } |
474 | 474 | ||
475 | /* re-enable hardware interrupt */ | 475 | /* re-enable hardware interrupt */ |
476 | ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_imask); | 476 | ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); |
477 | } | 477 | } |
478 | 478 | ||
479 | irqreturn_t ath_isr(int irq, void *dev) | 479 | irqreturn_t ath_isr(int irq, void *dev) |
@@ -504,7 +504,7 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
504 | */ | 504 | */ |
505 | ath9k_hw_getisr(ah, &status); /* NB: clears ISR too */ | 505 | ath9k_hw_getisr(ah, &status); /* NB: clears ISR too */ |
506 | 506 | ||
507 | status &= sc->sc_imask; /* discard unasked-for bits */ | 507 | status &= sc->imask; /* discard unasked-for bits */ |
508 | 508 | ||
509 | /* | 509 | /* |
510 | * If there are no status bits set, then this interrupt was not | 510 | * If there are no status bits set, then this interrupt was not |
@@ -513,7 +513,7 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
513 | if (!status) | 513 | if (!status) |
514 | return IRQ_NONE; | 514 | return IRQ_NONE; |
515 | 515 | ||
516 | sc->sc_intrstatus = status; | 516 | sc->intrstatus = status; |
517 | 517 | ||
518 | if (status & ATH9K_INT_FATAL) { | 518 | if (status & ATH9K_INT_FATAL) { |
519 | /* need a chip reset */ | 519 | /* need a chip reset */ |
@@ -560,8 +560,8 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
560 | * it will clear whatever condition caused | 560 | * it will clear whatever condition caused |
561 | * the interrupt. | 561 | * the interrupt. |
562 | */ | 562 | */ |
563 | ath9k_hw_procmibevent(ah, &sc->sc_halstats); | 563 | ath9k_hw_procmibevent(ah, &sc->nodestats); |
564 | ath9k_hw_set_interrupts(ah, sc->sc_imask); | 564 | ath9k_hw_set_interrupts(ah, sc->imask); |
565 | } | 565 | } |
566 | if (status & ATH9K_INT_TIM_TIMER) { | 566 | if (status & ATH9K_INT_TIM_TIMER) { |
567 | if (!(ah->ah_caps.hw_caps & | 567 | if (!(ah->ah_caps.hw_caps & |
@@ -581,7 +581,7 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
581 | 581 | ||
582 | if (sched) { | 582 | if (sched) { |
583 | /* turn off every interrupt except SWBA */ | 583 | /* turn off every interrupt except SWBA */ |
584 | ath9k_hw_set_interrupts(ah, (sc->sc_imask & ATH9K_INT_SWBA)); | 584 | ath9k_hw_set_interrupts(ah, (sc->imask & ATH9K_INT_SWBA)); |
585 | tasklet_schedule(&sc->intr_tq); | 585 | tasklet_schedule(&sc->intr_tq); |
586 | } | 586 | } |
587 | 587 | ||
@@ -656,7 +656,7 @@ static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key, | |||
656 | memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic)); | 656 | memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic)); |
657 | return ath_keyset(sc, keyix, hk, addr); | 657 | return ath_keyset(sc, keyix, hk, addr); |
658 | } | 658 | } |
659 | if (!sc->sc_splitmic) { | 659 | if (!sc->splitmic) { |
660 | /* | 660 | /* |
661 | * data key goes at first index, | 661 | * data key goes at first index, |
662 | * the hal handles the MIC keys at index+64. | 662 | * the hal handles the MIC keys at index+64. |
@@ -686,13 +686,13 @@ static int ath_reserve_key_cache_slot_tkip(struct ath_softc *sc) | |||
686 | { | 686 | { |
687 | int i; | 687 | int i; |
688 | 688 | ||
689 | for (i = IEEE80211_WEP_NKID; i < sc->sc_keymax / 2; i++) { | 689 | for (i = IEEE80211_WEP_NKID; i < sc->keymax / 2; i++) { |
690 | if (test_bit(i, sc->sc_keymap) || | 690 | if (test_bit(i, sc->keymap) || |
691 | test_bit(i + 64, sc->sc_keymap)) | 691 | test_bit(i + 64, sc->keymap)) |
692 | continue; /* At least one part of TKIP key allocated */ | 692 | continue; /* At least one part of TKIP key allocated */ |
693 | if (sc->sc_splitmic && | 693 | if (sc->splitmic && |
694 | (test_bit(i + 32, sc->sc_keymap) || | 694 | (test_bit(i + 32, sc->keymap) || |
695 | test_bit(i + 64 + 32, sc->sc_keymap))) | 695 | test_bit(i + 64 + 32, sc->keymap))) |
696 | continue; /* At least one part of TKIP key allocated */ | 696 | continue; /* At least one part of TKIP key allocated */ |
697 | 697 | ||
698 | /* Found a free slot for a TKIP key */ | 698 | /* Found a free slot for a TKIP key */ |
@@ -706,55 +706,55 @@ static int ath_reserve_key_cache_slot(struct ath_softc *sc) | |||
706 | int i; | 706 | int i; |
707 | 707 | ||
708 | /* First, try to find slots that would not be available for TKIP. */ | 708 | /* First, try to find slots that would not be available for TKIP. */ |
709 | if (sc->sc_splitmic) { | 709 | if (sc->splitmic) { |
710 | for (i = IEEE80211_WEP_NKID; i < sc->sc_keymax / 4; i++) { | 710 | for (i = IEEE80211_WEP_NKID; i < sc->keymax / 4; i++) { |
711 | if (!test_bit(i, sc->sc_keymap) && | 711 | if (!test_bit(i, sc->keymap) && |
712 | (test_bit(i + 32, sc->sc_keymap) || | 712 | (test_bit(i + 32, sc->keymap) || |
713 | test_bit(i + 64, sc->sc_keymap) || | 713 | test_bit(i + 64, sc->keymap) || |
714 | test_bit(i + 64 + 32, sc->sc_keymap))) | 714 | test_bit(i + 64 + 32, sc->keymap))) |
715 | return i; | 715 | return i; |
716 | if (!test_bit(i + 32, sc->sc_keymap) && | 716 | if (!test_bit(i + 32, sc->keymap) && |
717 | (test_bit(i, sc->sc_keymap) || | 717 | (test_bit(i, sc->keymap) || |
718 | test_bit(i + 64, sc->sc_keymap) || | 718 | test_bit(i + 64, sc->keymap) || |
719 | test_bit(i + 64 + 32, sc->sc_keymap))) | 719 | test_bit(i + 64 + 32, sc->keymap))) |
720 | return i + 32; | 720 | return i + 32; |
721 | if (!test_bit(i + 64, sc->sc_keymap) && | 721 | if (!test_bit(i + 64, sc->keymap) && |
722 | (test_bit(i , sc->sc_keymap) || | 722 | (test_bit(i , sc->keymap) || |
723 | test_bit(i + 32, sc->sc_keymap) || | 723 | test_bit(i + 32, sc->keymap) || |
724 | test_bit(i + 64 + 32, sc->sc_keymap))) | 724 | test_bit(i + 64 + 32, sc->keymap))) |
725 | return i + 64; | 725 | return i + 64; |
726 | if (!test_bit(i + 64 + 32, sc->sc_keymap) && | 726 | if (!test_bit(i + 64 + 32, sc->keymap) && |
727 | (test_bit(i, sc->sc_keymap) || | 727 | (test_bit(i, sc->keymap) || |
728 | test_bit(i + 32, sc->sc_keymap) || | 728 | test_bit(i + 32, sc->keymap) || |
729 | test_bit(i + 64, sc->sc_keymap))) | 729 | test_bit(i + 64, sc->keymap))) |
730 | return i + 64 + 32; | 730 | return i + 64 + 32; |
731 | } | 731 | } |
732 | } else { | 732 | } else { |
733 | for (i = IEEE80211_WEP_NKID; i < sc->sc_keymax / 2; i++) { | 733 | for (i = IEEE80211_WEP_NKID; i < sc->keymax / 2; i++) { |
734 | if (!test_bit(i, sc->sc_keymap) && | 734 | if (!test_bit(i, sc->keymap) && |
735 | test_bit(i + 64, sc->sc_keymap)) | 735 | test_bit(i + 64, sc->keymap)) |
736 | return i; | 736 | return i; |
737 | if (test_bit(i, sc->sc_keymap) && | 737 | if (test_bit(i, sc->keymap) && |
738 | !test_bit(i + 64, sc->sc_keymap)) | 738 | !test_bit(i + 64, sc->keymap)) |
739 | return i + 64; | 739 | return i + 64; |
740 | } | 740 | } |
741 | } | 741 | } |
742 | 742 | ||
743 | /* No partially used TKIP slots, pick any available slot */ | 743 | /* No partially used TKIP slots, pick any available slot */ |
744 | for (i = IEEE80211_WEP_NKID; i < sc->sc_keymax; i++) { | 744 | for (i = IEEE80211_WEP_NKID; i < sc->keymax; i++) { |
745 | /* Do not allow slots that could be needed for TKIP group keys | 745 | /* Do not allow slots that could be needed for TKIP group keys |
746 | * to be used. This limitation could be removed if we know that | 746 | * to be used. This limitation could be removed if we know that |
747 | * TKIP will not be used. */ | 747 | * TKIP will not be used. */ |
748 | if (i >= 64 && i < 64 + IEEE80211_WEP_NKID) | 748 | if (i >= 64 && i < 64 + IEEE80211_WEP_NKID) |
749 | continue; | 749 | continue; |
750 | if (sc->sc_splitmic) { | 750 | if (sc->splitmic) { |
751 | if (i >= 32 && i < 32 + IEEE80211_WEP_NKID) | 751 | if (i >= 32 && i < 32 + IEEE80211_WEP_NKID) |
752 | continue; | 752 | continue; |
753 | if (i >= 64 + 32 && i < 64 + 32 + IEEE80211_WEP_NKID) | 753 | if (i >= 64 + 32 && i < 64 + 32 + IEEE80211_WEP_NKID) |
754 | continue; | 754 | continue; |
755 | } | 755 | } |
756 | 756 | ||
757 | if (!test_bit(i, sc->sc_keymap)) | 757 | if (!test_bit(i, sc->keymap)) |
758 | return i; /* Found a free slot for a key */ | 758 | return i; /* Found a free slot for a key */ |
759 | } | 759 | } |
760 | 760 | ||
@@ -801,7 +801,7 @@ static int ath_key_config(struct ath_softc *sc, | |||
801 | return -EOPNOTSUPP; | 801 | return -EOPNOTSUPP; |
802 | mac = sta->addr; | 802 | mac = sta->addr; |
803 | 803 | ||
804 | vif = sc->sc_vaps[0]; | 804 | vif = sc->vifs[0]; |
805 | if (vif->type != NL80211_IFTYPE_AP) { | 805 | if (vif->type != NL80211_IFTYPE_AP) { |
806 | /* Only keyidx 0 should be used with unicast key, but | 806 | /* Only keyidx 0 should be used with unicast key, but |
807 | * allow this for client mode for now. */ | 807 | * allow this for client mode for now. */ |
@@ -829,12 +829,12 @@ static int ath_key_config(struct ath_softc *sc, | |||
829 | if (!ret) | 829 | if (!ret) |
830 | return -EIO; | 830 | return -EIO; |
831 | 831 | ||
832 | set_bit(idx, sc->sc_keymap); | 832 | set_bit(idx, sc->keymap); |
833 | if (key->alg == ALG_TKIP) { | 833 | if (key->alg == ALG_TKIP) { |
834 | set_bit(idx + 64, sc->sc_keymap); | 834 | set_bit(idx + 64, sc->keymap); |
835 | if (sc->sc_splitmic) { | 835 | if (sc->splitmic) { |
836 | set_bit(idx + 32, sc->sc_keymap); | 836 | set_bit(idx + 32, sc->keymap); |
837 | set_bit(idx + 64 + 32, sc->sc_keymap); | 837 | set_bit(idx + 64 + 32, sc->keymap); |
838 | } | 838 | } |
839 | } | 839 | } |
840 | 840 | ||
@@ -847,14 +847,14 @@ static void ath_key_delete(struct ath_softc *sc, struct ieee80211_key_conf *key) | |||
847 | if (key->hw_key_idx < IEEE80211_WEP_NKID) | 847 | if (key->hw_key_idx < IEEE80211_WEP_NKID) |
848 | return; | 848 | return; |
849 | 849 | ||
850 | clear_bit(key->hw_key_idx, sc->sc_keymap); | 850 | clear_bit(key->hw_key_idx, sc->keymap); |
851 | if (key->alg != ALG_TKIP) | 851 | if (key->alg != ALG_TKIP) |
852 | return; | 852 | return; |
853 | 853 | ||
854 | clear_bit(key->hw_key_idx + 64, sc->sc_keymap); | 854 | clear_bit(key->hw_key_idx + 64, sc->keymap); |
855 | if (sc->sc_splitmic) { | 855 | if (sc->splitmic) { |
856 | clear_bit(key->hw_key_idx + 32, sc->sc_keymap); | 856 | clear_bit(key->hw_key_idx + 32, sc->keymap); |
857 | clear_bit(key->hw_key_idx + 64 + 32, sc->sc_keymap); | 857 | clear_bit(key->hw_key_idx + 64 + 32, sc->keymap); |
858 | } | 858 | } |
859 | } | 859 | } |
860 | 860 | ||
@@ -876,7 +876,7 @@ static void setup_ht_cap(struct ath_softc *sc, | |||
876 | /* set up supported mcs set */ | 876 | /* set up supported mcs set */ |
877 | memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); | 877 | memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); |
878 | 878 | ||
879 | switch(sc->sc_rx_chainmask) { | 879 | switch(sc->rx_chainmask) { |
880 | case 1: | 880 | case 1: |
881 | ht_info->mcs.rx_mask[0] = 0xff; | 881 | ht_info->mcs.rx_mask[0] = 0xff; |
882 | break; | 882 | break; |
@@ -896,17 +896,17 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, | |||
896 | struct ieee80211_vif *vif, | 896 | struct ieee80211_vif *vif, |
897 | struct ieee80211_bss_conf *bss_conf) | 897 | struct ieee80211_bss_conf *bss_conf) |
898 | { | 898 | { |
899 | struct ath_vap *avp = (void *)vif->drv_priv; | 899 | struct ath_vif *avp = (void *)vif->drv_priv; |
900 | 900 | ||
901 | if (bss_conf->assoc) { | 901 | if (bss_conf->assoc) { |
902 | DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info ASSOC %d, bssid: %pM\n", | 902 | DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info ASSOC %d, bssid: %pM\n", |
903 | bss_conf->aid, sc->sc_curbssid); | 903 | bss_conf->aid, sc->curbssid); |
904 | 904 | ||
905 | /* New association, store aid */ | 905 | /* New association, store aid */ |
906 | if (avp->av_opmode == NL80211_IFTYPE_STATION) { | 906 | if (avp->av_opmode == NL80211_IFTYPE_STATION) { |
907 | sc->sc_curaid = bss_conf->aid; | 907 | sc->curaid = bss_conf->aid; |
908 | ath9k_hw_write_associd(sc->sc_ah, sc->sc_curbssid, | 908 | ath9k_hw_write_associd(sc->sc_ah, sc->curbssid, |
909 | sc->sc_curaid); | 909 | sc->curaid); |
910 | } | 910 | } |
911 | 911 | ||
912 | /* Configure the beacon */ | 912 | /* Configure the beacon */ |
@@ -914,18 +914,18 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, | |||
914 | sc->sc_flags |= SC_OP_BEACONS; | 914 | sc->sc_flags |= SC_OP_BEACONS; |
915 | 915 | ||
916 | /* Reset rssi stats */ | 916 | /* Reset rssi stats */ |
917 | sc->sc_halstats.ns_avgbrssi = ATH_RSSI_DUMMY_MARKER; | 917 | sc->nodestats.ns_avgbrssi = ATH_RSSI_DUMMY_MARKER; |
918 | sc->sc_halstats.ns_avgrssi = ATH_RSSI_DUMMY_MARKER; | 918 | sc->nodestats.ns_avgrssi = ATH_RSSI_DUMMY_MARKER; |
919 | sc->sc_halstats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER; | 919 | sc->nodestats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER; |
920 | sc->sc_halstats.ns_avgtxrate = ATH_RATE_DUMMY_MARKER; | 920 | sc->nodestats.ns_avgtxrate = ATH_RATE_DUMMY_MARKER; |
921 | 921 | ||
922 | /* Start ANI */ | 922 | /* Start ANI */ |
923 | mod_timer(&sc->sc_ani.timer, | 923 | mod_timer(&sc->ani.timer, |
924 | jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL)); | 924 | jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL)); |
925 | 925 | ||
926 | } else { | 926 | } else { |
927 | DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info DISSOC\n"); | 927 | DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info DISSOC\n"); |
928 | sc->sc_curaid = 0; | 928 | sc->curaid = 0; |
929 | } | 929 | } |
930 | } | 930 | } |
931 | 931 | ||
@@ -1120,7 +1120,7 @@ static void ath_radio_enable(struct ath_softc *sc) | |||
1120 | ath_beacon_config(sc, ATH_IF_ID_ANY); /* restart beacons */ | 1120 | ath_beacon_config(sc, ATH_IF_ID_ANY); /* restart beacons */ |
1121 | 1121 | ||
1122 | /* Re-Enable interrupts */ | 1122 | /* Re-Enable interrupts */ |
1123 | ath9k_hw_set_interrupts(ah, sc->sc_imask); | 1123 | ath9k_hw_set_interrupts(ah, sc->imask); |
1124 | 1124 | ||
1125 | /* Enable LED */ | 1125 | /* Enable LED */ |
1126 | ath9k_hw_cfg_output(ah, ATH_LED_PIN, | 1126 | ath9k_hw_cfg_output(ah, ATH_LED_PIN, |
@@ -1369,7 +1369,7 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1369 | */ | 1369 | */ |
1370 | ath_read_cachesize(sc, &csz); | 1370 | ath_read_cachesize(sc, &csz); |
1371 | /* XXX assert csz is non-zero */ | 1371 | /* XXX assert csz is non-zero */ |
1372 | sc->sc_cachelsz = csz << 2; /* convert to bytes */ | 1372 | sc->cachelsz = csz << 2; /* convert to bytes */ |
1373 | 1373 | ||
1374 | ah = ath9k_hw_attach(devid, sc, sc->mem, &status); | 1374 | ah = ath9k_hw_attach(devid, sc, sc->mem, &status); |
1375 | if (ah == NULL) { | 1375 | if (ah == NULL) { |
@@ -1381,19 +1381,19 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1381 | sc->sc_ah = ah; | 1381 | sc->sc_ah = ah; |
1382 | 1382 | ||
1383 | /* Get the hardware key cache size. */ | 1383 | /* Get the hardware key cache size. */ |
1384 | sc->sc_keymax = ah->ah_caps.keycache_size; | 1384 | sc->keymax = ah->ah_caps.keycache_size; |
1385 | if (sc->sc_keymax > ATH_KEYMAX) { | 1385 | if (sc->keymax > ATH_KEYMAX) { |
1386 | DPRINTF(sc, ATH_DBG_KEYCACHE, | 1386 | DPRINTF(sc, ATH_DBG_KEYCACHE, |
1387 | "Warning, using only %u entries in %u key cache\n", | 1387 | "Warning, using only %u entries in %u key cache\n", |
1388 | ATH_KEYMAX, sc->sc_keymax); | 1388 | ATH_KEYMAX, sc->keymax); |
1389 | sc->sc_keymax = ATH_KEYMAX; | 1389 | sc->keymax = ATH_KEYMAX; |
1390 | } | 1390 | } |
1391 | 1391 | ||
1392 | /* | 1392 | /* |
1393 | * Reset the key cache since some parts do not | 1393 | * Reset the key cache since some parts do not |
1394 | * reset the contents on initial power up. | 1394 | * reset the contents on initial power up. |
1395 | */ | 1395 | */ |
1396 | for (i = 0; i < sc->sc_keymax; i++) | 1396 | for (i = 0; i < sc->keymax; i++) |
1397 | ath9k_hw_keyreset(ah, (u16) i); | 1397 | ath9k_hw_keyreset(ah, (u16) i); |
1398 | 1398 | ||
1399 | if (ath9k_regd_init(sc->sc_ah)) | 1399 | if (ath9k_regd_init(sc->sc_ah)) |
@@ -1429,7 +1429,7 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1429 | goto bad2; | 1429 | goto bad2; |
1430 | } | 1430 | } |
1431 | 1431 | ||
1432 | sc->sc_config.cabqReadytime = ATH_CABQ_READY_TIME; | 1432 | sc->config.cabqReadytime = ATH_CABQ_READY_TIME; |
1433 | ath_cabq_update(sc); | 1433 | ath_cabq_update(sc); |
1434 | 1434 | ||
1435 | for (i = 0; i < ARRAY_SIZE(sc->tx.hwq_map); i++) | 1435 | for (i = 0; i < ARRAY_SIZE(sc->tx.hwq_map); i++) |
@@ -1466,8 +1466,8 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1466 | /* Initializes the noise floor to a reasonable default value. | 1466 | /* Initializes the noise floor to a reasonable default value. |
1467 | * Later on this will be updated during ANI processing. */ | 1467 | * Later on this will be updated during ANI processing. */ |
1468 | 1468 | ||
1469 | sc->sc_ani.sc_noise_floor = ATH_DEFAULT_NOISE_FLOOR; | 1469 | sc->ani.noise_floor = ATH_DEFAULT_NOISE_FLOOR; |
1470 | setup_timer(&sc->sc_ani.timer, ath_ani_calibrate, (unsigned long)sc); | 1470 | setup_timer(&sc->ani.timer, ath_ani_calibrate, (unsigned long)sc); |
1471 | 1471 | ||
1472 | if (ath9k_hw_getcapability(ah, ATH9K_CAP_CIPHER, | 1472 | if (ath9k_hw_getcapability(ah, ATH9K_CAP_CIPHER, |
1473 | ATH9K_CIPHER_TKIP, NULL)) { | 1473 | ATH9K_CIPHER_TKIP, NULL)) { |
@@ -1493,14 +1493,14 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1493 | ATH9K_CIPHER_MIC, NULL) | 1493 | ATH9K_CIPHER_MIC, NULL) |
1494 | && ath9k_hw_getcapability(ah, ATH9K_CAP_TKIP_SPLIT, | 1494 | && ath9k_hw_getcapability(ah, ATH9K_CAP_TKIP_SPLIT, |
1495 | 0, NULL)) | 1495 | 0, NULL)) |
1496 | sc->sc_splitmic = 1; | 1496 | sc->splitmic = 1; |
1497 | 1497 | ||
1498 | /* turn on mcast key search if possible */ | 1498 | /* turn on mcast key search if possible */ |
1499 | if (!ath9k_hw_getcapability(ah, ATH9K_CAP_MCAST_KEYSRCH, 0, NULL)) | 1499 | if (!ath9k_hw_getcapability(ah, ATH9K_CAP_MCAST_KEYSRCH, 0, NULL)) |
1500 | (void)ath9k_hw_setcapability(ah, ATH9K_CAP_MCAST_KEYSRCH, 1, | 1500 | (void)ath9k_hw_setcapability(ah, ATH9K_CAP_MCAST_KEYSRCH, 1, |
1501 | 1, NULL); | 1501 | 1, NULL); |
1502 | 1502 | ||
1503 | sc->sc_config.txpowlimit = ATH_TXPOWER_MAX; | 1503 | sc->config.txpowlimit = ATH_TXPOWER_MAX; |
1504 | 1504 | ||
1505 | /* 11n Capabilities */ | 1505 | /* 11n Capabilities */ |
1506 | if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) { | 1506 | if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) { |
@@ -1508,17 +1508,17 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1508 | sc->sc_flags |= SC_OP_RXAGGR; | 1508 | sc->sc_flags |= SC_OP_RXAGGR; |
1509 | } | 1509 | } |
1510 | 1510 | ||
1511 | sc->sc_tx_chainmask = ah->ah_caps.tx_chainmask; | 1511 | sc->tx_chainmask = ah->ah_caps.tx_chainmask; |
1512 | sc->sc_rx_chainmask = ah->ah_caps.rx_chainmask; | 1512 | sc->rx_chainmask = ah->ah_caps.rx_chainmask; |
1513 | 1513 | ||
1514 | ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); | 1514 | ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); |
1515 | sc->rx.defant = ath9k_hw_getdefantenna(ah); | 1515 | sc->rx.defant = ath9k_hw_getdefantenna(ah); |
1516 | 1516 | ||
1517 | ath9k_hw_getmac(ah, sc->sc_myaddr); | 1517 | ath9k_hw_getmac(ah, sc->macaddr); |
1518 | if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) { | 1518 | if (ah->ah_caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) { |
1519 | ath9k_hw_getbssidmask(ah, sc->sc_bssidmask); | 1519 | ath9k_hw_getbssidmask(ah, sc->bssidmask); |
1520 | ATH_SET_VAP_BSSID_MASK(sc->sc_bssidmask); | 1520 | ATH_SET_VIF_BSSID_MASK(sc->bssidmask); |
1521 | ath9k_hw_setbssidmask(ah, sc->sc_bssidmask); | 1521 | ath9k_hw_setbssidmask(ah, sc->bssidmask); |
1522 | } | 1522 | } |
1523 | 1523 | ||
1524 | sc->beacon.slottime = ATH9K_SLOT_TIME_9; /* default to short slot time */ | 1524 | sc->beacon.slottime = ATH9K_SLOT_TIME_9; /* default to short slot time */ |
@@ -1528,7 +1528,7 @@ static int ath_init(u16 devid, struct ath_softc *sc) | |||
1528 | sc->beacon.bslot[i] = ATH_IF_ID_ANY; | 1528 | sc->beacon.bslot[i] = ATH_IF_ID_ANY; |
1529 | 1529 | ||
1530 | /* save MISC configurations */ | 1530 | /* save MISC configurations */ |
1531 | sc->sc_config.swBeaconProcess = 1; | 1531 | sc->config.swBeaconProcess = 1; |
1532 | 1532 | ||
1533 | /* setup channels and rates */ | 1533 | /* setup channels and rates */ |
1534 | 1534 | ||
@@ -1577,7 +1577,7 @@ int ath_attach(u16 devid, struct ath_softc *sc) | |||
1577 | 1577 | ||
1578 | /* get mac address from hardware and set in mac80211 */ | 1578 | /* get mac address from hardware and set in mac80211 */ |
1579 | 1579 | ||
1580 | SET_IEEE80211_PERM_ADDR(hw, sc->sc_myaddr); | 1580 | SET_IEEE80211_PERM_ADDR(hw, sc->macaddr); |
1581 | 1581 | ||
1582 | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | | 1582 | hw->flags = IEEE80211_HW_RX_INCLUDES_FCS | |
1583 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | | 1583 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | |
@@ -1601,7 +1601,7 @@ int ath_attach(u16 devid, struct ath_softc *sc) | |||
1601 | hw->max_rates = 4; | 1601 | hw->max_rates = 4; |
1602 | hw->max_rate_tries = ATH_11N_TXMAXTRY; | 1602 | hw->max_rate_tries = ATH_11N_TXMAXTRY; |
1603 | hw->sta_data_size = sizeof(struct ath_node); | 1603 | hw->sta_data_size = sizeof(struct ath_node); |
1604 | hw->vif_data_size = sizeof(struct ath_vap); | 1604 | hw->vif_data_size = sizeof(struct ath_vif); |
1605 | 1605 | ||
1606 | hw->rate_control_algorithm = "ath9k_rate_control"; | 1606 | hw->rate_control_algorithm = "ath9k_rate_control"; |
1607 | 1607 | ||
@@ -1704,7 +1704,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) | |||
1704 | if (sc->sc_flags & SC_OP_BEACONS) | 1704 | if (sc->sc_flags & SC_OP_BEACONS) |
1705 | ath_beacon_config(sc, ATH_IF_ID_ANY); /* restart beacons */ | 1705 | ath_beacon_config(sc, ATH_IF_ID_ANY); /* restart beacons */ |
1706 | 1706 | ||
1707 | ath9k_hw_set_interrupts(ah, sc->sc_imask); | 1707 | ath9k_hw_set_interrupts(ah, sc->imask); |
1708 | 1708 | ||
1709 | if (retry_tx) { | 1709 | if (retry_tx) { |
1710 | int i; | 1710 | int i; |
@@ -1987,23 +1987,23 @@ static int ath9k_start(struct ieee80211_hw *hw) | |||
1987 | } | 1987 | } |
1988 | 1988 | ||
1989 | /* Setup our intr mask. */ | 1989 | /* Setup our intr mask. */ |
1990 | sc->sc_imask = ATH9K_INT_RX | ATH9K_INT_TX | 1990 | sc->imask = ATH9K_INT_RX | ATH9K_INT_TX |
1991 | | ATH9K_INT_RXEOL | ATH9K_INT_RXORN | 1991 | | ATH9K_INT_RXEOL | ATH9K_INT_RXORN |
1992 | | ATH9K_INT_FATAL | ATH9K_INT_GLOBAL; | 1992 | | ATH9K_INT_FATAL | ATH9K_INT_GLOBAL; |
1993 | 1993 | ||
1994 | if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_GTT) | 1994 | if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_GTT) |
1995 | sc->sc_imask |= ATH9K_INT_GTT; | 1995 | sc->imask |= ATH9K_INT_GTT; |
1996 | 1996 | ||
1997 | if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) | 1997 | if (sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) |
1998 | sc->sc_imask |= ATH9K_INT_CST; | 1998 | sc->imask |= ATH9K_INT_CST; |
1999 | 1999 | ||
2000 | ath_cache_conf_rate(sc, &hw->conf); | 2000 | ath_cache_conf_rate(sc, &hw->conf); |
2001 | 2001 | ||
2002 | sc->sc_flags &= ~SC_OP_INVALID; | 2002 | sc->sc_flags &= ~SC_OP_INVALID; |
2003 | 2003 | ||
2004 | /* Disable BMISS interrupt when we're not associated */ | 2004 | /* Disable BMISS interrupt when we're not associated */ |
2005 | sc->sc_imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); | 2005 | sc->imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); |
2006 | ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_imask); | 2006 | ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); |
2007 | 2007 | ||
2008 | ieee80211_wake_queues(sc->hw); | 2008 | ieee80211_wake_queues(sc->hw); |
2009 | 2009 | ||
@@ -2112,12 +2112,12 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
2112 | struct ieee80211_if_init_conf *conf) | 2112 | struct ieee80211_if_init_conf *conf) |
2113 | { | 2113 | { |
2114 | struct ath_softc *sc = hw->priv; | 2114 | struct ath_softc *sc = hw->priv; |
2115 | struct ath_vap *avp = (void *)conf->vif->drv_priv; | 2115 | struct ath_vif *avp = (void *)conf->vif->drv_priv; |
2116 | enum nl80211_iftype ic_opmode = NL80211_IFTYPE_UNSPECIFIED; | 2116 | enum nl80211_iftype ic_opmode = NL80211_IFTYPE_UNSPECIFIED; |
2117 | 2117 | ||
2118 | /* Support only vap for now */ | 2118 | /* Support only vif for now */ |
2119 | 2119 | ||
2120 | if (sc->sc_nvaps) | 2120 | if (sc->nvifs) |
2121 | return -ENOBUFS; | 2121 | return -ENOBUFS; |
2122 | 2122 | ||
2123 | mutex_lock(&sc->mutex); | 2123 | mutex_lock(&sc->mutex); |
@@ -2138,17 +2138,17 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
2138 | return -EOPNOTSUPP; | 2138 | return -EOPNOTSUPP; |
2139 | } | 2139 | } |
2140 | 2140 | ||
2141 | DPRINTF(sc, ATH_DBG_CONFIG, "Attach a VAP of type: %d\n", ic_opmode); | 2141 | DPRINTF(sc, ATH_DBG_CONFIG, "Attach a VIF of type: %d\n", ic_opmode); |
2142 | 2142 | ||
2143 | /* Set the VAP opmode */ | 2143 | /* Set the VIF opmode */ |
2144 | avp->av_opmode = ic_opmode; | 2144 | avp->av_opmode = ic_opmode; |
2145 | avp->av_bslot = -1; | 2145 | avp->av_bslot = -1; |
2146 | 2146 | ||
2147 | if (ic_opmode == NL80211_IFTYPE_AP) | 2147 | if (ic_opmode == NL80211_IFTYPE_AP) |
2148 | ath9k_hw_set_tsfadjust(sc->sc_ah, 1); | 2148 | ath9k_hw_set_tsfadjust(sc->sc_ah, 1); |
2149 | 2149 | ||
2150 | sc->sc_vaps[0] = conf->vif; | 2150 | sc->vifs[0] = conf->vif; |
2151 | sc->sc_nvaps++; | 2151 | sc->nvifs++; |
2152 | 2152 | ||
2153 | /* Set the device opmode */ | 2153 | /* Set the device opmode */ |
2154 | sc->sc_ah->ah_opmode = ic_opmode; | 2154 | sc->sc_ah->ah_opmode = ic_opmode; |
@@ -2160,7 +2160,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
2160 | if (ath9k_hw_phycounters(sc->sc_ah) && | 2160 | if (ath9k_hw_phycounters(sc->sc_ah) && |
2161 | ((conf->type == NL80211_IFTYPE_STATION) || | 2161 | ((conf->type == NL80211_IFTYPE_STATION) || |
2162 | (conf->type == NL80211_IFTYPE_ADHOC))) | 2162 | (conf->type == NL80211_IFTYPE_ADHOC))) |
2163 | sc->sc_imask |= ATH9K_INT_MIB; | 2163 | sc->imask |= ATH9K_INT_MIB; |
2164 | /* | 2164 | /* |
2165 | * Some hardware processes the TIM IE and fires an | 2165 | * Some hardware processes the TIM IE and fires an |
2166 | * interrupt when the TIM bit is set. For hardware | 2166 | * interrupt when the TIM bit is set. For hardware |
@@ -2169,15 +2169,15 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
2169 | */ | 2169 | */ |
2170 | if ((sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) && | 2170 | if ((sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) && |
2171 | (conf->type == NL80211_IFTYPE_STATION) && | 2171 | (conf->type == NL80211_IFTYPE_STATION) && |
2172 | !sc->sc_config.swBeaconProcess) | 2172 | !sc->config.swBeaconProcess) |
2173 | sc->sc_imask |= ATH9K_INT_TIM; | 2173 | sc->imask |= ATH9K_INT_TIM; |
2174 | 2174 | ||
2175 | ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_imask); | 2175 | ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); |
2176 | 2176 | ||
2177 | if (conf->type == NL80211_IFTYPE_AP) { | 2177 | if (conf->type == NL80211_IFTYPE_AP) { |
2178 | /* TODO: is this a suitable place to start ANI for AP mode? */ | 2178 | /* TODO: is this a suitable place to start ANI for AP mode? */ |
2179 | /* Start ANI */ | 2179 | /* Start ANI */ |
2180 | mod_timer(&sc->sc_ani.timer, | 2180 | mod_timer(&sc->ani.timer, |
2181 | jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL)); | 2181 | jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL)); |
2182 | } | 2182 | } |
2183 | 2183 | ||
@@ -2190,14 +2190,14 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
2190 | struct ieee80211_if_init_conf *conf) | 2190 | struct ieee80211_if_init_conf *conf) |
2191 | { | 2191 | { |
2192 | struct ath_softc *sc = hw->priv; | 2192 | struct ath_softc *sc = hw->priv; |
2193 | struct ath_vap *avp = (void *)conf->vif->drv_priv; | 2193 | struct ath_vif *avp = (void *)conf->vif->drv_priv; |
2194 | 2194 | ||
2195 | DPRINTF(sc, ATH_DBG_CONFIG, "Detach Interface\n"); | 2195 | DPRINTF(sc, ATH_DBG_CONFIG, "Detach Interface\n"); |
2196 | 2196 | ||
2197 | mutex_lock(&sc->mutex); | 2197 | mutex_lock(&sc->mutex); |
2198 | 2198 | ||
2199 | /* Stop ANI */ | 2199 | /* Stop ANI */ |
2200 | del_timer_sync(&sc->sc_ani.timer); | 2200 | del_timer_sync(&sc->ani.timer); |
2201 | 2201 | ||
2202 | /* Reclaim beacon resources */ | 2202 | /* Reclaim beacon resources */ |
2203 | if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP || | 2203 | if (sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP || |
@@ -2208,8 +2208,8 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
2208 | 2208 | ||
2209 | sc->sc_flags &= ~SC_OP_BEACONS; | 2209 | sc->sc_flags &= ~SC_OP_BEACONS; |
2210 | 2210 | ||
2211 | sc->sc_vaps[0] = NULL; | 2211 | sc->vifs[0] = NULL; |
2212 | sc->sc_nvaps--; | 2212 | sc->nvifs--; |
2213 | 2213 | ||
2214 | mutex_unlock(&sc->mutex); | 2214 | mutex_unlock(&sc->mutex); |
2215 | } | 2215 | } |
@@ -2223,10 +2223,10 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
2223 | 2223 | ||
2224 | if (changed & IEEE80211_CONF_CHANGE_PS) { | 2224 | if (changed & IEEE80211_CONF_CHANGE_PS) { |
2225 | if (conf->flags & IEEE80211_CONF_PS) { | 2225 | if (conf->flags & IEEE80211_CONF_PS) { |
2226 | if ((sc->sc_imask & ATH9K_INT_TIM_TIMER) == 0) { | 2226 | if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) { |
2227 | sc->sc_imask |= ATH9K_INT_TIM_TIMER; | 2227 | sc->imask |= ATH9K_INT_TIM_TIMER; |
2228 | ath9k_hw_set_interrupts(sc->sc_ah, | 2228 | ath9k_hw_set_interrupts(sc->sc_ah, |
2229 | sc->sc_imask); | 2229 | sc->imask); |
2230 | } | 2230 | } |
2231 | ath9k_hw_setrxabort(sc->sc_ah, 1); | 2231 | ath9k_hw_setrxabort(sc->sc_ah, 1); |
2232 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP); | 2232 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP); |
@@ -2234,10 +2234,10 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
2234 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); | 2234 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); |
2235 | ath9k_hw_setrxabort(sc->sc_ah, 0); | 2235 | ath9k_hw_setrxabort(sc->sc_ah, 0); |
2236 | sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON; | 2236 | sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON; |
2237 | if (sc->sc_imask & ATH9K_INT_TIM_TIMER) { | 2237 | if (sc->imask & ATH9K_INT_TIM_TIMER) { |
2238 | sc->sc_imask &= ~ATH9K_INT_TIM_TIMER; | 2238 | sc->imask &= ~ATH9K_INT_TIM_TIMER; |
2239 | ath9k_hw_set_interrupts(sc->sc_ah, | 2239 | ath9k_hw_set_interrupts(sc->sc_ah, |
2240 | sc->sc_imask); | 2240 | sc->imask); |
2241 | } | 2241 | } |
2242 | } | 2242 | } |
2243 | } | 2243 | } |
@@ -2262,7 +2262,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
2262 | } | 2262 | } |
2263 | 2263 | ||
2264 | if (changed & IEEE80211_CONF_CHANGE_POWER) | 2264 | if (changed & IEEE80211_CONF_CHANGE_POWER) |
2265 | sc->sc_config.txpowlimit = 2 * conf->power_level; | 2265 | sc->config.txpowlimit = 2 * conf->power_level; |
2266 | 2266 | ||
2267 | mutex_unlock(&sc->mutex); | 2267 | mutex_unlock(&sc->mutex); |
2268 | 2268 | ||
@@ -2275,7 +2275,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, | |||
2275 | { | 2275 | { |
2276 | struct ath_softc *sc = hw->priv; | 2276 | struct ath_softc *sc = hw->priv; |
2277 | struct ath_hal *ah = sc->sc_ah; | 2277 | struct ath_hal *ah = sc->sc_ah; |
2278 | struct ath_vap *avp = (void *)vif->drv_priv; | 2278 | struct ath_vif *avp = (void *)vif->drv_priv; |
2279 | u32 rfilt = 0; | 2279 | u32 rfilt = 0; |
2280 | int error, i; | 2280 | int error, i; |
2281 | 2281 | ||
@@ -2285,7 +2285,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, | |||
2285 | ah->ah_opmode != NL80211_IFTYPE_AP) { | 2285 | ah->ah_opmode != NL80211_IFTYPE_AP) { |
2286 | ah->ah_opmode = NL80211_IFTYPE_STATION; | 2286 | ah->ah_opmode = NL80211_IFTYPE_STATION; |
2287 | ath9k_hw_setopmode(ah); | 2287 | ath9k_hw_setopmode(ah); |
2288 | ath9k_hw_write_associd(ah, sc->sc_myaddr, 0); | 2288 | ath9k_hw_write_associd(ah, sc->macaddr, 0); |
2289 | /* Request full reset to get hw opmode changed properly */ | 2289 | /* Request full reset to get hw opmode changed properly */ |
2290 | sc->sc_flags |= SC_OP_FULL_RESET; | 2290 | sc->sc_flags |= SC_OP_FULL_RESET; |
2291 | } | 2291 | } |
@@ -2296,17 +2296,17 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, | |||
2296 | case NL80211_IFTYPE_STATION: | 2296 | case NL80211_IFTYPE_STATION: |
2297 | case NL80211_IFTYPE_ADHOC: | 2297 | case NL80211_IFTYPE_ADHOC: |
2298 | /* Set BSSID */ | 2298 | /* Set BSSID */ |
2299 | memcpy(sc->sc_curbssid, conf->bssid, ETH_ALEN); | 2299 | memcpy(sc->curbssid, conf->bssid, ETH_ALEN); |
2300 | sc->sc_curaid = 0; | 2300 | sc->curaid = 0; |
2301 | ath9k_hw_write_associd(sc->sc_ah, sc->sc_curbssid, | 2301 | ath9k_hw_write_associd(sc->sc_ah, sc->curbssid, |
2302 | sc->sc_curaid); | 2302 | sc->curaid); |
2303 | 2303 | ||
2304 | /* Set aggregation protection mode parameters */ | 2304 | /* Set aggregation protection mode parameters */ |
2305 | sc->sc_config.ath_aggr_prot = 0; | 2305 | sc->config.ath_aggr_prot = 0; |
2306 | 2306 | ||
2307 | DPRINTF(sc, ATH_DBG_CONFIG, | 2307 | DPRINTF(sc, ATH_DBG_CONFIG, |
2308 | "RX filter 0x%x bssid %pM aid 0x%x\n", | 2308 | "RX filter 0x%x bssid %pM aid 0x%x\n", |
2309 | rfilt, sc->sc_curbssid, sc->sc_curaid); | 2309 | rfilt, sc->curbssid, sc->curaid); |
2310 | 2310 | ||
2311 | /* need to reconfigure the beacon */ | 2311 | /* need to reconfigure the beacon */ |
2312 | sc->sc_flags &= ~SC_OP_BEACONS ; | 2312 | sc->sc_flags &= ~SC_OP_BEACONS ; |
@@ -2346,7 +2346,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, | |||
2346 | if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) | 2346 | if (ath9k_hw_keyisvalid(sc->sc_ah, (u16)i)) |
2347 | ath9k_hw_keysetmac(sc->sc_ah, | 2347 | ath9k_hw_keysetmac(sc->sc_ah, |
2348 | (u16)i, | 2348 | (u16)i, |
2349 | sc->sc_curbssid); | 2349 | sc->curbssid); |
2350 | } | 2350 | } |
2351 | 2351 | ||
2352 | /* Only legacy IBSS for now */ | 2352 | /* Only legacy IBSS for now */ |