summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-07-09 07:19:11 +0000
committeradrian <adrian@FreeBSD.org>2012-07-09 07:19:11 +0000
commitde86634e9a9edfa2f24d507afdddf3f16d9f4282 (patch)
tree85d7a3f9fb1620a02dd151b84b71500d8891132b
parent9a711a67d4aa86f9a25f182702a0f82bc85a7859 (diff)
downloadFreeBSD-src-de86634e9a9edfa2f24d507afdddf3f16d9f4282.zip
FreeBSD-src-de86634e9a9edfa2f24d507afdddf3f16d9f4282.tar.gz
Extend the RX HAL API to include the RX queue identifier.
The AR93xx and later chips support two RX FIFO queues - a high and low priority queue. For legacy chips, just assume the queues are high priority. This is inspired by the reference driver but is a reimplementation of the API and code.
-rw-r--r--sys/dev/ath/ath_hal/ah.h4
-rw-r--r--sys/dev/ath/ath_hal/ar5210/ar5210.h4
-rw-r--r--sys/dev/ath/ath_hal/ar5210/ar5210_recv.c8
-rw-r--r--sys/dev/ath/ath_hal/ar5211/ar5211.h4
-rw-r--r--sys/dev/ath/ath_hal/ar5211/ar5211_recv.c8
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212.h4
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212_recv.c8
-rw-r--r--sys/dev/ath/if_ath_rx.c6
-rw-r--r--sys/dev/ath/if_athvar.h8
9 files changed, 33 insertions, 21 deletions
diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h
index 9cc7e75..759c07d 100644
--- a/sys/dev/ath/ath_hal/ah.h
+++ b/sys/dev/ath/ath_hal/ah.h
@@ -1078,8 +1078,8 @@ struct ath_hal {
const struct ath_desc *ds, int *rates, int *tries);
/* Receive Functions */
- uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*);
- void __ahdecl(*ah_setRxDP)(struct ath_hal*, uint32_t rxdp);
+ uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*, HAL_RX_QUEUE);
+ void __ahdecl(*ah_setRxDP)(struct ath_hal*, uint32_t rxdp, HAL_RX_QUEUE);
void __ahdecl(*ah_enableReceive)(struct ath_hal*);
HAL_BOOL __ahdecl(*ah_stopDmaReceive)(struct ath_hal*);
void __ahdecl(*ah_startPcuReceive)(struct ath_hal*);
diff --git a/sys/dev/ath/ath_hal/ar5210/ar5210.h b/sys/dev/ath/ath_hal/ar5210/ar5210.h
index 68e3af5..657e250 100644
--- a/sys/dev/ath/ath_hal/ar5210/ar5210.h
+++ b/sys/dev/ath/ath_hal/ar5210/ar5210.h
@@ -180,8 +180,8 @@ extern void ar5210IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *);
extern HAL_BOOL ar5210GetTxCompletionRates(struct ath_hal *ah,
const struct ath_desc *, int *rates, int *tries);
-extern uint32_t ar5210GetRxDP(struct ath_hal *);
-extern void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp);
+extern uint32_t ar5210GetRxDP(struct ath_hal *, HAL_RX_QUEUE);
+extern void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE);
extern void ar5210EnableReceive(struct ath_hal *);
extern HAL_BOOL ar5210StopDmaReceive(struct ath_hal *);
extern void ar5210StartPcuReceive(struct ath_hal *);
diff --git a/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c b/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c
index bdb4d57..3a1220b 100644
--- a/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c
+++ b/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c
@@ -30,8 +30,10 @@
* Get the RXDP.
*/
uint32_t
-ar5210GetRxDP(struct ath_hal *ah)
+ar5210GetRxDP(struct ath_hal *ah, HAL_RX_QUEUE qtype)
{
+
+ HALASSERT(qtype == HAL_RX_QUEUE_HP);
return OS_REG_READ(ah, AR_RXDP);
}
@@ -39,8 +41,10 @@ ar5210GetRxDP(struct ath_hal *ah)
* Set the RxDP.
*/
void
-ar5210SetRxDP(struct ath_hal *ah, uint32_t rxdp)
+ar5210SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE qtype)
{
+
+ HALASSERT(qtype == HAL_RX_QUEUE_HP);
OS_REG_WRITE(ah, AR_RXDP, rxdp);
}
diff --git a/sys/dev/ath/ath_hal/ar5211/ar5211.h b/sys/dev/ath/ath_hal/ar5211/ar5211.h
index 122206b..1d6c8af 100644
--- a/sys/dev/ath/ath_hal/ar5211/ar5211.h
+++ b/sys/dev/ath/ath_hal/ar5211/ar5211.h
@@ -205,8 +205,8 @@ extern void ar5211IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *);
extern HAL_BOOL ar5211GetTxCompletionRates(struct ath_hal *ah,
const struct ath_desc *ds0, int *rates, int *tries);
-extern uint32_t ar5211GetRxDP(struct ath_hal *);
-extern void ar5211SetRxDP(struct ath_hal *, uint32_t rxdp);
+extern uint32_t ar5211GetRxDP(struct ath_hal *, HAL_RX_QUEUE);
+extern void ar5211SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE);
extern void ar5211EnableReceive(struct ath_hal *);
extern HAL_BOOL ar5211StopDmaReceive(struct ath_hal *);
extern void ar5211StartPcuReceive(struct ath_hal *);
diff --git a/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c b/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c
index 733559e..27c4835 100644
--- a/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c
+++ b/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c
@@ -30,8 +30,10 @@
* Get the RXDP.
*/
uint32_t
-ar5211GetRxDP(struct ath_hal *ah)
+ar5211GetRxDP(struct ath_hal *ah, HAL_RX_QUEUE qtype)
{
+
+ HALASSERT(qtype == HAL_RX_QUEUE_HP);
return OS_REG_READ(ah, AR_RXDP);
}
@@ -39,8 +41,10 @@ ar5211GetRxDP(struct ath_hal *ah)
* Set the RxDP.
*/
void
-ar5211SetRxDP(struct ath_hal *ah, uint32_t rxdp)
+ar5211SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE qtype)
{
+
+ HALASSERT(qtype == HAL_RX_QUEUE_HP);
OS_REG_WRITE(ah, AR_RXDP, rxdp);
HALASSERT(OS_REG_READ(ah, AR_RXDP) == rxdp);
}
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212.h b/sys/dev/ath/ath_hal/ar5212/ar5212.h
index d651691..a8b95d1 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212.h
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212.h
@@ -519,8 +519,8 @@ extern HAL_BOOL ar5212SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode,
extern HAL_POWER_MODE ar5212GetPowerMode(struct ath_hal *ah);
extern HAL_BOOL ar5212GetPowerStatus(struct ath_hal *ah);
-extern uint32_t ar5212GetRxDP(struct ath_hal *ath);
-extern void ar5212SetRxDP(struct ath_hal *ah, uint32_t rxdp);
+extern uint32_t ar5212GetRxDP(struct ath_hal *ath, HAL_RX_QUEUE);
+extern void ar5212SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE);
extern void ar5212EnableReceive(struct ath_hal *ah);
extern HAL_BOOL ar5212StopDmaReceive(struct ath_hal *ah);
extern void ar5212StartPcuReceive(struct ath_hal *ah);
diff --git a/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c b/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
index db4f93d..00b04ca 100644
--- a/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
+++ b/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c
@@ -29,8 +29,10 @@
* Get the RXDP.
*/
uint32_t
-ar5212GetRxDP(struct ath_hal *ath)
+ar5212GetRxDP(struct ath_hal *ath, HAL_RX_QUEUE qtype)
{
+
+ HALASSERT(qtype == HAL_RX_QUEUE_HP);
return OS_REG_READ(ath, AR_RXDP);
}
@@ -38,8 +40,10 @@ ar5212GetRxDP(struct ath_hal *ath)
* Set the RxDP.
*/
void
-ar5212SetRxDP(struct ath_hal *ah, uint32_t rxdp)
+ar5212SetRxDP(struct ath_hal *ah, uint32_t rxdp, HAL_RX_QUEUE qtype)
{
+
+ HALASSERT(qtype == HAL_RX_QUEUE_HP);
OS_REG_WRITE(ah, AR_RXDP, rxdp);
HALASSERT(OS_REG_READ(ah, AR_RXDP) == rxdp);
}
diff --git a/sys/dev/ath/if_ath_rx.c b/sys/dev/ath/if_ath_rx.c
index dd03fb9..6c22de1 100644
--- a/sys/dev/ath/if_ath_rx.c
+++ b/sys/dev/ath/if_ath_rx.c
@@ -916,7 +916,7 @@ rx_proc_next:
* Are there any net80211 buffer calls involved?
*/
bf = TAILQ_FIRST(&sc->sc_rxbuf);
- ath_hal_putrxbuf(ah, bf->bf_daddr);
+ ath_hal_putrxbuf(ah, bf->bf_daddr, HAL_RX_QUEUE_HP);
ath_hal_rxena(ah); /* enable recv descriptors */
ath_mode_init(sc); /* set filters, etc. */
ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */
@@ -1002,7 +1002,7 @@ ath_legacy_stoprecv(struct ath_softc *sc, int dodelay)
device_printf(sc->sc_dev,
"%s: rx queue %p, link %p\n",
__func__,
- (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah),
+ (caddr_t)(uintptr_t) ath_hal_getrxbuf(ah, HAL_RX_QUEUE_HP),
sc->sc_rxlink);
ix = 0;
TAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) {
@@ -1046,7 +1046,7 @@ ath_legacy_startrecv(struct ath_softc *sc)
}
bf = TAILQ_FIRST(&sc->sc_rxbuf);
- ath_hal_putrxbuf(ah, bf->bf_daddr);
+ ath_hal_putrxbuf(ah, bf->bf_daddr, HAL_RX_QUEUE_HP);
ath_hal_rxena(ah); /* enable recv descriptors */
ath_mode_init(sc); /* set filters, etc. */
ath_hal_startpcurecv(ah); /* re-enable PCU/DMA engine */
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index d622df5..71e2eba 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -745,8 +745,8 @@ void ath_intr(void *);
((*(_ah)->ah_setMulticastFilter)((_ah), (_mfilt0), (_mfilt1)))
#define ath_hal_waitforbeacon(_ah, _bf) \
((*(_ah)->ah_waitForBeaconDone)((_ah), (_bf)->bf_daddr))
-#define ath_hal_putrxbuf(_ah, _bufaddr) \
- ((*(_ah)->ah_setRxDP)((_ah), (_bufaddr)))
+#define ath_hal_putrxbuf(_ah, _bufaddr, _rxq) \
+ ((*(_ah)->ah_setRxDP)((_ah), (_bufaddr), (_rxq)))
/* NB: common across all chips */
#define AR_TSF_L32 0x804c /* MAC local clock lower 32 bits */
#define ath_hal_gettsf32(_ah) \
@@ -763,8 +763,8 @@ void ath_intr(void *);
((*(_ah)->ah_getTxDP)((_ah), (_q)))
#define ath_hal_numtxpending(_ah, _q) \
((*(_ah)->ah_numTxPending)((_ah), (_q)))
-#define ath_hal_getrxbuf(_ah) \
- ((*(_ah)->ah_getRxDP)((_ah)))
+#define ath_hal_getrxbuf(_ah, _rxq) \
+ ((*(_ah)->ah_getRxDP)((_ah), (_rxq)))
#define ath_hal_txstart(_ah, _q) \
((*(_ah)->ah_startTxDma)((_ah), (_q)))
#define ath_hal_setchannel(_ah, _chan) \
OpenPOWER on IntegriCloud