27 #define MIN_SPATIAL_EXPANSION 0
28 #define MAX_SPATIAL_EXPANSION 1
30 #define BRCMS_STF_SS_STBC_RX(wlc) (BRCMS_ISNPHY(wlc->band) && \
31 NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6))
38 static const u8 txcore_default[5] = {
46 static void brcms_c_stf_stbc_rx_ht_update(
struct brcms_c_info *wlc,
int val)
67 uint active_chains, txchain;
72 txchain = active_chains & 0xf;
74 if (wlc->
stf->txchain == wlc->
stf->hw_txchain) {
75 if (txchain && (txchain < wlc->stf->hw_txchain))
78 }
else if (wlc->
stf->txchain < wlc->
stf->hw_txchain) {
79 if (txchain == wlc->
stf->hw_txchain)
90 u8 siso_mcs_id, cdd_mcs_id, stbc_mcs_id;
96 *ss_algo_channel = (
u16) -1;
116 if (power.
target[siso_mcs_id] > (power.
target[cdd_mcs_id] + 12))
126 if (power.
target[siso_mcs_id] <= (power.
target[stbc_mcs_id] + 12))
130 static bool brcms_c_stf_stbc_tx_set(
struct brcms_c_info *wlc,
s32 int_val)
132 if ((int_val !=
AUTO) && (int_val !=
OFF) && (int_val !=
ON))
135 if ((int_val ==
ON) && (wlc->
stf->txstreams == 1))
152 && (wlc->
stf->rxstreams == 1))
156 brcms_c_stf_stbc_rx_ht_update(wlc, int_val);
160 static int brcms_c_stf_txcore_set(
struct brcms_c_info *wlc,
u8 Nsts,
164 wlc->
pub->unit, Nsts, core_mask);
169 if ((
hweight8(core_mask) == wlc->
stf->txstreams) &&
170 ((core_mask & ~wlc->
stf->txchain)
171 || !(core_mask & wlc->
stf->txchain)))
172 core_mask = wlc->
stf->txchain;
174 wlc->
stf->txcore[Nsts] = core_mask;
192 static int brcms_c_stf_spatial_policy_set(
struct brcms_c_info *wlc,
int val)
199 wlc->
stf->spatial_policy = (
s8) val;
202 wlc->
stf->txchain : txcore_default[i];
203 brcms_c_stf_txcore_set(wlc, (
u8)
i, core_mask);
224 static void _brcms_c_stf_phy_txant_upd(
struct brcms_c_info *wlc)
228 txant = (
s8) wlc->
stf->txant;
264 u8 txchain = (
u8) int_val;
268 if (wlc->
stf->txchain == txchain)
271 if ((txchain & ~wlc->
stf->hw_txchain)
272 || !(txchain & wlc->
stf->hw_txchain))
283 wlc->
stf->txchain = txchain;
284 wlc->
stf->txstreams = txstreams;
285 brcms_c_stf_stbc_tx_set(wlc, wlc->
band->band_stf_stbc_tx);
290 _brcms_c_stf_phy_txant_upd(wlc);
296 brcms_c_stf_txcore_set(wlc, (
u8) i, txcore_default[i]);
311 prev_stf_ss = wlc->
stf->ss_opmode;
318 wlc->
stf->ss_algosel_auto
319 && (wlc->
stf->ss_algo_channel != (
u16) -1)) {
320 upd_stf_ss = (wlc->
stf->txstreams == 1 ||
325 if (wlc->
band != band)
327 upd_stf_ss = (wlc->
stf->txstreams == 1) ?
330 if (prev_stf_ss != upd_stf_ss) {
331 wlc->
stf->ss_opmode = upd_stf_ss;
355 wlc->
stf->ss_algosel_auto =
true;
357 wlc->
stf->ss_algo_channel = (
u16) -1;
368 _brcms_c_stf_phy_txant_upd(wlc);
373 struct ssb_sprom *sprom = &wlc->
hw->d11core->bus->sprom;
380 if (wlc->
stf->hw_txchain == 0 || wlc->
stf->hw_txchain == 0xf) {
387 wlc->
stf->txchain = wlc->
stf->hw_txchain;
390 if (wlc->
stf->hw_rxchain == 0 || wlc->
stf->hw_rxchain == 0xf) {
397 wlc->
stf->rxchain = wlc->
stf->hw_rxchain;
401 memcpy(wlc->
stf->txcore, txcore_default,
sizeof(wlc->
stf->txcore));
411 u16 phytxant = wlc->
stf->phytxant;
423 return _brcms_c_stf_phytxchain_sel(wlc, rspec);
428 u16 phytxant = wlc->
stf->phytxant;
433 phytxant = _brcms_c_stf_phytxchain_sel(wlc, rspec);
436 phytxant |= phytxant &
mask;