summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/ath_hal
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2013-06-05 22:21:13 +0000
committeradrian <adrian@FreeBSD.org>2013-06-05 22:21:13 +0000
commit87c3bc4a47ab091af9cd5ab1622b2948b99e00ea (patch)
tree17039e230b0ba4cf8ee8636ce19a4ad2909d19c0 /sys/dev/ath/ath_hal
parentd8a34740631072e0636cc3f97248894c93780027 (diff)
downloadFreeBSD-src-87c3bc4a47ab091af9cd5ab1622b2948b99e00ea.zip
FreeBSD-src-87c3bc4a47ab091af9cd5ab1622b2948b99e00ea.tar.gz
As a temporary work-around (read: until there's a nice API for exposing
and controlling this form of antenna diversity) - print out the AR9285 antenna diversity configuration at attach time. This will help track down and diagose if/when people have connectivity issues on cards (eg if they connect a single antenna to LNA1, yet the card has RX configured to only occur on LNA2.) Tested: * AR9285 w/ antenna diversity enabled in EEPROM; * AR9285 w/ antenna diversity disabled in EEPROM; mapping only to a single antenna (LNA1.)
Diffstat (limited to 'sys/dev/ath/ath_hal')
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9285_attach.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
index 67a15b8..ce31174 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
@@ -105,6 +105,28 @@ ar9285AniSetup(struct ath_hal *ah)
ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE);
}
+static const char * ar9285_lna_conf[] = {
+ "LNA1-LNA2",
+ "LNA2",
+ "LNA1",
+ "LNA1+LNA2",
+};
+
+static void
+ar9285_eeprom_print_diversity_settings(struct ath_hal *ah)
+{
+ const HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom;
+ const MODAL_EEP4K_HEADER *pModal = &ee->ee_base.modalHeader;
+
+ ath_hal_printf(ah, "[ath] AR9285 Main LNA config: %s\n",
+ ar9285_lna_conf[(pModal->antdiv_ctl2 >> 2) & 0x3]);
+ ath_hal_printf(ah, "[ath] AR9285 Alt LNA config: %s\n",
+ ar9285_lna_conf[pModal->antdiv_ctl2 & 0x3]);
+ ath_hal_printf(ah, "[ath] LNA diversity %s, Diversity %s\n",
+ ((pModal->antdiv_ctl1 & 0x1) ? "enabled" : "disabled"),
+ ((pModal->antdiv_ctl1 & 0x8) ? "enabled" : "disabled"));
+}
+
/*
* Attach for an AR9285 part.
*/
@@ -309,6 +331,13 @@ ar9285Attach(uint16_t devid, HAL_SOFTC sc,
goto bad;
}
+ /*
+ * Print out the EEPROM antenna configuration mapping.
+ * Some devices have a hard-coded LNA configuration profile;
+ * others enable diversity.
+ */
+ ar9285_eeprom_print_diversity_settings(ah);
+
/* Print out whether the EEPROM settings enable AR9285 diversity */
if (ar9285_check_div_comb(ah)) {
ath_hal_printf(ah, "[ath] Enabling diversity for Kite\n");
OpenPOWER on IntegriCloud