summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2010-06-03 18:02:51 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2010-06-03 18:02:51 +0000
commit73ac8b7862c80ac91b46d7dd4286a0ddf58b57e0 (patch)
tree5d07a5d6a6bc42b038e9cfa923545642f962a462 /sys/dev/ic
parent5cb09fd1fdef5fecaba99e19b3dbaee81b9e9162 (diff)
enable async fifo for >=AR9287 1.3 only.
from ath9k.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/ar9287.c10
-rw-r--r--sys/dev/ic/athn.c14
-rw-r--r--sys/dev/ic/athnreg.h6
3 files changed, 17 insertions, 13 deletions
diff --git a/sys/dev/ic/ar9287.c b/sys/dev/ic/ar9287.c
index 21a6adfe315..b10274f4baa 100644
--- a/sys/dev/ic/ar9287.c
+++ b/sys/dev/ic/ar9287.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar9287.c,v 1.10 2010/05/10 17:44:21 damien Exp $ */
+/* $OpenBSD: ar9287.c,v 1.11 2010/06/03 18:02:50 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -82,8 +82,8 @@ void ar9287_set_txpower(struct athn_softc *, struct ieee80211_channel *,
struct ieee80211_channel *);
void ar9287_olpc_init(struct athn_softc *);
void ar9287_olpc_temp_compensation(struct athn_softc *);
-void ar9287_1_2_enable_async_fifo(struct athn_softc *);
-void ar9287_1_2_setup_async_fifo(struct athn_softc *);
+void ar9287_1_3_enable_async_fifo(struct athn_softc *);
+void ar9287_1_3_setup_async_fifo(struct athn_softc *);
/* Extern functions. */
uint8_t athn_chan2fbin(struct ieee80211_channel *);
@@ -597,7 +597,7 @@ ar9287_olpc_temp_compensation(struct athn_softc *sc)
}
void
-ar9287_1_2_enable_async_fifo(struct athn_softc *sc)
+ar9287_1_3_enable_async_fifo(struct athn_softc *sc)
{
/* Enable ASYNC FIFO. */
AR_SETBITS(sc, AR_MAC_PCU_ASYNC_FIFO_REG3,
@@ -610,7 +610,7 @@ ar9287_1_2_enable_async_fifo(struct athn_softc *sc)
}
void
-ar9287_1_2_setup_async_fifo(struct athn_softc *sc)
+ar9287_1_3_setup_async_fifo(struct athn_softc *sc)
{
uint32_t reg;
diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c
index 5c30fc7bb5a..66ae40549d5 100644
--- a/sys/dev/ic/athn.c
+++ b/sys/dev/ic/athn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: athn.c,v 1.47 2010/05/16 18:01:15 damien Exp $ */
+/* $OpenBSD: athn.c,v 1.48 2010/06/03 18:02:50 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -156,8 +156,8 @@ int ar9285_1_2_init_calib(struct athn_softc *,
struct ieee80211_channel *, struct ieee80211_channel *);
int ar9003_init_calib(struct athn_softc *);
void ar9285_pa_calib(struct athn_softc *);
-void ar9287_1_2_enable_async_fifo(struct athn_softc *);
-void ar9287_1_2_setup_async_fifo(struct athn_softc *);
+void ar9287_1_3_enable_async_fifo(struct athn_softc *);
+void ar9287_1_3_setup_async_fifo(struct athn_softc *);
void ar9003_reset_txsring(struct athn_softc *);
struct cfdriver athn_cd = {
@@ -2050,8 +2050,8 @@ athn_hw_reset(struct athn_softc *sc, struct ieee80211_channel *c,
if (AR_SREV_9280_10_OR_LATER(sc))
AR_SETBITS(sc, sc->gpio_input_en_off, AR_GPIO_JTAG_DISABLE);
- if (AR_SREV_9287_12_OR_LATER(sc) && !AR_SREV_9380_10_OR_LATER(sc))
- ar9287_1_2_enable_async_fifo(sc);
+ if (AR_SREV_9287_13_OR_LATER(sc) && !AR_SREV_9380_10_OR_LATER(sc))
+ ar9287_1_3_enable_async_fifo(sc);
/* Write init values to hardware. */
ops->hw_init(sc, c, extc);
@@ -2149,8 +2149,8 @@ athn_hw_reset(struct athn_softc *sc, struct ieee80211_channel *c,
if (!(sc->flags & ATHN_FLAG_SPLIT_TKIP_MIC))
AR_SETBITS(sc, AR_PCU_MISC, AR_PCU_MIC_NEW_LOC_ENA);
- if (AR_SREV_9287_12_OR_LATER(sc))
- ar9287_1_2_setup_async_fifo(sc);
+ if (AR_SREV_9287_13_OR_LATER(sc) && !AR_SREV_9380_10_OR_LATER(sc))
+ ar9287_1_3_setup_async_fifo(sc);
/* Disable sequence number generation in hardware. */
AR_SETBITS(sc, AR_STA_ID1, AR_STA_ID1_PRESERVE_SEQNUM);
diff --git a/sys/dev/ic/athnreg.h b/sys/dev/ic/athnreg.h
index 4fcc16ca510..e499b4aa831 100644
--- a/sys/dev/ic/athnreg.h
+++ b/sys/dev/ic/athnreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: athnreg.h,v 1.11 2010/05/16 09:19:48 damien Exp $ */
+/* $OpenBSD: athnreg.h,v 1.12 2010/06/03 18:02:50 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -779,6 +779,7 @@
#define AR_SREV_REVISION_9287_10 0
#define AR_SREV_REVISION_9287_11 1
#define AR_SREV_REVISION_9287_12 2
+#define AR_SREV_REVISION_9287_13 3
#define AR_SREV_VERSION_9380 0x1c0
#define AR_SREV_REVISION_9380_10 0
#define AR_SREV_REVISION_9380_20 2
@@ -1372,6 +1373,9 @@
#define AR_SREV_9287_12_OR_LATER(sc) \
((sc)->mac_ver > AR_SREV_VERSION_9287 || \
(AR_SREV_9287(sc) && (sc)->mac_rev >= AR_SREV_REVISION_9287_12))
+#define AR_SREV_9287_13_OR_LATER(sc) \
+ ((sc)->mac_ver > AR_SREV_VERSION_9287 || \
+ (AR_SREV_9287(sc) && (sc)->mac_rev >= AR_SREV_REVISION_9287_13))
#define AR_SREV_9380(sc) \
((sc)->mac_ver == AR_SREV_VERSION_9380)