wifi: rtw89: coex: translate slot ID to readable name
authorChing-Te Ku <ku920601@realtek.com>
Tue, 20 Sep 2022 01:09:32 +0000 (09:09 +0800)
committerKalle Valo <kvalo@kernel.org>
Thu, 22 Sep 2022 06:11:44 +0000 (09:11 +0300)
To analyze debug log quickly, use readable name in string format instead.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220920010939.12173-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/coex.c

index 991ebd94086bfcae5b44c1b400a352c7d85abdf8..b6366e0cf82add913428bc5f11e95f06ea7e5d59 100644 (file)
@@ -5727,6 +5727,7 @@ static void _show_bt_info(struct rtw89_dev *rtwdev, struct seq_file *m)
 #define CASE_BTC_ACT_STR(e) case BTC_ACT_ ## e | BTC_ACT_EXT_BIT: return #e
 #define CASE_BTC_POLICY_STR(e) \
        case BTC_CXP_ ## e | BTC_POLICY_EXT_BIT: return #e
+#define CASE_BTC_SLOT_STR(e) case CXST_ ## e: return #e
 
 static const char *steps_to_str(u16 step)
 {
@@ -5840,6 +5841,32 @@ static const char *steps_to_str(u16 step)
        }
 }
 
+static const char *id_to_slot(u32 id)
+{
+       switch (id) {
+       CASE_BTC_SLOT_STR(OFF);
+       CASE_BTC_SLOT_STR(B2W);
+       CASE_BTC_SLOT_STR(W1);
+       CASE_BTC_SLOT_STR(W2);
+       CASE_BTC_SLOT_STR(W2B);
+       CASE_BTC_SLOT_STR(B1);
+       CASE_BTC_SLOT_STR(B2);
+       CASE_BTC_SLOT_STR(B3);
+       CASE_BTC_SLOT_STR(B4);
+       CASE_BTC_SLOT_STR(LK);
+       CASE_BTC_SLOT_STR(BLK);
+       CASE_BTC_SLOT_STR(E2G);
+       CASE_BTC_SLOT_STR(E5G);
+       CASE_BTC_SLOT_STR(EBT);
+       CASE_BTC_SLOT_STR(ENULL);
+       CASE_BTC_SLOT_STR(WLK);
+       CASE_BTC_SLOT_STR(W1FDD);
+       CASE_BTC_SLOT_STR(B1FDD);
+       default:
+               return "unknown";
+       }
+}
+
 static
 void seq_print_segment(struct seq_file *m, const char *prefix, u16 *data,
                       u8 len, u8 seg_len, u8 start_idx, u8 ring_len)
@@ -6239,7 +6266,8 @@ static void _show_fbtc_cysta_v1(struct rtw89_dev *rtwdev, struct seq_file *m)
                if (!le32_to_cpu(pcysta->slot_cnt[i]))
                        continue;
 
-               seq_printf(m, ", %d:%d", i, le32_to_cpu(pcysta->slot_cnt[i]));
+               seq_printf(m, ", %s:%d", id_to_slot(i),
+                          le32_to_cpu(pcysta->slot_cnt[i]));
        }
 
        if (dm->tdma_now.rxflctrl)