Bluetooth: controller: adding API for unmasking peer features

For asymetrical features there needs to be a separate mechanism to
unmask features in peer. This must be used in central for unmasking in case
of 'unsupported in peer' condition for CIS Create.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
This commit is contained in:
Erik Brockhoff 2023-08-16 14:50:04 +02:00 committed by Alberto Escolar
commit 1de8a76f58
2 changed files with 7 additions and 2 deletions

View file

@ -921,14 +921,14 @@ static void lp_cc_st_wait_rx_cis_rsp(struct ll_conn *conn, struct proc_ctx *ctx,
break;
case LP_CC_EVT_UNKNOWN:
/* Unsupported in peer, so disable locally for this connection */
feature_unmask_features(conn, LL_FEAT_BIT_CIS_PERIPHERAL);
feature_unmask_peer_features(conn, LL_FEAT_BIT_CIS_PERIPHERAL);
ctx->data.cis_create.error = BT_HCI_ERR_UNSUPP_REMOTE_FEATURE;
lp_cc_complete(conn, ctx, evt, param);
break;
case LP_CC_EVT_REJECT:
if (pdu->llctrl.reject_ext_ind.error_code == BT_HCI_ERR_UNSUPP_REMOTE_FEATURE) {
/* Unsupported in peer, so disable locally for this connection */
feature_unmask_features(conn, LL_FEAT_BIT_CIS_PERIPHERAL);
feature_unmask_peer_features(conn, LL_FEAT_BIT_CIS_PERIPHERAL);
}
ctx->data.cis_create.error = pdu->llctrl.reject_ext_ind.error_code;
lp_cc_complete(conn, ctx, evt, param);

View file

@ -9,6 +9,11 @@ static inline void feature_unmask_features(struct ll_conn *conn, uint64_t ll_fea
conn->llcp.fex.features_used &= ~ll_feat_mask;
}
static inline void feature_unmask_peer_features(struct ll_conn *conn, uint64_t ll_feat_mask)
{
conn->llcp.fex.features_peer &= ~ll_feat_mask;
}
static inline bool feature_le_encryption(struct ll_conn *conn)
{
#if defined(CONFIG_BT_CTLR_LE_ENC)