Date: Wed, 17 Aug 2011 14:28:59 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r224940 - in user/adrian/if_ath_tx/sys/dev/ath: . ath_hal ath_hal/ar5416 Message-ID: <201108171428.p7HESxpv009044@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Wed Aug 17 14:28:58 2011 New Revision: 224940 URL: http://svn.freebsd.org/changeset/base/224940 Log: Add two new 11n methods - aggr middle and aggr last. This matches the HAL routines in ath9k and the reference driver. There's some duplicate and unused code though; I'll do a subsequent pass to prune those out. Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416.h user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h Wed Aug 17 14:08:02 2011 (r224939) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h Wed Aug 17 14:28:58 2011 (r224940) @@ -1000,8 +1000,14 @@ struct ath_hal { 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_set11nAggrFirst)(struct ath_hal *, + struct ath_desc *, u_int, u_int); void __ahdecl(*ah_set11nAggrMiddle)(struct ath_hal *, struct ath_desc *, u_int); + void __ahdecl(*ah_set11nAggrLast)(struct ath_hal *, + struct ath_desc *); + void __ahdecl(*ah_clr11nAggr)(struct ath_hal *, struct ath_desc *); void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *, Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Aug 17 14:08:02 2011 (r224939) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Aug 17 14:28:58 2011 (r224940) @@ -334,8 +334,14 @@ extern u_int ar5416GetGlobalTxTimeout(st 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); Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Aug 17 14:08:02 2011 (r224939) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Aug 17 14:28:58 2011 (r224940) @@ -165,7 +165,9 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_setupFirstTxDesc = ar5416SetupFirstTxDesc; ah->ah_setupLastTxDesc = ar5416SetupLastTxDesc; ah->ah_set11nRateScenario = ar5416Set11nRateScenario; + ah->ah_set11nAggrFirst = ar5416Set11nAggrFirst; ah->ah_set11nAggrMiddle = ar5416Set11nAggrMiddle; + ah->ah_set11nAggrLast = ar5416Set11nAggrLast; ah->ah_clr11nAggr = ar5416Clr11nAggr; ah->ah_set11nBurstDuration = ar5416Set11nBurstDuration; ah->ah_get11nExtBusy = ar5416Get11nExtBusy; Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Wed Aug 17 14:08:02 2011 (r224939) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Wed Aug 17 14:28:58 2011 (r224940) @@ -693,6 +693,19 @@ ar5416Set11nRateScenario(struct ath_hal } 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); @@ -712,6 +725,16 @@ ar5416Set11nAggrMiddle(struct ath_hal *a } 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); Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Wed Aug 17 14:08:02 2011 (r224939) +++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Wed Aug 17 14:28:58 2011 (r224940) @@ -830,8 +830,14 @@ void ath_intr(void *); #define ath_hal_set11nratescenario(_ah, _ds, _dur, _rt, _series, _ns, _flags) \ ((*(_ah)->ah_set11nRateScenario)((_ah), (_ds), (_dur), (_rt), \ (_series), (_ns), (_flags))) + +#define ath_hal_set11n_aggr_first(_ah, _ds, _len, _num) \ + ((*(_ah)->ah_set11nAggrFirst)((_ah), (_ds), (_len), (_num))) #define ath_hal_set11naggrmiddle(_ah, _ds, _num) \ ((*(_ah)->ah_set11nAggrMiddle)((_ah), (_ds), (_num))) +#define ath_hal_set11n_aggr_last(_ah, _ds) \ + ((*(_ah)->ah_set11nAggrLast)((_ah), (_ds))) + #define ath_hal_set11nburstduration(_ah, _ds, _dur) \ ((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur))) #define ath_hal_clr11n_aggr(_ah, _ds) \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108171428.p7HESxpv009044>