nimble/ll: Add Channel Sounding#1765
Conversation
fcafb89 to
6a71e3d
Compare
sjanc
left a comment
There was a problem hiding this comment.
look good, few nitpicks here and there
| cssm = connsm->cssm; | ||
|
|
||
| /* Check if a disabled role is used in CS configs */ | ||
| for (int i = 0; i < ARRAY_SIZE(cssm->config); i++) { |
There was a problem hiding this comment.
nitpick: we typically declare variable at top of the function, also could be unsigned to avoid signed-unsigned comparison
|
|
||
| /* Check if a disabled role is used in CS configs */ | ||
| for (int i = 0; i < ARRAY_SIZE(cssm->config); i++) { | ||
| struct ble_ll_cs_config *conf = &cssm->config[i]; |
| } | ||
|
|
||
| cssm->roles_enabled = cmd->role_enable; | ||
| cssm->cs_sync_antenna_selection = cmd->cs_sync_antenna_selection; |
There was a problem hiding this comment.
not sure if we are very consistent with this but maybe sm could be modified only after all validation is done? ie to avoid modifying it and stil returning error status
| int | ||
| ble_ll_cs_rx_fae_req(struct ble_ll_conn_sm *connsm, uint8_t *rspbuf) | ||
| { | ||
| memcpy(rspbuf, connsm->cssm->local_fae_table, 72); |
There was a problem hiding this comment.
this is quite a lot, is it guaranteed that there is enough linear space in underlying mbuf?
There was a problem hiding this comment.
Good point, there wasn't ;)
|
|
||
| if (!rc) { | ||
| swap_buf(out_data, ecb.cipher_text, BLE_ENC_BLOCK_SIZE); | ||
| rc = 0; |
| { | ||
| uint8_t config_id = connsm->cssm->config_req_id; | ||
| uint8_t action = connsm->cssm->config_req_action; | ||
| const struct ble_ll_cs_config *conf = &connsm->cssm->config[config_id]; |
There was a problem hiding this comment.
is config_id already validated here?
| return BLE_ERR_UNK_CONN_ID; | ||
| } | ||
|
|
||
| conf = &connsm->cssm->config[cmd->config_id]; |
There was a problem hiding this comment.
config_id should be validated before being used for indexing
a1d3776 to
66e8783
Compare
|
|
||
| pkg.cflags.TEST: | ||
| - -Irepos/mbedtls/include | ||
| - -Irepos/include/mbedtls |
There was a problem hiding this comment.
includes should be added automatically from pkg dep
| uint8_t *pv = connsm->cssm->drbg_ctx.pv; | ||
|
|
||
| if (!connsm->flags.encrypted) { | ||
| return rej_ext_ind_make(BLE_LL_CTRL_CS_SEC_REQ, |
There was a problem hiding this comment.
ble_ll_ctrl_rej_ext_ind_make + return
| struct ble_ll_cs_drbg_ctx *drbg_ctx = &connsm->cssm->drbg_ctx; | ||
|
|
||
| if (!IS_PENDING_CTRL_PROC(connsm, BLE_LL_CTRL_PROC_CS_SEC_START)) { | ||
| /* Should never happen */ |
There was a problem hiding this comment.
in bluetooth it will happen ;)
just change the comment to "ignore" or smth
| void | ||
| ble_ll_cs_rx_capabilities_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr) | ||
| { | ||
| ble_ll_cs_update_rem_capabilities(connsm, dptr); |
There was a problem hiding this comment.
this should verify data in rsp and return error if needed
66e8783 to
95655da
Compare
95655da to
e5c19a3
Compare
e5c19a3 to
a206502
Compare
a206502 to
7fb1152
Compare
|
Just rebase |
7fb1152 to
082a16d
Compare
082a16d to
3155c69
Compare
3155c69 to
ab2cd80
Compare
16396d8 to
2125857
Compare
There were changes to HCI between the draft and final version of the Bluetooth 6.0 specification.
Initialize the CS state machine with the connection state machine.
Add lengths and opcodes of Channel Sounding LL CTRL PDUs.
Implement the LE CS Read Local Supported Capabilities command. Enable basic CS capabilities in local controller.
Implements: - LE CS Read Remote Supported Capabilities command, - LE CS Write Cached Remote Supported Capabilities command.
The HCI_LE_CS_Set_Default_Settings command is used by a Host to set default CS settings in the local Controller for the connection.
Implements: - LE CS Read Remote FAE Table command - LE CS Write Cached Remote FAE Table command
Implements: - LE CS Create Config command - LE CS Remove Config command
Implements LE CS Security Enable command.
The spec does not define a mechanism to inform which CS parameter the controller rejects during CS start parameters negotiation, so a few logs on the controller side will definitely be useful.
2125857 to
380017f
Compare
|
Contains UPF fixes now |
No description provided.