Commit efb85ded authored by Ching-Te Ku's avatar Ching-Te Ku Committed by Ping-Ke Shih

wifi: rtw89: coex: Add Wi-Fi role v8 condition when set Bluetooth channel

This function is to let Bluetooth know Wi-Fi is using which channel,
and ask Bluetooth do not hop into the nearby channel. Wi-Fi channel
is saved at role info, this patch make the logic also get the channel
value from version 8 role info.
Signed-off-by: default avatarChing-Te Ku <ku920601@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Link: https://msgid.link/20240423130502.32682-7-pkshih@realtek.com
parent 947cbc6e
...@@ -2981,9 +2981,11 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev) ...@@ -2981,9 +2981,11 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev)
struct rtw89_btc_wl_role_info *wl_rinfo = &wl->role_info; struct rtw89_btc_wl_role_info *wl_rinfo = &wl->role_info;
struct rtw89_btc_wl_role_info_v1 *wl_rinfo_v1 = &wl->role_info_v1; struct rtw89_btc_wl_role_info_v1 *wl_rinfo_v1 = &wl->role_info_v1;
struct rtw89_btc_wl_role_info_v2 *wl_rinfo_v2 = &wl->role_info_v2; struct rtw89_btc_wl_role_info_v2 *wl_rinfo_v2 = &wl->role_info_v2;
struct rtw89_btc_wl_role_info_v8 *wl_rinfo_v8 = &wl->role_info_v8;
struct rtw89_btc_wl_active_role *r; struct rtw89_btc_wl_active_role *r;
struct rtw89_btc_wl_active_role_v1 *r1; struct rtw89_btc_wl_active_role_v1 *r1;
struct rtw89_btc_wl_active_role_v2 *r2; struct rtw89_btc_wl_active_role_v2 *r2;
struct rtw89_btc_wl_rlink *rlink;
u8 en = 0, i, ch = 0, bw = 0; u8 en = 0, i, ch = 0, bw = 0;
u8 mode, connect_cnt; u8 mode, connect_cnt;
...@@ -2999,6 +3001,9 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev) ...@@ -2999,6 +3001,9 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev)
} else if (ver->fwlrole == 2) { } else if (ver->fwlrole == 2) {
mode = wl_rinfo_v2->link_mode; mode = wl_rinfo_v2->link_mode;
connect_cnt = wl_rinfo_v2->connect_cnt; connect_cnt = wl_rinfo_v2->connect_cnt;
} else if (ver->fwlrole == 8) {
mode = wl_rinfo_v8->link_mode;
connect_cnt = wl_rinfo_v8->connect_cnt;
} else { } else {
return; return;
} }
...@@ -3014,6 +3019,7 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev) ...@@ -3014,6 +3019,7 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev)
r = &wl_rinfo->active_role[i]; r = &wl_rinfo->active_role[i];
r1 = &wl_rinfo_v1->active_role_v1[i]; r1 = &wl_rinfo_v1->active_role_v1[i];
r2 = &wl_rinfo_v2->active_role_v2[i]; r2 = &wl_rinfo_v2->active_role_v2[i];
rlink = &wl_rinfo_v8->rlink[i][0];
if (ver->fwlrole == 0 && if (ver->fwlrole == 0 &&
(r->role == RTW89_WIFI_ROLE_P2P_GO || (r->role == RTW89_WIFI_ROLE_P2P_GO ||
...@@ -3033,6 +3039,12 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev) ...@@ -3033,6 +3039,12 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev)
ch = r2->ch; ch = r2->ch;
bw = r2->bw; bw = r2->bw;
break; break;
} else if (ver->fwlrole == 8 &&
(rlink->role == RTW89_WIFI_ROLE_P2P_GO ||
rlink->role == RTW89_WIFI_ROLE_P2P_CLIENT)) {
ch = rlink->ch;
bw = rlink->bw;
break;
} }
} }
} else { } else {
...@@ -3042,6 +3054,7 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev) ...@@ -3042,6 +3054,7 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev)
r = &wl_rinfo->active_role[i]; r = &wl_rinfo->active_role[i];
r1 = &wl_rinfo_v1->active_role_v1[i]; r1 = &wl_rinfo_v1->active_role_v1[i];
r2 = &wl_rinfo_v2->active_role_v2[i]; r2 = &wl_rinfo_v2->active_role_v2[i];
rlink = &wl_rinfo_v8->rlink[i][0];
if (ver->fwlrole == 0 && if (ver->fwlrole == 0 &&
r->connected && r->band == RTW89_BAND_2G) { r->connected && r->band == RTW89_BAND_2G) {
...@@ -3058,6 +3071,11 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev) ...@@ -3058,6 +3071,11 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev)
ch = r2->ch; ch = r2->ch;
bw = r2->bw; bw = r2->bw;
break; break;
} else if (ver->fwlrole == 8 &&
rlink->connected && rlink->rf_band == RTW89_BAND_2G) {
ch = rlink->ch;
bw = rlink->bw;
break;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment