Bluetooth: controller: Support SMI TX flag as setting

SMI TX is different than other controller features in that it does not
necessarily imply any software changes; whether SMI TX is supported
may be simply a matter of hardware calibration. This change supports
using the same software on chips that do or do not support SMI TX
depending on calibration.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
This commit is contained in:
Wolfgang Puffitsch 2020-01-27 12:52:04 +01:00 committed by Alberto Escolar
commit 2071c2fb7a
8 changed files with 41 additions and 0 deletions

View file

@ -510,6 +510,12 @@ config BT_CTLR_SMI_TX
help
Enable support for Bluetooth 5.0 SMI TX in the Controller.
config BT_CTLR_SMI_TX_SETTING
bool "Stable modulation index - Transmitter as setting"
depends on BT_CTLR_SMI_TX && BT_CTLR_SETTINGS
help
Enable support for Bluetooth 5.0 SMI TX through a system setting.
if BT_LL_SW_SPLIT || BT_LL_SW_LEGACY
config BT_CTLR_ADVANCED_FEATURES

View file

@ -91,7 +91,12 @@
#endif /* !CONFIG_BT_CTLR_SMI_RX */
#if defined(CONFIG_BT_CTLR_SMI_TX)
#if defined(CONFIG_BT_CTLR_SMI_TX_SETTING)
#define LL_FEAT_BIT_SMI_TX (ll_settings_smi_tx() ? \
BIT64(BT_LE_FEAT_BIT_SMI_TX) : 0)
#else /* !CONFIG_BT_CTLR_SMI_TX_SETTING */
#define LL_FEAT_BIT_SMI_TX BIT64(BT_LE_FEAT_BIT_SMI_TX)
#endif /* !CONFIG_BT_CTLR_SMI_TX_SETTING */
#else /* !CONFIG_BT_CTLR_SMI_TX */
#define LL_FEAT_BIT_SMI_TX 0
#endif /* !CONFIG_BT_CTLR_SMI_TX */

View file

@ -21,3 +21,5 @@ static inline u16_t ll_settings_subversion_number(void)
}
#endif /* CONFIG_BT_CTLR_VERSION_SETTINGS */
bool ll_settings_smi_tx(void);

View file

@ -39,6 +39,7 @@
#include "ll.h"
#include "ll_feat.h"
#include "ll_filter.h"
#include "ll_settings.h"
/* Global singletons */

View file

@ -32,6 +32,17 @@ u16_t ll_settings_subversion_number(void)
#endif /* CONFIG_BT_CTLR_VERSION_SETTINGS */
#if defined(CONFIG_BT_CTLR_SMI_TX_SETTING)
static u8_t smi_tx;
bool ll_settings_smi_tx(void)
{
return smi_tx;
}
#endif /* CONFIG_BT_CTLR_SMI_TX_SETTING */
static int ctlr_set(const char *name, size_t len_rd,
settings_read_cb read_cb, void *store)
{
@ -63,6 +74,19 @@ static int ctlr_set(const char *name, size_t len_rd,
}
#endif /* CONFIG_BT_CTLR_VERSION_SETTINGS */
#if defined(CONFIG_BT_CTLR_SMI_TX_SETTING)
if (!strncmp(name, "smi_tx", nlen)) {
len = read_cb(store, &smi_tx, sizeof(smi_tx));
if (len < 0) {
BT_ERR("Failed to read SMI TX flag from storage"
" (err %d)", len);
} else {
BT_DBG("SMI TX flag set to %04x", smi_tx);
}
return 0;
}
#endif /* CONFIG_BT_CTLR_SMI_TX_SETTING */
return 0;
}

View file

@ -32,6 +32,7 @@
#include "pdu.h"
#include "ll.h"
#include "ll_feat.h"
#include "ll_settings.h"
#include "lll.h"
#include "lll_adv.h"
#include "lll_scan.h"

View file

@ -24,6 +24,7 @@
#include "pdu.h"
#include "ll.h"
#include "ll_feat.h"
#include "ll_settings.h"
#include "lll.h"
#include "lll_vendor.h"
#include "lll_clock.h"

View file

@ -21,6 +21,7 @@
#include "pdu.h"
#include "ll.h"
#include "ll_feat.h"
#include "ll_settings.h"
#include "lll.h"
#include "lll_vendor.h"