From patchwork Wed Jan 17 07:31:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10168681 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 68CCC601D3 for ; Wed, 17 Jan 2018 07:34:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5613E26255 for ; Wed, 17 Jan 2018 07:34:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AECE28179; Wed, 17 Jan 2018 07:34:42 +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 E7B3026255 for ; Wed, 17 Jan 2018 07:34:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752393AbeAQHek (ORCPT ); Wed, 17 Jan 2018 02:34:40 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:33054 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752358AbeAQHei (ORCPT ); Wed, 17 Jan 2018 02:34:38 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D822A6081E; Wed, 17 Jan 2018 07:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516174477; bh=OZlasI1cc/kZ/J78jOUNylP8t9BXWCVqBEfdK/fuDZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TgAv1DlqI9b5VmCsdK9Vi17L7/mSVG66ss8ibjq5RjvaKUzPbC8Pf40zjjhwvFvTd Wil9LVL4Gp1zZ7HxexZKcmgm6pidAdgFFQz3SPQvlkp7d65ws5SBdrciMVkMuseO5t ezrCVKqviGc338jFsLTAqF2g+1iP1PI6ZndRJv1o= 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 221B1609D1; Wed, 17 Jan 2018 07:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516174477; bh=OZlasI1cc/kZ/J78jOUNylP8t9BXWCVqBEfdK/fuDZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TgAv1DlqI9b5VmCsdK9Vi17L7/mSVG66ss8ibjq5RjvaKUzPbC8Pf40zjjhwvFvTd Wil9LVL4Gp1zZ7HxexZKcmgm6pidAdgFFQz3SPQvlkp7d65ws5SBdrciMVkMuseO5t ezrCVKqviGc338jFsLTAqF2g+1iP1PI6ZndRJv1o= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 221B1609D1 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, Pradeep Kumar Chitrapu , Tamizh chelvam Subject: [PATCH 3/4] mac80211: enable setting cqm config for AP mode Date: Wed, 17 Jan 2018 13:01:15 +0530 Message-Id: <1516174276-16789-4-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516174276-16789-1-git-send-email-tamizhr@codeaurora.org> References: <1516174276-16789-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: Pradeep Kumar Chitrapu Enable connection monitoring for AP mode which makes it possible to track signal strength of connected stations. Co-Developed-by: Tamizh Chelvam Signed-off-by: Pradeep Kumar Chitrapu Signed-off-by: Tamizh chelvam --- net/mac80211/cfg.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 46028e1..f290ca4 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2689,6 +2689,26 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, return 0; } +static void ieee80211_update_rssi_config(struct ieee80211_sub_if_data *sdata) +{ + if (!(sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_CQM_RSSI)) + return; + + /* tell the driver upon association, unless already associated */ + if (sdata->vif.type == NL80211_IFTYPE_STATION && + !sdata->u.mgd.associated) + return; + + /* if AP, always tell the driver by checking beacon status */ + if ((sdata->vif.type == NL80211_IFTYPE_AP || + sdata->vif.type == NL80211_IFTYPE_AP_VLAN || + sdata->vif.type == NL80211_IFTYPE_P2P_GO) && + !sdata->vif.bss_conf.enable_beacon) + return; + + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_CQM); +} + static int ieee80211_set_cqm_rssi_config(struct wiphy *wiphy, struct net_device *dev, s32 rssi_thold, u32 rssi_hyst) @@ -2711,11 +2731,7 @@ static int ieee80211_set_cqm_rssi_config(struct wiphy *wiphy, bss_conf->cqm_rssi_high = 0; sdata->u.mgd.last_cqm_event_signal = 0; - /* tell the driver upon association, unless already associated */ - if (sdata->u.mgd.associated && - sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_CQM_RSSI) - ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_CQM); - + ieee80211_update_rssi_config(sdata); return 0; } @@ -2736,11 +2752,7 @@ static int ieee80211_set_cqm_rssi_range_config(struct wiphy *wiphy, bss_conf->cqm_rssi_hyst = 0; sdata->u.mgd.last_cqm_event_signal = 0; - /* tell the driver upon association, unless already associated */ - if (sdata->u.mgd.associated && - sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_CQM_RSSI) - ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_CQM); - + ieee80211_update_rssi_config(sdata); return 0; }