From patchwork Sun Dec 6 01:11:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1411656 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=AYfWbQuD; 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=FwxWCpoT; 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 4CpT5h1r97z9sW8 for ; Sun, 6 Dec 2020 12:15:36 +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=kTUaqjKdvke96WE7ViOf6FaAVao5uUayoFq9N8Qieo0=; b=AYfWbQuDOp9CnaqrDTUIb95bx Ayfz9B2INEHUoV4qwJxX+pYVpni6fZBhbYnr2q43Nq6HeWCWUqTQpOjiHAxK9N0X+z71YVZZDzOT6 VUBYxCRxVQ2wn13+WdcM9/iBY0x8YO/gKX+KSfYR7keqSs3KVXWFFLHpE3hhphYW43PsqKGEfgCaj Sv4jZ9L3S0dX58RQgtmUOaloZRKs16KXxIq6MZgQcKCJTc3S1rRl0Zo8f031En62ogytPURsffSlL z/QiAfzdsj4pzCzKirNqyEetZ4AjPPIIY3hdxhQCUurWDYpcaxNHdhePk/FpeR0EF6KPSMUw/mm4J ILzndiiYA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klicD-0006PQ-0U; Sun, 06 Dec 2020 01:13:29 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klic3-0006MR-4O for openwrt-devel@lists.openwrt.org; Sun, 06 Dec 2020 01:13:20 +0000 Received: by mail-wm1-x341.google.com with SMTP id x22so8440923wmc.5 for ; Sat, 05 Dec 2020 17:13:17 -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=TSG8lT1y3YbOqorrhNljGcq1X4pYFYQSMagql05GyUQ=; b=FwxWCpoT6HFzahEh9pSGblu1aVkXGn0ot3o5utT7uhX+5Rc9RmlVKTiF3W3X0qIjFi EFYoy/IUlbEvxSWFKuLxZiwc9ls4d4OwvSfxeP+hpnxdGPOd/sEc8O0pl3T0PvGaSgA0 aMqbnmgftdTghuIA79A56tHkkaX5yjt7FTy2FLxTyzaU/Im/HX+O4839Qba4NuGxw4tY koeEK4uT93JdvREQF9UEae93nDVD+84xOAokdG2Rn62/rXGRgxs7Wgswc9DMEH0uNk0z H6VXO9UqyROw73E8Wd9mATU/loxNB3i9bLXBmZkFcc18dZI06NYkg25gcPzpfJ6LwHdy l5HQ== 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=TSG8lT1y3YbOqorrhNljGcq1X4pYFYQSMagql05GyUQ=; b=GD7EtAZEI9bhbcprrLlxUJHZ1Tt5wEMzTLLS7pFm6KnsXx8XwmM72ZhEHsxikCfZ+6 cBgcsUQ8ioHEHi1QP2m5nI4s8RuOrWxzdChjc98q+3gXLS2ichjYEatA4DhAEryhWw+5 hFE0ENEoCAEKTkSH3U2T6bjPLUj5m1tB6M8y2V/UK1PE+CdOHBG7CUHT8GJs+O1aNq5q A4E6C4eFgyzRdf2a7ga5EuVZqCL437l2Lh0gy4Oc+ns2/gXCUxVydi6yhNaf7iIqI7/C 1+E10tuJsF4YkBWYf4Pszab6oe1yikWHJZ7Mk5sj8ZT9eno+zd9bCmCX0OiYPLkDL8tf Xh4g== X-Gm-Message-State: AOAM531AOgJ76/msEcV/yXPIJb9iXfvCfmcU6X6lFfhiORWwDaWOTfXJ d5Xcxt+DlVk4UFDEM+LVx3w8CEKFyxI= X-Google-Smtp-Source: ABdhPJwDvKvlum9dyBWDIjATArS+AyNOqg8zSud6DvDQk4eNWdUGSTlgGMk8Zu/WCze1jou4LQSusw== X-Received: by 2002:a1c:4907:: with SMTP id w7mr3601692wma.175.1607217196015; Sat, 05 Dec 2020 17:13:16 -0800 (PST) Received: from ansuel-xps20.localdomain (host-87-1-248-10.retail.telecomitalia.it. [87.1.248.10]) by smtp.googlemail.com with ESMTPSA id b73sm7328415wmb.0.2020.12.05.17.13.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2020 17:13:15 -0800 (PST) From: Ansuel Smith To: openwrt-devel@lists.openwrt.org Subject: [IWINFO PATCH v3 1/4] iwinfo: export ht and vht operation in scan results Date: Sun, 6 Dec 2020 02:11:15 +0100 Message-Id: <20201206011118.20601-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201206011118.20601-1-ansuelsmth@gmail.com> References: <20201206011118.20601-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201205_201319_272856_763DF537 X-CRM114-Status: GOOD ( 16.01 ) 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 [2a00:1450:4864:20:0:0:0:341 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 | 35 ++++++++++++++++++++++++++++++++++- iwinfo_nl80211.c | 10 ++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) diff --git a/include/iwinfo.h b/include/iwinfo.h index 5e64294..676db91 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 uint16_t ht_chan_width[2] = { + 20, /* 20 MHz */ + 2040, /* 40 MHz or higher (refer to vht if supported) */ +}; + +static uint16_t vht_chan_width[] = { + [0] = 40, /* 40 MHz or lower (refer to ht to a more precise width) */ + [1] = 80, /* 80 MHz */ + [3] = 8080, /* 80+80 MHz */ + [2] = 160, /* 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..6bfe0ab 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -323,6 +323,20 @@ static char * format_assocrate(struct iwinfo_rate_entry *r) return buf; } +static const char* format_chan_width(uint16_t width) +{ + switch (width) { + case 20: return "20 MHz"; + case 2040: return "40 MHz and upper or 20 MHz with intolerant bit"; + case 40: return "40 MHz or lower"; + case 80: return "80 MHz"; + case 8080: return "80+80 MHz"; + case 160: return "160 MHz"; + } + + return "unknown"; +} + static const char * print_type(const struct iwinfo_ops *iw, const char *ifname) { @@ -612,8 +626,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", + format_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", + format_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 Sun Dec 6 01:11:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1411659 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=P+vetSTG; 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=sWU61EBZ; 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 4CpT5s32XFz9sW8 for ; Sun, 6 Dec 2020 12:15:45 +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=h6I6kUw7BILw/t3nsLlZtxlFFadxkzfjNjbzYEJEqKY=; b=P+vetSTGLpHX917O8aDIE2gAP bTlfkLNfh+Sq+5TsOv6XXWpzG7ZDNuveOxwqHNlGRxQr/vD9L5wUwQt7YCxHpimL/71r6JiaBQ2GQ 1454+F1sHpQtFnJ+o9t3yxN5bwhLp6PlCwS/XYNAjpYrocTmHnpKzhSzpSRu50MvzsE10EHPZ5iSh 84D3kyDNDgFmBSRR8OXIeLcdeKHjsPnY/PMMtqvqwVefym/UC5rLSSIOWCAfpAmFqoLXwBJwvAQV1 04QXYZAs9KYiMcUD8pmykGpuQV2AYQKkEh2qzOmT4mJZDYn4iWP511dYDYP/IqRdpmBulJCyjTN9K Xa8HV//SA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klic7-0006OJ-W7; Sun, 06 Dec 2020 01:13:24 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klic2-0006MU-PB for openwrt-devel@lists.openwrt.org; Sun, 06 Dec 2020 01:13:20 +0000 Received: by mail-wr1-x443.google.com with SMTP id e7so9059806wrv.6 for ; Sat, 05 Dec 2020 17:13:18 -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=IFEHczl1EhNRBu0nBZmKRm1PY7jxTJ74y2X2oT6VwKI=; b=sWU61EBZbai27bKwnJW3hn8rimvSmFc9KST5y7OXlDq3LrKHP/WAjVHVjpUoPo0WhF f4qj/LJ93xK+q7aA9VjkPzMLVm6RAMpObzaqzP29lAYUnBSzVU1hAnjJdhb1hLnv/Ezc vXclSwjIvmlTQ1CNnMcwUn/rwapSgR0JqU1z6z6lJcHmUrMHUu5jEOVMuZWMorM6Zie4 UptC8PgTlWI8tiaev27rEbNx7qXCgzBZuQ1VyZOthLLKRMtAS7zIS9aDSlQzLGR0Q0b5 Y9SXAUjH8YF/48iF5Z5MvlrmzDtIkH5F9KpfzGDLS7XLoR8oZu5o+cMy0UCkYrgNuapK I5lQ== 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=IFEHczl1EhNRBu0nBZmKRm1PY7jxTJ74y2X2oT6VwKI=; b=efppJ27oYFzy3pCDotOh7DopefyAC2xOXPiSo6KsrVmWB/TcthQNp9+YqJAEzVxyxW Y4qEW7agq4Wg4rMKkCFPuUfrhrmfr6/WjDLj4HpH0zeqy0lgQyEgUrhfNiwfx93gpyHQ MQ63Wbqx5gnSLlOSvhiM9I0FhvIIOPlApAZRc3PS1Tn1JrnMqyn/IF7G7KeIbSu8VoQS fFo1FhLD7553Gv4MFWI5rHfKmjQqkhN4e83eCXFSvtLJ+pUXwnarMmVyoVmZv8OvXanO Rwiaxs9I5cGH+ECv+Ykig+qonkRAQzlq0tIGyJHyMEKbB2Q0u/hNNnQMaLCM0b+lzFhL nD7w== X-Gm-Message-State: AOAM533tKmz3V0aNO0YVbpaTpVBhoHUVHzDD43C3YITye6ILNp2rKFqQ kGkaZcZMqPEC4nbLVU7LFx92TArsYU4= X-Google-Smtp-Source: ABdhPJyF24HGg5/TVBnu0fH4OlWQFYFZiFHK37VAp2lEsqDMGMC4YDEnUQK40/qG7nB5IPjp2ccnRw== X-Received: by 2002:a5d:4c4e:: with SMTP id n14mr2543095wrt.209.1607217197125; Sat, 05 Dec 2020 17:13:17 -0800 (PST) Received: from ansuel-xps20.localdomain (host-87-1-248-10.retail.telecomitalia.it. [87.1.248.10]) by smtp.googlemail.com with ESMTPSA id b73sm7328415wmb.0.2020.12.05.17.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2020 17:13:16 -0800 (PST) From: Ansuel Smith To: openwrt-devel@lists.openwrt.org Subject: [IWINFO PATCH v3 2/4] iwinfo: export center_chan info for local wifi Date: Sun, 6 Dec 2020 02:11:16 +0100 Message-Id: <20201206011118.20601-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201206011118.20601-1-ansuelsmth@gmail.com> References: <20201206011118.20601-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201205_201318_957311_66476A67 X-CRM114-Status: GOOD ( 19.57 ) 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 [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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 | 23 +++++++++++++++ iwinfo_nl80211.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 100 insertions(+), 1 deletion(-) diff --git a/include/iwinfo.h b/include/iwinfo.h index 676db91..680f384 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 6bfe0ab..cc5d298 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -445,6 +445,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; @@ -566,6 +584,11 @@ static void print_info(const struct iwinfo_ops *iw, const char *ifname) print_mode(iw, ifname), print_channel(iw, ifname), print_frequency(iw, ifname)); + if (iw->center_chan1 != NULL) { + 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 Sun Dec 6 01:11:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1411655 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=qxPdJ5wX; 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=CBuI+YVJ; 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 4CpT5R18RFz9sW8 for ; Sun, 6 Dec 2020 12:15:23 +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=iyUQNNj/WOips5W7Oc6CQvTgQHtd6QTn+vislEdpIeY=; b=qxPdJ5wXntVMDfPaBKBlQ329A kb7uv0v83Dktko4J5HgcHrIhz4NHz71XPI+08EUrj6WqWLtuNSr2WIdRBRLY02npmsbbC6G+Ag2sx qwHiK5D0f4ySJGDSQaEMvdcLzf8fnNnZdEREiKV4IxRg6GAWPcKynz41U70krZAL+FHjkv88tJY42 0FSbHZx0KuY32rc9pPx4JeaM6jDfZRmiYYnADL9sFCjveeCPnyj1Uzg7KmFMuS+ksc1kW2y8q/J8P 2HDww81Gd0nwEgdOaE7Is1geqZVsu7RvTNllwXBCEsUCBS3Vx+seH/Q3F8N835F+q03Ka92GG2gp8 emVAuJHdQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klicB-0006P5-6S; Sun, 06 Dec 2020 01:13:27 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klic3-0006Mz-Lw for openwrt-devel@lists.openwrt.org; Sun, 06 Dec 2020 01:13:20 +0000 Received: by mail-wr1-x443.google.com with SMTP id s8so9058798wrw.10 for ; Sat, 05 Dec 2020 17:13:19 -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=43nG/I0K2nZSDWn35VlqHLENE7B+3KI4LW+j/mpRrnY=; b=CBuI+YVJO2rHEclcyU1ZQM9WVX/bwBDmoXovXSXl6wY9KXL3vIEfY+M2RrlA/3SbV6 wZe9IlTeX/zdKeKETg2Ut3xLkJNiDA06aXze2pLwW44SmcrtjrV8U0OPFYGypTg6i9kt ZRClwBEvkfhdMDWZyEriTCJEcOATZV66swsOsXiUPhp06ZdcyeGgV94ZJS8GOybABRNx xN1ZhTaqt02PghKcgOBMh911rCLWc+QWPJ3SWSsdoDRrUdRaA02NdQJLYobYhqNybhYl X9nx7zYA/xxPn87oCq2gPQjyDr3kmvy0HxHzax616pOM41KtjsYOnLz8FoQPsC+NMYbT YljQ== 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=43nG/I0K2nZSDWn35VlqHLENE7B+3KI4LW+j/mpRrnY=; b=nEGRsP1S6xDlsET3nlJSc6JnZfFBvyDx1ItH9D40AaLO5yq44q72Vfptu25rmA4/JD IugpJ0MDtpeA/p2OQKn97wa7TBP7W7Mnmocf+kzkZuOTdmlanzPVaHvdurCrIvolKQf1 YJ7UWkdkdOdTt6p8vQhsWWGVE5BGN4SDVfbT+6BboE/E+0yefnC/UGRu5RAPs43v5ILm faIuLTgV05MTy+QFde0dObYJjmjh6crC5n7/URKAjPagRvw+pTy43A7rBUKay0xmiZ9W cP7X8LDW6D42okVrJb7Qh2jcQ4cAdgFr13V/6Xo7OyuKE3cwWzlCVflOgqI8t1QqbhPv cCWg== X-Gm-Message-State: AOAM530E+vWmUplPuTr33GpHbR18+0Rh44KEOCN5w7RDgleGObLAL5gP 24S2HQ7DmDi7v/QqCyiSc6JlRjW5Ra4= X-Google-Smtp-Source: ABdhPJx2cGLfs9Ang5JQtTQjyJNaE+qGMdrY7YkG06JShKIx1539IEoAif1V74hx+dGXykc9u1HNOA== X-Received: by 2002:a5d:6782:: with SMTP id v2mr343673wru.384.1607217198373; Sat, 05 Dec 2020 17:13:18 -0800 (PST) Received: from ansuel-xps20.localdomain (host-87-1-248-10.retail.telecomitalia.it. [87.1.248.10]) by smtp.googlemail.com with ESMTPSA id b73sm7328415wmb.0.2020.12.05.17.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2020 17:13:17 -0800 (PST) From: Ansuel Smith To: openwrt-devel@lists.openwrt.org Subject: [RPCD PATCH v3 3/4] iwinfo: add ht and vht operation info to wifi scan Date: Sun, 6 Dec 2020 02:11:17 +0100 Message-Id: <20201206011118.20601-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201206011118.20601-1-ansuelsmth@gmail.com> References: <20201206011118.20601-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201205_201319_841246_C44D49E1 X-CRM114-Status: GOOD ( 11.90 ) 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 [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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_u32(&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_u32(&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 Sun Dec 6 01:11:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1411658 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=s4PYV8M8; 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=O52RaYDH; 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 4CpT5p4wn7z9sW9 for ; Sun, 6 Dec 2020 12:15:42 +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=s4PYV8M86FM82iLBaCNg7il5K lMv25bLF2Av85V8cP6o1hvboydifipL4eqEkxA1v3EUB1EH3B6jfTBXJpce76noliG16zjjeh+Bw2 5tSq+N9p7dvsbs8EOa1bR9CuFnMDCqgRJoT5wbqkh9gC45Y/saHAcZ+SwurE4hSII4qiwAL9OQFlo 01i3hGnw8XJxODAXQjqW41+jz+ZjTF9V98juUC8hIWvlYd0kSL2vMPPbnoSh1B93mlbHSbHvpvH1E CRKhWeTbWVOmW1Sqllg08g6ykejiXA6NJNHtBkmEDRpVamAJ9FR1mbKuqRotUromd1SwaUiVmjgst kGnp+AZzQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1klicE-0006Po-NB; Sun, 06 Dec 2020 01:13:30 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1klic5-0006Ne-32 for openwrt-devel@lists.openwrt.org; Sun, 06 Dec 2020 01:13:22 +0000 Received: by mail-wr1-x444.google.com with SMTP id e7so9059842wrv.6 for ; Sat, 05 Dec 2020 17:13:20 -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=O52RaYDH+zuFl3JATgsn6ZCgej6SBx7R1fWWYRnJNFV1RslQzwvA6sVXroPgkCgn30 BeVX1cTzi0Y48Flrm05LjyxfIy5JdEiPfWJkJRoZtgplxYp8Mn0RzluVOwoVr65idawK Qmp7431uwCEKuuyI+KNkxafciz1PbuusA4yHK4irWSZhAKKgYlWjm2P9yig+Ec6/Jefd WRRdTDCkfIGtv7FWzv8RhSNcyzbVLEIFJXZtc+IZvY7KC/o4CH+o/s7704yxtpyZ+3AL nHm3pG2FC6cbLbGtjsaNVNQ97B//aYd+CsPXqwe8thoV3KH8RcW2gk371DdOQ3FeuAqJ m/ag== 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=rf/tazWWek8Savagysxaot04MTrXqxuW8p7La/SX1wfM9FfwBESaLZLXBZ/rCmUlYO yrBGrbCq8ezE+K9xQfyX0SfLzOI2SstItXpN0wBpHBEh3Opmn1JmjIhnT0js4e4qeUKh th7m5PGYfm4r7shGGEBlfKLZdhZyyYjSUvlFGuvQPg5WUJ+GPGJ1hJYNOvo2IbA7G2p8 O8j5C/Z5r30afdMmcgXdlFnAJOJXamBzw4zGhw7n7ED38VQf3TV0irAkOuFs26xS/Our WHwyAa22mSmuRCRtaMavLvo1A/3D6tRPRXmTHApDnVcA5G85pCYMsodONJiIWVMWJteH Q8bw== X-Gm-Message-State: AOAM530aGfFCNdWq6chqKKJFM2Z0p+xKzwvK4JOLVPVLTFh6D4C+ycpW /8WzD9nkSTkr4wjc89UDTmafbexPvVY= X-Google-Smtp-Source: ABdhPJwygyZ94nVDD/DYb6q7p5RObCH4s7UTct12+brkQcXeIdZ34Vlumt0pp9ai//FpgEyNnSxBHg== X-Received: by 2002:adf:ec0d:: with SMTP id x13mr12498207wrn.207.1607217199525; Sat, 05 Dec 2020 17:13:19 -0800 (PST) Received: from ansuel-xps20.localdomain (host-87-1-248-10.retail.telecomitalia.it. [87.1.248.10]) by smtp.googlemail.com with ESMTPSA id b73sm7328415wmb.0.2020.12.05.17.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2020 17:13:18 -0800 (PST) From: Ansuel Smith To: openwrt-devel@lists.openwrt.org Subject: [RPCD PATCH v3 4/4] iwinfo: export center channel for info ubus call Date: Sun, 6 Dec 2020 02:11:18 +0100 Message-Id: <20201206011118.20601-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201206011118.20601-1-ansuelsmth@gmail.com> References: <20201206011118.20601-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201205_201321_267966_EAA5533C X-CRM114-Status: GOOD ( 11.29 ) 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 [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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);