diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 14:43:13 -0700 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 14:43:13 -0700 | 
| commit | 951cc93a7493a81a47e20231441bc6cf17c98a37 (patch) | |
| tree | f53934f0f225e0215a85c8c59af4c6513e89e3f1 /drivers/net/wireless/ath/ath9k/recv.c | |
| parent | a7e1aabb28e8154ce987b622fd78d80a1ca39361 (diff) | |
| parent | 415b3334a21aa67806c52d1acf4e72e14f7f402f (diff) | |
| download | olio-linux-3.10-951cc93a7493a81a47e20231441bc6cf17c98a37.tar.xz olio-linux-3.10-951cc93a7493a81a47e20231441bc6cf17c98a37.zip  | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1287 commits)
  icmp: Fix regression in nexthop resolution during replies.
  net: Fix ppc64 BPF JIT dependencies.
  acenic: include NET_SKB_PAD headroom to incoming skbs
  ixgbe: convert to ndo_fix_features
  ixgbe: only enable WoL for magic packet by default
  ixgbe: remove ifdef check for non-existent define
  ixgbe: Pass staterr instead of re-reading status and error bits from descriptor
  ixgbe: Move interrupt related values out of ring and into q_vector
  ixgbe: add structure for containing RX/TX rings to q_vector
  ixgbe: inline the ixgbe_maybe_stop_tx function
  ixgbe: Update ATR to use recorded TX queues instead of CPU for routing
  igb: Fix for DH89xxCC near end loopback test
  e1000: always call e1000_check_for_link() on e1000_ce4100 MACs.
  netxen: add fw version compatibility check
  be2net: request native mode each time the card is reset
  ipv4: Constrain UFO fragment sizes to multiples of 8 bytes
  virtio_net: Fix panic in virtnet_remove
  ipv6: make fragment identifications less predictable
  ipv6: unshare inetpeers
  can: make function can_get_bittiming static
  ...
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/recv.c')
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 147 | 
1 files changed, 115 insertions, 32 deletions
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 07e35e59c9e..70dc8ecdad4 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c @@ -14,6 +14,7 @@   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.   */ +#include <linux/dma-mapping.h>  #include "ath9k.h"  #include "ar9003_mac.h" @@ -39,6 +40,7 @@ static inline bool ath_ant_div_comb_alt_check(u8 div_group, int alt_ratio,  			result = true;  		break;  	case 1: +	case 2:  		if ((((curr_main_set == ATH_ANT_DIV_COMB_LNA2) &&  			(curr_alt_set == ATH_ANT_DIV_COMB_LNA1) &&  				(alt_rssi_avg >= (main_rssi_avg - 5))) || @@ -1075,39 +1077,39 @@ static void ath_lnaconf_alt_good_scan(struct ath_ant_comb *antcomb,  		antcomb->rssi_lna1 = main_rssi_avg;  	switch ((ant_conf.main_lna_conf << 4) | ant_conf.alt_lna_conf) { -	case (0x10): /* LNA2 A-B */ +	case 0x10: /* LNA2 A-B */  		antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2;  		antcomb->first_quick_scan_conf =  			ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2;  		antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA1;  		break; -	case (0x20): /* LNA1 A-B */ +	case 0x20: /* LNA1 A-B */  		antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2;  		antcomb->first_quick_scan_conf =  			ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2;  		antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA2;  		break; -	case (0x21): /* LNA1 LNA2 */ +	case 0x21: /* LNA1 LNA2 */  		antcomb->main_conf = ATH_ANT_DIV_COMB_LNA2;  		antcomb->first_quick_scan_conf =  			ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2;  		antcomb->second_quick_scan_conf =  			ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2;  		break; -	case (0x12): /* LNA2 LNA1 */ +	case 0x12: /* LNA2 LNA1 */  		antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1;  		antcomb->first_quick_scan_conf =  			ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2;  		antcomb->second_quick_scan_conf =  			ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2;  		break; -	case (0x13): /* LNA2 A+B */ +	case 0x13: /* LNA2 A+B */  		antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2;  		antcomb->first_quick_scan_conf =  			ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2;  		antcomb->second_quick_scan_conf = ATH_ANT_DIV_COMB_LNA1;  		break; -	case (0x23): /* LNA1 A+B */ +	case 0x23: /* LNA1 A+B */  		antcomb->main_conf = ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2;  		antcomb->first_quick_scan_conf =  			ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2; @@ -1324,65 +1326,148 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,  		/* Adjust the fast_div_bias based on main and alt lna conf */  		switch ((ant_conf->main_lna_conf << 4) |  				ant_conf->alt_lna_conf) { -		case (0x01): /* A-B LNA2 */ +		case 0x01: /* A-B LNA2 */  			ant_conf->fast_div_bias = 0x3b;  			break; -		case (0x02): /* A-B LNA1 */ +		case 0x02: /* A-B LNA1 */  			ant_conf->fast_div_bias = 0x3d;  			break; -		case (0x03): /* A-B A+B */ +		case 0x03: /* A-B A+B */  			ant_conf->fast_div_bias = 0x1;  			break; -		case (0x10): /* LNA2 A-B */ +		case 0x10: /* LNA2 A-B */  			ant_conf->fast_div_bias = 0x7;  			break; -		case (0x12): /* LNA2 LNA1 */ +		case 0x12: /* LNA2 LNA1 */  			ant_conf->fast_div_bias = 0x2;  			break; -		case (0x13): /* LNA2 A+B */ +		case 0x13: /* LNA2 A+B */  			ant_conf->fast_div_bias = 0x7;  			break; -		case (0x20): /* LNA1 A-B */ +		case 0x20: /* LNA1 A-B */  			ant_conf->fast_div_bias = 0x6;  			break; -		case (0x21): /* LNA1 LNA2 */ +		case 0x21: /* LNA1 LNA2 */  			ant_conf->fast_div_bias = 0x0;  			break; -		case (0x23): /* LNA1 A+B */ +		case 0x23: /* LNA1 A+B */  			ant_conf->fast_div_bias = 0x6;  			break; -		case (0x30): /* A+B A-B */ +		case 0x30: /* A+B A-B */  			ant_conf->fast_div_bias = 0x1;  			break; -		case (0x31): /* A+B LNA2 */ +		case 0x31: /* A+B LNA2 */  			ant_conf->fast_div_bias = 0x3b;  			break; -		case (0x32): /* A+B LNA1 */ +		case 0x32: /* A+B LNA1 */  			ant_conf->fast_div_bias = 0x3d;  			break;  		default:  			break;  		} +	} else if (ant_conf->div_group == 1) { +		/* Adjust the fast_div_bias based on main and alt_lna_conf */ +		switch ((ant_conf->main_lna_conf << 4) | +			ant_conf->alt_lna_conf) { +		case 0x01: /* A-B LNA2 */ +			ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x02: /* A-B LNA1 */ +			ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x03: /* A-B A+B */ +			ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x10: /* LNA2 A-B */ +			if (!(antcomb->scan) && +			    (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO)) +				ant_conf->fast_div_bias = 0x3f; +			else +				ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x12: /* LNA2 LNA1 */ +			ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x13: /* LNA2 A+B */ +			if (!(antcomb->scan) && +			    (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO)) +				ant_conf->fast_div_bias = 0x3f; +			else +				ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x20: /* LNA1 A-B */ +			if (!(antcomb->scan) && +			    (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO)) +				ant_conf->fast_div_bias = 0x3f; +			else +				ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x21: /* LNA1 LNA2 */ +			ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x23: /* LNA1 A+B */ +			if (!(antcomb->scan) && +			    (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO)) +				ant_conf->fast_div_bias = 0x3f; +			else +				ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x30: /* A+B A-B */ +			ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x31: /* A+B LNA2 */ +			ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		case 0x32: /* A+B LNA1 */ +			ant_conf->fast_div_bias = 0x1; +			ant_conf->main_gaintb = 0; +			ant_conf->alt_gaintb = 0; +			break; +		default: +			break; +		}  	} else if (ant_conf->div_group == 2) {  		/* Adjust the fast_div_bias based on main and alt_lna_conf */  		switch ((ant_conf->main_lna_conf << 4) |  				ant_conf->alt_lna_conf) { -		case (0x01): /* A-B LNA2 */ +		case 0x01: /* A-B LNA2 */  			ant_conf->fast_div_bias = 0x1;  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x02): /* A-B LNA1 */ +		case 0x02: /* A-B LNA1 */  			ant_conf->fast_div_bias = 0x1;  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x03): /* A-B A+B */ +		case 0x03: /* A-B A+B */  			ant_conf->fast_div_bias = 0x1;  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x10): /* LNA2 A-B */ +		case 0x10: /* LNA2 A-B */  			if (!(antcomb->scan) &&  				(alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO))  				ant_conf->fast_div_bias = 0x1; @@ -1391,12 +1476,12 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x12): /* LNA2 LNA1 */ +		case 0x12: /* LNA2 LNA1 */  			ant_conf->fast_div_bias = 0x1;  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x13): /* LNA2 A+B */ +		case 0x13: /* LNA2 A+B */  			if (!(antcomb->scan) &&  				(alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO))  				ant_conf->fast_div_bias = 0x1; @@ -1405,7 +1490,7 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x20): /* LNA1 A-B */ +		case 0x20: /* LNA1 A-B */  			if (!(antcomb->scan) &&  				(alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO))  				ant_conf->fast_div_bias = 0x1; @@ -1414,12 +1499,12 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x21): /* LNA1 LNA2 */ +		case 0x21: /* LNA1 LNA2 */  			ant_conf->fast_div_bias = 0x1;  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x23): /* LNA1 A+B */ +		case 0x23: /* LNA1 A+B */  			if (!(antcomb->scan) &&  				(alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO))  				ant_conf->fast_div_bias = 0x1; @@ -1428,17 +1513,17 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x30): /* A+B A-B */ +		case 0x30: /* A+B A-B */  			ant_conf->fast_div_bias = 0x1;  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x31): /* A+B LNA2 */ +		case 0x31: /* A+B LNA2 */  			ant_conf->fast_div_bias = 0x1;  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0;  			break; -		case (0x32): /* A+B LNA1 */ +		case 0x32: /* A+B LNA1 */  			ant_conf->fast_div_bias = 0x1;  			ant_conf->main_gaintb = 0;  			ant_conf->alt_gaintb = 0; @@ -1446,9 +1531,7 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,  		default:  			break;  		} -  	} -  }  /* Antenna diversity and combining */  |