diff --git a/wireless/bluetooth/Kconfig b/wireless/bluetooth/Kconfig index c1cc6917916..bbbb098e86c 100644 --- a/wireless/bluetooth/Kconfig +++ b/wireless/bluetooth/Kconfig @@ -54,6 +54,20 @@ menuconfig WIRELESS_BLUETOOTH if WIRELESS_BLUETOOTH +config BLUETOOTH_FIRMWARE_DOWNLOAD + bool "Generic firmware download" + default n + ---help--- + Enables support for generic firmware download in the MAC layer. Do + not enable this option if no download is required OR if the download + if performed by the Bluetooth HCI layer. + + If this option is selected, then your board-specific code must + provide the firmware data via: + + const uint8_t bt_firmware_hcd[]; + const long int bt_firmware_len; + config BLUETOOTH_MAX_CONN int "Maximum number of simultaneous connections" default 1 diff --git a/wireless/bluetooth/bt_hcicore.c b/wireless/bluetooth/bt_hcicore.c index 698fd8e5df6..7421ae071ed 100644 --- a/wireless/bluetooth/bt_hcicore.c +++ b/wireless/bluetooth/bt_hcicore.c @@ -83,8 +83,6 @@ #define TIMEOUT_SEC 2 #define TIMEOUT_NSEC 500 * 1024 * 1024 -#define BT_FIRMWARE_UPLOAD /* REVISIT: Should be a Kconfig option? */ - /**************************************************************************** * Public Data ****************************************************************************/ @@ -97,11 +95,6 @@ struct bt_dev_s g_btdev; -#ifdef BT_FIRMWARE_UPLOAD -extern const uint8_t bt_firmware_hcd[]; -const long int bt_firmware_len; -#endiuf - /**************************************************************************** * Private Data ****************************************************************************/ @@ -1207,7 +1200,7 @@ static void le_read_buffer_size_complete(FAR struct bt_buf_s *buf) * ****************************************************************************/ -#ifdef BT_FIRMWARE_UPLOAD +#ifdef CONFIG_BLUETOOTH_FIRMWARE_DOWNLOAD static int bt_check_fw_upload(void) { uint8_t *rp = (uint8_t *)bt_firmware_hcd; diff --git a/wireless/bluetooth/bt_hcicore.h b/wireless/bluetooth/bt_hcicore.h index b4f8302db7c..95f28ab152a 100644 --- a/wireless/bluetooth/bt_hcicore.h +++ b/wireless/bluetooth/bt_hcicore.h @@ -166,6 +166,13 @@ typedef CODE void bt_le_scan_cb_t(FAR const bt_addr_le_t *addr, int8_t rssi, extern struct bt_dev_s g_btdev; +#ifdef CONFIG_BLUETOOTH_FIRMWARE_DOWNLOAD +/* Location and size of HCI firmware download */ + +extern const uint8_t bt_firmware_hcd[]; +extern const long int bt_firmware_len; +#endif + /**************************************************************************** * Inline Functions ****************************************************************************/