Bluetooth: Rework the HCI header set

In order to have clean, self-contained HCI headers that do not have any
dependencies towards the Host or any other part of the system (except
types), reorganize the headers in the following way:

- Split out the macros and structs from hci.h to a new hci_types.h
- Merge the existing hci_err.h into the new hci_types.h

Fixes #58214.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2023-06-09 13:33:53 +02:00 committed by Anas Nashif
commit 22f73992b2
59 changed files with 3139 additions and 3124 deletions

View file

@ -179,6 +179,11 @@ Changes in this release
* Cache API functions are now fully inlined by compilers.
* The Bluetooth HCI headers have been reworked, with ``hci.h`` now containing
only the function prototypes and the new ``hci_types.h`` defining all
HCI-related macros and structs. The previous ``hci_err.h`` has been merged
into ``hci_types.h``.
Removed APIs in this release
============================

View file

@ -21,7 +21,7 @@
#include <stdint.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci_err.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/bluetooth/addr.h>
#include <zephyr/bluetooth/gap.h>
#include <zephyr/bluetooth/direction.h>

File diff suppressed because it is too large Load diff

View file

@ -1,90 +0,0 @@
/** @file
* @brief Bluetooth Host Control Interface status codes.
*/
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HCI_STATUS_H_
#define ZEPHYR_INCLUDE_BLUETOOTH_HCI_STATUS_H_
#ifdef __cplusplus
extern "C" {
#endif
/** HCI Error Codes, BT Core Spec v5.2 [Vol 1, Part F]. */
#define BT_HCI_ERR_SUCCESS 0x00
#define BT_HCI_ERR_UNKNOWN_CMD 0x01
#define BT_HCI_ERR_UNKNOWN_CONN_ID 0x02
#define BT_HCI_ERR_HW_FAILURE 0x03
#define BT_HCI_ERR_PAGE_TIMEOUT 0x04
#define BT_HCI_ERR_AUTH_FAIL 0x05
#define BT_HCI_ERR_PIN_OR_KEY_MISSING 0x06
#define BT_HCI_ERR_MEM_CAPACITY_EXCEEDED 0x07
#define BT_HCI_ERR_CONN_TIMEOUT 0x08
#define BT_HCI_ERR_CONN_LIMIT_EXCEEDED 0x09
#define BT_HCI_ERR_SYNC_CONN_LIMIT_EXCEEDED 0x0a
#define BT_HCI_ERR_CONN_ALREADY_EXISTS 0x0b
#define BT_HCI_ERR_CMD_DISALLOWED 0x0c
#define BT_HCI_ERR_INSUFFICIENT_RESOURCES 0x0d
#define BT_HCI_ERR_INSUFFICIENT_SECURITY 0x0e
#define BT_HCI_ERR_BD_ADDR_UNACCEPTABLE 0x0f
#define BT_HCI_ERR_CONN_ACCEPT_TIMEOUT 0x10
#define BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL 0x11
#define BT_HCI_ERR_INVALID_PARAM 0x12
#define BT_HCI_ERR_REMOTE_USER_TERM_CONN 0x13
#define BT_HCI_ERR_REMOTE_LOW_RESOURCES 0x14
#define BT_HCI_ERR_REMOTE_POWER_OFF 0x15
#define BT_HCI_ERR_LOCALHOST_TERM_CONN 0x16
#define BT_HCI_ERR_REPEATED_ATTEMPTS 0x17
#define BT_HCI_ERR_PAIRING_NOT_ALLOWED 0x18
#define BT_HCI_ERR_UNKNOWN_LMP_PDU 0x19
#define BT_HCI_ERR_UNSUPP_REMOTE_FEATURE 0x1a
#define BT_HCI_ERR_SCO_OFFSET_REJECTED 0x1b
#define BT_HCI_ERR_SCO_INTERVAL_REJECTED 0x1c
#define BT_HCI_ERR_SCO_AIR_MODE_REJECTED 0x1d
#define BT_HCI_ERR_INVALID_LL_PARAM 0x1e
#define BT_HCI_ERR_UNSPECIFIED 0x1f
#define BT_HCI_ERR_UNSUPP_LL_PARAM_VAL 0x20
#define BT_HCI_ERR_ROLE_CHANGE_NOT_ALLOWED 0x21
#define BT_HCI_ERR_LL_RESP_TIMEOUT 0x22
#define BT_HCI_ERR_LL_PROC_COLLISION 0x23
#define BT_HCI_ERR_LMP_PDU_NOT_ALLOWED 0x24
#define BT_HCI_ERR_ENC_MODE_NOT_ACCEPTABLE 0x25
#define BT_HCI_ERR_LINK_KEY_CANNOT_BE_CHANGED 0x26
#define BT_HCI_ERR_REQUESTED_QOS_NOT_SUPPORTED 0x27
#define BT_HCI_ERR_INSTANT_PASSED 0x28
#define BT_HCI_ERR_PAIRING_NOT_SUPPORTED 0x29
#define BT_HCI_ERR_DIFF_TRANS_COLLISION 0x2a
#define BT_HCI_ERR_QOS_UNACCEPTABLE_PARAM 0x2c
#define BT_HCI_ERR_QOS_REJECTED 0x2d
#define BT_HCI_ERR_CHAN_ASSESS_NOT_SUPPORTED 0x2e
#define BT_HCI_ERR_INSUFF_SECURITY 0x2f
#define BT_HCI_ERR_PARAM_OUT_OF_MANDATORY_RANGE 0x30
#define BT_HCI_ERR_ROLE_SWITCH_PENDING 0x32
#define BT_HCI_ERR_RESERVED_SLOT_VIOLATION 0x34
#define BT_HCI_ERR_ROLE_SWITCH_FAILED 0x35
#define BT_HCI_ERR_EXT_INQ_RESP_TOO_LARGE 0x36
#define BT_HCI_ERR_SIMPLE_PAIR_NOT_SUPP_BY_HOST 0x37
#define BT_HCI_ERR_HOST_BUSY_PAIRING 0x38
#define BT_HCI_ERR_CONN_REJECTED_DUE_TO_NO_CHAN 0x39
#define BT_HCI_ERR_CONTROLLER_BUSY 0x3a
#define BT_HCI_ERR_UNACCEPT_CONN_PARAM 0x3b
#define BT_HCI_ERR_ADV_TIMEOUT 0x3c
#define BT_HCI_ERR_TERM_DUE_TO_MIC_FAIL 0x3d
#define BT_HCI_ERR_CONN_FAIL_TO_ESTAB 0x3e
#define BT_HCI_ERR_MAC_CONN_FAILED 0x3f
#define BT_HCI_ERR_CLOCK_ADJUST_REJECTED 0x40
#define BT_HCI_ERR_SUBMAP_NOT_DEFINED 0x41
#define BT_HCI_ERR_UNKNOWN_ADV_IDENTIFIER 0x42
#define BT_HCI_ERR_LIMIT_REACHED 0x43
#define BT_HCI_ERR_OP_CANCELLED_BY_HOST 0x44
#define BT_HCI_ERR_PACKET_TOO_LONG 0x45
#ifdef __cplusplus
}
#endif
#endif /* ZEPHYR_INCLUDE_BLUETOOTH_HCI_STATUS_H_ */

File diff suppressed because it is too large Load diff

View file

@ -13,7 +13,7 @@
#include <zephyr/logging/log.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "controller/hal/ticker.h"
#include "controller/ticker/ticker.h"

View file

@ -11,7 +11,7 @@
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/ticker.h"
#include "ticker/ticker.h"

View file

@ -17,7 +17,7 @@
#include <zephyr/drivers/bluetooth/hci_driver.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/bluetooth/hci_vs.h>
#include <zephyr/bluetooth/buf.h>
#include <zephyr/bluetooth/bluetooth.h>

View file

@ -21,7 +21,7 @@
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/drivers/bluetooth/hci_driver.h>
#ifdef CONFIG_CLOCK_CONTROL_NRF

View file

@ -5,6 +5,11 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <stdbool.h>
#include <zephyr/kernel.h>
int ll_init(struct k_sem *sem_rx);
int ll_deinit(void);
void ll_reset(void);

View file

@ -14,7 +14,7 @@
#include <zephyr/kernel.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "util/memq.h"

View file

@ -9,7 +9,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/bluetooth/controller.h>
#include "hal/ccm.h"

View file

@ -26,7 +26,7 @@
#include "ll_feat.h"
#include "ll_settings.h"
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/debug.h"

View file

@ -7,7 +7,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/bluetooth/hci_vs.h>
#include "hal/cpu.h"

View file

@ -8,7 +8,7 @@
#include <stdbool.h>
#include <stddef.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <soc.h>

View file

@ -8,7 +8,7 @@
#include <stddef.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <soc.h>
#include "hal/cpu.h"

View file

@ -39,7 +39,7 @@
#include "lll_tim_internal.h"
#include "lll_prof_internal.h"
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/debug.h"

View file

@ -6,7 +6,7 @@
#include <stdint.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "util/util.h"
#include "util/memq.h"

View file

@ -11,7 +11,7 @@
#include <soc.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/cpu.h"
#include "hal/ccm.h"

View file

@ -9,7 +9,7 @@
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/util.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/ccm.h"
#include "hal/radio.h"

View file

@ -40,7 +40,7 @@
#include "ll_feat.h"
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <soc.h>
#include "hal/debug.h"

View file

@ -41,7 +41,7 @@
#include "ull_df_internal.h"
#endif /* CONFIG_BT_CTLR_DTM_HCI_DF_IQ_REPORT */
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/debug.h"

View file

@ -7,7 +7,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "isoal.h"
#include "ull_iso_types.h"

View file

@ -8,7 +8,7 @@
#include <string.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/dlist.h>
#include <zephyr/sys/byteorder.h>

View file

@ -9,7 +9,7 @@
#include <zephyr/toolchain.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include "hal/cpu.h"

View file

@ -7,7 +7,7 @@
#include <zephyr/types.h>
#include <zephyr/toolchain.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include "hal/ccm.h"

View file

@ -12,7 +12,7 @@
#include <soc.h>
#include <zephyr/device.h>
#include <zephyr/drivers/entropy.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/cpu.h"
#include "hal/ccm.h"

View file

@ -9,7 +9,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include "hal/cpu.h"

View file

@ -6,7 +6,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include "hal/cpu.h"

View file

@ -8,7 +8,7 @@
#include <zephyr/kernel.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/cpu.h"
#include "hal/ccm.h"

View file

@ -6,7 +6,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include "hal/cpu.h"

View file

@ -6,7 +6,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include "util/util.h"

View file

@ -49,7 +49,7 @@
#include "ll.h"
#include "ll_feat.h"
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/debug.h"

View file

@ -8,7 +8,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include "hal/cpu.h"

View file

@ -7,7 +7,7 @@
#include <zephyr/kernel.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "util/util.h"
#include "util/mem.h"

View file

@ -8,7 +8,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/sys/util.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/cpu.h"
#include "hal/ccm.h"

View file

@ -8,7 +8,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include "hal/cpu.h"

View file

@ -7,7 +7,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/cpu.h"
#include "hal/ccm.h"

View file

@ -6,7 +6,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/slist.h>
#include <zephyr/sys/util.h>

View file

@ -6,7 +6,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/slist.h>
#include <zephyr/sys/util.h>

View file

@ -6,7 +6,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/slist.h>
#include <zephyr/sys/util.h>

View file

@ -6,7 +6,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/slist.h>
#include <zephyr/sys/util.h>

View file

@ -6,7 +6,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/slist.h>
#include <zephyr/sys/util.h>

View file

@ -6,7 +6,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/slist.h>
#include <zephyr/sys/util.h>

View file

@ -6,7 +6,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/slist.h>
#include <zephyr/sys/util.h>

View file

@ -6,7 +6,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/slist.h>
#include <zephyr/sys/util.h>

View file

@ -6,7 +6,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/slist.h>
#include <zephyr/sys/util.h>

View file

@ -6,7 +6,7 @@
#include <zephyr/types.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/slist.h>
#include <zephyr/sys/util.h>

View file

@ -6,7 +6,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/sys/byteorder.h>
#include "util/util.h"

View file

@ -46,7 +46,7 @@
#include "ull_conn_iso_internal.h"
#include "ull_llcp_internal.h"
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/debug.h"

View file

@ -7,7 +7,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/cpu.h"
#include "hal/ccm.h"

View file

@ -40,7 +40,7 @@
#include "ull_sync_iso_internal.h"
#include "ull_df_internal.h"
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include <soc.h>
#include "hal/debug.h"

View file

@ -5,7 +5,7 @@
*/
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "hal/ccm.h"
#include "hal/radio.h"

View file

@ -7,7 +7,7 @@
#include <zephyr/kernel.h>
#include <soc.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "util/util.h"
#include "util/mem.h"

View file

@ -7,7 +7,7 @@
#include <zephyr/kernel.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_types.h>
#include "util/util.h"
#include "util/mem.h"

View file

@ -14,7 +14,7 @@
#include <zephyr/bluetooth/audio/bap.h>
#include <zephyr/bluetooth/audio/pacs.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/hci_err.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/sys/util_macro.h>

View file

@ -9,7 +9,8 @@
#include <zephyr/types.h>
#include <zephyr/ztest.h>
#include "hci_err.h"
#include <zephyr/bluetooth/hci_types.h>
#include "util/mem.h"
#include "util/memq.h"
#include "pdu_df.h"

View file

@ -11,7 +11,7 @@
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/bluetooth/hci_err.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/logging/log.h>

View file

@ -11,7 +11,7 @@
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/gatt.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/bluetooth/hci_err.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/logging/log.h>