aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Rassieur <rassb@google.com>2019-03-29 04:16:12 +0000
committerBill Rassieur <rassb@google.com>2019-03-29 04:16:12 +0000
commit7dbb8382fedcac2b18e273dfd533766c2ebca792 (patch)
tree5e394e981dee1862bc7bf2660b4610bd79eaef75
parent4542c16c542992bd14b4ac9163ca2d9a3132aad7 (diff)
parent8bb92fbfb04f3bfe7d5b1c3963319072a811fa13 (diff)
downloadwpa_supplicant_8-7dbb8382fedcac2b18e273dfd533766c2ebca792.tar.gz
Merge master@5406228 into git_qt-dev-plus-aosp.
Change-Id: I1b38d8622315c51f0425cfbc88c8a674147de705 BUG: 129345239
-rw-r--r--wpa_supplicant/config.c1
-rw-r--r--wpa_supplicant/config_file.c4
-rw-r--r--wpa_supplicant/hidl/1.2/p2p_iface.cpp25
3 files changed, 18 insertions, 12 deletions
diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
index 2902413f..839dea2d 100644
--- a/wpa_supplicant/config.c
+++ b/wpa_supplicant/config.c
@@ -4862,6 +4862,7 @@ static const struct global_parse_data global_fields[] = {
{ INT_RANGE(gas_rand_mac_addr, 0, 2), 0 },
{ INT_RANGE(dpp_config_processing, 0, 2), 0 },
{ INT_RANGE(coloc_intf_reporting, 0, 1), 0 },
+ { INT_RANGE(bss_no_flush_when_down, 0, 1), 0 },
};
#undef FUNC
diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
index f1d865cc..5fcad36e 100644
--- a/wpa_supplicant/config_file.c
+++ b/wpa_supplicant/config_file.c
@@ -1539,6 +1539,10 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
if (config->p2p_interface_random_mac_addr)
fprintf(f, "p2p_interface_random_mac_addr=%d\n",
config->p2p_interface_random_mac_addr);
+ if (config->bss_no_flush_when_down)
+ fprintf(f, "bss_no_flush_when_down=%d\n",
+ config->bss_no_flush_when_down);
+
}
#endif /* CONFIG_NO_CONFIG_WRITE */
diff --git a/wpa_supplicant/hidl/1.2/p2p_iface.cpp b/wpa_supplicant/hidl/1.2/p2p_iface.cpp
index dba66646..bcd96c39 100644
--- a/wpa_supplicant/hidl/1.2/p2p_iface.cpp
+++ b/wpa_supplicant/hidl/1.2/p2p_iface.cpp
@@ -1675,21 +1675,22 @@ SupplicantStatus P2pIface::addGroup_1_2Internal(
wpa_printf(MSG_INFO, "No matched BSS exists, try to find it by scan");
- if (wpa_s->scan_res_handler) {
- wpa_printf(MSG_WARNING, "There is on-going scanning, cannot start another scan.");
- return {SupplicantStatusCode::FAILURE_UNKNOWN,
- "Failed to start scan due to device busy."};
- }
-
if (pending_scan_res_join_callback != NULL) {
- wpa_printf(MSG_WARNING, "There is running group join scan.");
- return {SupplicantStatusCode::FAILURE_UNKNOWN,
- "Failed to start scan due to device busy."};
+ wpa_printf(MSG_WARNING, "P2P: Renew scan result callback with new request.");
}
pending_join_scan_callback =
[wpa_s, ssid, freq]() {
- if (0 != joinScanReq(wpa_s, ssid, freq)) {
+ int ret = joinScanReq(wpa_s, ssid, freq);
+ // for BUSY case, the scan might be occupied by WiFi.
+ // Do not give up immediately, but try again later.
+ if (-EBUSY == ret) {
+ // re-schedule this join scan and don't consume retry count.
+ if (pending_scan_res_join_callback) {
+ wpa_s->p2p_join_scan_count--;
+ pending_scan_res_join_callback();
+ }
+ } else if (0 != ret) {
notifyGroupJoinFailure(wpa_s);
pending_scan_res_join_callback = NULL;
}
@@ -1732,8 +1733,8 @@ SupplicantStatus P2pIface::addGroup_1_2Internal(
};
wpa_s->p2p_join_scan_count = 0;
- if (0 != joinScanReq(wpa_s, ssid, freq)) {
- pending_scan_res_join_callback = NULL;
+ pending_join_scan_callback();
+ if (pending_scan_res_join_callback == NULL) {
return {SupplicantStatusCode::FAILURE_UNKNOWN, "Failed to start scan."};
}
return {SupplicantStatusCode::SUCCESS, ""};