From patchwork Mon Jul 9 09:14:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujith Manoharan X-Patchwork-Id: 1171681 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7E74840B2F for ; Mon, 9 Jul 2012 09:27:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752689Ab2GIJQL (ORCPT ); Mon, 9 Jul 2012 05:16:11 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:64728 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752633Ab2GIJQK (ORCPT ); Mon, 9 Jul 2012 05:16:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1341825371; x=1373361371; h=from:mime-version:content-transfer-encoding:message-id: date:to:cc:subject; bh=Yd5WbBXWlBZgecKelSHuiWmel99tMdru/5a21ozhwYk=; b=oCHc74reaLB72vNcX3dE+Gs3zUYHg/sa1JeINh0gShf1ESqpDxB072yH BTDvZ568Sgonr4Nn3g+pjxbjwAWp1FPtoyAWcd3tJT+Z90SpQeHo2IKsY RdIc1yqciZi7PrRx0S1X1L6cmbpNliqTigiXg2kSKc/oek8ROk/ZLd6y4 k=; X-IronPort-AV: E=McAfee;i="5400,1158,6766"; a="206244797" Received: from ironmsg04-r.qualcomm.com ([172.30.46.18]) by wolverine02.qualcomm.com with ESMTP; 09 Jul 2012 02:16:11 -0700 X-IronPort-AV: E=Sophos;i="4.77,551,1336374000"; d="scan'208";a="342487876" Received: from nasanexhc07.na.qualcomm.com ([172.30.39.190]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 09 Jul 2012 02:16:11 -0700 Received: from sarge (172.30.39.5) by qcmail1.qualcomm.com (172.30.39.190) with Microsoft SMTP Server (TLS) id 14.2.309.2; Mon, 9 Jul 2012 02:16:09 -0700 From: Sujith Manoharan MIME-Version: 1.0 Message-ID: <20474.41227.340474.446454@gargle.gargle.HOWL> Date: Mon, 9 Jul 2012 14:44:51 +0530 To: X-Mailer: VM 8.2.0b under 24.1.1 (x86_64-unknown-linux-gnu) CC: Subject: [RFC/WIP 03/11] ath9k: Cleanup interface handling X-Originating-IP: [172.30.39.5] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org * Do not set/clear TSF when adding/deleting an interface. This should be done when the BSS is set up and should also take into account the existence of other interfaces. * Set opmode explicitly. * ANI setup needs to be decided based on multiple interfaces. This can be done via the bss_info_changed() callback. Signed-off-by: Sujith Manoharan --- drivers/net/wireless/ath/ath9k/main.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 1265add..2619bd3 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -913,11 +913,9 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw, if (iter_data.naps > 0) { ath9k_hw_set_tsfadjust(ah, true); - set_bit(SC_OP_TSF_RESET, &sc->sc_flags); ah->opmode = NL80211_IFTYPE_AP; } else { ath9k_hw_set_tsfadjust(ah, false); - clear_bit(SC_OP_TSF_RESET, &sc->sc_flags); if (iter_data.nmeshes) ah->opmode = NL80211_IFTYPE_MESH_POINT; @@ -929,25 +927,14 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw, ah->opmode = NL80211_IFTYPE_STATION; } + ath9k_hw_setopmode(ah); + if ((iter_data.nstations + iter_data.nadhocs + iter_data.nmeshes) > 0) ah->imask |= ATH9K_INT_TSFOOR; else ah->imask &= ~ATH9K_INT_TSFOOR; ath9k_hw_set_interrupts(ah); - - if (iter_data.naps > 0) { - sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; - - if (!common->disable_ani) { - set_bit(SC_OP_ANI_RUN, &sc->sc_flags); - ath_start_ani(common); - } - - } else { - clear_bit(SC_OP_ANI_RUN, &sc->sc_flags); - del_timer_sync(&common->ani.timer); - } } static int ath9k_add_interface(struct ieee80211_hw *hw,