From 98d7adc30daa012556fb1e7d9f8bd83ffdc84741 Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Thu, 22 Oct 2020 10:59:18 +0200 Subject: [PATCH] Bluetooth: controller: Stop aux after connected After slave connection is created only adv instance is stopped, we also need to stop aux separately if enabled. Signed-off-by: Andrzej Kaczmarek --- subsys/bluetooth/controller/ll_sw/ull.c | 9 +++++++++ subsys/bluetooth/controller/ll_sw/ull_slave.c | 20 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/ull.c b/subsys/bluetooth/controller/ll_sw/ull.c index 5b408c2dec6..8206ba4fbd2 100644 --- a/subsys/bluetooth/controller/ll_sw/ull.c +++ b/subsys/bluetooth/controller/ll_sw/ull.c @@ -798,6 +798,15 @@ void ll_rx_dequeue(void) } } +#if defined(CONFIG_BT_CTLR_ADV_EXT) + if (lll->aux) { + struct ll_adv_aux_set *aux; + + aux = (void *)HDR_LLL2EVT(lll->aux); + aux->is_started = 0U; + } +#endif /* CONFIG_BT_CTLR_ADV_EXT */ + adv->is_enabled = 0U; #else /* !CONFIG_BT_PERIPHERAL */ ARG_UNUSED(cc); diff --git a/subsys/bluetooth/controller/ll_sw/ull_slave.c b/subsys/bluetooth/controller/ll_sw/ull_slave.c index 51576f6b6e8..3d7aff88566 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_slave.c +++ b/subsys/bluetooth/controller/ll_sw/ull_slave.c @@ -310,6 +310,26 @@ void ull_slave_setup(memq_link_t *link, struct node_rx_hdr *rx, mayfly_enable(TICKER_USER_ID_ULL_HIGH, TICKER_USER_ID_ULL_LOW, 0); #endif +#if defined(CONFIG_BT_CTLR_ADV_EXT) && (CONFIG_BT_CTLR_ADV_AUX_SET > 0) + struct lll_adv_aux *lll_aux = adv->lll.aux; + + if (lll_aux) { + struct ll_adv_aux_set *aux; + + aux = (void *)HDR_LLL2EVT(lll_aux); + + ticker_id_adv = TICKER_ID_ADV_AUX_BASE + + ull_adv_aux_handle_get(aux); + ticker_status = ticker_stop(TICKER_INSTANCE_ID_CTLR, + TICKER_USER_ID_ULL_HIGH, + ticker_id_adv, + ticker_op_stop_adv_cb, aux); + ticker_op_stop_adv_cb(ticker_status, aux); + + aux->is_started = 0U; + } +#endif + /* Stop Advertiser */ ticker_id_adv = TICKER_ID_ADV_BASE + ull_adv_handle_get(adv); ticker_status = ticker_stop(TICKER_INSTANCE_ID_CTLR,