From patchwork Sun Nov 15 22:53:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1400602 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=d11HWOSS; 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=tir8+Uz/; 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 4CZ6x76KYHz9sPB for ; Mon, 16 Nov 2020 09:55: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=n1g0M5xAx0aZzSlXOGOaHSeTcaUDJOY9tUoEEH0NbDA=; b=d11HWOSS+HQptQaJHhuSzW2j4 fdKQUuAiAACOLWMiJIIHi22+41byaGO2uqdbLPqMlIBGUnaqWb0mTKr0oVAzRX0xTUPrHUr3wWZm+ hPTt1GQHm+AveQVXsMbYPulIB7CFYHdehH5WQcb1ABc0Zs2v5GLpXLgVGoxDJa00Cza36DzNW8Jfd onyF2Mcb96mAR/UA4ABl/a9wES4E6R07kXSoBNIGyUZSgrRUP8KSWRU2+Z9S6NGsblBuH/wgQIt16 E4+pBMkdQAn30B5gxXppQ4/cmm0n8BzRVHuGuIbeoye8si4UDRiDQg9NrmaP1pni7f0pSvaAuZSnn KWw04Oy8A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1keQtv-0005gN-8x; Sun, 15 Nov 2020 22:53:39 +0000 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1keQtr-0005er-7o for openwrt-devel@lists.openwrt.org; Sun, 15 Nov 2020 22:53:36 +0000 Received: by mail-ej1-x642.google.com with SMTP id oq3so21828376ejb.7 for ; Sun, 15 Nov 2020 14:53:33 -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=LAns745Q3QR/ay3d07t53+1WciVzFQJijDqgX5HicUg=; b=tir8+Uz/0966uoUgwCuL5lcJH8IxIn5juLEWa9zIsSF1x96puPZRBQHQVi1pYWE22a wwA9hTAeDOgZhcLZag3x7exfOzdRZePUepcz+/0ZRxVfPvogo+yxPV7VGkP91kSAQOOu JUDSre3kTHIBvHQWASgAnNig5sx7YDiGagfjcko3+dKAg1om65HAPVU1wYX+RZYfBebF SlRyx70ibYn82Xr/L10IuFvo2V3FQl48Ybe5/c+L7NLNY/qvgYtAkpcszIk8j8SfKGPJ amlFmGl8dout+Z7KvjIZ+4Ay4Uo6yyTcDWj9DxUyZ6tWRnB+WRlKslKzbigqihLX58zk 46Xg== 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=LAns745Q3QR/ay3d07t53+1WciVzFQJijDqgX5HicUg=; b=SGLGI5FBLbH3mxCwDPhkIrL3mxjIOlvxyu9Qztq72sQgh3XsUCi3axiosuvNTsteEl grvAFQz9ZDiOOKk/P9lRhAcOSv/H9QJlET2S50UX2su5KuzDTjGJG2M+H01AhkhNFJYb ZN2BK9IlRkKobRi4pu3CKFk0rFjeOfh33a1NqH/wy0RwNkLkvAOfM6iHwkJ7tan/Oubi Y5X3UYE5vBjL5rkUy6YKc1Ln3/0/1NKrSoMsWgAfbGbvi4ltw74rTrKTx5dSkDU4aKTN EfqvRkApfG3efXHcw8PXS0IiHvRmqrWoNR34c6IA3HAM9rGLD5oFmvmaS2p7GJS+vo5T msnA== X-Gm-Message-State: AOAM53024aWh9W0i7vsECICWvUDWSNHPDyKPtzP2gi4XcCrJcGJTtj+H 8H992/aVyou5xc/5WOOxoviW37hOYRM= X-Google-Smtp-Source: ABdhPJzXqwceSeKGyejR4jeJXpkEh3VoPu/+TG8dKsmyOm8iqZut/Um4OltGRUGBa/SOa8bB0W8+Qw== X-Received: by 2002:a17:906:4698:: with SMTP id a24mr12501730ejr.90.1605480812075; Sun, 15 Nov 2020 14:53:32 -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 f9sm9461728ejd.85.2020.11.15.14.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2020 14:53:31 -0800 (PST) From: Ansuel Smith To: openwrt-devel@lists.openwrt.org Subject: [IWINFO RFC PATCH 1/2] iwinfo: export ht and vht operation in scan results Date: Sun, 15 Nov 2020 23:53:21 +0100 Message-Id: <20201115225321.31277-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201115225321.31277-1-ansuelsmth@gmail.com> References: <20201115225321.31277-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201115_175335_342677_E8927973 X-CRM114-Status: GOOD ( 19.00 ) 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:642 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 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.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 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 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 --- The final goal of this patch is to add a nice and easy graph to luci to better check wifi channel utilizzation directly from the ui. This is already possibile but the current implementation lacks of any clean implementation to get channel width. With the new provided data, chan width can be indirectly calculated and parsed by the ui. If this gets accepted, I have some concerns about how to handle the const char * struct used to print the data. (should I add them in the iwinfo include?) include/iwinfo.h | 14 ++++++++++++++ iwinfo_cli.c | 40 +++++++++++++++++++++++++++++++++++++++- iwinfo_nl80211.c | 11 +++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/include/iwinfo.h b/include/iwinfo.h index 5e64294..66df429 100644 --- a/include/iwinfo.h +++ b/include/iwinfo.h @@ -170,6 +170,18 @@ 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; +}; + struct iwinfo_scanlist_entry { uint8_t mac[6]; char ssid[IWINFO_ESSID_MAX_SIZE+1]; @@ -179,6 +191,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..0037b1f 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -585,6 +585,25 @@ static void print_scanlist(const struct iwinfo_ops *iw, const char *ifname) char buf[IWINFO_BUFSIZE]; struct iwinfo_scanlist_entry *e; + const char *ht_secondary_offset[4] = { + "no secondary", + "above", + "[reserved!]", + "below", + }; + + const char *ht_chan_width[2] = { + "20 MHz", + "any", + }; + + const char *vht_chan_width[] = { + [0] = "20 or 40 MHz", + [1] = "80 MHz", + [3] = "80+80 MHz", + [2] = "160 MHz", + }; + if (iw->scanlist(ifname, buf, &len)) { printf("Scanning not possible\n\n"); @@ -612,8 +631,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..e86bf56 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -2306,6 +2308,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 Nov 15 22:53:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1400601 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=Qd+6QcmY; 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=vMBJxFoK; 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 4CZ6x76Dmqz9s1l for ; Mon, 16 Nov 2020 09:55: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: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:In-Reply-To:References:List-Owner; bh=RVOkQdoZGznISTnoNc4qPNZZnRqB5gmPK3J3fyBQDTg=; b=Qd+6QcmYhXpWR1zB+1k96u+pfu n0EF+6e/MXG+GRttoqMp9cI5vHAHCnyMac9cWiElkbqe1j7OaA21rfxVCwuD2tfzs0VkzQ4CSQrLP kSAfVrWT3SMKkESoq1nXg+WLCRXDbtH2ZUc6wcIbNt44AXGGwh6SKHqze6x3aEB3uyO110dlX+UDE pH5edw+VyQ6dCOM3BGf2Iekze6OaSzV2ax8EwKw6r/Pe4CXXsQUEI7c/vhkjyxQ8cAZkDqDUdL5M6 q+Q0OyAcLiy+nljpZSFaVlxZcw0fk+IkFxaV3OM72UrKIiMhMGjoBZD//Qe4ZZABP29xvgmXwWAXO +QZNHFbw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1keQts-0005fy-SJ; Sun, 15 Nov 2020 22:53:36 +0000 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1keQtp-0005ei-QI for openwrt-devel@lists.openwrt.org; Sun, 15 Nov 2020 22:53:35 +0000 Received: by mail-ed1-x543.google.com with SMTP id d18so3943508edt.7 for ; Sun, 15 Nov 2020 14:53:32 -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:mime-version :content-transfer-encoding; bh=59uZJBesWA5Mg5Bzj15E7BHEfKR3jmRME6fFd4YCDKM=; b=vMBJxFoKJHd6CzaR0alm/HRQterRpmx35njeFUZ0uzR1ARXWHr10auytIqAb76Yt45 cGD0cGeLSuUy48QdPYP31IrpP7+48QIgypNRVeuXvrUvySMTp7aioM17B3X2FeMwNbP/ lh3q/edGCJq5N1OUTCY/cqaDZatPlXm3OveLPBIRETWSA+zJ7Co2PURIyzd7hoCGNCjS sheKLsvQ6Hn8JbF+CDSHFK6gAb1ACYVIgGlw75zKf5fDzGyVwAhVK9pDPv7kumh0cjGv FP/dI06qhpO2LgdAhLGzxT0xHEJAvsDbth06wKrg6cCDfCv+zaPs0ezU+MTAhZW9b3JU ZPZQ== 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:mime-version :content-transfer-encoding; bh=59uZJBesWA5Mg5Bzj15E7BHEfKR3jmRME6fFd4YCDKM=; b=P1pes3/52rVHABQVJwlYPDG//GknMAUEFvBYh4V/r9QyznAhdIunjElfS13vnjN70Z UdjZ4ZDbayXve1M5gjJfrIUzVpnLxWPTNTgnihFHpqk/6TOuveFTc4pTyMYixysUQOXC orVSdRwjLlIYGyKXYMtkTrmyvhrMx+mVDG7Vtt0NTyuDqC66HoaGa834QItZ7VEeRvcv dwnH8mZXyiTGgmAzvfWTP14dxvDf4HAhKRdK2fhZoDqAJEtCHrY3Mfo1tvDJNeGBZXC+ xeWmLW26SeYuUtubhzAu4fCmZBwD9+dZe0zX7SCM1hLvpegiqOjqsVkPPLBorWuf73Yz 28Ww== X-Gm-Message-State: AOAM532XHWDCNEnt8So0gXdUE1uitZtb2LqurT8EM0FtuMkMrf2uhj0d ozh+jxsEyR+kXV4BNYzvDI6CY+FBUD8= X-Google-Smtp-Source: ABdhPJzMd9BG+ZNAD4iwWBQfD3AGE/+UX7ysxhx7jq6gjGs/fWSBtTVTwEi08iDMQCsMhd5raXU1Mg== X-Received: by 2002:a05:6402:1c8e:: with SMTP id cy14mr13569546edb.39.1605480810691; Sun, 15 Nov 2020 14:53:30 -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 f9sm9461728ejd.85.2020.11.15.14.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2020 14:53:29 -0800 (PST) From: Ansuel Smith To: openwrt-devel@lists.openwrt.org Subject: [RPCD RFC PATCH 2/2] iwinfo: add ht and vht operation info to wifi scan Date: Sun, 15 Nov 2020 23:53:20 +0100 Message-Id: <20201115225321.31277-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201115_175333_956514_F339EF4D X-CRM114-Status: GOOD ( 12.33 ) 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:543 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 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.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 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 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 | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/iwinfo.c b/iwinfo.c index 7780e69..182db2d 100644 --- a/iwinfo.c +++ b/iwinfo.c @@ -403,11 +403,30 @@ 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; + const char *ht_secondary_offset[4] = { + "no secondary", + "above", + "[reserved!]", + "below", + }; + + const char *ht_chan_width[2] = { + "20 MHz", + "any", + }; + + const char *vht_chan_width[] = { + [0] = "20 or 40 MHz", + [1] = "80 MHz", + [3] = "80+80 MHz", + [2] = "160 MHz", + }; + rv = rpc_iwinfo_open(msg); if (rv) @@ -441,6 +460,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);