Skip to content

Commit

Permalink
Bluetooth: Controller: Enable Connection Subrating support in the SDC
Browse files Browse the repository at this point in the history
This enables experimental support for Connection Subrating.

Signed-off-by: Timothy Keys <[email protected]>
  • Loading branch information
weeTike committed May 24, 2024
1 parent de6a369 commit accbebf
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions subsys/bluetooth/controller/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ config BT_LL_SOFTDEVICE
select BT_HAS_HCI_VS
select BT_CTLR_DF_SUPPORT if HAS_HW_NRF_RADIO_DFE
select BT_CTLR_LE_POWER_CONTROL_SUPPORT
select BT_CTLR_SUBRATING_SUPPORT
depends on (SOC_SERIES_BSIM_NRFXX || SOC_SERIES_NRF52X || SOC_COMPATIBLE_NRF5340_CPUNET ||\
SOC_NRF54H20_CPURAD || SOC_SERIES_NRF54LX)
help
Expand Down Expand Up @@ -555,5 +556,9 @@ config BT_CTLR_SDC_CIS_SUBEVENT_LENGTH_US
If this parameter is set to zero, the subevent length
is chosen by the controller.

config BT_CTLR_SUBRATING
bool "Subrate Connection commands [EXPERIMENTAL]"
select EXPERIMENTAL

endmenu
endif # BT_LL_SOFTDEVICE
15 changes: 15 additions & 0 deletions subsys/bluetooth/controller/hci_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,21 @@ static int configure_supported_features(void)
}
#endif

if (IS_ENABLED(CONFIG_BT_CTLR_SUBRATING)) {
if (IS_ENABLED(CONFIG_BT_CENTRAL)) {
err = sdc_support_connection_subrating_central();
if (err) {
return -ENOTSUP;
}
}
if (IS_ENABLED(CONFIG_BT_PERIPHERAL)) {
err = sdc_support_connection_subrating_peripheral();
if (err) {
return -ENOTSUP;
}
}
}

return 0;
}

Expand Down
20 changes: 20 additions & 0 deletions subsys/bluetooth/controller/hci_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,13 @@ void hci_internal_supported_commands(sdc_hci_ip_supported_commands_t *cmds)
#if defined(CONFIG_BT_CTLR_ISO_RX_BUFFERS)
cmds->hci_le_iso_receive_test = 1;
#endif

#if defined(CONFIG_BT_CTLR_SUBRATING)
#if defined(CONFIG_BT_CENTRAL)
cmds->hci_le_set_default_subrate_command = 1;
#endif
cmds->hci_le_subrate_request_command = 1;
#endif /* CONFIG_BT_CTLR_SUBRATING */
}

#if defined(CONFIG_BT_HCI_VS)
Expand Down Expand Up @@ -781,6 +788,10 @@ void hci_internal_le_supported_features(
#if defined(CONFIG_BT_CTLR_SDC_PAWR_SYNC)
features->params.periodic_advertising_with_responses_scanner = 1;
#endif

#if defined(CONFIG_BT_CTLR_SUBRATING)
features->params.connection_subrating = 1;
#endif
}

static void le_read_supported_states(uint8_t *buf)
Expand Down Expand Up @@ -1528,6 +1539,15 @@ static uint8_t le_controller_cmd_put(uint8_t const * const cmd,
(void *)event_out_params);
#endif

#if defined(CONFIG_BT_CTLR_SUBRATING)
#if defined(CONFIG_BT_CENTRAL)
case SDC_HCI_OPCODE_CMD_LE_SET_DEFAULT_SUBRATE:
return sdc_hci_cmd_le_set_default_subrate((void *)cmd_params);
#endif
case SDC_HCI_OPCODE_CMD_LE_SUBRATE_REQUEST:
return sdc_hci_cmd_le_subrate_request((void *)cmd_params);
#endif /* CONFIG_BT_CTLR_SUBRATING */

default:
return BT_HCI_ERR_UNKNOWN_CMD;
}
Expand Down

0 comments on commit accbebf

Please sign in to comment.