From patchwork Tue Aug 9 21:04:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12939922 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 BD3A54403 for ; Tue, 9 Aug 2022 21:04:51 +0000 (UTC) Received: by mail-pf1-f171.google.com with SMTP id d20so11887356pfq.5 for ; Tue, 09 Aug 2022 14:04:51 -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=UgJaC/YttuSpx7IuYowEUG/NEl6A/kP6uLCshpV5D7Fx/+xwP0ri+F2SNOQGCPTWth i0/BIsMHsoqPGhjgGrg9ObeMiKo6MONGhul2wol8aRYfc5O3SS5IJPGwEU7hYU3fv5/M nPxMzPMMRyDW/Ox5kLU6I0sufFK/Nkrylm/7YiYHnzWa2/VfEMjhsvaztdcdc5mqfch3 ss8MH2B1GFNwW4TV+pBlhDAGfu+tbwZdyW8ny99K4cXPsvKci8CTVABLJt+74iQjJJLW GHlpYAjIF7vHDaTBKxG73yFVcIlFOaYHmce7a4DiZON1CJHFqVj2Eb0zRQDCVcx/+IFt Xkhg== 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=ThVhjT4fHXdYUfLKBCrUQmNuzJ1W7TBVnVqJWwu4oX8B7kzjDKrdfI4aXW2+hNfnqI NNzYy+XPwI9Yx4N4ME8NX883PStuH844uDf0pwAqHflnsvQqraF7+MBs0Ttox1+H5LLa QpuumTgLDowaRxlzIAd4k2fp7oeZkWdbCsUYtQywkpZiUX+83awmnbhVCty4Phc3OPy7 B1vfcrUQgOxLUW2qOYkGN9AY4FvC9IlwhOZrE762dEquOtk+SPBfjvQMrEO+g0kb4A8m e1IhwYK8KT30SqqUHGaP1DBh1qoCAbDlv/tk1pL6hYbApMd9pktmsZ3mObmUyzGIndRS xQAg== X-Gm-Message-State: ACgBeo0ifTGjtwmeEj8nXYpcPGqP1hY5dsYE+iz51zsXDhx6HzZHVqmJ QKz4B1dOT71LqDbpZWSNqdSEpBMsFeU= X-Google-Smtp-Source: AA6agR4va5a/mGqWp8ASWahGX84GDSIO4A8Za1T7Xr9dIXgEMgDtkUGI3tTWB/42cAA8nwewQHK2AQ== X-Received: by 2002:a05:6a00:aca:b0:52b:bd66:8c94 with SMTP id c10-20020a056a000aca00b0052bbd668c94mr24643495pfl.3.1660079090828; Tue, 09 Aug 2022 14:04:50 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id w8-20020a170902904800b0016d23e941f2sm11161706plz.258.2022.08.09.14.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 14:04:50 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 1/4] monitor: parse RNR element Date: Tue, 9 Aug 2022 14:04:46 -0700 Message-Id: <20220809210449.158256-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 21:04:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12939923 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (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 03E6546AD for ; Tue, 9 Aug 2022 21:04:51 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id gj1so12904672pjb.0 for ; Tue, 09 Aug 2022 14:04:51 -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=5xdUDQux1ToIRpEEPJyVULPdiiwTo+90TFcCy4/Zrzo=; b=UJGOz+5QR1xzwucT4iNV0DKoJbP1EAboFlvWfjV8i7TRg/z2dOXUcTubb2F1Irdw7b 4qNE0/HY+OCwOVp5stl808q+q09+ByMm55mD8Msxl/UeQbna4SXvr/7FDh2XYtKi08ce heNrqcNY3e9Zsf5FPN3iKG9yW00RE/ytdh4d1zdcEAobrnVOFSJeqBCI7qy1s9TzKOF6 vWadn0d6BfmXKcPElmi5MxDCoPEaeNeSHRQNkZt8yv1e45iMK89F/6me92sAE+1TAW/0 q9f621209LgpFCeJyIDVIv5Iviu24GBo/qdM2xo700N4Tyoy19FnCB3WVH+/u2tAcdmY VWbQ== 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=5xdUDQux1ToIRpEEPJyVULPdiiwTo+90TFcCy4/Zrzo=; b=6yAZYklB7LLmTQmPUy47aoWU8RvepPMTJkDPgoScerePiJj3XcuNg+MJU4G/1Xv21N 92cN1yC+cq8eN7hFdb0JqN16fMQDLYSUNzxoB1Q54/qFKOTpL5tscYoNmdlkkqlzp15i K8oq3tkdJSLxmVqhrzlUs0z8gB+1rxkpO1znch3paQuEMvU1d4PCYuXPVpSj6NzSXono Zoqh3/Ly1+dIHKv6dhhuhcH07m4i/tv8L9RC+RSbTvlzkadvvmpb6fYmZ1Utex2LgNty shCyWYKPtUg0CpRatAcrEomlkcoIa+Yb9tliIk0oabmUwpBdxHHLlCeHcwPU+GMSqYEu lobA== X-Gm-Message-State: ACgBeo3A/T8//4mrkVFqmWl544Evks8OpWgGQl+HGgiHXqb6ictd+iko 1i+hVSqEMFJDwkBbXaQZaj3RSnNs/iI= X-Google-Smtp-Source: AA6agR4YsuT55lyC73IpP19H6X97X6ZKCXXNNZyy5zq9hbjHi+tGvG7+Xc32eirTa7rYIL3tFJGeIA== X-Received: by 2002:a17:90b:149:b0:1f7:59cd:9847 with SMTP id em9-20020a17090b014900b001f759cd9847mr373447pjb.78.1660079091279; Tue, 09 Aug 2022 14:04:51 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id w8-20020a170902904800b0016d23e941f2sm11161706plz.258.2022.08.09.14.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 14:04:51 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 2/4] monitor: add better array type support Date: Tue, 9 Aug 2022 14:04:47 -0700 Message-Id: <20220809210449.158256-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220809210449.158256-1-prestwoj@gmail.com> References: <20220809210449.158256-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 changes the union to a struct so nested/function can be defined along with array_type. --- monitor/nlmon.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 54aaa465..8b70b055 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -139,7 +139,8 @@ struct attr_entry { uint16_t attr; const char *str; enum attr_type type; - union { + + struct { const struct attr_entry *nested; enum attr_type array_type; attr_func_t function; @@ -6691,6 +6692,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 +6702,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 +6848,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 21:04:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12939924 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (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 9EA6146AF for ; Tue, 9 Aug 2022 21:04:52 +0000 (UTC) Received: by mail-pg1-f172.google.com with SMTP id d7so12436518pgc.13 for ; Tue, 09 Aug 2022 14:04:52 -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=kt1auLOcChLYta0iCDcf2PqGmYR6wkIamB/sFjXtv6s=; b=lgCABbYxcBPl4HDFBXzgR8Pf5foBuFAuFOYD3RNKyvtfifT2vBVi27YNvOU5BWlPk5 z/ZzB3ZGGTc3rKVnadVhBTh/blCnKzR8dcdKvccE9rRxallxHJA5xpg1P1YjDWo2rzjw xzUB7qCz3vX9F5FWW/yQkIB6EXUJQvLwXJfQavi6lXlOKO1ctjwCexaoIcY8iwYwlPtL Z+gURTImMNfxOdgib3rviuOrFSrL7NeKtTIKSYCDydKuuOZzCsMGU8dV1m/VrWyHDPor eMfRfQHYwheugUtIxlJoYqWdpzN+iaqBsasruOMha8gxBO0sfE+pso9ypXWS8f/iPhdE WJNg== 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=kt1auLOcChLYta0iCDcf2PqGmYR6wkIamB/sFjXtv6s=; b=whCSruX2LEBeR8UB19ryyOf4l8oWRYUXAqKkxjWZhuNZVC0aAdjSzIdCJeYHK2yNEj qlwinDxu/I4FXu8t0UJnzOANJaeUaM0GNmW2oy3GXtS9d1YjViVz6h5MyAoKWowdmwox GyzSucMX0wlvVTbCE7w8SRbH+Umx/snRZAbBVVUduHGdvD2CEaK8wa96hHHxxHfDZE/d UlbAC5oZaNg2fOh/Sw0ZHtfTXmnZRzhO773hF0Syb7k6r0A0fn08vLgx0MQ0Pf8rx0r7 iLpbeIhHzyWYmeosVW8O1qKmK8n7zHL3Muo3wnN/DlkxSg6Yky2kpZP0KYZZ4fmW/NQN AB+Q== X-Gm-Message-State: ACgBeo1L6pf4mZEaKsX3VhyPREOiYMNticjyDz2kxsCpWHPFeDpZ1fRp TaUECPAYJ2yKQwRuC1dLxVyIsMULfjE= X-Google-Smtp-Source: AA6agR7Lz7+ErnK+D8ZJSpgnj0HUAkxbtrqqQFuTenCJfxGS7A/b1HN3xoOpTFQzEpktDeXQ1uaNhQ== X-Received: by 2002:aa7:8d94:0:b0:52b:a70e:ae89 with SMTP id i20-20020aa78d94000000b0052ba70eae89mr24586588pfr.23.1660079091941; Tue, 09 Aug 2022 14:04:51 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id w8-20020a170902904800b0016d23e941f2sm11161706plz.258.2022.08.09.14.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 14:04:51 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 3/4] monitor: print out type of unknown element Date: Tue, 9 Aug 2022 14:04:48 -0700 Message-Id: <20220809210449.158256-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220809210449.158256-1-prestwoj@gmail.com> References: <20220809210449.158256-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 8b70b055..e880ca1e 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -6743,7 +6743,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; @@ -6763,7 +6763,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 21:04:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12939925 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 49A594403 for ; Tue, 9 Aug 2022 21:04:53 +0000 (UTC) Received: by mail-pl1-f176.google.com with SMTP id o3so12460039ple.5 for ; Tue, 09 Aug 2022 14:04:53 -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=4Vb/9MaiYA8Jj7ZuBhIlEdlToU6LSNTvQjfje/tpvQY=; b=fvV+c51XLSptNCgzXED3e4CH7MYJfxNXzfHT9PFnwXbx3DbkpbcoZlxlmG7RZt/uo0 YroP2Tkn2vCnBtljvfjAwSW+Pv5evOwgJjVvx0FKZ0kpps6ROf4A3IzUgjo4goULEjjc KR4HvGuzo80MAuPA7X8UriTDc4Z01CLDAr1DBrY3myLQ6u90r3jyuPF5j8KetZDsDIo2 uQzCTmI+zyS79iQ1oOFneBR6a0bw3PmJYgAoX8u3kcojW01autxDy23i9b6xL9RRDWzL cLn7k75WVBOIVWVUEcxcPiscizIAkytYjkMFkeQyTqwb/gLEYTEQQsH9wSdZUergYwWe 1okw== 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=4Vb/9MaiYA8Jj7ZuBhIlEdlToU6LSNTvQjfje/tpvQY=; b=5EIADO/tHoI8ThozruFY/ak2pvEFqBNCK/f3rwwD/3xhMdB3T5anhy75zZoiYViJJP Uv6hSx0UHwOopqzkH3S+txvhRKqP3fGKh21TnBqzQEceuj9kX30lkqt0Vmvbuam7t6Fd YmCjD6rLAuIPzgQoGs596NY5mzYYvIaMK2+BTHdWZAbHRP2ACBlzv6cjrX2r0ld1eKPa vnYRdOe7MQhMfSajH3Js3L8GbYVytrjkQyiPkQn4PH7ihaL+6lkkC9xhpHsgqnl1mHCy /idrcpVne2tCTLoGpNISbnG5jmheWvGNog7RWQZWnCNdDQ+VSDysQpyXlD1Z9oldbazU x2Uw== X-Gm-Message-State: ACgBeo2GYAYEqMYQW2Bow3icMIsraOYZh4lEg/kIhp+O95vVEWmAyLXF UmGmqThVO0djB2BfIp/WBjRcYgVgmu4= X-Google-Smtp-Source: AA6agR7lTjYScgupoehRUpF9wUSXbEe7AVdukhX38+gcb2i+whX+S0auyT005I6hQ9LiGOw0gE3J/g== X-Received: by 2002:a17:902:b684:b0:16e:e4b1:631c with SMTP id c4-20020a170902b68400b0016ee4b1631cmr24984723pls.88.1660079092602; Tue, 09 Aug 2022 14:04:52 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id w8-20020a170902904800b0016d23e941f2sm11161706plz.258.2022.08.09.14.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 14:04:52 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 4/4] monitor: add support for HE element Date: Tue, 9 Aug 2022 14:04:49 -0700 Message-Id: <20220809210449.158256-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220809210449.158256-1-prestwoj@gmail.com> References: <20220809210449.158256-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 e880ca1e..4210c46e 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -5539,6 +5539,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 } }, @@ -5552,6 +5570,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 } }, { } };