Commit 4488fc6c authored by Johan Hedberg's avatar Johan Hedberg
Browse files

Bluetooth: Move HCI device bus information to the driver



The bus that we notify over the monitor protocol is really driver
specific, so let each driver specify their bus type.

Change-Id: Ic3a086fcc06352dbf051e52cef5bf6b8696349ae
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 8c3add2b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -254,6 +254,7 @@ static int h4_open(void)
}

static struct bt_driver drv = {
	.bus		= BT_DRIVER_BUS_UART,
	.open		= h4_open,
	.send		= h4_send,
};
+1 −0
Original line number Diff line number Diff line
@@ -764,6 +764,7 @@ static int h5_open(void)
}

static struct bt_driver drv = {
	.bus		= BT_DRIVER_BUS_UART,
	.open		= h5_open,
	.send		= h5_queue,
};
+13 −0
Original line number Diff line number Diff line
@@ -52,7 +52,20 @@ struct net_buf *bt_buf_get_acl(void);
/* Receive data from the controller/HCI driver */
int bt_recv(struct net_buf *buf);

enum bt_driver_bus {
	BT_DRIVER_BUS_VIRTUAL       = 0,
	BT_DRIVER_BUS_USB           = 1,
	BT_DRIVER_BUS_PCCARD        = 2,
	BT_DRIVER_BUS_UART          = 3,
	BT_DRIVER_BUS_RS232         = 4,
	BT_DRIVER_BUS_PCI           = 5,
	BT_DRIVER_BUS_SDIO          = 6,
};

struct bt_driver {
	/* Bus of the transport (BT_DRIVER_BUS_*) */
	enum bt_driver_bus bus;

	/* Open the HCI transport */
	int (*open)(void);

+1 −1
Original line number Diff line number Diff line
@@ -3095,7 +3095,7 @@ int bt_driver_register(struct bt_driver *drv)

	bt_dev.drv = drv;

	bt_monitor_new_index(BT_MONITOR_TYPE_PRIMARY, BT_MONITOR_BUS_UART,
	bt_monitor_new_index(BT_MONITOR_TYPE_PRIMARY, drv->bus,
			     BT_ADDR_ANY, "bt0");

	return 0;
+0 −8
Original line number Diff line number Diff line
@@ -39,14 +39,6 @@
#define BT_MONITOR_TYPE_PRIMARY	0
#define BT_MONITOR_TYPE_AMP	1

#define BT_MONITOR_BUS_VIRTUAL	0
#define BT_MONITOR_BUS_USB	1
#define BT_MONITOR_BUS_PCCARD	2
#define BT_MONITOR_BUS_UART	3
#define BT_MONITOR_BUS_RS232	4
#define BT_MONITOR_BUS_PCI	5
#define BT_MONITOR_BUS_SDIO	6

struct bt_monitor_hdr {
	uint16_t opcode;
	uint16_t index;
Loading