Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37398 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751066AbeBHLqx (ORCPT ); Thu, 8 Feb 2018 06:46:53 -0500 From: Timothy Redaelli To: linux-wireless@vger.kernel.org Cc: QCA ath9k Development , Felix Fietkau Subject: [PATCH] ath9k: fix DFS detector synchronization Date: Thu, 8 Feb 2018 12:46:47 +0100 Message-Id: (sfid-20180208_124657_564101_67AB3A68) Sender: linux-wireless-owner@vger.kernel.org List-ID: The code currently syncronize the DFS region only if curchan != 0, but hostapd launch DFS before the channel is set and so set_dfs_domain is never executed. CC: Felix Fietkau Signed-off-by: Timothy Redaelli --- drivers/net/wireless/ath/ath9k/init.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index e479fae5aab9..b71b16715f6a 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -257,6 +257,11 @@ static void ath9k_reg_notifier(struct wiphy *wiphy, ath_reg_notifier_apply(wiphy, request, reg); + /* synchronize DFS detector if regulatory domain changed */ + if (sc->dfs_detector != NULL) + sc->dfs_detector->set_dfs_domain(sc->dfs_detector, + request->dfs_region); + /* Set tx power */ if (!ah->curchan) return; @@ -267,10 +272,6 @@ static void ath9k_reg_notifier(struct wiphy *wiphy, ath9k_cmn_update_txpow(ah, sc->cur_chan->cur_txpower, sc->cur_chan->txpower, &sc->cur_chan->cur_txpower); - /* synchronize DFS detector if regulatory domain changed */ - if (sc->dfs_detector != NULL) - sc->dfs_detector->set_dfs_domain(sc->dfs_detector, - request->dfs_region); ath9k_ps_restore(sc); } -- 2.14.3