/* * Copyright (c) 2010 Broadcom Corporation * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
staticconst u8 txcore_default[5] = {
(0), /* bitmap of the core enabled */
(0x01), /* For Nsts = 1, enable core 1 */
(0x03), /* For Nsts = 2, enable core 1 & 2 */
(0x07), /* For Nsts = 3, enable core 1, 2 & 3 */
(0x0f) /* For Nsts = 4, enable all cores */
};
staticvoid brcms_c_stf_stbc_rx_ht_update(struct brcms_c_info *wlc, int val)
{ /* MIMOPHYs rev3-6 cannot receive STBC with only one rx core active */ if (BRCMS_STF_SS_STBC_RX(wlc)) { if ((wlc->stf->rxstreams == 1) && (val != HT_CAP_RX_STBC_NO)) return;
}
if (wlc->pub->up) {
brcms_c_update_beacon(wlc);
brcms_c_update_probe_resp(wlc, true);
}
}
/* * every WLC_TEMPSENSE_PERIOD seconds temperature check to decide whether to * turn on/off txchain.
*/ void brcms_c_tempsense_upd(struct brcms_c_info *wlc)
{ struct brcms_phy_pub *pi = wlc->band->pi;
uint active_chains, txchain;
/* Check if the chip is too hot. Disable one Tx chain, if it is */ /* high 4 bits are for Rx chain, low 4 bits are for Tx chain */
active_chains = wlc_phy_stf_chain_active_get(pi);
txchain = active_chains & 0xf;
if (wlc->stf->txchain == wlc->stf->hw_txchain) { if (txchain && (txchain < wlc->stf->hw_txchain)) /* turn off 1 tx chain */
brcms_c_stf_txchain_set(wlc, txchain, true);
} elseif (wlc->stf->txchain < wlc->stf->hw_txchain) { if (txchain == wlc->stf->hw_txchain) /* turn back on txchain */
brcms_c_stf_txchain_set(wlc, txchain, true);
}
}
/* * the "+3dbm (12 0.25db units)" is to account for the fact that with * CDD, tx occurs on both chains
*/ if (power.target[siso_mcs_id] > (power.target[cdd_mcs_id] + 12))
setbit(ss_algo_channel, PHY_TXC1_MODE_SISO); else
setbit(ss_algo_channel, PHY_TXC1_MODE_CDD);
/* * STBC is ORed into to algo channel as STBC requires per-packet SCB * capability check so cannot be default mode of operation. One of * SISO, CDD have to be set
*/ if (power.target[siso_mcs_id] <= (power.target[stbc_mcs_id] + 12))
setbit(ss_algo_channel, PHY_TXC1_MODE_STBC);
}
wlc->stf->txcore[Nsts] = core_mask; /* Nsts = 1..4, txcore index = 1..4 */ if (Nsts == 1) { /* Needs to update beacon and ucode generated response * frames when 1 stream core map changed
*/
wlc->stf->phytxant = core_mask << PHY_TXC_ANT_SHIFT;
brcms_b_txant_set(wlc->hw, wlc->stf->phytxant); if (wlc->clk) {
brcms_c_suspend_mac_and_wait(wlc);
brcms_c_beacon_phytxctl_txant_upd(wlc, wlc->bcn_rspec);
brcms_c_enable_mac(wlc);
}
}
return 0;
}
staticint brcms_c_stf_spatial_policy_set(struct brcms_c_info *wlc, int val)
{ int i;
u8 core_mask = 0;
brcms_dbg_ht(wlc->hw->d11core, "wl%d: val %x\n", wlc->pub->unit,
val);
wlc->stf->spatial_policy = (s8) val; for (i = 1; i <= MAX_STREAMS_SUPPORTED; i++) {
core_mask = (val == MAX_SPATIAL_EXPANSION) ?
wlc->stf->txchain : txcore_default[i];
brcms_c_stf_txcore_set(wlc, (u8) i, core_mask);
} return 0;
}
/* * Centralized txant update function. call it whenever wlc->stf->txant and/or * wlc->stf->txchain change. * * Antennas are controlled by ucode indirectly, which drives PHY or GPIO to * achieve various tx/rx antenna selection schemes * * legacy phy, bit 6 and bit 7 means antenna 0 and 1 respectively, bit6+bit7 * means auto(last rx). * for NREV<3, bit 6 and bit 7 means antenna 0 and 1 respectively, bit6+bit7 * means last rx and do tx-antenna selection for SISO transmissions * for NREV=3, bit 6 and bit _8_ means antenna 0 and 1 respectively, bit6+bit7 * means last rx and do tx-antenna selection for SISO transmissions * for NREV>=7, bit 6 and bit 7 mean antenna 0 and 1 respectively, nit6+bit7 * means both cores active
*/ staticvoid _brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc)
{
s8 txant;
if ((txchain & ~wlc->stf->hw_txchain)
|| !(txchain & wlc->stf->hw_txchain)) return -EINVAL;
/* * if nrate override is configured to be non-SISO STF mode, reject * reducing txchain to 1
*/
txstreams = (u8) hweight8(txchain); if (txstreams > MAX_STREAMS_SUPPORTED) return -EINVAL;
/* get available rx/tx chains */
wlc->stf->hw_txchain = sprom->txchain;
wlc->stf->hw_rxchain = sprom->rxchain;
/* these parameter are intended to be used for all PHY types */ if (wlc->stf->hw_txchain == 0 || wlc->stf->hw_txchain == 0xf) { if (BRCMS_ISNPHY(wlc->band))
wlc->stf->hw_txchain = TXCHAIN_DEF_NPHY; else
wlc->stf->hw_txchain = TXCHAIN_DEF;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.