From patchwork Mon Oct 19 06:33:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Rodriguez X-Patchwork-Id: 54682 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9J6XrDH015232 for ; Mon, 19 Oct 2009 06:33:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754436AbZJSGdq (ORCPT ); Mon, 19 Oct 2009 02:33:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753830AbZJSGdq (ORCPT ); Mon, 19 Oct 2009 02:33:46 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:54689 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754004AbZJSGdm (ORCPT ); Mon, 19 Oct 2009 02:33:42 -0400 Received: from mcgrof by bombadil.infradead.org with local (Exim 4.69 #1 (Red Hat Linux)) id 1MzloR-0005OO-1l; Mon, 19 Oct 2009 06:33:47 +0000 From: "Luis R. Rodriguez" To: linux-wireless@vger.kernel.org Cc: ath9k-devel@venema.h4ckr.net, "Luis R. Rodriguez" Subject: [RFT 08/15] ath9k_hw: rename ath9k_hw_rf_free() to ath9k_hw_rf_free_ext_banks() Date: Mon, 19 Oct 2009 02:33:39 -0400 Message-Id: <1255934026-20686-9-git-send-email-lrodriguez@atheros.com> X-Mailer: git-send-email 1.6.2.rc1.3.g81d3f In-Reply-To: <1255934026-20686-1-git-send-email-lrodriguez@atheros.com> References: <1255934026-20686-1-git-send-email-lrodriguez@atheros.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 694629b..5a08b97 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -1282,7 +1282,8 @@ void ath9k_hw_detach(struct ath_hw *ah) ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP); free_hw: - ath9k_hw_rf_free(ah); + if (!AR_SREV_9280_10_OR_LATER(ah)) + ath9k_hw_rf_free_ext_banks(ah); kfree(ah); ah = NULL; } diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 8fe64cf..f9eb57b 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h @@ -628,7 +628,6 @@ static inline struct ath_regulatory *ath9k_hw_regulatory(struct ath_hw *ah) const char *ath9k_hw_probe(u16 vendorid, u16 devid); void ath9k_hw_detach(struct ath_hw *ah); int ath9k_hw_init(struct ath_hw *ah); -void ath9k_hw_rf_free(struct ath_hw *ah); int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, bool bChannelChange); void ath9k_hw_fill_cap_info(struct ath_hw *ah); diff --git a/drivers/net/wireless/ath/ath9k/phy.c b/drivers/net/wireless/ath/ath9k/phy.c index 923ea0b..d50b5ff 100644 --- a/drivers/net/wireless/ath/ath9k/phy.c +++ b/drivers/net/wireless/ath/ath9k/phy.c @@ -384,18 +384,20 @@ ath9k_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan, } /** - * ath9k_hw_rf_free - Free memory for analog bank scratch buffers + * ath9k_hw_rf_free_ext_banks - Free memory for analog bank scratch buffers * @ah: atheros hardware struture - * For the external AR2133/AR5133 radios. + * For the external AR2133/AR5133 radios banks. */ void -ath9k_hw_rf_free(struct ath_hw *ah) +ath9k_hw_rf_free_ext_banks(struct ath_hw *ah) { #define ATH_FREE_BANK(bank) do { \ kfree(bank); \ bank = NULL; \ } while (0); + BUG_ON(AR_SREV_9280_10_OR_LATER(ah)); + ATH_FREE_BANK(ah->analogBank0Data); ATH_FREE_BANK(ah->analogBank1Data); ATH_FREE_BANK(ah->analogBank2Data); @@ -405,6 +407,7 @@ ath9k_hw_rf_free(struct ath_hw *ah) ATH_FREE_BANK(ah->analogBank7Data); ATH_FREE_BANK(ah->addac5416_21); ATH_FREE_BANK(ah->bank6Temp); + #undef ATH_FREE_BANK } diff --git a/drivers/net/wireless/ath/ath9k/phy.h b/drivers/net/wireless/ath/ath9k/phy.h index fa1dce4..c083bbf 100644 --- a/drivers/net/wireless/ath/ath9k/phy.h +++ b/drivers/net/wireless/ath/ath9k/phy.h @@ -29,6 +29,8 @@ bool ath9k_hw_set_rf_regs(struct ath_hw *ah, u16 modesIndex); void ath9k_hw_decrease_chain_power(struct ath_hw *ah, struct ath9k_channel *chan); + +void ath9k_hw_rf_free_ext_banks(struct ath_hw *ah); int ath9k_hw_rf_alloc_ext_banks(struct ath_hw *ah); #define AR_PHY_BASE 0x9800