Skip to content

Commit

Permalink
Bluetooth: Controller: Kconfig: Allow limiting max tx octets below 27
Browse files Browse the repository at this point in the history
Define BT_CTLR_MIN_VAL_OF_MAX_ACL_TX_PAYLOAD_DEFAULT to allow
setting the maximum number of tx octets to a value lower than 27 bytes.

We only allow using this with devices supporting ISO as there is a risk
of not being interoperable with older devices.

Signed-off-by: Rubin Gerritsen <[email protected]>
  • Loading branch information
rugeGerritsen authored and rlubos committed Nov 23, 2023
1 parent 4ca4e9f commit 2cd0e2a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
20 changes: 20 additions & 0 deletions subsys/bluetooth/controller/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,26 @@ config BT_CTLR_SDC_CENTRAL_ACL_EVENT_SPACING_DEFAULT
timeline if the connection interval is longer than the ACL event spacing.
This gap can be used for other scheduling activites like isochronous streams.

config BT_CTLR_MIN_VAL_OF_MAX_ACL_TX_PAYLOAD_DEFAULT
int "Default minimum value that will be used as maximum Tx octets for ACL connections"
default 27
range 10 27
depends on BT_ISO && BT_CONN
help
This configuration sets the minimum value of maximum ACL payload length that can be sent
in each packet. If the configured event length is shorter than what is required to
send a packet pair of 27 bytes in each direction, the controller will use this value to
determine how much it can reduce the payload size to satisfy the event length requirements.
LL Control PDUs are not affected by this API.
Together with BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT this allows the controller to schedule
ACLs events closer together with other activities.
Setting this parameter to a lower value will result in more link layer fragmentation,
reducing the maximum throughput.
Setting this parameter to a value lower than 27 bytes may result in interoperability
issues with older Bluetooth products. It is therefore not recommended to use this API
for applications interacting with devices qualified for Bluetooth Specification 5.1 or
older.

config BT_CTLR_SDC_PERIODIC_ADV_EVENT_LEN_DEFAULT_OVERRIDE
bool "Override periodic adv event length default"

Expand Down
14 changes: 14 additions & 0 deletions subsys/bluetooth/controller/hci_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,20 @@ static int hci_driver_open(void)
}
}

#if defined(BT_CTLR_MIN_VAL_OF_MAX_ACL_TX_PAYLOAD_DEFAULT)
if (CONFIG_BT_CTLR_MIN_VAL_OF_MAX_ACL_TX_PAYLOAD_DEFAULT != 27) {
sdc_hci_cmd_vs_min_val_of_max_acl_tx_payload_set_t params = {
.min_val_of_max_acl_tx_payload =
CONFIG_config BT_CTLR_MIN_VAL_OF_MAX_ACL_TX_PAYLOAD_DEFAULT
};
err = sdc_hci_cmd_vs_min_val_of_max_acl_tx_payload_set(&params);
if (err) {
MULTITHREADING_LOCK_RELEASE();
return -ENOTSUP;
}
}
#endif

MULTITHREADING_LOCK_RELEASE();

return 0;
Expand Down

0 comments on commit 2cd0e2a

Please sign in to comment.