Author: adrian
Date: Sun Jan 22 05:28:26 2017
New Revision: 312611
URL: https://svnweb.freebsd.org/changeset/base/312611

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

Modified:
  head/tools/tools/ath/athalq/ar9300_ds.c
  head/tools/tools/ath/athalq/ar9300_ds.h
  head/tools/tools/ath/athalq/main.c

Modified: head/tools/tools/ath/athalq/ar9300_ds.c
==============================================================================
--- head/tools/tools/ath/athalq/ar9300_ds.c     Sun Jan 22 00:46:04 2017        
(r312610)
+++ head/tools/tools/ath/athalq/ar9300_ds.c     Sun Jan 22 05:28:26 2017        
(r312611)
@@ -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
        /* 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
            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_p
        /* 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,

Modified: head/tools/tools/ath/athalq/ar9300_ds.h
==============================================================================
--- head/tools/tools/ath/athalq/ar9300_ds.h     Sun Jan 22 00:46:04 2017        
(r312610)
+++ head/tools/tools/ath/athalq/ar9300_ds.h     Sun Jan 22 05:28:26 2017        
(r312611)
@@ -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__ */

Modified: head/tools/tools/ath/athalq/main.c
==============================================================================
--- head/tools/tools/ath/athalq/main.c  Sun Jan 22 00:46:04 2017        
(r312610)
+++ head/tools/tools/ath/athalq/main.c  Sun Jan 22 05:28:26 2017        
(r312611)
@@ -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),
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to