diff options
author | Shuibing Dai <shuibing@google.com> | 2023-05-05 14:08:11 -0700 |
---|---|---|
committer | Shuibing Dai <shuibing@google.com> | 2023-05-05 14:14:47 -0700 |
commit | e2fad41387f69ed12ad120a39b604fa1d8d07bf5 (patch) | |
tree | fa40e45c1aa69a86ac095bd7a3ef69f3d47ce6eb | |
parent | 70ff123549452ada8fd2c10f564a20c7258bcea0 (diff) | |
download | wpa_supplicant_8-e2fad41387f69ed12ad120a39b604fa1d8d07bf5.tar.gz |
Fix p2p on DFS channel issue: p2p_dfs_chan_enable is NOT enabled on p2p interface
When wpa_supplicant init p2p dev interface, it reads config items from p2p_supplicant_overlay.conf. But when init p2p wlan interface, the config file name is null. We have to save the config items to global p2p data struct.
Bug: 272298287
Test: Manually verified it working from logs
Change-Id: I211a36515bfa76ea23c077cc9e43fc811d9e139f
-rw-r--r-- | src/p2p/p2p.c | 8 | ||||
-rw-r--r-- | src/p2p/p2p.h | 6 | ||||
-rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 3 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 5d50726d..a1fe1213 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -2960,6 +2960,14 @@ bool is_p2p_6ghz_disabled(struct p2p_data *p2p) } +bool is_p2p_dfs_chan_enabled(struct p2p_data *p2p) +{ + if (p2p) + return p2p->cfg->p2p_dfs_chan_enable; + return false; +} + + struct p2p_data * p2p_init(const struct p2p_config *cfg) { struct p2p_data *p2p; diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 27bdac3b..77841285 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -508,6 +508,11 @@ struct p2p_config { bool p2p_6ghz_disable; /** + * p2p_dfs_chan_enable - Enable p2p Go to operate on dfs channel + */ + bool p2p_dfs_chan_enable; + + /** * pri_dev_type - Primary Device Type (see WPS) */ u8 pri_dev_type[8]; @@ -2114,6 +2119,7 @@ void p2p_update_channel_list(struct p2p_data *p2p, const struct p2p_channels *cli_chan); bool is_p2p_6ghz_disabled(struct p2p_data *p2p); +bool is_p2p_dfs_chan_enabled(struct p2p_data *p2p); /** * p2p_set_best_channels - Update best channel information diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 5cf67300..09c11e06 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -3993,7 +3993,7 @@ static int wpas_p2p_setup_channels(struct wpa_supplicant *wpa_s, const struct oper_class_map *o = &global_op_class[op]; unsigned int ch; struct p2p_reg_class *reg = NULL, *cli_reg = NULL; - bool check_dfs_supported = (wpa_s->conf->p2p_dfs_chan_enable + bool check_dfs_supported = (is_p2p_dfs_chan_enabled(wpa_s->global->p2p) && is_dfs_global_op_class(o->op_class)); if ((!check_dfs_supported && o->p2p == NO_P2P_SUPP) || @@ -4971,6 +4971,7 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s) p2p.p2ps_group_capability = p2ps_group_capability; p2p.get_pref_freq_list = wpas_p2p_get_pref_freq_list; p2p.p2p_6ghz_disable = wpa_s->conf->p2p_6ghz_disable; + p2p.p2p_dfs_chan_enable = wpa_s->conf->p2p_dfs_chan_enable; 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); |