Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp551793ybc; Fri, 22 Nov 2019 09:17:29 -0800 (PST) X-Google-Smtp-Source: APXvYqwiyyJE8TrveI4K9RPlRigmT5fyUSHhSk5M4KLP7u3J8cd97jeuzyGcTrFEworWhnwagVCf X-Received: by 2002:a50:f612:: with SMTP id c18mr2431705edn.285.1574443049319; Fri, 22 Nov 2019 09:17:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574443049; cv=none; d=google.com; s=arc-20160816; b=yyWlWYnffdC1pJZmmEk0UntgzSnny5O6Zny77TBwDC4/3sIIQ1CvqzaeUmFUL9PDLd ZFyF5yVznTUVbLy1Cheyl/fLeMtV2IvM5jwb/67HVcvSUuuYP0NSJp+TeyD6j/VZN9Pv CTWdzZH04hSUBxI+/8QS2/rDAtOg1hLImmvInU80ifLJ8gJutqsDO93mRtNwv9t8Obr0 +lE+7eqBa7sW2WjxZxQPt98qpMOF33Ij1YKpqqTUvyzjSjNmEerEfdkT0KNCMA3NkZ7v rpotzG+UowBdASQEzbn0AYhQuMv5rAV9CqPrYo+FXVNSOe7sJ4y2r98O36rjzd0T4qQU n5oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=DcsslMAygnD7yk84CpnOySOl202pcz0hRl0XZbmX6aE=; b=U2JoTO0I9JmJLz2iJSGC0UDnMELeJqZ1hjrpQ4zrAZ/X6RQaF+BmIT/jtbLvym22ii aZ2IEFzuRXk3yGJ46Ew4vRQnh7c9jeZ4+tIOk/zQ00JgUkNkAVHhwoVUhLbgkUwI578T B7/uCaD7lnbzgHspF1cnEF8dTedUk84kTmuRnf09ghsLlXDdYOxW79/XoHWGLeNldCxQ gOxvV+zB1EzGOoIkfO75/Rvn8fsM29KsRK0siMi1cZpUa/tZPfKNnHLdabpZ9EjJlqDc sTbATwi6TSD0WJ+QtmEWctYdLPHx0rpBWyPWvldMH3a+L90Pj/2qyDxaSUNLtOCbd9pi 2NZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TXJYr4tU; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si4889512edq.325.2019.11.22.09.17.03; Fri, 22 Nov 2019 09:17:29 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=TXJYr4tU; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbfKVRRC (ORCPT + 99 others); Fri, 22 Nov 2019 12:17:02 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37444 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfKVRRB (ORCPT ); Fri, 22 Nov 2019 12:17:01 -0500 Received: by mail-pf1-f194.google.com with SMTP id p24so3774829pfn.4 for ; Fri, 22 Nov 2019 09:17:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DcsslMAygnD7yk84CpnOySOl202pcz0hRl0XZbmX6aE=; b=TXJYr4tUxQLT/tDlv149LiKqyl5SyfcoyRy+gEP1re2sTJHvJIzdAT4StoeOUCNPdL G+hYzjj4lwVbuhL1GZWX1H8LgB1PXX+N3LGaLuQKDW39F1DTiEbh3eDqF8sMDSr9hPwl DgnVo/4fumZQQOO2JnIs4V8jpKXiHXjfbL3uafx16uNh5/pOxA9FjjTTyzv54pA8mKwO v+wrQTdz+Z0/PoaF6Rdb3KIrJLi70RoapcOahdZjOqCkE/Nn2u/mKBIuqLKM5XmGTdqb hlRn0jHCFS2uB7tpvCnS10P+EwaRV6sYSpernvOhJRZyCP+yIolgGLYSIip3fvZFwtJN 7h6w== 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:in-reply-to :references; bh=DcsslMAygnD7yk84CpnOySOl202pcz0hRl0XZbmX6aE=; b=saIZWanG7s1juNUeyDZt4JsvwD6BcseAN9t9VZayvNrPCjL8KQdKHonjm6y5bDSf+q OPjoYyYQFAUX+vyROizEsqVC/n9uGYDueKOFYy+kjekABa1igoWDCCTdcQ0S9eeIotAO X4g0bnJC76bDeU4akmK37BOCtXIMC4qIdLa1+npjQfdOfvaw0LyepEBFDxjkuvaPxayN oRUA2hei8cUcYh/ItRb0KlATxXBgT/iDs6w1BbYhh7NH540c6jWplV6L9WvhuRBlG45r 2MDLpL9nUqblMIh1NqSisD5GNJxRDYrU3Di63AXoqATz9uKJMlrRp4cTAEZavZs78a04 igSA== X-Gm-Message-State: APjAAAU1OZdjjpTWNjtGVbPpQBD6on5+oAyDMniCfIfit7V2nKzkwt0Z FIEKsjpYZMNaHpnbZgBYYkoUb5aQ X-Received: by 2002:a62:7bd3:: with SMTP id w202mr18116892pfc.200.1574443020732; Fri, 22 Nov 2019 09:17:00 -0800 (PST) Received: from jprestwo-test.jf.intel.com ([134.134.139.76]) by smtp.gmail.com with ESMTPSA id b13sm7406030pgj.28.2019.11.22.09.16.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2019 09:17:00 -0800 (PST) From: James Prestwood To: linux-wireless@vger.kernel.org Cc: James Prestwood Subject: [PATCH v3 2/2] mac80211_hwsim: set rx_status mactime/flag for wmediumd path Date: Fri, 22 Nov 2019 09:14:01 -0800 Message-Id: <20191122171401.8788-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191122171401.8788-1-prestwoj@gmail.com> References: <20191122171401.8788-1-prestwoj@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This patch sets the required rx_status mactime and flags in order for the parent TSF value to be calculated and sent to userspace. This is already done elsewhere, but this patch allows this to work for the wmediumd code path. Signed-off-by: James Prestwood --- drivers/net/wireless/mac80211_hwsim.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index e9bc599481d4..01b2ac9707cc 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -3238,6 +3238,8 @@ static int hwsim_cloned_frame_received_nl(struct sk_buff *skb_2, int frame_data_len; void *frame_data; struct sk_buff *skb = NULL; + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb_2->data; + u64 now; if (!info->attrs[HWSIM_ATTR_ADDR_RECEIVER] || !info->attrs[HWSIM_ATTR_FRAME] || @@ -3300,6 +3302,18 @@ static int hwsim_cloned_frame_received_nl(struct sk_buff *skb_2, rx_status.rate_idx = nla_get_u32(info->attrs[HWSIM_ATTR_RX_RATE]); rx_status.signal = nla_get_u32(info->attrs[HWSIM_ATTR_SIGNAL]); + if (ieee80211_is_beacon(hdr->frame_control) || + ieee80211_is_probe_resp(hdr->frame_control)) { + rx_status.boottime_ns = ktime_get_boottime_ns(); + now = data2->abs_bcn_ts; + } else { + now = mac80211_hwsim_get_tsf_raw(); + } + + rx_status.mactime = now + data2->tsf_offset; + + rx_status.flag |= RX_FLAG_MACTIME_START; + memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status)); data2->rx_pkts++; data2->rx_bytes += skb->len; -- 2.17.1