Bluetooth: controller: store STO value instead of pre-calculated reload

Instead of storing the calculated reload value (in conn intervals) in
the conn object, now store the timeout value, and perform calculation
when used. This allows using the timeout value across all CIS's without
having to re-calc and store on change of TO

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
This commit is contained in:
Erik Brockhoff 2022-09-08 13:19:49 +02:00 committed by Carles Cufí
commit 0604a4d2f1
8 changed files with 40 additions and 54 deletions

View file

@ -220,7 +220,11 @@ static void lp_comm_tx(struct ll_conn *conn, struct proc_ctx *ctx)
* NOTE: As the supervision timeout is at most 32s the normal procedure response
* timeout of 40s will never come into play for the ACL Termination procedure.
*/
llcp_lr_prt_restart_with_value(conn, conn->supervision_reload);
const uint32_t conn_interval_us = conn->lll.interval * CONN_INT_UNIT_US;
const uint16_t sto_reload = RADIO_CONN_EVENTS(
(conn->supervision_timeout * 10U * 1000U),
conn_interval_us);
llcp_lr_prt_restart_with_value(conn, sto_reload);
}
}