linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] mesh: Fix string of public-oob and static-oob
       [not found] <CGME20191203100133epcas5p1bf4b021f6cabcba3b5ff67965ccfec56@epcas5p1.samsung.com>
@ 2019-12-03 10:01 ` Prathyusha Nelluri
       [not found]   ` <CGME20191203100133epcas5p190c7b3e7e06d84b1db57ec85054876ef@epcas5p1.samsung.com>
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Prathyusha Nelluri @ 2019-12-03 10:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Prathyusha N

From: Prathyusha N <prathyusha.n@samsung.com>

Fix string typo as per mesh-api.txt
---
 mesh/agent.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mesh/agent.c b/mesh/agent.c
index 5a5570a..9f9399f 100644
--- a/mesh/agent.c
+++ b/mesh/agent.c
@@ -131,9 +131,9 @@ static void parse_prov_caps(struct mesh_agent_prov_caps *caps,
 			break;
 		}
 
-		if (!strcmp(str, "PublicOOB"))
+		if (!strcmp(str, "public-oob"))
 			caps->pub_type = 1;
-		else if (!strcmp(str, "StaticOOB"))
+		else if (!strcmp(str, "static-oob"))
 			caps->static_type = 1;
 	}
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 1/1] mesh: Fix invalid transaction number in PROV_INVITE
       [not found]   ` <CGME20191203100133epcas5p190c7b3e7e06d84b1db57ec85054876ef@epcas5p1.samsung.com>
@ 2019-12-03 10:01     ` Prathyusha Nelluri
  2019-12-03 18:50       ` Gix, Brian
  0 siblings, 1 reply; 5+ messages in thread
From: Prathyusha Nelluri @ 2019-12-03 10:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Prathyusha N

From: Prathyusha N <prathyusha.n@samsung.com>

For initiator, transaction number starts from 0x00 where as for acceptor
transaction number starts from 0x80. Since transaction number is
pre-incremented and sent in every packet, initialize it with 0xFF for
initiator and 0x7F for acceptor.
---
 mesh/pb-adv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
index 6b4a700..19d1453 100644
--- a/mesh/pb-adv.c
+++ b/mesh/pb-adv.c
@@ -292,6 +292,7 @@ static void pb_adv_packet(void *user_data, const uint8_t *pkt, uint16_t len)
 		/* Only call Open callback once */
 		if (first) {
 			l_debug("PB-ADV open confirmed");
+			session->local_trans_num = 0xFF;
 			session->open_cb(session->user_data, pb_adv_tx,
 							session, PB_ADV);
 		}
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 1/1] mesh: Fix to send close indication on timeout
       [not found]   ` <CGME20191203100134epcas5p4855ab386bd90877c85114b970a252223@epcas5p4.samsung.com>
@ 2019-12-03 10:01     ` Prathyusha Nelluri
  0 siblings, 0 replies; 5+ messages in thread
From: Prathyusha Nelluri @ 2019-12-03 10:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Prathyusha N

From: Prathyusha N <prathyusha.n@samsung.com>

If pb_session is freed in timeout, close indication will not be sent.
pb_session is freed in pb_adv_unreg() and hence removed from tx_timeout.
Added acceptor_free() in acp_prov_close() to ensure pb_session is freed.
---
 mesh/pb-adv.c        | 2 --
 mesh/prov-acceptor.c | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
index 19d1453..586cd7f 100644
--- a/mesh/pb-adv.c
+++ b/mesh/pb-adv.c
@@ -175,8 +175,6 @@ static void tx_timeout(struct l_timeout *timeout, void *user_data)
 	l_info("TX timeout");
 	cb = pb_session->close_cb;
 	user_data = pb_session->user_data;
-	l_free(pb_session);
-	pb_session = NULL;
 	cb(user_data, 1);
 }
 
diff --git a/mesh/prov-acceptor.c b/mesh/prov-acceptor.c
index bca0193..03972c2 100644
--- a/mesh/prov-acceptor.c
+++ b/mesh/prov-acceptor.c
@@ -121,6 +121,7 @@ static void acceptor_free(void)
 static void acp_prov_close(void *user_data, uint8_t reason)
 {
 	/* TODO: Handle Close */
+	acceptor_free();
 }
 
 static void prov_to(struct l_timeout *timeout, void *user_data)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] mesh: Fix string of public-oob and static-oob
  2019-12-03 10:01 ` [PATCH 1/1] mesh: Fix string of public-oob and static-oob Prathyusha Nelluri
       [not found]   ` <CGME20191203100133epcas5p190c7b3e7e06d84b1db57ec85054876ef@epcas5p1.samsung.com>
       [not found]   ` <CGME20191203100134epcas5p4855ab386bd90877c85114b970a252223@epcas5p4.samsung.com>
@ 2019-12-03 18:49   ` Gix, Brian
  2 siblings, 0 replies; 5+ messages in thread
From: Gix, Brian @ 2019-12-03 18:49 UTC (permalink / raw)
  To: prathyusha.n, linux-bluetooth

Applied

On Tue, 2019-12-03 at 15:31 +0530, Prathyusha Nelluri wrote:
> From: Prathyusha N <prathyusha.n@samsung.com>
> 
> Fix string typo as per mesh-api.txt
> ---
>  mesh/agent.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mesh/agent.c b/mesh/agent.c
> index 5a5570a..9f9399f 100644
> --- a/mesh/agent.c
> +++ b/mesh/agent.c
> @@ -131,9 +131,9 @@ static void parse_prov_caps(struct mesh_agent_prov_caps *caps,
>  			break;
>  		}
>  
> -		if (!strcmp(str, "PublicOOB"))
> +		if (!strcmp(str, "public-oob"))
>  			caps->pub_type = 1;
> -		else if (!strcmp(str, "StaticOOB"))
> +		else if (!strcmp(str, "static-oob"))
>  			caps->static_type = 1;
>  	}
>  

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] mesh: Fix invalid transaction number in PROV_INVITE
  2019-12-03 10:01     ` [PATCH 1/1] mesh: Fix invalid transaction number in PROV_INVITE Prathyusha Nelluri
@ 2019-12-03 18:50       ` Gix, Brian
  0 siblings, 0 replies; 5+ messages in thread
From: Gix, Brian @ 2019-12-03 18:50 UTC (permalink / raw)
  To: prathyusha.n, linux-bluetooth

Applied

On Tue, 2019-12-03 at 15:31 +0530, Prathyusha Nelluri wrote:
> From: Prathyusha N <prathyusha.n@samsung.com>
> 
> For initiator, transaction number starts from 0x00 where as for acceptor
> transaction number starts from 0x80. Since transaction number is
> pre-incremented and sent in every packet, initialize it with 0xFF for
> initiator and 0x7F for acceptor.
> ---
>  mesh/pb-adv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
> index 6b4a700..19d1453 100644
> --- a/mesh/pb-adv.c
> +++ b/mesh/pb-adv.c
> @@ -292,6 +292,7 @@ static void pb_adv_packet(void *user_data, const uint8_t *pkt, uint16_t len)
>  		/* Only call Open callback once */
>  		if (first) {
>  			l_debug("PB-ADV open confirmed");
> +			session->local_trans_num = 0xFF;
>  			session->open_cb(session->user_data, pb_adv_tx,
>  							session, PB_ADV);
>  		}

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-03 18:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20191203100133epcas5p1bf4b021f6cabcba3b5ff67965ccfec56@epcas5p1.samsung.com>
2019-12-03 10:01 ` [PATCH 1/1] mesh: Fix string of public-oob and static-oob Prathyusha Nelluri
     [not found]   ` <CGME20191203100133epcas5p190c7b3e7e06d84b1db57ec85054876ef@epcas5p1.samsung.com>
2019-12-03 10:01     ` [PATCH 1/1] mesh: Fix invalid transaction number in PROV_INVITE Prathyusha Nelluri
2019-12-03 18:50       ` Gix, Brian
     [not found]   ` <CGME20191203100134epcas5p4855ab386bd90877c85114b970a252223@epcas5p4.samsung.com>
2019-12-03 10:01     ` [PATCH 1/1] mesh: Fix to send close indication on timeout Prathyusha Nelluri
2019-12-03 18:49   ` [PATCH 1/1] mesh: Fix string of public-oob and static-oob Gix, Brian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).