summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-06-12 06:01:53 +0000
committeradrian <adrian@FreeBSD.org>2013-06-12 06:01:53 +0000
commitcba1418efedac7ba586dbc2591b16cb3cb7e9c66 (patch)
tree4790a23ec7dc0a7b8d336dec1154182197208e52
parent12f3cde5409e2a538fb4b23813cc5a6816ea1949 (diff)
downloadFreeBSD-src-cba1418efedac7ba586dbc2591b16cb3cb7e9c66.zip
FreeBSD-src-cba1418efedac7ba586dbc2591b16cb3cb7e9c66.tar.gz
Remove the AR9285 specific structure for LNA diversity and use the HAL.
The AR9300 HAL update included the LNA diversity configuration information so it can be used in the AR9485 configuration code.
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c17
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9285_phy.c6
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9285_phy.h9
3 files changed, 13 insertions, 19 deletions
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c b/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c
index ee4bf5e..fa7e49b 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c
@@ -59,16 +59,16 @@ ath_is_alt_ant_ratio_better(int alt_ratio, int maxdelta, int mindelta,
static void
ath_lnaconf_alt_good_scan(struct ar9285_ant_comb *antcomb,
- struct ar9285_antcomb_conf ant_conf, int main_rssi_avg)
+ HAL_ANT_COMB_CONFIG *ant_conf, int main_rssi_avg)
{
antcomb->quick_scan_cnt = 0;
- if (ant_conf.main_lna_conf == HAL_ANT_DIV_COMB_LNA2)
+ if (ant_conf->main_lna_conf == HAL_ANT_DIV_COMB_LNA2)
antcomb->rssi_lna2 = main_rssi_avg;
- else if (ant_conf.main_lna_conf == HAL_ANT_DIV_COMB_LNA1)
+ else if (ant_conf->main_lna_conf == HAL_ANT_DIV_COMB_LNA1)
antcomb->rssi_lna1 = main_rssi_avg;
- switch ((ant_conf.main_lna_conf << 4) | ant_conf.alt_lna_conf) {
+ switch ((ant_conf->main_lna_conf << 4) | ant_conf->alt_lna_conf) {
case (0x10): /* LNA2 A-B */
antcomb->main_conf = HAL_ANT_DIV_COMB_LNA1_MINUS_LNA2;
antcomb->first_quick_scan_conf =
@@ -114,7 +114,7 @@ ath_lnaconf_alt_good_scan(struct ar9285_ant_comb *antcomb,
static void
ath_select_ant_div_from_quick_scan(struct ar9285_ant_comb *antcomb,
- struct ar9285_antcomb_conf *div_ant_conf, int main_rssi_avg,
+ HAL_ANT_COMB_CONFIG *div_ant_conf, int main_rssi_avg,
int alt_rssi_avg, int alt_ratio)
{
/* alt_good */
@@ -312,7 +312,7 @@ ath_select_ant_div_from_quick_scan(struct ar9285_ant_comb *antcomb,
}
static void
-ath_ant_div_conf_fast_divbias(struct ar9285_antcomb_conf *ant_conf)
+ath_ant_div_conf_fast_divbias(HAL_ANT_COMB_CONFIG *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) {
@@ -362,7 +362,7 @@ void
ar9285_ant_comb_scan(struct ath_hal *ah, struct ath_rx_status *rs,
unsigned long ticks, int hz)
{
- struct ar9285_antcomb_conf div_ant_conf;
+ HAL_ANT_COMB_CONFIG div_ant_conf;
struct ar9285_ant_comb *antcomb = &AH9285(ah)->ant_comb;
int alt_ratio = 0, alt_rssi_avg = 0, main_rssi_avg = 0, curr_alt_set;
int curr_main_set, curr_bias;
@@ -431,6 +431,7 @@ ar9285_ant_comb_scan(struct ath_hal *ah, struct ath_rx_status *rs,
antcomb->total_pkt_count);
}
+ OS_MEMZERO(&div_ant_conf, sizeof(div_ant_conf));
ar9285_antdiv_comb_conf_get(ah, &div_ant_conf);
curr_alt_set = div_ant_conf.alt_lna_conf;
curr_main_set = div_ant_conf.main_lna_conf;
@@ -440,7 +441,7 @@ ar9285_ant_comb_scan(struct ath_hal *ah, struct ath_rx_status *rs,
if (antcomb->count == ATH_ANT_DIV_COMB_MAX_COUNT) {
if (alt_ratio > ATH_ANT_DIV_COMB_ALT_ANT_RATIO) {
- ath_lnaconf_alt_good_scan(antcomb, div_ant_conf,
+ ath_lnaconf_alt_good_scan(antcomb, &div_ant_conf,
main_rssi_avg);
antcomb->alt_good = AH_TRUE;
} else {
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c b/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c
index b28b97f..0ccad31 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c
@@ -40,8 +40,7 @@
#include "ar9002/ar9285_phy.h"
void
-ar9285_antdiv_comb_conf_get(struct ath_hal *ah,
- struct ar9285_antcomb_conf *antconf)
+ar9285_antdiv_comb_conf_get(struct ath_hal *ah, HAL_ANT_COMB_CONFIG *antconf)
{
uint32_t regval;
@@ -55,8 +54,7 @@ ar9285_antdiv_comb_conf_get(struct ath_hal *ah,
}
void
-ar9285_antdiv_comb_conf_set(struct ath_hal *ah,
- struct ar9285_antcomb_conf *antconf)
+ar9285_antdiv_comb_conf_set(struct ath_hal *ah, HAL_ANT_COMB_CONFIG *antconf)
{
uint32_t regval;
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_phy.h b/sys/dev/ath/ath_hal/ar9002/ar9285_phy.h
index b236718..0255e17 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9285_phy.h
+++ b/sys/dev/ath/ath_hal/ar9002/ar9285_phy.h
@@ -31,16 +31,11 @@
/*
* Manipulate AR9285 antenna diversity configuration
*/
-struct ar9285_antcomb_conf {
- uint8_t main_lna_conf;
- uint8_t alt_lna_conf;
- uint8_t fast_div_bias;
-};
extern void ar9285_antdiv_comb_conf_set(struct ath_hal *ah,
- struct ar9285_antcomb_conf *antconf);
+ HAL_ANT_COMB_CONFIG *antconf);
extern void ar9285_antdiv_comb_conf_get(struct ath_hal *ah,
- struct ar9285_antcomb_conf *antconf);
+ HAL_ANT_COMB_CONFIG *antconf);
extern HAL_BOOL ar9285_check_div_comb(struct ath_hal *ah);
#endif
OpenPOWER on IntegriCloud