From patchwork Tue Nov 24 01:32:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1405195 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=nCBR25kj; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=TAEKhxz9; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cg66012yDz9sT6 for ; Tue, 24 Nov 2020 12:35:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=aySprKGEa9ASTzxqXoPEhhSjBADe6u/AEy7122O70og=; b=nCBR25kjDZ4y/UfSi8TbTksZu u41bDoxhY+sx0ArNRluDt2J5jr6koLlRQ8qyaZ6MgQx4HtOJSpn19n/kJ/87rAFl/FpJAE1wGgYNr WDS2Z/+Evg7t8N0Hka0Rv96HIinvtqGx3gKYbRZzdF+PkAnNFTaJLqxvEeaQs38v4Mx6H9rgxmpg4 NzOUS5uil3mM8DyrEkLRIS1kXKEBTxPxA/0Go8RtnvT6ikz1nDUs3aaCu61vPeOQeoftc8qScN6hz ZX790Cbr90GBpX+qky+gQWZYxpRuMhzodSegNtWOkQAwK8hEjUv4dSHtcp7TGQOP6hgrqlOJ+mkuF XNLcV66mg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khNCo-0000YG-Oh; Tue, 24 Nov 2020 01:33:19 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khNCb-0000U5-5z for openwrt-devel@lists.openwrt.org; Tue, 24 Nov 2020 01:33:06 +0000 Received: by mail-qt1-x843.google.com with SMTP id f27so5458270qtv.6 for ; Mon, 23 Nov 2020 17:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ywMZQPMdK5vNMaesNuWHGc8u2FwPc6189peW93v3eFk=; b=TAEKhxz9kOEWq0YHG6ZdS5MKt6hWmBYklNKqRT80Ycl3q9s3g4Su/yGU+Zyloy4lD2 Wkg89XRKocU0RgInWCjj9xLkudMO6rs9e3/92h77DlSE87lU3gLARxlUnCsD0+0j1J/6 /W+QMSPTbtHVWxNnmPRhewsHuNl8K6c/OPSGgskZaVSQsWd347VzM2L8+iAUiC5/NLQP lJjnlrE0EdwZeW0pNwXYRnOU4RBcdAEJdtbT+htOd4Sw72fP4zCJ+f4Z/RVqQ1ClM1Ja lGlZqkAbp8XT7NC0A6ZUApEXzS9qu/4BMf7OIjyKjd6QpdoFrTk4FUjFT7wq0zwqE0Yp V+Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ywMZQPMdK5vNMaesNuWHGc8u2FwPc6189peW93v3eFk=; b=U/o5BtjUxvQrK2pXUFbZA2pBhNTZnvMLf7Ts5qJWhBmUwAApMptrywibfpswgm3RqV MYPQKtHBCjSLIQaiHkNJ0OjVkw2v+TiwITZDLU2M3XSJ1SAxO1cIeaJCN4xvKoNaPkwY 3x4Gz3wZexEcUuVerqFkEt9Viw1SMKisB1nUPycLre0xYvqSgdA6woBQOdla1EfPC28P kYX2eheOuIEXs334+OPoXBRzFMuIu2MKa0ka3ols8iIVvrPHN7fbpENOmAKQvIy/gBhm 31N6YETUg3LXqx9IXh32iIhiPimfRNVoAwaS2ovv21hscudrvAJs2J3HfwlJSCaEqqnX xyDw== X-Gm-Message-State: AOAM530ovUXKf+jPAgARLtaiFBaTQ+45rZ3q2eM+jcliq7mVTac8kM+0 C9F+TBaOrQmLYfgdyVvOQs3wDMgjGL0= X-Google-Smtp-Source: ABdhPJxTXUS9CMxbLTeDG0gUR8EO5e1uKZB4RMqt0TK/kdJEBR+1F1j/uDgtDlpyrheU9X4kr3ex1w== X-Received: by 2002:ac8:6f46:: with SMTP id n6mr2130968qtv.151.1606181583135; Mon, 23 Nov 2020 17:33:03 -0800 (PST) Received: from ansuel-xps20.localdomain (93-39-149-95.ip76.fastwebnet.it. [93.39.149.95]) by smtp.googlemail.com with ESMTPSA id g18sm11025872qtv.79.2020.11.23.17.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 17:33:00 -0800 (PST) From: Ansuel Smith To: openwrt-devel@lists.openwrt.org Subject: [IWINFO PATCH v2 1/4] iwinfo: export ht and vht operation in scan results Date: Tue, 24 Nov 2020 02:32:49 +0100 Message-Id: <20201124013252.18323-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124013252.18323-1-ansuelsmth@gmail.com> References: <20201124013252.18323-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_203305_936914_AE0D195E X-CRM114-Status: GOOD ( 15.08 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:843 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ansuel Smith Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Export ht and vht operation data in scan results. These additional data can be usefull to check wifi channel utilizzation by neraby stations. Signed-off-by: Ansuel Smith --- include/iwinfo.h | 34 ++++++++++++++++++++++++++++++++++ iwinfo_cli.c | 21 ++++++++++++++++++++- iwinfo_nl80211.c | 10 ++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/include/iwinfo.h b/include/iwinfo.h index 5e64294..afb738f 100644 --- a/include/iwinfo.h +++ b/include/iwinfo.h @@ -170,6 +170,38 @@ struct iwinfo_crypto_entry { uint8_t auth_algs; }; +struct iwinfo_scanlist_ht_chan_entry { + uint8_t primary_chan; + uint8_t secondary_chan_off; + uint8_t chan_width; +}; + +struct iwinfo_scanlist_vht_chan_entry { + uint8_t chan_width; + uint8_t center_chan_1; + uint8_t center_chan_2; +}; + +static const char *ht_secondary_offset[4] = { + "no secondary", + "above", + "[reserved!]", + "below", +}; + + +static const char *ht_chan_width[2] = { + "20 MHz", + "any", +}; + +static const char *vht_chan_width[] = { + [0] = "20 or 40 MHz", + [1] = "80 MHz", + [3] = "80+80 MHz", + [2] = "160 MHz", +}; + struct iwinfo_scanlist_entry { uint8_t mac[6]; char ssid[IWINFO_ESSID_MAX_SIZE+1]; @@ -179,6 +211,8 @@ struct iwinfo_scanlist_entry { uint8_t quality; uint8_t quality_max; struct iwinfo_crypto_entry crypto; + struct iwinfo_scanlist_ht_chan_entry ht_chan_info; + struct iwinfo_scanlist_vht_chan_entry vht_chan_info; }; struct iwinfo_country_entry { diff --git a/iwinfo_cli.c b/iwinfo_cli.c index 0332bc2..5885d06 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -612,8 +612,27 @@ static void print_scanlist(const struct iwinfo_ops *iw, const char *ifname) format_signal(e->signal - 0x100), format_quality(e->quality), format_quality_max(e->quality_max)); - printf(" Encryption: %s\n\n", + printf(" Encryption: %s\n", format_encryption(&e->crypto)); + printf(" HT Operation:\n"); + printf(" Primary Channel: %d\n", + e->ht_chan_info.primary_chan); + printf(" Secondary Channel Offset: %s\n", + ht_secondary_offset[e->ht_chan_info.secondary_chan_off]); + printf(" Channel Width: %s\n", + ht_chan_width[e->ht_chan_info.chan_width]); + + if (e->vht_chan_info.center_chan_1) { + printf(" VHT Operation:\n"); + printf(" Channel Width: %s\n", + vht_chan_width[e->vht_chan_info.chan_width]); + printf(" Center Frequency 1: %d\n", + e->vht_chan_info.center_chan_1); + printf(" Center Frequency 2: %d\n", + e->vht_chan_info.center_chan_2); + } + + printf("\n"); } } diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index 2b2a043..5917e3a 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -2306,6 +2306,16 @@ static void nl80211_get_scanlist_ie(struct nlattr **bss, iwinfo_parse_rsn(&e->crypto, ie + 6, ie[1] - 4, IWINFO_CIPHER_TKIP, IWINFO_KMGMT_PSK); break; + case 61: /* HT oeration */ + e->ht_chan_info.primary_chan = ie[2]; + e->ht_chan_info.secondary_chan_off = ie[3] & 0x3; + e->ht_chan_info.chan_width = (ie[4] & 0x4)>>2; + break; + case 192: /* VHT operation */ + e->vht_chan_info.chan_width = ie[2]; + e->vht_chan_info.center_chan_1 = ie[3]; + e->vht_chan_info.center_chan_2 = ie[4]; + break; } ielen -= ie[1] + 2; From patchwork Tue Nov 24 01:32:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1405196 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=BAKNJbv/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=m3xoX1Of; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cg6600zWKz9sSf for ; Tue, 24 Nov 2020 12:35:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wIdaVpOr/Y20g+eJS3U9FRIGhOeAFFuogFmw7Jt+NFs=; b=BAKNJbv/j0Z9ThqqU5Bid6kR+ n9OCwgOrT6sStSDjjTkn6b4XSaeUE2zLrEf4PCmmhyW4KNWtVmAKw9eQUSirmxIaYXxYul+qMlkx2 9O9ZL/bDHX5Se2LfD0VygGQygFk7bxe9Vw9IVNc1FIUsz8SGao2gbhJEcRq2ZhG8peOXmA/+MJYg0 ZCynSmIl/F7D8ATLhirfUOowra5QHgTk1+M+M5v+xDP0OOEAuX+fie+OWX6P5uCEhXzrGSOIRcaeQ 6TdXoZ17K4/robcL9eLinuTs5zP7jCkjm+4vr4i6SKMgzqmFujt2vSRl2VqWO6ZzBXVlwomTFNmZb odJF/ZZEQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khND9-0000dL-Um; Tue, 24 Nov 2020 01:33:40 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khNCd-0000Ua-Ey for openwrt-devel@lists.openwrt.org; Tue, 24 Nov 2020 01:33:15 +0000 Received: by mail-qk1-x743.google.com with SMTP id l2so19141694qkf.0 for ; Mon, 23 Nov 2020 17:33:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xbLSscBwK6Myichfe1AteOJ9VcvpKLXwMIGOpHqpg4o=; b=m3xoX1OfKup9T60OcQEfxzlrrmS5c+XQvnRhCTZDDxnByRe6a01C6Ap2JlnuOMSUEe lhDDsRyOVKKAi3yMudOy7pTp3lxtjLVYGctay3hDX5pyPEz6ZbsT7GUlsoO8p1nC5jWo dGQJUw/ItM0U0vtZUg0apk1/ujdGs47qI1fFKJVMiEodLeWb570QMqlZIML85RKdIpDK 8fJ/ITyL0hNdZJhkPIOLkyo165T2i2vyG8V4n293ZEehuUYB3Vt33O0w9emDAJp9S/+P LovARO7gHShJtmVSWXfESJ6cxPSV9GG4vEEb5aUtRBr9IZie0NBQvRHIzmk+HWbH8E9R QMLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xbLSscBwK6Myichfe1AteOJ9VcvpKLXwMIGOpHqpg4o=; b=Duk9EJ+vLE0aZMKA3Ue+1mawzuYhojAhhVZI8vdsMUGwNoUpGqXKIk25JfEcfI+g0R zo4/7ci8QHB+ThLT9WfkqwTwmWCE9Ptc74BtGbjrrpDWYZSCrUAw5aZT6gHKf78D6XeU hoHeE+8JQTI5741l73+e1jxmtgHMVP+RE8G1RT6Kl1p77SetfgwjTj70iHqCohIchMC0 X2YCmZCI+LIVZF++v1hhP7gwT39xp8gC0YGGZ/ayY9Gam84MtB4nnDnUDjg2OcH5IXgM sVU4Ke7hnpx9E5eYDgtO/l+hgcueS478Nm7ZWMGWGJUXwAOWxTY0MyH6SocKlRqa3SLt DOMQ== X-Gm-Message-State: AOAM530aJM9fxZZi4tnZUBgmPgXXIE7CiEmj8+16pek4HbCIlh9fsuLk +iXX5EJXylvjqxtsrC1Ld1CfCYeBAb8= X-Google-Smtp-Source: ABdhPJySNbowrEZn4z9ewvbGihKtVL6lin8KRbIGAbh/AdDNPTHExNjsd4YkMBUfdyjxZE2PmJPpRA== X-Received: by 2002:a37:7c04:: with SMTP id x4mr2544187qkc.222.1606181584886; Mon, 23 Nov 2020 17:33:04 -0800 (PST) Received: from ansuel-xps20.localdomain (93-39-149-95.ip76.fastwebnet.it. [93.39.149.95]) by smtp.googlemail.com with ESMTPSA id g18sm11025872qtv.79.2020.11.23.17.33.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 17:33:04 -0800 (PST) From: Ansuel Smith To: openwrt-devel@lists.openwrt.org Subject: [IWINFO PATCH v2 2/4] iwinfo: export center_chan info for local wifi Date: Tue, 24 Nov 2020 02:32:50 +0100 Message-Id: <20201124013252.18323-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124013252.18323-1-ansuelsmth@gmail.com> References: <20201124013252.18323-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_203307_960963_31573B73 X-CRM114-Status: GOOD ( 19.84 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:743 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ansuel Smith Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Iwinfo already export the htmode but there is no way to know where the channel expan in case a 40Mhz+ channel width is used. Export the center channels used by the driver to better know the channel utilizzation of the wifi. Signed-off-by: Ansuel Smith --- include/iwinfo.h | 2 ++ iwinfo_cli.c | 21 +++++++++++++ iwinfo_nl80211.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 98 insertions(+), 1 deletion(-) diff --git a/include/iwinfo.h b/include/iwinfo.h index afb738f..ce29940 100644 --- a/include/iwinfo.h +++ b/include/iwinfo.h @@ -282,6 +282,8 @@ struct iwinfo_ops { int (*survey)(const char *, char *, int *); int (*lookup_phy)(const char *, char *); void (*close)(void); + int (*center_chan1)(const char *, int *); + int (*center_chan2)(const char *, int *); }; const char * iwinfo_type(const char *ifname); diff --git a/iwinfo_cli.c b/iwinfo_cli.c index 5885d06..bd78b9f 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -431,6 +431,24 @@ static char * print_channel(const struct iwinfo_ops *iw, const char *ifname) return format_channel(ch); } +static char * print_center_chan1(const struct iwinfo_ops *iw, const char *ifname) +{ + int ch; + if (iw->center_chan1(ifname, &ch)) + ch = -1; + + return format_channel(ch); +} + +static char * print_center_chan2(const struct iwinfo_ops *iw, const char *ifname) +{ + int ch; + if (iw->center_chan2(ifname, &ch)) + ch = -1; + + return format_channel(ch); +} + static char * print_frequency(const struct iwinfo_ops *iw, const char *ifname) { int freq; @@ -552,6 +570,9 @@ static void print_info(const struct iwinfo_ops *iw, const char *ifname) print_mode(iw, ifname), print_channel(iw, ifname), print_frequency(iw, ifname)); + printf(" Center Channel 1: %s", + print_center_chan1(iw, ifname)); + printf(" 2: %s\n", print_center_chan2(iw, ifname)); printf(" Tx-Power: %s Link Quality: %s/%s\n", print_txpower(iw, ifname), print_quality(iw, ifname), diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index 5917e3a..1bcc5ea 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -1262,6 +1262,56 @@ static int nl80211_get_frequency(const char *ifname, int *buf) return (*buf == 0) ? -1 : 0; } +static int nl80211_get_center_freq1_cb(struct nl_msg *msg, void *arg) +{ + int *freq = arg; + struct nlattr **tb = nl80211_parse(msg); + + if (tb[NL80211_ATTR_CENTER_FREQ1]) + *freq = nla_get_u32(tb[NL80211_ATTR_CENTER_FREQ1]); + + return NL_SKIP; +} + +static int nl80211_get_center_freq1(const char *ifname, int *buf) +{ + char *res; + + /* try to find frequency from interface info */ + res = nl80211_phy2ifname(ifname); + *buf = 0; + + nl80211_request(res ? res : ifname, NL80211_CMD_GET_INTERFACE, 0, + nl80211_get_center_freq1_cb, buf); + + return (*buf == 0) ? -1 : 0; +} + +static int nl80211_get_center_freq2_cb(struct nl_msg *msg, void *arg) +{ + int *freq = arg; + struct nlattr **tb = nl80211_parse(msg); + + if (tb[NL80211_ATTR_CENTER_FREQ2]) + *freq = nla_get_u32(tb[NL80211_ATTR_CENTER_FREQ2]); + + return NL_SKIP; +} + +static int nl80211_get_center_freq2(const char *ifname, int *buf) +{ + char *res; + + /* try to find frequency from interface info */ + res = nl80211_phy2ifname(ifname); + *buf = 0; + + nl80211_request(res ? res : ifname, NL80211_CMD_GET_INTERFACE, 0, + nl80211_get_center_freq2_cb, buf); + + return (*buf == 0) ? -1 : 0; +} + static int nl80211_get_channel(const char *ifname, int *buf) { if (!nl80211_get_frequency(ifname, buf)) @@ -1273,6 +1323,28 @@ static int nl80211_get_channel(const char *ifname, int *buf) return -1; } +static int nl80211_get_center_chan1(const char *ifname, int *buf) +{ + if (!nl80211_get_center_freq1(ifname, buf)) + { + *buf = nl80211_freq2channel(*buf); + return 0; + } + + return -1; +} + +static int nl80211_get_center_chan2(const char *ifname, int *buf) +{ + if (!nl80211_get_center_freq2(ifname, buf)) + { + *buf = nl80211_freq2channel(*buf); + return 0; + } + + return -1; +} + static int nl80211_get_txpower_cb(struct nl_msg *msg, void *arg) { int *buf = arg; @@ -3242,5 +3314,7 @@ const struct iwinfo_ops nl80211_ops = { .countrylist = nl80211_get_countrylist, .survey = nl80211_get_survey, .lookup_phy = nl80211_lookup_phyname, - .close = nl80211_close + .close = nl80211_close, + .center_chan1 = nl80211_get_center_chan1, + .center_chan2 = nl80211_get_center_chan2 }; From patchwork Tue Nov 24 01:32:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1405197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=TIMWPtGy; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=gOEFmmlS; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cg66143zfz9sRK for ; Tue, 24 Nov 2020 12:35:21 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GYYi8juWBWaQumhoMf5ef4/alJHvUjkYTWULXDknH64=; b=TIMWPtGyq6/DgdidPrHdVlsQK 6Fo/nkoHLu2yRnhn2779kphsvBifm6fiLlQHuaaLVtZKQm5yTdz+ygeMVyOjo3hdMRJ175nb7Cp+T 7RCnrDuWJpbIXh+dVNo2WJhe1Ar0hlPSSHRPL6k42hrUmY5RXNQla9rIjTQmztk+q18W0OYCfdNaq iXMDzyTqJuzFfpITMxMK3tfcD0owlj6Nm61K6xCSbfPxbUc8OkJ0bG5wZEfwXYH5G0iA4oRCTIMUR XK6DzZopV+c0ib+mX99kNegSMAS8+AG7abQpT6SNXpKtnQi2V4Bu+Xuat6jzng6mXwVksbi6RxHnU JSRnr6OWw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khNDE-0000eB-Gi; Tue, 24 Nov 2020 01:33:44 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khNCf-0000Wl-8J for openwrt-devel@lists.openwrt.org; Tue, 24 Nov 2020 01:33:15 +0000 Received: by mail-qk1-x742.google.com with SMTP id u4so19055053qkk.10 for ; Mon, 23 Nov 2020 17:33:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8yhF+VRrH31Fm9fv9G2LMom1Kuadmk5+GEKJ3hM0OlU=; b=gOEFmmlS7YCe8t6e/Ye/NCM2GjIg7TAinitsdlDfyNX4XlnbbUVhMmBmbg8F/sVg4B Ztrz8by4P3IqyU2QmdIirJtn1ilk7UCGR8CI3AmcG/2ZFsKJbVNPTWDPS4F8+VXiL7En DmZKAcyzQbR+rCI+UZ6JH/Qm5NcOE4656Idrbpq8Fug+HJJmbqZtU7LsB2yGgxsea6mM TTWgne5VCPW1ihQoUzfii2RhAlVpvIxGNcP2oCeLAWTPdvJ3GvEEff9DX3mJ/a5AeaKa x3aNggrotfB/ac7tK3eJuS5OJRQXuiIhAshHleaH1+E5A0FFzonz1lmj3Hd6R4iTPdOl G5XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8yhF+VRrH31Fm9fv9G2LMom1Kuadmk5+GEKJ3hM0OlU=; b=hA5C9rWI+it77tzV/TS0ZkEu9iS2u9+J3JjaOnLJ8S6npipy3cB8PWYemwy/H+uUOq JOZUZh8RmlBWXQt527wp52lQqb9UwmVhCHlOpmsNVgJrU8f3kdRCPlHkJsJS/ucauawk MoG5eZHz0MgGOnEM+WhvadLvf4O8mhV3Gm8EyIAmkAmiEXTTt9fRDYbrV4etV9510Wob 47s3JAl2u39KjfZ4pZdB+ye0fBpaxaEmRsaNRSoJHEtMgyA0/xfCRGHKcEg5eKG2A9yI dS0cVCnqApT3unkQEFV/2vHUGVjeMKDPFLJxvmTP/OxlCpj8q/HMHT2aF6fyWo3NcJrg QKHw== X-Gm-Message-State: AOAM530yCs5Gw0SsdoS2IuggZXF20fWuQ1fIC5k001HTfRchbCN3Lwwn S6YiOdn1mgJq2PnFHxZxFIAfb+DAf5s= X-Google-Smtp-Source: ABdhPJy8PL5JOdxAwo6HG1pExfLvYJ13j9VUVzsgEWdWewpMvtqeynEV8hnkl33pz5PtyvspbI+IXg== X-Received: by 2002:a37:7201:: with SMTP id n1mr2472250qkc.148.1606181587207; Mon, 23 Nov 2020 17:33:07 -0800 (PST) Received: from ansuel-xps20.localdomain (93-39-149-95.ip76.fastwebnet.it. [93.39.149.95]) by smtp.googlemail.com with ESMTPSA id g18sm11025872qtv.79.2020.11.23.17.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 17:33:06 -0800 (PST) From: Ansuel Smith To: openwrt-devel@lists.openwrt.org Subject: [RPCD PATCH v2 3/4] iwinfo: add ht and vht operation info to wifi scan Date: Tue, 24 Nov 2020 02:32:51 +0100 Message-Id: <20201124013252.18323-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124013252.18323-1-ansuelsmth@gmail.com> References: <20201124013252.18323-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_203309_462630_E360DF27 X-CRM114-Status: GOOD ( 12.56 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:742 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ansuel Smith Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Iwinfo exports ht and vht operation info useful to get channel info of nearby stations. Add these new info to ubus output. Signed-off-by: Ansuel Smith --- iwinfo.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/iwinfo.c b/iwinfo.c index 7780e69..45ca784 100644 --- a/iwinfo.c +++ b/iwinfo.c @@ -403,7 +403,7 @@ rpc_iwinfo_scan(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *msg) { int i, rv, len; - void *c, *d; + void *c, *d, *t; char mac[18]; char res[IWINFO_BUFSIZE]; struct iwinfo_scanlist_entry *e; @@ -441,6 +441,20 @@ rpc_iwinfo_scan(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_add_u32(&buf, "quality", e->quality); blobmsg_add_u32(&buf, "quality_max", e->quality_max); + t = blobmsg_open_table(&buf, "ht_operation"); + blobmsg_add_u32(&buf, "primary_channel", e->ht_chan_info.primary_chan); + blobmsg_add_string(&buf, "secondary_channel_offset", ht_secondary_offset[e->ht_chan_info.secondary_chan_off]); + blobmsg_add_string(&buf, "channel_width", ht_chan_width[e->ht_chan_info.chan_width]); + blobmsg_close_table(&buf, t); + + if (e->vht_chan_info.center_chan_1) { + t = blobmsg_open_table(&buf, "vht_operation"); + blobmsg_add_string(&buf, "channel_width", vht_chan_width[e->vht_chan_info.chan_width]); + blobmsg_add_u32(&buf, "center_freq_1", e->vht_chan_info.center_chan_1); + blobmsg_add_u32(&buf, "center_freq_2", e->vht_chan_info.center_chan_2); + blobmsg_close_table(&buf, t); + } + rpc_iwinfo_add_encryption("encryption", &e->crypto); blobmsg_close_table(&buf, d); From patchwork Tue Nov 24 01:32:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1405198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=yCheqL3M; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ckMbtQZm; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cg6622FFmz9sRK for ; Tue, 24 Nov 2020 12:35:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1O0cs+xn9OpwVJE61QF3Ncihq1XbhJv5+wkSIHvBr5s=; b=yCheqL3MViaQ8ZFGesHXsNIzn XHHWGDPUCuatWBeEOhk6U5ZdsXujCLUWEde9QdFgvrzgziEDOKoGH10KYadhOCN2GGOiNEFF8emxl Wppru5/zMlHS4LGLcbtBRWEgHU1iRRH4qZyldOL4qD7TuXf0si4utCNKjCiAk/NmvwMj5sGDNBw2l OpXGaTiw/zM+6PRXlzE8LH3v2d1d1PxSS0dKLS7K4BFqcxuoc8/8lV/+TZcLlReTtJHGxK8pb4oOM 87DlKNJ1WlTbWCxtJtdWXuKtxEqY3A7Nd4Mox1s9Gs0yAKaEQR9XuHPpkJneh1YO9KKKQgVzqERXM J9Gu+JB4w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khND5-0000cP-DU; Tue, 24 Nov 2020 01:33:35 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khNCh-0000XY-1s for openwrt-devel@lists.openwrt.org; Tue, 24 Nov 2020 01:33:15 +0000 Received: by mail-qk1-x741.google.com with SMTP id l2so19141839qkf.0 for ; Mon, 23 Nov 2020 17:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=voUNkeaYYDJo6aWyRVbOn1okH2yAabm7/l4INlPgUDk=; b=ckMbtQZm34kXS+Xqw5sUnLleADjxh+9H33k5VuhJ84sZ+MJgE7qxfEQwtQGi58We03 xs/yt+f+WGVK1vDNx7VzKU34XihGVa2J5Ih4S8rjUHXAOJN8MT+bh3W3rvDgtGiG7q2n z4/DyWraCTXJ/pgcNxPMkmmhKPlvSmQIyd3nd6GdnUqpz/7XKFW85ssOobEJTjInqBMK +O6vTJC1HlsUHZvtT4cFtq7rLLkdow7YjTAA8y1Cqi3XYlCVZ7VKK9Q6eOFICv0JSnlj 332FnDIIDdbd/0PbExXl61H/rk9Tzzhl+ce1icyrGSFr9PTx8onyd/pfGLZr86mqWs2S 4CHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=voUNkeaYYDJo6aWyRVbOn1okH2yAabm7/l4INlPgUDk=; b=KOdfrGPiLCSUaD7KV7EfApWv7CaGnQRFZPl/uti2YDKhAh58s3CqfattG5xLZIdfFM jOZdgBgrmf43/KM+MXj9qlq5qr8m6j7NCmFR7UTzu5Pby3izpi6bKxxMuRfuSzVerSUE RW8LIP8wCJgFzKrcrO+eCNxW/X9eHPvt8CBQj0IHkZyoXbzU1MWuE2NMogy58OYfMgy9 FI03894GU+5it8h7WhBIraqT6WzMQVoU5CnZkzXl8Vw+sJw3n/fMvwL1U461s8kuMXHA AMn8AzfhUjsfNwWQOjZNz+Z0JTR5/VR1yq1jk7+2AjXnjtj1oyOQYyaRjMiVwC9KpwOP zBDA== X-Gm-Message-State: AOAM533id9FvSWWZyBa8R5EOzNDXTCh8TU9s0sqkrzaSZ623MIV3ZCet OtOg09lgJEMSsVPV8/ThjDl15BkuByA= X-Google-Smtp-Source: ABdhPJzPBWLB4Tx2z/gAaaWRAktM84tZomJgOnbk9OE7Yz3w5g/lPxuvZySBetQwmWeJRTsUZW+GAA== X-Received: by 2002:a37:9481:: with SMTP id w123mr2416674qkd.3.1606181589000; Mon, 23 Nov 2020 17:33:09 -0800 (PST) Received: from ansuel-xps20.localdomain (93-39-149-95.ip76.fastwebnet.it. [93.39.149.95]) by smtp.googlemail.com with ESMTPSA id g18sm11025872qtv.79.2020.11.23.17.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 17:33:08 -0800 (PST) From: Ansuel Smith To: openwrt-devel@lists.openwrt.org Subject: [RPCD PATCH v2 4/4] iwinfo: export center channel for info ubus call Date: Tue, 24 Nov 2020 02:32:52 +0100 Message-Id: <20201124013252.18323-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124013252.18323-1-ansuelsmth@gmail.com> References: <20201124013252.18323-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_203311_330433_6B5742E6 X-CRM114-Status: GOOD ( 11.85 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:741 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ansuel Smith Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Iwinfo export the center channel sued by the wifi. Include this data in the ubus info call to better know the channel utilizzation of the wifi. Signed-off-by: Ansuel Smith --- iwinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iwinfo.c b/iwinfo.c index 45ca784..94fa822 100644 --- a/iwinfo.c +++ b/iwinfo.c @@ -364,6 +364,8 @@ rpc_iwinfo_info(struct ubus_context *ctx, struct ubus_object *obj, rpc_iwinfo_call_int("mode", iw->mode, IWINFO_OPMODE_NAMES); rpc_iwinfo_call_int("channel", iw->channel, NULL); + rpc_iwinfo_call_int("center_chan1", iw->center_chan1, NULL); + rpc_iwinfo_call_int("center_chan2", iw->center_chan2, NULL); rpc_iwinfo_call_int("frequency", iw->frequency, NULL); rpc_iwinfo_call_int("frequency_offset", iw->frequency_offset, NULL);