diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 11:47:58 -0700 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-04 11:47:58 -0700 | 
| commit | 6ba74014c1ab0e37af7de6f64b4eccbbae3cb9e7 (patch) | |
| tree | 8f3892fc44f1e403675a6d7e88fda5c70e56ee4c /drivers/net/wireless/ath/ath9k/ar9002_phy.c | |
| parent | 5abd9ccced7a726c817dd6b5b96bc933859138d1 (diff) | |
| parent | 3ff1c25927e3af61c6bf0e4ed959504058ae4565 (diff) | |
| download | olio-linux-3.10-6ba74014c1ab0e37af7de6f64b4eccbbae3cb9e7.tar.xz olio-linux-3.10-6ba74014c1ab0e37af7de6f64b4eccbbae3cb9e7.zip  | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1443 commits)
  phy/marvell: add 88ec048 support
  igb: Program MDICNFG register prior to PHY init
  e1000e: correct MAC-PHY interconnect register offset for 82579
  hso: Add new product ID
  can: Add driver for esd CAN-USB/2 device
  l2tp: fix export of header file for userspace
  can-raw: Fix skb_orphan_try handling
  Revert "net: remove zap_completion_queue"
  net: cleanup inclusion
  phy/marvell: add 88e1121 interface mode support
  u32: negative offset fix
  net: Fix a typo from "dev" to "ndev"
  igb: Use irq_synchronize per vector when using MSI-X
  ixgbevf: fix null pointer dereference due to filter being set for VLAN 0
  e1000e: Fix irq_synchronize in MSI-X case
  e1000e: register pm_qos request on hardware activation
  ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice
  net: Add getsockopt support for TCP thin-streams
  cxgb4: update driver version
  cxgb4: add new PCI IDs
  ...
Manually fix up conflicts in:
 - drivers/net/e1000e/netdev.c: due to pm_qos registration
   infrastructure changes
 - drivers/net/phy/marvell.c: conflict between adding 88ec048 support
   and cleaning up the IDs
 - drivers/net/wireless/ipw2x00/ipw2100.c: trivial ipw2100_pm_qos_req
   conflict (registration change vs marking it static)
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9002_phy.c')
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9002_phy.c | 71 | 
1 files changed, 34 insertions, 37 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_phy.c b/drivers/net/wireless/ath/ath9k/ar9002_phy.c index ed314e89bfe..adbf031fbc5 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c @@ -471,52 +471,47 @@ static u32 ar9002_hw_compute_pll_control(struct ath_hw *ah,  static void ar9002_hw_do_getnf(struct ath_hw *ah,  			      int16_t nfarray[NUM_NF_READINGS])  { -	struct ath_common *common = ath9k_hw_common(ah);  	int16_t nf;  	nf = MS(REG_READ(ah, AR_PHY_CCA), AR9280_PHY_MINCCA_PWR); - -	if (nf & 0x100) -		nf = 0 - ((nf ^ 0x1ff) + 1); -	ath_print(common, ATH_DBG_CALIBRATE, -		  "NF calibrated [ctl] [chain 0] is %d\n", nf); - -	if (AR_SREV_9271(ah) && (nf >= -114)) -		nf = -116; - -	nfarray[0] = nf; - -	if (!AR_SREV_9285(ah) && !AR_SREV_9271(ah)) { -		nf = MS(REG_READ(ah, AR_PHY_CH1_CCA), -				AR9280_PHY_CH1_MINCCA_PWR); - -		if (nf & 0x100) -			nf = 0 - ((nf ^ 0x1ff) + 1); -		ath_print(common, ATH_DBG_CALIBRATE, -			  "NF calibrated [ctl] [chain 1] is %d\n", nf); -		nfarray[1] = nf; -	} +	nfarray[0] = sign_extend(nf, 9);  	nf = MS(REG_READ(ah, AR_PHY_EXT_CCA), AR9280_PHY_EXT_MINCCA_PWR); -	if (nf & 0x100) -		nf = 0 - ((nf ^ 0x1ff) + 1); -	ath_print(common, ATH_DBG_CALIBRATE, -		  "NF calibrated [ext] [chain 0] is %d\n", nf); +	if (IS_CHAN_HT40(ah->curchan)) +		nfarray[3] = sign_extend(nf, 9); -	if (AR_SREV_9271(ah) && (nf >= -114)) -		nf = -116; +	if (AR_SREV_9285(ah) || AR_SREV_9271(ah)) +		return; -	nfarray[3] = nf; +	nf = MS(REG_READ(ah, AR_PHY_CH1_CCA), AR9280_PHY_CH1_MINCCA_PWR); +	nfarray[1] = sign_extend(nf, 9); -	if (!AR_SREV_9285(ah) && !AR_SREV_9271(ah)) { -		nf = MS(REG_READ(ah, AR_PHY_CH1_EXT_CCA), -				AR9280_PHY_CH1_EXT_MINCCA_PWR); +	nf = MS(REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR9280_PHY_CH1_EXT_MINCCA_PWR); +	if (IS_CHAN_HT40(ah->curchan)) +		nfarray[4] = sign_extend(nf, 9); +} -		if (nf & 0x100) -			nf = 0 - ((nf ^ 0x1ff) + 1); -		ath_print(common, ATH_DBG_CALIBRATE, -			  "NF calibrated [ext] [chain 1] is %d\n", nf); -		nfarray[4] = nf; +static void ar9002_hw_set_nf_limits(struct ath_hw *ah) +{ +	if (AR_SREV_9285(ah)) { +		ah->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9285_2GHZ; +		ah->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_9285_2GHZ; +		ah->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9285_2GHZ; +	} else if (AR_SREV_9287(ah)) { +		ah->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9287_2GHZ; +		ah->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_9287_2GHZ; +		ah->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9287_2GHZ; +	} else if (AR_SREV_9271(ah)) { +		ah->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9271_2GHZ; +		ah->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_9271_2GHZ; +		ah->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9271_2GHZ; +	} else { +		ah->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9280_2GHZ; +		ah->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_9280_2GHZ; +		ah->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9280_2GHZ; +		ah->nf_5g.max = AR_PHY_CCA_MAX_GOOD_VAL_9280_5GHZ; +		ah->nf_5g.min = AR_PHY_CCA_MIN_GOOD_VAL_9280_5GHZ; +		ah->nf_5g.nominal = AR_PHY_CCA_NOM_VAL_9280_5GHZ;  	}  } @@ -532,4 +527,6 @@ void ar9002_hw_attach_phy_ops(struct ath_hw *ah)  	priv_ops->olc_init = ar9002_olc_init;  	priv_ops->compute_pll_control = ar9002_hw_compute_pll_control;  	priv_ops->do_getnf = ar9002_hw_do_getnf; + +	ar9002_hw_set_nf_limits(ah);  }  |