iwinfo: add basic IEEE 802.11be support#10
Conversation
Required for IEEE 802.11be support Taken from the v6.6.15 mac80211 package Signed-off-by: Koral Ilgun <koral.ilgun@smartrg.com> Signed-off-by: Chad Monroe <chad@monroe.io>
| uint8_t is_he:1; | ||
| uint8_t he_gi; | ||
| uint8_t he_dcm; | ||
| uint8_t mhz; |
There was a problem hiding this comment.
This change breaks the ABI which I'd ideally like to avoid. If I am not mistaken, there should be two bytes of padding at the end of the struct, so maybe place the high mhz bits after the mss field. Also put the is_eht bitfield member directly after is_he to ensure that it ends up in the same byte.
Updated structure layout could look like:
struct iwinfo_rate_entry {
uint32_t rate;
int8_t mcs;
uint8_t is_40mhz:1;
uint8_t is_short_gi:1;
uint8_t is_ht:1;
uint8_t is_vht:1;
uint8_t is_he:1;
uint8_t is_eht:1;
uint8_t he_gi;
uint8_t he_dcm;
uint8_t mhz_lo;
uint8_t nss;
uint8_t mhz_hi;
uint8_t eht_gi;
};
| } | ||
| else if (r->is_eht) | ||
| { | ||
| p += snprintf(p, l, ", EHT-MCS %d, %dMHz", r->mcs, r->mhz); |
There was a problem hiding this comment.
Assuming the updated structure, this will become:
p += snprintf(p, l, ", EHT-MCS %d, %dMHz", r->mcs, r->mhz_hi * 256 + r->mhz);
|
|
||
| if (len > sizeof(m->eht_phy_cap) - 1) | ||
| len = sizeof(m->eht_phy_cap) - 1; | ||
| memcpy(&((__u8 *)m->eht_phy_cap)[1], |
| } | ||
|
|
||
| // EHT | ||
| if (tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC]) { |
| nla_data(tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY]), | ||
| len); | ||
| } | ||
| if (tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET]) { |
| } | ||
| if (tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET]) { | ||
| } | ||
| if (tb[NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE]) { |
| ri[NL80211_RATE_INFO_160_MHZ_WIDTH]) | ||
| re->mhz = 160; | ||
| else if (ri[NL80211_RATE_INFO_320_MHZ_WIDTH]) | ||
| re->mhz = 320; |
There was a problem hiding this comment.
Assuming the updated structure layout, this should become
re->mhz_hi = 320 / 256, re->mhz = 320 % 256;
or
re->mhz_hi = 1, re->mhz = 64;
| lua_pushboolean(L, r->is_eht); | ||
| lua_setfield(L, -2, rx ? "rx_eht" : "tx_eht"); | ||
|
|
||
| lua_pushnumber(L, r->mhz); |
There was a problem hiding this comment.
Assuming the updated structure layout, this should become
lua_pushnumber(L, r->mhz_hi * 256 + r->mhz);
Add support for IEEE 802.11be via HW and HT modelist as well as EHT specific rate information for associated STAs. Signed-off-by: Koral Ilgun <koral.ilgun@smartrg.com> Signed-off-by: Chad Monroe <chad@monroe.io>
|
Hi @jow- Thanks for looking this over! I think I got all of your requested changes in the most recent push if you don't mind checking them. I tested that 20, 80, 160 and 320MHz bandwidths are still reported correctly via the CLI and ubus. In order for assoclist to display 320MHz correctly via ubus I've updated rpcd #5 as well. Two questions, mostly for my own understanding if you have the time to share:
|
|
Hi,
Yes. The ... ends up being a struct with one byte holding three bits, while in contrast a ... ends up being three bytes large (first a byte holding two bits, then a byte holding a boolean 1 or 0 value, then another byte holding one bit).
It depends, in this particular case the structure size and layout did not change, so existing code built against an older libiwinfo loading a newer one will continue to work. It might not be able to make sense of the new values (e.g. wrongly report "64 MHz" for a 320 wide channel) but it will not crash trying to access nonexistent/invalid memory when the structures returned by iwinfo are larger than what the program expects. The reason why we need to be somewhat careful with the ABI here is that some programs (e.g. LuCI) Here's my local testcase for the structure size: The reason why it was possible in this case is that the original struct had two unused alignment padding bytes at the end. |
|
Thanks for the super clear info, it is very helpful :) The ABI change part makes a lot of sense now.. I was thinking about the problem backwards before your explanation. Please let me know if any other changes are needed and thanks again for your help! |
|
Successfully tested on Banana Pi4 |
danpawlik
left a comment
There was a problem hiding this comment.
LGTM.
Tested-By: Daniel Pawlik pawlik.dan@gmail.com
|
any chance to merge that @jow- ? I see it has been already approved by Daniel. |
In the iwinfo fork, there are required patches [1][2] to make the BE wireless standard be available in Luci. [1] openwrt/iwinfo#11 [2] openwrt/iwinfo#10
In the iwinfo fork, there are required patches [1][2] to make the BE wireless standard be available in Luci. [1] openwrt/iwinfo#11 [2] openwrt/iwinfo#10
The rpcd repository contains a patch [1] that will bring BE wireless standard. Also update iwinfo project to apply patches [2][3]. [1] - openwrt/rpcd#5 [2] openwrt/iwinfo#11 [3] openwrt/iwinfo#10
This commit provides switch luci project to use branch that contains patch for BE standard [1]. The rpcd repository contains a patch [2] that will bring BE wireless standard. Also update iwinfo project to apply patches [3][4]. [1] - openwrt/luci#7279 [2] - openwrt/rpcd#5 [3] openwrt/iwinfo#11 [4] openwrt/iwinfo#10 (cherry picked from commit 97d6044)
This commit provides switch luci project to use branch that contains patch for BE standard [1]. The rpcd repository contains a patch [2] that will bring BE wireless standard. Also update iwinfo project to apply patches [3][4]. [1] - openwrt/luci#7279 [2] - openwrt/rpcd#5 [3] openwrt/iwinfo#11 [4] openwrt/iwinfo#10
This commit provides switch luci project to use branch that contains patch for BE standard [1]. The rpcd repository contains a patch [2] that will bring BE wireless standard. Also update iwinfo project to apply patches [3][4]. [1] - openwrt/luci#7279 [2] - openwrt/rpcd#5 [3] openwrt/iwinfo#11 [4] openwrt/iwinfo#10
This commit provides switch luci project to use branch that contains patch for BE standard [1]. The rpcd repository contains a patch [2] that will bring BE wireless standard. Also update iwinfo project to apply patches [3][4]. [1] - openwrt/luci#7279 [2] - openwrt/rpcd#5 [3] openwrt/iwinfo#11 [4] openwrt/iwinfo#10
This commit provides switch luci project to use branch that contains patch for BE standard [1]. The rpcd repository contains a patch [2] that will bring BE wireless standard. Also update iwinfo project to apply patches [3][4]. [1] - openwrt/luci#7279 [2] - openwrt/rpcd#5 [3] openwrt/iwinfo#11 [4] openwrt/iwinfo#10
This commit provides switch luci project to use branch that contains patch for BE standard [1]. The rpcd repository contains a patch [2] that will bring BE wireless standard. Also update iwinfo project to apply patches [3][4]. [1] - openwrt/luci#7279 [2] - openwrt/rpcd#5 [3] openwrt/iwinfo#11 [4] openwrt/iwinfo#10
This commit provides switch luci project to use branch that contains patch for BE standard [1]. The rpcd repository contains a patch [2] that will bring BE wireless standard. Also update iwinfo project to apply patches [3][4]. [1] - openwrt/luci#7279 [2] - openwrt/rpcd#5 [3] openwrt/iwinfo#11 [4] openwrt/iwinfo#10 (cherry picked from commit c616208)
This commit provides switch luci project to use branch that contains patch for BE standard [1]. The rpcd repository contains a patch [2] that will bring BE wireless standard. Also update iwinfo project to apply patches [3][4]. [1] - openwrt/luci#7279 [2] - openwrt/rpcd#5 [3] openwrt/iwinfo#11 [4] openwrt/iwinfo#10 (cherry picked from commit c616208)
This commit provides switch luci project to use branch that contains patch for BE standard [1]. The rpcd repository contains a patch [2] that will bring BE wireless standard. Also update iwinfo project to apply patches [3][4]. [1] - openwrt/luci#7279 [2] - openwrt/rpcd#5 [3] openwrt/iwinfo#11 [4] openwrt/iwinfo#10 (cherry picked from commit c616208)
This commit provides switch luci project to use branch that contains patch for BE standard [1]. The rpcd repository contains a patch [2] that will bring BE wireless standard. Also update iwinfo project to apply patches [3][4]. [1] - openwrt/luci#7279 [2] - openwrt/rpcd#5 [3] openwrt/iwinfo#11 [4] openwrt/iwinfo#10 (cherry picked from commit c616208)
Tested with banana rpi-4 In order to complete 11be support - the below pulls will need to be applied RPCD - openwrt/rpcd#5 iwinfo - openwrt/iwinfo#10 Signed-off-by: Rudy Andram <rmandrad@gmail.com> Tested-By: Daniel Pawlik <pawlik.dan@gmail.com>
Tested with banana rpi-4 In order to complete 11be support - the below pulls will need to be applied RPCD - openwrt/rpcd#5 iwinfo - openwrt/iwinfo#10 Signed-off-by: Rudy Andram <rmandrad@gmail.com> Tested-By: Daniel Pawlik <pawlik.dan@gmail.com>
Tested with banana rpi-4 In order to complete 11be support - the below pulls will need to be applied RPCD - openwrt/rpcd#5 iwinfo - openwrt/iwinfo#10 Signed-off-by: Rudy Andram <rmandrad@gmail.com> Tested-By: Daniel Pawlik <pawlik.dan@gmail.com> correct ; with , instead for the declaration of eht
Tested with banana rpi-4 In order to complete 11be support - the below pulls will need to be applied RPCD - openwrt/rpcd#5 iwinfo - openwrt/iwinfo#10 Signed-off-by: Rudy Andram <rmandrad@gmail.com> Tested-By: Daniel Pawlik <pawlik.dan@gmail.com> correct ; with , instead for the declaration of eht
Tested with banana rpi-4 In order to complete 11be support - the below pulls will need to be applied RPCD - openwrt/rpcd#5 iwinfo - openwrt/iwinfo#10 Signed-off-by: Rudy Andram <rmandrad@gmail.com> Tested-By: Daniel Pawlik <pawlik.dan@gmail.com> correct ; with , instead for the declaration of eht
|
@cmonroe Can you also take care of the 240(/160+80) MHz case? |
|
@cmonroe: Thanks :) |
|
Dear all, @cmonroe, @jow-, @rmandrad, @danpawlik, @systemcrash, @dangowrt, There is a new PR linked to 11be done by @prokowsoftware here: Can you look? Thanks in advance. |
Add basic support for 802.11be / WiFi 7 to iwinfo.