summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2011-08-03 13:39:11 +0000
committeradrian <adrian@FreeBSD.org>2011-08-03 13:39:11 +0000
commit0ac1b3709ed0f81448f50c9b71d285b0c5e50b78 (patch)
tree27390a1eb70e61063f8dcd39aae660c0e7a9bc87
parent4c59a0b47be4a2340ee3348d80cde595ea9c43d0 (diff)
downloadFreeBSD-src-0ac1b3709ed0f81448f50c9b71d285b0c5e50b78.zip
FreeBSD-src-0ac1b3709ed0f81448f50c9b71d285b0c5e50b78.tar.gz
Add in a dirty hack that allows for AR9280/AR9285/AR9287 embedded
systems, in the same way that AR9130 embedded systems work. This isn't -everything- that is required - the PCI glue still needs to be taught about the eepromdata hint, along the same lines as the AHB glue. Approved by: re (kib, blanket)
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9280_attach.c8
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9285_attach.c10
-rw-r--r--sys/dev/ath/ath_hal/ar9002/ar9287_attach.c8
3 files changed, 25 insertions, 1 deletions
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
index 4f4b8ba..014838b 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
@@ -28,6 +28,8 @@
#include "ar5416/ar5416reg.h"
#include "ar5416/ar5416phy.h"
+#include "ar9001/ar9130_eeprom.h"
+
#include "ar9002/ar9280v1.ini"
#include "ar9002/ar9280v2.ini"
#include "ar9002/ar9280_olc.h"
@@ -191,6 +193,12 @@ ar9280Attach(uint16_t devid, HAL_SOFTC sc,
AH5416(ah)->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK;
AH5416(ah)->ah_tx_chainmask = AR9280_DEFAULT_TXCHAINMASK;
+ if (eepromdata) {
+ AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead;
+ AH_PRIVATE((ah))->ah_eepromWrite = NULL;
+ ah->ah_eepromdata = eepromdata;
+ }
+
if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) {
/* reset chip */
HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n",
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
index 02c7b98..4301d09 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
@@ -29,6 +29,8 @@
#include "ar5416/ar5416reg.h"
#include "ar5416/ar5416phy.h"
+#include "ar9001/ar9130_eeprom.h"
+
#include "ar9002/ar9285.ini"
#include "ar9002/ar9285v2.ini"
#include "ar9002/ar9280v2.ini" /* XXX ini for tx/rx gain */
@@ -153,7 +155,13 @@ ar9285Attach(uint16_t devid, HAL_SOFTC sc,
AH5416(ah)->ah_writeIni = ar9285WriteIni;
AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK;
AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK;
-
+
+ if (eepromdata) {
+ AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead;
+ AH_PRIVATE((ah))->ah_eepromWrite = NULL;
+ ah->ah_eepromdata = eepromdata;
+ }
+
ahp->ah_maxTxTrigLev = MAX_TX_FIFO_THRESHOLD >> 1;
if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) {
diff --git a/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
index 78400f5..96a3fde 100644
--- a/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
+++ b/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
@@ -30,6 +30,8 @@
#include "ar5416/ar5416reg.h"
#include "ar5416/ar5416phy.h"
+#include "ar9001/ar9130_eeprom.h"
+
#include "ar9002/ar9287_cal.h"
#include "ar9002/ar9287_reset.h"
#include "ar9002/ar9287_olc.h"
@@ -168,6 +170,12 @@ ar9287Attach(uint16_t devid, HAL_SOFTC sc,
AH5416(ah)->ah_rx_chainmask = AR9287_DEFAULT_RXCHAINMASK;
AH5416(ah)->ah_tx_chainmask = AR9287_DEFAULT_TXCHAINMASK;
+ if (eepromdata) {
+ AH_PRIVATE((ah))->ah_eepromRead = ar9130EepromRead;
+ AH_PRIVATE((ah))->ah_eepromWrite = NULL;
+ ah->ah_eepromdata = eepromdata;
+ }
+
if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) {
/* reset chip */
HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n",
OpenPOWER on IntegriCloud