svn commit: r218066 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416
Adrian Chadd
adrian at FreeBSD.org
Sat Jan 29 12:16:27 UTC 2011
Author: adrian
Date: Sat Jan 29 12:16:26 2011
New Revision: 218066
URL: http://svn.freebsd.org/changeset/base/218066
Log:
Link in the 11n specific TX methods into the HAL.
Modified:
head/sys/dev/ath/ath_hal/ah.h
head/sys/dev/ath/ath_hal/ar5416/ar5416.h
head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
head/sys/dev/ath/if_athvar.h
Modified: head/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.h Sat Jan 29 11:35:23 2011 (r218065)
+++ head/sys/dev/ath/ath_hal/ah.h Sat Jan 29 12:16:26 2011 (r218066)
@@ -793,6 +793,32 @@ struct ath_hal {
const HAL_BEACON_STATE *);
void __ahdecl(*ah_resetStationBeaconTimers)(struct ath_hal*);
+ /* 802.11n Functions */
+ HAL_BOOL __ahdecl(*ah_chainTxDesc)(struct ath_hal *,
+ struct ath_desc *, u_int, u_int, HAL_PKT_TYPE,
+ u_int, HAL_CIPHER, uint8_t, u_int, HAL_BOOL,
+ HAL_BOOL);
+ HAL_BOOL __ahdecl(*ah_setupFirstTxDesc)(struct ath_hal *,
+ struct ath_desc *, u_int, u_int, u_int,
+ u_int, u_int, u_int, u_int, u_int);
+ HAL_BOOL __ahdecl(*ah_setupLastTxDesc)(struct ath_hal *,
+ struct ath_desc *, const struct ath_desc *);
+ void __ahdecl(*ah_set11nRateScenario)(struct ath_hal *,
+ struct ath_desc *, u_int, u_int,
+ HAL_11N_RATE_SERIES [], u_int, u_int);
+ void __ahdecl(*ah_set11nAggrMiddle)(struct ath_hal *,
+ struct ath_desc *, u_int);
+ void __ahdecl(*ah_clr11nAggr)(struct ath_hal *,
+ struct ath_desc *);
+ void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *,
+ struct ath_desc *, u_int);
+ uint32_t __ahdecl(*ah_get11nExtBusy)(struct ath_hal *);
+ void __ahdecl(*ah_set11nMac2040)(struct ath_hal *,
+ HAL_HT_MACMODE);
+ HAL_HT_RXCLEAR __ahdecl(*ah_get11nRxClear)(struct ath_hal *ah);
+ void __ahdecl(*ah_set11nRxClear)(struct ath_hal *,
+ HAL_HT_RXCLEAR);
+
/* Interrupt functions */
HAL_BOOL __ahdecl(*ah_isInterruptPending)(struct ath_hal*);
HAL_BOOL __ahdecl(*ah_getPendingInterrupts)(struct ath_hal*, HAL_INT*);
Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Jan 29 11:35:23 2011 (r218065)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Jan 29 12:16:26 2011 (r218066)
@@ -223,5 +223,23 @@ extern HAL_STATUS ar5416ProcTxDesc(struc
extern HAL_BOOL ar5416GetTxCompletionRates(struct ath_hal *ah,
const struct ath_desc *ds0, int *rates, int *tries);
+extern HAL_BOOL ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds,
+ u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int keyIx,
+ HAL_CIPHER cipher, uint8_t delims, u_int segLen, HAL_BOOL firstSeg,
+ HAL_BOOL lastSeg);
+extern HAL_BOOL ar5416SetupFirstTxDesc(struct ath_hal *ah, struct ath_desc *ds,
+ u_int aggrLen, u_int flags, u_int txPower, u_int txRate0, u_int txTries0,
+ u_int antMode, u_int rtsctsRate, u_int rtsctsDuration);
+extern HAL_BOOL ar5416SetupLastTxDesc(struct ath_hal *ah, struct ath_desc *ds,
+ const struct ath_desc *ds0);
+extern HAL_BOOL ar5416SetGlobalTxTimeout(struct ath_hal *ah, u_int tu);
+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);
+extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims);
+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);
#endif /* _ATH_AR5416_H_ */
Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jan 29 11:35:23 2011 (r218065)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jan 29 12:16:26 2011 (r218066)
@@ -136,8 +136,7 @@ ar5416InitState(struct ath_hal_5416 *ahp
ah->ah_setStationBeaconTimers = ar5416SetStaBeaconTimers;
ah->ah_resetStationBeaconTimers = ar5416ResetStaBeaconTimers;
- /* XXX 802.11n Functions */
-#if 0
+ /* 802.11n Functions */
ah->ah_chainTxDesc = ar5416ChainTxDesc;
ah->ah_setupFirstTxDesc = ar5416SetupFirstTxDesc;
ah->ah_setupLastTxDesc = ar5416SetupLastTxDesc;
@@ -149,7 +148,6 @@ ar5416InitState(struct ath_hal_5416 *ahp
ah->ah_set11nMac2040 = ar5416Set11nMac2040;
ah->ah_get11nRxClear = ar5416Get11nRxClear;
ah->ah_set11nRxClear = ar5416Set11nRxClear;
-#endif
/* Interrupt functions */
ah->ah_isInterruptPending = ar5416IsInterruptPending;
Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Jan 29 11:35:23 2011 (r218065)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Jan 29 12:16:26 2011 (r218066)
@@ -311,8 +311,6 @@ ar5416FillTxDesc(struct ath_hal *ah, str
return AH_TRUE;
}
-#if 0
-
HAL_BOOL
ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds,
u_int pktLen,
@@ -327,6 +325,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, st
{
struct ar5416_desc *ads = AR5416DESC(ds);
uint32_t *ds_txstatus = AR5416_DS_TXSTATUS(ah,ads);
+ struct ath_hal_5416 *ahp = AH5416(ah);
int isaggr = 0;
@@ -342,7 +341,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, st
}
if (!firstSeg) {
- ath_hal_memzero(ds->ds_hw, AR5416_DESC_TX_CTL_SZ);
+ OS_MEMZERO(ds->ds_hw, AR5416_DESC_TX_CTL_SZ);
}
ads->ds_ctl0 = (pktLen & AR_FrameLen);
@@ -356,7 +355,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, st
ads->ds_ctl0 |= AR_DestIdxValid;
}
- ads->ds_ctl6 = SM(keyType[cipher], AR_EncrType);
+ ads->ds_ctl6 = SM(ahp->ah_keytype[cipher], AR_EncrType);
if (isaggr) {
ads->ds_ctl6 |= SM(delims, AR_PadDelim);
}
@@ -456,7 +455,6 @@ ar5416SetupLastTxDesc(struct ath_hal *ah
return AH_TRUE;
}
-#endif /* 0 */
#ifdef AH_NEED_DESC_SWAP
/* Swap transmit descriptor */
@@ -588,7 +586,6 @@ ar5416ProcTxDesc(struct ath_hal *ah,
return HAL_OK;
}
-#if 0
HAL_BOOL
ar5416SetGlobalTxTimeout(struct ath_hal *ah, u_int tu)
{
@@ -706,7 +703,6 @@ ar5416Set11nBurstDuration(struct ath_hal
ads->ds_ctl2 &= ~AR_BurstDur;
ads->ds_ctl2 |= SM(burstDuration, AR_BurstDur);
}
-#endif
/*
* Retrieve the rate table from the given TX completion descriptor
Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h Sat Jan 29 11:35:23 2011 (r218065)
+++ head/sys/dev/ath/if_athvar.h Sat Jan 29 12:16:26 2011 (r218066)
@@ -654,6 +654,29 @@ void ath_intr(void *);
#define ath_hal_gettxcompletionrates(_ah, _ds, _rates, _tries) \
((*(_ah)->ah_getTxCompletionRates)((_ah), (_ds), (_rates), (_tries)))
+#define ath_hal_chaintxdesc(_ah, _ds, _pktlen, _hdrlen, _type, _keyix, \
+ _ cipher, _delims, _seglen, _first, _last) \
+ ((*(_ah)->ah_chainTxDesc((_ah), (_ds), (_pktlen), (_hdrlen), \
+ (_type), (_keyix), (_cipher), (_delims), (_seglen), \
+ (_first), (_last))))
+#define ath_hal_setupfirsttxdesc(_ah, _ds, _aggrlen, _flags, _txpower, \
+ _txr0, _txtr0, _antm, _rcr, _rcd) \
+ ((*(_ah)->ah_setupFirstTxDesc)((_ah), (_ds), (_aggrlen), (_flags), \
+ (_txpower), (_txr0), (_txtr0), (_antm), (_rcr), (_rcd)))
+#define ath_hal_setuplasttxdesc(_ah, _ds, _ds0) \
+ ((*(_ah)->ah_setupLastTxDesc)((_ah), (_ds), (_ds0)))
+#define ath_hal_set11nratescenario(_ah, _ds, _dur, _rt, _series, _ns) \
+ ((*(_ah)->ah_set11nRateScenario)((_ah), (_ds), (_dur), (_rt), \
+ (_series), (_ns)))
+#define ath_hal_set11naggrmiddle(_ah, _ds, _num) \
+ ((*(_ah)->ah_set11nAggrMiddle((_ah), (_ds), (_num))))
+#define ath_hal_set11nburstduration(_ah, _ds, _dur) \
+ ((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur)))
+
+ #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \
+ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type)))
+ #define ath_hal_gpioset(_ah, _gpio, _b) \
+
#define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \
((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type)))
#define ath_hal_gpioset(_ah, _gpio, _b) \
More information about the svn-src-head
mailing list