[PATCH] Android: Skip explicit conf_p2p_dev loading for main interface
Dmitry Shmidt
dimitrysh
Sun Sep 28 14:03:45 PDT 2014
On Sun, Sep 28, 2014 at 11:40 AM, Peer, Ilan <ilan.peer at intel.com> wrote:
>
>
> >
> > diff --git a/wpa_supplicant/wpa_supplicant.c
> > b/wpa_supplicant/wpa_supplicant.c index f20bc62..9d21fe0 100644
> > --- a/wpa_supplicant/wpa_supplicant.c
> > +++ b/wpa_supplicant/wpa_supplicant.c
> > @@ -3509,7 +3509,9 @@ static int wpa_supplicant_init_iface(struct
> > wpa_supplicant *wpa_s,
> >
> > #ifdef CONFIG_P2P
> > wpa_s->conf_p2p_dev = os_rel2abs_path(iface-
> > >conf_p2p_dev);
> > +#ifndef ANDROID_P2P
> > wpa_config_read(wpa_s->conf_p2p_dev, wpa_s->conf);
> > +#endif
>
> I think it would be cleaner to do the reading only if iface->p2p_mgmt is
> set (happens only in case a dedicated P2P DEVICE interface is added).
>
>
>
> 1) iface->p2p_mgmt will be set later.
>
>
>
> For the case of Non netdev P2P_DEVICE, iface->mgmt. is set in
> wpas_p2p_add_p2pdev_interface() and this is done before the flow that calls
> wpa_supplicant_add_iface() -> wpa_supplicant_init_iface(), so using this
> state variable, the P2P specific configuration file would be read only for
> a (non netdev) P2P_DEVICE interface.
>
Please correct me if I am wrong but wpas_p2p_add_p2pdev_interface() is
called after wpa_supplicant_add_iface()
wpa_s = wpa_supplicant_add_iface(global, &ifaces[i]);
if (wpa_s == NULL) {
exitcode = -1;
break;
}#ifdef CONFIG_P2P
if (wpa_s->global->p2p == NULL &&
(wpa_s->drv_flags &
WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE) &&
wpas_p2p_add_p2pdev_interface(wpa_s) < 0)
exitcode = -1;#endif /* CONFIG_P2P */
It is highly possible I am missing something but I am still can not fidn
the case when we need to load -m switch file for main interface.
> 2) In case p2p has separate Netdev - it will have its own iterface, in
> case for Non-netdev it will still load this file
>
> taking it from parent. Can you please describe the situation when we need
> to load this file for main interface?
>
>
>
> In case that a P2P Device has a separate Netdev, you can simply use the ?c
> to pass the configuration file for the interface with all needed
> parameters, so there is no need to use the ?m switch.
>
Right, this is exactly my point.
>
>
> In the past Jouni wanted to better handle this by having some global
> configuration file that will hold global configuration parameters that
> would be shared between all the interfaces. I tried to prepare some
> solution for this if (still in Jouni?s queue):
>
>
>
> http://patchwork.ozlabs.org/patch/332033/
>
> http://patchwork.ozlabs.org/patch/332034/
>
> http://patchwork.ozlabs.org/patch/332035/
>
This is probably right thing to do but let's wait for Jouni's response.
>
>
> Regards,
>
>
>
> Ilan.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20140928/ea0dfc3d/attachment-0001.htm>
More information about the Hostap
mailing list