Skip to content

Commit 2057659

Browse files
cvinayakkartben
authored andcommitted
Bluetooth: Controller: nRF54Lx: Fix MDATA length to avoid MIC failures
Fix MDATA length with extra bytes to mitigate MIC failures. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
1 parent d720032 commit 2057659

File tree

1 file changed

+6
-1
lines changed
  • subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio

1 file changed

+6
-1
lines changed

subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/radio/radio.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2072,6 +2072,11 @@ struct ccm_job_ptr {
20722072
#define CCM_JOB_PTR_ATTRIBUTE_ADATA 13U
20732073
#define CCM_JOB_PTR_ATTRIBUTE_MDATA 14U
20742074

2075+
/* For a Max 27 byte PDU reception, an actual 26 byte PDU needs the below extra MDATA length to
2076+
* mitigate MIC failures. I.e. MDATA length = 27 + 4 (MIC size) + 2 (extra).
2077+
*/
2078+
#define NRF_CCM_WORKAROUND_XXXX_MDATA_EXTRA 2U
2079+
20752080
static struct {
20762081
uint16_t in_alen;
20772082
uint16_t in_mlen;
@@ -2253,7 +2258,7 @@ static void *radio_ccm_ext_rx_pkt_set(struct ccm *cnf, uint8_t phy, uint8_t pdu_
22532258
ccm_job.in[3].attribute = CCM_JOB_PTR_ATTRIBUTE_ADATA;
22542259

22552260
ccm_job.in[4].ptr = (void *)((uint8_t *)_pkt_scratch + 3U);
2256-
ccm_job.in[4].length = mlen;
2261+
ccm_job.in[4].length = mlen + NRF_CCM_WORKAROUND_XXXX_MDATA_EXTRA;
22572262
ccm_job.in[4].attribute = CCM_JOB_PTR_ATTRIBUTE_MDATA;
22582263

22592264
ccm_job.in[5].ptr = NULL;

0 commit comments

Comments
 (0)