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.
This commit is contained in:
Andrzej Kaczmarek
2022-10-11 22:02:11 +02:00
parent b353ddc1a4
commit c6e6614cf1
2 changed files with 16 additions and 0 deletions
@@ -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 */
+12
View File
@@ -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,