diff options
author | adrian <adrian@FreeBSD.org> | 2011-01-29 12:16:26 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2011-01-29 12:16:26 +0000 |
commit | 876bfc9fd7b4d40485de6f553c856dc82b55c555 (patch) | |
tree | 8b67b3fea78898caccee4bf5f2b3bd6280e4bbca /sys/dev | |
parent | 05a9c90aff7fc24d4ff0c691901e9a44607ab93d (diff) | |
download | FreeBSD-src-876bfc9fd7b4d40485de6f553c856dc82b55c555.zip FreeBSD-src-876bfc9fd7b4d40485de6f553c856dc82b55c555.tar.gz |
Link in the 11n specific TX methods into the HAL.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ath/ath_hal/ah.h | 26 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416.h | 18 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416_attach.c | 4 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c | 10 | ||||
-rw-r--r-- | sys/dev/ath/if_athvar.h | 23 |
5 files changed, 71 insertions, 10 deletions
diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h index 3a8ad6b..cb1af32 100644 --- a/sys/dev/ath/ath_hal/ah.h +++ b/sys/dev/ath/ath_hal/ah.h @@ -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*); diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416.h b/sys/dev/ath/ath_hal/ar5416/ar5416.h index e4bf737..ef83ab6 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416.h +++ b/sys/dev/ath/ath_hal/ar5416/ar5416.h @@ -223,5 +223,23 @@ extern HAL_STATUS ar5416ProcTxDesc(struct ath_hal *ah, 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_ */ diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c index c550f45..d3f92be 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c @@ -136,8 +136,7 @@ ar5416InitState(struct ath_hal_5416 *ahp5416, uint16_t devid, HAL_SOFTC sc, 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 *ahp5416, uint16_t devid, HAL_SOFTC sc, ah->ah_set11nMac2040 = ar5416Set11nMac2040; ah->ah_get11nRxClear = ar5416Get11nRxClear; ah->ah_set11nRxClear = ar5416Set11nRxClear; -#endif /* Interrupt functions */ ah->ah_isInterruptPending = ar5416IsInterruptPending; diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c b/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c index 156b1a7..3f3d00a 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c @@ -311,8 +311,6 @@ ar5416FillTxDesc(struct ath_hal *ah, struct ath_desc *ds, 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, struct ath_desc *ds, { 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, struct ath_desc *ds, } 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, struct ath_desc *ds, 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, struct ath_desc *ds, 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 *ah, struct ath_desc *ds, ads->ds_ctl2 &= ~AR_BurstDur; ads->ds_ctl2 |= SM(burstDuration, AR_BurstDur); } -#endif /* * Retrieve the rate table from the given TX completion descriptor diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 5f07b6f..6a2616a 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -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) \ |