Skip to content

Commit b867f0e

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: Controller: Fix T_MAFS between broadcasting roles
When calculating the offsets between primary advertising PDU, auxiliary PDU, Periodic Advertising PDU, and BIS PDU, the values used as anchor points for starting the periodic interval for auxiliary, periodic and BIG events, should be ensured to have the minimum auxiliary frame spacing T_MAFS between the PDUs. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 1bbe209 commit b867f0e

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

subsys/bluetooth/controller/ll_sw/ull_adv.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,8 +1409,7 @@ uint8_t ll_adv_enable(uint8_t enable)
14091409
ticks_anchor + ticks_slot +
14101410
HAL_TICKER_US_TO_TICKS(
14111411
MAX(EVENT_MAFS_US,
1412-
EVENT_OVERHEAD_START_US) -
1413-
EVENT_OVERHEAD_START_US +
1412+
EVENT_OVERHEAD_START_US) +
14141413
(EVENT_TICKER_RES_MARGIN_US << 1));
14151414

14161415
ticks_slot_overhead_aux =
@@ -1450,8 +1449,7 @@ uint8_t ll_adv_enable(uint8_t enable)
14501449
ticks_anchor_aux + ticks_slot_aux +
14511450
HAL_TICKER_US_TO_TICKS(
14521451
MAX(EVENT_MAFS_US,
1453-
EVENT_OVERHEAD_START_US) -
1454-
EVENT_OVERHEAD_START_US +
1452+
EVENT_OVERHEAD_START_US) +
14551453
(EVENT_TICKER_RES_MARGIN_US << 1));
14561454

14571455
ret = ull_adv_sync_start(adv, sync,

subsys/bluetooth/controller/ll_sw/ull_adv_aux.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2419,7 +2419,9 @@ uint32_t ull_adv_aux_evt_init(struct ll_adv_aux_set *aux,
24192419
if (!err) {
24202420
*ticks_anchor = ticks_anchor_aux;
24212421
*ticks_anchor += HAL_TICKER_US_TO_TICKS(
2422-
EVENT_TICKER_RES_MARGIN_US);
2422+
MAX(EVENT_MAFS_US,
2423+
EVENT_OVERHEAD_START_US) +
2424+
(EVENT_TICKER_RES_MARGIN_US << 1));
24232425
}
24242426
#endif /* CONFIG_BT_CTLR_SCHED_ADVANCED */
24252427

subsys/bluetooth/controller/ll_sw/ull_adv_iso.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,9 @@ static uint32_t adv_iso_start(struct ll_adv_iso_set *adv_iso,
860860
ticks_slot, &ticks_anchor);
861861
if (!err) {
862862
ticks_anchor += HAL_TICKER_US_TO_TICKS(
863-
EVENT_TICKER_RES_MARGIN_US);
863+
MAX(EVENT_MAFS_US,
864+
EVENT_OVERHEAD_START_US) +
865+
(EVENT_TICKER_RES_MARGIN_US << 1));
864866
} else {
865867
ticks_anchor = ticker_ticks_now_get();
866868
}

subsys/bluetooth/controller/ll_sw/ull_adv_sync.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,6 @@ uint8_t ll_adv_sync_enable(uint8_t handle, uint8_t enable)
888888
HAL_TICKER_US_TO_TICKS(
889889
MAX(EVENT_MAFS_US,
890890
EVENT_OVERHEAD_START_US) -
891-
EVENT_OVERHEAD_START_US +
892891
(EVENT_TICKER_RES_MARGIN_US << 1));
893892
}
894893

0 commit comments

Comments
 (0)