Skip to content

Commit fc47320

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: controller: Consistent use of internal BT_CTLR_ADV_SET
Consistently use the internal BT_CTLR_ADV_SET value in the controller's implementation. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent ec0aa83 commit fc47320

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

subsys/bluetooth/controller/ll_sw/lll.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018-2019 Nordic Semiconductor ASA
2+
* Copyright (c) 2018-2021 Nordic Semiconductor ASA
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -30,6 +30,16 @@
3030
#define XON_BITMASK BIT(31) /* XTAL has been retained from previous prepare */
3131
#endif /* CONFIG_BT_CTLR_XTAL_ADVANCED */
3232

33+
#if defined(CONFIG_BT_BROADCASTER)
34+
#if defined(CONFIG_BT_CTLR_ADV_SET)
35+
#define BT_CTLR_ADV_SET CONFIG_BT_CTLR_ADV_SET
36+
#else /* CONFIG_BT_CTLR_ADV_SET */
37+
#define BT_CTLR_ADV_SET 1
38+
#endif /* CONFIG_BT_CTLR_ADV_SET */
39+
#else /* !CONFIG_BT_BROADCASTER */
40+
#define BT_CTLR_ADV_SET 0
41+
#endif /* !CONFIG_BT_BROADCASTER */
42+
3343
#if defined(CONFIG_BT_OBSERVER)
3444
#if defined(CONFIG_BT_CTLR_ADV_EXT)
3545
#if defined(CONFIG_BT_CTLR_PHY_CODED)
@@ -49,8 +59,7 @@ enum {
4959
TICKER_ID_ADV_STOP,
5060
TICKER_ID_ADV_BASE,
5161
#if defined(CONFIG_BT_CTLR_ADV_EXT) || defined(CONFIG_BT_HCI_MESH_EXT)
52-
TICKER_ID_ADV_LAST = ((TICKER_ID_ADV_BASE) +
53-
(CONFIG_BT_CTLR_ADV_SET) - 1),
62+
TICKER_ID_ADV_LAST = ((TICKER_ID_ADV_BASE) + (BT_CTLR_ADV_SET) - 1),
5463
#if defined(CONFIG_BT_CTLR_ADV_EXT)
5564
#if (CONFIG_BT_CTLR_ADV_AUX_SET > 0)
5665
TICKER_ID_ADV_AUX_BASE,

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
/*
2-
* Copyright (c) 2017-2019 Nordic Semiconductor ASA
2+
* Copyright (c) 2017-2021 Nordic Semiconductor ASA
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#if defined(CONFIG_BT_CTLR_ADV_SET)
8-
#define BT_CTLR_ADV_SET CONFIG_BT_CTLR_ADV_SET
9-
#else /* CONFIG_BT_CTLR_ADV_SET */
10-
#define BT_CTLR_ADV_SET 1
11-
#endif /* CONFIG_BT_CTLR_ADV_SET */
12-
137
/* Structure used to double buffer pointers of AD Data PDU buffer.
148
* The first and last members are used to make modification to AD data to be
159
* context safe. Thread always appends or updates the buffer pointed to

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2019 Nordic Semiconductor ASA
2+
* Copyright (c) 2017-2021 Nordic Semiconductor ASA
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/

subsys/bluetooth/controller/ll_sw/ull_adv_aux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ uint16_t ll_adv_aux_max_data_length_get(void)
323323

324324
uint8_t ll_adv_aux_set_count_get(void)
325325
{
326-
return CONFIG_BT_CTLR_ADV_SET;
326+
return BT_CTLR_ADV_SET;
327327
}
328328

329329
uint8_t ll_adv_aux_set_remove(uint8_t handle)

subsys/bluetooth/controller/ll_sw/ull_adv_iso.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "ull_adv_types.h"
3434
#include "ull_adv_internal.h"
3535

36-
static struct ll_adv_iso ll_adv_iso[CONFIG_BT_CTLR_ADV_SET];
36+
static struct ll_adv_iso ll_adv_iso[BT_CTLR_ADV_SET];
3737
static void *adv_iso_free;
3838

3939
static uint32_t ull_adv_iso_start(struct ll_adv_iso *adv_iso,
@@ -238,7 +238,7 @@ uint8_t ll_adv_iso_by_hci_handle_get(uint8_t hci_handle, uint8_t *handle)
238238

239239
adv_iso = &ll_adv_iso[0];
240240

241-
for (idx = 0U; idx < CONFIG_BT_CTLR_ADV_SET; idx++, adv_iso++) {
241+
for (idx = 0U; idx < BT_CTLR_ADV_SET; idx++, adv_iso++) {
242242
if (adv_iso->is_created &&
243243
(adv_iso->hci_handle == hci_handle)) {
244244
*handle = idx;
@@ -257,7 +257,7 @@ uint8_t ll_adv_iso_by_hci_handle_new(uint8_t hci_handle, uint8_t *handle)
257257
adv_iso = &ll_adv_iso[0];
258258
adv_iso_empty = NULL;
259259

260-
for (idx = 0U; idx < CONFIG_BT_CTLR_ADV_SET; idx++, adv_iso++) {
260+
for (idx = 0U; idx < BT_CTLR_ADV_SET; idx++, adv_iso++) {
261261
if (adv_iso->is_created) {
262262
if (adv_iso->hci_handle == hci_handle) {
263263
return BT_HCI_ERR_CMD_DISALLOWED;
@@ -330,7 +330,7 @@ static uint32_t ull_adv_iso_start(struct ll_adv_iso *adv_iso,
330330

331331
static inline struct ll_adv_iso *ull_adv_iso_get(uint8_t handle)
332332
{
333-
if (handle >= CONFIG_BT_CTLR_ADV_SET) {
333+
if (handle >= BT_CTLR_ADV_SET) {
334334
return NULL;
335335
}
336336

0 commit comments

Comments
 (0)