diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_phy.c')
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_phy.c | 36 | 
1 files changed, 26 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index 1bc33f51e46..c83be2dd571 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c @@ -86,14 +86,31 @@ static int ar9003_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)  			channelSel = (freq * 4) / 120;  			chan_frac = (((freq * 4) % 120) * 0x20000) / 120;  			channelSel = (channelSel << 17) | chan_frac; +		} else if (AR_SREV_9340(ah)) { +			if (ah->is_clk_25mhz) { +				u32 chan_frac; + +				channelSel = (freq * 2) / 75; +				chan_frac = (((freq * 2) % 75) * 0x20000) / 75; +				channelSel = (channelSel << 17) | chan_frac; +			} else +				channelSel = CHANSEL_2G(freq) >> 1;  		} else  			channelSel = CHANSEL_2G(freq);  		/* Set to 2G mode */  		bMode = 1;  	} else { -		channelSel = CHANSEL_5G(freq); -		/* Doubler is ON, so, divide channelSel by 2. */ -		channelSel >>= 1; +		if (AR_SREV_9340(ah) && ah->is_clk_25mhz) { +			u32 chan_frac; + +			channelSel = (freq * 2) / 75; +			chan_frac = ((freq % 75) * 0x20000) / 75; +			channelSel = (channelSel << 17) | chan_frac; +		} else { +			channelSel = CHANSEL_5G(freq); +			/* Doubler is ON, so, divide channelSel by 2. */ +			channelSel >>= 1; +		}  		/* Set to 5G mode */  		bMode = 0;  	} @@ -151,7 +168,7 @@ static void ar9003_hw_spur_mitigate_mrc_cck(struct ath_hw *ah,  	 * is out-of-band and can be ignored.  	 */ -	if (AR_SREV_9485(ah)) { +	if (AR_SREV_9485(ah) || AR_SREV_9340(ah)) {  		spur_fbin_ptr = ar9003_get_spur_chan_ptr(ah,  							 IS_CHAN_2GHZ(chan));  		if (spur_fbin_ptr[0] == 0) /* No spur */ @@ -176,7 +193,7 @@ static void ar9003_hw_spur_mitigate_mrc_cck(struct ath_hw *ah,  	for (i = 0; i < max_spur_cnts; i++) {  		negative = 0; -		if (AR_SREV_9485(ah)) +		if (AR_SREV_9485(ah) || AR_SREV_9340(ah))  			cur_bb_spur = FBIN2FREQ(spur_fbin_ptr[i],  					IS_CHAN_2GHZ(chan)) - synth_freq;  		else @@ -599,29 +616,25 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,  	struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);  	unsigned int regWrites = 0, i;  	struct ieee80211_channel *channel = chan->chan; -	u32 modesIndex, freqIndex; +	u32 modesIndex;  	switch (chan->chanmode) {  	case CHANNEL_A:  	case CHANNEL_A_HT20:  		modesIndex = 1; -		freqIndex = 1;  		break;  	case CHANNEL_A_HT40PLUS:  	case CHANNEL_A_HT40MINUS:  		modesIndex = 2; -		freqIndex = 1;  		break;  	case CHANNEL_G:  	case CHANNEL_G_HT20:  	case CHANNEL_B:  		modesIndex = 4; -		freqIndex = 2;  		break;  	case CHANNEL_G_HT40PLUS:  	case CHANNEL_G_HT40MINUS:  		modesIndex = 3; -		freqIndex = 2;  		break;  	default: @@ -646,6 +659,9 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,  		REG_WRITE_ARRAY(&ah->iniModesAdditional,  				modesIndex, regWrites); +	if (AR_SREV_9340(ah) && !ah->is_clk_25mhz) +		REG_WRITE_ARRAY(&ah->iniModesAdditional_40M, 1, regWrites); +  	ar9003_hw_override_ini(ah);  	ar9003_hw_set_channel_regs(ah, chan);  	ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);  |