Bluetooth: Controller: Ensure ext header max size reservation

Ensure maximum size of common extended header format be
reserved when CONFIG_BT_CTLR_ADV_RESERVE_MAX=n is used so
that changes to ACAD, like channel map update does not need
frequent update to periodic advertising auxiliary channel
PDU time reservations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2022-10-15 06:41:38 +05:30 committed by Carles Cufí
commit 1b023e5419

View file

@ -52,6 +52,8 @@ static uint8_t adv_type_check(struct ll_adv_set *adv);
static inline struct ll_adv_sync_set *sync_acquire(void);
static inline void sync_release(struct ll_adv_sync_set *sync);
static inline uint16_t sync_handle_get(struct ll_adv_sync_set *sync);
static uint32_t ull_adv_sync_pdu_time_get(const struct ll_adv_sync_set *sync,
const struct pdu_adv *pdu);
static inline uint8_t sync_remove(struct ll_adv_sync_set *sync,
struct ll_adv_set *adv, uint8_t enable);
static uint8_t sync_chm_update(uint8_t handle);
@ -1071,8 +1073,7 @@ uint32_t ull_adv_sync_start(struct ll_adv_set *adv,
lll_sync = &sync->lll;
ter_pdu = lll_adv_sync_data_peek(lll_sync, NULL);
/* Calculate the PDU Tx Time and hence the radio event length */
time_us = ull_adv_sync_time_get(sync, ter_pdu->len);
time_us = ull_adv_sync_pdu_time_get(sync, ter_pdu);
/* TODO: active_to_start feature port */
sync->ull.ticks_active_to_start = 0U;
@ -1118,7 +1119,7 @@ uint8_t ull_adv_sync_time_update(struct ll_adv_sync_set *sync,
uint32_t time_us;
uint32_t ret;
time_us = ull_adv_sync_time_get(sync, pdu->len);
time_us = ull_adv_sync_pdu_time_get(sync, pdu);
time_ticks = HAL_TICKER_US_TO_TICKS(time_us);
if (sync->ull.ticks_slot > time_ticks) {
ticks_minus = sync->ull.ticks_slot - time_ticks;
@ -1888,6 +1889,23 @@ static inline uint16_t sync_handle_get(struct ll_adv_sync_set *sync)
sizeof(struct ll_adv_sync_set));
}
static uint32_t ull_adv_sync_pdu_time_get(const struct ll_adv_sync_set *sync,
const struct pdu_adv *pdu)
{
uint8_t len;
/* Calculate the PDU Tx Time and hence the radio event length,
* Always use maximum length for common extended header format so that
* ACAD could be update when periodic advertising is active and the
* time reservation need not be updated everytime avoiding overlapping
* with other active states/roles.
*/
len = pdu->len - pdu->adv_ext_ind.ext_hdr_len -
PDU_AC_EXT_HEADER_SIZE_MIN + PDU_AC_EXT_HEADER_SIZE_MAX;
return ull_adv_sync_time_get(sync, len);
}
static uint8_t sync_stop(struct ll_adv_sync_set *sync)
{
uint8_t sync_handle;