mac80211/ath10k: save ssid info for STATION mode
Subsystems (2)
cover mac80211/ath10k: save ssid info for STATION mode
save the ssid info for STATION mode which could be used for ath10k to get the corret/exact cfg80211_bss.
Wen Gong (2):
mac80211: save ssid info to ieee80211_bss_conf while assoc
ath10k: pass the ssid info to get the correct bss entity
drivers/net/wireless/ath/ath10k/mac.c | 3 ++- net/mac80211/mlme.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-)
Signature · 7 lines
2.23.0 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
PATCH 1/2 mac80211: save ssid info to ieee80211_bss_conf while assoc
The ssid info of ieee80211_bss_conf is filled in ieee80211_start_ap() for AP mode. For STATION mode, it is empty, save the info from struct ieee80211_mgd_assoc_data, the struct ieee80211_mgd_assoc_data will be freed after assoc, so the ssid info of ieee80211_mgd_assoc_data can not access after assoc, save ssid info to ieee80211_bss_conf, then ssid info can be still access after assoc.
--- net/mac80211/mlme.c | 3 +++ 1 file changed, 3 insertions(+)
net/mac80211/mlme.c +3 -0
@@ -5364,6 +5364,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,struct ieee80211_mgd_assoc_data *assoc_data;const struct cfg80211_bss_ies *beacon_ies;struct ieee80211_supported_band *sband; +struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;const u8 *ssidie, *ht_ie, *vht_ie;int i, err;bool override = false;
@@ -5381,6 +5382,8 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, }memcpy (assoc_data->ssid, ssidie +2 , ssidie[1 ]); assoc_data->ssid_len = ssidie[1 ]; +memcpy (bss_conf->ssid, assoc_data->ssid, assoc_data->ssid_len); + bss_conf->ssid_len = assoc_data->ssid_len;rcu_read_unlock ();if (ifmgd->associated) {
Signature · 7 lines
2.23.0 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
PATCH 2/2 ath10k: pass the ssid info to get the correct bss entity
In reply to Wen GongWhen connect to an AP with WPA mode, ath10k need to set need_ptk_4_way to firmware in WMI_PEER_ASSOC_CMD, then the data path is disallow in firmware, it will be allowed untill firmware finish the 4 way handshake.
It failed with a test case with below steps:
1. configure AP with WPA mode with ssid1 SimpleConnect_a_orbvt_ch1, bssid1 and channel 1.
2. connect to ssid1 and ping success.
3. wait 10 seconds which is less than IEEE80211_SCAN_RESULT_EXPIRE(30 seconds).
4. configure AP with OPEN mode with ssid2 SimpleConnect_b_z3a00_ch1, but use same bssid1 and channel 1 of step 1.
5. disconnect ssid1.
6. connect to ssid2 and ping fail.
Fail reason:
When run step 6, ath10k_peer_assoc_h_crypto() called cfg80211_get_bss() with bssid and chan info, but ssid1 and ssid2 have the same bssid and channel, then there have 2 entry for ssid1 and ssid2 in cfg80211. The ssid1's order is before ssid2 in bss_list, and ssid1's age is less than the expire time which is IEEE80211_SCAN_RESULT_EXPIRE(30 seconds). Then ssid1's entry is selected and ath10k_peer_assoc_h_crypto() parsed it and get the rsnie and then need_ptk_4_way is set to firmware, so data path is disallowed and it will not receive 4 way handshake for OPEN mode, so ping fail in step 6.
This patch is to pass the ssid info to cfg80211_get_bss() as same as cfg80211_mlme_assoc() and cfg80211_mlme_auth(), then it will find the correct bss entry in above test case, then case success.
For AP mode, the ssid info is filled in ieee80211_start_ap(), for STATION mode, it is filled in ieee80211_mgd_assoc(). Tested for both AP/STATION mode with QCA6174 hw3.2 PCI, it is success start/connect/ping for WPA/OPEN mode.
Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
--- drivers/net/wireless/ath/ath10k/mac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/mac.c +2 -1
@@ -2177,7 +2177,8 @@ static void ath10k_peer_assoc_h_crypto(struct ath10k *ar,if (WARN_ON (ath10k_mac_vif_chan (vif, &def)))return ; - bss =cfg80211_get_bss (ar->hw->wiphy, def.chan, info->bssid,NULL ,0 , + bss =cfg80211_get_bss (ar->hw->wiphy, def.chan, info->bssid, + info->ssid_len ? info->ssid :NULL , info->ssid_len,IEEE80211_BSS_TYPE_ANY ,IEEE80211_PRIVACY_ANY );if (bss) {const struct cfg80211_bss_ies *ies;
Signature · 7 lines
2.23.0 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH 2/2] ath10k: pass the ssid info to get the correct bss entity
Quoted 35 lines · Wen Gong
When connect to an AP with WPA mode, ath10k need to set
need_ptk_4_wayto firmware inWMI_PEER_ASSOC_CMD, then the data path is disallow in firmware, it will be allowed untill firmware finish the 4 way handshake.It failed with a test case with below steps:
1. configure AP with WPA mode with ssid1SimpleConnect_a_orbvt_ch1, bssid1 and channel 1.
2. connect to ssid1 and ping success.
3. wait 10 seconds which is less thanIEEE80211_SCAN_RESULT_EXPIRE(30 seconds).
4. configure AP with OPEN mode with ssid2SimpleConnect_b_z3a00_ch1, but use same bssid1 and channel 1 of step 1.
5. disconnect ssid1.
6. connect to ssid2 and ping fail.Fail reason:
When run step 6,ath10k_peer_assoc_h_crypto()calledcfg80211_get_bss()with bssid and chan info, but ssid1 and ssid2 have the same bssid and channel, then there have 2 entry for ssid1 and ssid2 in cfg80211. The ssid1's order is before ssid2 inbss_list, and ssid1's age is less than the expire time which isIEEE80211_SCAN_RESULT_EXPIRE(30 seconds). Then ssid1's entry is selected andath10k_peer_assoc_h_crypto()parsed it and get the rsnie and thenneed_ptk_4_wayis set to firmware, so data path is disallowed and it will not receive 4 way handshake for OPEN mode, so ping fail in step 6.This patch is to pass the ssid info to
cfg80211_get_bss()as same ascfg80211_mlme_assoc()andcfg80211_mlme_auth(), then it will find the correct bss entry in above test case, then case success.For AP mode, the ssid info is filled in
ieee80211_start_ap(), for STATION mode, it is filled inieee80211_mgd_assoc(). Tested for both AP/STATION mode with QCA6174 hw3.2 PCI, it is success start/connect/ping for WPA/OPEN mode.
Quoted 4 lines
Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
Signed-off-by Wen Gong <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
22df5e1bec25 ath10k: pass the ssid info to get the correct bss entity
Signature · 9 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Re: [PATCH 2/2] ath10k: pass the ssid info to get the correct bss entity
In reply to Wen GongQuoted 35 lines · Wen Gong
When connect to an AP with WPA mode, ath10k need to set
need_ptk_4_wayto firmware inWMI_PEER_ASSOC_CMD, then the data path is disallow in firmware, it will be allowed untill firmware finish the 4 way handshake.It failed with a test case with below steps:
1. configure AP with WPA mode with ssid1SimpleConnect_a_orbvt_ch1, bssid1 and channel 1.
2. connect to ssid1 and ping success.
3. wait 10 seconds which is less thanIEEE80211_SCAN_RESULT_EXPIRE(30 seconds).
4. configure AP with OPEN mode with ssid2SimpleConnect_b_z3a00_ch1, but use same bssid1 and channel 1 of step 1.
5. disconnect ssid1.
6. connect to ssid2 and ping fail.Fail reason:
When run step 6,ath10k_peer_assoc_h_crypto()calledcfg80211_get_bss()with bssid and chan info, but ssid1 and ssid2 have the same bssid and channel, then there have 2 entry for ssid1 and ssid2 in cfg80211. The ssid1's order is before ssid2 inbss_list, and ssid1's age is less than the expire time which isIEEE80211_SCAN_RESULT_EXPIRE(30 seconds). Then ssid1's entry is selected andath10k_peer_assoc_h_crypto()parsed it and get the rsnie and thenneed_ptk_4_wayis set to firmware, so data path is disallowed and it will not receive 4 way handshake for OPEN mode, so ping fail in step 6.This patch is to pass the ssid info to
cfg80211_get_bss()as same ascfg80211_mlme_assoc()andcfg80211_mlme_auth(), then it will find the correct bss entry in above test case, then case success.For AP mode, the ssid info is filled in
ieee80211_start_ap(), for STATION mode, it is filled inieee80211_mgd_assoc(). Tested for both AP/STATION mode with QCA6174 hw3.2 PCI, it is success start/connect/ping for WPA/OPEN mode.
Quoted 4 lines
Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
Signed-off-by Wen Gong <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
22df5e1bec25 ath10k: pass the ssid info to get the correct bss entity
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches