From b6481f096228da9805ff159d17ddac4dbce0e1ab Mon Sep 17 00:00:00 2001
From: Marek Puzyniak <marek.puzyniak@iopsys.eu>
Date: Fri, 13 Jan 2023 12:03:12 +0000
Subject: [PATCH] handle all possible values of radio extch

According to this table:
BW	extch
=============
20MHz	none
40MHz+	above
40MHz-	below
other	auto

Signed-off-by: Marek Puzyniak <marek.puzyniak@iopsys.eu>
---
 wifimngr.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/wifimngr.c b/wifimngr.c
index 8d01d2e..2c63d1e 100644
--- a/wifimngr.c
+++ b/wifimngr.c
@@ -869,9 +869,10 @@ int wl_radio_status(struct ubus_context *ctx, struct ubus_object *obj,
 	blobmsg_add_u32(&bb, "opclass", opclass.g_opclass);
 	blobmsg_add_u32(&bb, "channel", channel);
 	blobmsg_add_u32(&bb, "bandwidth", bw_int[bw]);
-	blobmsg_add_string(&bb, "channel_ext", radio.extch == EXTCH_NONE ? "none" :
-					radio.extch == EXTCH_ABOVE ? "above" :
-					"below");
+	blobmsg_add_string(&bb, "channel_ext",
+			radio.extch == EXTCH_NONE ? "none" :
+			radio.extch == EXTCH_ABOVE ? "above" :
+			radio.extch == EXTCH_BELOW ? "below" : "auto");
 	blobmsg_add_u32(&bb, "tx_streams", radio.tx_streams);
 	blobmsg_add_u32(&bb, "rx_streams", radio.rx_streams);
 	blobmsg_add_u32(&bb, "noise", noise);
-- 
GitLab