From patchwork Tue Jul 17 11:46:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujith Manoharan X-Patchwork-Id: 1204811 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C61E1DF25A for ; Tue, 17 Jul 2012 11:47:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751979Ab2GQLrX (ORCPT ); Tue, 17 Jul 2012 07:47:23 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:14565 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751000Ab2GQLrX (ORCPT ); Tue, 17 Jul 2012 07:47:23 -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=1342525644; x=1374061644; h=from:mime-version:content-transfer-encoding:message-id: date:to:cc:subject; bh=6z3bnpQrtPbTWGWwtyC1Uevb/0/elOAQXPLWbXss4F0=; b=U19brApk4sDLx5yIRI9X0WY7G4wNOiRfO0EOo9itHQL7BJqLugMBN6/C X+KJ2MDOtLgR4vyK8tJm17x2tEmqOSXPrG+YNpRXWgtS6Tx8Wyb/yWlOK hlZOFv25UzQE0lVl5x8v8EzAkEY4o3BUEsqrbmsE/4nSU7dxIe3yxiOv/ E=; X-IronPort-AV: E=McAfee;i="5400,1158,6774"; a="211384341" Received: from ironmsg03-l.qualcomm.com ([172.30.48.18]) by wolverine01.qualcomm.com with ESMTP; 17 Jul 2012 04:47:23 -0700 X-IronPort-AV: E=Sophos;i="4.77,601,1336374000"; d="scan'208";a="285877732" Received: from nasanexhc04.na.qualcomm.com ([172.30.48.17]) by Ironmsg03-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 17 Jul 2012 04:47:23 -0700 Received: from sarge (172.30.48.1) by qcmail1.qualcomm.com (172.30.48.17) with Microsoft SMTP Server (TLS) id 14.2.309.2; Tue, 17 Jul 2012 04:47:21 -0700 From: Sujith Manoharan MIME-Version: 1.0 Message-ID: <20485.20603.389613.955872@gargle.gargle.HOWL> Date: Tue, 17 Jul 2012 17:16:03 +0530 To: X-Mailer: VM 8.2.0b under 24.1.1 (x86_64-unknown-linux-gnu) CC: Subject: [PATCH 06/12] ath9k: Remove is_bslot_active X-Originating-IP: [172.30.48.1] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org In the tx_last_beacon() callback, mac80211's beaconing status can be used instead. The beacon tasklet doesn't require it because it is disabled when removing a slot. Signed-off-by: Sujith Manoharan --- drivers/net/wireless/ath/ath9k/ath9k.h | 2 +- drivers/net/wireless/ath/ath9k/beacon.c | 15 +++++---------- drivers/net/wireless/ath/ath9k/main.c | 5 +++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index a4dd5b1..641ca9e 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -360,7 +360,7 @@ void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, struct ath_vif { int av_bslot; - bool is_bslot_active, primary_sta_vif; + bool primary_sta_vif; __le64 tsf_adjust; /* TSF adjustment for staggered beacons */ struct ath_buf *av_bcbuf; }; diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index a79ec45..2962b3e 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c @@ -134,20 +134,17 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw, struct ath_softc *sc = hw->priv; struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_buf *bf; - struct ath_vif *avp; + struct ath_vif *avp = (void *)vif->drv_priv; struct sk_buff *skb; - struct ath_txq *cabq; + struct ath_txq *cabq = sc->beacon.cabq; struct ieee80211_tx_info *info; int cabq_depth; - ath9k_reset_beacon_status(sc); - - avp = (void *)vif->drv_priv; - cabq = sc->beacon.cabq; - - if ((avp->av_bcbuf == NULL) || !avp->is_bslot_active) + if (avp->av_bcbuf == NULL) return NULL; + ath9k_reset_beacon_status(sc); + /* Release the old beacon first */ bf = avp->av_bcbuf; @@ -234,7 +231,6 @@ void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif) for (slot = 0; slot < ATH_BCBUF; slot++) { if (sc->beacon.bslot[slot] == NULL) { avp->av_bslot = slot; - avp->is_bslot_active = false; break; } } @@ -267,7 +263,6 @@ void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif) } avp->av_bcbuf = NULL; - avp->is_bslot_active = false; sc->beacon.bslot[avp->av_bslot] = NULL; sc->nbcnvifs--; list_add_tail(&bf->list, &sc->beacon.bbuf); diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 6a7dfbb..e58c657 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -1787,10 +1787,11 @@ static int ath9k_tx_last_beacon(struct ieee80211_hw *hw) if (!vif) return 0; - avp = (void *)vif->drv_priv; - if (!avp->is_bslot_active) + if (!vif->bss_conf.enable_beacon) return 0; + avp = (void *)vif->drv_priv; + if (!sc->beacon.tx_processed && !edma) { tasklet_disable(&sc->bcon_tasklet);