<div>Hi Jouni &amp; Johannes,</div><div><br></div><div>&gt; Like Johannes pointed out, it would be nice to get a patch file that is</div>&gt; not corrupted (tabs were removed or converted to a single space, etc.,<br>&gt; that prevented the patch from applying). Similarly, it would be good to<br>
&gt; get the D-Bus indication added, too.<div><br></div><div>No matter how much I try, still some how I miss to find the white space corruption. :(</div><div>Sorry for the trouble. I am not sure yet on whether corruption happens at my editor(customized vim) or at my email client. Any tips or ideas would be helpful.</div>
<div><br></div><div>Regarding DBUS, I still don&#39;t have a very good understanding of D-BUS interface. So thought of working on it once initial changes are frozen/done. </div><div><div><br></div><div>Regarding the patch, do we really need to iterate through the interface list?. I was assuming that the wpas_drv_shared_freq implementation should take care of this.In case of virtual interfaces sharing a single PHY, the shared_freq handler should return the freq in use (STA associated freq/ GO operating freq). </div>
<div><br></div><div>Again, this iteration check would be required for drivers which doesn&#39;t implement the shared_freq handler and still have shared virtual interfaces over a single PHY. I may be missing something here also. Please correct my understanding, if wrong. Apart from this doubt, everything else looks fine with the cleaned up version of the patch.</div>
<div><br></div><div> </div><div><br></div>- Jithu<br><br><div class="gmail_quote">On Sun, Apr 8, 2012 at 10:47 PM, Jouni Malinen <span dir="ltr">&lt;<a href="mailto:j@w1.fi">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">
<div class="im">On Tue, Mar 06, 2012 at 10:33:55AM +0530, Jithu Jance wrote:<br>
&gt; Single channel concurrency Patch [2/4]<br>
&gt;<br>
&gt; This patch handles the case where a p2p join fails due to a freq conflict<br>
&gt; with the existing STA connection.<br>
<br>
</div>Like Johannes pointed out, it would be nice to get a patch file that is<br>
not corrupted (tabs were removed or converted to a single space, etc.,<br>
that prevented the patch from applying). Similarly, it would be good to<br>
get the D-Bus indication added, too.<br>
<br>
&gt; diff --git a/wpa_supplicant/p2p_supplicant.c<br>
<div class="im">&gt; @@ -2644,6 +2645,14 @@ static void wpas_p2p_scan_res_join(struct<br>
&gt; wpa_supplicant *wpa_s,<br>
&gt;   wpa_printf(MSG_DEBUG, &quot;P2P: Target GO operating frequency &quot;<br>
&gt;     &quot;from P2P peer table: %d MHz&quot;, freq);<br>
&gt;   }<br>
&gt; +<br>
&gt; + if (!(wpa_s-&gt;drv_flags &amp; WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT) &amp;&amp;<br>
&gt; + ((shared_freq = wpa_drv_shared_freq(wpa_s)) &gt; 0) &amp;&amp; (shared_freq !=<br>
&gt; freq)) {<br>
&gt; + wpa_msg(wpa_s-&gt;parent, MSG_INFO,<br>
&gt; + P2P_EVENT_GROUP_FORMATION_FAILURE &quot;reason=FREQ_CONFLICT&quot;);<br>
&gt; + return;<br>
&gt; + }<br>
<br>
</div>This is not enough and not in the correct location. The following freq<br>
update based on BSS table is needed for many cases. In addition, the<br>
wpa_s-&gt;global-&gt;ifaces list should be iterated in search of an<br>
conflicting operating channel.<br>
<br>
I added a more complete version of this type of validation:<br>
<br>
<br>
commit 4b156206092d1d500407abbed7007071deee47d0<br>
<br>
    P2P: Abort join-group operation if concurrent group cannot be supported<br>
<br>
    If the driver does not indicate support for multi-channel concurrency,<br>
    abort join-group operation if the end result would result in use of<br>
    multiple operating frequencies with the same radio.<br>
<br>
    Signed-hostap: Jouni Malinen &lt;<a href="mailto:j@w1.fi">j@w1.fi</a>&gt;<br>
<br>
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c<br>
index 1c339d2..fa675fe 100644<br>
--- a/wpa_supplicant/p2p_supplicant.c<br>
+++ b/wpa_supplicant/p2p_supplicant.c<br>
@@ -2605,6 +2605,44 @@ static void wpas_p2p_pd_before_join_timeout(void *eloop_ctx, void *timeout_ctx)<br>
 }<br>
<br>
<br>
+static int wpas_check_freq_conflict(struct wpa_supplicant *wpa_s, int freq)<br>
+{<br>
+       struct wpa_supplicant *iface;<br>
+       int shared_freq;<br>
+       u8 bssid[ETH_ALEN];<br>
+<br>
+       if (wpa_s-&gt;drv_flags &amp; WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT)<br>
+               return 0;<br>
<div class="im">+<br>
+       for (iface = wpa_s-&gt;global-&gt;ifaces; iface; iface = iface-&gt;next) {<br>
</div>+               if (!wpas_p2p_create_iface(wpa_s) &amp;&amp; iface == wpa_s)<br>
+                       continue;<br>
+               if (iface-&gt;current_ssid == NULL || iface-&gt;assoc_freq == 0)<br>
+                       continue;<br>
+               if (wpa_drv_get_bssid(iface, bssid) == 0) {<br>
+                       if (freq != (int) wpa_s-&gt;assoc_freq) {<br>
+                               wpa_printf(MSG_DEBUG, &quot;P2P: Frequency &quot;<br>
+                                          &quot;conflict - %s connected on %d MHz &quot;<br>
+                                          &quot;- new connection on %d MHz&quot;,<br>
+                                          wpa_s-&gt;ifname, wpa_s-&gt;assoc_freq,<br>
+                                          freq);<br>
+                               return 1;<br>
+                       }<br>
+               }<br>
+       }<br>
+<br>
+       shared_freq = wpa_drv_shared_freq(wpa_s);<br>
+       if (shared_freq &gt; 0 &amp;&amp; shared_freq != freq) {<br>
+               wpa_printf(MSG_DEBUG, &quot;P2P: Frequency conflict - shared &quot;<br>
+                          &quot;virtual interface connected on %d MHz - new &quot;<br>
+                          &quot;connection on %d MHz&quot;, shared_freq, freq);<br>
+               return 1;<br>
<div class="im">+       }<br>
+<br>
+       return 0;<br>
+}<br>
</div>+<br>
+<br>
<div class="im"> static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s,<br>
</div>                                   struct wpa_scan_results *scan_res)<br>
 {<br>
@@ -2655,6 +2693,13 @@ static void wpas_p2p_scan_res_join(struct wpa_supplicant *wpa_s,<br>
        if (freq &gt; 0) {<br>
                u16 method;<br>
<br>
+               if (wpas_check_freq_conflict(wpa_s, freq) &gt; 0) {<br>
<div class="im">+                       wpa_msg(wpa_s-&gt;parent, MSG_INFO,<br>
+                               P2P_EVENT_GROUP_FORMATION_FAILURE<br>
</div>+                               &quot;reason=FREQ_CONFLICT&quot;);<br>
+                       return;<br>
+               }<br>
+<br>
                wpa_printf(MSG_DEBUG, &quot;P2P: Send Provision Discovery Request &quot;<br>
                           &quot;prior to joining an existing group (GO &quot; MACSTR<br>
                           &quot; freq=%u MHz)&quot;,<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Jouni Malinen                                            PGP id EFC895FA<br>
_______________________________________________<br>
HostAP mailing list<br>
<a href="mailto:HostAP@lists.shmoo.com">HostAP@lists.shmoo.com</a><br>
<a href="http://lists.shmoo.com/mailman/listinfo/hostap" target="_blank">http://lists.shmoo.com/mailman/listinfo/hostap</a><br>
</div></div></blockquote></div><br></div>