From patchwork Wed Jan 17 07:18:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10168673 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0973F601E7 for ; Wed, 17 Jan 2018 07:21:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6615281E1 for ; Wed, 17 Jan 2018 07:21:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAF5E28210; Wed, 17 Jan 2018 07:21:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83EE3281E1 for ; Wed, 17 Jan 2018 07:21:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752205AbeAQHVr (ORCPT ); Wed, 17 Jan 2018 02:21:47 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:57446 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173AbeAQHVp (ORCPT ); Wed, 17 Jan 2018 02:21:45 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4ED526081E; Wed, 17 Jan 2018 07:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516173705; bh=kuWHYp8TU8oskDILiQbUl9qzUQ/3ax8Rs68ZmsH/W1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D18AaREx62rGqwKTlbEJuAJr+FkBm4aSg1VVdKbcnPSyRPezhNsVzrsGThk/XpuNJ UgLXMmy+HCCK58dcIETu/Wv1maoG6Ba6evcFAf9EgJ56s6ze9hHFUQiYhXujFf5fLt Bo1o0rT4yrEH6XuJun4mlIaeqnztJlyYht6Tzka4= Received: from cheath10p342229-lin.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tamizhr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8AD62608CB; Wed, 17 Jan 2018 07:21:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516173704; bh=kuWHYp8TU8oskDILiQbUl9qzUQ/3ax8Rs68ZmsH/W1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O8ElfzEOV5RcxUuTYDUTD7moqp3O12Y1peiMBxPiakFl46eWV0wo+5UGa5x/ehOAG i7BXLbxmF01Angek3iaLG8O2fpjfxaKRIxkRjo+U8sTQUZtbYvT198SCwGJakLVOm2 jckXyrJcf5Hg2NYHpYySMKzoh95sEAsXalwycHj0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8AD62608CB Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: tamizhr@codeaurora.org To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, tamizhr@qti.qualcomm.com, Tamizh chelvam Subject: [PATCH 2/2] mac80211: Add support to notify ht/vht opmode modification. Date: Wed, 17 Jan 2018 12:48:28 +0530 Message-Id: <1516173508-16528-2-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516173508-16528-1-git-send-email-tamizhr@codeaurora.org> References: <1516173508-16528-1-git-send-email-tamizhr@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tamizh chelvam This will add support to send an event to a userspace application whenever station advertise its ht/vht opmode modification through an action frame. Signed-off-by: Tamizh chelvam --- net/mac80211/rx.c | 15 +++++++++++++++ net/mac80211/vht.c | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index fd58061..60ec460 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2873,6 +2873,14 @@ static void ieee80211_process_sa_query_req(struct ieee80211_sub_if_data *sdata, rate_control_rate_update(local, sband, rx->sta, IEEE80211_RC_SMPS_CHANGED); + cfg80211_sta_opmode_change_notify( + sdata->dev, + rx->sta->addr, + SMPS_MODE_CHANGED, + smps_mode, + rx->sta->sta.bandwidth, + rx->sta->sta.rx_nss, + GFP_KERNEL); goto handled; } case WLAN_HT_ACTION_NOTIFY_CHANWIDTH: { @@ -2902,6 +2910,13 @@ static void ieee80211_process_sa_query_req(struct ieee80211_sub_if_data *sdata, rate_control_rate_update(local, sband, rx->sta, IEEE80211_RC_BW_CHANGED); + cfg80211_sta_opmode_change_notify( + sdata->dev, + rx->sta->addr, + MAX_BW_CHANGED, + rx->sta->sta.smps_mode, + new_bw, rx->sta->sta.rx_nss, + GFP_KERNEL); goto handled; } default: diff --git a/net/mac80211/vht.c b/net/mac80211/vht.c index b9276ac..f1d7dce 100644 --- a/net/mac80211/vht.c +++ b/net/mac80211/vht.c @@ -447,6 +447,7 @@ u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata, enum nl80211_band band) { enum ieee80211_sta_rx_bandwidth new_bw; + u8 opmode_changed = 0; u32 changed = 0; u8 nss; @@ -461,6 +462,7 @@ u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata, if (sta->sta.rx_nss != nss) { sta->sta.rx_nss = nss; changed |= IEEE80211_RC_NSS_CHANGED; + opmode_changed |= N_SS_CHANGED; } switch (opmode & IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK) { @@ -482,8 +484,17 @@ u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata, if (new_bw != sta->sta.bandwidth) { sta->sta.bandwidth = new_bw; changed |= IEEE80211_RC_BW_CHANGED; + opmode_changed |= MAX_BW_CHANGED; } + if (opmode_changed) + cfg80211_sta_opmode_change_notify(sdata->dev, sta->addr, + opmode_changed, + sta->sta.smps_mode, + sta->sta.bandwidth, + sta->sta.rx_nss, + GFP_KERNEL); + return changed; }