<p dir="ltr">Hi Jouni,</p>
<p dir="ltr">Did you get a chance to look into logs?<br>
Are these logs OK?</p>
<p dir="ltr">Thanks,<br>
-Avinash</p>
<div class="gmail_quote">On May 14, 2014 10:07 AM, "Avinash Patil" <<a href="mailto:avinashapatil@gmail.com">avinashapatil@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Jouni,<br>
<br>
Please find attached logs for failure case without these changes.<br>
<br>
Also my comments inline.<br>
<br>
Thanks,<br>
Avinash<br>
On Tue, May 13, 2014 at 7:36 PM, Jouni Malinen <<a href="mailto:j@w1.fi">j@w1.fi</a>> wrote:<br>
> On Tue, May 13, 2014 at 03:46:05PM +0530, Avinash Patil wrote:<br>
>> We add interface manually by "iw dev interface wlan0 add uap0 type<br>
>> __ap" and then we start AP operations using supplicant.<br>
>> Typical configuration file would be like this:<br>
>><br>
>> network={<br>
>> ssid="supplicant_ap"<br>
>> key_mgmt=NONE<br>
>> mode=2<br>
>> frequency=2432<br>
>> }<br>
>><br>
>> #wpa_supplicant -Dnl80211 -i uap0 -c ap.conf<br>
><br>
> Does this fail for you without the change? If so, could you please share<br>
> a wpa_supplicant debug log showing the failure?<br>
><br>
>> >> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c<br>
>> >> @@ -4698,7 +4698,7 @@ wpa_driver_nl80211_finish_drv_init(struct<br>
>> >> - if (drv->hostapd)<br>
>> >> + if (drv->hostapd || nl80211_get_ifmode(bss) == NL80211_IFTYPE_AP)<br>
>> >> nlmode = NL80211_IFTYPE_AP;<br>
>> ><br>
>> > This breaks the case of something first setting wlan0 to non-station<br>
>> > mode (e.g., "iw wlan0 set type __ap") followed by wpa_supplicant started<br>
>> > on wlan0. The expectation there is that wpa_supplicant runs operations<br>
>> > in station mode until requested to something else (e.g., start AP mode).<br>
>><br>
>> I did not fully understand this scenario but I think you are referring<br>
>> to similar situation as I described earlier except while I am adding<br>
>> interface, in this case interface type is changed.<br>
><br>
> I'm talking about the exact same way of adding the vif, but different<br>
> wpa_supplicant configuration, i.e., a configuration that does not enable<br>
> AP mode operations.<br>
><br>
>> > Why would this change be needed in the first place? Doesn't<br>
>> > wpa_supplicant set the interface to AP mode when the AP mode network is<br>
>> > being configured?<br>
>><br>
>> This handles a case where AP<=>STA change_virtual_interface is not<br>
>> supported but we know that interface on which supplicant is started is<br>
>> AP interface.<br>
>> To ensure that this check applies only to statically created<br>
>> interface, we can add one more check:<br>
>><br>
>> if (drv->hostapd || (nl80211_get_ifmode(bss) ==<br>
>> NL80211_IFTYPE_AP && !bss->if_dynamic))<br>
>> nlmode = NL80211_IFTYPE_AP;<br>
><br>
> The problem here is that this function does not know what wpa_supplicant<br>
> will do next. In the example I described, the new operation would not be<br>
> AP mode and as such, changing to AP mode here would not be correct. In<br>
> the example you are describing, the next operation is AP mode, but the<br>
> code here has no way of knowing that and as such, I don't think it<br>
> should use the current iftype of the interface to try to guess what<br>
> might be happening next.<br>
<br>
Maybe we can have another config file parameter (e.g. static_ap=1) to<br>
indicate changing to default NL_IFTYPE type STATATION is not supported<br>
and supplicant should set iftype as AP during initialization.<br>
<br>
> --<br>
> Jouni Malinen PGP id EFC895FA<br>
</blockquote></div>