From patchwork Tue Aug 9 18:48:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12939856 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DB1D33C4 for ; Tue, 9 Aug 2022 18:48:10 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id q9-20020a17090a2dc900b001f58bcaca95so11719904pjm.3 for ; Tue, 09 Aug 2022 11:48:10 -0700 (PDT) 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:cc :to:from:from:to:cc; bh=kYN+Bt6ubs5UZ8VJ7OI/SJmuCj8HLQ/+k/GoGL/o8Ho=; b=L6RwZ3KYwVzIYXH+XtIO41Zj+ommRNpIWreDE+LOCb8Te4s8pQcjGcRjzUfje9ruYN iX5dWBK6VT46+xWkSOsSIb2DaFyxU466JX3sDGcztwL+8wc+vQ/113NzdjrR+yL2qNf+ eHtnNtmhYdHuRdnKcCGO+mtD4oTVUlcckzKu91Wx8U8Rftt3Vb0eRL3NphgYOv2qxZ0B kcV/LnLr5OxyVGyIoVd3Nk83cxbiO7Sq+p/pzhQTqvHRTE0AyeBvdYAduwgMSm2bRQXY gsEL72wr0xXPhl4o2+Zw35xMwp9HEQU8iXmCgnjjOnQ6tQ5rwTWrAIi46pnebnGIpvSd dLJg== 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:cc :to:from:x-gm-message-state:from:to:cc; bh=kYN+Bt6ubs5UZ8VJ7OI/SJmuCj8HLQ/+k/GoGL/o8Ho=; b=i9+ZPBqXhyOwFEvWn2ekA+61/b3lzPB6SUEuLLprEZCOBXcKaPLgfbsFQjfCxzUvkY yVwVE/aFb1jUssNIwryEAqV9WTEvjcTONsGTcnJB7uKcHV5hoyvFHLnFGKhH7is0Vt51 rzEoig3zNayd+r9F2xJM1K1vA+s0TGRTISwl2U84dcQ1ajne4GMEU3dQeNg3JQ6Cvoz0 tRlhSYbMV8FaGycXWUX+pH36fipB6yWTxoUtgVk4fB8v3VHg64+14+aLoR00s9c5E/zh l947Kp46La3V04oQ7xCe3VP9yxi+tPFxqUc5RO5PISu05VE+vThBzPsGn0Vyr5OOVrgN nbxQ== X-Gm-Message-State: ACgBeo1xx1xnLGTAo7zkI8M0+yJbwm/9qF+mlYfqPS4Fi0dDh7dvekmU 5GstHWzfIKDFbV19GU6QRBK7EVOUeYs= X-Google-Smtp-Source: AA6agR6ERo2MrFsp2J4yNrpZ52aaVpYDt8+MeKOLpFwcJKKg4kadp1vcOysIjjzL9LfAJeDVIkG5RA== X-Received: by 2002:a17:902:ec8f:b0:16e:d8d8:c317 with SMTP id x15-20020a170902ec8f00b0016ed8d8c317mr24215482plg.12.1660070889435; Tue, 09 Aug 2022 11:48:09 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id x15-20020a170902ec8f00b0016a0bf0ce32sm11403157plg.70.2022.08.09.11.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 11:48:09 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 1/4] monitor: parse RNR element Date: Tue, 9 Aug 2022 11:48:04 -0700 Message-Id: <20220809184807.147780-1-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- monitor/nlmon.c | 117 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 34c5eed6..54aaa465 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -2278,6 +2278,121 @@ static void print_rsnx(unsigned int level, const char *label, print_attr(level + 1, "SAE Hash-to-Element"); } +static void print_bss_parameters(unsigned int level, uint8_t parameters) +{ + print_attr(level, "BSS Parameters"); + + if (test_bit(¶meters, 0)) + print_attr(level + 1, "OCT Recommended"); + + if (test_bit(¶meters, 1)) + print_attr(level + 1, "Same SSID"); + + if (test_bit(¶meters, 2)) + print_attr(level + 1, "Multiple BSSID"); + + if (test_bit(¶meters, 3)) + print_attr(level + 1, "Transmitted BSSID"); + + if (test_bit(¶meters, 4)) + print_attr(level + 1, "2.4/5GHz Co-Located ESS member"); + + if (test_bit(¶meters, 5)) + print_attr(level + 1, "Unsolicited Probe Responses Active"); + + if (test_bit(¶meters, 6)) + print_attr(level + 1, "Co-Located AP"); +} + +static void print_reduced_neighbor_report(unsigned int level, const char *label, + const void *data, uint16_t size) +{ + const uint8_t *ptr = data; + unsigned int field_count = 0; + + print_attr(level, "%s", label); + + if (size < 5) { + print_attr(level + 1, "error parsing"); + return; + } + + level++; + + while (ptr < (uint8_t *)data + size) { + uint16_t hdr = l_get_le16(ptr); + uint8_t oper = l_get_u8(ptr + 2); + uint8_t chan = l_get_u8(ptr + 3); + uint8_t count = bit_field((uint8_t)(hdr & 0xff), 4, 4); + uint8_t type = bit_field((uint8_t)(hdr & 0xff), 0, 2); + uint8_t filtered = test_bit(&hdr, 2); + uint8_t info_size = (hdr & 0xff00) >> 8; + uint8_t i; + + ptr += 4; + + print_attr(level, "Field #%u", field_count); + + /* TBTT Information Header */ + print_attr(level + 1, "Info Field Type: %u", type); + print_attr(level + 1, "Filtered Neighbor AP: %u", filtered); + print_attr(level + 1, "Information Count: %u", count); + print_attr(level + 1, "Information Length: %u", info_size); + + print_attr(level + 1, "Operating Class: %u", oper); + print_attr(level + 1, "Channel: %u", chan); + + level++; + + /* Information Set(s) */ + for (i = 0; i <= count; i++) { + const uint8_t *info = ptr; + + if (info + info_size > (uint8_t *)data + size || + info_size == 0 || info_size == 3 || + info_size == 4 || info_size == 10) { + print_attr(level + 1, "error parsing"); + return; + } + + print_attr(level, "Information Set #%u", i); + + if (info_size >= 1) + print_attr(level + 1, + "Neighbor TBTT Offset: %u TU's", + l_get_u8(info++)); + + if (info_size >= 7) { + print_attr(level + 1, "BSSID: "MAC, + MAC_STR(info)); + info += 6; + } + + if (info_size == 5 || info_size == 6 || + info_size >= 11) { + print_attr(level + 1, "Short SSID: %08x", + l_get_u32(info)); + info += 4; + } + + if (info_size == 2 || info_size == 6 || + info_size == 8 || info_size == 9 || + info_size >= 12) + print_bss_parameters(level + 1, *info++); + + if (info_size == 9 || info_size >= 13) + print_attr(level + 1, "20 MHz PSD: %d", + (int8_t)*info++); + + ptr += info_size; + } + + level--; + + field_count++; + } +} + static struct attr_entry ie_entry[] = { { IE_TYPE_SSID, "SSID", ATTR_CUSTOM, { .function = print_ie_ssid } }, @@ -2340,6 +2455,8 @@ static struct attr_entry ie_entry[] = { ATTR_CUSTOM, { .function = print_fast_bss_transition } }, { IE_TYPE_MOBILITY_DOMAIN, "Mobility Domain", ATTR_CUSTOM, { .function = print_mobility_domain } }, + { IE_TYPE_REDUCED_NEIGHBOR_REPORT, "Reduced Neighbor Report", + ATTR_CUSTOM, { .function = print_reduced_neighbor_report } }, { IE_TYPE_RSNX, "RSNX", ATTR_CUSTOM, { .function = print_rsnx } }, { }, From patchwork Tue Aug 9 18:48:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12939857 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DBF4468E for ; Tue, 9 Aug 2022 18:48:10 +0000 (UTC) Received: by mail-pj1-f43.google.com with SMTP id q7-20020a17090a7a8700b001f300db8677so13042327pjf.5 for ; Tue, 09 Aug 2022 11:48:10 -0700 (PDT) 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:cc:to:from:from:to:cc; bh=IPu+zk/t4fWWnok/PJoKTmzBeUVbEvPoKTaQGz6oXnw=; b=Z8+24CtGxzdv0mXgwHHOPqD1t93tjtDTYohnuWTY1AO+OQHnGzNLtQtVGGgXBF6q51 vUghkepeCY/yPStXGC8UccB9/Ru9xLQf8EIlKB+YaoKhA9wSHEJyk2gLq7bt+meXDV4p 427sdeFq4RZA9d2t8q4tsIPbAhvUn2gl06vzmR4/Y6UWI3kYgTuqztpMfuo/IuBrEhaM T0T/Je61euz0AcmQWgU+YWlAM9SaKzUgoxW4r0rpS8fRv3/yEDZSEjnerZTPXau++rKa xMdYu4g6Ry8qENjduQSg7F+6ta1G1P0rt3rrUVhcQm8Se2OT1389fo4cv3WZkTQV5s3Q NzLw== 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:cc:to:from:x-gm-message-state:from:to:cc; bh=IPu+zk/t4fWWnok/PJoKTmzBeUVbEvPoKTaQGz6oXnw=; b=boGoo9hKLlFQJcGSkrj9RhCJc1F3KMzRSL+gInXqT5UW8dQvwquy2DVHHizTDXyaPm +jNsGxxd0HqKn/LRdPnxDwdmLK0dyDC3hZdZbYTzfkLJYy+ljW1G9SKZ92rkkYFXoMjI G7y/8gQ6yO2T51PyJEm+UWconvY3dDuwzoIQ85b1pyaFDP26xYtNybB+B2hk8lR3C20T iiM6it6mdfuIYf5TaEiovADDXmRscsCGiyAUhZpIzKt4K+KdG3DOdVbOHG08hAe/XdXA KK6sFr8XPkr0FkHOZQMZK2qJ4w2zhwH4JZylT7w7vSI9a8oTuj9AWNdDeJOPsKa/p/EA FUJw== X-Gm-Message-State: ACgBeo2IwoaM7WDlRtAoY5FK7sp4qwq7A64ONq43+xSRuzt7yr4+JBU7 G1qy09PrFv2BSMojSNYykc9G3ooEEyI= X-Google-Smtp-Source: AA6agR7Q09xqThHmC3ak2epXVjYfmkSoLjNWrFyUkZeBjqLNP9uXiOkXHZnUDSRsj+EcYL7QpJ3Sjg== X-Received: by 2002:a17:902:bc49:b0:16d:ac99:f96f with SMTP id t9-20020a170902bc4900b0016dac99f96fmr24473025plz.130.1660070889901; Tue, 09 Aug 2022 11:48:09 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id x15-20020a170902ec8f00b0016a0bf0ce32sm11403157plg.70.2022.08.09.11.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 11:48:09 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 2/4] monitor: add more array type support Date: Tue, 9 Aug 2022 11:48:05 -0700 Message-Id: <20220809184807.147780-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220809184807.147780-1-prestwoj@gmail.com> References: <20220809184807.147780-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The ATTR_ARRAY type was quite limited, only supporting u16/u32 and addresses. This moves 'array_type' out of the union in attr_entry which allows nested/function to be supplied along with array_type. This poses an issue with defining const entries unless array_type is moved *after* the union. Otherwise nearly every single definition would require setting array_type to zero in the const definition. Instead array_type will come after the union, and the few definitions which use ATTR_ARRAY have been updated to fix the compile errors. --- monitor/nlmon.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 54aaa465..cb1097fa 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -139,11 +139,13 @@ struct attr_entry { uint16_t attr; const char *str; enum attr_type type; + union { const struct attr_entry *nested; - enum attr_type array_type; attr_func_t function; }; + + enum attr_type array_type; }; static void print_attributes(int indent, const struct attr_entry *table, @@ -6230,11 +6232,9 @@ static const struct attr_entry attr_table[] = { { NL80211_ATTR_MAX_NUM_SCAN_SSIDS, "Max Number Scan SSIDs", ATTR_U8 }, { NL80211_ATTR_SCAN_FREQUENCIES, - "Scan Frequencies", ATTR_ARRAY, - { .array_type = ATTR_U32 } }, + "Scan Frequencies", ATTR_ARRAY, {}, ATTR_U32 }, { NL80211_ATTR_SCAN_SSIDS, - "Scan SSIDs", ATTR_ARRAY, - { .array_type = ATTR_BINARY } }, + "Scan SSIDs", ATTR_ARRAY, {}, ATTR_BINARY }, { NL80211_ATTR_GENERATION, "Generation", ATTR_U32 }, { NL80211_ATTR_BSS, @@ -6488,8 +6488,7 @@ static const struct attr_entry attr_table[] = { { NL80211_ATTR_ACL_POLICY, "ACL Policy", ATTR_U32 }, { NL80211_ATTR_MAC_ADDRS, - "MAC Addresses", ATTR_ARRAY, - { .array_type = ATTR_ADDRESS } }, + "MAC Addresses", ATTR_ARRAY, {}, ATTR_ADDRESS }, { NL80211_ATTR_MAC_ACL_MAX, "MAC ACL Max" }, { NL80211_ATTR_RADAR_EVENT, @@ -6691,6 +6690,7 @@ static void print_value(int indent, const char *label, enum attr_type type, } static void print_array(int indent, enum attr_type type, + const struct attr_entry *entry, const void *buf, uint32_t len) { const struct nlattr *nla; @@ -6700,8 +6700,22 @@ static void print_array(int indent, enum attr_type type, char str[8]; snprintf(str, sizeof(str), "%u", nla_type); - print_value(indent, str, type, + + switch (type) { + case ATTR_NESTED: + if (entry->nested) + print_attributes(indent + 1, entry->nested, + NLA_DATA(nla), NLA_PAYLOAD(nla)); + else + printf("missing nested table\n"); + break; + default: + print_value(indent, str, type, NLA_DATA(nla), NLA_PAYLOAD(nla)); + break; + } + + } } @@ -6832,7 +6846,7 @@ static void print_attributes(int indent, const struct attr_entry *table, NLA_PAYLOAD(nla)); if (array_type == ATTR_UNSPEC) printf("missing type\n"); - print_array(indent + 1, array_type, + print_array(indent + 1, array_type, &table[i], NLA_DATA(nla), NLA_PAYLOAD(nla)); break; case ATTR_FLAG_OR_U16: From patchwork Tue Aug 9 18:48:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12939859 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 252C74692 for ; Tue, 9 Aug 2022 18:48:11 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id t22-20020a17090a449600b001f617f2bf3eso1968686pjg.0 for ; Tue, 09 Aug 2022 11:48:11 -0700 (PDT) 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:cc:to:from:from:to:cc; bh=S83bHbQkbEyob9gsd/CcdExvFxSxfKJvdCDiIWCzmPE=; b=enPf3C3QFRMAJpIodTHmYhBX5lalksFeEBpBbay9ORRiP3Meq52uku+GuFvRGVvQyI BeNwcdH/PqxzISHdBYeO5Hp9+FwxGKEi1u9jEetZ23BVyY3FwVn+fUs7s+xS6OsPQc6v VaSeIN0V7AyWyzfsNIVTYogbIJthbzpsmvinwTxjhmGONs6aZuw+kNou2YWlLGgZpv7S zqQT7pGlBwD9zM2RGDiGBLoqtMsJMrabMPmKtVDi5n1qSsL/VZPXtQfwB936M0CHZxmm frs3tc1HX4tftYSh1IJBuikiKEnUOzv5BmjAu5RezvsrZHnl0IO3M+i7eKlSafmjmR5t H6Kg== 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:cc:to:from:x-gm-message-state:from:to:cc; bh=S83bHbQkbEyob9gsd/CcdExvFxSxfKJvdCDiIWCzmPE=; b=8GrNA3Qvw/zrfL/wfw1JMzTgFtie4DvO82AFholu8dorx+KWzZeXDXE/YbrBMbChTn 9JqOewoctr8qDxIJ0VwxTr6zEz2VjmvUAW29evcK4lyXhT4B3PFzxwUA8tP9Ev6bBPGd kcl86eoKSWswnguGosg96dOOa23apkFJWBoreonwH+hqwnZlp0i0JDlF3SPXjgc4P2Cf mvbAbanYtHXHx2QpKHYmii++cfDPBTi77erbxcHygbiE6wcTsOiA/4NT7NfEndeMGrv8 rOkEHZSxcEdWgtZOlE8YD52eztLI9x0RshD0gSLtkeQF7AuBqHTQH32jrTu2rcc4soz7 azNA== X-Gm-Message-State: ACgBeo290Oy8IQu7AggeN1SO5i176R96wE/CUX/08aTHfci2e8MdbGDZ DC+Jdy5fKvgNzhdZl867aVh9oq2aHDc= X-Google-Smtp-Source: AA6agR46OZC5nQl2aDBSIIeHZ5YYsrDh9gt8Q5zRj1a7O+vKziewsuV4kDdh0qmtv+lI+1Oyw2oN2w== X-Received: by 2002:a17:903:1c5:b0:16e:e892:fa14 with SMTP id e5-20020a17090301c500b0016ee892fa14mr23897680plh.158.1660070890340; Tue, 09 Aug 2022 11:48:10 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id x15-20020a170902ec8f00b0016a0bf0ce32sm11403157plg.70.2022.08.09.11.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 11:48:10 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 3/4] monitor: print out type of unknown element Date: Tue, 9 Aug 2022 11:48:06 -0700 Message-Id: <20220809184807.147780-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220809184807.147780-1-prestwoj@gmail.com> References: <20220809184807.147780-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This changes the string from "Reserved" to "Unknown" which feels more fitting, and also prints out the NL type of the unknown element. --- monitor/nlmon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index cb1097fa..d7327abb 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -6741,7 +6741,7 @@ static void print_attributes(int indent, const struct attr_entry *table, int64_t val_s64; uint8_t *ptr; - str = "Reserved"; + str = "Unknown"; type = ATTR_UNSPEC; array_type = ATTR_UNSPEC; nested = NULL; @@ -6761,7 +6761,7 @@ static void print_attributes(int indent, const struct attr_entry *table, switch (type) { case ATTR_UNSPEC: - print_attr(indent, "%s: len %u", str, + print_attr(indent, "%s: %u len %u", str, nla_type, NLA_PAYLOAD(nla)); print_hexdump(indent + 1, NLA_DATA(nla), NLA_PAYLOAD(nla)); From patchwork Tue Aug 9 18:48:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12939858 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9023C4693 for ; Tue, 9 Aug 2022 18:48:11 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id 15-20020a17090a098f00b001f305b453feso18524260pjo.1 for ; Tue, 09 Aug 2022 11:48:11 -0700 (PDT) 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:cc:to:from:from:to:cc; bh=DQ9SFN96wr9VZA9gLupqLHzJJW2TZ7neyOqY6kogg24=; b=JdsVkX1rOFpRzy50vKBsBlh4zN1FIHGZef1jvRHUZJUJai8PGXCPGx9QbbqqU2ADxr yVQNAehCAzOYRra2aWRjy63n9BS5BM4rfeVMweYJQSm8Xd7EO+ezChxOisM1xGZsRUmC DUtn7Kb315pUtB1o05uoX9MHhtIp+7YCXxLSHWFc/Y7/Y/CqUOePNIweADhuckRE7AU0 jdhflaReZU+hj4MT5tgz21be7vQviY8fzxYe5l7OraSLVINcXktEJufrN++/nUvwZWYW HP4ZtxXXPwcUPexi8A8EE9oM180XKnlbcpgumyVGVMUr1LRoy+lCmykU/PSWwE279awS u3Ew== 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:cc:to:from:x-gm-message-state:from:to:cc; bh=DQ9SFN96wr9VZA9gLupqLHzJJW2TZ7neyOqY6kogg24=; b=HrjS2KNB0xgVsrSxM9XGGrFdBsUhrSonjYkZH/138yXWi2oermc8Pgi7OPp1rva+NB 1u9T6PomvDXhf04vqxNmNXkJITkc3Vp/wvtVLrLjazOPZ8O6eiTnelf2M26vdoIyzQot aRUh1WMVDNW6c2gMVCbZIerJ7kQ7yj3V6VXEvmOteNzgPLg8ZzSi2OiaXhFPhWVRckAU cNgFoWrm68i0atjS7MuNrNs7Hi/kvL6iklyHhSQytl0KcSNj1mW4DaaL8jIXx7myvM9e 5VgeQA3KfyGlmVRcXnNo2HJPxXWTL+H7CsUWdtRzBindl+gRye9YMcC84IXQOeijXtIX GCkg== X-Gm-Message-State: ACgBeo0+GoCm/j6bA52bMqKZOHBG9/8rQqR58zWrYThgvS3BvZveDnEz QOlRiGO9hGq0gEGLqx5rqUFagl9074o= X-Google-Smtp-Source: AA6agR4gwWU8TOe8gSkU5P4PYULGGgWjVVYPbdU0jL84Z1gkZHIXNAFPacFX+ysJq+6ECw4Vy7JcwA== X-Received: by 2002:a17:902:8683:b0:171:3114:7678 with SMTP id g3-20020a170902868300b0017131147678mr1115748plo.172.1660070890801; Tue, 09 Aug 2022 11:48:10 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id x15-20020a170902ec8f00b0016a0bf0ce32sm11403157plg.70.2022.08.09.11.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 11:48:10 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 4/4] monitor: add support for HE element Date: Tue, 9 Aug 2022 11:48:07 -0700 Message-Id: <20220809184807.147780-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220809184807.147780-1-prestwoj@gmail.com> References: <20220809184807.147780-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Support for the HE IE. --- monitor/nlmon.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index d7327abb..2a68d0dc 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -5540,6 +5540,24 @@ static void print_band_rates(unsigned int level, const char *label, } } +static const struct attr_entry iftype_data_table[] = { + { NL80211_BAND_IFTYPE_ATTR_IFTYPES, "Interface Types", ATTR_NESTED, + { iftype_table } }, + { NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC, "HE MAC Capabilities", + ATTR_BINARY }, + { NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY, "HE PHY Capabilities", + ATTR_BINARY }, + { NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET, "HE NSS/MCS Set", + ATTR_BINARY }, + { NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE, "HE PPE Thresholds", + ATTR_BINARY }, + { NL80211_BAND_IFTYPE_ATTR_MAX, "Highest band HE capability attribute", + ATTR_BINARY }, + { NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA, "HE 6GHz band capabilities", + ATTR_BINARY }, + { } +}; + static const struct attr_entry wiphy_bands_table[] = { { NL80211_BAND_ATTR_FREQS, "Frequencies", ATTR_CUSTOM, { .function = print_band_frequencies } }, @@ -5553,6 +5571,8 @@ static const struct attr_entry wiphy_bands_table[] = { { NL80211_BAND_ATTR_HT_AMPDU_DENSITY, "AMPDU Density" }, { NL80211_BAND_ATTR_VHT_MCS_SET, "VHT MCS Set" }, { NL80211_BAND_ATTR_VHT_CAPA, "VHT Capabilities" }, + { NL80211_BAND_ATTR_IFTYPE_DATA, "Interface Type Data", + ATTR_ARRAY, { iftype_data_table }, ATTR_NESTED }, { } };