Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp771181pxa; Thu, 27 Aug 2020 15:37:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwE7LlTTiNIGivzWWmy8+oaFLebcsHDmFizp1QHQK2kM9TsQ9aB29mpFsiyK49usmN5jVui X-Received: by 2002:a17:906:388a:: with SMTP id q10mr9760744ejd.416.1598567835647; Thu, 27 Aug 2020 15:37:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598567835; cv=none; d=google.com; s=arc-20160816; b=xgARx7boKfUBGM3oMI9T8v7VPU4VZ7sacWalnODTM+KJsy6Dcs1icZbW+SYkzMSrM1 +OgDwe7OXMlRjaFozFlRFP5SYhuF1bjUCe9dV2y76r/93VBtEf4VE1hwuP1+Cf7CawuF R4iTN+HaPr+WcZhgCX0PR9HXHHPlO+F7g4iJatplTZzb2C2FmDEVAXC7yP3qc9mYWeR1 WbTY3AhbkTIOgYGCMT2watT+B4FrPwpfwtWU8s6XZK1MHLFhfq+4ksU0yUeBOzBNMt98 qgnghXvPCdXETYT1eQUohLEYNvny+QRQUkv4B1RLAh/FeNcN5psH/lAGDg6XEWaZQN/P xkcQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=O/60qj4VUWZRZMAChottLwirpdUgV/p6WdzQczJ/agg=; b=bkSOVs7xQN9boKNvMP2OrsEAlGNsp752OIdPgC5Snfyrbse/+0z7Aoo7U4znH5j9W8 bzvKot+cHm5fiHk9M0gQIOIiBn6mOeppVBXG897pUnVUmV0O1I0vWjRDusxpjTDCY1e6 HLytTX4238KBylXn7tAnkwfdQRlDwce13/keVWc/uhNk5OVmn7YXlVXCL22raq+EQiQm cc+ihJvOFw1UkbzDNVA2xhl2AFbAp3vV00RSJbs42q2G5zVROfvQMRzsAwx9d1ydFavw 5Kufv8yi34jdepvoSXV/FWWdzN5KlvMkIImt+dsdxBHL7LzT+sXDRXS/Tvqa/OcTrlms ZS/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z20si2353879edq.490.2020.08.27.15.36.51; Thu, 27 Aug 2020 15:37:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728073AbgH0Wdr (ORCPT + 99 others); Thu, 27 Aug 2020 18:33:47 -0400 Received: from mail.adapt-ip.com ([173.164.178.19]:50616 "EHLO web.adapt-ip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728068AbgH0Wdr (ORCPT ); Thu, 27 Aug 2020 18:33:47 -0400 Received: from localhost (localhost [127.0.0.1]) by web.adapt-ip.com (Postfix) with ESMTP id 522B24F8538; Thu, 27 Aug 2020 22:33:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at web.adapt-ip.com Received: from web.adapt-ip.com ([127.0.0.1]) by localhost (web.adapt-ip.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id XnUr2SE02OUD; Thu, 27 Aug 2020 22:33:43 +0000 (UTC) Received: from atlas.campbell.adapt-ip.com (gateway.adapt-ip.com [173.164.178.20]) (Authenticated sender: thomas@adapt-ip.com) by web.adapt-ip.com (Postfix) with ESMTPSA id 015324F827F; Thu, 27 Aug 2020 22:33:13 +0000 (UTC) From: Thomas Pedersen To: Johannes Berg Cc: linux-wireless , Thomas Pedersen Subject: [PATCH 20/22] nl80211: include frequency offset in survey info Date: Thu, 27 Aug 2020 15:33:02 -0700 Message-Id: <20200827223304.16155-21-thomas@adapt-ip.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200827223304.16155-1-thomas@adapt-ip.com> References: <20200827223304.16155-1-thomas@adapt-ip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Recently channels gained a potential frequency offset, so include this in the per-channel survey info. Signed-off-by: Thomas Pedersen --- include/uapi/linux/nl80211.h | 2 ++ net/wireless/nl80211.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 03f4d83da473..973b56c2226f 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -4073,6 +4073,7 @@ enum nl80211_user_reg_hint_type { * receiving frames destined to the local BSS * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number * currently defined + * @NL80211_SURVEY_INFO_FREQUENCY_OFFSET: center frequency offset in KHz * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use */ enum nl80211_survey_info { @@ -4088,6 +4089,7 @@ enum nl80211_survey_info { NL80211_SURVEY_INFO_TIME_SCAN, NL80211_SURVEY_INFO_PAD, NL80211_SURVEY_INFO_TIME_BSS_RX, + NL80211_SURVEY_INFO_FREQUENCY_OFFSET, /* keep last */ __NL80211_SURVEY_INFO_AFTER_LAST, diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 5672abb34b86..750bef58b319 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -9119,6 +9119,11 @@ static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq, survey->channel->center_freq)) goto nla_put_failure; + if (survey->channel && + nla_put_u32(msg, NL80211_SURVEY_INFO_FREQUENCY_OFFSET, + survey->channel->freq_offset)) + goto nla_put_failure; + if ((survey->filled & SURVEY_INFO_NOISE_DBM) && nla_put_u8(msg, NL80211_SURVEY_INFO_NOISE, survey->noise)) goto nla_put_failure; -- 2.20.1