Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1058915ybm; Tue, 21 May 2019 08:03:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrsrDXdygBQPoh39R7nkpSduXySxyyhQqoI94QXYNu9XQ1rdxhujMWOy5Hk3wCbPl/nym9 X-Received: by 2002:a17:902:6b81:: with SMTP id p1mr82140902plk.207.1558451039161; Tue, 21 May 2019 08:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558451039; cv=none; d=google.com; s=arc-20160816; b=voxrNUcSz3dG2CBxCkrWGjAbdP4rZ/SNWsIYualGo6+k9emIZs+50bKJiYytGH0Nto /uuv1oo++AGHr9GdwcIOtvVt9gZEZ6Iz5WROf+AWFWPaPga6f4zr7WrVwaAhgRqEit5j n/G/emgEtXP4BsIujMwD9i8T5S1XTM6xIXdx7lPbtTOEQxwWbNWHov7JxtlaroKTDLe/ Buuyy/jfQYhznqlyEWv5JC/3UqbgilgQu7wkUMO3Ue1FeR5X2xsz7n3/6/HubB7/sOBt CWbi/ACSdpdPaPGtZzbs8er7CIfqrFujqHpV/cYVcWmLNesj5N+dsFjVuj8NbvJpx0hC T0dA== 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 :message-id:date:subject:cc:to:from; bh=7NbRwx4bW2dswbpFrT7rbIbUxH/sp7WYQ3keazXivSg=; b=wkb323tXTcGbZq/brDsvJrPSxcfGhut1X+CI+hWdrx7kUNA3GIJ3M3I1wAdN66rVkj LrFO/GwjM5h672Lh9vgHMB9LijeSFgN09dWBHvMnu12wpizI2uqwH0xzKwZTTJRQ5EEA oQqRxvUZdYcSQ59iyw7VTFrphchVRjrWG2jsd1R1T/6o5guVxKMRrvYcZYX0HfgWQUzV Sv8tfQkRtq5qBdl8emiCFxPYszGLYm0cSXk6lK6FGM593yHa5b3f40HKXliblmcdnXoc dnMgdLeGvfvQ/IhsIboPlfvCU2eUi2t+E/UAn9MumnGiolYDMI4tqdeZ3BoMKpT8L3IR 27Og== 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 b12si22486338pla.126.2019.05.21.08.03.29; Tue, 21 May 2019 08:03:59 -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; 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 S1728661AbfEUPDK (ORCPT + 99 others); Tue, 21 May 2019 11:03:10 -0400 Received: from nbd.name ([46.4.11.11]:38154 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728318AbfEUPDK (ORCPT ); Tue, 21 May 2019 11:03:10 -0400 Received: from p548c8ce3.dip0.t-ipconnect.de ([84.140.140.227] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1hT6IF-00007m-7R; Tue, 21 May 2019 17:03:07 +0200 From: John Crispin To: Johannes Berg Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, John Crispin , Shashidhar Lakkavalli Subject: [PATCH 1/2] mac80211: add ieee80211_get_he_iftype_cap() helper Date: Tue, 21 May 2019 17:02:58 +0200 Message-Id: <20190521150259.2414-1-john@phrozen.org> X-Mailer: git-send-email 2.20.1 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 This function is similar to ieee80211_get_he_sta_cap() but allows passing the iftype. Also make ieee80211_get_he_sta_cap() use the new helper rather than duplicating the code. Signed-off-by: Shashidhar Lakkavalli Signed-off-by: John Crispin --- include/net/cfg80211.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3f67f01b5f7a..379202ff3d14 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -395,16 +395,18 @@ ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *sband, } /** - * ieee80211_get_he_sta_cap - return HE capabilities for an sband's STA - * @sband: the sband to search for the STA on + * ieee80211_get_he_iftype_cap - return HE capabilities for an sband's iftype + * @sband: the sband to search for the iftype on + * @iftype: enum nl80211_iftype * * Return: pointer to the struct ieee80211_sta_he_cap, or NULL is none found */ static inline const struct ieee80211_sta_he_cap * -ieee80211_get_he_sta_cap(const struct ieee80211_supported_band *sband) +ieee80211_get_he_iftype_cap(const struct ieee80211_supported_band *sband, + u8 iftype) { const struct ieee80211_sband_iftype_data *data = - ieee80211_get_sband_iftype_data(sband, NL80211_IFTYPE_STATION); + ieee80211_get_sband_iftype_data(sband, iftype); if (data && data->he_cap.has_he) return &data->he_cap; @@ -412,6 +414,18 @@ ieee80211_get_he_sta_cap(const struct ieee80211_supported_band *sband) return NULL; } +/** + * ieee80211_get_he_sta_cap - return HE capabilities for an sband's STA + * @sband: the sband to search for the STA on + * + * Return: pointer to the struct ieee80211_sta_he_cap, or NULL is none found + */ +static inline const struct ieee80211_sta_he_cap * +ieee80211_get_he_sta_cap(const struct ieee80211_supported_band *sband) +{ + return ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_STATION); +} + /** * wiphy_read_of_freq_limits - read frequency limits from device tree * -- 2.20.1