[athalq] add debug parsing for the TX FIFO push status.

This commit is contained in:
Adrian Chadd 2017-01-22 05:28:26 +00:00
parent e0b79e669b
commit 3f637132cf
3 changed files with 29 additions and 7 deletions

View File

@ -38,6 +38,22 @@ __FBSDID("$FreeBSD$");
#define MS(_v, _f) ( ((_v) & (_f)) >> _f##_S )
#define MF(_v, _f) ( !! ((_v) & (_f)))
void
ath_alq_print_edma_tx_fifo_push(struct if_ath_alq_payload *a)
{
struct if_ath_alq_tx_fifo_push p;
memcpy(&p, &a->payload, sizeof(p));
printf("[%u.%06u] [%llu] TXPUSH txq=%d, nframes=%d, fifodepth=%d, frmcount=%d\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid),
be32toh(p.txq),
be32toh(p.nframes),
be32toh(p.fifo_depth),
be32toh(p.frame_cnt));
}
static void
ar9300_decode_txstatus(struct if_ath_alq_payload *a)
{
@ -46,10 +62,13 @@ ar9300_decode_txstatus(struct if_ath_alq_payload *a)
/* XXX assumes txs is smaller than PAYLOAD_LEN! */
memcpy(&txs, &a->payload, sizeof(struct ar9300_txs));
printf("[%u.%06u] [%llu] TXSTATUS\n",
printf("[%u.%06u] [%llu] TXSTATUS TxTimestamp=%d, DescId=0x%04x, QCU=%d\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid));
(unsigned long long) be64toh(a->hdr.threadid),
txs.status4,
(unsigned int) MS(txs.status1, AR_tx_desc_id),
(unsigned int) MS(txs.ds_info, AR_tx_qcu_num));
printf(" DescId=0x%08x\n", txs.status1);
printf(" DescLen=%d, TxQcuNum=%d, CtrlStat=%d, DescId=0x%04x\n",
@ -58,7 +77,7 @@ ar9300_decode_txstatus(struct if_ath_alq_payload *a)
MS(txs.ds_info, AR_ctrl_stat),
MS(txs.ds_info, AR_desc_id));
printf(" TxTimestamp=0x%08x\n", txs.status4);
printf(" TxTimestamp: %d\n", txs.status4);
printf(" TxDone=%d, SeqNo=%d, TxOpExceed=%d, TXBFStatus=%d\n",
MF(txs.status8, AR_tx_done),
@ -130,10 +149,11 @@ ar9300_decode_txdesc(struct if_ath_alq_payload *a)
/* XXX assumes txs is smaller than PAYLOAD_LEN! */
memcpy(&txc, &a->payload, 96);
printf("[%u.%06u] [%llu] TXD\n",
printf("[%u.%06u] [%llu] TXD DescId=0x%04x\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid));
(unsigned long long) be64toh(a->hdr.threadid),
(unsigned int) MS(txc.ds_ctl10, AR_tx_desc_id));
printf(" DescLen=%d, TxQcuNum=%d, CtrlStat=%d, DescId=0x%04x\n",
txc.ds_info & 0xff,

View File

@ -19,5 +19,6 @@
#define __AR9300_DS_H__
extern void ar9300_alq_payload(struct if_ath_alq_payload *a);
extern void ath_alq_print_edma_tx_fifo_push(struct if_ath_alq_payload *a);
#endif /* __AR9300_DS_H__ */

View File

@ -186,6 +186,9 @@ main(int argc, const char *argv[])
case ATH_ALQ_RESUME_BEACON:
ath_alq_print_beacon_resume(a);
break;
case ATH_ALQ_TX_FIFO_PUSH:
ath_alq_print_edma_tx_fifo_push(a);
break;
default:
if (be32toh(hdr.sc_hal_magic) == AR5210_MAGIC)
ar5210_alq_payload(a);
@ -195,10 +198,8 @@ main(int argc, const char *argv[])
ar5212_alq_payload(a);
else if (be32toh(hdr.sc_hal_magic) == AR5416_MAGIC)
ar5416_alq_payload(a);
#if 1
else if (be32toh(hdr.sc_hal_magic) == AR9300_MAGIC)
ar9300_alq_payload(a);
#endif
else
printf("[%d.%06d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp_sec),