1 /*
2 * Copyright (c) 2010 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 #include <linux/kernel.h>
18 #include <linux/module.h>
19
20 #include <proto/802.11.h>
21
22 #include <bcmdefs.h>
23 #include <bcmutils.h>
24 #include <siutils.h>
25 #include <wlioctl.h>
26 #include <bcmwifi.h>
27 #include <sbhnddma.h>
28
29 #include "wlc_types.h"
30 #include "d11.h"
31 #include "wl_dbg.h"
32 #include "wlc_cfg.h"
33 #include "wlc_rate.h"
34 #include "wlc_scb.h"
35 #include "wlc_pub.h"
36 #include "wlc_key.h"
37 #include "phy/wlc_phy_hal.h"
38 #include "wlc_channel.h"
39 #include "wlc_main.h"
40 #include "wl_export.h"
41 #include "wlc_bmac.h"
42 #include "wlc_stf.h"
43
44 #define MIN_SPATIAL_EXPANSION 0
45 #define MAX_SPATIAL_EXPANSION 1
46
47 #define WLC_STF_SS_STBC_RX(wlc) (WLCISNPHY(wlc->band) && \
48 NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6))
49
50 static bool wlc_stf_stbc_tx_set(struct wlc_info *wlc, s32 int_val);
51 static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 val);
52 static int wlc_stf_spatial_policy_set(struct wlc_info *wlc, int val);
53 static void wlc_stf_stbc_rx_ht_update(struct wlc_info *wlc, int val);
54
55 static void _wlc_stf_phy_txant_upd(struct wlc_info *wlc);
56 static u16 _wlc_stf_phytxchain_sel(struct wlc_info *wlc, ratespec_t rspec);
57
58 #define NSTS_1 1
59 #define NSTS_2 2
60 #define NSTS_3 3
61 #define NSTS_4 4
62 const u8 txcore_default[5] = {
63 (0), /* bitmap of the core enabled */
64 (0x01), /* For Nsts = 1, enable core 1 */
65 (0x03), /* For Nsts = 2, enable core 1 & 2 */
66 (0x07), /* For Nsts = 3, enable core 1, 2 & 3 */
67 (0x0f) /* For Nsts = 4, enable all cores */
68 };
69
wlc_stf_stbc_rx_ht_update(struct wlc_info * wlc,int val)70 static void wlc_stf_stbc_rx_ht_update(struct wlc_info *wlc, int val)
71 {
72 ASSERT((val == HT_CAP_RX_STBC_NO)
73 || (val == HT_CAP_RX_STBC_ONE_STREAM));
74
75 /* MIMOPHYs rev3-6 cannot receive STBC with only one rx core active */
76 if (WLC_STF_SS_STBC_RX(wlc)) {
77 if ((wlc->stf->rxstreams == 1) && (val != HT_CAP_RX_STBC_NO))
78 return;
79 }
80
81 wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_RX_STBC;
82 wlc->ht_cap.cap_info |= (val << IEEE80211_HT_CAP_RX_STBC_SHIFT);
83
84 if (wlc->pub->up) {
85 wlc_update_beacon(wlc);
86 wlc_update_probe_resp(wlc, true);
87 }
88 }
89
90 /* every WLC_TEMPSENSE_PERIOD seconds temperature check to decide whether to turn on/off txchain */
wlc_tempsense_upd(struct wlc_info * wlc)91 void wlc_tempsense_upd(struct wlc_info *wlc)
92 {
93 wlc_phy_t *pi = wlc->band->pi;
94 uint active_chains, txchain;
95
96 /* Check if the chip is too hot. Disable one Tx chain, if it is */
97 /* high 4 bits are for Rx chain, low 4 bits are for Tx chain */
98 active_chains = wlc_phy_stf_chain_active_get(pi);
99 txchain = active_chains & 0xf;
100
101 if (wlc->stf->txchain == wlc->stf->hw_txchain) {
102 if (txchain && (txchain < wlc->stf->hw_txchain)) {
103 /* turn off 1 tx chain */
104 wlc_stf_txchain_set(wlc, txchain, true);
105 }
106 } else if (wlc->stf->txchain < wlc->stf->hw_txchain) {
107 if (txchain == wlc->stf->hw_txchain) {
108 /* turn back on txchain */
109 wlc_stf_txchain_set(wlc, txchain, true);
110 }
111 }
112 }
113
114 void
wlc_stf_ss_algo_channel_get(struct wlc_info * wlc,u16 * ss_algo_channel,chanspec_t chanspec)115 wlc_stf_ss_algo_channel_get(struct wlc_info *wlc, u16 *ss_algo_channel,
116 chanspec_t chanspec)
117 {
118 tx_power_t power;
119 u8 siso_mcs_id, cdd_mcs_id, stbc_mcs_id;
120
121 /* Clear previous settings */
122 *ss_algo_channel = 0;
123
124 if (!wlc->pub->up) {
125 *ss_algo_channel = (u16) -1;
126 return;
127 }
128
129 wlc_phy_txpower_get_current(wlc->band->pi, &power,
130 CHSPEC_CHANNEL(chanspec));
131
132 siso_mcs_id = (CHSPEC_IS40(chanspec)) ?
133 WL_TX_POWER_MCS40_SISO_FIRST : WL_TX_POWER_MCS20_SISO_FIRST;
134 cdd_mcs_id = (CHSPEC_IS40(chanspec)) ?
135 WL_TX_POWER_MCS40_CDD_FIRST : WL_TX_POWER_MCS20_CDD_FIRST;
136 stbc_mcs_id = (CHSPEC_IS40(chanspec)) ?
137 WL_TX_POWER_MCS40_STBC_FIRST : WL_TX_POWER_MCS20_STBC_FIRST;
138
139 /* criteria to choose stf mode */
140
141 /* the "+3dbm (12 0.25db units)" is to account for the fact that with CDD, tx occurs
142 * on both chains
143 */
144 if (power.target[siso_mcs_id] > (power.target[cdd_mcs_id] + 12))
145 setbit(ss_algo_channel, PHY_TXC1_MODE_SISO);
146 else
147 setbit(ss_algo_channel, PHY_TXC1_MODE_CDD);
148
149 /* STBC is ORed into to algo channel as STBC requires per-packet SCB capability check
150 * so cannot be default mode of operation. One of SISO, CDD have to be set
151 */
152 if (power.target[siso_mcs_id] <= (power.target[stbc_mcs_id] + 12))
153 setbit(ss_algo_channel, PHY_TXC1_MODE_STBC);
154 }
155
wlc_stf_stbc_tx_set(struct wlc_info * wlc,s32 int_val)156 static bool wlc_stf_stbc_tx_set(struct wlc_info *wlc, s32 int_val)
157 {
158 if ((int_val != AUTO) && (int_val != OFF) && (int_val != ON)) {
159 return false;
160 }
161
162 if ((int_val == ON) && (wlc->stf->txstreams == 1))
163 return false;
164
165 if ((int_val == OFF) || (wlc->stf->txstreams == 1)
166 || !WLC_STBC_CAP_PHY(wlc))
167 wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
168 else
169 wlc->ht_cap.cap_info |= IEEE80211_HT_CAP_TX_STBC;
170
171 wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = (s8) int_val;
172 wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = (s8) int_val;
173
174 return true;
175 }
176
wlc_stf_stbc_rx_set(struct wlc_info * wlc,s32 int_val)177 bool wlc_stf_stbc_rx_set(struct wlc_info *wlc, s32 int_val)
178 {
179 if ((int_val != HT_CAP_RX_STBC_NO)
180 && (int_val != HT_CAP_RX_STBC_ONE_STREAM)) {
181 return false;
182 }
183
184 if (WLC_STF_SS_STBC_RX(wlc)) {
185 if ((int_val != HT_CAP_RX_STBC_NO)
186 && (wlc->stf->rxstreams == 1))
187 return false;
188 }
189
190 wlc_stf_stbc_rx_ht_update(wlc, int_val);
191 return true;
192 }
193
wlc_stf_txcore_set(struct wlc_info * wlc,u8 Nsts,u8 core_mask)194 static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 core_mask)
195 {
196 WL_TRACE("wl%d: %s: Nsts %d core_mask %x\n",
197 wlc->pub->unit, __func__, Nsts, core_mask);
198
199 ASSERT((Nsts > 0) && (Nsts <= MAX_STREAMS_SUPPORTED));
200
201 if (WLC_BITSCNT(core_mask) > wlc->stf->txstreams) {
202 core_mask = 0;
203 }
204
205 if ((WLC_BITSCNT(core_mask) == wlc->stf->txstreams) &&
206 ((core_mask & ~wlc->stf->txchain)
207 || !(core_mask & wlc->stf->txchain))) {
208 core_mask = wlc->stf->txchain;
209 }
210
211 ASSERT(!core_mask || Nsts <= WLC_BITSCNT(core_mask));
212
213 wlc->stf->txcore[Nsts] = core_mask;
214 /* Nsts = 1..4, txcore index = 1..4 */
215 if (Nsts == 1) {
216 /* Needs to update beacon and ucode generated response
217 * frames when 1 stream core map changed
218 */
219 wlc->stf->phytxant = core_mask << PHY_TXC_ANT_SHIFT;
220 wlc_bmac_txant_set(wlc->hw, wlc->stf->phytxant);
221 if (wlc->clk) {
222 wlc_suspend_mac_and_wait(wlc);
223 wlc_beacon_phytxctl_txant_upd(wlc, wlc->bcn_rspec);
224 wlc_enable_mac(wlc);
225 }
226 }
227
228 return BCME_OK;
229 }
230
wlc_stf_spatial_policy_set(struct wlc_info * wlc,int val)231 static int wlc_stf_spatial_policy_set(struct wlc_info *wlc, int val)
232 {
233 int i;
234 u8 core_mask = 0;
235
236 WL_TRACE("wl%d: %s: val %x\n", wlc->pub->unit, __func__, val);
237
238 wlc->stf->spatial_policy = (s8) val;
239 for (i = 1; i <= MAX_STREAMS_SUPPORTED; i++) {
240 core_mask = (val == MAX_SPATIAL_EXPANSION) ?
241 wlc->stf->txchain : txcore_default[i];
242 wlc_stf_txcore_set(wlc, (u8) i, core_mask);
243 }
244 return BCME_OK;
245 }
246
wlc_stf_txchain_set(struct wlc_info * wlc,s32 int_val,bool force)247 int wlc_stf_txchain_set(struct wlc_info *wlc, s32 int_val, bool force)
248 {
249 u8 txchain = (u8) int_val;
250 u8 txstreams;
251 uint i;
252
253 if (wlc->stf->txchain == txchain)
254 return BCME_OK;
255
256 if ((txchain & ~wlc->stf->hw_txchain)
257 || !(txchain & wlc->stf->hw_txchain))
258 return BCME_RANGE;
259
260 /* if nrate override is configured to be non-SISO STF mode, reject reducing txchain to 1 */
261 txstreams = (u8) WLC_BITSCNT(txchain);
262 if (txstreams > MAX_STREAMS_SUPPORTED)
263 return BCME_RANGE;
264
265 if (txstreams == 1) {
266 for (i = 0; i < NBANDS(wlc); i++)
267 if ((RSPEC_STF(wlc->bandstate[i]->rspec_override) !=
268 PHY_TXC1_MODE_SISO)
269 || (RSPEC_STF(wlc->bandstate[i]->mrspec_override) !=
270 PHY_TXC1_MODE_SISO)) {
271 if (!force)
272 return BCME_ERROR;
273
274 /* over-write the override rspec */
275 if (RSPEC_STF(wlc->bandstate[i]->rspec_override)
276 != PHY_TXC1_MODE_SISO) {
277 wlc->bandstate[i]->rspec_override = 0;
278 WL_ERROR("%s(): temp sense override non-SISO rspec_override\n",
279 __func__);
280 }
281 if (RSPEC_STF
282 (wlc->bandstate[i]->mrspec_override) !=
283 PHY_TXC1_MODE_SISO) {
284 wlc->bandstate[i]->mrspec_override = 0;
285 WL_ERROR("%s(): temp sense override non-SISO mrspec_override\n",
286 __func__);
287 }
288 }
289 }
290
291 wlc->stf->txchain = txchain;
292 wlc->stf->txstreams = txstreams;
293 wlc_stf_stbc_tx_set(wlc, wlc->band->band_stf_stbc_tx);
294 wlc_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]);
295 wlc_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]);
296 wlc->stf->txant =
297 (wlc->stf->txstreams == 1) ? ANT_TX_FORCE_0 : ANT_TX_DEF;
298 _wlc_stf_phy_txant_upd(wlc);
299
300 wlc_phy_stf_chain_set(wlc->band->pi, wlc->stf->txchain,
301 wlc->stf->rxchain);
302
303 for (i = 1; i <= MAX_STREAMS_SUPPORTED; i++)
304 wlc_stf_txcore_set(wlc, (u8) i, txcore_default[i]);
305
306 return BCME_OK;
307 }
308
309 /* update wlc->stf->ss_opmode which represents the operational stf_ss mode we're using */
wlc_stf_ss_update(struct wlc_info * wlc,struct wlcband * band)310 int wlc_stf_ss_update(struct wlc_info *wlc, struct wlcband *band)
311 {
312 int ret_code = 0;
313 u8 prev_stf_ss;
314 u8 upd_stf_ss;
315
316 prev_stf_ss = wlc->stf->ss_opmode;
317
318 /* NOTE: opmode can only be SISO or CDD as STBC is decided on a per-packet basis */
319 if (WLC_STBC_CAP_PHY(wlc) &&
320 wlc->stf->ss_algosel_auto
321 && (wlc->stf->ss_algo_channel != (u16) -1)) {
322 ASSERT(isset(&wlc->stf->ss_algo_channel, PHY_TXC1_MODE_CDD)
323 || isset(&wlc->stf->ss_algo_channel,
324 PHY_TXC1_MODE_SISO));
325 upd_stf_ss = (wlc->stf->no_cddstbc || (wlc->stf->txstreams == 1)
326 || isset(&wlc->stf->ss_algo_channel,
327 PHY_TXC1_MODE_SISO)) ? PHY_TXC1_MODE_SISO
328 : PHY_TXC1_MODE_CDD;
329 } else {
330 if (wlc->band != band)
331 return ret_code;
332 upd_stf_ss = (wlc->stf->no_cddstbc
333 || (wlc->stf->txstreams ==
334 1)) ? PHY_TXC1_MODE_SISO : band->
335 band_stf_ss_mode;
336 }
337 if (prev_stf_ss != upd_stf_ss) {
338 wlc->stf->ss_opmode = upd_stf_ss;
339 wlc_bmac_band_stf_ss_set(wlc->hw, upd_stf_ss);
340 }
341
342 return ret_code;
343 }
344
wlc_stf_attach(struct wlc_info * wlc)345 int wlc_stf_attach(struct wlc_info *wlc)
346 {
347 wlc->bandstate[BAND_2G_INDEX]->band_stf_ss_mode = PHY_TXC1_MODE_SISO;
348 wlc->bandstate[BAND_5G_INDEX]->band_stf_ss_mode = PHY_TXC1_MODE_CDD;
349
350 if (WLCISNPHY(wlc->band) &&
351 (wlc_phy_txpower_hw_ctrl_get(wlc->band->pi) != PHY_TPC_HW_ON))
352 wlc->bandstate[BAND_2G_INDEX]->band_stf_ss_mode =
353 PHY_TXC1_MODE_CDD;
354 wlc_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]);
355 wlc_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]);
356
357 wlc_stf_stbc_rx_ht_update(wlc, HT_CAP_RX_STBC_NO);
358 wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = OFF;
359 wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = OFF;
360
361 if (WLC_STBC_CAP_PHY(wlc)) {
362 wlc->stf->ss_algosel_auto = true;
363 wlc->stf->ss_algo_channel = (u16) -1; /* Init the default value */
364 }
365 return 0;
366 }
367
wlc_stf_detach(struct wlc_info * wlc)368 void wlc_stf_detach(struct wlc_info *wlc)
369 {
370 }
371
wlc_stf_ant_txant_validate(struct wlc_info * wlc,s8 val)372 int wlc_stf_ant_txant_validate(struct wlc_info *wlc, s8 val)
373 {
374 int bcmerror = BCME_OK;
375
376 /* when there is only 1 tx_streams, don't allow to change the txant */
377 if (WLCISNPHY(wlc->band) && (wlc->stf->txstreams == 1))
378 return ((val == wlc->stf->txant) ? bcmerror : BCME_RANGE);
379
380 switch (val) {
381 case -1:
382 val = ANT_TX_DEF;
383 break;
384 case 0:
385 val = ANT_TX_FORCE_0;
386 break;
387 case 1:
388 val = ANT_TX_FORCE_1;
389 break;
390 case 3:
391 val = ANT_TX_LAST_RX;
392 break;
393 default:
394 bcmerror = BCME_RANGE;
395 break;
396 }
397
398 if (bcmerror == BCME_OK)
399 wlc->stf->txant = (s8) val;
400
401 return bcmerror;
402
403 }
404
405 /*
406 * Centralized txant update function. call it whenever wlc->stf->txant and/or wlc->stf->txchain
407 * change
408 *
409 * Antennas are controlled by ucode indirectly, which drives PHY or GPIO to
410 * achieve various tx/rx antenna selection schemes
411 *
412 * legacy phy, bit 6 and bit 7 means antenna 0 and 1 respectively, bit6+bit7 means auto(last rx)
413 * for NREV<3, bit 6 and bit 7 means antenna 0 and 1 respectively, bit6+bit7 means last rx and
414 * do tx-antenna selection for SISO transmissions
415 * for NREV=3, bit 6 and bit _8_ means antenna 0 and 1 respectively, bit6+bit7 means last rx and
416 * do tx-antenna selection for SISO transmissions
417 * for NREV>=7, bit 6 and bit 7 mean antenna 0 and 1 respectively, nit6+bit7 means both cores active
418 */
_wlc_stf_phy_txant_upd(struct wlc_info * wlc)419 static void _wlc_stf_phy_txant_upd(struct wlc_info *wlc)
420 {
421 s8 txant;
422
423 txant = (s8) wlc->stf->txant;
424 ASSERT(txant == ANT_TX_FORCE_0 || txant == ANT_TX_FORCE_1
425 || txant == ANT_TX_LAST_RX);
426
427 if (WLC_PHY_11N_CAP(wlc->band)) {
428 if (txant == ANT_TX_FORCE_0) {
429 wlc->stf->phytxant = PHY_TXC_ANT_0;
430 } else if (txant == ANT_TX_FORCE_1) {
431 wlc->stf->phytxant = PHY_TXC_ANT_1;
432
433 if (WLCISNPHY(wlc->band) &&
434 NREV_GE(wlc->band->phyrev, 3)
435 && NREV_LT(wlc->band->phyrev, 7)) {
436 wlc->stf->phytxant = PHY_TXC_ANT_2;
437 }
438 } else {
439 if (WLCISLCNPHY(wlc->band) || WLCISSSLPNPHY(wlc->band))
440 wlc->stf->phytxant = PHY_TXC_LCNPHY_ANT_LAST;
441 else {
442 /* keep this assert to catch out of sync wlc->stf->txcore */
443 ASSERT(wlc->stf->txchain > 0);
444 wlc->stf->phytxant =
445 wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
446 }
447 }
448 } else {
449 if (txant == ANT_TX_FORCE_0)
450 wlc->stf->phytxant = PHY_TXC_OLD_ANT_0;
451 else if (txant == ANT_TX_FORCE_1)
452 wlc->stf->phytxant = PHY_TXC_OLD_ANT_1;
453 else
454 wlc->stf->phytxant = PHY_TXC_OLD_ANT_LAST;
455 }
456
457 wlc_bmac_txant_set(wlc->hw, wlc->stf->phytxant);
458 }
459
wlc_stf_phy_txant_upd(struct wlc_info * wlc)460 void wlc_stf_phy_txant_upd(struct wlc_info *wlc)
461 {
462 _wlc_stf_phy_txant_upd(wlc);
463 }
464
wlc_stf_phy_chain_calc(struct wlc_info * wlc)465 void wlc_stf_phy_chain_calc(struct wlc_info *wlc)
466 {
467 /* get available rx/tx chains */
468 wlc->stf->hw_txchain = (u8) getintvar(wlc->pub->vars, "txchain");
469 wlc->stf->hw_rxchain = (u8) getintvar(wlc->pub->vars, "rxchain");
470
471 /* these parameter are intended to be used for all PHY types */
472 if (wlc->stf->hw_txchain == 0 || wlc->stf->hw_txchain == 0xf) {
473 if (WLCISNPHY(wlc->band)) {
474 wlc->stf->hw_txchain = TXCHAIN_DEF_NPHY;
475 } else {
476 wlc->stf->hw_txchain = TXCHAIN_DEF;
477 }
478 }
479
480 wlc->stf->txchain = wlc->stf->hw_txchain;
481 wlc->stf->txstreams = (u8) WLC_BITSCNT(wlc->stf->hw_txchain);
482
483 if (wlc->stf->hw_rxchain == 0 || wlc->stf->hw_rxchain == 0xf) {
484 if (WLCISNPHY(wlc->band)) {
485 wlc->stf->hw_rxchain = RXCHAIN_DEF_NPHY;
486 } else {
487 wlc->stf->hw_rxchain = RXCHAIN_DEF;
488 }
489 }
490
491 wlc->stf->rxchain = wlc->stf->hw_rxchain;
492 wlc->stf->rxstreams = (u8) WLC_BITSCNT(wlc->stf->hw_rxchain);
493
494 /* initialize the txcore table */
495 memcpy(wlc->stf->txcore, txcore_default, sizeof(wlc->stf->txcore));
496
497 /* default spatial_policy */
498 wlc->stf->spatial_policy = MIN_SPATIAL_EXPANSION;
499 wlc_stf_spatial_policy_set(wlc, MIN_SPATIAL_EXPANSION);
500 }
501
_wlc_stf_phytxchain_sel(struct wlc_info * wlc,ratespec_t rspec)502 static u16 _wlc_stf_phytxchain_sel(struct wlc_info *wlc, ratespec_t rspec)
503 {
504 u16 phytxant = wlc->stf->phytxant;
505
506 if (RSPEC_STF(rspec) != PHY_TXC1_MODE_SISO) {
507 ASSERT(wlc->stf->txstreams > 1);
508 phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
509 } else if (wlc->stf->txant == ANT_TX_DEF)
510 phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
511 phytxant &= PHY_TXC_ANT_MASK;
512 return phytxant;
513 }
514
wlc_stf_phytxchain_sel(struct wlc_info * wlc,ratespec_t rspec)515 u16 wlc_stf_phytxchain_sel(struct wlc_info *wlc, ratespec_t rspec)
516 {
517 return _wlc_stf_phytxchain_sel(wlc, rspec);
518 }
519
wlc_stf_d11hdrs_phyctl_txant(struct wlc_info * wlc,ratespec_t rspec)520 u16 wlc_stf_d11hdrs_phyctl_txant(struct wlc_info *wlc, ratespec_t rspec)
521 {
522 u16 phytxant = wlc->stf->phytxant;
523 u16 mask = PHY_TXC_ANT_MASK;
524
525 /* for non-siso rates or default setting, use the available chains */
526 if (WLCISNPHY(wlc->band)) {
527 ASSERT(wlc->stf->txchain != 0);
528 phytxant = _wlc_stf_phytxchain_sel(wlc, rspec);
529 mask = PHY_TXC_HTANT_MASK;
530 }
531 phytxant |= phytxant & mask;
532 return phytxant;
533 }
534