2016-08-15 18:22:59 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Nordic Semiconductor ASA
|
|
|
|
* Copyright (c) 2016 Vinayak Kariappa Chettimada
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-08-15 18:22:59 +08:00
|
|
|
*/
|
|
|
|
|
2016-09-15 16:07:56 +08:00
|
|
|
#ifndef _HCI_CONTROLLER_H_
|
|
|
|
#define _HCI_CONTROLLER_H_
|
2016-08-15 18:22:59 +08:00
|
|
|
|
2017-08-09 14:21:11 +08:00
|
|
|
#if defined(CONFIG_BT_HCI_ACL_FLOW_CONTROL)
|
2017-04-07 15:53:02 +08:00
|
|
|
extern s32_t hci_hbuf_total;
|
|
|
|
extern u32_t hci_hbuf_sent;
|
|
|
|
extern u32_t hci_hbuf_acked;
|
|
|
|
extern atomic_t hci_state_mask;
|
|
|
|
|
|
|
|
#define HCI_STATE_BIT_RESET 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define HCI_CLASS_EVT_REQUIRED 0
|
|
|
|
#define HCI_CLASS_EVT_DISCARDABLE 1
|
|
|
|
#define HCI_CLASS_EVT_CONNECTION 2
|
|
|
|
#define HCI_CLASS_ACL_DATA 3
|
|
|
|
|
2017-09-01 22:20:46 +08:00
|
|
|
#if defined(CONFIG_SOC_FAMILY_NRF5)
|
|
|
|
#define BT_HCI_VS_HW_PLAT BT_HCI_VS_HW_PLAT_NORDIC
|
|
|
|
#if defined(CONFIG_SOC_SERIES_NRF51X)
|
|
|
|
#define BT_HCI_VS_HW_VAR BT_HCI_VS_HW_VAR_NORDIC_NRF51X;
|
|
|
|
#elif defined(CONFIG_SOC_SERIES_NRF52X)
|
|
|
|
#define BT_HCI_VS_HW_VAR BT_HCI_VS_HW_VAR_NORDIC_NRF52X;
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#define BT_HCI_VS_HW_PLAT 0
|
|
|
|
#define BT_HCI_VS_HW_VAR 0
|
|
|
|
#endif /* CONFIG_SOC_FAMILY_NRF5 */
|
|
|
|
|
2017-04-07 15:53:02 +08:00
|
|
|
void hci_init(struct k_poll_signal *signal_host_buf);
|
2017-02-01 23:32:29 +08:00
|
|
|
struct net_buf *hci_cmd_handle(struct net_buf *cmd);
|
2016-09-22 22:46:21 +08:00
|
|
|
void hci_evt_encode(struct radio_pdu_node_rx *node_rx, struct net_buf *buf);
|
2017-04-07 15:53:02 +08:00
|
|
|
s8_t hci_get_class(struct radio_pdu_node_rx *node_rx);
|
2017-08-09 14:21:11 +08:00
|
|
|
#if defined(CONFIG_BT_CONN)
|
2017-09-12 23:14:30 +08:00
|
|
|
int hci_acl_handle(struct net_buf *acl, struct net_buf **evt);
|
2016-09-22 22:46:21 +08:00
|
|
|
void hci_acl_encode(struct radio_pdu_node_rx *node_rx, struct net_buf *buf);
|
2017-04-21 01:00:29 +08:00
|
|
|
void hci_num_cmplt_encode(struct net_buf *buf, u16_t handle, u8_t num);
|
2017-04-07 15:53:02 +08:00
|
|
|
#endif
|
2016-09-15 16:07:56 +08:00
|
|
|
#endif /* _HCI_CONTROLLER_H_ */
|