<div>Hi Jouni & Johannes,</div><div><br></div><div>> Like Johannes pointed out, it would be nice to get a patch file that is</div>> 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.<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'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'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"><<a href="mailto:j@w1.fi">j@w1.fi</a>></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>
> Single channel concurrency Patch [2/4]<br>
><br>
> This patch handles the case where a p2p join fails due to a freq conflict<br>
> 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>
> diff --git a/wpa_supplicant/p2p_supplicant.c<br>
<div class="im">> @@ -2644,6 +2645,14 @@ static void wpas_p2p_scan_res_join(struct<br>
> wpa_supplicant *wpa_s,<br>
> wpa_printf(MSG_DEBUG, "P2P: Target GO operating frequency "<br>
> "from P2P peer table: %d MHz", freq);<br>
> }<br>
> +<br>
> + if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT) &&<br>
> + ((shared_freq = wpa_drv_shared_freq(wpa_s)) > 0) && (shared_freq !=<br>
> freq)) {<br>
> + wpa_msg(wpa_s->parent, MSG_INFO,<br>
> + P2P_EVENT_GROUP_FORMATION_FAILURE "reason=FREQ_CONFLICT");<br>
> + return;<br>
> + }<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->global->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 <<a href="mailto:j@w1.fi">j@w1.fi</a>><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->drv_flags & WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT)<br>
+ return 0;<br>
<div class="im">+<br>
+ for (iface = wpa_s->global->ifaces; iface; iface = iface->next) {<br>
</div>+ if (!wpas_p2p_create_iface(wpa_s) && iface == wpa_s)<br>
+ continue;<br>
+ if (iface->current_ssid == NULL || iface->assoc_freq == 0)<br>
+ continue;<br>
+ if (wpa_drv_get_bssid(iface, bssid) == 0) {<br>
+ if (freq != (int) wpa_s->assoc_freq) {<br>
+ wpa_printf(MSG_DEBUG, "P2P: Frequency "<br>
+ "conflict - %s connected on %d MHz "<br>
+ "- new connection on %d MHz",<br>
+ wpa_s->ifname, wpa_s->assoc_freq,<br>
+ freq);<br>
+ return 1;<br>
+ }<br>
+ }<br>
+ }<br>
+<br>
+ shared_freq = wpa_drv_shared_freq(wpa_s);<br>
+ if (shared_freq > 0 && shared_freq != freq) {<br>
+ wpa_printf(MSG_DEBUG, "P2P: Frequency conflict - shared "<br>
+ "virtual interface connected on %d MHz - new "<br>
+ "connection on %d MHz", 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 > 0) {<br>
u16 method;<br>
<br>
+ if (wpas_check_freq_conflict(wpa_s, freq) > 0) {<br>
<div class="im">+ wpa_msg(wpa_s->parent, MSG_INFO,<br>
+ P2P_EVENT_GROUP_FORMATION_FAILURE<br>
</div>+ "reason=FREQ_CONFLICT");<br>
+ return;<br>
+ }<br>
+<br>
wpa_printf(MSG_DEBUG, "P2P: Send Provision Discovery Request "<br>
"prior to joining an existing group (GO " MACSTR<br>
" freq=%u MHz)",<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>