diff mbox

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

Message ID 2C2F1EBA8050E74EA81502D5740B4BD6BBA9D30FAD@SJEXCHCCR02.corp.ad.broadcom.com
State Superseded, archived
Headers show

Commit Message

Neeraj Garg Nov. 8, 2011, 10:36 a.m. UTC
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



Regards,
-Neeraj

Comments

Johannes Berg Nov. 8, 2011, 10:52 a.m. UTC | #1
On Tue, 2011-11-08 at 02:36 -0800, Neeraj Kumar Garg wrote:
> Hello Jouni,
> 
> Sorry for sending this patch again. Please let me know if the patch
> requires modifications.

It does, you need to not send it as html :-)

johannes
diff mbox

Patch

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,
      curr_noa_len);

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

  return P2P_SC_SUCCESS;