Skip to content

Commit 946304e

Browse files
erwangocarlescufi
authored andcommitted
drivers: bluetooth: stm32wb: Put HCI messages under CONFIG_BT_HCI_HOST
HCI message sending in this hci driver as these actions require hci_host to be available and could be performed by the remote host if required. Explicit this dependency using CONFIG_BT_HCI_HOST. This is is required to be able to compile BT_HCI_RAW mode. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent 41422f9 commit 946304e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

drivers/bluetooth/hci/ipm_stm32wb.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ struct aci_set_ble_addr {
6363
uint8_t value[6];
6464
} __packed;
6565

66+
#ifdef CONFIG_BT_HCI_HOST
6667
#define ACI_WRITE_SET_TX_POWER_LEVEL BT_OP(BT_OGF_VS, 0xFC0F)
6768
#define ACI_HAL_WRITE_CONFIG_DATA BT_OP(BT_OGF_VS, 0xFC0C)
6869
#define ACI_HAL_STACK_RESET BT_OP(BT_OGF_VS, 0xFC3B)
6970

7071
#define HCI_CONFIG_DATA_PUBADDR_OFFSET 0
71-
#define HCI_CONFIG_DATA_RANDOM_ADDRESS_OFFSET 0x2E
72-
7372
static bt_addr_t bd_addr_udn;
73+
#endif /* CONFIG_BT_HCI_HOST */
74+
75+
#define HCI_CONFIG_DATA_RANDOM_ADDRESS_OFFSET 0x2E
7476

7577
/* Rx thread definitions */
7678
K_FIFO_DEFINE(ipm_rx_events_fifo);
@@ -428,6 +430,7 @@ static void start_ble_rf(void)
428430
LL_RCC_SetCLK48ClockSource(LL_RCC_CLK48_CLKSOURCE_HSI48);
429431
}
430432

433+
#ifdef CONFIG_BT_HCI_HOST
431434
bt_addr_t *bt_get_ble_addr(void)
432435
{
433436
bt_addr_t *bd_addr;
@@ -523,6 +526,7 @@ static int bt_ipm_ble_init(void)
523526

524527
return 0;
525528
}
529+
#endif /* CONFIG_BT_HCI_HOST */
526530

527531
static int c2_reset(void)
528532
{
@@ -569,16 +573,19 @@ static int bt_ipm_open(void)
569573
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO),
570574
0, K_NO_WAIT);
571575

576+
#ifdef CONFIG_BT_HCI_HOST
572577
err = bt_ipm_ble_init();
573578
if (err) {
574579
return err;
575580
}
581+
#endif /* CONFIG_BT_HCI_HOST */
576582

577583
BT_DBG("IPM Channel Open Completed");
578584

579585
return 0;
580586
}
581587

588+
#ifdef CONFIG_BT_HCI_HOST
582589
static int bt_ipm_close(void)
583590
{
584591
int err;
@@ -603,12 +610,15 @@ static int bt_ipm_close(void)
603610

604611
return err;
605612
}
613+
#endif /* CONFIG_BT_HCI_HOST */
606614

607615
static const struct bt_hci_driver drv = {
608616
.name = "BT IPM",
609617
.bus = BT_HCI_DRIVER_BUS_IPM,
610618
.open = bt_ipm_open,
619+
#ifdef CONFIG_BT_HCI_HOST
611620
.close = bt_ipm_close,
621+
#endif
612622
.send = bt_ipm_send,
613623
};
614624

0 commit comments

Comments
 (0)