ar2425.c (185380) | ar2425.c (185406) |
---|---|
1/* 2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 3 * Copyright (c) 2002-2008 Atheros Communications, Inc. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * --- 4 unchanged lines hidden (view full) --- 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * 17 * $Id: ar2425.c,v 1.8 2008/11/16 21:33:05 sam Exp $ 18 */ 19#include "opt_ah.h" 20 | 1/* 2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting 3 * Copyright (c) 2002-2008 Atheros Communications, Inc. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * --- 4 unchanged lines hidden (view full) --- 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * 17 * $Id: ar2425.c,v 1.8 2008/11/16 21:33:05 sam Exp $ 18 */ 19#include "opt_ah.h" 20 |
21#ifdef AH_SUPPORT_2425 22 | |
23#include "ah.h" 24#include "ah_internal.h" 25 26#include "ar5212/ar5212.h" 27#include "ar5212/ar5212reg.h" 28#include "ar5212/ar5212phy.h" 29 30#include "ah_eeprom_v3.h" 31 32#define AH_5212_2425 | 21#include "ah.h" 22#include "ah_internal.h" 23 24#include "ar5212/ar5212.h" 25#include "ar5212/ar5212reg.h" 26#include "ar5212/ar5212phy.h" 27 28#include "ah_eeprom_v3.h" 29 30#define AH_5212_2425 |
33#ifdef AH_SUPPORT_2417 | |
34#define AH_5212_2417 | 31#define AH_5212_2417 |
35#endif | |
36#include "ar5212/ar5212.ini" 37 38#define N(a) (sizeof(a)/sizeof(a[0])) 39 40struct ar2425State { 41 RF_HAL_FUNCS base; /* public state, must be first */ 42 uint16_t pcdacTable[PWR_TABLE_SIZE_2413]; 43 --- 162 unchanged lines hidden (view full) --- 206 207 /* Bank 7 Setup */ 208 RF_BANK_SETUP(priv, 7, modesIndex); 209 210 /* Write Analog registers */ 211 HAL_INI_WRITE_BANK(ah, ar5212Bank1_2425, priv->Bank1Data, regWrites); 212 HAL_INI_WRITE_BANK(ah, ar5212Bank2_2425, priv->Bank2Data, regWrites); 213 HAL_INI_WRITE_BANK(ah, ar5212Bank3_2425, priv->Bank3Data, regWrites); | 32#include "ar5212/ar5212.ini" 33 34#define N(a) (sizeof(a)/sizeof(a[0])) 35 36struct ar2425State { 37 RF_HAL_FUNCS base; /* public state, must be first */ 38 uint16_t pcdacTable[PWR_TABLE_SIZE_2413]; 39 --- 162 unchanged lines hidden (view full) --- 202 203 /* Bank 7 Setup */ 204 RF_BANK_SETUP(priv, 7, modesIndex); 205 206 /* Write Analog registers */ 207 HAL_INI_WRITE_BANK(ah, ar5212Bank1_2425, priv->Bank1Data, regWrites); 208 HAL_INI_WRITE_BANK(ah, ar5212Bank2_2425, priv->Bank2Data, regWrites); 209 HAL_INI_WRITE_BANK(ah, ar5212Bank3_2425, priv->Bank3Data, regWrites); |
214#ifdef AH_SUPPORT_2417 | |
215 if (IS_2417(ah)) { 216 HALASSERT(N(ar5212Bank6_2425) == N(ar5212Bank6_2417)); 217 HAL_INI_WRITE_BANK(ah, ar5212Bank6_2417, priv->Bank6Data, 218 regWrites); 219 } else | 210 if (IS_2417(ah)) { 211 HALASSERT(N(ar5212Bank6_2425) == N(ar5212Bank6_2417)); 212 HAL_INI_WRITE_BANK(ah, ar5212Bank6_2417, priv->Bank6Data, 213 regWrites); 214 } else |
220#endif /* AH_SUPPORT_2417 */ | |
221 HAL_INI_WRITE_BANK(ah, ar5212Bank6_2425, priv->Bank6Data, 222 regWrites); 223 HAL_INI_WRITE_BANK(ah, ar5212Bank7_2425, priv->Bank7Data, regWrites); 224 225 /* Now that we have reprogrammed rfgain value, clear the flag. */ 226 ahp->ah_rfgainState = HAL_RFGAIN_INACTIVE; 227 228 HALDEBUG(ah, HAL_DEBUG_RFPARAM, "<==%s\n", __func__); --- 454 unchanged lines hidden (view full) --- 683 ath_hal_free(ahp->ah_rfHal); 684 ahp->ah_rfHal = AH_NULL; 685} 686 687/* 688 * Allocate memory for analog bank scratch buffers 689 * Scratch Buffer will be reinitialized every reset so no need to zero now 690 */ | 215 HAL_INI_WRITE_BANK(ah, ar5212Bank6_2425, priv->Bank6Data, 216 regWrites); 217 HAL_INI_WRITE_BANK(ah, ar5212Bank7_2425, priv->Bank7Data, regWrites); 218 219 /* Now that we have reprogrammed rfgain value, clear the flag. */ 220 ahp->ah_rfgainState = HAL_RFGAIN_INACTIVE; 221 222 HALDEBUG(ah, HAL_DEBUG_RFPARAM, "<==%s\n", __func__); --- 454 unchanged lines hidden (view full) --- 677 ath_hal_free(ahp->ah_rfHal); 678 ahp->ah_rfHal = AH_NULL; 679} 680 681/* 682 * Allocate memory for analog bank scratch buffers 683 * Scratch Buffer will be reinitialized every reset so no need to zero now 684 */ |
691HAL_BOOL | 685static HAL_BOOL |
692ar2425RfAttach(struct ath_hal *ah, HAL_STATUS *status) 693{ 694 struct ath_hal_5212 *ahp = AH5212(ah); 695 struct ar2425State *priv; 696 697 HALASSERT(ah->ah_magic == AR5212_MAGIC); 698 699 HALASSERT(ahp->ah_rfHal == AH_NULL); --- 14 unchanged lines hidden (view full) --- 714 priv->base.getNfAdjust = ar5212GetNfAdjust; 715 716 ahp->ah_pcdacTable = priv->pcdacTable; 717 ahp->ah_pcdacTableSize = sizeof(priv->pcdacTable); 718 ahp->ah_rfHal = &priv->base; 719 720 return AH_TRUE; 721} | 686ar2425RfAttach(struct ath_hal *ah, HAL_STATUS *status) 687{ 688 struct ath_hal_5212 *ahp = AH5212(ah); 689 struct ar2425State *priv; 690 691 HALASSERT(ah->ah_magic == AR5212_MAGIC); 692 693 HALASSERT(ahp->ah_rfHal == AH_NULL); --- 14 unchanged lines hidden (view full) --- 708 priv->base.getNfAdjust = ar5212GetNfAdjust; 709 710 ahp->ah_pcdacTable = priv->pcdacTable; 711 ahp->ah_pcdacTableSize = sizeof(priv->pcdacTable); 712 ahp->ah_rfHal = &priv->base; 713 714 return AH_TRUE; 715} |
722#endif /* AH_SUPPORT_2425 */ | 716 717static HAL_BOOL 718ar2425Probe(struct ath_hal *ah) 719{ 720 return IS_2425(ah) || IS_2417(ah); 721} 722AH_RF(ar2425, ar2425Probe, ar2425RfAttach); |