[PATCH] Provision discovery to be sent to GO operating freq Signed-off-by: root <root at neeraj-ubuntu64.(none)>

root (none) root at neeraj-ubuntu64.
Fri Oct 21 02:03:52 EDT 2011


---
 src/p2p/p2p.c    |    4 +++-
 src/p2p/p2p_pd.c |    6 ++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
 mode change 100644 => 100755 src/p2p/p2p.c
 mode change 100644 => 100755 src/p2p/p2p_pd.c

diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
old mode 100644
new mode 100755
index 259f854..36d69d3
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -574,8 +574,10 @@ int p2p_add_device(struct p2p_data *p2p, const u8
*addr, int freq, int level,
  freq, msg.ds_params ? *msg.ds_params : -1);
  }
  dev->listen_freq = freq;
- if (msg.group_info)
+ if (msg.group_info) {
  dev->oper_freq = freq;
+ dev->go_state = REMOTE_GO;
+ }
  dev->info.level = level;

  p2p_copy_wps_info(dev, 0, &msg);
diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
old mode 100644
new mode 100755
index f7ff06c..d8758c9
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -283,8 +283,10 @@ int p2p_send_prov_disc_req(struct p2p_data *p2p, struct
p2p_device *dev,
 {
  struct wpabuf *req;
  int freq;
-
- freq = dev->listen_freq > 0 ? dev->listen_freq : dev->oper_freq;
+ if (dev->go_state == REMOTE_GO)
+ freq = dev->oper_freq;
+ else
+ freq = dev->listen_freq > 0 ? dev->listen_freq : dev->oper_freq;
  if (freq <= 0) {
  wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
  "P2P: No Listen/Operating frequency known for the "
-- 
1.7.4.1

Regards,
-Neeraj Garg

--20cf307f3b8aaf27e504afc8fe44
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello,<div>In some occurrences, when listen_freq and the final operating fr=
equency of the GO are different, then the current supplicant code in p2p_pd=
.c ends up sending provision discovery request frame to the listen frequenc=
y. Since GO is no longer listening on listen_freq (it has moved to oper cha=
nnel), frame doesn&#39;t get received by GO.=A0</div>
<div>Supplicant code in p2p.c update the listen_freq and the operating freq=
uency both in the add_device context. But at the time of sending the provis=
ion discovery, it checks if listen_freq is 0 or not.</div><div>I have creat=
ed a patch for this problem. In the add_device context, we will update the =
go_state as REMOTE_GO.</div>
<div><br></div><div>Please see the patch and let me know if it is good to a=
pply.</div><div><br></div><div><div>From acb5cbe76b022b94077469ad9bf382ae31=
c10332 Mon Sep 17 00:00:00 2001</div><div>From: root &lt;root at neeraj-ubuntu=
64.(none)&gt;</div>
<div>Date: Fri, 21 Oct 2011 11:33:52 +0530</div><div>Subject: [PATCH] Provi=
sion discovery to be sent to GO operating freq</div><div>=A0Signed-off-by: =
root &lt;root at neeraj-ubuntu64.(none)&gt;</div><div><br></div><div>---</div>
<div>=A0src/p2p/p2p.c =A0 =A0| =A0 =A04 +++-</div><div>=A0src/p2p/p2p_pd.c =
| =A0 =A06 ++++--</div><div>=A02 files changed, 7 insertions(+), 3 deletion=
s(-)</div><div>=A0mode change 100644 =3D&gt; 100755 src/p2p/p2p.c</div><div=
>=A0mode change 100644 =3D&gt; 100755 src/p2p/p2p_pd.c</div>
<div><br></div><div>diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c</div><div>ol=
d mode 100644</div><div>new mode 100755</div><div>index 259f854..36d69d3</d=
iv><div>--- a/src/p2p/p2p.c</div><div>+++ b/src/p2p/p2p.c</div><div>@@ -574=
,8 +574,10 @@ int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int =
freq, int level,</div>
<div>=A0<span class=3D"Apple-tab-span" style=3D"white-space:pre">			</span>=
freq, msg.ds_params ? *msg.ds_params : -1);</div><div>=A0<span class=3D"App=
le-tab-span" style=3D"white-space:pre">	</span>}</div><div>=A0<span class=
=3D"Apple-tab-span" style=3D"white-space:pre">	</span>dev-&gt;listen_freq =
=3D freq;</div>
<div>-<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>if (=
msg.group_info)</div><div>+<span class=3D"Apple-tab-span" style=3D"white-sp=
ace:pre">	</span>if (msg.group_info) {</div><div>=A0<span class=3D"Apple-ta=
b-span" style=3D"white-space:pre">		</span>dev-&gt;oper_freq =3D freq;</div=
>
<div>+<span class=3D"Apple-tab-span" style=3D"white-space:pre">		</span>dev=
-&gt;go_state =3D REMOTE_GO;</div><div>+<span class=3D"Apple-tab-span" styl=
e=3D"white-space:pre">	</span>}</div><div>=A0<span class=3D"Apple-tab-span"=
 style=3D"white-space:pre">	</span>dev-&gt;info.level =3D level;</div>
<div>=A0</div><div>=A0<span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span>p2p_copy_wps_info(dev, 0, &amp;msg);</div><div>diff --git a/src=
/p2p/p2p_pd.c b/src/p2p/p2p_pd.c</div><div>old mode 100644</div><div>new mo=
de 100755</div>
<div>index f7ff06c..d8758c9</div><div>--- a/src/p2p/p2p_pd.c</div><div>+++ =
b/src/p2p/p2p_pd.c</div><div>@@ -283,8 +283,10 @@ int p2p_send_prov_disc_re=
q(struct p2p_data *p2p, struct p2p_device *dev,</div><div>=A0{</div><div>
=A0<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>struct =
wpabuf *req;</div><div>=A0<span class=3D"Apple-tab-span" style=3D"white-spa=
ce:pre">	</span>int freq;</div><div>-</div><div>-<span class=3D"Apple-tab-s=
pan" style=3D"white-space:pre">	</span>freq =3D dev-&gt;listen_freq &gt; 0 =
? dev-&gt;listen_freq : dev-&gt;oper_freq;</div>
<div>+<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>if (=
dev-&gt;go_state =3D=3D REMOTE_GO)</div><div>+<span class=3D"Apple-tab-span=
" style=3D"white-space:pre">		</span>freq =3D dev-&gt;oper_freq;</div><div>=
+<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>else</div=
>
<div>+<span class=3D"Apple-tab-span" style=3D"white-space:pre">		</span>fre=
q =3D dev-&gt;listen_freq &gt; 0 ? dev-&gt;listen_freq : dev-&gt;oper_freq;=
</div><div>=A0<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</s=
pan>if (freq &lt;=3D 0) {</div>
<div>=A0<span class=3D"Apple-tab-span" style=3D"white-space:pre">		</span>w=
pa_msg(p2p-&gt;cfg-&gt;msg_ctx, MSG_DEBUG,</div><div>=A0<span class=3D"Appl=
e-tab-span" style=3D"white-space:pre">			</span>&quot;P2P: No Listen/Operat=
ing frequency known for the &quot;</div>
<div>--=A0</div><div>1.7.4.1</div></div><div><br></div><div>Regards,</div><=
div>-Neeraj Garg</div>

--20cf307f3b8aaf27e504afc8fe44--


More information about the HostAP mailing list