From patchwork Tue Dec 10 14:43:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Theil X-Patchwork-Id: 11282683 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E7DF514BD for ; Tue, 10 Dec 2019 14:44:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C64C22077B for ; Tue, 10 Dec 2019 14:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727492AbfLJOoN (ORCPT ); Tue, 10 Dec 2019 09:44:13 -0500 Received: from smail.rz.tu-ilmenau.de ([141.24.186.67]:44990 "EHLO smail.rz.tu-ilmenau.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727480AbfLJOoN (ORCPT ); Tue, 10 Dec 2019 09:44:13 -0500 Received: from isengard.tu-ilmenau.de (unknown [141.24.207.101]) (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 6D9B5580074; Tue, 10 Dec 2019 15:44:11 +0100 (CET) From: Markus Theil To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Markus Theil Subject: [PATCH] iw: event: add sta opmode changed command Date: Tue, 10 Dec 2019 15:43:56 +0100 Message-Id: <20191210144356.15377-1-markus.theil@tu-ilmenau.de> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Parsing this command helps tracking num spatial stream and bandwidth changes. Signed-off-by: Markus Theil --- event.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/event.c b/event.c index 0cedeb9..7600781 100644 --- a/event.c +++ b/event.c @@ -708,6 +708,32 @@ static void parse_set_interface(struct nlattr **attrs) printf("\n"); } +static void parse_sta_opmode_changed(struct nlattr **attrs) +{ + char macbuf[ETH_ALEN*3]; + + printf("sta opmode changed"); + + if (attrs[NL80211_ATTR_MAC]) { + mac_addr_n2a(macbuf, nla_data(attrs[NL80211_ATTR_MAC])); + printf(" %s", macbuf); + } + + if (attrs[NL80211_ATTR_SMPS_MODE]) { + printf(" smps mode %i", nla_get_u8(attrs[NL80211_ATTR_SMPS_MODE])); + } + + if (attrs[NL80211_ATTR_CHANNEL_WIDTH]) { + printf(" chan width %i", nla_get_u8(attrs[NL80211_ATTR_CHANNEL_WIDTH])); + } + + if (attrs[NL80211_ATTR_NSS]) { + printf(" nss %i", nla_get_u8(attrs[NL80211_ATTR_NSS])); + } + + printf("\n"); +} + static int print_event(struct nl_msg *msg, void *arg) { struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); @@ -1055,6 +1081,10 @@ static int print_event(struct nl_msg *msg, void *arg) parse_set_interface(tb); break; } + case NL80211_CMD_STA_OPMODE_CHANGED: { + parse_sta_opmode_changed(tb); + break; + } default: printf("unknown event %d (%s)\n", gnlh->cmd, command_name(gnlh->cmd));