From patchwork Fri Jul 27 16:30:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 143084 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1024549ljj; Fri, 27 Jul 2018 09:30:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdp5t71CmWiLdYm13S2fFi7gfvyxdUxhpaTbRfWM4hsagXbnIF1/x42034kIyPzLAmhTXOM X-Received: by 2002:a17:902:9893:: with SMTP id s19-v6mr6651091plp.130.1532709029021; Fri, 27 Jul 2018 09:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532709029; cv=none; d=google.com; s=arc-20160816; b=YnvBjkOQobYgI/afBRlKhvQvymRs8ze5xuIXZ5znuWu1I9CkRxR0xcsIicx4TBfLgX TRxJ/fSmS8Q9u6icddAKIMFhciHE//CA7PstHJEIDevF1VV1/yjDpDH17nzkJzntoCmh I8rDuBDsMEZ3EA6yPmAO0+7IpNT5ZrmC/DvAv92nkHFV7BVG1jUOKwUL50fzV5ROCijB 2w0QneVK1cepWlrlEV6XW8+FjjgLYKJi7Uv9NYR4CMVc++/Ozo1bm8oEQo/fxPfh1mhE 83HWq9fVtkZvV/sh9ry+V1Vc/d1l9iDXhbV/ZAWPo2s0faglgOKE5hkUWvPe7Z41HTfl nA2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=9ANXmgwHfI2M2FkWDRJq5kIHWR3ljF9imk3TD4Dx33Q=; b=AFaRXjGpLJ4g7XGOmwqWEx9kJ7/zTJbSdAbjOZwB2Wzyh/q/tGl13aY1Gdmd0G80/Z EqgrYoGB5VE62F8O+1H6arRXXwfag8LXUg5/rXNJqkYwbtfis7wy0dGdr/2/WSFcHAgf f6DfszXTgbBh/9DkzhTMMy4fOW2QcnYzFJt5mzG+wWIj7CFcn/t8exn+ugProIzw45T2 4Rt2b8ukEajWf3KH4kykP1uVlw8SdhzBVWnP3W55fLXi1KsvY2Dndq1kn4M0mts9NX3N g7zzXTkJaUGxtE9zkTYMMekTGYc1oQXCj+QbmsCHBJVWuEV7LjaD1yXnRF0CwIjXCQRs XJ4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CnS1RS1O; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6-v6si4323252pgb.61.2018.07.27.09.30.28; Fri, 27 Jul 2018 09:30:29 -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=@linaro.org header.s=google header.b=CnS1RS1O; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731568AbeG0RxG (ORCPT + 3 others); Fri, 27 Jul 2018 13:53:06 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35420 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbeG0RxG (ORCPT ); Fri, 27 Jul 2018 13:53:06 -0400 Received: by mail-wm0-f66.google.com with SMTP id o18-v6so6144888wmc.0 for ; Fri, 27 Jul 2018 09:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=9ANXmgwHfI2M2FkWDRJq5kIHWR3ljF9imk3TD4Dx33Q=; b=CnS1RS1Ot8NKe1jtPs240ZDIfUT6jVyoDIb7ldCkIhZiF7XLVLmULSr2npvxa/kiZu l0aoe3P9kBPWyow7TaoGermwNHZBZcRrrIzf3NQueYAohHgxzb5XYfBiJiks5+cnmEXs 9rlvLsd/Ri21irift9KL1soqp8BwA6+ivYdnc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9ANXmgwHfI2M2FkWDRJq5kIHWR3ljF9imk3TD4Dx33Q=; b=jdWPtiYYRjcz94EXxoftIp6VeZYE5hxFDelZaHXNHjCAmZzu2N6rSOfhik+E5F0ELW C/r9kjqFlqfE9J4sxN+s6llLsqPsftDQoJQGrfJa7TulW05JPgnLMUC1yzRcqIw4LEWy vvU65b8BQF/tupXAhXhL2XKPINl3VVPY50HvjwqFtXoPP6FDtM+qTG7cvSKttKQMBnVo R57oU/emeT2F0IfzfO521cmS5tyATOGiLSQpKgZldQklLEc1rzbkSUQZ3gvxPl3S02J/ 3xTgIH9hJVOoD4VmKR1pnUKxCdnfDAN8P/2qQ6ZYnrhYLvWArycEgP6gVbZUdYAXLgWW hkfw== X-Gm-Message-State: AOUpUlG6kage0vxlec6LLCuVPdfkQktJT8fsYynjY+DKfNx1CqKXnbm0 gNcYeansdRFwMvoItKkkC8AQcQ== X-Received: by 2002:a1c:9215:: with SMTP id u21-v6mr4784870wmd.106.1532709025678; Fri, 27 Jul 2018 09:30:25 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-655-1-762-165.w109-220.abo.wanadoo.fr. [109.220.142.165]) by smtp.gmail.com with ESMTPSA id j6-v6sm3017678wro.13.2018.07.27.09.30.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Jul 2018 09:30:24 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Loic Poulain Subject: [PATCH] wlcore: Set rx_status boottime_ns field on rx Date: Fri, 27 Jul 2018 18:30:23 +0200 Message-Id: <1532709023-1237-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When receiving a beacon or probe response, we should update the boottime_ns field which is the timestamp the frame was received at. (cf mac80211.h) This fixes a scanning issue with Android since it relies on this timestamp to determine when the AP has been seen for the last time (via the nl80211 BSS_LAST_SEEN_BOOTTIME parameter). Signed-off-by: Loic Poulain --- drivers/net/wireless/ti/wlcore/rx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c index 0f15696..078a494 100644 --- a/drivers/net/wireless/ti/wlcore/rx.c +++ b/drivers/net/wireless/ti/wlcore/rx.c @@ -59,7 +59,7 @@ static u32 wlcore_rx_get_align_buf_size(struct wl1271 *wl, u32 pkt_len) static void wl1271_rx_status(struct wl1271 *wl, struct wl1271_rx_descriptor *desc, struct ieee80211_rx_status *status, - u8 beacon) + u8 beacon, u8 probe_rsp) { memset(status, 0, sizeof(struct ieee80211_rx_status)); @@ -106,6 +106,9 @@ static void wl1271_rx_status(struct wl1271 *wl, } } + if (beacon || probe_rsp) + status->boottime_ns = ktime_get_boot_ns(); + if (beacon) wlcore_set_pending_regdomain_ch(wl, (u16)desc->channel, status->band); @@ -191,7 +194,8 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length, if (ieee80211_is_data_present(hdr->frame_control)) is_data = 1; - wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon); + wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon, + ieee80211_is_probe_resp(hdr->frame_control)); wlcore_hw_set_rx_csum(wl, desc, skb); seq_num = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4;