1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-28 11:57:28 +00:00

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
This commit is contained in:
Adrian Chadd 2012-07-19 02:25:14 +00:00
parent abded2bcf2
commit ad3e6dcd37
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238607
11 changed files with 120 additions and 0 deletions

View File

@ -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);

View File

@ -179,6 +179,12 @@ extern void ar5210GetTxIntrQueue(struct ath_hal *ah, uint32_t *);
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);

View File

@ -75,6 +75,9 @@ static const struct ath_hal_private ar5210hal = {{
.ah_getTxIntrQueue = ar5210GetTxIntrQueue,
.ah_reqTxIntrDesc = ar5210IntrReqTxDesc,
.ah_getTxCompletionRates = ar5210GetTxCompletionRates,
.ah_setTxDescLink = ar5210SetTxDescLink,
.ah_getTxDescLink = ar5210GetTxDescLink,
.ah_getTxDescLinkPtr = ar5210GetTxDescLinkPtr,
/* RX Functions */
.ah_getRxDP = ar5210GetRxDP,

View File

@ -630,3 +630,36 @@ ar5210GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *
{
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;
}

View File

@ -204,6 +204,12 @@ extern void ar5211GetTxIntrQueue(struct ath_hal *ah, uint32_t *);
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);

View File

@ -75,6 +75,9 @@ static const struct ath_hal_private ar5211hal = {{
.ah_getTxIntrQueue = ar5211GetTxIntrQueue,
.ah_reqTxIntrDesc = ar5211IntrReqTxDesc,
.ah_getTxCompletionRates = ar5211GetTxCompletionRates,
.ah_setTxDescLink = ar5211SetTxDescLink,
.ah_getTxDescLink = ar5211GetTxDescLink,
.ah_getTxDescLinkPtr = ar5211GetTxDescLinkPtr,
/* RX Functions */
.ah_getRxDP = ar5211GetRxDP,

View File

@ -671,3 +671,27 @@ ar5211GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *
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;
}

View File

@ -602,6 +602,12 @@ extern void ar5212GetTxIntrQueue(struct ath_hal *ah, uint32_t *);
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);

View File

@ -71,6 +71,9 @@ static const struct ath_hal_private ar5212hal = {{
.ah_getTxIntrQueue = ar5212GetTxIntrQueue,
.ah_reqTxIntrDesc = ar5212IntrReqTxDesc,
.ah_getTxCompletionRates = ar5212GetTxCompletionRates,
.ah_setTxDescLink = ar5212SetTxDescLink,
.ah_getTxDescLink = ar5212GetTxDescLink,
.ah_getTxDescLinkPtr = ar5212GetTxDescLinkPtr,
/* RX Functions */
.ah_getRxDP = ar5212GetRxDP,

View File

@ -971,3 +971,27 @@ ar5212GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *
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;
}

View File

@ -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) \