aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_supplicant.c
diff options
context:
space:
mode:
authorVasyl Vavrychuk <vvavrychuk@gmail.com>2018-02-12 19:29:06 (GMT)
committerJouni Malinen <j@w1.fi>2018-04-02 09:13:59 (GMT)
commit8fb2b35735b47926ab0d5fd164c42c0e1b3399a6 (patch)
tree8318e3775413652737a12f8a123aeab064f80868 /wpa_supplicant/wpa_supplicant.c
parentd53401c54bd4148d1336cafffbc9752cf2ee5b71 (diff)
downloadhostap-8fb2b35735b47926ab0d5fd164c42c0e1b3399a6.zip
hostap-8fb2b35735b47926ab0d5fd164c42c0e1b3399a6.tar.gz
hostap-8fb2b35735b47926ab0d5fd164c42c0e1b3399a6.tar.bz2
Clean up setting of iface->p2p_mgmt flag
Previously we set this flag to one in wpa_supplicant_init_iface() if Wi-Fi controller does not have a dedicated P2P-interface. This setting had effect only in scope of wpa_supplicant_init_iface() and it contradicts with comment to struct wpa_interface::p2p_mgmt field. This comment says that this flag is used only if Wi-Fi controller has dedicated P2P-device interface. Also it contradicts with usage of similiar p2p_mgmt field in struct wpa_supplicant. Again struct wpa_supplicant::p2p_mgmt is set only for dedicated P2P-device interface. After this change wpa_interface become input argument to wpa_supplicant_init_iface() that we are not modifying. Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com>
Diffstat (limited to 'wpa_supplicant/wpa_supplicant.c')
-rw-r--r--wpa_supplicant/wpa_supplicant.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 68184df..2a05ef9 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -5144,7 +5144,7 @@ radio_work_pending(struct wpa_supplicant *wpa_s, const char *type)
static int wpas_init_driver(struct wpa_supplicant *wpa_s,
- struct wpa_interface *iface)
+ const struct wpa_interface *iface)
{
const char *ifname, *driver, *rn;
@@ -5228,7 +5228,7 @@ static void wpas_gas_server_tx(void *ctx, int freq, const u8 *da,
#endif /* CONFIG_GAS_SERVER */
static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
- struct wpa_interface *iface)
+ const struct wpa_interface *iface)
{
struct wpa_driver_capa capa;
int capa_res;
@@ -5429,8 +5429,6 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
*/
if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE)
wpa_s->p2p_mgmt = iface->p2p_mgmt;
- else
- iface->p2p_mgmt = 1;
if (wpa_s->num_multichan_concurrent == 0)
wpa_s->num_multichan_concurrent = 1;
@@ -5439,10 +5437,7 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
return -1;
#ifdef CONFIG_TDLS
- if ((!iface->p2p_mgmt ||
- !(wpa_s->drv_flags &
- WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE)) &&
- wpa_tdls_init(wpa_s->wpa))
+ if (!iface->p2p_mgmt && wpa_tdls_init(wpa_s->wpa))
return -1;
#endif /* CONFIG_TDLS */
@@ -5514,7 +5509,9 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
return -1;
}
- if (iface->p2p_mgmt && wpas_p2p_init(wpa_s->global, wpa_s) < 0) {
+ if ((!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE) ||
+ wpa_s->p2p_mgmt) &&
+ wpas_p2p_init(wpa_s->global, wpa_s) < 0) {
wpa_msg(wpa_s, MSG_ERROR, "Failed to init P2P");
return -1;
}