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