From patchwork Wed Mar 21 22:44:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Shmidt X-Patchwork-Id: 132246 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp115487ljb; Wed, 21 Mar 2018 15:44:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELtJ8mDbTTSA4JseFltAqoDrMpy6Q8vQ29dzm4m/Sw0i/0ceTOV4OP81v77PshreWLLLR7Mt X-Received: by 10.99.155.2 with SMTP id r2mr10355718pgd.450.1521672279884; Wed, 21 Mar 2018 15:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521672279; cv=none; d=google.com; s=arc-20160816; b=NB3dAcm4Ydx0aggKqUEbexh/j/2pmdRlwPjHiFfR9utqv+TOINpIIqUXsuIEJuJLxN 4CHt4AQHcdzejr+6tstpc17f3l3pM0CGWxOW8j2tT+Sj1/7RIUblu2N0qiUXtuFIfWMM lsAfBzSeYmJ81jgMV2PNYIzR6y+MxauuUBgaDxoFkZWqNqC6p4h+9htCLEdvPbqo71mm gX/LLHYTFADJeujWjGyjteuuGsCPzSUyoj0Okg/LzjmdjteIGjn7nb1FYTdbA2I60EBE DQ64N3bPYbrRosk9bv04yPxpZIJcortBdvbc1ejN0ATqMnz4OJHura1zXvh2gz1G9EhT 2cCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:date:message-id :mime-version:dkim-signature:arc-authentication-results; bh=OlLUFV6D1Zko5atW1fR9DD2KeVvpfGdc3W2SUA35nHg=; b=w7W/728wpNEg2pR8joqKOsV9GaCX8EnLRyb5T6X9otuTH7918N6JjzeuhFTvRciQQ0 AB7fPBbKel6TvdAvaWxC5icVqPNooD/wKr1Cxc7eoncUP+t6jd0rLmhDvV9frk8mcpHt EuJZkUUJBRuWJgEvnolbsoMmdhv5iwtESa5xITGGGu+YT5PRw2t5sVaY/O5hgrgauSJx bS3vrRPgblEO0JXhzvunVceGg9mqMzSmVS/rADXs//NAv16iIZbu8mBN+2m2BZ/179Lv DCo8CoKIfd9SBx4PcszV638UjoyjND1vhTSzL8xYp/Ah6KaUkkNOsC5LHmKCTB+HU6rC 5Frw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DI+pHDs4; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si5161475plk.567.2018.03.21.15.44.39; Wed, 21 Mar 2018 15:44:39 -0700 (PDT) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=DI+pHDs4; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753773AbeCUWoi (ORCPT + 2 others); Wed, 21 Mar 2018 18:44:38 -0400 Received: from mail-yw0-f202.google.com ([209.85.161.202]:43224 "EHLO mail-yw0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753309AbeCUWoh (ORCPT ); Wed, 21 Mar 2018 18:44:37 -0400 Received: by mail-yw0-f202.google.com with SMTP id f185so1395401ywd.10 for ; Wed, 21 Mar 2018 15:44:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:message-id:date:subject:from:to:cc; bh=OlLUFV6D1Zko5atW1fR9DD2KeVvpfGdc3W2SUA35nHg=; b=DI+pHDs4DY2+zi5BSMUH40Qp23pXxUZlPVpSg8dfXQkbvbdlQ1ZM60f+Xaz3zMPXIJ IjKhe/dE0pevkg99LxWl3YORkg/rWNqt412o0udxwTx1WWkciuROuz0Hw/2tE3sND7pv aEAZYsHdvFlf2xT+1nQ6Tuo1a0CUpr0HEkusgdqI6mhE+syBmgPBBdLaeqqcJiHw1yE2 YXmpigzCANFmncJC0Ya1n61CPsSXxJqtBgK7WMv2K1RlXgTvx6zz1UREm08aqwNl08yb 3376NucT5XxEAFTJEHFdel6QbCsJt/DKpJ5m9M9RIJz5qCg0dr1u/8z1xpzczlti2dSZ HV+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:message-id:date:subject:from:to:cc; bh=OlLUFV6D1Zko5atW1fR9DD2KeVvpfGdc3W2SUA35nHg=; b=hco8yTfx0H3j+RvwlYFrAZXz/W+blOqObyQiNs1VHii+Z7rTLPI46/lc20IaGhKlF/ 9nIBNZh9ZAw9Qq4acVohtdBwb8KTPz28/o6QchAHVt4jun4kWSGUlJkSkCC304XMV5vc Ms9KFeaelebPxBk7hlTG/klrcRR6+F20CJf3afUE+xdZCKArV8SA3JwGrnOtsuCSGbTL O2oP9dUzeSPbqYiY9i+Nm78Yt+pzDhL6PqaiDKTM2enbKJm2Vxz013T2EDsUstSivKnZ lUkNF/6T4X9zQJnkoUqBMVYG3nP15yTF9rSYzfMIm0wFRx1/cXLOBBFo9x8nQV8gpfL8 Kg9g== X-Gm-Message-State: AElRT7E6h57q8kI/5F+1H7zOpC8G1vzaGOtDpBF1S6jXs1QYeFW4IGGL C8Dk7yB0UJM7fgRuWXEI6OXBV/81vRrSLlvys+tIBh02W3/9VzybZVdKuSLecjhwpeqZYVHvkJ/ HHO6wGnFYASJj9X6FBawYmA0bI4AvWF+G/pbEmScxY3xoqrKlXWV5lv/vEeP88DwXy68/EqEF1N bymoJf MIME-Version: 1.0 X-Received: by 2002:a25:1482:: with SMTP id 124-v6mr7049588ybu.71.1521672276420; Wed, 21 Mar 2018 15:44:36 -0700 (PDT) Message-ID: <00000000000080af470567f3ef29@google.com> Date: Wed, 21 Mar 2018 22:44:36 +0000 Subject: [PATCH] brcmfmac: Add timestamp to scan results report From: dimitrysh@google.com To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, franky.lin@broadcom.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org >From 01da9ee11ce6e0973972b2ffd37eef660714f71a Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Wed, 21 Mar 2018 15:35:45 -0700 Subject: [PATCH] brcmfmac: Add timestamp to scan results report Monotonic time from boot is good timestamp indicator and it can be used by kernel and userspace. Change-Id: I122374fa79c6dbd7967b2c30553cb04dee032ebc Signed-off-by: Dmitry Shmidt --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) u16 notify_capability; @@ -2885,10 +2887,12 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg, brcmf_dbg(CONN, "Beacon interval: %d\n", notify_interval); brcmf_dbg(CONN, "Signal: %d\n", notify_signal); + get_monotonic_boottime(&ts); + timestamp = (u64)ts.tv_sec * 1000000 + ts.tv_nsec / 1000; bss = cfg80211_inform_bss(wiphy, notify_channel, CFG80211_BSS_FTYPE_UNKNOWN, (const u8 *)bi->BSSID, - 0, notify_capability, + timestamp, notify_capability, notify_interval, notify_ie, notify_ielen, notify_signal, GFP_KERNEL); -- 2.17.0.rc0.231.g781580f067-goog diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 4157c90ad973..76d6ed553b7c 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -2845,6 +2845,8 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg, struct cfg80211_bss *bss; struct ieee80211_supported_band *band; struct brcmu_chan ch; + struct timespec ts; + u64 timestamp; u16 channel; u32 freq;