From: Johannes Berg <johannes@sipsolutions.net>
To: Ningyuan Wang <nywang@google.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] Print NL80211_BSS_LAST_SEEN_BOOTTIME and beacon tsf
Date: Wed, 06 Sep 2017 12:36:51 +0200 [thread overview]
Message-ID: <1504694211.13457.10.camel@sipsolutions.net> (raw)
In-Reply-To: <20170726000118.77660-1-nywang@google.com> (sfid-20170726_020239_886626_8A8FB83C)
Hi,
> nl80211.h | 4 ++++
Please don't include nl80211.h changes, I'll update that as needed.
> + if (bss[NL80211_BSS_BEACON_TSF]) {
> + unsigned long long tsf;
> + tsf = (unsigned long
> long)nla_get_u64(bss[NL80211_BSS_BEACON_TSF]);
> + printf("\tBeacon TSF: %llu usec (%llud,
> %.2lld:%.2llu:%.2llu)\n",
> + tsf, tsf/1000/1000/60/60/24,
> (tsf/1000/1000/60/60) % 24,
> + (tsf/1000/1000/60) % 60, (tsf/1000/1000) %
> 60);
> + }
This seems fine, but we already print the BSS_TSF - is it really
needed? Anyway, I think it's OK, just not sure there's much point.
> + if (bss[NL80211_BSS_LAST_SEEN_BOOTTIME]) {
> + unsigned long long last_seen_since_boot;
> + last_seen_since_boot =
> + (unsigned long
> long)nla_get_u64(bss[NL80211_BSS_LAST_SEEN_BOOTTIME]);
> + printf("\tlast seen since boot time: %llu usec
> (%llud, %.2lld:%.2llu:%.2llu)\n",
> + last_seen_since_boot, last_seen_since_boot
> /1000/1000/1000/60/60/24,
> + (last_seen_since_boot /1000/1000/1000/60/60)
> % 24,
> + (last_seen_since_boot/1000/1000/1000/60) %
> 60,
> + (last_seen_since_boot/1000/1000/1000) % 60);
> + }
This is wrong - the value isn't "last seen since boot", it's "last seen
*at* boottime X" - but "boottime" maybe some kind of strange concept,
so I don't think printing this to a user makes a lot of sense at all?
johannes
prev parent reply other threads:[~2017-09-06 10:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 0:47 [PATCH] Print NL80211_BSS_LAST_SEEN_BOOTTIME on scan results Ningyuan Wang
2017-07-21 15:18 ` Kalle Valo
[not found] ` <CACS3zKWXPYK98kuBBXnwXa84H5DrB8Mv4UbF7NdM3DFJ9G3PdQ@mail.gmail.com>
2017-07-21 16:57 ` Kalle Valo
2017-07-26 0:01 ` [PATCH] Print NL80211_BSS_LAST_SEEN_BOOTTIME and beacon tsf Ningyuan Wang
2017-09-06 10:36 ` Johannes Berg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504694211.13457.10.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=nywang@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox