From: Ching-Te Ku RTL8922D supports dual BT (BT0 + BT1). The C2H report structs for fcxbtscan_v8 and fcxbtdevinfo carry a bt_id field that indicates which BT device sent the report; without routing the data always landed in bt0, silently dropping BT1 information. fcxbtscan_v8: the existing code used a local 'tbt' for the scan array copy but then wrote scan_info_update to the outer 'bt' (always bt0). Reassign 'bt' from bt_id so the update flag reaches the correct device. fcxbtdevinfo_v8: no bt_id routing existed at all. In v8 the rsvd byte carries bt_id; add a version check and redirect 'a2dp' to the selected device's a2dp descriptor. btver_v8 and btafh_v8 already route correctly and are untouched. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/coex.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw89/coex.c b/drivers/net/wireless/realtek/rtw89/coex.c index 785060acf508..2513af4d727c 100644 --- a/drivers/net/wireless/realtek/rtw89/coex.c +++ b/drivers/net/wireless/realtek/rtw89/coex.c @@ -1591,11 +1591,10 @@ static void _update_bt_report(struct rtw89_dev *rtwdev, u8 rpt_type, u8 *pfinfo) } else if (ver->fcxbtscan == 8) { struct rtw89_btc_fbtc_btscan_v8 *pscan_v8 = (struct rtw89_btc_fbtc_btscan_v8 *)pfinfo; - struct rtw89_btc_bt_info *tbt = - pscan_v8->bt_id ? &btc->cx.bt1 : &btc->cx.bt0; + bt = pscan_v8->bt_id ? &btc->cx.bt1 : &btc->cx.bt0; for (i = 0; i < CXSCAN_MAX; i++) { - tbt->scan_info_v2[i] = pscan_v8->para[i]; + bt->scan_info_v2[i] = pscan_v8->para[i]; if ((pscan_v8->type & BIT(i)) && pscan_v8->para[i].win == 0 && pscan_v8->para[i].intvl == 0) @@ -1653,6 +1652,10 @@ static void _update_bt_report(struct rtw89_dev *rtwdev, u8 rpt_type, u8 *pfinfo) break; case BTC_RPT_TYPE_BT_DEVICE: pdev = (struct rtw89_btc_fbtc_btdevinfo *)pfinfo; + if (ver->fcxbtdevinfo == 8) { + bt = pdev->rsvd ? &btc->cx.bt1 : &btc->cx.bt0; + a2dp = &bt->link_info.a2dp_desc; + } a2dp->device_name = le32_to_cpu(pdev->dev_name); a2dp->vendor_id = le16_to_cpu(pdev->vendor_id); a2dp->flush_time = le32_to_cpu(pdev->flush_time); -- 2.25.1