Bluetooth: Controller: Add CTE REQ disable when change PHY to CODED

Accodring to BT 5.3 Core Vol 4, Part E section 7.8.85 the CTE request
procedure has to be disabled as if Host issued the HCI_LE_Connection-
CTE_Request_Enable with enable property set to 0. It means a Controller
should automaticall  disable the procedure.

There were no handling of this part of specification.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
This commit is contained in:
Piotr Pryga 2022-01-28 22:58:34 +01:00 committed by Carles Cufí
commit dbf86b0359
3 changed files with 72 additions and 20 deletions

View file

@ -1654,9 +1654,24 @@ void ull_conn_done(struct node_rx_event_done *done)
if (conn->llcp.cte_req.req_expire > elapsed_event) {
conn->llcp.cte_req.req_expire -= elapsed_event;
} else {
uint8_t err;
conn->llcp.cte_req.req_expire = 0U;
ull_cp_cte_req(conn, conn->llcp.cte_req.min_cte_len,
conn->llcp.cte_req.cte_type);
err = ull_cp_cte_req(conn, conn->llcp.cte_req.min_cte_len,
conn->llcp.cte_req.cte_type);
if (err == BT_HCI_ERR_CMD_DISALLOWED) {
/* Conditions has changed e.g. PHY was changed to CODED.
* New CTE REQ is not possible. Disable the periodic requests.
*
* If the CTE REQ is in active state, let it complete and disable
* in regular control procedure way.
*/
if (!conn->llcp.cte_req.is_active) {
ull_cp_cte_req_set_disable(conn);
}
}
}
}
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */