<div dir="ltr">Hi Jouni,<div><br></div><div>Thanks for review.</div><div>I will submit a v2 where we wont be exposing interface type outside drivers i.e. driver_nl80211.</div><div>Also I will take care of formatting comments.</div><div><br></div><div>Thanks,</div><div>Avinash</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 15, 2014 at 2:47 PM, Jouni Malinen <span dir="ltr">&lt;<a href="mailto:j@w1.fi" target="_blank">j@w1.fi</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Nov 06, 2014 at 12:44:14PM +0530, Avinash Patil wrote:<br>
&gt; This patch adds dbus getter method for nl80211 iftype.<br>
&gt; This is required by certain applications which intend to start<br>
&gt; AP operations only if current interface type is AP.<br>
&gt; Getter method for capabilities cannot be used for this purpose as<br>
&gt; this enumarates all the supported interface types.<br>
&gt;<br>
&gt; Patch also adds notification handlers for interface type change<br>
&gt; events.<br>
<br>
</span>This has significant whitespace damage in the inline patch.. Could you<br>
please resend with those fixed? For example:<br>
<br>
checking file src/drivers/driver_nl80211.c<br>
patch: **** malformed patch at line 196: *priv, u8 *bssid)<br>
<br>
&gt; diff --git a/src/common/defs.h b/src/common/defs.h<br>
<span class="">&gt; @@ -297,6 +297,24 @@ enum wpa_ctrl_req_type {<br>
&gt;         NUM_WPA_CTRL_REQS<br>
&gt;  };<br>
&gt;<br>
&gt; +enum wpa_nl80211_iftype {<br>
<br>
</span>nl80211 should not really show up in any way in defs.h. In addition, it<br>
is a bit strange to see interface types defined here, i.e., I would have<br>
expected to see this in src/drivers/driver.h.<br>
<br>
&gt; +       WPA_IFTYPE_UNSPECIFIED,<br>
..<br>
<span class=""><br>
&gt; +       /* keep last */<br>
&gt; +       WPA_NL80211_IFTYPES,<br>
&gt; +       WPA_IFTYPE_MAX = WPA_NL80211_IFTYPES - 1<br>
<br>
</span>What would these be used for? There was nothing using these in the<br>
patch..<br>
<br>
<br>
&gt; diff --git a/src/drivers/driver.h b/src/drivers/driver.h<br>
<span class="">&gt; @@ -1427,6 +1427,18 @@ struct wpa_driver_ops {<br>
</span><span class="">&gt;         /**<br>
&gt; +        * get_iftype - Get the current NL80211 iftype<br>
<br>
</span>driver.h is supposed to define a driver independent interface. This<br>
should not be documented as being specific to nl80211.<br>
<span class=""><br>
&gt; +       int (*get_iftype)(void *priv, u8 *iftype);<br>
<br>
</span>u8 * ??<br>
<br>
Shouldn&#39;t this be that enum wpa_nl80211_iftype (or well, renamed to<br>
something not nl80211 specific) and the enum defined in this file?<br>
<span class=""><br>
&gt; +static int wpa_driver_nl80211_get_nl80211_iftype(void *priv, u8 *iftype)<br>
&gt; +{<br>
&gt; +       struct i802_bss *bss = priv;<br>
&gt; +       if (!bss)<br>
&gt; +               return -1;<br>
&gt; +<br>
&gt; +       *iftype = (u8)nl80211_get_ifmode(bss);<br>
&gt; +<br>
&gt; +       return 0;<br>
&gt; +}<br>
<br>
</span>This would need to map driver interface (nl80211) specific values to<br>
generic values defined in driver.h. That said, I&#39;m not sure I really<br>
understand why we would expose every nl80211 iftype to external programs<br>
through wpa_supplicant. What is the real need for that information? Is<br>
it just something like &quot;is this interface configured in AP mode&quot;? I&#39;d<br>
assume something much simpler would cover that need..<br>
<br>
&gt; +       if(wpa_drv_get_iftype(wpa_s, &amp;iftype)) {<br>
<br>
&quot;if (wpa_drv...&quot;<br>
<br>
&gt; +       char_iftype =  wpa_supplicant_iftype_txt(iftype);<br>
<br>
&quot;char_iftype = wpa_...&quot;<br>
<span class=""><br>
&gt; diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c<br>
&gt; index 6761c1a..3a075c8 100644<br>
&gt; --- a/wpa_supplicant/events.c<br>
&gt; +++ b/wpa_supplicant/events.c<br>
&gt; @@ -182,9 +182,12 @@ void wpa_supplicant_stop_countermeasures(void<br>
&gt; *eloop_ctx, void *sock_ctx)<br>
&gt;  void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s)<br>
&gt;  {<br>
&gt;         int bssid_changed;<br>
&gt; -<br>
&gt; +       u8 old_iftype = 0, new_iftype = 0;<br>
&gt;         wnm_bss_keep_alive_deinit(wpa_s);<br>
<br>
</span>Should not move that empty line in that way.. And why use u8 for<br>
something that seemed to get an enum defined for it?<br>
<span class=""><br>
&gt; +       if(wpa_drv_get_iftype(wpa_s, &amp;new_iftype)) {<br>
&gt; +               wpa_dbg(wpa_s, MSG_DEBUG, &quot;Failed to get new iftype!&quot;);<br>
&gt; +       }<br>
&gt; +       if (new_iftype != old_iftype)<br>
&gt; +               wpas_notify_interface_type_changed(wpa_s-&gt;global);<br>
<br>
</span>Why would interface type be reported to change if wpa_drv_get_iftype()<br>
failed?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Jouni Malinen                                            PGP id EFC895FA<br>
</font></span></blockquote></div><br></div>