mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 20:46:48 +02:00
wifi: rtw89: fix authentication fail during scan
We used to store operating channel info after associated. However, scan might happen before that. Without switching back to operating channel, authentication or association might fail. Therefore, we switch back to operating channel when the scanning vif's BSSID is non-zero, which implies connected or during attempt to connect. Signed-off-by: Po-Hao Huang <phhuang@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/20230411124832.14965-6-pkshih@realtek.com
This commit is contained in:
parent
6cfb6cc20a
commit
c5280e5f67
|
|
@ -3199,7 +3199,7 @@ static void rtw89_hw_scan_add_chan(struct rtw89_dev *rtwdev, int chan_type,
|
|||
}
|
||||
|
||||
static int rtw89_hw_scan_add_chan_list(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_vif *rtwvif)
|
||||
struct rtw89_vif *rtwvif, bool connected)
|
||||
{
|
||||
struct cfg80211_scan_request *req = rtwvif->scan_req;
|
||||
struct rtw89_mac_chinfo *ch_info, *tmp;
|
||||
|
|
@ -3243,7 +3243,7 @@ static int rtw89_hw_scan_add_chan_list(struct rtw89_dev *rtwdev,
|
|||
type = RTW89_CHAN_ACTIVE;
|
||||
rtw89_hw_scan_add_chan(rtwdev, type, req->n_ssids, ch_info);
|
||||
|
||||
if (rtwvif->net_type != RTW89_NET_TYPE_NO_LINK &&
|
||||
if (connected &&
|
||||
off_chan_time + ch_info->period > RTW89_OFF_CHAN_TIME) {
|
||||
tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
|
||||
if (!tmp) {
|
||||
|
|
@ -3276,7 +3276,7 @@ static int rtw89_hw_scan_add_chan_list(struct rtw89_dev *rtwdev,
|
|||
}
|
||||
|
||||
static int rtw89_hw_scan_prehandle(struct rtw89_dev *rtwdev,
|
||||
struct rtw89_vif *rtwvif)
|
||||
struct rtw89_vif *rtwvif, bool connected)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -3285,7 +3285,7 @@ static int rtw89_hw_scan_prehandle(struct rtw89_dev *rtwdev,
|
|||
rtw89_err(rtwdev, "Update probe request failed\n");
|
||||
goto out;
|
||||
}
|
||||
ret = rtw89_hw_scan_add_chan_list(rtwdev, rtwvif);
|
||||
ret = rtw89_hw_scan_add_chan_list(rtwdev, rtwvif, connected);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -3363,16 +3363,19 @@ int rtw89_hw_scan_offload(struct rtw89_dev *rtwdev, struct ieee80211_vif *vif,
|
|||
{
|
||||
struct rtw89_scan_option opt = {0};
|
||||
struct rtw89_vif *rtwvif;
|
||||
bool connected;
|
||||
int ret = 0;
|
||||
|
||||
rtwvif = vif ? (struct rtw89_vif *)vif->drv_priv : NULL;
|
||||
if (!rtwvif)
|
||||
return -EINVAL;
|
||||
|
||||
/* This variable implies connected or during attempt to connect */
|
||||
connected = !is_zero_ether_addr(rtwvif->bssid);
|
||||
opt.enable = enable;
|
||||
opt.target_ch_mode = rtwvif->net_type != RTW89_NET_TYPE_NO_LINK;
|
||||
opt.target_ch_mode = connected;
|
||||
if (enable) {
|
||||
ret = rtw89_hw_scan_prehandle(rtwdev, rtwvif);
|
||||
ret = rtw89_hw_scan_prehandle(rtwdev, rtwvif, connected);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user