This is an automated email from the ASF dual-hosted git repository.

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new c6e6614c nimble/ll: Add init and reset for external code
c6e6614c is described below

commit c6e6614cf114526113f02321cf38c156417d675d
Author: Andrzej Kaczmarek <andrzej.kaczma...@codecoup.pl>
AuthorDate: Sun Oct 9 21:44:30 2022 +0200

    nimble/ll: Add init and reset for external code
    
    This adds init and reset calls for external code so it can be
    initialized and reset properly in sync with LL.
---
 nimble/controller/include/controller/ble_ll_ext.h |  4 ++++
 nimble/controller/src/ble_ll.c                    | 12 ++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/nimble/controller/include/controller/ble_ll_ext.h 
b/nimble/controller/include/controller/ble_ll_ext.h
index fc46ad4d..5b3bb376 100644
--- a/nimble/controller/include/controller/ble_ll_ext.h
+++ b/nimble/controller/include/controller/ble_ll_ext.h
@@ -36,6 +36,10 @@ extern "C" {
 
 struct ble_ll_sched_item;
 
+/* Called when LL package is initialized (before ll_task is started) */
+void ble_ll_ext_init(void);
+/* Called when LL is reset (i.e. HCI_Reset) */
+void ble_ll_ext_reset(void);
 /* Called when LL is in "external" state and PHY starts to receive a PDU */
 int ble_ll_ext_rx_isr_start(uint8_t pdu_type, struct ble_mbuf_hdr *rxhdr);
 /* Called when LL is in "external" state and PHY finished to receive a PDU */
diff --git a/nimble/controller/src/ble_ll.c b/nimble/controller/src/ble_ll.c
index d8d2e6bc..b3719c12 100644
--- a/nimble/controller/src/ble_ll.c
+++ b/nimble/controller/src/ble_ll.c
@@ -56,6 +56,10 @@
 #include "ble_ll_dtm_priv.h"
 #endif
 
+#if MYNEWT_VAL(BLE_LL_EXT)
+#include <controller/ble_ll_ext.h>
+#endif
+
 /* XXX:
  *
  * 1) use the sanity task!
@@ -1605,6 +1609,10 @@ ble_ll_reset(void)
     ble_ll_rfmgmt_reset();
     OS_EXIT_CRITICAL(sr);
 
+#if MYNEWT_VAL(BLE_LL_EXT)
+    ble_ll_ext_reset();
+#endif
+
 #if MYNEWT_VAL(BLE_LL_ROLE_BROADCASTER)
     /* Stop any advertising */
     ble_ll_adv_reset();
@@ -1981,6 +1989,10 @@ ble_ll_init(void)
     ble_ll_hci_vs_init();
 #endif
 
+#if MYNEWT_VAL(BLE_LL_EXT)
+    ble_ll_ext_init();
+#endif
+
 #if MYNEWT
     /* Initialize the LL task */
     os_task_init(&g_ble_ll_task, "ble_ll", ble_ll_task, NULL,

Reply via email to