Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp621094ybl; Fri, 13 Dec 2019 01:52:58 -0800 (PST) X-Google-Smtp-Source: APXvYqwdaG80RpIm5FA29rVcIe06+Od51XlOgRMbJnKi5v44quZdGu7VKrwKN4zX2eCCT+YTc8mi X-Received: by 2002:a05:6830:12d0:: with SMTP id a16mr14065080otq.8.1576230778339; Fri, 13 Dec 2019 01:52:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576230778; cv=none; d=google.com; s=arc-20160816; b=ObgbRd8Ph0j79qtr5kXlIeTpyJzXbTS+i3G2j/o5fEaWk2r/pWzdCd1FFUcwcfGzhT eVi3m8t4bQa/39LbRXJ4Dj8yEPd1aJY5oIr2r3FpbRZ6PjwfxK6ViUzew5SYqwEhKdYV 5jJnIqcbVAOw5ooDp9vrznmodfxxddjmfcxMfoL64ZQbS2nZJfd8z2QISWIHyLFpgCC8 a/jXvWZFYCnQZ8KN01zKjhAs2EdhjBWb51GCsqY2esd4xfOix22T4qD1Tyk4jfcPURG3 L0zYS+NkIetjGaQLEcGgsJLeSvl0lhuiNRe1tQ/U2rLurilTTJDH/oiFR+BDVTDijAET ks6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id; bh=PYFF13TUR4U0DuLx6F4mGUmqi8UxI5oB/jsv0Bfh/Hk=; b=torXJ/1eXRJZwtGj7CtO1cmqs07Ck24V7+ScfSp7V0ELrMgQfkLO2OMX6+9h3D5hY1 X9GyM4niqS9eKUMhLlAMDIANLoCHoJJSCIQBKTXdSknmvwEoyTbEXZYTEimAl/ayUsq/ cuCafrPDYintbELlomdav2TiWi/SbHGbk7PvX1ByeEWsuh62FGyo0DXhxE9EJe08qFcB VOj9T5gbd5i6lVUp4r23d30QesEM8P0qs3bwr/cot2vgLmbDVFhFxqZQI9mMFmYIBV98 QgVe1iAW1QGxTEDb2kNu0waLi0o++nsYmXmpKjN3KS4zP4u1xaPdjW9/jY9SnFlRX1PX CD6A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c131si4373394oig.170.2019.12.13.01.52.42; Fri, 13 Dec 2019 01:52:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725928AbfLMJwh (ORCPT + 99 others); Fri, 13 Dec 2019 04:52:37 -0500 Received: from s3.sipsolutions.net ([144.76.43.62]:45356 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbfLMJwh (ORCPT ); Fri, 13 Dec 2019 04:52:37 -0500 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.92.3) (envelope-from ) id 1ifhch-009drg-7w; Fri, 13 Dec 2019 10:52:35 +0100 Message-ID: Subject: Re: [PATCH v3 2/2] mac80211_hwsim: set rx_status mactime/flag for wmediumd path From: Johannes Berg To: James Prestwood , linux-wireless@vger.kernel.org Date: Fri, 13 Dec 2019 10:52:33 +0100 In-Reply-To: <20191122171401.8788-2-prestwoj@gmail.com> (sfid-20191122_181703_706598_214135C2) References: <20191122171401.8788-1-prestwoj@gmail.com> <20191122171401.8788-2-prestwoj@gmail.com> (sfid-20191122_181703_706598_214135C2) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 (3.34.2-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 2019-11-22 at 09:14 -0800, James Prestwood wrote: > 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; I'm pretty sure this should be data, not data2, like in the other code paths? Also, please rebase - I already did the boottime_ns before overlapping your change, so you can also get rid of the 'hdr' variable. johannes