1 --- a/drivers/net/wireless/ath/ath.h
2 +++ b/drivers/net/wireless/ath/ath.h
3 @@ -140,9 +140,6 @@ struct ath_common {
5 u8 bssidmask[ETH_ALEN];
13 --- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
14 +++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
15 @@ -113,7 +113,7 @@ static int ar9003_get_training_power_5g(
19 - switch (get_streams(common->tx_chainmask)) {
20 + switch (get_streams(ah->txchainmask)) {
24 @@ -126,7 +126,7 @@ static int ar9003_get_training_power_5g(
27 ath_dbg(common, ATH_DBG_CALIBRATE,
28 - "Invalid tx-chainmask: %u\n", common->tx_chainmask);
29 + "Invalid tx-chainmask: %u\n", ah->txchainmask);
33 --- a/drivers/net/wireless/ath/ath9k/main.c
34 +++ b/drivers/net/wireless/ath/ath9k/main.c
35 @@ -318,7 +318,6 @@ static void ath_paprd_activate(struct at
37 struct ath_hw *ah = sc->sc_ah;
38 struct ath9k_hw_cal_data *caldata = ah->caldata;
39 - struct ath_common *common = ath9k_hw_common(ah);
42 if (!caldata || !caldata->paprd_done)
43 @@ -327,7 +326,7 @@ static void ath_paprd_activate(struct at
45 ar9003_paprd_enable(ah, false);
46 for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) {
47 - if (!(common->tx_chainmask & BIT(chain)))
48 + if (!(ah->txchainmask & BIT(chain)))
51 ar9003_paprd_populate_single_table(ah, caldata, chain);
52 @@ -414,7 +413,7 @@ void ath_paprd_calibrate(struct work_str
53 memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
55 for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) {
56 - if (!(common->tx_chainmask & BIT(chain)))
57 + if (!(ah->txchainmask & BIT(chain)))
61 @@ -535,7 +534,7 @@ void ath_ani_calibrate(unsigned long dat
62 if (longcal || shortcal) {
64 ath9k_hw_calibrate(ah, ah->curchan,
65 - common->rx_chainmask, longcal);
66 + ah->rxchainmask, longcal);
70 --- a/drivers/net/wireless/ath/ath9k/hw.c
71 +++ b/drivers/net/wireless/ath/ath9k/hw.c
72 @@ -1485,9 +1485,6 @@ int ath9k_hw_reset(struct ath_hw *ah, st
76 - ah->txchainmask = common->tx_chainmask;
77 - ah->rxchainmask = common->rx_chainmask;
79 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
82 @@ -2105,6 +2102,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw
84 pCap->tx_chainmask = fixup_chainmask(chip_chainmask, pCap->tx_chainmask);
85 pCap->rx_chainmask = fixup_chainmask(chip_chainmask, pCap->rx_chainmask);
86 + ah->txchainmask = pCap->tx_chainmask;
87 + ah->rxchainmask = pCap->rx_chainmask;
89 ah->misc_mode |= AR_PCU_MIC_NEW_LOC_ENA;
91 --- a/drivers/net/wireless/ath/ath9k/xmit.c
92 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
93 @@ -1660,7 +1660,7 @@ u8 ath_txchainmask_reduction(struct ath_
95 static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int len)
97 - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
98 + struct ath_hw *ah = sc->sc_ah;
99 struct ath9k_11n_rate_series series[4];
101 struct ieee80211_tx_info *tx_info;
102 @@ -1720,7 +1720,7 @@ static void ath_buf_set_rate(struct ath_
104 series[i].Rate = rix | 0x80;
105 series[i].ChSel = ath_txchainmask_reduction(sc,
106 - common->tx_chainmask, series[i].Rate);
107 + ah->txchainmask, series[i].Rate);
108 series[i].PktDuration = ath_pkt_duration(sc, rix, len,
109 is_40, is_sgi, is_sp);
110 if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC))
111 @@ -1745,10 +1745,10 @@ static void ath_buf_set_rate(struct ath_
114 if (bf->bf_state.bfs_paprd)
115 - series[i].ChSel = common->tx_chainmask;
116 + series[i].ChSel = ah->txchainmask;
118 series[i].ChSel = ath_txchainmask_reduction(sc,
119 - common->tx_chainmask, series[i].Rate);
120 + ah->txchainmask, series[i].Rate);
122 series[i].PktDuration = ath9k_hw_computetxtime(sc->sc_ah,
123 phy, rate->bitrate * 100, len, rix, is_sp);
124 --- a/drivers/net/wireless/ath/ath9k/beacon.c
125 +++ b/drivers/net/wireless/ath/ath9k/beacon.c
126 @@ -107,7 +107,7 @@ static void ath_beacon_setup(struct ath_
128 series[0].Rate = rate;
129 series[0].ChSel = ath_txchainmask_reduction(sc,
130 - common->tx_chainmask, series[0].Rate);
131 + ah->txchainmask, series[0].Rate);
132 series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0;
133 ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration,
135 --- a/drivers/net/wireless/ath/ath9k/debug.c
136 +++ b/drivers/net/wireless/ath/ath9k/debug.c
137 @@ -95,11 +95,11 @@ static ssize_t read_file_tx_chainmask(st
138 size_t count, loff_t *ppos)
140 struct ath_softc *sc = file->private_data;
141 - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
142 + struct ath_hw *ah = sc->sc_ah;
146 - len = sprintf(buf, "0x%08x\n", common->tx_chainmask);
147 + len = sprintf(buf, "0x%08x\n", ah->txchainmask);
148 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
151 @@ -107,7 +107,7 @@ static ssize_t write_file_tx_chainmask(s
152 size_t count, loff_t *ppos)
154 struct ath_softc *sc = file->private_data;
155 - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
156 + struct ath_hw *ah = sc->sc_ah;
160 @@ -120,8 +120,8 @@ static ssize_t write_file_tx_chainmask(s
161 if (strict_strtoul(buf, 0, &mask))
164 - common->tx_chainmask = mask;
165 - sc->sc_ah->caps.tx_chainmask = mask;
166 + ah->txchainmask = mask;
167 + ah->caps.tx_chainmask = mask;
171 @@ -138,11 +138,11 @@ static ssize_t read_file_rx_chainmask(st
172 size_t count, loff_t *ppos)
174 struct ath_softc *sc = file->private_data;
175 - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
176 + struct ath_hw *ah = sc->sc_ah;
180 - len = sprintf(buf, "0x%08x\n", common->rx_chainmask);
181 + len = sprintf(buf, "0x%08x\n", ah->rxchainmask);
182 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
185 @@ -150,7 +150,7 @@ static ssize_t write_file_rx_chainmask(s
186 size_t count, loff_t *ppos)
188 struct ath_softc *sc = file->private_data;
189 - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
190 + struct ath_hw *ah = sc->sc_ah;
194 @@ -163,8 +163,8 @@ static ssize_t write_file_rx_chainmask(s
195 if (strict_strtoul(buf, 0, &mask))
198 - common->rx_chainmask = mask;
199 - sc->sc_ah->caps.rx_chainmask = mask;
200 + ah->rxchainmask = mask;
201 + ah->caps.rx_chainmask = mask;
205 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
206 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
207 @@ -509,8 +509,8 @@ static void setup_ht_cap(struct ath9k_ht
208 memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
210 /* ath9k_htc supports only 1 or 2 stream devices */
211 - tx_streams = ath9k_cmn_count_streams(common->tx_chainmask, 2);
212 - rx_streams = ath9k_cmn_count_streams(common->rx_chainmask, 2);
213 + tx_streams = ath9k_cmn_count_streams(priv->ah->txchainmask, 2);
214 + rx_streams = ath9k_cmn_count_streams(priv->ah->rxchainmask, 2);
216 ath_dbg(common, ATH_DBG_CONFIG,
217 "TX streams %d, RX streams: %d\n",
218 @@ -601,9 +601,6 @@ static void ath9k_init_misc(struct ath9k
220 struct ath_common *common = ath9k_hw_common(priv->ah);
222 - common->tx_chainmask = priv->ah->caps.tx_chainmask;
223 - common->rx_chainmask = priv->ah->caps.rx_chainmask;
225 memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN);
227 priv->ah->opmode = NL80211_IFTYPE_STATION;
228 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
229 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
230 @@ -826,8 +826,7 @@ void ath9k_htc_ani_work(struct work_stru
231 if (longcal || shortcal)
232 common->ani.caldone =
233 ath9k_hw_calibrate(ah, ah->curchan,
234 - common->rx_chainmask,
236 + ah->rxchainmask, longcal);
238 ath9k_htc_ps_restore(priv);
240 --- a/drivers/net/wireless/ath/ath9k/init.c
241 +++ b/drivers/net/wireless/ath/ath9k/init.c
242 @@ -270,8 +270,8 @@ static void setup_ht_cap(struct ath_soft
244 /* set up supported mcs set */
245 memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
246 - tx_streams = ath9k_cmn_count_streams(common->tx_chainmask, max_streams);
247 - rx_streams = ath9k_cmn_count_streams(common->rx_chainmask, max_streams);
248 + tx_streams = ath9k_cmn_count_streams(ah->txchainmask, max_streams);
249 + rx_streams = ath9k_cmn_count_streams(ah->rxchainmask, max_streams);
251 ath_dbg(common, ATH_DBG_CONFIG,
252 "TX streams %d, RX streams: %d\n",
253 @@ -506,9 +506,6 @@ static void ath9k_init_misc(struct ath_s
254 sc->sc_flags |= SC_OP_RXAGGR;
257 - common->tx_chainmask = sc->sc_ah->caps.tx_chainmask;
258 - common->rx_chainmask = sc->sc_ah->caps.rx_chainmask;
260 ath9k_hw_set_diversity(sc->sc_ah, true);
261 sc->rx.defant = ath9k_hw_getdefantenna(sc->sc_ah);
263 @@ -645,10 +642,8 @@ static void ath9k_init_band_txpower(stru
264 static void ath9k_init_txpower_limits(struct ath_softc *sc)
266 struct ath_hw *ah = sc->sc_ah;
267 - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
268 struct ath9k_channel *curchan = ah->curchan;
270 - ah->txchainmask = common->tx_chainmask;
271 if (ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ)
272 ath9k_init_band_txpower(sc, IEEE80211_BAND_2GHZ);
273 if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ)