Teach athalq about the recent if_ath_alq timestamp format change.

This commit is contained in:
Adrian Chadd 2013-02-11 02:54:24 +00:00
parent 81561d0459
commit 0a83addd18
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=246649
5 changed files with 51 additions and 34 deletions

View File

@ -45,8 +45,9 @@ ar5210_decode_txstatus(struct if_ath_alq_payload *a)
/* XXX assumes txs is smaller than PAYLOAD_LEN! */
memcpy(&txs, &a->payload, sizeof(struct ar5210_desc));
printf("[%u] [%llu] TXSTATUS\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] TXSTATUS\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid));
/* ds_txstatus0 */
@ -78,8 +79,9 @@ ar5210_decode_txdesc(struct if_ath_alq_payload *a)
/* XXX assumes txs is smaller than PAYLOAD_LEN! */
memcpy(&txc, &a->payload, sizeof(struct ar5210_desc));
printf("[%u] [%llu] TXD\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] TXD\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid));
printf(" link=0x%08x, data=0x%08x\n",
@ -116,8 +118,9 @@ ar5210_decode_rxstatus(struct if_ath_alq_payload *a)
/* XXX assumes rxs is smaller than PAYLOAD_LEN! */
memcpy(&rxs, &a->payload, sizeof(struct ar5210_desc));
printf("[%u] [%llu] RXSTATUS\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] RXSTATUS\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid));
printf(" link=0x%08x, data=0x%08x\n",
@ -167,8 +170,9 @@ ar5210_alq_payload(struct if_ath_alq_payload *a)
ar5210_decode_txdesc(a);
break;
default:
printf("[%d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp),
printf("[%d.%06d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp_sec),
be32toh(a->hdr.tstamp_usec),
be64toh(a->hdr.threadid),
be16toh(a->hdr.op), be16toh(a->hdr.len));
}

View File

@ -45,8 +45,9 @@ ar5211_decode_txstatus(struct if_ath_alq_payload *a)
/* XXX assumes txs is smaller than PAYLOAD_LEN! */
memcpy(&txs, &a->payload, sizeof(struct ar5211_desc));
printf("[%u] [%llu] TXSTATUS\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] TXSTATUS\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid));
/* ds_txstatus0 */
@ -79,8 +80,9 @@ ar5211_decode_txdesc(struct if_ath_alq_payload *a)
/* XXX assumes txs is smaller than PAYLOAD_LEN! */
memcpy(&txc, &a->payload, sizeof(struct ar5211_desc));
printf("[%u] [%llu] TXD\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] TXD\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid));
printf(" link=0x%08x, data=0x%08x\n",
@ -117,8 +119,9 @@ ar5211_decode_rxstatus(struct if_ath_alq_payload *a)
/* XXX assumes rxs is smaller than PAYLOAD_LEN! */
memcpy(&rxs, &a->payload, sizeof(struct ar5211_desc));
printf("[%u] [%llu] RXSTATUS\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] RXSTATUS\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid));
printf(" link=0x%08x, data=0x%08x\n",
@ -168,8 +171,9 @@ ar5211_alq_payload(struct if_ath_alq_payload *a)
ar5211_decode_txdesc(a);
break;
default:
printf("[%d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp),
printf("[%d.%06d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp_sec),
be32toh(a->hdr.tstamp_usec),
be64toh(a->hdr.threadid),
be16toh(a->hdr.op), be16toh(a->hdr.len));
}

View File

@ -45,8 +45,9 @@ ar5212_decode_txstatus(struct if_ath_alq_payload *a)
/* XXX assumes txs is smaller than PAYLOAD_LEN! */
memcpy(&txs, &a->payload, sizeof(struct ar5212_desc));
printf("[%u] [%llu] TXSTATUS: TxDone=%d, TS=0x%08x\n\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] TXSTATUS: TxDone=%d, TS=0x%08x\n\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid),
MF(txs.u.tx.status1, AR_Done),
MS(txs.u.tx.status0, AR_SendTimestamp));
@ -85,8 +86,9 @@ ar5212_decode_txdesc(struct if_ath_alq_payload *a)
/* XXX assumes txs is smaller than PAYLOAD_LEN! */
memcpy(&txc, &a->payload, sizeof(struct ar5212_desc));
printf("[%u] [%llu] TXD\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] TXD\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid));
printf(" link=0x%08x, data=0x%08x\n",
@ -149,8 +151,9 @@ ar5212_decode_rxstatus(struct if_ath_alq_payload *a)
/* XXX assumes rxs is smaller than PAYLOAD_LEN! */
memcpy(&rxs, &a->payload, sizeof(struct ar5212_desc));
printf("[%u] [%llu] RXSTATUS: RxOK=%d TS=0x%08x\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] RXSTATUS: RxOK=%d TS=0x%08x\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid),
MF(rxs.ds_rxstatus1, AR_Done),
MS(rxs.ds_rxstatus1, AR_RcvTimestamp));
@ -214,8 +217,9 @@ ar5212_alq_payload(struct if_ath_alq_payload *a)
ar5212_decode_txdesc(a);
break;
default:
printf("[%d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp),
printf("[%d.%06d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp_sec),
be32toh(a->hdr.tstamp_usec),
be64toh(a->hdr.threadid),
be16toh(a->hdr.op), be16toh(a->hdr.len));
}

View File

@ -45,8 +45,9 @@ ar5416_decode_txstatus(struct if_ath_alq_payload *a)
/* XXX assumes txs is smaller than PAYLOAD_LEN! */
memcpy(&txs, &a->payload, sizeof(struct ar5416_desc));
printf("[%u] [%llu] TXSTATUS: TxDone=%d, TS=0x%08x\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] TXSTATUS: TxDone=%d, TS=0x%08x\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid),
MF(txs.u.tx.status[9], AR_TxDone),
txs.u.tx.status[2]);
@ -121,8 +122,9 @@ ar5416_decode_txdesc(struct if_ath_alq_payload *a)
/* XXX assumes txs is smaller than PAYLOAD_LEN! */
memcpy(&txc, &a->payload, sizeof(struct ar5416_desc));
printf("[%u] [%llu] TXD\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] TXD\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid));
printf(" link=0x%08x, data=0x%08x\n",
@ -252,8 +254,9 @@ ar5416_decode_rxstatus(struct if_ath_alq_payload *a)
/* XXX assumes rxs is smaller than PAYLOAD_LEN! */
memcpy(&rxs, &a->payload, sizeof(struct ar5416_desc));
printf("[%u] [%llu] RXSTATUS: RxDone=%d, TS=0x%08x\n",
(unsigned int) be32toh(a->hdr.tstamp),
printf("[%u.%06u] [%llu] RXSTATUS: RxDone=%d, TS=0x%08x\n",
(unsigned int) be32toh(a->hdr.tstamp_sec),
(unsigned int) be32toh(a->hdr.tstamp_usec),
(unsigned long long) be64toh(a->hdr.threadid),
MF(rxs.ds_rxstatus8, AR_RxDone),
rxs.ds_rxstatus2);
@ -352,8 +355,9 @@ ar5416_alq_payload(struct if_ath_alq_payload *a)
ar5416_decode_txdesc(a);
break;
default:
printf("[%d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp),
printf("[%d.%06d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp_sec),
be32toh(a->hdr.tstamp_usec),
be64toh(a->hdr.threadid),
be16toh(a->hdr.op), be16toh(a->hdr.len));
}

View File

@ -126,8 +126,9 @@ main(int argc, const char *argv[])
ar9300_alq_payload(a);
#endif
else
printf("[%d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp),
printf("[%d.%06d] [%lld] op: %d; len %d\n",
be32toh(a->hdr.tstamp_sec),
be32toh(a->hdr.tstamp_usec),
be64toh(a->hdr.threadid),
be16toh(a->hdr.op),
be16toh(a->hdr.len));