From patchwork Fri Apr 12 21:40:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 10899157 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E749D17E1 for ; Fri, 12 Apr 2019 21:40:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C624828EC7 for ; Fri, 12 Apr 2019 21:40:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B968228F28; Fri, 12 Apr 2019 21:40:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EC8F28EC7 for ; Fri, 12 Apr 2019 21:40:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726898AbfDLVkP (ORCPT ); Fri, 12 Apr 2019 17:40:15 -0400 Received: from [208.74.158.174] ([208.74.158.174]:33322 "EHLO mail3.candelatech.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1726765AbfDLVkP (ORCPT ); Fri, 12 Apr 2019 17:40:15 -0400 Received: from v-f24-64.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id D8A5113C2B9; Fri, 12 Apr 2019 14:40:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com D8A5113C2B9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1555105214; bh=AFBHr02OV/E3qmpQmrl0HvuLgWGGG4zwdFg7CADvGMo=; h=From:To:Cc:Subject:Date:From; b=URZQvU0UJVb5aPotz3xO6FBBe89QBHasHVqa9RDKopEZZ6FAClMxqsixR5lkupxvu KPK+c9FHWHM6KAAHzg9Bif++I9dMWGMJTkRxGwZ50m2m+GKdfutSsCuEpC180whgEb klWWzCqSuuWssQHMiyYqAAA7eJl+tDKsDXXWd/lc= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: Ben Greear Subject: [PATCH 1/2] iw: Support authenticated-at station statistic. Date: Fri, 12 Apr 2019 14:40:09 -0700 Message-Id: <1555105210-22996-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.7.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear This can be helpful for calculating roaming time and other higher precision stats. Signed-off-by: Ben Greear --- nl80211.h | 2 ++ station.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/nl80211.h b/nl80211.h index e1ea2cb..ebaae12 100644 --- a/nl80211.h +++ b/nl80211.h @@ -3139,6 +3139,7 @@ enum nl80211_sta_bss_param { * @NL80211_STA_INFO_TX_DURATION: aggregate PPDU duration for all frames * sent to the station (u64, usec) * @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16) + * @NL80211_STA_INFO_AUTH_AT_MS: Timestamp of last assoc -> auth transition, in ms * @__NL80211_STA_INFO_AFTER_LAST: internal * @NL80211_STA_INFO_MAX: highest possible station info attribute */ @@ -3184,6 +3185,7 @@ enum nl80211_sta_info { NL80211_STA_INFO_CONNECTED_TO_GATE, NL80211_STA_INFO_TX_DURATION, NL80211_STA_INFO_AIRTIME_WEIGHT, + NL80211_STA_INFO_AUTH_AT_MS, /* keep last */ __NL80211_STA_INFO_AFTER_LAST, diff --git a/station.c b/station.c index 25cbbc3..3b0c5f1 100644 --- a/station.c +++ b/station.c @@ -557,6 +557,9 @@ static int print_sta_handler(struct nl_msg *msg, void *arg) if (sinfo[NL80211_STA_INFO_CONNECTED_TIME]) printf("\n\tconnected time:\t%u seconds", nla_get_u32(sinfo[NL80211_STA_INFO_CONNECTED_TIME])); + if (sinfo[NL80211_STA_INFO_AUTH_AT_MS]) + printf("\n\tauthenticated at:\t%llu ms", + (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_AUTH_AT_MS])); printf("\n"); return NL_SKIP; From patchwork Fri Apr 12 21:40:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 10899159 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D814017E1 for ; Fri, 12 Apr 2019 21:40:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCF2A28EC7 for ; Fri, 12 Apr 2019 21:40:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B138628F28; Fri, 12 Apr 2019 21:40:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5530528EC7 for ; Fri, 12 Apr 2019 21:40:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726917AbfDLVkS (ORCPT ); Fri, 12 Apr 2019 17:40:18 -0400 Received: from [208.74.158.174] ([208.74.158.174]:33336 "EHLO mail3.candelatech.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1726765AbfDLVkS (ORCPT ); Fri, 12 Apr 2019 17:40:18 -0400 Received: from v-f24-64.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id DFD8513C2B9; Fri, 12 Apr 2019 14:40:17 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com DFD8513C2B9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1555105218; bh=GJ+eo5+Sp9maQ370wrEcV5dXSzZigGvgdbdmIax19Rs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=plve36pEDjoCbeOleIP2XX3IHcx+uvWNkVHrS8A/7FIY9ni5nO9+eMK6fQkXdE0Tf 4XviDp/GtyyuVAQgxvM1CqX/tkxt33ta5XaprBFurtdQHhgG5uoictidFAR1q1gn5H zMevB45/2WgGVGmjyYpmJmCggVQMCNYfrQ4jGjVw= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: Ben Greear Subject: [PATCH 2/2] iw: Print current time in station info dump Date: Fri, 12 Apr 2019 14:40:10 -0700 Message-Id: <1555105210-22996-2-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1555105210-22996-1-git-send-email-greearb@candelatech.com> References: <1555105210-22996-1-git-send-email-greearb@candelatech.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear This lets us more precisely calculate the absolute timestamp of last-rix (ie, now - idle). Signed-off-by: Ben Greear --- station.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/station.c b/station.c index 3b0c5f1..60804f2 100644 --- a/station.c +++ b/station.c @@ -314,6 +314,12 @@ static int print_sta_handler(struct nl_msg *msg, void *arg) [NL80211_STA_INFO_ACK_SIGNAL_AVG] = { .type = NLA_U8 }, }; char *chain; + struct timeval now; + unsigned long long now_ms; + + gettimeofday(&now, NULL); + now_ms = now.tv_sec * 1000; + now_ms += (now.tv_usec / 1000); nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), NULL); @@ -561,7 +567,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg) printf("\n\tauthenticated at:\t%llu ms", (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_AUTH_AT_MS])); - printf("\n"); + printf("\n\tcurrent time:\t%llu ms\n", now_ms); return NL_SKIP; }