This adds 802.11ax HE specific rate information to iwinfo.
Add fields for HE status of a STA as well as DCM and guard interval
fields specific to HE operation.
Signed-off-by: David Bauer <mail@david-bauer.net>
* @NL80211_RATE_INFO_5_MHZ_WIDTH: 5 MHz width - note that this is
* a legacy rate and will be reported as the actual bitrate, i.e.
* a quarter of the base (20 MHz) rate
+ * @NL80211_RATE_INFO_HE_MCS: HE MCS index (u8, 0-11)
+ * @NL80211_RATE_INFO_HE_NSS: HE NSS value (u8, 1-8)
+ * @NL80211_RATE_INFO_HE_GI: HE guard interval identifier
+ * (u8, see &enum nl80211_he_gi)
+ * @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1)
+ * @NL80211_RATE_INFO_RU_ALLOC: HE RU allocation, if not present then
+ * non-OFDMA was used (u8, see &enum nl80211_he_ru_alloc)
* @__NL80211_RATE_INFO_AFTER_LAST: internal use
*/
enum nl80211_rate_info {
NL80211_RATE_INFO_160_MHZ_WIDTH,
NL80211_RATE_INFO_10_MHZ_WIDTH,
NL80211_RATE_INFO_5_MHZ_WIDTH,
+ NL80211_RATE_INFO_HE_MCS,
+ NL80211_RATE_INFO_HE_NSS,
+ NL80211_RATE_INFO_HE_GI,
+ NL80211_RATE_INFO_HE_DCM,
+ NL80211_RATE_INFO_HE_RU_ALLOC,
/* keep last */
__NL80211_RATE_INFO_AFTER_LAST,
uint8_t is_short_gi:1;
uint8_t is_ht:1;
uint8_t is_vht:1;
+ uint8_t is_he:1;
+ uint8_t he_gi;
+ uint8_t he_dcm;
uint8_t mhz;
uint8_t nss;
};
l = sizeof(buf) - (p - buf);
}
}
+ else if (r->is_he)
+ {
+ p += snprintf(p, l, ", HE-MCS %d, %dMHz", r->mcs, r->mhz);
+ l = sizeof(buf) - (p - buf);
+
+ p += snprintf(p, l, ", HE-NSS %d", r->nss);
+ l = sizeof(buf) - (p - buf);
+
+ p += snprintf(p, l, ", HE-GI %d", r->he_gi);
+ l = sizeof(buf) - (p - buf);
+
+ p += snprintf(p, l, ", HE-DCM %d", r->he_dcm);
+ l = sizeof(buf) - (p - buf);
+ }
}
return buf;
lua_pushboolean(L, r->is_vht);
lua_setfield(L, -2, rx ? "rx_vht" : "tx_vht");
+ lua_pushboolean(L, r->is_he);
+ lua_setfield(L, -2, rx ? "rx_he" : "tx_he");
+
lua_pushnumber(L, r->mhz);
lua_setfield(L, -2, rx ? "rx_mhz" : "tx_mhz");
lua_pushboolean(L, r->is_short_gi);
lua_setfield(L, -2, rx ? "rx_short_gi" : "tx_short_gi");
}
- else if (r->is_vht)
+ else if (r->is_vht || r->is_he)
{
lua_pushnumber(L, r->mcs);
lua_setfield(L, -2, rx ? "rx_mcs" : "tx_mcs");
lua_pushnumber(L, r->nss);
lua_setfield(L, -2, rx ? "rx_nss" : "tx_nss");
- lua_pushboolean(L, r->is_short_gi);
- lua_setfield(L, -2, rx ? "rx_short_gi" : "tx_short_gi");
+ if (r->is_he) {
+ lua_pushnumber(L, r->he_gi);
+ lua_setfield(L, -2, rx ? "rx_he_gi" : "tx_he_gi");
+
+ lua_pushnumber(L, r->he_dcm);
+ lua_setfield(L, -2, rx ? "rx_he_dcm" : "tx_he_dcm");
+ }
+
+ if (r->is_vht) {
+ lua_pushboolean(L, r->is_short_gi);
+ lua_setfield(L, -2, rx ? "rx_short_gi" : "tx_short_gi");
+ }
}
}
else if (ri[NL80211_RATE_INFO_BITRATE])
re->rate = nla_get_u16(ri[NL80211_RATE_INFO_BITRATE]) * 100;
- if (ri[NL80211_RATE_INFO_VHT_MCS])
+ if (ri[NL80211_RATE_INFO_HE_MCS])
+ {
+ re->is_he = 1;
+ re->mcs = nla_get_u8(ri[NL80211_RATE_INFO_HE_MCS]);
+
+ if (ri[NL80211_RATE_INFO_HE_NSS])
+ re->nss = nla_get_u8(ri[NL80211_RATE_INFO_HE_NSS]);
+ if (ri[NL80211_RATE_INFO_HE_GI])
+ re->he_gi = nla_get_u8(ri[NL80211_RATE_INFO_HE_GI]);
+ if (ri[NL80211_RATE_INFO_HE_DCM])
+ re->he_dcm = nla_get_u8(ri[NL80211_RATE_INFO_HE_DCM]);
+ }
+ else if (ri[NL80211_RATE_INFO_VHT_MCS])
{
re->is_vht = 1;
re->mcs = nla_get_u8(ri[NL80211_RATE_INFO_VHT_MCS]);