aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2008-08-11 04:34:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-29 16:23:58 -0400
commitb4696c8b9233bea812b972a5e79c5db7ecf13867 (patch)
treeaf515054456aa403ca973ecf9640e15639f75f5a /drivers/net/wireless
parent6a2b9e8c8f4be9954933051719b312adcfb7263d (diff)
ath9k: Use a single opmode variable
ah_opmode and sc_opmode are redundant. This patch removes sc_opmode. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath9k/ath9k.h2
-rw-r--r--drivers/net/wireless/ath9k/beacon.c18
-rw-r--r--drivers/net/wireless/ath9k/core.c21
-rw-r--r--drivers/net/wireless/ath9k/core.h6
-rw-r--r--drivers/net/wireless/ath9k/hw.c8
-rw-r--r--drivers/net/wireless/ath9k/main.c3
-rw-r--r--drivers/net/wireless/ath9k/recv.c18
-rw-r--r--drivers/net/wireless/ath9k/xmit.c4
8 files changed, 41 insertions, 39 deletions
diff --git a/drivers/net/wireless/ath9k/ath9k.h b/drivers/net/wireless/ath9k/ath9k.h
index 3e7072dcb439..682d3bb4d494 100644
--- a/drivers/net/wireless/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath9k/ath9k.h
@@ -855,7 +855,7 @@ bool ath9k_regd_init_channels(struct ath_hal *ah,
855u32 ath9k_hw_mhz2ieee(struct ath_hal *ah, u32 freq, u32 flags); 855u32 ath9k_hw_mhz2ieee(struct ath_hal *ah, u32 freq, u32 flags);
856enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah, 856enum ath9k_int ath9k_hw_set_interrupts(struct ath_hal *ah,
857 enum ath9k_int ints); 857 enum ath9k_int ints);
858bool ath9k_hw_reset(struct ath_hal *ah, enum ath9k_opmode opmode, 858bool ath9k_hw_reset(struct ath_hal *ah,
859 struct ath9k_channel *chan, 859 struct ath9k_channel *chan,
860 enum ath9k_ht_macmode macmode, 860 enum ath9k_ht_macmode macmode,
861 u8 txchainmask, u8 rxchainmask, 861 u8 txchainmask, u8 rxchainmask,
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c
index 67a804626757..2736a4b4e4a1 100644
--- a/drivers/net/wireless/ath9k/beacon.c
+++ b/drivers/net/wireless/ath9k/beacon.c
@@ -33,7 +33,7 @@ static int ath_beaconq_config(struct ath_softc *sc)
33 struct ath9k_tx_queue_info qi; 33 struct ath9k_tx_queue_info qi;
34 34
35 ath9k_hw_get_txq_props(ah, sc->sc_bhalq, &qi); 35 ath9k_hw_get_txq_props(ah, sc->sc_bhalq, &qi);
36 if (sc->sc_opmode == ATH9K_M_HOSTAP) { 36 if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) {
37 /* Always burst out beacon and CAB traffic. */ 37 /* Always burst out beacon and CAB traffic. */
38 qi.tqi_aifs = 1; 38 qi.tqi_aifs = 1;
39 qi.tqi_cwmin = 0; 39 qi.tqi_cwmin = 0;
@@ -85,7 +85,7 @@ static void ath_beacon_setup(struct ath_softc *sc,
85 85
86 flags = ATH9K_TXDESC_NOACK; 86 flags = ATH9K_TXDESC_NOACK;
87 87
88 if (sc->sc_opmode == ATH9K_M_IBSS && 88 if (sc->sc_ah->ah_opmode == ATH9K_M_IBSS &&
89 (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) { 89 (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) {
90 ds->ds_link = bf->bf_daddr; /* self-linked */ 90 ds->ds_link = bf->bf_daddr; /* self-linked */
91 flags |= ATH9K_TXDESC_VEOL; 91 flags |= ATH9K_TXDESC_VEOL;
@@ -375,7 +375,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id)
375 struct ath_buf, list); 375 struct ath_buf, list);
376 list_del(&avp->av_bcbuf->list); 376 list_del(&avp->av_bcbuf->list);
377 377
378 if (sc->sc_opmode == ATH9K_M_HOSTAP || 378 if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP ||
379 !(sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) { 379 !(sc->sc_ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) {
380 int slot; 380 int slot;
381 /* 381 /*
@@ -750,7 +750,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
750 if (if_id != ATH_IF_ID_ANY) 750 if (if_id != ATH_IF_ID_ANY)
751 av_opmode = sc->sc_vaps[if_id]->av_opmode; 751 av_opmode = sc->sc_vaps[if_id]->av_opmode;
752 else 752 else
753 av_opmode = sc->sc_opmode; 753 av_opmode = sc->sc_ah->ah_opmode;
754 754
755 memzero(&conf, sizeof(struct ath_beacon_config)); 755 memzero(&conf, sizeof(struct ath_beacon_config));
756 756
@@ -770,7 +770,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
770 nexttbtt = TSF_TO_TU(get_unaligned_le32(conf.u.last_tstamp + 4), 770 nexttbtt = TSF_TO_TU(get_unaligned_le32(conf.u.last_tstamp + 4),
771 get_unaligned_le32(conf.u.last_tstamp)); 771 get_unaligned_le32(conf.u.last_tstamp));
772 /* XXX conditionalize multi-bss support? */ 772 /* XXX conditionalize multi-bss support? */
773 if (sc->sc_opmode == ATH9K_M_HOSTAP) { 773 if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) {
774 /* 774 /*
775 * For multi-bss ap support beacons are either staggered 775 * For multi-bss ap support beacons are either staggered
776 * evenly over N slots or burst together. For the former 776 * evenly over N slots or burst together. For the former
@@ -791,7 +791,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
791 DPRINTF(sc, ATH_DBG_BEACON, "%s: nexttbtt %u intval %u (%u)\n", 791 DPRINTF(sc, ATH_DBG_BEACON, "%s: nexttbtt %u intval %u (%u)\n",
792 __func__, nexttbtt, intval, conf.beacon_interval); 792 __func__, nexttbtt, intval, conf.beacon_interval);
793 /* Check for ATH9K_M_HOSTAP and sc_nostabeacons for WDS client */ 793 /* Check for ATH9K_M_HOSTAP and sc_nostabeacons for WDS client */
794 if (sc->sc_opmode == ATH9K_M_STA) { 794 if (sc->sc_ah->ah_opmode == ATH9K_M_STA) {
795 struct ath9k_beacon_state bs; 795 struct ath9k_beacon_state bs;
796 u64 tsf; 796 u64 tsf;
797 u32 tsftu; 797 u32 tsftu;
@@ -911,7 +911,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
911 ath9k_hw_set_interrupts(ah, 0); 911 ath9k_hw_set_interrupts(ah, 0);
912 if (nexttbtt == intval) 912 if (nexttbtt == intval)
913 intval |= ATH9K_BEACON_RESET_TSF; 913 intval |= ATH9K_BEACON_RESET_TSF;
914 if (sc->sc_opmode == ATH9K_M_IBSS) { 914 if (sc->sc_ah->ah_opmode == ATH9K_M_IBSS) {
915 /* 915 /*
916 * Pull nexttbtt forward to reflect the current 916 * Pull nexttbtt forward to reflect the current
917 * TSF . 917 * TSF .
@@ -943,7 +943,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
943 if (!(ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) 943 if (!(ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL))
944 sc->sc_imask |= ATH9K_INT_SWBA; 944 sc->sc_imask |= ATH9K_INT_SWBA;
945 ath_beaconq_config(sc); 945 ath_beaconq_config(sc);
946 } else if (sc->sc_opmode == ATH9K_M_HOSTAP) { 946 } else if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP) {
947 /* 947 /*
948 * In AP mode we enable the beacon timers and 948 * In AP mode we enable the beacon timers and
949 * SWBA interrupts to prepare beacon frames. 949 * SWBA interrupts to prepare beacon frames.
@@ -959,7 +959,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id)
959 * When using a self-linked beacon descriptor in 959 * When using a self-linked beacon descriptor in
960 * ibss mode load it once here. 960 * ibss mode load it once here.
961 */ 961 */
962 if (sc->sc_opmode == ATH9K_M_IBSS && 962 if (sc->sc_ah->ah_opmode == ATH9K_M_IBSS &&
963 (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL)) 963 (ah->ah_caps.hw_caps & ATH9K_HW_CAP_VEOL))
964 ath_beacon_start_adhoc(sc, 0); 964 ath_beacon_start_adhoc(sc, 0);
965 } 965 }
diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c
index 7f92d469ad02..8359356ac02e 100644
--- a/drivers/net/wireless/ath9k/core.c
+++ b/drivers/net/wireless/ath9k/core.c
@@ -355,7 +355,7 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
355 fastcc = false; 355 fastcc = false;
356 356
357 spin_lock_bh(&sc->sc_resetlock); 357 spin_lock_bh(&sc->sc_resetlock);
358 if (!ath9k_hw_reset(ah, sc->sc_opmode, hchan, 358 if (!ath9k_hw_reset(ah, hchan,
359 ht_macmode, sc->sc_tx_chainmask, 359 ht_macmode, sc->sc_tx_chainmask,
360 sc->sc_rx_chainmask, 360 sc->sc_rx_chainmask,
361 sc->sc_ht_extprotspacing, 361 sc->sc_ht_extprotspacing,
@@ -533,7 +533,8 @@ int ath_vap_listen(struct ath_softc *sc, int if_id)
533 rfilt = ath_calcrxfilter(sc); 533 rfilt = ath_calcrxfilter(sc);
534 ath9k_hw_setrxfilter(ah, rfilt); 534 ath9k_hw_setrxfilter(ah, rfilt);
535 535
536 if (sc->sc_opmode == ATH9K_M_STA || sc->sc_opmode == ATH9K_M_IBSS) { 536 if (sc->sc_ah->ah_opmode == ATH9K_M_STA ||
537 sc->sc_ah->ah_opmode == ATH9K_M_IBSS) {
537 memcpy(sc->sc_curbssid, ath_bcast_mac, ETH_ALEN); 538 memcpy(sc->sc_curbssid, ath_bcast_mac, ETH_ALEN);
538 ath9k_hw_write_associd(ah, sc->sc_curbssid, sc->sc_curaid); 539 ath9k_hw_write_associd(ah, sc->sc_curbssid, sc->sc_curaid);
539 } else 540 } else
@@ -603,7 +604,7 @@ int ath_vap_attach(struct ath_softc *sc,
603 sc->sc_vaps[if_id] = avp; 604 sc->sc_vaps[if_id] = avp;
604 sc->sc_nvaps++; 605 sc->sc_nvaps++;
605 /* Set the device opmode */ 606 /* Set the device opmode */
606 sc->sc_opmode = opmode; 607 sc->sc_ah->ah_opmode = opmode;
607 608
608 /* default VAP configuration */ 609 /* default VAP configuration */
609 avp->av_config.av_fixed_rateset = IEEE80211_FIXED_RATE_NONE; 610 avp->av_config.av_fixed_rateset = IEEE80211_FIXED_RATE_NONE;
@@ -677,7 +678,8 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan)
677 int error = 0; 678 int error = 0;
678 enum ath9k_ht_macmode ht_macmode = ath_cwm_macmode(sc); 679 enum ath9k_ht_macmode ht_macmode = ath_cwm_macmode(sc);
679 680
680 DPRINTF(sc, ATH_DBG_CONFIG, "%s: mode %d\n", __func__, sc->sc_opmode); 681 DPRINTF(sc, ATH_DBG_CONFIG, "%s: mode %d\n",
682 __func__, sc->sc_ah->ah_opmode);
681 683
682 /* 684 /*
683 * Stop anything previously setup. This is safe 685 * Stop anything previously setup. This is safe
@@ -702,7 +704,7 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan)
702 sc->sc_curchan = *initial_chan; 704 sc->sc_curchan = *initial_chan;
703 705
704 spin_lock_bh(&sc->sc_resetlock); 706 spin_lock_bh(&sc->sc_resetlock);
705 if (!ath9k_hw_reset(ah, sc->sc_opmode, &sc->sc_curchan, ht_macmode, 707 if (!ath9k_hw_reset(ah, &sc->sc_curchan, ht_macmode,
706 sc->sc_tx_chainmask, sc->sc_rx_chainmask, 708 sc->sc_tx_chainmask, sc->sc_rx_chainmask,
707 sc->sc_ht_extprotspacing, false, &status)) { 709 sc->sc_ht_extprotspacing, false, &status)) {
708 DPRINTF(sc, ATH_DBG_FATAL, 710 DPRINTF(sc, ATH_DBG_FATAL,
@@ -749,7 +751,8 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan)
749 * Note we only do this (at the moment) for station mode. 751 * Note we only do this (at the moment) for station mode.
750 */ 752 */
751 if (ath9k_hw_phycounters(ah) && 753 if (ath9k_hw_phycounters(ah) &&
752 ((sc->sc_opmode == ATH9K_M_STA) || (sc->sc_opmode == ATH9K_M_IBSS))) 754 ((sc->sc_ah->ah_opmode == ATH9K_M_STA) ||
755 (sc->sc_ah->ah_opmode == ATH9K_M_IBSS)))
753 sc->sc_imask |= ATH9K_INT_MIB; 756 sc->sc_imask |= ATH9K_INT_MIB;
754 /* 757 /*
755 * Some hardware processes the TIM IE and fires an 758 * Some hardware processes the TIM IE and fires an
@@ -758,7 +761,7 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan)
758 * enable the TIM interrupt when operating as station. 761 * enable the TIM interrupt when operating as station.
759 */ 762 */
760 if ((ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) && 763 if ((ah->ah_caps.hw_caps & ATH9K_HW_CAP_ENHANCEDPM) &&
761 (sc->sc_opmode == ATH9K_M_STA) && 764 (sc->sc_ah->ah_opmode == ATH9K_M_STA) &&
762 !sc->sc_config.swBeaconProcess) 765 !sc->sc_config.swBeaconProcess)
763 sc->sc_imask |= ATH9K_INT_TIM; 766 sc->sc_imask |= ATH9K_INT_TIM;
764 /* 767 /*
@@ -789,7 +792,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
789 792
790 /* Reset chip */ 793 /* Reset chip */
791 spin_lock_bh(&sc->sc_resetlock); 794 spin_lock_bh(&sc->sc_resetlock);
792 if (!ath9k_hw_reset(ah, sc->sc_opmode, &sc->sc_curchan, 795 if (!ath9k_hw_reset(ah, &sc->sc_curchan,
793 ht_macmode, 796 ht_macmode,
794 sc->sc_tx_chainmask, sc->sc_rx_chainmask, 797 sc->sc_tx_chainmask, sc->sc_rx_chainmask,
795 sc->sc_ht_extprotspacing, false, &status)) { 798 sc->sc_ht_extprotspacing, false, &status)) {
@@ -1096,7 +1099,7 @@ int ath_init(u16 devid, struct ath_softc *sc)
1096 goto bad; 1099 goto bad;
1097 1100
1098 /* default to STA mode */ 1101 /* default to STA mode */
1099 sc->sc_opmode = ATH9K_M_MONITOR; 1102 sc->sc_ah->ah_opmode = ATH9K_M_MONITOR;
1100 1103
1101 /* Setup rate tables */ 1104 /* Setup rate tables */
1102 1105
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h
index 19399da8d47e..bfe16230b5e7 100644
--- a/drivers/net/wireless/ath9k/core.h
+++ b/drivers/net/wireless/ath9k/core.h
@@ -895,15 +895,15 @@ struct ath_ht_info {
895struct ath_softc { 895struct ath_softc {
896 struct ieee80211_hw *hw; 896 struct ieee80211_hw *hw;
897 struct pci_dev *pdev; 897 struct pci_dev *pdev;
898 void __iomem *mem;
899 struct tasklet_struct intr_tq; 898 struct tasklet_struct intr_tq;
900 struct tasklet_struct bcon_tasklet; 899 struct tasklet_struct bcon_tasklet;
901 struct ath_config sc_config; /* load-time parameters */ 900 struct ath_config sc_config; /* load-time parameters */
902 int sc_debug;
903 struct ath_hal *sc_ah; 901 struct ath_hal *sc_ah;
904 struct ath_rate_softc *sc_rc; /* tx rate control support */ 902 struct ath_rate_softc *sc_rc; /* tx rate control support */
903 void __iomem *mem;
904
905 int sc_debug;
905 u32 sc_intrstatus; 906 u32 sc_intrstatus;
906 enum ath9k_opmode sc_opmode; /* current operating mode */
907 unsigned int rx_filter; 907 unsigned int rx_filter;
908 u8 sc_invalid; /* being detached */ 908 u8 sc_invalid; /* being detached */
909 u8 sc_beacons; /* beacons running */ 909 u8 sc_beacons; /* beacons running */
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index 3d879e7a8ea6..24b78c2eb44b 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -5839,7 +5839,7 @@ static inline bool ath9k_hw_init_cal(struct ath_hal *ah,
5839} 5839}
5840 5840
5841 5841
5842bool ath9k_hw_reset(struct ath_hal *ah, enum ath9k_opmode opmode, 5842bool ath9k_hw_reset(struct ath_hal *ah,
5843 struct ath9k_channel *chan, 5843 struct ath9k_channel *chan,
5844 enum ath9k_ht_macmode macmode, 5844 enum ath9k_ht_macmode macmode,
5845 u8 txchainmask, u8 rxchainmask, 5845 u8 txchainmask, u8 rxchainmask,
@@ -5953,7 +5953,7 @@ bool ath9k_hw_reset(struct ath_hal *ah, enum ath9k_opmode opmode,
5953 | (ah->ah_config. 5953 | (ah->ah_config.
5954 ack_6mb ? AR_STA_ID1_ACKCTS_6MB : 0) 5954 ack_6mb ? AR_STA_ID1_ACKCTS_6MB : 0)
5955 | ahp->ah_staId1Defaults); 5955 | ahp->ah_staId1Defaults);
5956 ath9k_hw_set_operating_mode(ah, opmode); 5956 ath9k_hw_set_operating_mode(ah, ah->ah_opmode);
5957 5957
5958 REG_WRITE(ah, AR_BSSMSKL, get_unaligned_le32(ahp->ah_bssidmask)); 5958 REG_WRITE(ah, AR_BSSMSKL, get_unaligned_le32(ahp->ah_bssidmask));
5959 REG_WRITE(ah, AR_BSSMSKU, get_unaligned_le16(ahp->ah_bssidmask + 4)); 5959 REG_WRITE(ah, AR_BSSMSKU, get_unaligned_le16(ahp->ah_bssidmask + 4));
@@ -5983,13 +5983,11 @@ bool ath9k_hw_reset(struct ath_hal *ah, enum ath9k_opmode opmode,
5983 for (i = 0; i < ah->ah_caps.total_queues; i++) 5983 for (i = 0; i < ah->ah_caps.total_queues; i++)
5984 ath9k_hw_resettxqueue(ah, i); 5984 ath9k_hw_resettxqueue(ah, i);
5985 5985
5986 ath9k_hw_init_interrupt_masks(ah, opmode); 5986 ath9k_hw_init_interrupt_masks(ah, ah->ah_opmode);
5987 ath9k_hw_init_qos(ah); 5987 ath9k_hw_init_qos(ah);
5988 5988
5989 ath9k_hw_init_user_settings(ah); 5989 ath9k_hw_init_user_settings(ah);
5990 5990
5991 ah->ah_opmode = opmode;
5992
5993 REG_WRITE(ah, AR_STA_ID1, 5991 REG_WRITE(ah, AR_STA_ID1,
5994 REG_READ(ah, AR_STA_ID1) | AR_STA_ID1_PRESERVE_SEQNUM); 5992 REG_READ(ah, AR_STA_ID1) | AR_STA_ID1_PRESERVE_SEQNUM);
5995 5993
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 262fd7a8cd9a..7504b64020c9 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -472,7 +472,8 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
472 ath_rate_newstate(sc, avp); 472 ath_rate_newstate(sc, avp);
473 473
474 /* Reclaim beacon resources */ 474 /* Reclaim beacon resources */
475 if (sc->sc_opmode == ATH9K_M_HOSTAP || sc->sc_opmode == ATH9K_M_IBSS) { 475 if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP ||
476 sc->sc_ah->ah_opmode == ATH9K_M_IBSS) {
476 ath9k_hw_stoptxdma(sc->sc_ah, sc->sc_bhalq); 477 ath9k_hw_stoptxdma(sc->sc_ah, sc->sc_bhalq);
477 ath_beacon_return(sc, avp); 478 ath_beacon_return(sc, avp);
478 } 479 }
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index a12584961d69..6d1d5035f159 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -184,7 +184,7 @@ static int ath_ampdu_input(struct ath_softc *sc,
184 tid = qc[0] & 0xf; 184 tid = qc[0] & 0xf;
185 } 185 }
186 186
187 if (sc->sc_opmode == ATH9K_M_STA) { 187 if (sc->sc_ah->ah_opmode == ATH9K_M_STA) {
188 /* Drop the frame not belonging to me. */ 188 /* Drop the frame not belonging to me. */
189 if (memcmp(hdr->addr1, sc->sc_myaddr, ETH_ALEN)) { 189 if (memcmp(hdr->addr1, sc->sc_myaddr, ETH_ALEN)) {
190 dev_kfree_skb(skb); 190 dev_kfree_skb(skb);
@@ -605,26 +605,26 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
605 | ATH9K_RX_FILTER_MCAST; 605 | ATH9K_RX_FILTER_MCAST;
606 606
607 /* If not a STA, enable processing of Probe Requests */ 607 /* If not a STA, enable processing of Probe Requests */
608 if (sc->sc_opmode != ATH9K_M_STA) 608 if (sc->sc_ah->ah_opmode != ATH9K_M_STA)
609 rfilt |= ATH9K_RX_FILTER_PROBEREQ; 609 rfilt |= ATH9K_RX_FILTER_PROBEREQ;
610 610
611 /* Can't set HOSTAP into promiscous mode */ 611 /* Can't set HOSTAP into promiscous mode */
612 if (((sc->sc_opmode != ATH9K_M_HOSTAP) && 612 if (((sc->sc_ah->ah_opmode != ATH9K_M_HOSTAP) &&
613 (sc->rx_filter & FIF_PROMISC_IN_BSS)) || 613 (sc->rx_filter & FIF_PROMISC_IN_BSS)) ||
614 (sc->sc_opmode == ATH9K_M_MONITOR)) { 614 (sc->sc_ah->ah_opmode == ATH9K_M_MONITOR)) {
615 rfilt |= ATH9K_RX_FILTER_PROM; 615 rfilt |= ATH9K_RX_FILTER_PROM;
616 /* ??? To prevent from sending ACK */ 616 /* ??? To prevent from sending ACK */
617 rfilt &= ~ATH9K_RX_FILTER_UCAST; 617 rfilt &= ~ATH9K_RX_FILTER_UCAST;
618 } 618 }
619 619
620 if (((sc->sc_opmode == ATH9K_M_STA) && 620 if (((sc->sc_ah->ah_opmode == ATH9K_M_STA) &&
621 (sc->rx_filter & FIF_BCN_PRBRESP_PROMISC)) || 621 (sc->rx_filter & FIF_BCN_PRBRESP_PROMISC)) ||
622 (sc->sc_opmode == ATH9K_M_IBSS)) 622 (sc->sc_ah->ah_opmode == ATH9K_M_IBSS))
623 rfilt |= ATH9K_RX_FILTER_BEACON; 623 rfilt |= ATH9K_RX_FILTER_BEACON;
624 624
625 /* If in HOSTAP mode, want to enable reception of PSPOLL frames 625 /* If in HOSTAP mode, want to enable reception of PSPOLL frames
626 & beacon frames */ 626 & beacon frames */
627 if (sc->sc_opmode == ATH9K_M_HOSTAP) 627 if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP)
628 rfilt |= (ATH9K_RX_FILTER_BEACON | ATH9K_RX_FILTER_PSPOLL); 628 rfilt |= (ATH9K_RX_FILTER_BEACON | ATH9K_RX_FILTER_PSPOLL);
629 return rfilt; 629 return rfilt;
630 630
@@ -905,7 +905,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
905 * Enable this if you want to see 905 * Enable this if you want to see
906 * error frames in Monitor mode. 906 * error frames in Monitor mode.
907 */ 907 */
908 if (sc->sc_opmode != ATH9K_M_MONITOR) 908 if (sc->sc_ah->ah_opmode != ATH9K_M_MONITOR)
909 goto rx_next; 909 goto rx_next;
910#endif 910#endif
911 /* fall thru for monitor mode handling... */ 911 /* fall thru for monitor mode handling... */
@@ -950,7 +950,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush)
950 * decryption and MIC failures. For monitor mode, 950 * decryption and MIC failures. For monitor mode,
951 * we also ignore the CRC error. 951 * we also ignore the CRC error.
952 */ 952 */
953 if (sc->sc_opmode == ATH9K_M_MONITOR) { 953 if (sc->sc_ah->ah_opmode == ATH9K_M_MONITOR) {
954 if (ds->ds_rxstat.rs_status & 954 if (ds->ds_rxstat.rs_status &
955 ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC | 955 ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
956 ATH9K_RXERR_CRC)) 956 ATH9K_RXERR_CRC))
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c
index a24a3a5b0e62..0b5b2dd92562 100644
--- a/drivers/net/wireless/ath9k/xmit.c
+++ b/drivers/net/wireless/ath9k/xmit.c
@@ -1047,7 +1047,7 @@ static void ath_tx_complete_aggr_rifs(struct ath_softc *sc,
1047 * when perform internal reset in this routine. 1047 * when perform internal reset in this routine.
1048 * Only enable reset in STA mode for now. 1048 * Only enable reset in STA mode for now.
1049 */ 1049 */
1050 if (sc->sc_opmode == ATH9K_M_STA) 1050 if (sc->sc_ah->ah_opmode == ATH9K_M_STA)
1051 needreset = 1; 1051 needreset = 1;
1052 } 1052 }
1053 } else { 1053 } else {
@@ -1454,7 +1454,7 @@ static void ath_drain_txdataq(struct ath_softc *sc, bool retry_tx)
1454 "%s: Unable to stop TxDMA. Reset HAL!\n", __func__); 1454 "%s: Unable to stop TxDMA. Reset HAL!\n", __func__);
1455 1455
1456 spin_lock_bh(&sc->sc_resetlock); 1456 spin_lock_bh(&sc->sc_resetlock);
1457 if (!ath9k_hw_reset(ah, sc->sc_opmode, 1457 if (!ath9k_hw_reset(ah,
1458 &sc->sc_curchan, ht_macmode, 1458 &sc->sc_curchan, ht_macmode,
1459 sc->sc_tx_chainmask, sc->sc_rx_chainmask, 1459 sc->sc_tx_chainmask, sc->sc_rx_chainmask,
1460 sc->sc_ht_extprotspacing, true, &status)) { 1460 sc->sc_ht_extprotspacing, true, &status)) {