summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2011-10-25 23:09:07 +0000
committeradrian <adrian@FreeBSD.org>2011-10-25 23:09:07 +0000
commit6e02a1785b25dab3cf933e468e99a4fef36e6927 (patch)
tree42e8b25bc7f29a48fa43e3b0bd537fa5844ce1d8 /sys/dev/ath
parent04a73f171eafd274361841cd2bfc0f3813520049 (diff)
downloadFreeBSD-src-6e02a1785b25dab3cf933e468e99a4fef36e6927.zip
FreeBSD-src-6e02a1785b25dab3cf933e468e99a4fef36e6927.tar.gz
Add some 11n bits from the if_ath_tx 11n branch:
* Add the TID field in the TX status descriptor; * Add in the 11n first/middle/last functions for fiddling with the descriptors. These are from the Linux and the reference driver, but I'm not (currently) using them. * Add further AR_ISR_S5 register definitions. Obtained from: Linux ath9k, Atheros
Diffstat (limited to 'sys/dev/ath')
-rw-r--r--sys/dev/ath/ath_hal/ah_desc.h1
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416.h6
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c24
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416desc.h2
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416reg.h8
5 files changed, 40 insertions, 1 deletions
diff --git a/sys/dev/ath/ath_hal/ah_desc.h b/sys/dev/ath/ath_hal/ah_desc.h
index 4651fc2..2ef7b85 100644
--- a/sys/dev/ath/ath_hal/ah_desc.h
+++ b/sys/dev/ath/ath_hal/ah_desc.h
@@ -50,6 +50,7 @@ struct ath_tx_status {
/* #define ts_rssi ts_rssi_combined */
uint32_t ts_ba_low; /* blockack bitmap low */
uint32_t ts_ba_high; /* blockack bitmap high */
+ uint8_t ts_tid; /* TID */
uint32_t ts_evm0; /* evm bytes */
uint32_t ts_evm1;
uint32_t ts_evm2;
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416.h b/sys/dev/ath/ath_hal/ar5416/ar5416.h
index fa5629e..35d9a4d 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416.h
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416.h
@@ -339,8 +339,14 @@ extern u_int ar5416GetGlobalTxTimeout(struct ath_hal *ah);
extern void ar5416Set11nRateScenario(struct ath_hal *ah, struct ath_desc *ds,
u_int durUpdateEn, u_int rtsctsRate, HAL_11N_RATE_SERIES series[],
u_int nseries, u_int flags);
+
+extern void ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds,
+ u_int aggrLen, u_int numDelims);
extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims);
+extern void ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds);
+
extern void ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds);
+
extern void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration);
extern const HAL_RATE_TABLE *ar5416GetRateTable(struct ath_hal *, u_int mode);
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c b/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
index 3341b52..17beb49 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
@@ -504,6 +504,7 @@ ar5416ProcTxDesc(struct ath_hal *ah,
/* Update software copies of the HW status */
ts->ts_seqnum = MS(ds_txstatus[9], AR_SeqNum);
ts->ts_tstamp = AR_SendTimestamp(ds_txstatus);
+ ts->ts_tid = MS(ds_txstatus[9], AR_TxTid);
ts->ts_status = 0;
if (ds_txstatus[1] & AR_ExcessiveRetries)
@@ -692,6 +693,19 @@ ar5416Set11nRateScenario(struct ath_hal *ah, struct ath_desc *ds,
}
void
+ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds,
+ u_int aggrLen, u_int numDelims)
+{
+ struct ar5416_desc *ads = AR5416DESC(ds);
+
+ ads->ds_ctl1 |= (AR_IsAggr | AR_MoreAggr);
+
+ ads->ds_ctl6 &= ~(AR_AggrLen | AR_PadDelim);
+ ads->ds_ctl6 |= SM(aggrLen, AR_AggrLen) |
+ SM(numDelims, AR_PadDelim);
+}
+
+void
ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims)
{
struct ar5416_desc *ads = AR5416DESC(ds);
@@ -711,6 +725,16 @@ ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims)
}
void
+ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds)
+{
+ struct ar5416_desc *ads = AR5416DESC(ds);
+
+ ads->ds_ctl1 |= AR_IsAggr;
+ ads->ds_ctl1 &= ~AR_MoreAggr;
+ ads->ds_ctl6 &= ~AR_PadDelim;
+}
+
+void
ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds)
{
struct ar5416_desc *ads = AR5416DESC(ds);
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416desc.h b/sys/dev/ath/ath_hal/ar5416/ar5416desc.h
index 105c5d6..bc57d89 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416desc.h
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416desc.h
@@ -302,6 +302,8 @@ struct ar5416_desc {
#define AR_FinalTxIdx_S 21
#define AR_TxStatusRsvd82 0x01800000
#define AR_PowerMgmt 0x02000000
+#define AR_TxTid 0xf0000000
+#define AR_TxTid_S 28
#define AR_TxStatusRsvd83 0xfc000000
/***********
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416reg.h b/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
index bfd6107..8644f0d 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
@@ -260,7 +260,13 @@
#define AR_ISR_S5 0x0098
#define AR_ISR_S5_S 0x00d8
-#define AR_ISR_S5_TIM_TIMER 0x00000010
+#define AR_ISR_S5_GENTIMER7 0x00000080 // Mask for timer 7 trigger
+#define AR_ISR_S5_TIM_TIMER 0x00000010 // TIM Timer ISR
+#define AR_ISR_S5_DTIM_TIMER 0x00000020 // DTIM Timer ISR
+#define AR_ISR_S5_GENTIMER_TRIG 0x0000FF80 // ISR for generic timer trigger 7-15
+#define AR_ISR_S5_GENTIMER_TRIG_S 0
+#define AR_ISR_S5_GENTIMER_THRESH 0xFF800000 // ISR for generic timer threshold 7-15
+#define AR_ISR_S5_GENTIMER_THRESH_S 16
#define AR_INTR_SPURIOUS 0xffffffff
#define AR_INTR_RTC_IRQ 0x00000001 /* rtc in shutdown state */
OpenPOWER on IntegriCloud