diff options
| -rw-r--r-- | src/drivers/driver.h | 1 | ||||
| -rw-r--r-- | src/drivers/driver_nl80211.c | 4 | ||||
| -rw-r--r-- | src/p2p/p2p.c | 9 | ||||
| -rw-r--r-- | src/p2p/p2p.h | 8 | ||||
| -rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 8 | ||||
| -rw-r--r-- | wpa_supplicant/wnm_sta.c | 13 |
6 files changed, 41 insertions, 2 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h index ccbcab6e..c48339d6 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -42,6 +42,7 @@ enum reg_change_initiator { REGDOM_SET_BY_USER, REGDOM_SET_BY_DRIVER, REGDOM_SET_BY_COUNTRY_IE, + REGDOM_BEACON_HINT, }; /** diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index a98a3cd4..e221f657 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2850,8 +2850,10 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, break; case NL80211_CMD_REG_BEACON_HINT: wpa_printf(MSG_DEBUG, "nl80211: Regulatory beacon hint"); + os_memset(&data, 0, sizeof(data)); + data.channel_list_changed.initiator = REGDOM_BEACON_HINT; wpa_supplicant_event(drv->ctx, EVENT_CHANNEL_LIST_CHANGED, - NULL); + &data); break; case NL80211_CMD_NEW_STATION: nl80211_new_station_event(drv, tb); diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 3e5dc8c2..1126f2d1 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -3875,6 +3875,15 @@ static void p2p_ext_listen_timeout(void *eloop_ctx, void *timeout_ctx) p2p_ext_listen_timeout, p2p, NULL); } + if ((p2p->cfg->is_p2p_in_progress && + p2p->cfg->is_p2p_in_progress(p2p->cfg->cb_ctx)) || + (p2p->pending_action_state == P2P_PENDING_PD && + p2p->pd_retries > 0)) { + p2p_dbg(p2p, "Operation in progress - skip Extended Listen timeout (%s)", + p2p_state_txt(p2p->state)); + return; + } + if (p2p->state == P2P_LISTEN_ONLY && p2p->ext_listen_only) { /* * This should not really happen, but it looks like the Listen diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 5e729fbd..4461ed65 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -773,6 +773,14 @@ struct p2p_config { * or 0 if not. */ int (*is_concurrent_session_active)(void *ctx); + + /** + * is_p2p_in_progress - Check whether P2P operation is in progress + * @ctx: Callback context from cb_ctx + * Returns: 1 if P2P operation (e.g., group formation) is in progress + * or 0 if not. + */ + int (*is_p2p_in_progress)(void *ctx); }; diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 9a4e42f9..e339d0e6 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3304,6 +3304,13 @@ int wpas_p2p_add_p2pdev_interface(struct wpa_supplicant *wpa_s) } +static int _wpas_p2p_in_progress(void *ctx) +{ + struct wpa_supplicant *wpa_s = ctx; + return wpas_p2p_in_progress(wpa_s); +} + + /** * wpas_p2p_init - Initialize P2P module for %wpa_supplicant * @global: Pointer to global data from wpa_supplicant_init() @@ -3369,6 +3376,7 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s) p2p.get_noa = wpas_get_noa; p2p.go_connected = wpas_go_connected; p2p.is_concurrent_session_active = wpas_is_concurrent_session_active; + p2p.is_p2p_in_progress = _wpas_p2p_in_progress; os_memcpy(wpa_s->global->p2p_dev_addr, wpa_s->own_addr, ETH_ALEN); os_memcpy(p2p.dev_addr, wpa_s->global->p2p_dev_addr, ETH_ALEN); diff --git a/wpa_supplicant/wnm_sta.c b/wpa_supplicant/wnm_sta.c index 95e2dfff..810bf296 100644 --- a/wpa_supplicant/wnm_sta.c +++ b/wpa_supplicant/wnm_sta.c @@ -486,9 +486,12 @@ static int compare_scan_neighbor_results(struct wpa_supplicant *wpa_s, u8 i, j; - if (scan_res == NULL || num_neigh_rep == 0) + if (scan_res == NULL || num_neigh_rep == 0 || !wpa_s->current_bss) return 0; + wpa_printf(MSG_DEBUG, "WNM: Current BSS " MACSTR " RSSI %d", + MAC2STR(wpa_s->bssid), wpa_s->current_bss->level); + for (i = 0; i < num_neigh_rep; i++) { for (j = 0; j < scan_res->num; j++) { /* Check for a better RSSI AP */ @@ -499,8 +502,16 @@ static int compare_scan_neighbor_results(struct wpa_supplicant *wpa_s, /* Got a BSSID with better RSSI value */ os_memcpy(bssid_to_connect, neigh_rep[i].bssid, ETH_ALEN); + wpa_printf(MSG_DEBUG, "Found a BSS " MACSTR + " with better scan RSSI %d", + MAC2STR(scan_res->res[j]->bssid), + scan_res->res[j]->level); return 1; } + wpa_printf(MSG_DEBUG, "scan_res[%d] " MACSTR + " RSSI %d", j, + MAC2STR(scan_res->res[j]->bssid), + scan_res->res[j]->level); } } |
