This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new efb9058a nimble/ll: Add option to control initial DLE update
efb9058a is described below
commit efb9058a4246f8eb273b707f439a2a9af81ab081
Author: Szymon Janc <[email protected]>
AuthorDate: Thu Feb 2 08:59:24 2023 +0100
nimble/ll: Add option to control initial DLE update
New option allows to select if controller should initiate DLE update
automatically for connection. By default it is enabled to not change
existing controller behavior.
---
nimble/controller/include/controller/ble_ll_conn.h | 2 ++
nimble/controller/src/ble_ll_ctrl.c | 5 +++++
nimble/controller/syscfg.yml | 12 ++++++++----
porting/npl/riot/include/syscfg/syscfg.h | 4 ++++
4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/nimble/controller/include/controller/ble_ll_conn.h
b/nimble/controller/include/controller/ble_ll_conn.h
index 016e5abd..1e704ad3 100644
--- a/nimble/controller/include/controller/ble_ll_conn.h
+++ b/nimble/controller/include/controller/ble_ll_conn.h
@@ -129,7 +129,9 @@ union ble_ll_conn_sm_flags {
uint32_t aux_conn_req: 1;
uint32_t rxd_features:1;
uint32_t pending_hci_rd_features:1;
+#if MYNEWT_VAL(BLE_LL_CONN_INIT_AUTO_DLE)
uint32_t pending_initiate_dle:1;
+#endif
uint32_t subrate_trans:1;
uint32_t subrate_ind_txd:1;
uint32_t subrate_host_req:1;
diff --git a/nimble/controller/src/ble_ll_ctrl.c
b/nimble/controller/src/ble_ll_ctrl.c
index 3a100523..7d828aeb 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -2137,7 +2137,10 @@ ble_ll_ctrl_update_features(struct ble_ll_conn_sm
*connsm, uint8_t *feat)
}
#endif
+#if MYNEWT_VAL(BLE_LL_CONN_INIT_AUTO_DLE)
connsm->csmflags.cfbit.pending_initiate_dle = 1;
+#endif
+
connsm->csmflags.cfbit.rxd_features = 1;
}
}
@@ -3050,10 +3053,12 @@ ll_ctrl_send_rsp:
#endif
}
+#if MYNEWT_VAL(BLE_LL_CONN_INIT_AUTO_DLE)
if (connsm->csmflags.cfbit.pending_initiate_dle) {
connsm->csmflags.cfbit.pending_initiate_dle = 0;
ble_ll_ctrl_initiate_dle(connsm, true);
}
+#endif
return rc;
}
diff --git a/nimble/controller/syscfg.yml b/nimble/controller/syscfg.yml
index 3c1dc18b..34039bb0 100644
--- a/nimble/controller/syscfg.yml
+++ b/nimble/controller/syscfg.yml
@@ -140,11 +140,15 @@ syscfg.defs:
BLE_LL_CONN_INIT_MAX_TX_BYTES:
description: >
Used to set the initial maximum transmit PDU size in a
- connection. If this is set to a value greater than 27,
- the controller will automatically attempt to do the
- data length update procedure. The host can always tell
- the controller to update this value.
+ connection. The host can always tell the controller to update this
+ value.
value: '27'
+ BLE_LL_CONN_INIT_AUTO_DLE:
+ description: >
+ If BLE_LL_CONN_INIT_MAX_TX_BYTES is set to value greater than 27
+ controller will automatically attempt to do the data length update
+ procedure.
+ value: 1
# The number of slots that will be allocated to each connection
BLE_LL_CONN_INIT_SLOTS:
diff --git a/porting/npl/riot/include/syscfg/syscfg.h
b/porting/npl/riot/include/syscfg/syscfg.h
index dbde6c99..75752c02 100644
--- a/porting/npl/riot/include/syscfg/syscfg.h
+++ b/porting/npl/riot/include/syscfg/syscfg.h
@@ -1046,6 +1046,10 @@
#define MYNEWT_VAL_BLE_LL_CONN_EVENT_END_MARGIN (0)
#endif
+#ifndef MYNEWT_VAL_BLE_LL_CONN_INIT_AUTO_DLE
+#define MYNEWT_VAL_BLE_LL_CONN_INIT_AUTO_DLE (1)
+#endif
+
/* Overridden by @apache-mynewt-nimble/porting/targets/riot (defined by
@apache-mynewt-nimble/nimble/controller) */
#ifndef MYNEWT_VAL_BLE_LL_CONN_INIT_MAX_TX_BYTES
#define MYNEWT_VAL_BLE_LL_CONN_INIT_MAX_TX_BYTES
(MYNEWT_VAL_BLE_LL_MAX_PKT_SIZE)