Commit e3e91d32 authored by Johan Hedberg's avatar Johan Hedberg
Browse files

Bluetooth: Add name member to HCI driver struct



This is more of a convenience to let the driver identify itself in
debug logs and the monitor protocol.

Change-Id: I73351477e98d45d6344c180b8088bde29df6f7d9
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 4488fc6c
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 = {
	.name		= "H:4",
	.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 = {
	.name		= "H:5",
	.bus		= BT_DRIVER_BUS_UART,
	.open		= h5_open,
	.send		= h5_queue,
+3 −0
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ enum bt_driver_bus {
};

struct bt_driver {
	/* Name of the driver */
	const char *name;

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

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

	bt_dev.drv = drv;

	BT_DBG("Registered %s", drv->name ? drv->name : "");

	bt_monitor_new_index(BT_MONITOR_TYPE_PRIMARY, drv->bus,
			     BT_ADDR_ANY, "bt0");
			     BT_ADDR_ANY, drv->name ? drv->name : "bt0");

	return 0;
}
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ static int driver_send(struct net_buf *buf)
}

static struct bt_driver drv = {
	.name         = "test",
	.bus          = BT_DRIVER_BUS_VIRTUAL,
	.open         = driver_open,
	.send         = driver_send,