From patchwork Sun Nov 13 15:11:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Heider X-Patchwork-Id: 1703245 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=iCKQcvIw; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=OSyH1/uW; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N9GDV2cNbz23n0 for ; Mon, 14 Nov 2022 02:13:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=G/PrQbQvx+JeHrlGS6CQaEC+U34tJYLe4ZxzuV8Ld5Q=; b=iCKQcvIw/9RcWK snphw1+QLE/DR34IxvN6F4CFVR1V43nRjPv54kWT149QnZXuo4yFt1/AKktDiZUqeZrnBxWbZ+csZ B4C2tj5GLFlMAJTvBcICUZA8OOW4IyDtn1nQNBBMvUvErsPvYMGwcDMuT6i8i5gQdk61XcV2YZBod peY8SaMS/S6QG2mlEi9DC6ZRCAYFtTrT7FHgXqe3P7usZ84SQia0AuX+yGEjtYeXk7wshl3m28SCv 7sISKLucFbfRs/Xm2K9EccZJmOLj1sR1nHF8Hg88D40K7Q9nR/Hw/8oBNcY5qBQqpn2PDNjYmknqf hPBHGb1zQtzWZeOqBJSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouEdx-00By4S-AD; Sun, 13 Nov 2022 15:11:33 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouEdu-00By2S-PN for openwrt-devel@lists.openwrt.org; Sun, 13 Nov 2022 15:11:31 +0000 Received: by mail-wm1-x329.google.com with SMTP id p16so5697423wmc.3 for ; Sun, 13 Nov 2022 07:11:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=VZEJ/24sapC0GnPGSwSQl9iZi9XvMxGiPPnDQr+9bRQ=; b=OSyH1/uWnja0mIp/X66Jd/KyeiuyOHQlp3SfnMwqxk1Z6gpz+BFM5vykc/KTFNeuBn aCgDpVkXbN9gYVYb9pnqZHs976RS0vsE/M+dCbhVqU9w2ghfRCDwdwQ9z+ryD1sx8wQX +5N1zzjs1meoUbKDobg2OO7Mf6HW9GusI4NumnHwS93Jg3B/x+1OZAs7cS6qsiuUMezX y4e8LcHncnaIPun3as+WRipOYia53gPpYdUrahyMG4zGN3fvON8D+hjx8BfX8O8r2sC6 EpaNQdYYivsmQB9WS3lFucT6O/DoTyYPG8IQL+cCX//SQwzXPGI00v7JkmKSKujVez3t vK4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VZEJ/24sapC0GnPGSwSQl9iZi9XvMxGiPPnDQr+9bRQ=; b=T2kAEjsNYf4gB37Xzft07VpMALzYqJjgr3pCCURKDnb7fMrwuHYcYAyrauDl9T2dB/ 28P3YOxOVWGDzh0Vn2DW+8LPU4l3FW/asRGV706GlaIWUryS21L4Truh2hM2Nb+Au5h0 88l6KDobh4VzfAzRE7/zcLJUMLTsZldNv9abyWwjTqrFSo8+pr6z0C8e6lL2kERIUsqI IdNd397wu55pEGt2St02zSLAtQW6EK2kZ3rViqI4wbsVUPRzME4tDjKxZQK5YgY1EdgU ERhm8zIeIgnk+fKm3vEa9YoQ+mtqWgPm9i2wkG8Bl5GCuAktX12DsSxPJjvgjPqVkmqZ 2Z3A== X-Gm-Message-State: ANoB5pnUWAoIZDidJEIhl4kGVuhZmySgyJRaP4VtineVpsGB0CJLsa5p gZdDbuTyG2VWtunDPLCbLm7C4CqAjz8= X-Google-Smtp-Source: AA0mqf4QBpXb0gnrwLAF8wsnFRCMIIgzKup4+SCESmDPrSK/6Yo4o25NVohVDq60EwLruYmsLUfSwQ== X-Received: by 2002:a05:600c:5554:b0:3cf:9be3:8d26 with SMTP id iz20-20020a05600c555400b003cf9be38d26mr5927059wmb.185.1668352283797; Sun, 13 Nov 2022 07:11:23 -0800 (PST) Received: from mamamia.internal (a89-182-189-22.net-htp.de. [89.182.189.22]) by smtp.gmail.com with ESMTPSA id c2-20020a5d4cc2000000b0023655e51c14sm7020114wrt.32.2022.11.13.07.11.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 07:11:23 -0800 (PST) From: Andre Heider To: openwrt-devel@lists.openwrt.org Subject: [PATCH iwinfo 1/4] iwinfo: fix wrong error message Date: Sun, 13 Nov 2022 16:11:17 +0100 Message-Id: <20221113151120.790801-1-a.heider@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221113_071130_862273_0F69EF87 X-CRM114-Status: UNSURE ( 8.85 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: In this case the specified backend couldn't be found. Signed-off-by: Andre Heider --- iwinfo_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iwinfo_cli.c b/iwinfo_cli.c index dca86cf..d8851d7 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -972,7 +972,7 @@ int main(int argc, char **argv) Content analysis details: (-0.2 points, 5.0 required) 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:329 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [a.heider[at]gmail.com] -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 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.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org In this case the specified backend couldn't be found. Signed-off-by: Andre Heider --- iwinfo_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iwinfo_cli.c b/iwinfo_cli.c index dca86cf..d8851d7 100644 --- a/iwinfo_cli.c +++ b/iwinfo_cli.c @@ -972,7 +972,7 @@ int main(int argc, char **argv) if (!iw) { - fprintf(stderr, "No such wireless device: %s\n", argv[1]); + fprintf(stderr, "No such wireless backend: %s\n", argv[1]); rv = 1; } else From patchwork Sun Nov 13 15:11:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Heider X-Patchwork-Id: 1703248 X-Patchwork-Delegate: jow@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=rO4rdP8S; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=c77aWbxy; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N9GDY1mBmz23n0 for ; Mon, 14 Nov 2022 02:13:48 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type: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:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FFIheQHEbE3wIMg0DdBNzYWdz6um7nbLVmrogVK2eik=; b=rO4rdP8Sks+Xfn d27zwn6cXySblRA5j9uqbaW2BoIUCc1iP3PILQuU6jdt7/w6kn41p+WozcI+vG2dGU3qD+XoFO0Jb NHFWx8w0/3cizUxSt7e3dQgqUgmVNYI44110P2+jsde8IwbEnjRYRBGLTlHiHnHZQ5vCcXH4kbEOo Ojvfyg3Ysic8cuucCp22wepzcTaS0H8CcFMQVOo/G9uv5SFM5ihyBKM87rQO6pqqitYutuaB1ML9F musvcnGwIX39px+k8DiyspDnYzlHcoGZrqK3XBfoq6n1x5XXwxLhz1Z+McsnSTbJ9ovP+gMvnoKdO 9zssKgtsiPoNlEB1IwOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouEea-00ByBF-OE; Sun, 13 Nov 2022 15:12:12 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouEdv-00By2T-CT for openwrt-devel@lists.openwrt.org; Sun, 13 Nov 2022 15:11:33 +0000 Received: by mail-wr1-x42b.google.com with SMTP id d9so8301690wrm.13 for ; Sun, 13 Nov 2022 07:11:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=M3j0u9haz+0HwCMIsQ4WEPAJzBs9/DHs3r7ybdl31Aw=; b=c77aWbxyPTIXTM6+RT/OkEQNP0f1qqvNuBz4bN4EmdK1ftbsRy1Ohbe9fRyiSXrH+I Jd0SYCMVgbLA4l46fLuJVqA8Q1cC1d9xZd8D8La90b3kuey86tQvhpvzoN71vHNO6uuu irzdHf5IvRXhnVF/JIZRMiHptsuIQSBaAFuab8LKjA7H77VonNRgF50r0xfDYwKVXDx3 gOgiptXYeR00ZvRDOR3lKLsuN0LKG1DuGfyZKmZ0vewJOa6faKTwZ4XHWA0hGZYW2/kT ikoj8syxqlsBWs6ZxC7Xm6P6jS/Er/EgFzkaow/0r9n5c/XVgox6jzaG+4LhGMtHIzLG xnZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M3j0u9haz+0HwCMIsQ4WEPAJzBs9/DHs3r7ybdl31Aw=; b=hALw0/agBxLcyRVQ0HMxhcbZZ/6a5T4prPwVDV1zEvLzZ20MKZpnGZfzXQmbJjuOcX cAj8fUElOFdIxQ4NpFxmk8TcuaIW3EVraIBFke6xYjrKMTWYuz8Cxq1WlPxNvBqYs1KE RtZod+6FlM8PCJr1lcvR9jiUuDPL8G9AAGeUJEWVvUTED8UhreNG8a+o0wGef+I/OmF5 DkNsiwAHhYR33xGGgOJNrT+is8hDxU2ljpgxbPoHA3LIlNaG11dueDPuoRsHUdrJNp87 IBOhOzNUJ9nhd7fMrdyvMnoyLnRPcjxk8i0D0fQhN8acWqYALJ3tvgwfLDLzDE6oeGYe ag/w== X-Gm-Message-State: ANoB5pmweugva5G89pQqE6ttUUyo3KLtM9eBm4WJMt3bIPks4Uao7VWG hDEhCi1DIZA67c03Lozd7OExH407e4s= X-Google-Smtp-Source: AA0mqf6XZ7R326wRsS5H1oe5DNijn1Us4xbTUPocB8kD+E/W/sztToaK4LP57PhAYYsWgPTqdo0dpA== X-Received: by 2002:a5d:4910:0:b0:22e:589:4dd2 with SMTP id x16-20020a5d4910000000b0022e05894dd2mr5313425wrq.236.1668352284657; Sun, 13 Nov 2022 07:11:24 -0800 (PST) Received: from mamamia.internal (a89-182-189-22.net-htp.de. [89.182.189.22]) by smtp.gmail.com with ESMTPSA id c2-20020a5d4cc2000000b0023655e51c14sm7020114wrt.32.2022.11.13.07.11.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 07:11:24 -0800 (PST) From: Andre Heider To: openwrt-devel@lists.openwrt.org Subject: [PATCH iwinfo 2/4] iwinfo: nl80211: skip ftd and mtd lookups for usb devices Date: Sun, 13 Nov 2022 16:11:18 +0100 Message-Id: <20221113151120.790801-2-a.heider@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221113151120.790801-1-a.heider@gmail.com> References: <20221113151120.790801-1-a.heider@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221113_071131_442435_4CAC515B X-CRM114-Status: GOOD ( 15.18 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Determine if parent device of the phy belongs to the "usb" subsystem and skip those expensive lookups accordingly. Those don't even make any sense for usb devices. With a 5.15 kernel the mtd lookup even spams dmesg with: "mtdblock: MTD device 'factory' is NAND, please consider using UBI block devices instead." Content analysis details: (-0.2 points, 5.0 required) 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:42b listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [a.heider[at]gmail.com] -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 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.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Determine if parent device of the phy belongs to the "usb" subsystem and skip those expensive lookups accordingly. Those don't even make any sense for usb devices. With a 5.15 kernel the mtd lookup even spams dmesg with: "mtdblock: MTD device 'factory' is NAND, please consider using UBI block devices instead." Before: sys 0m 3.56s$ After: sys 0m 0.09s Signed-off-by: Andre Heider --- iwinfo_nl80211.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index ba92530..fcc48dd 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -3455,7 +3455,8 @@ static int nl80211_hardware_id_from_fdt(struct iwinfo_hardware_id *id, const cha static int nl80211_get_hardware_id(const char *ifname, char *buf) { struct iwinfo_hardware_id *id = (struct iwinfo_hardware_id *)buf; - char *phy, num[8], path[PATH_MAX]; + char *phy, *p, num[8], link[PATH_MAX], path[PATH_MAX]; + bool usb = false; int i; struct { const char *path; uint16_t *dest; } lookup[] = { @@ -3470,6 +3471,16 @@ static int nl80211_get_hardware_id(const char *ifname, char *buf) /* Try to determine the phy name from the given interface */ phy = nl80211_ifname2phy(ifname); + snprintf(path, sizeof(path), "/sys/class/%s/%s/device/subsystem", + phy ? "ieee80211" : "net", + phy ? phy : ifname); + + if (realpath(path, link)) { + p = strrchr(link, '/'); + if (p) + usb = strcmp(p + 1, "usb") == 0; + } + for (i = 0; i < ARRAY_SIZE(lookup); i++) { snprintf(path, sizeof(path), "/sys/class/%s/%s/device/%s", @@ -3480,14 +3491,16 @@ static int nl80211_get_hardware_id(const char *ifname, char *buf) *lookup[i].dest = strtoul(num, NULL, 16); } - /* Failed to obtain hardware IDs, try FDT */ - if (id->vendor_id == 0 || id->device_id == 0) - if (!nl80211_hardware_id_from_fdt(id, ifname)) - return 0; + if (!usb) { + /* Failed to obtain hardware IDs, try FDT */ + if (id->vendor_id == 0 || id->device_id == 0) + if (!nl80211_hardware_id_from_fdt(id, ifname)) + return 0; - /* Failed to obtain hardware IDs, search board config */ - if (id->vendor_id == 0 || id->device_id == 0) - return iwinfo_hardware_id_from_mtd(id); + /* Failed to obtain hardware IDs, search board config */ + if (id->vendor_id == 0 || id->device_id == 0) + return iwinfo_hardware_id_from_mtd(id); + } return 0; } From patchwork Sun Nov 13 15:11:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Heider X-Patchwork-Id: 1703247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=H3tiYVsF; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=AM3uePGv; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N9GDV64RZz23n1 for ; Mon, 14 Nov 2022 02:13:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type: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:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kEyDAMo46hCUlHx4nUzVxmuvwEMmsiJz+sg5qqqrCGc=; b=H3tiYVsFHqI3ZX 9fl8G1Q6e85vYSVsohBEmzjTUwQgC7kX7mcfr61yorGdZ2bgmf/YgK6ut6Q0xEYiMmLXtmxJZ45uI X8gEH76+PReuW9zgiQUXdPaEOIilzVd8GDYzyVJJXX8CoX0VzIrZHkg/93QX3+oqIcRYGJxirF1h/ Cttc2NpOypOz4/be80brA+LZE5hjgXYlwJj1OSGfUsWvr4EBBSsKxlGK00VTkm1kA1TvdfbkahS1z mUwmO38qsIUyAwCHQtgcYChnNrPpiT2MCRAFZG7yP2+nSgeIDkpNdxzrzSYChey9K1kKMcK5pI7lH gahm1GZqef8ZmldQexRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouEeM-00By89-9h; Sun, 13 Nov 2022 15:11:58 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouEdv-00By2Y-CM for openwrt-devel@lists.openwrt.org; Sun, 13 Nov 2022 15:11:33 +0000 Received: by mail-wm1-x330.google.com with SMTP id j5-20020a05600c410500b003cfa9c0ea76so6077331wmi.3 for ; Sun, 13 Nov 2022 07:11:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0oGm6kjjpCWniXBy6cjxO+nd/2/syQXtV//R4kqWtV8=; b=AM3uePGvErD31dpclwHyy8BVFRtwLxMgVtOlSSPuPW+hH/3Nb2TEUXzgGNo8GMAXmt S2ZBIoL8YtZKmcOQRqoOlJSjElwtBLwbfZz3FDctDsZym3rGXkAoRN1RRgFYBmc0akXh xNk1OjIqFE17DKNpg3iqSwivybOtc3192OViV/xS0iUWqoYHV+mfgfYjjexaDA/RV4Ro cyVNcrm8xP53vYOGodxwcrlFkbIIa8EqX6zOpzA1ssoNROidPUi6HoErFXdIGVYr2jly IYgPY52E1JUJ3thMY/SKloQNyB82ZLMzWKCGHUM4e8So8Vnf0ri8yUjNpsxX3g/t3Z4x gEJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0oGm6kjjpCWniXBy6cjxO+nd/2/syQXtV//R4kqWtV8=; b=vLOR9SntOowyJ5RBHssDlQR5uRJvdcbVTW9JOK9Rv7VqXtgl7DvUnlhkQOJ50m5pH6 HWGJxbu3UaKwpEBt+RNgEv78+P0XQBleyDKs1c5UWt+v7WotjrDAIB5hSXWqZ/KbNeXU xJcBAIuaXWSWGkWCwmpbEqxc5IJVKbJ/AtvkVGSFyn1i3ViYTLKWhFjJo9ujQ9AmkbCb 6pr9bCx+c30se++g8sFfJjWK/RB+bZxadOukGYuLh6rG7zNHj1wQuIBrOBLt5FIcoEaQ MyU7g3HfktFfJBTXco0E/KjnUQZ4P+IopDzVs0c+NKHiIZUodyqK3ZLhjuw+5j4O4PFZ qe5A== X-Gm-Message-State: ANoB5pkdpjcqcSr2pxVsji/2cZ0jOz/ne7EHx6IN4qzHA5NSqLMp90nL 3hwMSdNrjtSx/+B9zRk0aqhQeqG6i08= X-Google-Smtp-Source: AA0mqf5RSxTPN8rV/j5uHcNXXe011D/L0rmrhjUsXrThsMXMlT0taHFKrgmsnKll1BVsopM1OBgeGQ== X-Received: by 2002:a05:600c:4a90:b0:3cf:81cf:c5c8 with SMTP id b16-20020a05600c4a9000b003cf81cfc5c8mr6077522wmp.151.1668352285658; Sun, 13 Nov 2022 07:11:25 -0800 (PST) Received: from mamamia.internal (a89-182-189-22.net-htp.de. [89.182.189.22]) by smtp.gmail.com with ESMTPSA id c2-20020a5d4cc2000000b0023655e51c14sm7020114wrt.32.2022.11.13.07.11.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 07:11:24 -0800 (PST) From: Andre Heider To: openwrt-devel@lists.openwrt.org Subject: [PATCH iwinfo 3/4] iwinfo: nl80211: read usb vendor and product id as subsystem ids Date: Sun, 13 Nov 2022 16:11:19 +0100 Message-Id: <20221113151120.790801-3-a.heider@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221113151120.790801-1-a.heider@gmail.com> References: <20221113151120.790801-1-a.heider@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221113_071131_437964_D4AB45E8 X-CRM114-Status: UNSURE ( 9.08 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: USB devices can now be added to devices.txt as: 0x0000 | 0x0000 | vendor id | product id | ... Signed-off-by: Andre Heider --- devices.txt | 2 ++ iwinfo_nl80211.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) Content analysis details: (-0.2 points, 5.0 required) 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:330 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [a.heider[at]gmail.com] -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 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.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org USB devices can now be added to devices.txt as: 0x0000 | 0x0000 | vendor id | product id | ... Signed-off-by: Andre Heider --- devices.txt | 2 ++ iwinfo_nl80211.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/devices.txt b/devices.txt index b01e4ac..8796276 100644 --- a/devices.txt +++ b/devices.txt @@ -200,3 +200,5 @@ 0x14e4 0xaa52 0x14e4 0xaa52 0 0 "Broadcom" "BCM43602" 0x02d0 0xa9a6 0x0000 0x0000 0 0 "Cypress" "CYW43455" 0x1ae9 0x0310 0x1ae9 0x0000 0 0 "Wilocity" "Wil6210" +# USB devices +# 0x0000 | 0x0000 | vendor id | product id | ... diff --git a/iwinfo_nl80211.c b/iwinfo_nl80211.c index fcc48dd..aa92382 100644 --- a/iwinfo_nl80211.c +++ b/iwinfo_nl80211.c @@ -3463,7 +3463,9 @@ static int nl80211_get_hardware_id(const char *ifname, char *buf) { "vendor", &id->vendor_id }, { "device", &id->device_id }, { "subsystem_vendor", &id->subsystem_vendor_id }, - { "subsystem_device", &id->subsystem_device_id } + { "subsystem_device", &id->subsystem_device_id }, + { "../idVendor", &id->subsystem_vendor_id }, + { "../idProduct", &id->subsystem_device_id }, }; memset(id, 0, sizeof(*id)); From patchwork Sun Nov 13 15:11:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Heider X-Patchwork-Id: 1703246 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=vgEimU0G; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=EuDkuYXp; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4N9GDV6P7Mz23n5 for ; Mon, 14 Nov 2022 02:13:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type: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:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FueeaF0+lSn6/UcQramcYbCge8bPh+FaniLX66EgxdI=; b=vgEimU0Glevj8+ 7UT/FAVQPj+medHGG5wNgR9SNolYSMHluQxl/5PsvrdWgRQuAZSgECW6sUxW7IMXf/2RvwhZAagzG FD2LMp9FezySMsg8zjBaJS41cgxZpY0Sv39loyn96ISZaXPu4XyjjNzSv63CNCr/kE5hRtZGjMmyj 4T+8f/ZK2/qTzC8mTM5KyGr8HCLLxDBhvWyCur/oZT6hvECp4bGYrF2KDY097IG+Uxq7JpSN5OeMY dn65SkJs4a3NBlH6yOgZmVexybCzuDZB9BxEOsc4C/rxIVwGKRUiDEmCJ+GlInyoRU8GD+r5qdTnR BTySfcLp4uuq9t4K/VcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouEe9-00By6C-Ax; Sun, 13 Nov 2022 15:11:45 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouEdv-00By2i-By for openwrt-devel@lists.openwrt.org; Sun, 13 Nov 2022 15:11:32 +0000 Received: by mail-wr1-x436.google.com with SMTP id w14so12970926wru.8 for ; Sun, 13 Nov 2022 07:11:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=wmLlLc/Gtuhkc8L3WI2kVkidlfBcTxn0HN5L8Uwg9C0=; b=EuDkuYXppNXlOr/kLUk5CmhmS3pwNjYmCEhul5Q/wN6mONJ5CztvyFkUz2+ze8vgng fIY9UniNwaQllk+rI0uaJCEtt38OXjayBsSlOWs5fGPEOAsGs0mj/s/vQuR9tI8JEklr ntrONQgNoprzBHe/MDhqD4n9haYT1v4JJlYh7NuP4/50SOrVoX/K/NY2KfBYFpsvSHOW Z3fMormdCDcRyHyfT5o9vXzaN9Z38d1hBa6ESNECdMq5xwTUlRt6ftY03lM4chekF0lb dVLH0qLfby99+oNILTbHX8zeioEN+KukYidtnb5P0mNy1ysLoZtRHrUxoO/wfXvaNGoT o+Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wmLlLc/Gtuhkc8L3WI2kVkidlfBcTxn0HN5L8Uwg9C0=; b=QyNwwazB1GfozcEEWiRKRHjbuHhiAWH1mYvmrl99jSQmgJgTABw4bL2dCvqQlRiZtq KpX3tjfyi4eqKSII39xNtdixDqDjSrcaB6wRvRelpUa7zZjq9DQuPjUI9kChsULQKNCc z8h8/gSjAks1TIJh2MjDiP1CKtema+vyOu8SyDl83RnsVeOFQM7UmNBJWXephG9uT3Oi f33E7sr/sCPflMPEzU1GGNezVKSB0so5QPhQTzr5DjO3zTP9adofUW6JCBUkHe3qXwvg Fi61yfTwfQWlSeFqZshEwvuxuAGdevKerqhojlOTA8T5VPyco9JNNEybuALz77mQREpo I6cw== X-Gm-Message-State: ANoB5pkRhBO849jdvebzj4Bof9eyu53Zky9V1Qv3kpvi6Z6cZCew5kDg J4JATedokYkAhXKRBskr8OjjYEWvyxE= X-Google-Smtp-Source: AA0mqf4afU6WtB+4LRvLAhEOKaib73ylzx5olmTViVs9U0wmUofXN9e/5AZUq5+mMRmkXLsJ56lM7A== X-Received: by 2002:adf:ed48:0:b0:22e:3d3d:2664 with SMTP id u8-20020adfed48000000b0022e3d3d2664mr5514134wro.553.1668352286536; Sun, 13 Nov 2022 07:11:26 -0800 (PST) Received: from mamamia.internal (a89-182-189-22.net-htp.de. [89.182.189.22]) by smtp.gmail.com with ESMTPSA id c2-20020a5d4cc2000000b0023655e51c14sm7020114wrt.32.2022.11.13.07.11.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 07:11:25 -0800 (PST) From: Andre Heider To: openwrt-devel@lists.openwrt.org Subject: [PATCH iwinfo 4/4] devices: add usb device MediaTek MT7921AU Date: Sun, 13 Nov 2022 16:11:20 +0100 Message-Id: <20221113151120.790801-4-a.heider@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221113151120.790801-1-a.heider@gmail.com> References: <20221113151120.790801-1-a.heider@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221113_071131_429521_86E28EA8 X-CRM114-Status: UNSURE ( 6.26 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add USB PID/VID as found on e.g. Comfast CF-953AX. Signed-off-by: Andre Heider --- devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/devices.txt b/devices.txt index 8796276..7674f85 100644 --- a/devices.txt +++ b/devices.txt @@ -202,3 +202,4 @@ 0x1ae9 0x0310 0x1ae9 0x0000 0 0 "Wilocity" "Wil6210" # USB devices # 0x0000 [...] Content analysis details: (-0.2 points, 5.0 required) 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:436 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [a.heider[at]gmail.com] -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 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.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add USB PID/VID as found on e.g. Comfast CF-953AX. Signed-off-by: Andre Heider --- devices.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/devices.txt b/devices.txt index 8796276..7674f85 100644 --- a/devices.txt +++ b/devices.txt @@ -202,3 +202,4 @@ 0x1ae9 0x0310 0x1ae9 0x0000 0 0 "Wilocity" "Wil6210" # USB devices # 0x0000 | 0x0000 | vendor id | product id | ... +0x0000 0x0000 0x0e8d 0x7961 0 0 "MediaTek" "MT7921AU"