wifi: rtw89: coex: Add Bluetooth frequency hopping map version 7
authorChing-Te Ku <ku920601@realtek.com>
Tue, 23 Apr 2024 13:04:57 +0000 (21:04 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Mon, 29 Apr 2024 00:51:34 +0000 (08:51 +0800)
The report is reported from Bluetooth, it described the usable
Bluetooth channel map. Bluetooth should not hopped into Wi-Fi
using channel. Version 8 report adjust the structure variables
order.

Signed-off-by: Ching-Te Ku <ku920601@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240423130502.32682-4-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/coex.c
drivers/net/wireless/realtek/rtw89/core.h

index b0921a264f3db077282b22451bbc0d02c1d3a5fa..f4ac9354f7ab5fa09ea24703a195f7a37f3259d9 100644 (file)
@@ -1138,6 +1138,7 @@ static void _update_bt_report(struct rtw89_dev *rtwdev, u8 rpt_type, u8 *pfinfo)
        struct rtw89_btc_fbtc_btscan_v7 *pscan_v7;
        struct rtw89_btc_fbtc_btafh *pafh_v1 = NULL;
        struct rtw89_btc_fbtc_btafh_v2 *pafh_v2 = NULL;
+       struct rtw89_btc_fbtc_btafh_v7 *pafh_v7 = NULL;
        struct rtw89_btc_fbtc_btdevinfo *pdev = NULL;
        bool scan_update = true;
        int i;
@@ -1198,6 +1199,17 @@ static void _update_bt_report(struct rtw89_dev *rtwdev, u8 rpt_type, u8 *pfinfo)
                                memcpy(&bt_linfo->afh_map_le[0], pafh_v2->afh_le_a, 4);
                                memcpy(&bt_linfo->afh_map_le[4], pafh_v2->afh_le_b, 1);
                        }
+               } else if (ver->fcxbtafh == 7) {
+                       pafh_v7 = (struct rtw89_btc_fbtc_btafh_v7 *)pfinfo;
+                       if (pafh_v7->map_type & RPT_BT_AFH_SEQ_LEGACY) {
+                               memcpy(&bt_linfo->afh_map[0], pafh_v7->afh_l, 4);
+                               memcpy(&bt_linfo->afh_map[4], pafh_v7->afh_m, 4);
+                               memcpy(&bt_linfo->afh_map[8], pafh_v7->afh_h, 2);
+                       }
+                       if (pafh_v7->map_type & RPT_BT_AFH_SEQ_LE) {
+                               memcpy(&bt_linfo->afh_map_le[0], pafh_v7->afh_le_a, 4);
+                               memcpy(&bt_linfo->afh_map_le[4], pafh_v7->afh_le_b, 1);
+                       }
                } else if (ver->fcxbtafh == 1) {
                        pafh_v1 = (struct rtw89_btc_fbtc_btafh *)pfinfo;
                        memcpy(&bt_linfo->afh_map[0], pafh_v1->afh_l, 4);
index 0b1d63b2fa1f3b3c862776fbc3a78d71e64199a7..78600e7fbad495e3b3cecdab7a36d078ae5199f1 100644 (file)
@@ -2735,6 +2735,18 @@ struct rtw89_btc_fbtc_btafh_v2 {
        u8 afh_le_b[4];
 } __packed;
 
+struct rtw89_btc_fbtc_btafh_v7 {
+       u8 fver;
+       u8 map_type;
+       u8 rsvd0;
+       u8 rsvd1;
+       u8 afh_l[4]; /*bit0:2402, bit1:2403.... bit31:2433 */
+       u8 afh_m[4]; /*bit0:2434, bit1:2435.... bit31:2465 */
+       u8 afh_h[4]; /*bit0:2466, bit1:2467.....bit14:2480 */
+       u8 afh_le_a[4];
+       u8 afh_le_b[4];
+} __packed;
+
 struct rtw89_btc_fbtc_btdevinfo {
        u8 fver; /* btc_ver::fcxbtdevinfo */
        u8 rsvd;