rpcd: iwinfo: add IEEE 802.11be support master
authorChad Monroe <chad@monroe.io>
Thu, 20 Jun 2024 23:52:21 +0000 (16:52 -0700)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 17 Sep 2024 17:06:44 +0000 (18:06 +0100)
Add basic IEEE 802.11be support for rpcd iwinfo commands.

Signed-off-by: Chad Monroe <chad@monroe.io>
iwinfo.c

index f8dec8005889f4f3ac9394c0f9802b78de6b4bb0..ff0f38b7face5fb66cea0cad73542de2a5ab2315 100644 (file)
--- a/iwinfo.c
+++ b/iwinfo.c
@@ -284,8 +284,20 @@ static void rpc_iwinfo_call_hw_ht_mode(int hwmodelist)
                        hwmode_str = "ac";
                else if (iwinfo_htmode_is_he(htmode))
                        hwmode_str = "ax";
-               else
-                       hwmode_str = "a/g";
+               else if (iwinfo_htmode_is_eht(htmode))
+                       hwmode_str = "be";
+               else {
+                       if (hwmodelist & IWINFO_80211_N)
+                               hwmode_str = "n";
+                       else if (hwmodelist & IWINFO_80211_G)
+                               hwmode_str = "g";
+                       else if (hwmodelist & IWINFO_80211_B)
+                               hwmode_str = "b";
+                       else if (hwmodelist & IWINFO_80211_A)
+                               hwmode_str = "a";
+                       else
+                               hwmode_str = "unknown";
+               }
        } else
                htmode_str = hwmode_str = "unknown";
 
@@ -446,7 +458,8 @@ rpc_iwinfo_add_rateinfo(struct iwinfo_rate_entry *r)
        blobmsg_add_u8(&buf, "ht", r->is_ht);
        blobmsg_add_u8(&buf, "vht", r->is_vht);
        blobmsg_add_u8(&buf, "he", r->is_he);
-       blobmsg_add_u32(&buf, "mhz", r->mhz);
+       blobmsg_add_u8(&buf, "eht", r->is_eht);
+       blobmsg_add_u32(&buf, "mhz", r->mhz_hi * 256 + r->mhz);
        blobmsg_add_u32(&buf, "rate", r->rate);
 
        if (r->is_ht) {
@@ -465,6 +478,11 @@ rpc_iwinfo_add_rateinfo(struct iwinfo_rate_entry *r)
                blobmsg_add_u32(&buf, "he_gi", r->he_gi);
                blobmsg_add_u32(&buf, "he_dcm", r->he_dcm);
        }
+       else if (r->is_eht) {
+               blobmsg_add_u32(&buf, "mcs", r->mcs);
+               blobmsg_add_u32(&buf, "nss", r->nss);
+               blobmsg_add_u32(&buf, "eht_gi", r->eht_gi);
+       }
 }
 
 static int