From owner-svn-src-all@FreeBSD.ORG Thu Jul 19 02:25:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E673106564A; Thu, 19 Jul 2012 02:25:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F52A8FC0A; Thu, 19 Jul 2012 02:25:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6J2PF3F034023; Thu, 19 Jul 2012 02:25:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6J2PEKA034011; Thu, 19 Jul 2012 02:25:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201207190225.q6J2PEKA034011@svn.freebsd.org> From: Adrian Chadd Date: Thu, 19 Jul 2012 02:25:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238607 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jul 2012 02:25:15 -0000 Author: adrian Date: Thu Jul 19 02:25:14 2012 New Revision: 238607 URL: http://svn.freebsd.org/changeset/base/238607 Log: Break out the TX descriptor link field into HAL methods. The DMA FIFO chips (AR93xx and later) differ slightly to th elegacy chips: * The RX DMA descriptors don't have a ds_link field; * The TX DMA descriptors have a ds_link field however at a different offset. This is a reimplementation based on what the reference driver and ath9k does. A subsequent commit will enable it in the TX and beacon paths. Obtained from: Linux ath9k, Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5210/ar5210.h head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c head/sys/dev/ath/ath_hal/ar5211/ar5211.h head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_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 Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ah.h Thu Jul 19 02:25:14 2012 (r238607) @@ -1084,6 +1084,12 @@ struct ath_hal { void __ahdecl(*ah_reqTxIntrDesc)(struct ath_hal *, struct ath_desc*); HAL_BOOL __ahdecl(*ah_getTxCompletionRates)(struct ath_hal *, const struct ath_desc *ds, int *rates, int *tries); + void __ahdecl(*ah_setTxDescLink)(struct ath_hal *ah, void *ds, + uint32_t link); + void __ahdecl(*ah_getTxDescLink)(struct ath_hal *ah, void *ds, + uint32_t *link); + void __ahdecl(*ah_getTxDescLinkPtr)(struct ath_hal *ah, void *ds, + uint32_t **linkptr); /* Receive Functions */ uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*, HAL_RX_QUEUE); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210.h Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210.h Thu Jul 19 02:25:14 2012 (r238607) @@ -179,6 +179,12 @@ extern void ar5210GetTxIntrQueue(struct 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 void ar5210SetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t link); +extern void ar5210GetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t *link); +extern void ar5210GetTxDescLinkPtr(struct ath_hal *ah, void *ds, + uint32_t **linkptr); extern uint32_t ar5210GetRxDP(struct ath_hal *, HAL_RX_QUEUE); extern void ar5210SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE); Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Thu Jul 19 02:25:14 2012 (r238607) @@ -75,6 +75,9 @@ static const struct ath_hal_private ar52 .ah_getTxIntrQueue = ar5210GetTxIntrQueue, .ah_reqTxIntrDesc = ar5210IntrReqTxDesc, .ah_getTxCompletionRates = ar5210GetTxCompletionRates, + .ah_setTxDescLink = ar5210SetTxDescLink, + .ah_getTxDescLink = ar5210GetTxDescLink, + .ah_getTxDescLinkPtr = ar5210GetTxDescLinkPtr, /* RX Functions */ .ah_getRxDP = ar5210GetRxDP, Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5210/ar5210_xmit.c Thu Jul 19 02:25:14 2012 (r238607) @@ -630,3 +630,36 @@ ar5210GetTxCompletionRates(struct ath_ha { return AH_FALSE; } + +/* + * Set the TX descriptor link pointer + */ +void +ar5210SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link) +{ + struct ar5210_desc *ads = AR5210DESC(ds); + + ads->ds_link = link; +} + +/* + * Get the TX descriptor link pointer + */ +void +ar5210GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link) +{ + struct ar5210_desc *ads = AR5210DESC(ds); + + *link = ads->ds_link; +} + +/* + * Get a pointer to the TX descriptor link pointer + */ +void +ar5210GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr) +{ + struct ar5210_desc *ads = AR5210DESC(ds); + + *linkptr = &ads->ds_link; +} Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211.h Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211.h Thu Jul 19 02:25:14 2012 (r238607) @@ -204,6 +204,12 @@ extern void ar5211GetTxIntrQueue(struct 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 void ar5211SetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t link); +extern void ar5211GetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t *link); +extern void ar5211GetTxDescLinkPtr(struct ath_hal *ah, void *ds, + uint32_t **linkptr); extern uint32_t ar5211GetRxDP(struct ath_hal *, HAL_RX_QUEUE); extern void ar5211SetRxDP(struct ath_hal *, uint32_t rxdp, HAL_RX_QUEUE); Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Thu Jul 19 02:25:14 2012 (r238607) @@ -75,6 +75,9 @@ static const struct ath_hal_private ar52 .ah_getTxIntrQueue = ar5211GetTxIntrQueue, .ah_reqTxIntrDesc = ar5211IntrReqTxDesc, .ah_getTxCompletionRates = ar5211GetTxCompletionRates, + .ah_setTxDescLink = ar5211SetTxDescLink, + .ah_getTxDescLink = ar5211GetTxDescLink, + .ah_getTxDescLinkPtr = ar5211GetTxDescLinkPtr, /* RX Functions */ .ah_getRxDP = ar5211GetRxDP, Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c Thu Jul 19 02:25:14 2012 (r238607) @@ -671,3 +671,27 @@ ar5211GetTxCompletionRates(struct ath_ha return AH_FALSE; } + +void +ar5211SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link) +{ + struct ar5211_desc *ads = AR5211DESC(ds); + + ads->ds_link = link; +} + +void +ar5211GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link) +{ + struct ar5211_desc *ads = AR5211DESC(ds); + + *link = ads->ds_link; +} + +void +ar5211GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr) +{ + struct ar5211_desc *ads = AR5211DESC(ds); + + *linkptr = &ads->ds_link; +} Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Thu Jul 19 02:25:14 2012 (r238607) @@ -602,6 +602,12 @@ extern void ar5212GetTxIntrQueue(struct extern void ar5212IntrReqTxDesc(struct ath_hal *ah, struct ath_desc *); extern HAL_BOOL ar5212GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries); +extern void ar5212SetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t link); +extern void ar5212GetTxDescLink(struct ath_hal *ah, void *ds, + uint32_t *link); +extern void ar5212GetTxDescLinkPtr(struct ath_hal *ah, void *ds, + uint32_t **linkptr); extern const HAL_RATE_TABLE *ar5212GetRateTable(struct ath_hal *, u_int mode); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Thu Jul 19 02:25:14 2012 (r238607) @@ -71,6 +71,9 @@ static const struct ath_hal_private ar52 .ah_getTxIntrQueue = ar5212GetTxIntrQueue, .ah_reqTxIntrDesc = ar5212IntrReqTxDesc, .ah_getTxCompletionRates = ar5212GetTxCompletionRates, + .ah_setTxDescLink = ar5212SetTxDescLink, + .ah_getTxDescLink = ar5212GetTxDescLink, + .ah_getTxDescLinkPtr = ar5212GetTxDescLinkPtr, /* RX Functions */ .ah_getRxDP = ar5212GetRxDP, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c Thu Jul 19 02:25:14 2012 (r238607) @@ -971,3 +971,27 @@ ar5212GetTxCompletionRates(struct ath_ha return AH_TRUE; } + +void +ar5212SetTxDescLink(struct ath_hal *ah, void *ds, uint32_t link) +{ + struct ar5212_desc *ads = AR5212DESC(ds); + + ads->ds_link = link; +} + +void +ar5212GetTxDescLink(struct ath_hal *ah, void *ds, uint32_t *link) +{ + struct ar5212_desc *ads = AR5212DESC(ds); + + *link = ads->ds_link; +} + +void +ar5212GetTxDescLinkPtr(struct ath_hal *ah, void *ds, uint32_t **linkptr) +{ + struct ar5212_desc *ads = AR5212DESC(ds); + + *linkptr = &ads->ds_link; +} Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Wed Jul 18 23:32:12 2012 (r238606) +++ head/sys/dev/ath/if_athvar.h Thu Jul 19 02:25:14 2012 (r238607) @@ -1067,6 +1067,12 @@ void ath_intr(void *); ((*(_ah)->ah_getTxIntrQueue)((_ah), (_txqs))) #define ath_hal_gettxcompletionrates(_ah, _ds, _rates, _tries) \ ((*(_ah)->ah_getTxCompletionRates)((_ah), (_ds), (_rates), (_tries))) +#define ath_hal_settxdesclink(_ah, _ds, _link) \ + ((*(_ah)->ah_setTxDescLink)((_ah), (_ds), (_link))) +#define ath_hal_gettxdesclink(_ah, _ds, _link) \ + ((*(_ah)->ah_getTxDescLink)((_ah), (_ds), (_link))) +#define ath_hal_gettxdesclinkptr(_ah, _ds, _linkptr) \ + ((*(_ah)->ah_getTxDescLinkPtr)((_ah), (_ds), (_linkptr))) #define ath_hal_setupfirsttxdesc(_ah, _ds, _aggrlen, _flags, _txpower, \ _txr0, _txtr0, _antm, _rcr, _rcd) \