wifi: rtw89: coex: Add Bluetooth scan parameter report version 7
authorChing-Te Ku <ku920601@realtek.com>
Tue, 23 Apr 2024 13:04:56 +0000 (21:04 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Mon, 29 Apr 2024 00:50:27 +0000 (08:50 +0800)
This report is reported from Bluetooth, it described Bluetooth scan
parameters. Version 7 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-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/coex.c
drivers/net/wireless/realtek/rtw89/core.h

index e61af63..b0921a2 100644 (file)
@@ -1135,6 +1135,7 @@ static void _update_bt_report(struct rtw89_dev *rtwdev, u8 rpt_type, u8 *pfinfo)
        struct rtw89_btc_fbtc_btver *pver = NULL;
        struct rtw89_btc_fbtc_btscan_v1 *pscan_v1;
        struct rtw89_btc_fbtc_btscan_v2 *pscan_v2;
+       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_btdevinfo *pdev = NULL;
@@ -1172,6 +1173,15 @@ static void _update_bt_report(struct rtw89_dev *rtwdev, u8 rpt_type, u8 *pfinfo)
                                    pscan_v2->para[i].intvl == 0)
                                        scan_update = false;
                        }
+               } else if (ver->fcxbtscan == 7) {
+                       pscan_v7 = (struct rtw89_btc_fbtc_btscan_v7 *)pfinfo;
+                       for (i = 0; i < CXSCAN_MAX; i++) {
+                               bt->scan_info_v2[i] = pscan_v7->para[i];
+                               if ((pscan_v7->type & BIT(i)) &&
+                                   pscan_v7->para[i].win == 0 &&
+                                   pscan_v7->para[i].intvl == 0)
+                                       scan_update = false;
+                       }
                }
                if (scan_update)
                        bt->scan_info_update = 1;
@@ -1428,6 +1438,11 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
                } else if (ver->fcxbtscan == 2) {
                        pfinfo = &pfwinfo->rpt_fbtc_btscan.finfo.v2;
                        pcinfo->req_len = sizeof(pfwinfo->rpt_fbtc_btscan.finfo.v2);
+               } else if (ver->fcxbtscan == 7) {
+                       pfinfo = &pfwinfo->rpt_fbtc_btscan.finfo.v7;
+                       pcinfo->req_len = sizeof(pfwinfo->rpt_fbtc_btscan.finfo.v7);
+               } else {
+                       goto err;
                }
                pcinfo->req_fver = ver->fcxbtscan;
                break;
index d8f7eea..0b1d63b 100644 (file)
@@ -1954,9 +1954,18 @@ struct rtw89_btc_fbtc_btscan_v2 {
        struct rtw89_btc_bt_scan_info_v2 para[CXSCAN_MAX];
 } __packed;
 
+struct rtw89_btc_fbtc_btscan_v7 {
+       u8 fver; /* btc_ver::fcxbtscan */
+       u8 type;
+       u8 rsvd0;
+       u8 rsvd1;
+       struct rtw89_btc_bt_scan_info_v2 para[CXSCAN_MAX];
+} __packed;
+
 union rtw89_btc_fbtc_btscan {
        struct rtw89_btc_fbtc_btscan_v1 v1;
        struct rtw89_btc_fbtc_btscan_v2 v2;
+       struct rtw89_btc_fbtc_btscan_v7 v7;
 };
 
 struct rtw89_btc_bt_info {