carl9170 firmware: per-vif tx sequence counter
[carl9170fw.git] / tools / src / fwinfo.c
index 5ef3334bbd1d7843026f80fcff395b5e03348f09..c54ff81e80f98916c27ee5ba9e2ce8f3910ea306 100644 (file)
@@ -56,7 +56,6 @@ static const struct feature_list known_otus_features_v1[] = {
        CHECK_FOR_FEATURE(CARL9170FW_USB_RESP_EP2),
        CHECK_FOR_FEATURE(CARL9170FW_USB_DOWN_STREAM),
        CHECK_FOR_FEATURE(CARL9170FW_USB_UP_STREAM),
-       CHECK_FOR_FEATURE(CARL9170FW_USB_WATCHDOG),
        CHECK_FOR_FEATURE(CARL9170FW_UNUSABLE),
        CHECK_FOR_FEATURE(CARL9170FW_COMMAND_PHY),
        CHECK_FOR_FEATURE(CARL9170FW_COMMAND_CAM),
@@ -64,6 +63,8 @@ static const struct feature_list known_otus_features_v1[] = {
        CHECK_FOR_FEATURE(CARL9170FW_HANDLE_BACK_REQ),
        CHECK_FOR_FEATURE(CARL9170FW_GPIO_INTERRUPT),
        CHECK_FOR_FEATURE(CARL9170FW_PSM),
+       CHECK_FOR_FEATURE(CARL9170FW_RX_FILTER),
+       CHECK_FOR_FEATURE(CARL9170FW_WOL),
 };
 
 static void check_feature_list(const struct carl9170fw_desc_head *head,
@@ -150,16 +151,27 @@ static void show_dbg_desc(const struct carl9170fw_desc_head *head,
 {
        const struct carl9170fw_dbg_desc *dbg = (const void *) head;
 
+#define DBG_ADDR(_name, _reg) do {                                     \
+       unsigned int __tmp = le32_to_cpu(dbg->_reg);                    \
+       if (__tmp)                                                      \
+               fprintf(stdout, "\t\t" _name " = 0x%.8x\n", __tmp);     \
+       } while (0);
+
        fprintf(stdout, "\tFirmware Debug Registers/Counters\n");
-       fprintf(stdout, "\t\tbogoclock    = 0x%.8x\n",
-               le32_to_cpu(dbg->bogoclock_addr));
-       fprintf(stdout, "\t\tcounter      = 0x%.8x\n",
-               le32_to_cpu(dbg->counter_addr));
-       fprintf(stdout, "\t\trx total     = 0x%.8x\n",
-               le32_to_cpu(dbg->rx_total_addr));
-       fprintf(stdout, "\t\trx overrun   = 0x%.8x\n",
-               le32_to_cpu(dbg->rx_overrun_addr));
-       /* Nothing interesting here */
+       DBG_ADDR("bogoclock    ", bogoclock_addr);
+       DBG_ADDR("counter      ", counter_addr);
+       DBG_ADDR("rx total     ", rx_total_addr);
+       DBG_ADDR("rx overrun   ", rx_overrun_addr);
+       DBG_ADDR("rx filer     ", rx_filter);
+}
+
+static void show_txsq_desc(const struct carl9170fw_desc_head *head,
+                           struct carlfw *fw __unused)
+{
+       const struct carl9170fw_txsq_desc *txsq = (const void *) head;
+
+       fprintf(stdout, "\t\ttx-seq table addr: 0x%x\n",
+               le32_to_cpu(txsq->seq_table_addr));
 }
 
 static void show_chk_desc(const struct carl9170fw_desc_head *head,
@@ -197,6 +209,7 @@ static const struct {
        uint16_t size;
 } known_magics[] = {
        ADD_HANDLER(OTUS, show_otus_desc),
+       ADD_HANDLER(TXSQ, show_txsq_desc),
        ADD_HANDLER(MOTD, show_motd_desc),
        ADD_HANDLER(DBG, show_dbg_desc),
        ADD_HANDLER(FIX, show_fix_desc),
@@ -253,7 +266,7 @@ int main(int argc, char *args[])
 
        carlfw_get_fw(fw, &len);
        fprintf(stdout, "General Firmware Statistics:\n");
-       fprintf(stdout, "\tFirmware file size: %u Bytes\n", len);
+       fprintf(stdout, "\tFirmware file size: %u Bytes\n", (unsigned int)len);
        fprintf(stdout, "\t%d Descriptors in %d Bytes\n",
                carlfw_get_descs_num(fw), carlfw_get_descs_size(fw));