iwinfo: return hwmode 'ad' on 802.11ad-only hardware
authorDaniel Golle <daniel@makrotopia.org>
Tue, 5 Jan 2021 22:32:45 +0000 (22:32 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 5 Jan 2021 22:32:45 +0000 (22:32 +0000)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
iwinfo.c

index 4133dc46ed14de733f4b66db0b5bc0a22f55a260..7c9a656a12a31f1ded769963b408b686a485a22f 100644 (file)
--- a/iwinfo.c
+++ b/iwinfo.c
@@ -301,6 +301,12 @@ static void rpc_iwinfo_call_hw_ht_mode()
        const char *hwmode_str;
        const char *htmode_str;
        int32_t htmode = 0;
+       int modes;
+
+       if (!iw->hwmodelist(ifname, &modes) && (modes == IWINFO_80211_AD)) {
+               blobmsg_add_string(&buf, "hwmode", "ad");
+               return;
+       }
 
        if (iw->htmode(ifname, &htmode))
                return;