Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5195750ybl; Wed, 22 Jan 2020 12:07:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwxLp3qq7VmXZ49i/UqhDDfHZLT0aSXYxUYgIsKS9m3JN8+rJJf7x16SjSYM3qwLAmtEJ3j X-Received: by 2002:a9d:7305:: with SMTP id e5mr8429092otk.64.1579723626988; Wed, 22 Jan 2020 12:07:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579723626; cv=none; d=google.com; s=arc-20160816; b=wG0vDBgtw2pd6HtlrsDtLhBswBUcmZwPgyME+xtZ30DeXCACqEN0aPs06Hu7PyqS8J i40zSIIZO6iYaP/C+DCFAh6ELFpSR67beg+W1keC00wDUea/lsIb0S1YitFZsSaYDs31 91Ui9S0YwHzwlZ+ZQ+HDHMp8zA3ksEVgDrtKeS+udKhkzO6HhmYPXk1vd8aYCsVl0xyn AMPIVv3GqdeJOGoB3gO55LSQ/QkbpEj7epW10dp6CjSb1pjGcf6yec0Wr8jMXmXqCmN8 XpoAxBfNZ9aXkCkz/WBw2sam32DNIYBd3ICS+7RzPeqVipJdEYcWGMTtEB8LBZBJZP+1 u5Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=sHjo9u58EvWMvzmDRXFrAyHZK7ftXTL4C4l8MwTL6so=; b=OenPzmULK/Ng83J8sDFKZFlKG8klKkCROdz4lY567oWUOkRSs2CYrZ5z4xsoYMXixr rIyzReZ+RAOaDs43qOT/BkIQowSJuyW9o7U2+9Klkw2gbQgKVIHxa3N/2G4MfPRK/L61 HR2bKpjtQFppvuvxrJfKp4hyUL39cmBbHZ/wZ7RlW9DKt9wt1+AolgVmTtkbTZ5JNxp+ qxoFzYEra0/kaq7T+cgi2tfuP8uf/5TMYVT5tyjWuzCZhGXhCVR2P8ARsh1a/AqqODvP jZmyf3uLksHdMoroziZmkWOZqr4k6Gn9JY9vJtet9P/I9YYJVygWXRz26m3nwHLteM2a MgBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r202si22020489oie.247.2020.01.22.12.06.43; Wed, 22 Jan 2020 12:07:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726194AbgAVUGd (ORCPT + 99 others); Wed, 22 Jan 2020 15:06:33 -0500 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:53990 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbgAVUGc (ORCPT ); Wed, 22 Jan 2020 15:06:32 -0500 Received: from legolas.fritz.box (unknown [91.53.47.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smail.rz.tu-ilmenau.de (Postfix) with ESMTPSA id 5663158007B; Wed, 22 Jan 2020 21:06:30 +0100 (CET) From: Markus Theil To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Markus Theil Subject: [PATCH] iw: scan: print radio measurement capabilities Date: Wed, 22 Jan 2020 21:06:16 +0100 Message-Id: <20200122200616.7897-1-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Signed-off-by: Markus Theil --- scan.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/scan.c b/scan.c index bfd39e4..fd522d4 100644 --- a/scan.c +++ b/scan.c @@ -582,6 +582,61 @@ static void print_supprates(const uint8_t type, uint8_t len, printf("\n"); } +static void print_rm_enabled_capabilities(const uint8_t type, uint8_t len, + const uint8_t *data, + const struct print_ies_data *ie_buffer) +{ + __u64 capa = data[0] | + data[1] << 8 | + data[2] << 16 | + data[3] << 24 | + ((__u64) data[4]) << 32; + + printf("\n"); + printf("\t\tCapabilities: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", + data[0], data[1], + data[2], data[3], + data[4]); + +#define PRINT_RM_CAPA(_bit, _str) \ + do { \ + if (capa & BIT(_bit)) \ + printf("\t\t\t" _str "\n"); \ + } while (0) + + PRINT_RM_CAPA(0, "Link Measurement"); + PRINT_RM_CAPA(1, "Neighbor Report"); + PRINT_RM_CAPA(2, "Parallel Measurements"); + PRINT_RM_CAPA(3, "Repeated Measurements"); + PRINT_RM_CAPA(4, "Beacon Passive Measurement"); + PRINT_RM_CAPA(5, "Beacon Active"); + PRINT_RM_CAPA(6, "Beacon Table Measurement"); + PRINT_RM_CAPA(7, "Beacon Measurement Reporting Conditions"); + PRINT_RM_CAPA(8, "Frame Measurement"); + PRINT_RM_CAPA(9, "Channel Load"); + PRINT_RM_CAPA(10, "Noise Histogram Measurement"); + PRINT_RM_CAPA(11, "Statistics Measurement"); + PRINT_RM_CAPA(12, "LCI Measurement"); + PRINT_RM_CAPA(13, "LCI Azimuth"); + PRINT_RM_CAPA(14, "Transmit Stream/Category Measurement"); + PRINT_RM_CAPA(15, "Triggered Transmit Stream/Category"); + PRINT_RM_CAPA(16, "AP Channel Report"); + PRINT_RM_CAPA(17, "RM MIB Capability"); + + PRINT_RM_CAPA(27, "Measurement Pilot Transmission Information"); + PRINT_RM_CAPA(28, "Neighbor Report TSF Offset"); + PRINT_RM_CAPA(29, "RCPI Measurement"); + PRINT_RM_CAPA(30, "RSNI Measurement"); + PRINT_RM_CAPA(31, "BSS Average Access Delay"); + PRINT_RM_CAPA(32, "BSS Available Admission"); + PRINT_RM_CAPA(33, "Antenna"); + PRINT_RM_CAPA(34, "FTM Range Report"); + PRINT_RM_CAPA(35, "Civic Location Measurement"); + + printf("\t\tNonoperating Channel Max Measurement Duration: %i\n", data[3] >> 5); + printf("\t\tMeasurement Pilot Capability: %i\n", data[4] & 7); +} + static void print_ds(const uint8_t type, uint8_t len, const uint8_t *data, const struct print_ies_data *ie_buffer) { @@ -1540,6 +1595,7 @@ static const struct ie_print ieprinters[] = { [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), }, [48] = { "RSN", print_rsn, 2, 255, BIT(PRINT_SCAN), }, [50] = { "Extended supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), }, + [70] = { "RM enabled capabilities", print_rm_enabled_capabilities, 5, 5, BIT(PRINT_SCAN), }, [113] = { "MESH Configuration", print_mesh_conf, 7, 7, BIT(PRINT_SCAN), }, [114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), }, [127] = { "Extended capabilities", print_capabilities, 0, 255, BIT(PRINT_SCAN), }, -- 2.25.0