Lines Matching refs:rspec

352 static u8 brcms_basic_rate(struct brcms_c_info *wlc, u32 rspec)  in brcms_basic_rate()  argument
354 if (is_mcs_rate(rspec)) in brcms_basic_rate()
355 return wlc->band->basic_rate[mcs_table[rspec & RSPEC_RATE_MASK] in brcms_basic_rate()
357 return wlc->band->basic_rate[rspec & RSPEC_RATE_MASK]; in brcms_basic_rate()
360 static u16 frametype(u32 rspec, u8 mimoframe) in frametype() argument
362 if (is_mcs_rate(rspec)) in frametype()
364 return is_cck_rate(rspec) ? FT_CCK : FT_OFDM; in frametype()
5673 brcms_c_calc_ack_time(struct brcms_c_info *wlc, u32 rspec, in brcms_c_calc_ack_time() argument
5683 rspec = brcms_basic_rate(wlc, rspec); in brcms_c_calc_ack_time()
5686 brcms_c_calc_frame_time(wlc, rspec, preamble_type, in brcms_c_calc_ack_time()
5692 brcms_c_calc_cts_time(struct brcms_c_info *wlc, u32 rspec, in brcms_c_calc_cts_time() argument
5695 return brcms_c_calc_ack_time(wlc, rspec, preamble_type); in brcms_c_calc_cts_time()
5699 brcms_c_calc_ba_time(struct brcms_c_info *wlc, u32 rspec, in brcms_c_calc_ba_time() argument
5707 rspec = brcms_basic_rate(wlc, rspec); in brcms_c_calc_ba_time()
5709 return brcms_c_calc_frame_time(wlc, rspec, preamble_type, in brcms_c_calc_ba_time()
5794 static bool brcms_c_valid_rate(struct brcms_c_info *wlc, u32 rspec, int band, in brcms_c_valid_rate() argument
5809 if (is_mcs_rate(rspec)) { in brcms_c_valid_rate()
5810 if ((rspec & RSPEC_RATE_MASK) >= MCS_TABLE_SIZE) in brcms_c_valid_rate()
5813 return isset(hw_rateset->mcs, (rspec & RSPEC_RATE_MASK)); in brcms_c_valid_rate()
5817 if (hw_rateset->rates[i] == rspec2rate(rspec)) in brcms_c_valid_rate()
5822 "not in hw_rateset\n", wlc->pub->unit, rspec); in brcms_c_valid_rate()
5834 u32 rspec; in mac80211_wlc_set_nrate() local
5908 rspec = rate; in mac80211_wlc_set_nrate()
5910 rspec |= RSPEC_MIMORATE; in mac80211_wlc_set_nrate()
5915 rspec |= (stc << RSPEC_STC_SHIFT); in mac80211_wlc_set_nrate()
5919 rspec |= (stf << RSPEC_STF_SHIFT); in mac80211_wlc_set_nrate()
5922 rspec |= RSPEC_OVERRIDE_MCS_ONLY; in mac80211_wlc_set_nrate()
5925 rspec |= RSPEC_SHORT_GI; in mac80211_wlc_set_nrate()
5928 && !brcms_c_valid_rate(wlc, rspec, cur_band->bandtype, true)) in mac80211_wlc_set_nrate()
5931 return rspec; in mac80211_wlc_set_nrate()
5991 static void brcms_c_compute_mimo_plcp(u32 rspec, uint length, u8 *plcp) in brcms_c_compute_mimo_plcp() argument
5993 u8 mcs = (u8) (rspec & RSPEC_RATE_MASK); in brcms_c_compute_mimo_plcp()
5995 if (rspec_is40mhz(rspec) || (mcs == 32)) in brcms_c_compute_mimo_plcp()
5998 plcp[3] = rspec_mimoplcp3(rspec); /* rspec already holds this byte */ in brcms_c_compute_mimo_plcp()
6006 brcms_c_compute_ofdm_plcp(u32 rspec, u32 length, u8 *plcp) in brcms_c_compute_ofdm_plcp() argument
6010 int rate = rspec2rate(rspec); in brcms_c_compute_ofdm_plcp()
6027 static void brcms_c_compute_cck_plcp(struct brcms_c_info *wlc, u32 rspec, in brcms_c_compute_cck_plcp() argument
6030 int rate = rspec2rate(rspec); in brcms_c_compute_cck_plcp()
6036 brcms_c_compute_plcp(struct brcms_c_info *wlc, u32 rspec, in brcms_c_compute_plcp() argument
6039 if (is_mcs_rate(rspec)) in brcms_c_compute_plcp()
6040 brcms_c_compute_mimo_plcp(rspec, length, plcp); in brcms_c_compute_plcp()
6041 else if (is_ofdm_rate(rspec)) in brcms_c_compute_plcp()
6042 brcms_c_compute_ofdm_plcp(rspec, length, plcp); in brcms_c_compute_plcp()
6044 brcms_c_compute_cck_plcp(wlc, rspec, length, plcp); in brcms_c_compute_plcp()
6093 static u16 brcms_c_phytxctl1_calc(struct brcms_c_info *wlc, u32 rspec) in brcms_c_phytxctl1_calc() argument
6101 bw = rspec_get_bw(rspec); in brcms_c_phytxctl1_calc()
6110 if (is_mcs_rate(rspec)) { in brcms_c_phytxctl1_calc()
6111 uint mcs = rspec & RSPEC_RATE_MASK; in brcms_c_phytxctl1_calc()
6114 phyctl1 = rspec_phytxbyte2(rspec); in brcms_c_phytxctl1_calc()
6117 } else if (is_cck_rate(rspec) && !BRCMS_ISLCNPHY(wlc->band) in brcms_c_phytxctl1_calc()
6125 phyctl1 = (bw | (rspec_stf(rspec) << PHY_TXC1_MODE_SHIFT)); in brcms_c_phytxctl1_calc()
6129 phycfg = brcms_c_rate_legacy_phyctl(rspec2rate(rspec)); in brcms_c_phytxctl1_calc()
6138 (rspec_stf(rspec) << PHY_TXC1_MODE_SHIFT)); in brcms_c_phytxctl1_calc()
6163 u32 rspec[2] = { BRCM_RATE_1M, BRCM_RATE_1M }; in brcms_c_d11hdrs_mac80211() local
6250 rspec[k] = in brcms_c_d11hdrs_mac80211()
6254 rspec[k] = BRCM_RATE_1M; in brcms_c_d11hdrs_mac80211()
6257 rspec[k] = mac80211_wlc_set_nrate(wlc, wlc->band, in brcms_c_d11hdrs_mac80211()
6279 if (!rspec_active(rspec[k])) { in brcms_c_d11hdrs_mac80211()
6280 rspec[k] = BRCM_RATE_1M; in brcms_c_d11hdrs_mac80211()
6298 if (((is_mcs_rate(rspec[k]) && in brcms_c_d11hdrs_mac80211()
6299 is_single_stream(rspec[k] & RSPEC_RATE_MASK)) || in brcms_c_d11hdrs_mac80211()
6300 is_ofdm_rate(rspec[k])) in brcms_c_d11hdrs_mac80211()
6301 && ((rspec[k] & RSPEC_OVERRIDE_MCS_ONLY) in brcms_c_d11hdrs_mac80211()
6302 || !(rspec[k] & RSPEC_OVERRIDE))) { in brcms_c_d11hdrs_mac80211()
6303 rspec[k] &= ~(RSPEC_STF_MASK | RSPEC_STC_MASK); in brcms_c_d11hdrs_mac80211()
6306 if (is_mcs_rate(rspec[k]) in brcms_c_d11hdrs_mac80211()
6312 rspec[k] |= (PHY_TXC1_MODE_STBC << in brcms_c_d11hdrs_mac80211()
6316 rspec[k] |= in brcms_c_d11hdrs_mac80211()
6331 if (is_mcs_rate(rspec[k])) { in brcms_c_d11hdrs_mac80211()
6333 if ((rspec[k] & RSPEC_RATE_MASK) in brcms_c_d11hdrs_mac80211()
6343 } else if (is_ofdm_rate(rspec[k])) { in brcms_c_d11hdrs_mac80211()
6355 if ((rspec[k] & RSPEC_RATE_MASK) == 32) in brcms_c_d11hdrs_mac80211()
6357 rspec[k] = RSPEC_MIMORATE; in brcms_c_d11hdrs_mac80211()
6363 rspec[k] &= ~RSPEC_BW_MASK; in brcms_c_d11hdrs_mac80211()
6364 if ((k == 0) || ((k > 0) && is_mcs_rate(rspec[k]))) in brcms_c_d11hdrs_mac80211()
6365 rspec[k] |= (mimo_txbw << RSPEC_BW_SHIFT); in brcms_c_d11hdrs_mac80211()
6367 rspec[k] |= (mimo_ctlchbw << RSPEC_BW_SHIFT); in brcms_c_d11hdrs_mac80211()
6370 rspec[k] &= ~RSPEC_SHORT_GI; in brcms_c_d11hdrs_mac80211()
6377 && (!is_mcs_rate(rspec[k]))) { in brcms_c_d11hdrs_mac80211()
6383 if (is_mcs_rate(rspec[k])) { in brcms_c_d11hdrs_mac80211()
6390 if ((rspec[k] & RSPEC_SHORT_GI) in brcms_c_d11hdrs_mac80211()
6391 && is_single_stream(rspec[k] & in brcms_c_d11hdrs_mac80211()
6397 if (!is_mcs_rate(rspec[0]) in brcms_c_d11hdrs_mac80211()
6405 rspec[k] &= ~RSPEC_BW_MASK; in brcms_c_d11hdrs_mac80211()
6406 rspec[k] |= (PHY_TXC1_BW_20MHZ << RSPEC_BW_SHIFT); in brcms_c_d11hdrs_mac80211()
6409 if (BRCMS_ISNPHY(wlc->band) && is_ofdm_rate(rspec[k])) { in brcms_c_d11hdrs_mac80211()
6410 rspec[k] &= ~RSPEC_STF_MASK; in brcms_c_d11hdrs_mac80211()
6411 rspec[k] |= phyctl1_stf << RSPEC_STF_SHIFT; in brcms_c_d11hdrs_mac80211()
6428 brcms_c_compute_plcp(wlc, rspec[0], phylen, plcp); in brcms_c_d11hdrs_mac80211()
6429 brcms_c_compute_plcp(wlc, rspec[1], phylen, plcp_fallback); in brcms_c_d11hdrs_mac80211()
6434 if (is_cck_rate(rspec[1])) { in brcms_c_d11hdrs_mac80211()
6440 mainrates = is_ofdm_rate(rspec[0]) ? in brcms_c_d11hdrs_mac80211()
6448 brcms_c_compute_frame_dur(wlc, rspec[0], preamble_type[0], in brcms_c_d11hdrs_mac80211()
6454 (u16) brcms_c_calc_frame_time(wlc, rspec[0], in brcms_c_d11hdrs_mac80211()
6467 durid = brcms_c_compute_frame_dur(wlc, rspec[1], in brcms_c_d11hdrs_mac80211()
6497 if (rspec2rate(rspec[1]) != BRCM_RATE_1M) in brcms_c_d11hdrs_mac80211()
6536 rts_rspec[k] = brcms_c_rspec_to_rts_rspec(wlc, rspec[k], in brcms_c_d11hdrs_mac80211()
6582 rspec[0], rts_preamble_type[0], in brcms_c_d11hdrs_mac80211()
6587 rts_rspec[1], rspec[1], in brcms_c_d11hdrs_mac80211()
6622 if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && is_mcs_rate(rspec)) in brcms_c_d11hdrs_mac80211()
6624 brcm_c_ampdu_null_delim_cnt(wlc->ampdu, scb, rspec, phylen); in brcms_c_d11hdrs_mac80211()
6641 xfts = frametype(rspec[1], wlc->mimoft); in brcms_c_d11hdrs_mac80211()
6649 phyctl = frametype(rspec[0], wlc->mimoft); in brcms_c_d11hdrs_mac80211()
6652 if (rspec2rate(rspec[0]) != BRCM_RATE_1M) in brcms_c_d11hdrs_mac80211()
6657 phyctl |= brcms_c_stf_d11hdrs_phyctl_txant(wlc, rspec[0]); in brcms_c_d11hdrs_mac80211()
6664 phyctl1 = brcms_c_phytxctl1_calc(wlc, rspec[0]); in brcms_c_d11hdrs_mac80211()
6666 phyctl1 = brcms_c_phytxctl1_calc(wlc, rspec[1]); in brcms_c_d11hdrs_mac80211()
6681 if (is_mcs_rate(rspec[0]) && in brcms_c_d11hdrs_mac80211()
6684 brcms_c_calc_lsig_len(wlc, rspec[0], phylen); in brcms_c_d11hdrs_mac80211()
6688 if (is_mcs_rate(rspec[1]) && in brcms_c_d11hdrs_mac80211()
6691 brcms_c_calc_lsig_len(wlc, rspec[1], phylen); in brcms_c_d11hdrs_mac80211()
6703 brcms_c_calc_frame_time(wlc, rspec[0], in brcms_c_d11hdrs_mac80211()
6725 brcms_c_compute_frame_dur(wlc, rspec[0], in brcms_c_d11hdrs_mac80211()
6729 brcms_c_calc_frame_time(wlc, rspec[1], in brcms_c_d11hdrs_mac80211()
6733 brcms_c_compute_frame_dur(wlc, rspec[1], in brcms_c_d11hdrs_mac80211()
6754 rspec[0], preamble_type[0], in brcms_c_d11hdrs_mac80211()
6774 rspec2rate(rspec[0])); in brcms_c_d11hdrs_mac80211()
6885 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, u32 rspec, in brcms_c_rspec_to_rts_rspec() argument
6892 rts_rspec = rspec; in brcms_c_rspec_to_rts_rspec()
6893 else if (wlc->band->gmode && wlc->protection->_g && !is_cck_rate(rspec)) in brcms_c_rspec_to_rts_rspec()
6907 rts_rspec = brcms_basic_rate(wlc, rspec); in brcms_c_rspec_to_rts_rspec()
6917 if (rspec_is40mhz(rspec) && !is_cck_rate(rts_rspec)) in brcms_c_rspec_to_rts_rspec()
6997 u32 rspec; in prep_mac80211_status() local
7020 rspec = brcms_c_compute_rspec(rxh, plcp); in prep_mac80211_status()
7021 if (is_mcs_rate(rspec)) { in prep_mac80211_status()
7022 rx_status->rate_idx = rspec & RSPEC_RATE_MASK; in prep_mac80211_status()
7024 if (rspec_is40mhz(rspec)) in prep_mac80211_status()
7027 switch (rspec2rate(rspec)) { in prep_mac80211_status()
7078 if (is_cck_rate(rspec)) { in prep_mac80211_status()
7081 } else if (is_ofdm_rate(rspec)) { in prep_mac80211_status()