[PATCH] P2P return a successful response for p2p presence request if driver has return noa_len greater than 0

Neeraj Kumar Garg neerajkg at broadcom.com
Tue Nov 8 05:36:18 EST 2011

Hello Jouni,
Sorry for sending this patch again. Please let me know if the patch requires modifications.

If the driver returns a valid noa attribute and curr_noa_len > 0, we should return P2P Presence response as P2P_SC_SUCCESS instead of UNABLE_TO_ACCODATE. The problem is p2p_process_presence_req takes the status response from p2p_group_presence_req function and then puts this status in P2P Presence response. With the present code, if curr_noa_len==0, then only we send a SUCCESS response.
I agree that calling function p2p_group_presence_req() is not required as we are anyways again calling get_noa in the function p2p_process_presence_req. But then alternatively, we should not use status variable to send the P2P presence response OR status variable should be dependent upon get_noa call in function p2p_process_presence_req.

 src/p2p/p2p_group.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 src/p2p/p2p_group.c

diff --git a/src/p2p/p2p_group.c b/src/p2p/p2p_group.c
old mode 100644
new mode 100755
index 58b24c5..d60f6c0
--- a/src/p2p/p2p_group.c
+++ b/src/p2p/p2p_group.c
@@ -658,7 +658,7 @@ u8 p2p_group_presence_req(struct p2p_group *group,

  /* TODO: properly process request and store copy */
- if (curr_noa_len > 0)
+ if (curr_noa_len < 0)

  return P2P_SC_SUCCESS;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.shmoo.com/pipermail/hostap/attachments/20111108/1cf1403f/attachment-0001.htm 

More information about the HostAP mailing list