-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Bluetooth: Controller: Fix nRF CCM disable on connection event abort #88184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -228,6 +228,13 @@ void lll_conn_abort_cb(struct lll_prepare_param *prepare_param, void *param) | |||||||||
| */ | ||||||||||
| radio_isr_set(isr_done, param); | ||||||||||
| radio_disable(); | ||||||||||
|
|
||||||||||
| #if defined(CONFIG_BT_CTLR_LE_ENC) | ||||||||||
| if (lll->enc_rx) { | ||||||||||
| radio_ccm_disable(); | ||||||||||
| } | ||||||||||
|
Comment on lines
+233
to
+235
|
||||||||||
| if (lll->enc_rx) { | |
| radio_ccm_disable(); | |
| } | |
| disable_ccm_if_encrypted(lll); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The abort_cb is kept role specific to make it easy to update its logic in future, hence not considering using common helper functions. Also, the context that stores the enc state is different for different roles in the Controller.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -445,6 +445,15 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) | |||||||||||||||||
| radio_isr_set(isr_done, cis_lll); | ||||||||||||||||||
| radio_disable(); | ||||||||||||||||||
|
|
||||||||||||||||||
| #if defined(CONFIG_BT_CTLR_LE_ENC) | ||||||||||||||||||
| /* Get reference to ACL context */ | ||||||||||||||||||
| const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); | ||||||||||||||||||
|
|
||||||||||||||||||
| if (conn_lll->enc_rx) { | ||||||||||||||||||
| radio_ccm_disable(); | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
+449
to
+454
|
||||||||||||||||||
| /* Get reference to ACL context */ | |
| const struct lll_conn *conn_lll = ull_conn_lll_get(cis_lll->acl_handle); | |
| if (conn_lll->enc_rx) { | |
| radio_ccm_disable(); | |
| } | |
| /* Disable CCM if encryption is enabled */ | |
| disable_ccm_if_encrypted(cis_lll->acl_handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The abort_cb is kept role specific to make it easy to update its logic in future, hence not considering using common helper functions. Also, the context that stores the enc state is different for different roles in the Controller.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -482,6 +482,15 @@ static void abort_cb(struct lll_prepare_param *prepare_param, void *param) | |||||||||||||
| if (!prepare_param) { | ||||||||||||||
| radio_isr_set(isr_done, param); | ||||||||||||||
| radio_disable(); | ||||||||||||||
|
|
||||||||||||||
| if (IS_ENABLED(CONFIG_BT_CTLR_BROADCAST_ISO_ENC)) { | ||||||||||||||
| const struct lll_sync_iso *lll = param; | ||||||||||||||
|
|
||||||||||||||
| if (lll->enc) { | ||||||||||||||
| radio_ccm_disable(); | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+487
to
+491
|
||||||||||||||
| const struct lll_sync_iso *lll = param; | |
| if (lll->enc) { | |
| radio_ccm_disable(); | |
| } | |
| disable_ccm_if_encrypted(param); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The abort_cb is kept role specific to make it easy to update its logic in future, hence not considering using common helper functions. Also, the context that stores the enc state is different for different roles in the Controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The similar pattern of checking the encryption state and disabling CCM appears across different modules. Consider consolidating this logic into a helper function to ease future maintenance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
abort_cbis kept role specific to make it easy to update its logic in future, hence not considering using common helper functions. Also, the context that stores the enc state is different for different roles in the Controller.