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