Lines Matching +full:in +full:- +full:band

6  * copyright notice and this permission notice appear in all copies.
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
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
31 #define BRCMS_STF_SS_STBC_RX(wlc) (BRCMS_ISNPHY(wlc->band) && \
32 NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6))
49 /* MIMOPHYs rev3-6 cannot receive STBC with only one rx core active */ in brcms_c_stf_stbc_rx_ht_update()
51 if ((wlc->stf->rxstreams == 1) && (val != HT_CAP_RX_STBC_NO)) in brcms_c_stf_stbc_rx_ht_update()
55 if (wlc->pub->up) { in brcms_c_stf_stbc_rx_ht_update()
67 struct brcms_phy_pub *pi = wlc->band->pi; in brcms_c_tempsense_upd()
75 if (wlc->stf->txchain == wlc->stf->hw_txchain) { in brcms_c_tempsense_upd()
76 if (txchain && (txchain < wlc->stf->hw_txchain)) in brcms_c_tempsense_upd()
79 } else if (wlc->stf->txchain < wlc->stf->hw_txchain) { in brcms_c_tempsense_upd()
80 if (txchain == wlc->stf->hw_txchain) in brcms_c_tempsense_upd()
96 if (!wlc->pub->up) { in brcms_c_stf_ss_algo_channel_get()
97 *ss_algo_channel = (u16) -1; in brcms_c_stf_ss_algo_channel_get()
101 wlc_phy_txpower_get_current(wlc->band->pi, &power, in brcms_c_stf_ss_algo_channel_get()
123 * STBC is ORed into to algo channel as STBC requires per-packet SCB in brcms_c_stf_ss_algo_channel_get()
136 if ((int_val == ON) && (wlc->stf->txstreams == 1)) in brcms_c_stf_stbc_tx_set()
139 wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = (s8) int_val; in brcms_c_stf_stbc_tx_set()
140 wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = (s8) int_val; in brcms_c_stf_stbc_tx_set()
153 && (wlc->stf->rxstreams == 1)) in brcms_c_stf_stbc_rx_set()
164 brcms_dbg_ht(wlc->hw->d11core, "wl%d: Nsts %d core_mask %x\n", in brcms_c_stf_txcore_set()
165 wlc->pub->unit, Nsts, core_mask); in brcms_c_stf_txcore_set()
167 if (hweight8(core_mask) > wlc->stf->txstreams) in brcms_c_stf_txcore_set()
170 if ((hweight8(core_mask) == wlc->stf->txstreams) && in brcms_c_stf_txcore_set()
171 ((core_mask & ~wlc->stf->txchain) in brcms_c_stf_txcore_set()
172 || !(core_mask & wlc->stf->txchain))) in brcms_c_stf_txcore_set()
173 core_mask = wlc->stf->txchain; in brcms_c_stf_txcore_set()
175 wlc->stf->txcore[Nsts] = core_mask; in brcms_c_stf_txcore_set()
181 wlc->stf->phytxant = core_mask << PHY_TXC_ANT_SHIFT; in brcms_c_stf_txcore_set()
182 brcms_b_txant_set(wlc->hw, wlc->stf->phytxant); in brcms_c_stf_txcore_set()
183 if (wlc->clk) { in brcms_c_stf_txcore_set()
185 brcms_c_beacon_phytxctl_txant_upd(wlc, wlc->bcn_rspec); in brcms_c_stf_txcore_set()
198 brcms_dbg_ht(wlc->hw->d11core, "wl%d: val %x\n", wlc->pub->unit, in brcms_c_stf_spatial_policy_set()
201 wlc->stf->spatial_policy = (s8) val; in brcms_c_stf_spatial_policy_set()
204 wlc->stf->txchain : txcore_default[i]; in brcms_c_stf_spatial_policy_set()
211 * Centralized txant update function. call it whenever wlc->stf->txant and/or
212 * wlc->stf->txchain change.
220 * means last rx and do tx-antenna selection for SISO transmissions
222 * means last rx and do tx-antenna selection for SISO transmissions
230 txant = (s8) wlc->stf->txant; in _brcms_c_stf_phy_txant_upd()
231 if (BRCMS_PHY_11N_CAP(wlc->band)) { in _brcms_c_stf_phy_txant_upd()
233 wlc->stf->phytxant = PHY_TXC_ANT_0; in _brcms_c_stf_phy_txant_upd()
235 wlc->stf->phytxant = PHY_TXC_ANT_1; in _brcms_c_stf_phy_txant_upd()
237 if (BRCMS_ISNPHY(wlc->band) && in _brcms_c_stf_phy_txant_upd()
238 NREV_GE(wlc->band->phyrev, 3) in _brcms_c_stf_phy_txant_upd()
239 && NREV_LT(wlc->band->phyrev, 7)) in _brcms_c_stf_phy_txant_upd()
240 wlc->stf->phytxant = PHY_TXC_ANT_2; in _brcms_c_stf_phy_txant_upd()
242 if (BRCMS_ISLCNPHY(wlc->band) || in _brcms_c_stf_phy_txant_upd()
243 BRCMS_ISSSLPNPHY(wlc->band)) in _brcms_c_stf_phy_txant_upd()
244 wlc->stf->phytxant = PHY_TXC_LCNPHY_ANT_LAST; in _brcms_c_stf_phy_txant_upd()
246 /* catch out of sync wlc->stf->txcore */ in _brcms_c_stf_phy_txant_upd()
247 WARN_ON(wlc->stf->txchain <= 0); in _brcms_c_stf_phy_txant_upd()
248 wlc->stf->phytxant = in _brcms_c_stf_phy_txant_upd()
249 wlc->stf->txchain << PHY_TXC_ANT_SHIFT; in _brcms_c_stf_phy_txant_upd()
254 wlc->stf->phytxant = PHY_TXC_OLD_ANT_0; in _brcms_c_stf_phy_txant_upd()
256 wlc->stf->phytxant = PHY_TXC_OLD_ANT_1; in _brcms_c_stf_phy_txant_upd()
258 wlc->stf->phytxant = PHY_TXC_OLD_ANT_LAST; in _brcms_c_stf_phy_txant_upd()
261 brcms_b_txant_set(wlc->hw, wlc->stf->phytxant); in _brcms_c_stf_phy_txant_upd()
270 if (wlc->stf->txchain == txchain) in brcms_c_stf_txchain_set()
273 if ((txchain & ~wlc->stf->hw_txchain) in brcms_c_stf_txchain_set()
274 || !(txchain & wlc->stf->hw_txchain)) in brcms_c_stf_txchain_set()
275 return -EINVAL; in brcms_c_stf_txchain_set()
278 * if nrate override is configured to be non-SISO STF mode, reject in brcms_c_stf_txchain_set()
283 return -EINVAL; in brcms_c_stf_txchain_set()
285 wlc->stf->txchain = txchain; in brcms_c_stf_txchain_set()
286 wlc->stf->txstreams = txstreams; in brcms_c_stf_txchain_set()
287 brcms_c_stf_stbc_tx_set(wlc, wlc->band->band_stf_stbc_tx); in brcms_c_stf_txchain_set()
288 brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]); in brcms_c_stf_txchain_set()
289 brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]); in brcms_c_stf_txchain_set()
290 wlc->stf->txant = in brcms_c_stf_txchain_set()
291 (wlc->stf->txstreams == 1) ? ANT_TX_FORCE_0 : ANT_TX_DEF; in brcms_c_stf_txchain_set()
294 wlc_phy_stf_chain_set(wlc->band->pi, wlc->stf->txchain, in brcms_c_stf_txchain_set()
295 wlc->stf->rxchain); in brcms_c_stf_txchain_set()
304 * update wlc->stf->ss_opmode which represents the operational stf_ss mode
307 void brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_band *band) in brcms_c_stf_ss_update() argument
312 prev_stf_ss = wlc->stf->ss_opmode; in brcms_c_stf_ss_update()
316 * per-packet basis in brcms_c_stf_ss_update()
319 wlc->stf->ss_algosel_auto in brcms_c_stf_ss_update()
320 && (wlc->stf->ss_algo_channel != (u16) -1)) { in brcms_c_stf_ss_update()
321 upd_stf_ss = (wlc->stf->txstreams == 1 || in brcms_c_stf_ss_update()
322 isset(&wlc->stf->ss_algo_channel, in brcms_c_stf_ss_update()
326 if (wlc->band != band) in brcms_c_stf_ss_update()
328 upd_stf_ss = (wlc->stf->txstreams == 1) ? in brcms_c_stf_ss_update()
329 PHY_TXC1_MODE_SISO : band->band_stf_ss_mode; in brcms_c_stf_ss_update()
332 wlc->stf->ss_opmode = upd_stf_ss; in brcms_c_stf_ss_update()
333 brcms_b_band_stf_ss_set(wlc->hw, upd_stf_ss); in brcms_c_stf_ss_update()
339 wlc->bandstate[BAND_2G_INDEX]->band_stf_ss_mode = PHY_TXC1_MODE_SISO; in brcms_c_stf_attach()
340 wlc->bandstate[BAND_5G_INDEX]->band_stf_ss_mode = PHY_TXC1_MODE_CDD; in brcms_c_stf_attach()
342 if (BRCMS_ISNPHY(wlc->band) && in brcms_c_stf_attach()
343 (wlc_phy_txpower_hw_ctrl_get(wlc->band->pi) != PHY_TPC_HW_ON)) in brcms_c_stf_attach()
344 wlc->bandstate[BAND_2G_INDEX]->band_stf_ss_mode = in brcms_c_stf_attach()
346 brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_2G_INDEX]); in brcms_c_stf_attach()
347 brcms_c_stf_ss_update(wlc, wlc->bandstate[BAND_5G_INDEX]); in brcms_c_stf_attach()
350 wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = OFF; in brcms_c_stf_attach()
351 wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = OFF; in brcms_c_stf_attach()
354 wlc->stf->ss_algosel_auto = true; in brcms_c_stf_attach()
356 wlc->stf->ss_algo_channel = (u16) -1; in brcms_c_stf_attach()
372 struct ssb_sprom *sprom = &wlc->hw->d11core->bus->sprom; in brcms_c_stf_phy_chain_calc()
375 wlc->stf->hw_txchain = sprom->txchain; in brcms_c_stf_phy_chain_calc()
376 wlc->stf->hw_rxchain = sprom->rxchain; in brcms_c_stf_phy_chain_calc()
379 if (wlc->stf->hw_txchain == 0 || wlc->stf->hw_txchain == 0xf) { in brcms_c_stf_phy_chain_calc()
380 if (BRCMS_ISNPHY(wlc->band)) in brcms_c_stf_phy_chain_calc()
381 wlc->stf->hw_txchain = TXCHAIN_DEF_NPHY; in brcms_c_stf_phy_chain_calc()
383 wlc->stf->hw_txchain = TXCHAIN_DEF; in brcms_c_stf_phy_chain_calc()
386 wlc->stf->txchain = wlc->stf->hw_txchain; in brcms_c_stf_phy_chain_calc()
387 wlc->stf->txstreams = (u8) hweight8(wlc->stf->hw_txchain); in brcms_c_stf_phy_chain_calc()
389 if (wlc->stf->hw_rxchain == 0 || wlc->stf->hw_rxchain == 0xf) { in brcms_c_stf_phy_chain_calc()
390 if (BRCMS_ISNPHY(wlc->band)) in brcms_c_stf_phy_chain_calc()
391 wlc->stf->hw_rxchain = RXCHAIN_DEF_NPHY; in brcms_c_stf_phy_chain_calc()
393 wlc->stf->hw_rxchain = RXCHAIN_DEF; in brcms_c_stf_phy_chain_calc()
396 wlc->stf->rxchain = wlc->stf->hw_rxchain; in brcms_c_stf_phy_chain_calc()
397 wlc->stf->rxstreams = (u8) hweight8(wlc->stf->hw_rxchain); in brcms_c_stf_phy_chain_calc()
400 memcpy(wlc->stf->txcore, txcore_default, sizeof(wlc->stf->txcore)); in brcms_c_stf_phy_chain_calc()
403 wlc->stf->spatial_policy = MIN_SPATIAL_EXPANSION; in brcms_c_stf_phy_chain_calc()
410 u16 phytxant = wlc->stf->phytxant; in _brcms_c_stf_phytxchain_sel()
413 phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT; in _brcms_c_stf_phytxchain_sel()
414 else if (wlc->stf->txant == ANT_TX_DEF) in _brcms_c_stf_phytxchain_sel()
415 phytxant = wlc->stf->txchain << PHY_TXC_ANT_SHIFT; in _brcms_c_stf_phytxchain_sel()
427 u16 phytxant = wlc->stf->phytxant; in brcms_c_stf_d11hdrs_phyctl_txant()
430 /* for non-siso rates or default setting, use the available chains */ in brcms_c_stf_d11hdrs_phyctl_txant()
431 if (BRCMS_ISNPHY(wlc->band)) { in brcms_c_stf_d11hdrs_phyctl_txant()