Lines Matching +full:data +full:- +full:rate +full:- +full:bps

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * IEEE 802.11 PHY-related support.
68 /* XXX the 11n and the basic rate flag are unfortunately overlapping. Grr. */
78 /* Preamble dot11Rate Rate */
91 /* Preamble dot11Rate Rate */
111 /* Preamble dot11Rate Rate */
127 /* Preamble dot11Rate Rate */
143 /* Preamble dot11Rate Rate */
159 /* Preamble dot11Rate Rate */
174 /* Preamble dot11Rate Rate */
190 /* Preamble dot11Rate Rate */
238 /* Preamble dot11Rate Rate */
290 * Setup a rate table's reverse lookup table and fill in
306 for (i = 0; i < nitems(rt->rateCodeToIndex); i++) in ieee80211_setup_ratetable()
307 rt->rateCodeToIndex[i] = (uint8_t) -1; in ieee80211_setup_ratetable()
308 for (i = 0; i < rt->rateCount; i++) { in ieee80211_setup_ratetable()
309 uint8_t code = rt->info[i].dot11Rate; in ieee80211_setup_ratetable()
310 uint8_t cix = rt->info[i].ctlRateIndex; in ieee80211_setup_ratetable()
311 uint8_t ctl_rate = rt->info[cix].dot11Rate; in ieee80211_setup_ratetable()
314 * Map without the basic rate bit. in ieee80211_setup_ratetable()
317 * rate bit is stripped here. in ieee80211_setup_ratetable()
319 * For HT, use the MCS rate bit. in ieee80211_setup_ratetable()
322 if (rt->info[i].phy == IEEE80211_T_HT) { in ieee80211_setup_ratetable()
326 /* XXX assume the control rate is non-MCS? */ in ieee80211_setup_ratetable()
328 rt->rateCodeToIndex[code] = i; in ieee80211_setup_ratetable()
331 * XXX for 11g the control rate to use for 5.5 and 11 Mb/s in ieee80211_setup_ratetable()
333 * the static tables are setup with an 11b-compatible in ieee80211_setup_ratetable()
334 * 2Mb/s rate which will work but is suboptimal in ieee80211_setup_ratetable()
336 * NB: Control rate is always less than or equal to the in ieee80211_setup_ratetable()
337 * current rate, so control rate's reverse lookup entry in ieee80211_setup_ratetable()
340 rt->info[i].lpAckDuration = ieee80211_compute_duration(rt, in ieee80211_setup_ratetable()
342 rt->info[i].spAckDuration = ieee80211_compute_duration(rt, in ieee80211_setup_ratetable()
349 /* Setup all rate tables */
400 panic("%s: no rate table for channel; freq %u flags 0x%x\n", in ieee80211_get_ratetable()
401 __func__, c->ic_freq, c->ic_flags); in ieee80211_get_ratetable()
407 * Convert PLCP signal/rate field to 802.11 rate (.5Mbits/s)
410 * used to derive an 802.11 rate for constructing radiotap
411 * header data for rx frames.
445 * Covert 802.11 rate to PLCP signal.
448 ieee80211_rate2plcp(int rate, enum ieee80211_phytype type) in ieee80211_rate2plcp() argument
451 switch (rate) { in ieee80211_rate2plcp()
452 /* OFDM rates (cf IEEE Std 802.11a-1999, pp. 14 Table 80) */ in ieee80211_rate2plcp()
461 /* CCK rates (IEEE Std 802.11b-1999 page 15, subclause 18.2.3.3) */ in ieee80211_rate2plcp()
466 /* IEEE Std 802.11g-2003 page 19, subclause 19.3.2.1 */ in ieee80211_rate2plcp()
469 return 0; /* XXX unsupported/unknown rate */ in ieee80211_rate2plcp()
498 * using the specified rate, phy, and short preamble setting.
503 uint32_t frameLen, uint16_t rate, int isShortPreamble) in ieee80211_compute_duration() argument
505 uint8_t rix = rt->rateCodeToIndex[rate]; in ieee80211_compute_duration()
509 KASSERT(rix != (uint8_t)-1, ("rate %d has no info", rate)); in ieee80211_compute_duration()
510 kbps = rt->info[rix].rateKbps; in ieee80211_compute_duration()
514 switch (rt->info[rix].phy) { in ieee80211_compute_duration()
517 if (isShortPreamble && rt->info[rix].shortPreamble) in ieee80211_compute_duration()
525 KASSERT(bitsPerSymbol != 0, ("full rate bps")); in ieee80211_compute_duration()
535 KASSERT(bitsPerSymbol != 0, ("1/4 rate bps")); in ieee80211_compute_duration()
545 KASSERT(bitsPerSymbol != 0, ("1/2 rate bps")); in ieee80211_compute_duration()
554 /* we still save OFDM rates in kbps - so double them */ in ieee80211_compute_duration()
556 KASSERT(bitsPerSymbol != 0, ("turbo bps")); in ieee80211_compute_duration()
564 panic("%s: unknown phy %u (rate %u)\n", __func__, in ieee80211_compute_duration()
565 rt->info[rix].phy, rate); in ieee80211_compute_duration()
595 ieee80211_compute_duration_ht(uint32_t frameLen, uint16_t rate, in ieee80211_compute_duration_ht() argument
600 KASSERT(rate & IEEE80211_RATE_MCS, ("not mcs %d", rate)); in ieee80211_compute_duration_ht()
601 KASSERT((rate &~ IEEE80211_RATE_MCS) < 31, ("bad mcs 0x%x", rate)); in ieee80211_compute_duration_ht()
604 bitsPerSymbol = ht40_bps[rate & 0x1f]; in ieee80211_compute_duration_ht()
606 bitsPerSymbol = ht20_bps[rate & 0x1f]; in ieee80211_compute_duration_ht()
630 * This is based on 802.11-2020 21.5 (Parameters for VHT-MCSs.)
632 * Not all MCS rate / channel widths are valid, as there needs
659 * See 802.11-2020 21.5 (Parameters for VHT-MCSs) for more details.
673 return (ieee80211_vht_mcs_allowed_list_20[nss - 1]); in ieee80211_phy_vht_get_mcs_mask()
675 return (ieee80211_vht_mcs_allowed_list_40[nss - 1]); in ieee80211_phy_vht_get_mcs_mask()
677 return (ieee80211_vht_mcs_allowed_list_80[nss - 1]); in ieee80211_phy_vht_get_mcs_mask()
679 return (ieee80211_vht_mcs_allowed_list_160[nss - 1]); in ieee80211_phy_vht_get_mcs_mask()
690 * See 802.11-2020 21.5 (Parameters for VHT-MCSs) for more details.
694 * @param mcs MCS rate, 0..9
713 int cod_n; /* Coding rate numerator */
714 int cod_d; /* Coding rate denominator */
718 * These parameters are taken from 802.11-2020 Table 21-29
719 * (VHT-MCSs for Mandatory 20 MHZ, Nss=1).
738 * @brief Calculate the bitrate of the given VHT MCS rate.
743 * @param is_shortgi True if short guard-interval (400nS)
761 * Short-GI - 3.6uS symbol time, long-GI - 4.0uS symbol time in ieee80211_phy_vht_get_mcs_kbit()
763 * See 802.11-2020 Table 21-5 (Timing-related constraints.) in ieee80211_phy_vht_get_mcs_kbit()
773 * See 802.11-2020 Table 21-5 (Timing-related constraints.) in ieee80211_phy_vht_get_mcs_kbit()