Return-path: Received: from s72.web-hosting.com ([198.187.29.22]:39795 "EHLO s72.web-hosting.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751774AbaJJJLp (ORCPT ); Fri, 10 Oct 2014 05:11:45 -0400 From: Sujith Manoharan To: John Linville Cc: linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com Subject: [PATCH] ath9k: Send AUTHORIZED event only for station mode Date: Fri, 10 Oct 2014 14:42:38 +0530 Message-Id: <1412932358-11824-1-git-send-email-sujith@msujith.org> (sfid-20141010_111149_407861_DCC0C45C) Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Sujith Manoharan ATH_CHANCTX_EVENT_AUTHORIZED is required to trigger the MCC scheduler when a station interface becomes authorized. But, since the driver gets station state notifications when the current operating mode is AP too, make sure that we send ATH_CHANCTX_EVENT_AUTHORIZED only when the interface is in station mode. Signed-off-by: Sujith Manoharan --- drivers/net/wireless/ath/ath9k/main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 2048ef1..0545fe6 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -1590,10 +1590,12 @@ static int ath9k_sta_state(struct ieee80211_hw *hw, } if (ath9k_is_chanctx_enabled()) { - if (old_state == IEEE80211_STA_ASSOC && - new_state == IEEE80211_STA_AUTHORIZED) - ath_chanctx_event(sc, vif, - ATH_CHANCTX_EVENT_AUTHORIZED); + if (vif->type == NL80211_IFTYPE_STATION) { + if (old_state == IEEE80211_STA_ASSOC && + new_state == IEEE80211_STA_AUTHORIZED) + ath_chanctx_event(sc, vif, + ATH_CHANCTX_EVENT_AUTHORIZED); + } } return ret; -- 2.1.2