All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] mesh: Fix updating CID, PID, VID & CRPL on node attach
@ 2020-06-15 11:11 Michał Lowas-Rzechonek
  2020-06-15 16:55 ` Stotland, Inga
  2020-06-15 19:55 ` Gix, Brian
  0 siblings, 2 replies; 3+ messages in thread
From: Michał Lowas-Rzechonek @ 2020-06-15 11:11 UTC (permalink / raw)
  To: linux-bluetooth

In 8a382262125787caf38a1f800ec8956a1bf71d85, we wanted to allow the
application to update certain composition fields. This patch makes it
work.
---
 mesh/node.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/mesh/node.c b/mesh/node.c
index 10b44c8a5..6140fdf9f 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -1365,16 +1365,18 @@ static bool add_local_node(struct mesh_node *node, uint16_t unicast, bool kr,
 static void update_composition(struct mesh_node *node, struct mesh_node *attach)
 {
 	if (node->comp.cid != attach->comp.cid)
-		mesh_config_update_company_id(node->cfg, attach->comp.cid);
+		mesh_config_update_company_id(attach->cfg, node->comp.cid);
 
 	if (node->comp.pid != attach->comp.pid)
-		mesh_config_update_product_id(node->cfg, attach->comp.pid);
+		mesh_config_update_product_id(attach->cfg, node->comp.pid);
 
 	if (node->comp.vid != attach->comp.vid)
-		mesh_config_update_version_id(node->cfg, attach->comp.vid);
+		mesh_config_update_version_id(attach->cfg, node->comp.vid);
 
 	if (node->comp.crpl != attach->comp.crpl)
-		mesh_config_update_crpl(node->cfg, attach->comp.crpl);
+		mesh_config_update_crpl(attach->cfg, node->comp.crpl);
+
+	attach->comp = node->comp;
 }
 
 static bool check_req_node(struct managed_obj_request *req)
-- 
2.20.1


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

* Re: [PATCH BlueZ] mesh: Fix updating CID, PID, VID & CRPL on node attach
  2020-06-15 11:11 [PATCH BlueZ] mesh: Fix updating CID, PID, VID & CRPL on node attach Michał Lowas-Rzechonek
@ 2020-06-15 16:55 ` Stotland, Inga
  2020-06-15 19:55 ` Gix, Brian
  1 sibling, 0 replies; 3+ messages in thread
From: Stotland, Inga @ 2020-06-15 16:55 UTC (permalink / raw)
  To: michal.lowas-rzechonek, linux-bluetooth; +Cc: Gix, Brian

Good catch

On Mon, 2020-06-15 at 13:11 +0200, Michał Lowas-Rzechonek wrote:
> In 8a382262125787caf38a1f800ec8956a1bf71d85, we wanted to allow the
> application to update certain composition fields. This patch makes it
> work.
> ---
>  mesh/node.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/mesh/node.c b/mesh/node.c
> index 10b44c8a5..6140fdf9f 100644
> --- a/mesh/node.c
> +++ b/mesh/node.c
> @@ -1365,16 +1365,18 @@ static bool add_local_node(struct mesh_node *node, uint16_t unicast, bool kr,
>  static void update_composition(struct mesh_node *node, struct mesh_node *attach)
>  {
>  	if (node->comp.cid != attach->comp.cid)
> -		mesh_config_update_company_id(node->cfg, attach->comp.cid);
> +		mesh_config_update_company_id(attach->cfg, node->comp.cid);
>  
>  	if (node->comp.pid != attach->comp.pid)
> -		mesh_config_update_product_id(node->cfg, attach->comp.pid);
> +		mesh_config_update_product_id(attach->cfg, node->comp.pid);
>  
>  	if (node->comp.vid != attach->comp.vid)
> -		mesh_config_update_version_id(node->cfg, attach->comp.vid);
> +		mesh_config_update_version_id(attach->cfg, node->comp.vid);
>  
>  	if (node->comp.crpl != attach->comp.crpl)
> -		mesh_config_update_crpl(node->cfg, attach->comp.crpl);
> +		mesh_config_update_crpl(attach->cfg, node->comp.crpl);
> +
> +	attach->comp = node->comp;
>  }
>  
>  static bool check_req_node(struct managed_obj_request *req)

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

* Re: [PATCH BlueZ] mesh: Fix updating CID, PID, VID & CRPL on node attach
  2020-06-15 11:11 [PATCH BlueZ] mesh: Fix updating CID, PID, VID & CRPL on node attach Michał Lowas-Rzechonek
  2020-06-15 16:55 ` Stotland, Inga
@ 2020-06-15 19:55 ` Gix, Brian
  1 sibling, 0 replies; 3+ messages in thread
From: Gix, Brian @ 2020-06-15 19:55 UTC (permalink / raw)
  To: michal.lowas-rzechonek, linux-bluetooth

Applied, Thanks.

On Mon, 2020-06-15 at 13:11 +0200, Michał Lowas-Rzechonek wrote:
> In 8a382262125787caf38a1f800ec8956a1bf71d85, we wanted to allow the
> application to update certain composition fields. This patch makes it
> work.
> ---
>  mesh/node.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/mesh/node.c b/mesh/node.c
> index 10b44c8a5..6140fdf9f 100644
> --- a/mesh/node.c
> +++ b/mesh/node.c
> @@ -1365,16 +1365,18 @@ static bool add_local_node(struct mesh_node *node, uint16_t unicast, bool kr,
>  static void update_composition(struct mesh_node *node, struct mesh_node *attach)
>  {
>  	if (node->comp.cid != attach->comp.cid)
> -		mesh_config_update_company_id(node->cfg, attach->comp.cid);
> +		mesh_config_update_company_id(attach->cfg, node->comp.cid);
>  
>  	if (node->comp.pid != attach->comp.pid)
> -		mesh_config_update_product_id(node->cfg, attach->comp.pid);
> +		mesh_config_update_product_id(attach->cfg, node->comp.pid);
>  
>  	if (node->comp.vid != attach->comp.vid)
> -		mesh_config_update_version_id(node->cfg, attach->comp.vid);
> +		mesh_config_update_version_id(attach->cfg, node->comp.vid);
>  
>  	if (node->comp.crpl != attach->comp.crpl)
> -		mesh_config_update_crpl(node->cfg, attach->comp.crpl);
> +		mesh_config_update_crpl(attach->cfg, node->comp.crpl);
> +
> +	attach->comp = node->comp;
>  }
>  
>  static bool check_req_node(struct managed_obj_request *req)

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

end of thread, other threads:[~2020-06-15 19:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 11:11 [PATCH BlueZ] mesh: Fix updating CID, PID, VID & CRPL on node attach Michał Lowas-Rzechonek
2020-06-15 16:55 ` Stotland, Inga
2020-06-15 19:55 ` Gix, Brian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.