public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/4] Mesh demon switched to using kernel Mesh MGMT
@ 2022-09-22 20:38 Brian Gix
  2022-09-22 20:38 ` [PATCH BlueZ 1/4] mgmt: Add support for Mesh in the kernel Brian Gix
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Brian Gix @ 2022-09-22 20:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: luiz.dentz, brian.gix, inga.stotland

This patchset enables the mesh daemon (bluetooth-meshd) to use the new
MGMT mesh opcodes and events to send and receive Mesh packets. By
default, the daemon attempts to enable the experimental mesh
functionality, and query the kernel for active mesh support before then
enumerating the available controllers and selecting ojne that works.

If no kernel support is found, it will continue to use a raw HCI socket
for mesh support.

Brian Gix (4):
  mgmt: Add support for Mesh in the kernel
  lib: Add defines of new MGMT opcodes and events
  mesh: Improve PB-ADV timing for reliability
  mesh: Add new kernel MGMT based IO transport

 Makefile.mesh          |   9 +-
 doc/mgmt-api.txt       | 192 +++++++++++++++++++++++++++++++++--------
 lib/mgmt.h             |   6 ++
 mesh/main.c            |  39 ++++++++-
 mesh/mesh-io-api.h     |  11 ++-
 mesh/mesh-io-generic.c |  47 +++-------
 mesh/mesh-io-unit.c    |  13 ++-
 mesh/mesh-io.c         | 188 ++++++++++++++++++++++++++++++----------
 mesh/mesh-io.h         |   4 +-
 mesh/mesh-mgmt.c       | 164 +++++++++++++++++++++++++++--------
 mesh/mesh-mgmt.h       |  12 ++-
 mesh/mesh.c            |   6 +-
 mesh/mesh.h            |   2 +-
 mesh/pb-adv.c          |   9 +-
 14 files changed, 523 insertions(+), 179 deletions(-)

-- 
2.37.3


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH BlueZ v2 1/2] mesh: Improve PB-ADV timing for reliability
@ 2022-09-22 21:38 Brian Gix
  2022-09-22 22:24 ` Mesh demon switched to using kernel Mesh MGMT bluez.test.bot
  0 siblings, 1 reply; 11+ messages in thread
From: Brian Gix @ 2022-09-22 21:38 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: luiz.dentz, brian.gix, inga.stotland

Because provisioning is not speed dependent, Timing on outbound PB-ADV
packets have been modified to be less likely missed by remote controlers
with looser timing capabilities.
---
 mesh/pb-adv.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
index 83f922aa8..180b16258 100644
--- a/mesh/pb-adv.c
+++ b/mesh/pb-adv.c
@@ -23,6 +23,8 @@
 #include "mesh/provision.h"
 #include "mesh/pb-adv.h"
 
+#include "mesh/util.h"
+
 
 struct pb_adv_session {
 	mesh_prov_open_func_t open_cb;
@@ -158,7 +160,7 @@ static void send_adv_segs(struct pb_adv_session *session, const uint8_t *data,
 	l_debug("max_seg: %2.2x", max_seg);
 	l_debug("size: %2.2x, CRC: %2.2x", size, buf[9]);
 
-	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 200,
+	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
 							buf, init_size + 10);
 
 	consumed = init_size;
@@ -174,7 +176,7 @@ static void send_adv_segs(struct pb_adv_session *session, const uint8_t *data,
 		buf[6] = (i << 2) | 0x02;
 		memcpy(buf + 7, data + consumed, seg_size);
 
-		pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 200,
+		pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
 							buf, seg_size + 7);
 
 		consumed += seg_size;
@@ -270,7 +272,8 @@ static void send_ack(struct pb_adv_session *session, uint8_t trans_num)
 	ack.trans_num = trans_num;
 	ack.opcode = PB_ADV_ACK;
 
-	pb_adv_send(session, 1, 100, &ack, sizeof(ack));
+	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
+							&ack, sizeof(ack));
 }
 
 static void send_close_ind(struct pb_adv_session *session, uint8_t reason)
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH BlueZ v3 1/2] mesh: Improve PB-ADV timing for reliability
@ 2022-09-22 21:40 Brian Gix
  2022-09-22 22:26 ` Mesh demon switched to using kernel Mesh MGMT bluez.test.bot
  0 siblings, 1 reply; 11+ messages in thread
From: Brian Gix @ 2022-09-22 21:40 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: luiz.dentz, brian.gix, inga.stotland

Because provisioning is not speed dependent, Timing on outbound PB-ADV
packets have been modified to be less likely missed by remote controlers
with looser timing capabilities.
---
 mesh/pb-adv.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
index 83f922aa8..180b16258 100644
--- a/mesh/pb-adv.c
+++ b/mesh/pb-adv.c
@@ -23,6 +23,8 @@
 #include "mesh/provision.h"
 #include "mesh/pb-adv.h"
 
+#include "mesh/util.h"
+
 
 struct pb_adv_session {
 	mesh_prov_open_func_t open_cb;
@@ -158,7 +160,7 @@ static void send_adv_segs(struct pb_adv_session *session, const uint8_t *data,
 	l_debug("max_seg: %2.2x", max_seg);
 	l_debug("size: %2.2x, CRC: %2.2x", size, buf[9]);
 
-	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 200,
+	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
 							buf, init_size + 10);
 
 	consumed = init_size;
@@ -174,7 +176,7 @@ static void send_adv_segs(struct pb_adv_session *session, const uint8_t *data,
 		buf[6] = (i << 2) | 0x02;
 		memcpy(buf + 7, data + consumed, seg_size);
 
-		pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 200,
+		pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
 							buf, seg_size + 7);
 
 		consumed += seg_size;
@@ -270,7 +272,8 @@ static void send_ack(struct pb_adv_session *session, uint8_t trans_num)
 	ack.trans_num = trans_num;
 	ack.opcode = PB_ADV_ACK;
 
-	pb_adv_send(session, 1, 100, &ack, sizeof(ack));
+	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
+							&ack, sizeof(ack));
 }
 
 static void send_close_ind(struct pb_adv_session *session, uint8_t reason)
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH BlueZ v4 1/2] mesh: Improve PB-ADV timing for reliability
@ 2022-09-22 22:31 Brian Gix
  2022-09-22 23:26 ` Mesh demon switched to using kernel Mesh MGMT bluez.test.bot
  0 siblings, 1 reply; 11+ messages in thread
From: Brian Gix @ 2022-09-22 22:31 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: luiz.dentz, brian.gix, inga.stotland

Because provisioning is not speed dependent, Timing on outbound PB-ADV
packets have been modified to be less likely missed by remote controlers
with looser timing capabilities.
---
 mesh/pb-adv.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
index 83f922aa8..180b16258 100644
--- a/mesh/pb-adv.c
+++ b/mesh/pb-adv.c
@@ -23,6 +23,8 @@
 #include "mesh/provision.h"
 #include "mesh/pb-adv.h"
 
+#include "mesh/util.h"
+
 
 struct pb_adv_session {
 	mesh_prov_open_func_t open_cb;
@@ -158,7 +160,7 @@ static void send_adv_segs(struct pb_adv_session *session, const uint8_t *data,
 	l_debug("max_seg: %2.2x", max_seg);
 	l_debug("size: %2.2x, CRC: %2.2x", size, buf[9]);
 
-	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 200,
+	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
 							buf, init_size + 10);
 
 	consumed = init_size;
@@ -174,7 +176,7 @@ static void send_adv_segs(struct pb_adv_session *session, const uint8_t *data,
 		buf[6] = (i << 2) | 0x02;
 		memcpy(buf + 7, data + consumed, seg_size);
 
-		pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 200,
+		pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
 							buf, seg_size + 7);
 
 		consumed += seg_size;
@@ -270,7 +272,8 @@ static void send_ack(struct pb_adv_session *session, uint8_t trans_num)
 	ack.trans_num = trans_num;
 	ack.opcode = PB_ADV_ACK;
 
-	pb_adv_send(session, 1, 100, &ack, sizeof(ack));
+	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
+							&ack, sizeof(ack));
 }
 
 static void send_close_ind(struct pb_adv_session *session, uint8_t reason)
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread
* [PATCH BlueZ v5 1/2] mesh: Improve PB-ADV timing for reliability
@ 2022-09-23 18:00 Brian Gix
  2022-09-23 19:24 ` Mesh demon switched to using kernel Mesh MGMT bluez.test.bot
  0 siblings, 1 reply; 11+ messages in thread
From: Brian Gix @ 2022-09-23 18:00 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: luiz.dentz, brian.gix, inga.stotland

Because provisioning is not speed dependent, Timing on outbound PB-ADV
packets have been modified to be less likely missed by remote controlers
with looser timing capabilities.
---
 mesh/pb-adv.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/mesh/pb-adv.c b/mesh/pb-adv.c
index 83f922aa8..180b16258 100644
--- a/mesh/pb-adv.c
+++ b/mesh/pb-adv.c
@@ -23,6 +23,8 @@
 #include "mesh/provision.h"
 #include "mesh/pb-adv.h"
 
+#include "mesh/util.h"
+
 
 struct pb_adv_session {
 	mesh_prov_open_func_t open_cb;
@@ -158,7 +160,7 @@ static void send_adv_segs(struct pb_adv_session *session, const uint8_t *data,
 	l_debug("max_seg: %2.2x", max_seg);
 	l_debug("size: %2.2x, CRC: %2.2x", size, buf[9]);
 
-	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 200,
+	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
 							buf, init_size + 10);
 
 	consumed = init_size;
@@ -174,7 +176,7 @@ static void send_adv_segs(struct pb_adv_session *session, const uint8_t *data,
 		buf[6] = (i << 2) | 0x02;
 		memcpy(buf + 7, data + consumed, seg_size);
 
-		pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 200,
+		pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
 							buf, seg_size + 7);
 
 		consumed += seg_size;
@@ -270,7 +272,8 @@ static void send_ack(struct pb_adv_session *session, uint8_t trans_num)
 	ack.trans_num = trans_num;
 	ack.opcode = PB_ADV_ACK;
 
-	pb_adv_send(session, 1, 100, &ack, sizeof(ack));
+	pb_adv_send(session, MESH_IO_TX_COUNT_UNLIMITED, 500,
+							&ack, sizeof(ack));
 }
 
 static void send_close_ind(struct pb_adv_session *session, uint8_t reason)
-- 
2.37.3


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

end of thread, other threads:[~2022-09-23 19:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-22 20:38 [PATCH BlueZ 0/4] Mesh demon switched to using kernel Mesh MGMT Brian Gix
2022-09-22 20:38 ` [PATCH BlueZ 1/4] mgmt: Add support for Mesh in the kernel Brian Gix
2022-09-22 21:32   ` Mesh demon switched to using kernel Mesh MGMT bluez.test.bot
2022-09-22 20:38 ` [PATCH BlueZ 2/4] lib: Add defines of new MGMT opcodes and events Brian Gix
2022-09-22 20:38 ` [PATCH BlueZ 3/4] mesh: Improve PB-ADV timing for reliability Brian Gix
2022-09-22 20:38 ` [PATCH BlueZ 4/4] mesh: Add new kernel MGMT based IO transport Brian Gix
2022-09-22 21:20 ` [PATCH BlueZ 0/4] Mesh demon switched to using kernel Mesh MGMT patchwork-bot+bluetooth
  -- strict thread matches above, loose matches on Subject: below --
2022-09-22 21:38 [PATCH BlueZ v2 1/2] mesh: Improve PB-ADV timing for reliability Brian Gix
2022-09-22 22:24 ` Mesh demon switched to using kernel Mesh MGMT bluez.test.bot
2022-09-22 21:40 [PATCH BlueZ v3 1/2] mesh: Improve PB-ADV timing for reliability Brian Gix
2022-09-22 22:26 ` Mesh demon switched to using kernel Mesh MGMT bluez.test.bot
2022-09-22 22:31 [PATCH BlueZ v4 1/2] mesh: Improve PB-ADV timing for reliability Brian Gix
2022-09-22 23:26 ` Mesh demon switched to using kernel Mesh MGMT bluez.test.bot
2022-09-23 18:00 [PATCH BlueZ v5 1/2] mesh: Improve PB-ADV timing for reliability Brian Gix
2022-09-23 19:24 ` Mesh demon switched to using kernel Mesh MGMT bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox