Bluetooth: Controller: Use conn interval unit for Auxiliary event
Use connection interval units of 1250 us for periodic scheduling of Extended Advertising auxiliary PDU events so that auxiliary events can be periodically grouped alongwith the Periodic Advertising Events. This will permit mitigating overlaps amongst them. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
0f407597bd
commit
4e787d0a2a
@ -21,9 +21,10 @@
|
||||
#define EVENT_DONE_LINK_CNT 1
|
||||
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
|
||||
|
||||
#define ADV_INT_UNIT_US 625U
|
||||
#define SCAN_INT_UNIT_US 625U
|
||||
#define CONN_INT_UNIT_US 1250U
|
||||
#define ADV_INT_UNIT_US 625U
|
||||
#define SCAN_INT_UNIT_US 625U
|
||||
#define CONN_INT_UNIT_US 1250U
|
||||
#define PERIODIC_INT_UNIT_US 1250U
|
||||
|
||||
/* Intervals after which connection or sync establishment is considered lost */
|
||||
#define CONN_ESTAB_COUNTDOWN 6U
|
||||
|
||||
@ -489,7 +489,7 @@ static void isr_rx(void *param)
|
||||
HAL_TICKER_TICKS_TO_US(radio_tmr_start_get()) +
|
||||
radio_tmr_aa_restore() - addr_us_get(lll->phy) +
|
||||
(ceiling_fraction(lll->ptc_curr, lll->bn) *
|
||||
lll->iso_interval * CONN_INT_UNIT_US);
|
||||
lll->iso_interval * PERIODIC_INT_UNIT_US);
|
||||
iso_meta->status = 0U;
|
||||
|
||||
lll->payload[bis_idx][payload_index] = node_rx;
|
||||
|
||||
@ -1422,11 +1422,18 @@ uint8_t ll_adv_enable(uint8_t enable)
|
||||
|
||||
/* Keep aux interval equal or higher than primary PDU
|
||||
* interval.
|
||||
* Use periodic interval units to represent the
|
||||
* periodic behavior of scheduling of AUX_ADV_IND PDUs
|
||||
* so that it is grouped with similar interval units
|
||||
* used for ACL Connections, Periodic Advertising and
|
||||
* BIG radio events.
|
||||
*/
|
||||
aux->interval = adv->interval +
|
||||
(HAL_TICKER_TICKS_TO_US(
|
||||
ULL_ADV_RANDOM_DELAY) /
|
||||
ADV_INT_UNIT_US);
|
||||
aux->interval =
|
||||
ceiling_fraction(((uint64_t)adv->interval *
|
||||
ADV_INT_UNIT_US) +
|
||||
HAL_TICKER_TICKS_TO_US(
|
||||
ULL_ADV_RANDOM_DELAY),
|
||||
PERIODIC_INT_UNIT_US);
|
||||
|
||||
ret = ull_adv_aux_start(aux, ticks_anchor_aux,
|
||||
ticks_slot_overhead_aux);
|
||||
|
||||
@ -144,10 +144,20 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref,
|
||||
uint32_t ticks_anchor;
|
||||
uint32_t ret;
|
||||
|
||||
aux->interval = adv->interval +
|
||||
(HAL_TICKER_TICKS_TO_US(
|
||||
ULL_ADV_RANDOM_DELAY) /
|
||||
ADV_INT_UNIT_US);
|
||||
/* Keep aux interval equal or higher than primary PDU
|
||||
* interval.
|
||||
* Use periodic interval units to represent the
|
||||
* periodic behavior of scheduling of AUX_ADV_IND PDUs
|
||||
* so that it is grouped with similar interval units
|
||||
* used for ACL Connections, Periodic Advertising and
|
||||
* BIG radio events.
|
||||
*/
|
||||
aux->interval =
|
||||
ceiling_fraction(((uint64_t)adv->interval *
|
||||
ADV_INT_UNIT_US) +
|
||||
HAL_TICKER_TICKS_TO_US(
|
||||
ULL_ADV_RANDOM_DELAY),
|
||||
PERIODIC_INT_UNIT_US);
|
||||
|
||||
/* TODO: Find the anchor before the group of
|
||||
* active Periodic Advertising events, so
|
||||
@ -1056,9 +1066,12 @@ uint32_t ull_adv_aux_start(struct ll_adv_aux_set *aux, uint32_t ticks_anchor,
|
||||
uint32_t ticks_slot_overhead)
|
||||
{
|
||||
uint32_t volatile ret_cb;
|
||||
uint32_t interval_us;
|
||||
uint8_t aux_handle;
|
||||
uint32_t ret;
|
||||
|
||||
interval_us = aux->interval * PERIODIC_INT_UNIT_US;
|
||||
|
||||
ull_hdr_init(&aux->ull);
|
||||
aux_handle = ull_adv_aux_handle_get(aux);
|
||||
|
||||
@ -1066,9 +1079,8 @@ uint32_t ull_adv_aux_start(struct ll_adv_aux_set *aux, uint32_t ticks_anchor,
|
||||
ret = ticker_start(TICKER_INSTANCE_ID_CTLR, TICKER_USER_ID_THREAD,
|
||||
(TICKER_ID_ADV_AUX_BASE + aux_handle),
|
||||
ticks_anchor, 0,
|
||||
HAL_TICKER_US_TO_TICKS((uint64_t)aux->interval *
|
||||
ADV_INT_UNIT_US),
|
||||
TICKER_NULL_REMAINDER, TICKER_NULL_LAZY,
|
||||
HAL_TICKER_US_TO_TICKS(interval_us),
|
||||
HAL_TICKER_REMAINDER(interval_us), TICKER_NULL_LAZY,
|
||||
(aux->ull.ticks_slot + ticks_slot_overhead),
|
||||
ticker_cb, aux,
|
||||
ull_ticker_status_give, (void *)&ret_cb);
|
||||
|
||||
@ -302,7 +302,7 @@ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
||||
* or integer multiple of SDU interval for unframed PDUs
|
||||
*/
|
||||
iso_interval_us = ((sdu_interval * lll_adv_iso->bn) /
|
||||
(bn * CONN_INT_UNIT_US)) * CONN_INT_UNIT_US;
|
||||
(bn * PERIODIC_INT_UNIT_US)) * PERIODIC_INT_UNIT_US;
|
||||
|
||||
/* Allocate next PDU */
|
||||
err = ull_adv_sync_pdu_alloc(adv, ULL_ADV_PDU_EXTRA_DATA_ALLOC_IF_EXIST,
|
||||
@ -341,7 +341,7 @@ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
||||
*/
|
||||
|
||||
big_info->iso_interval =
|
||||
sys_cpu_to_le16(iso_interval_us / CONN_INT_UNIT_US);
|
||||
sys_cpu_to_le16(iso_interval_us / PERIODIC_INT_UNIT_US);
|
||||
big_info->num_bis = lll_adv_iso->num_bis;
|
||||
big_info->nse = lll_adv_iso->nse;
|
||||
big_info->bn = lll_adv_iso->bn;
|
||||
|
||||
@ -853,7 +853,7 @@ uint32_t ull_adv_sync_start(struct ll_adv_set *adv,
|
||||
ticks_slot_overhead = 0U;
|
||||
}
|
||||
|
||||
interval_us = (uint32_t)sync->interval * CONN_INT_UNIT_US;
|
||||
interval_us = (uint32_t)sync->interval * PERIODIC_INT_UNIT_US;
|
||||
|
||||
sync_handle = sync_handle_get(sync);
|
||||
|
||||
|
||||
@ -619,7 +619,7 @@ void ull_sync_setup(struct ll_scan_set *scan, struct ll_scan_aux_set *aux,
|
||||
lll->phy = aux->lll.phy;
|
||||
|
||||
interval = sys_le16_to_cpu(si->interval);
|
||||
interval_us = interval * CONN_INT_UNIT_US;
|
||||
interval_us = interval * PERIODIC_INT_UNIT_US;
|
||||
|
||||
/* Convert fromm 10ms units to interval units */
|
||||
sync->timeout_reload = RADIO_SYNC_EVENTS((sync->timeout * 10U *
|
||||
|
||||
@ -383,7 +383,7 @@ void ull_sync_iso_setup(struct ll_sync_iso_set *sync_iso,
|
||||
}
|
||||
|
||||
lll->iso_interval = sys_le16_to_cpu(bi->iso_interval);
|
||||
interval_us = lll->iso_interval * CONN_INT_UNIT_US;
|
||||
interval_us = lll->iso_interval * PERIODIC_INT_UNIT_US;
|
||||
|
||||
sync_iso->timeout_reload =
|
||||
RADIO_SYNC_EVENTS((sync_iso->timeout * 10U * USEC_PER_MSEC),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user