Bluetooth: Controller: Refactor HCI files
As part of the effort to consolidate the BLE Controller's HCI layer, the following files have been renamed: * hci.h -> hci_internal.h: contains the HCI API to be used by the driver * main.c -> hci_driver.c: Implement bt_driver and includes initialization and glue code Jira: ZEP-726 Change-Id: Ica8b3e114da42a766a1b14ce59558cacd899a1a7 Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
eeccdaca05
commit
496b02b54a
4 changed files with 22 additions and 24 deletions
|
@ -14,5 +14,5 @@ obj-$(CONFIG_BLUETOOTH_CONTROLLER) += hal/radio.o
|
|||
obj-$(CONFIG_BLUETOOTH_CONTROLLER) += ll/ticker.o
|
||||
obj-$(CONFIG_BLUETOOTH_CONTROLLER) += ll/ctrl.o
|
||||
obj-$(CONFIG_BLUETOOTH_CONTROLLER) += ll/ll.o
|
||||
obj-$(CONFIG_BLUETOOTH_CONTROLLER) += hci/hci_driver.o
|
||||
obj-$(CONFIG_BLUETOOTH_CONTROLLER) += hci/hci.o
|
||||
obj-$(CONFIG_BLUETOOTH_CONTROLLER) += main.o
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include <toolchain.h>
|
||||
#include <errno.h>
|
||||
#include <misc/byteorder.h>
|
||||
#include <bluetooth/hci.h>
|
||||
|
||||
#include "defines.h"
|
||||
#include "ticker.h"
|
||||
|
@ -33,9 +34,7 @@
|
|||
#include "pdu.h"
|
||||
#include "ctrl.h"
|
||||
#include "ll.h"
|
||||
|
||||
#include <bluetooth/hci.h>
|
||||
#include "hci.h"
|
||||
#include "hci_internal.h"
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
|
@ -959,7 +958,7 @@ static void hci_data_handle(void)
|
|||
hci_context.rx_len = 0;
|
||||
}
|
||||
|
||||
void hci_handle(uint8_t x, uint8_t *len, uint8_t **out)
|
||||
void hcic_handle(uint8_t x, uint8_t *len, uint8_t **out)
|
||||
{
|
||||
struct bt_hci_cmd_hdr *cmd;
|
||||
|
||||
|
@ -1378,7 +1377,7 @@ static void encode_data(uint8_t *buf, uint8_t *len, uint8_t **out)
|
|||
|
||||
}
|
||||
|
||||
void hci_encode(uint8_t *buf, uint8_t *len, uint8_t **out)
|
||||
void hcic_encode(uint8_t *buf, uint8_t *len, uint8_t **out)
|
||||
{
|
||||
struct radio_pdu_node_rx *radio_pdu_node_rx;
|
||||
struct pdu_data *pdu_data;
|
||||
|
@ -1408,8 +1407,8 @@ void hci_encode(uint8_t *buf, uint8_t *len, uint8_t **out)
|
|||
}
|
||||
}
|
||||
|
||||
void hci_encode_num_cmplt(uint16_t handle, uint8_t num, uint8_t *len,
|
||||
uint8_t **out)
|
||||
void hcic_encode_num_cmplt(uint16_t handle, uint8_t num, uint8_t *len,
|
||||
uint8_t **out)
|
||||
{
|
||||
struct bt_hci_evt_num_completed_packets *ep;
|
||||
struct bt_hci_handle_count *hc;
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include "hal/radio.h"
|
||||
#include "ll/ticker.h"
|
||||
#include "ll/ctrl_internal.h"
|
||||
#include "hci/hci.h"
|
||||
#include "hci_internal.h"
|
||||
|
||||
#include "hal/debug.h"
|
||||
|
||||
|
@ -224,7 +224,7 @@ static void native_recv_fiber(int unused0, int unused1)
|
|||
uint8_t *buf;
|
||||
int retval;
|
||||
|
||||
hci_encode_num_cmplt(handle, num_cmplt, &len, &buf);
|
||||
hcic_encode_num_cmplt(handle, num_cmplt, &len, &buf);
|
||||
BT_ASSERT(len);
|
||||
|
||||
retval = native_recv(len, buf);
|
||||
|
@ -238,7 +238,7 @@ static void native_recv_fiber(int unused0, int unused1)
|
|||
uint8_t *buf;
|
||||
int retval;
|
||||
|
||||
hci_encode((uint8_t *)radio_pdu_node_rx, &len, &buf);
|
||||
hcic_encode((uint8_t *)radio_pdu_node_rx, &len, &buf);
|
||||
|
||||
/* Not all radio_rx_get are translated to HCI!,
|
||||
* hence just dequeue.
|
||||
|
@ -267,7 +267,6 @@ static void native_recv_fiber(int unused0, int unused1)
|
|||
|
||||
static int native_send(struct net_buf *buf)
|
||||
{
|
||||
extern void hci_handle(uint8_t x, uint8_t *len, uint8_t **out);
|
||||
uint8_t type;
|
||||
uint8_t remaining;
|
||||
uint8_t *in;
|
||||
|
@ -279,10 +278,10 @@ static int native_send(struct net_buf *buf)
|
|||
type = bt_buf_get_type(buf);
|
||||
switch (type) {
|
||||
case BT_BUF_ACL_OUT:
|
||||
hci_handle(HCI_ACL, &remaining, &in);
|
||||
hcic_handle(HCI_ACL, &remaining, &in);
|
||||
break;
|
||||
case BT_BUF_CMD:
|
||||
hci_handle(HCI_CMD, &remaining, &in);
|
||||
hcic_handle(HCI_CMD, &remaining, &in);
|
||||
break;
|
||||
default:
|
||||
BT_ERR("Unknown HCI type %u", type);
|
||||
|
@ -296,7 +295,7 @@ static int native_send(struct net_buf *buf)
|
|||
|
||||
if (buf->len) {
|
||||
while (buf->len - 1) {
|
||||
hci_handle(net_buf_pull_u8(buf), &remaining, &in);
|
||||
hcic_handle(net_buf_pull_u8(buf), &remaining, &in);
|
||||
}
|
||||
|
||||
if (remaining) {
|
||||
|
@ -304,9 +303,9 @@ static int native_send(struct net_buf *buf)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
hci_handle(net_buf_pull_u8(buf), &remaining, &in);
|
||||
hcic_handle(net_buf_pull_u8(buf), &remaining, &in);
|
||||
|
||||
BT_DBG("hci_handle returned %u bytes", remaining);
|
||||
BT_DBG("hcic_handle returned %u bytes", remaining);
|
||||
|
||||
if (remaining) {
|
||||
int retval;
|
|
@ -15,12 +15,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _HCI_H_
|
||||
#define _HCI_H_
|
||||
#ifndef _HCI_CONTROLLER_H_
|
||||
#define _HCI_CONTROLLER_H_
|
||||
|
||||
void hci_handle(uint8_t x, uint8_t *len, uint8_t **out);
|
||||
void hci_encode(uint8_t *buf, uint8_t *len, uint8_t **out);
|
||||
void hci_encode_num_cmplt(uint16_t instance, uint8_t num, uint8_t *len,
|
||||
uint8_t **out);
|
||||
void hcic_handle(uint8_t x, uint8_t *len, uint8_t **out);
|
||||
void hcic_encode(uint8_t *buf, uint8_t *len, uint8_t **out);
|
||||
void hcic_encode_num_cmplt(uint16_t instance, uint8_t num, uint8_t *len,
|
||||
uint8_t **out);
|
||||
|
||||
#endif /* _HCI_H_ */
|
||||
#endif /* _HCI_CONTROLLER_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue