summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2016-04-05 22:01:56 +0000
committeradrian <adrian@FreeBSD.org>2016-04-05 22:01:56 +0000
commita7d48b904239807d4bba04f3a0bdafed23b4b8ca (patch)
treed1bf7b50b6cd8ebd567255c2b17ca19020b5bc9d /sys/net80211
parent0bbf0b11a9d552031dc1c28c796efc5fabc6aefe (diff)
downloadFreeBSD-src-a7d48b904239807d4bba04f3a0bdafed23b4b8ca.zip
FreeBSD-src-a7d48b904239807d4bba04f3a0bdafed23b4b8ca.tar.gz
[net80211] rename 11n rate macros into a useful spot
* begin moving the 11n macros out of ieee80211_phy.c and into a header so they can be used elsewhere. * rename some of them into the IEEE80211_* namespace. * convert HT_RC_2_MCS() to work with three-stream rates.
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_phy.c2
-rw-r--r--sys/net80211/ieee80211_phy.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_phy.c b/sys/net80211/ieee80211_phy.c
index 4242ac0..16bbb2a 100644
--- a/sys/net80211/ieee80211_phy.c
+++ b/sys/net80211/ieee80211_phy.c
@@ -590,7 +590,7 @@ static const uint16_t ht40_bps[32] = {
#define HT_STF 4
#define HT_LTF(n) ((n) * 4)
-#define HT_RC_2_MCS(_rc) ((_rc) & 0xf)
+#define HT_RC_2_MCS(_rc) ((_rc) & 0x1f)
#define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1)
#define IS_HT_RATE(_rc) ( (_rc) & IEEE80211_RATE_MCS)
diff --git a/sys/net80211/ieee80211_phy.h b/sys/net80211/ieee80211_phy.h
index cb6b358..7970388 100644
--- a/sys/net80211/ieee80211_phy.h
+++ b/sys/net80211/ieee80211_phy.h
@@ -194,6 +194,14 @@ uint8_t ieee80211_plcp2rate(uint8_t, enum ieee80211_phytype);
*/
uint8_t ieee80211_rate2plcp(int, enum ieee80211_phytype);
+/*
+ * 802.11n rate manipulation.
+ */
+
+#define IEEE80211_HT_RC_2_MCS(_rc) ((_rc) & 0x1f)
+#define IEEE80211_HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1)
+#define IEEE80211_IS_HT_RATE(_rc) ( (_rc) & IEEE80211_RATE_MCS)
+
uint32_t ieee80211_compute_duration_ht(uint32_t frameLen,
uint16_t rate, int streams, int isht40,
int isShortGI);
OpenPOWER on IntegriCloud