Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 16/18] gatttool: Add unix socket connect
From: Claudio Takahasi @ 2014-01-21 13:26 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: claudio.takahasi
In-Reply-To: <1390310814-19880-1-git-send-email-claudio.takahasi@openbossa.org>

This patch adds the initial support for GATT procedures over unix
socket transport on command line mode (one-shot command). Temporary
solution to allow local GATT procedures testing.
---
 attrib/gatttool.c | 27 ++++++++++++++++++++-------
 attrib/gatttool.h |  1 +
 attrib/utils.c    | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 75 insertions(+), 7 deletions(-)

diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index ebc8123..d701f7b 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -29,7 +29,6 @@
 #include <errno.h>
 #include <glib.h>
 #include <stdlib.h>
-#include <unistd.h>
 
 #include <bluetooth/bluetooth.h>
 #include <bluetooth/hci.h>
@@ -53,6 +52,7 @@ static int opt_end = 0xffff;
 static int opt_handle = -1;
 static int opt_mtu = 0;
 static int opt_psm = 0;
+static gboolean opt_local = FALSE;
 static gboolean opt_primary = FALSE;
 static gboolean opt_characteristics = FALSE;
 static gboolean opt_char_read = FALSE;
@@ -511,6 +511,8 @@ static GOptionEntry options[] = {
 		"Specify local adapter interface", "hciX" },
 	{ "device", 'b', 0, G_OPTION_ARG_STRING, &opt_dst,
 		"Specify remote Bluetooth address", "MAC" },
+	{ "local", 'L', 0, G_OPTION_ARG_NONE, &opt_local,
+		"Use unix socket transport (local communication)", NULL },
 	{ "addr-type", 't', 0, G_OPTION_ARG_STRING, &opt_dst_type,
 		"Set LE address type. Default: public", "[public | random]"},
 	{ "mtu", 'm', 0, G_OPTION_ARG_INT, &opt_mtu,
@@ -563,6 +565,11 @@ int main(int argc, char *argv[])
 		g_clear_error(&gerr);
 	}
 
+	if (opt_local) {
+		opt_src = NULL;
+		opt_dst = NULL;
+	}
+
 	if (opt_interactive) {
 		interactive(opt_src, opt_dst, opt_dst_type, opt_psm);
 		goto done;
@@ -588,14 +595,20 @@ int main(int argc, char *argv[])
 		goto done;
 	}
 
-	if (opt_dst == NULL) {
-		g_print("Remote Bluetooth address required\n");
-		got_error = TRUE;
-		goto done;
+	if (opt_local)
+		chan = unix_connect(connect_cb, &gerr);
+	else {
+		if (opt_dst == NULL) {
+			g_print("Remote Bluetooth address required\n");
+			got_error = TRUE;
+			goto done;
+		}
+
+		chan = gatt_connect(opt_src, opt_dst, opt_dst_type,
+					opt_sec_level, opt_psm, opt_mtu,
+					connect_cb, &gerr);
 	}
 
-	chan = gatt_connect(opt_src, opt_dst, opt_dst_type, opt_sec_level,
-					opt_psm, opt_mtu, connect_cb, &gerr);
 	if (chan == NULL) {
 		g_printerr("%s\n", gerr->message);
 		g_clear_error(&gerr);
diff --git a/attrib/gatttool.h b/attrib/gatttool.h
index 8f0913c..be8e236 100644
--- a/attrib/gatttool.h
+++ b/attrib/gatttool.h
@@ -27,4 +27,5 @@ GIOChannel *gatt_connect(const char *src, const char *dst,
 			const char *dst_type, const char *sec_level,
 			int psm, int mtu, BtIOConnect connect_cb,
 			GError **gerr);
+GIOChannel *unix_connect(BtIOConnect connect_cb, GError **gerr);
 size_t gatt_attr_data_from_string(const char *str, uint8_t **data);
diff --git a/attrib/utils.c b/attrib/utils.c
index 77bab27..de7b00a 100644
--- a/attrib/utils.c
+++ b/attrib/utils.c
@@ -25,7 +25,12 @@
 #include "config.h"
 #endif
 
+#include <errno.h>
 #include <stdlib.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
 #include <glib.h>
 
 #include <bluetooth/bluetooth.h>
@@ -101,6 +106,55 @@ GIOChannel *gatt_connect(const char *src, const char *dst,
 	return chan;
 }
 
+static gboolean unix_connect_cb(GIOChannel *io, GIOCondition cond,
+							gpointer user_data)
+{
+	BtIOConnect connect_cb = user_data;
+	GError *gerr;
+
+	if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) {
+		gerr = g_error_new_literal(G_IO_CHANNEL_ERROR,
+						G_IO_CHANNEL_ERROR_FAILED,
+						"connection attempt failed");
+		connect_cb(io, gerr, user_data);
+		g_clear_error(&gerr);
+	} else {
+		connect_cb(io, NULL, user_data);
+	}
+
+	return FALSE;
+}
+
+GIOChannel *unix_connect(BtIOConnect connect_cb, GError **gerr)
+{
+	GIOChannel *io;
+	struct sockaddr_un uaddr  = {
+		.sun_family	= AF_UNIX,
+		.sun_path	= "\0/bluetooth/unix_att",
+	};
+	int sk;
+
+	sk = socket(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC , 0);
+	if (sk < 0) {
+		g_set_error_literal(gerr, G_IO_CHANNEL_ERROR,
+				G_IO_CHANNEL_ERROR_FAILED, strerror(errno));
+		return NULL;
+	}
+
+	if (connect(sk, (struct sockaddr *) &uaddr, sizeof(uaddr)) < 0) {
+		g_set_error_literal(gerr, G_IO_CHANNEL_ERROR,
+				G_IO_CHANNEL_ERROR_FAILED, strerror(errno));
+		close(sk);
+		return NULL;
+	}
+
+	io = g_io_channel_unix_new(sk);
+	g_io_add_watch(io, G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
+						unix_connect_cb, connect_cb);
+
+	return io;
+}
+
 size_t gatt_attr_data_from_string(const char *str, uint8_t **data)
 {
 	char tmp[3];
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH BlueZ v2 17/18] gatttool: Add unix socket support for interactive mode
From: Claudio Takahasi @ 2014-01-21 13:26 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: claudio.takahasi
In-Reply-To: <1390310814-19880-1-git-send-email-claudio.takahasi@openbossa.org>

This patch allows running GATT operations over unix socket on
interactive mode.
---
 attrib/interactive.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/attrib/interactive.c b/attrib/interactive.c
index 9826a4b..febebaa 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -84,7 +84,7 @@ static char *get_prompt(void)
 	if (opt_dst)
 		g_string_append_printf(prompt, "[%17s]", opt_dst);
 	else
-		g_string_append_printf(prompt, "[%17s]", "");
+		g_string_append_printf(prompt, "[LOCAL]");
 
 	if (conn_state == STATE_CONNECTED)
 		g_string_append(prompt, COLOR_OFF);
@@ -405,15 +405,18 @@ static void cmd_connect(int argcp, char **argvp)
 			opt_dst_type = g_strdup("public");
 	}
 
-	if (opt_dst == NULL) {
-		error("Remote Bluetooth address required\n");
-		return;
+	if (opt_dst) {
+
+		rl_printf("Attempting to connect to %s\n", opt_dst);
+		set_state(STATE_CONNECTING);
+		iochannel = gatt_connect(opt_src, opt_dst, opt_dst_type,
+					opt_sec_level, opt_psm, opt_mtu,
+					connect_cb, &gerr);
+	} else {
+		rl_printf("Local connection\n");
+		iochannel = unix_connect(connect_cb, &gerr);
 	}
 
-	rl_printf("Attempting to connect to %s\n", opt_dst);
-	set_state(STATE_CONNECTING);
-	iochannel = gatt_connect(opt_src, opt_dst, opt_dst_type, opt_sec_level,
-					opt_psm, opt_mtu, connect_cb, &gerr);
 	if (iochannel == NULL) {
 		set_state(STATE_DISCONNECTED);
 		error("%s\n", gerr->message);
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH BlueZ v2 18/18] bluetooth.conf: Add ObjectManager interface
From: Claudio Takahasi @ 2014-01-21 13:26 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: claudio.takahasi
In-Reply-To: <1390310814-19880-1-git-send-email-claudio.takahasi@openbossa.org>

---
 src/bluetooth.conf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 0495200..ad8891a 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -18,6 +18,7 @@
     <allow send_interface="org.bluez.Profile1"/>
     <allow send_interface="org.bluez.HeartRateWatcher1"/>
     <allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
+    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
   </policy>
 
   <policy at_console="true">
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH BlueZ 1/2] android/A2DP: Add retry logic to Audio IPC
From: Luiz Augusto von Dentz @ 2014-01-21 14:00 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

In case the audio HAL disconnects without cleaning up its endpoints treat
it as unclean disconnection and attempt to reconnect.
---
 android/a2dp.c      | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 android/audio-ipc.c | 13 +++++++---
 android/audio-ipc.h |  2 +-
 android/ipc.c       |  9 +++----
 android/ipc.h       |  3 ++-
 5 files changed, 83 insertions(+), 12 deletions(-)

diff --git a/android/a2dp.c b/android/a2dp.c
index 5569691..a996f79 100644
--- a/android/a2dp.c
+++ b/android/a2dp.c
@@ -51,6 +51,7 @@
 #define L2CAP_PSM_AVDTP 0x19
 #define SVC_HINT_CAPTURING 0x08
 #define IDLE_TIMEOUT 1
+#define AUDIO_RETRY_TIMEOUT 2
 
 static GIOChannel *server = NULL;
 static GSList *devices = NULL;
@@ -58,6 +59,8 @@ static GSList *endpoints = NULL;
 static GSList *setups = NULL;
 static bdaddr_t adapter_addr;
 static uint32_t record_id = 0;
+static guint audio_retry_id = 0;
+static bool audio_retrying = false;
 
 struct a2dp_preset {
 	void *data;
@@ -1232,6 +1235,8 @@ static void bt_audio_open(const void *buf, uint16_t len)
 
 	DBG("");
 
+	audio_retrying = false;
+
 	if (cmd->presets == 0) {
 		error("No audio presets found");
 		goto failed;
@@ -1424,6 +1429,65 @@ static const struct ipc_handler audio_handlers[] = {
 	{ bt_stream_suspend, false, sizeof(struct audio_cmd_suspend_stream) },
 };
 
+static void bt_audio_unregister(void)
+{
+	DBG("");
+
+	if (audio_retry_id > 0)
+		g_source_remove(audio_retry_id);
+
+	g_slist_free_full(setups, setup_free);
+	setups = NULL;
+
+	g_slist_free_full(endpoints, unregister_endpoint);
+	endpoints = NULL;
+
+	audio_ipc_cleanup();
+}
+
+static void bt_audio_register(GDestroyNotify destroy)
+{
+	DBG("");
+
+	audio_ipc_init(destroy);
+
+	audio_ipc_register(audio_handlers, G_N_ELEMENTS(audio_handlers));
+}
+
+static gboolean audio_retry_register(void *data)
+{
+	GDestroyNotify destroy = data;
+
+	audio_retry_id = 0;
+	audio_retrying = true;
+
+	bt_audio_register(destroy);
+
+	return FALSE;
+}
+
+static void audio_disconnected(void *data)
+{
+	bool restart;
+
+	DBG("");
+
+	if (audio_retrying)
+		goto retry;
+
+	restart = endpoints != NULL ? true : false;
+
+	bt_audio_unregister();
+
+	if (!restart)
+		return;
+
+retry:
+	audio_retry_id = g_timeout_add_seconds(AUDIO_RETRY_TIMEOUT,
+						audio_retry_register,
+						audio_disconnected);
+}
+
 bool bt_a2dp_register(const bdaddr_t *addr)
 {
 	GError *err = NULL;
@@ -1431,8 +1495,6 @@ bool bt_a2dp_register(const bdaddr_t *addr)
 
 	DBG("");
 
-	audio_ipc_init();
-
 	bacpy(&adapter_addr, addr);
 
 	server = bt_io_listen(connect_cb, NULL, NULL, NULL, &err,
@@ -1462,7 +1524,7 @@ bool bt_a2dp_register(const bdaddr_t *addr)
 	ipc_register(HAL_SERVICE_ID_A2DP, cmd_handlers,
 						G_N_ELEMENTS(cmd_handlers));
 
-	audio_ipc_register(audio_handlers, G_N_ELEMENTS(audio_handlers));
+	bt_audio_register(audio_disconnected);
 
 	return true;
 
diff --git a/android/audio-ipc.c b/android/audio-ipc.c
index f4b55e3..ee444cf 100644
--- a/android/audio-ipc.c
+++ b/android/audio-ipc.c
@@ -46,6 +46,7 @@ static struct service_handler service;
 static gboolean audio_watch_cb(GIOChannel *io, GIOCondition cond,
 							gpointer user_data)
 {
+	GDestroyNotify destroy = user_data;
 	char buf[BLUEZ_AUDIO_MTU];
 	ssize_t ret;
 	int fd, err;
@@ -74,33 +75,39 @@ static gboolean audio_watch_cb(GIOChannel *io, GIOCondition cond,
 
 fail:
 	audio_ipc_cleanup();
+	if (destroy)
+		destroy(NULL);
 	return FALSE;
 }
 
 static gboolean audio_connect_cb(GIOChannel *io, GIOCondition cond,
 							gpointer user_data)
 {
+	GDestroyNotify destroy = user_data;
+
 	DBG("");
 
 	if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) {
 		error("Audio IPC: socket connect failed");
 		audio_ipc_cleanup();
+		if (destroy)
+			destroy(NULL);
 		return FALSE;
 	}
 
 	cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL;
 
-	g_io_add_watch(audio_io, cond, audio_watch_cb, NULL);
+	g_io_add_watch(audio_io, cond, audio_watch_cb, user_data);
 
 	info("Audio IPC: successfully connected");
 
 	return FALSE;
 }
 
-void audio_ipc_init(void)
+void audio_ipc_init(GDestroyNotify destroy)
 {
 	audio_io = ipc_connect(BLUEZ_AUDIO_SK_PATH, sizeof(BLUEZ_AUDIO_SK_PATH),
-							audio_connect_cb);
+						audio_connect_cb, destroy);
 }
 
 void audio_ipc_cleanup(void)
diff --git a/android/audio-ipc.h b/android/audio-ipc.h
index 0b5f216..ddff01e 100644
--- a/android/audio-ipc.h
+++ b/android/audio-ipc.h
@@ -21,7 +21,7 @@
  *
  */
 
-void audio_ipc_init(void);
+void audio_ipc_init(GDestroyNotify destroy);
 void audio_ipc_cleanup(void);
 
 void audio_ipc_register(const struct ipc_handler *handlers, uint8_t size);
diff --git a/android/ipc.c b/android/ipc.c
index ed3ef3c..8098409 100644
--- a/android/ipc.c
+++ b/android/ipc.c
@@ -141,7 +141,8 @@ static gboolean notif_watch_cb(GIOChannel *io, GIOCondition cond,
 	return FALSE;
 }
 
-GIOChannel *ipc_connect(const char *path, size_t size, GIOFunc connect_cb)
+GIOChannel *ipc_connect(const char *path, size_t size, GIOFunc connect_cb,
+							void *user_data)
 {
 	struct sockaddr_un addr;
 	GIOCondition cond;
@@ -174,7 +175,7 @@ GIOChannel *ipc_connect(const char *path, size_t size, GIOFunc connect_cb)
 
 	cond = G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL;
 
-	g_io_add_watch(io, cond, connect_cb, NULL);
+	g_io_add_watch(io, cond, connect_cb, user_data);
 
 	return io;
 }
@@ -215,7 +216,7 @@ static gboolean cmd_connect_cb(GIOChannel *io, GIOCondition cond,
 	}
 
 	notif_io = ipc_connect(BLUEZ_HAL_SK_PATH, sizeof(BLUEZ_HAL_SK_PATH),
-							notif_connect_cb);
+						notif_connect_cb, NULL);
 	if (!notif_io)
 		raise(SIGTERM);
 
@@ -225,7 +226,7 @@ static gboolean cmd_connect_cb(GIOChannel *io, GIOCondition cond,
 void ipc_init(void)
 {
 	cmd_io = ipc_connect(BLUEZ_HAL_SK_PATH, sizeof(BLUEZ_HAL_SK_PATH),
-							cmd_connect_cb);
+						cmd_connect_cb, NULL);
 	if (!cmd_io)
 		raise(SIGTERM);
 }
diff --git a/android/ipc.h b/android/ipc.h
index b1cc5c5..0ba9c67 100644
--- a/android/ipc.h
+++ b/android/ipc.h
@@ -34,7 +34,8 @@ struct service_handler {
 
 void ipc_init(void);
 void ipc_cleanup(void);
-GIOChannel *ipc_connect(const char *path, size_t size, GIOFunc connect_cb);
+GIOChannel *ipc_connect(const char *path, size_t size, GIOFunc connect_cb,
+							void *user_data);
 int ipc_handle_msg(struct service_handler *handlers, size_t max_index,
 						const void *buf, ssize_t len);
 
-- 
1.8.4.2


^ permalink raw reply related

* [PATCH BlueZ 2/2] android/ipc: Leave the connect callback to handle errors
From: Luiz Augusto von Dentz @ 2014-01-21 14:00 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1390312859-27349-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

It is not necessary to check connect errors since there is a watch
created for that.
---
 android/ipc.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/android/ipc.c b/android/ipc.c
index 8098409..4f2428c 100644
--- a/android/ipc.c
+++ b/android/ipc.c
@@ -166,12 +166,7 @@ GIOChannel *ipc_connect(const char *path, size_t size, GIOFunc connect_cb,
 
 	memcpy(addr.sun_path, path, size);
 
-	if (connect(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
-		error("IPC: failed to connect HAL socket %s: %d (%s)", &path[1],
-							errno, strerror(errno));
-		g_io_channel_unref(io);
-		return NULL;
-	}
+	connect(sk, (struct sockaddr *) &addr, sizeof(addr));
 
 	cond = G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL;
 
-- 
1.8.4.2


^ permalink raw reply related

* [PATCH 0/5] Remote device cache support
From: Szymon Janc @ 2014-01-21 15:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

Changes since RFC:
 - set cache limit to 300
 - update timestamp of cached device
 - rebased to master
 - other minor fixes

Szymon Janc (5):
  android/bluetooth: Split devices list to devices and bonded_devices
  android/bluetooth: Use defines for settings and devices files paths
  android/bluetooth: Always store device info
  android/bluetooth: Add support for caching remote device info
  android/bluetooth: Add support for loading caches devices from storage

 android/bluetooth.c | 202 ++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 149 insertions(+), 53 deletions(-)

-- 
1.8.3.2


^ permalink raw reply

* [PATCH 1/5] android/bluetooth: Split devices list to devices and bonded_devices
From: Szymon Janc @ 2014-01-21 15:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1390316497-18451-1-git-send-email-szymon.janc@tieto.com>

From: Szymon Janc <szymon.janc@gmail.com>

Bonded devices are permament until unbondedn. Non-bonded devices will
be held in (size limited) cache based on timestamp property so split
list to ease separation.
---
 android/bluetooth.c | 47 +++++++++++++++++++++++++++++++++++------------
 1 file changed, 35 insertions(+), 12 deletions(-)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index 4849dab..8f08122 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -132,6 +132,8 @@ static const uint16_t uuid_list[] = {
 
 static uint16_t option_index = MGMT_INDEX_NONE;
 static struct mgmt *mgmt_if = NULL;
+
+static GSList *bonded_devices = NULL;
 static GSList *devices = NULL;
 
 /* This list contains addresses which are asked for records */
@@ -283,6 +285,10 @@ static struct device *find_device(const bdaddr_t *bdaddr)
 {
 	GSList *l;
 
+	l = g_slist_find_custom(bonded_devices, bdaddr, device_match);
+	if (l)
+		return l->data;
+
 	l = g_slist_find_custom(devices, bdaddr, device_match);
 	if (l)
 		return l->data;
@@ -559,12 +565,30 @@ static void set_device_bond_state(const bdaddr_t *addr, uint8_t status,
 	if (!dev)
 		return;
 
-	if (dev->bond_state != state) {
-		dev->bond_state = state;
-		send_bond_state_change(&dev->bdaddr, status, state);
+	if (dev->bond_state == state)
+		return;
 
-		store_device_info(dev);
+	switch (state) {
+	case HAL_BOND_STATE_NONE:
+		if (dev->bond_state == HAL_BOND_STATE_BONDED) {
+			bonded_devices = g_slist_remove(bonded_devices, dev);
+			devices = g_slist_prepend(devices, dev);
+		}
+		break;
+	case HAL_BOND_STATE_BONDED:
+		devices = g_slist_remove(devices, dev);
+		bonded_devices = g_slist_prepend(bonded_devices, dev);
+		break;
+	case HAL_BOND_STATE_BONDING:
+	default:
+		break;
 	}
+
+	dev->bond_state = state;
+
+	store_device_info(dev);
+
+	send_bond_state_change(&dev->bdaddr, status, state);
 }
 
 static  void send_device_property(const bdaddr_t *bdaddr, uint8_t type,
@@ -2128,18 +2152,15 @@ static uint8_t get_adapter_scan_mode(void)
 
 static uint8_t get_adapter_bonded_devices(void)
 {
-	uint8_t buf[sizeof(bdaddr_t) * g_slist_length(devices)];
+	uint8_t buf[sizeof(bdaddr_t) * g_slist_length(bonded_devices)];
 	int i = 0;
 	GSList *l;
 
 	DBG("");
 
-	for (l = devices; l; l = g_slist_next(l)) {
+	for (l = bonded_devices; l; l = g_slist_next(l)) {
 		struct device *dev = l->data;
 
-		if (dev->bond_state != HAL_BOND_STATE_BONDED)
-			continue;
-
 		bdaddr2android(&dev->bdaddr, buf + (i * sizeof(bdaddr_t)));
 		i++;
 	}
@@ -2691,11 +2712,10 @@ static void send_bonded_devices_props(void)
 {
 	GSList *l;
 
-	for (l = devices; l; l = g_slist_next(l)) {
+	for (l = bonded_devices; l; l = g_slist_next(l)) {
 		struct device *dev = l->data;
 
-		if (dev->bond_state == HAL_BOND_STATE_BONDED)
-			get_remote_device_props(dev);
+		get_remote_device_props(dev);
 	}
 }
 
@@ -3093,6 +3113,9 @@ void bt_bluetooth_unregister(void)
 {
 	DBG("");
 
+	g_slist_free_full(bonded_devices, (GDestroyNotify) free_device);
+	bonded_devices = NULL;
+
 	g_slist_free_full(devices, (GDestroyNotify) free_device);
 	devices = NULL;
 
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 2/5] android/bluetooth: Use defines for settings and devices files paths
From: Szymon Janc @ 2014-01-21 15:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1390316497-18451-1-git-send-email-szymon.janc@tieto.com>

From: Szymon Janc <szymon.janc@gmail.com>

---
 android/bluetooth.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index 8f08122..3314267 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -54,6 +54,9 @@
 
 #define DUT_MODE_FILE "/sys/kernel/debug/bluetooth/hci%u/dut_mode"
 
+#define SETTINGS_FILE ANDROID_STORAGEDIR"/settings"
+#define DEVICES_FILE ANDROID_STORAGEDIR"/devices"
+
 #define DEVICE_ID_SOURCE	0x0002	/* USB */
 #define DEVICE_ID_VENDOR	0x1d6b	/* Linux Foundation */
 #define DEVICE_ID_PRODUCT	0x0247	/* BlueZ for Android */
@@ -148,8 +151,7 @@ static void store_adapter_config(void)
 
 	key_file = g_key_file_new();
 
-	g_key_file_load_from_file(key_file, ANDROID_STORAGEDIR"/settings", 0,
-									NULL);
+	g_key_file_load_from_file(key_file, SETTINGS_FILE, 0, NULL);
 
 	ba2str(&adapter.bdaddr, addr);
 
@@ -160,7 +162,7 @@ static void store_adapter_config(void)
 
 	data = g_key_file_to_data(key_file, &length, NULL);
 
-	g_file_set_contents(ANDROID_STORAGEDIR"/settings", data, length, NULL);
+	g_file_set_contents(SETTINGS_FILE, data, length, NULL);
 
 	g_free(data);
 	g_key_file_free(key_file);
@@ -173,8 +175,7 @@ static void load_adapter_config(void)
 	char *str;
 
 	key_file = g_key_file_new();
-	g_key_file_load_from_file(key_file, ANDROID_STORAGEDIR"/settings", 0,
-									NULL);
+	g_key_file_load_from_file(key_file, SETTINGS_FILE, 0, NULL);
 
 	str = g_key_file_get_string(key_file, "General", "Address", NULL);
 	if (!str) {
@@ -216,8 +217,7 @@ static void store_device_info(struct device *dev)
 	ba2str(&dev->bdaddr, addr);
 
 	key_file = g_key_file_new();
-	g_key_file_load_from_file(key_file, ANDROID_STORAGEDIR"/devices", 0,
-									NULL);
+	g_key_file_load_from_file(key_file, DEVICES_FILE, 0, NULL);
 
 	if (dev->bond_state == HAL_BOND_STATE_NONE) {
 		g_key_file_remove_group(key_file, addr, NULL);
@@ -266,7 +266,7 @@ static void store_device_info(struct device *dev)
 
 done:
 	str = g_key_file_to_data(key_file, &length, NULL);
-	g_file_set_contents(ANDROID_STORAGEDIR"/devices", str, length, NULL);
+	g_file_set_contents(DEVICES_FILE, str, length, NULL);
 	g_free(str);
 
 	g_key_file_free(key_file);
@@ -521,8 +521,7 @@ static void store_link_key(const bdaddr_t *dst, const uint8_t *key,
 
 	key_file = g_key_file_new();
 
-	if (!g_key_file_load_from_file(key_file, ANDROID_STORAGEDIR"/devices",
-								0, NULL))
+	if (!g_key_file_load_from_file(key_file, DEVICES_FILE, 0, NULL))
 		return;
 
 	ba2str(dst, addr);
@@ -537,7 +536,7 @@ static void store_link_key(const bdaddr_t *dst, const uint8_t *key,
 	g_key_file_set_integer(key_file, addr, "LinkKeyPinLength", pin_length);
 
 	data = g_key_file_to_data(key_file, &length, NULL);
-	g_file_set_contents(ANDROID_STORAGEDIR"/devices", data, length, NULL);
+	g_file_set_contents(DEVICES_FILE, data, length, NULL);
 	g_free(data);
 
 	g_key_file_free(key_file);
@@ -1726,8 +1725,7 @@ static void load_devices_info(bt_bluetooth_ready cb)
 
 	key_file = g_key_file_new();
 
-	g_key_file_load_from_file(key_file, ANDROID_STORAGEDIR"/devices", 0,
-									NULL);
+	g_key_file_load_from_file(key_file, DEVICES_FILE, 0, NULL);
 
 	devs = g_key_file_get_groups(key_file, &len);
 
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 3/5] android/bluetooth: Always store device info
From: Szymon Janc @ 2014-01-21 15:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1390316497-18451-1-git-send-email-szymon.janc@tieto.com>

This allows to cache remote device informations.
---
 android/bluetooth.c | 42 +++++++++++++++++++++++++++++-------------
 1 file changed, 29 insertions(+), 13 deletions(-)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index 3314267..f32dd91 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -207,23 +207,11 @@ static void store_device_info(struct device *dev)
 	char **uuids = NULL;
 	char *str;
 
-	/* We only store bonded devices and need to modify the storage
-	 * if the state is either NONE or BONDED.
-	 */
-	if (dev->bond_state != HAL_BOND_STATE_BONDED &&
-					dev->bond_state != HAL_BOND_STATE_NONE)
-		return;
-
 	ba2str(&dev->bdaddr, addr);
 
 	key_file = g_key_file_new();
 	g_key_file_load_from_file(key_file, DEVICES_FILE, 0, NULL);
 
-	if (dev->bond_state == HAL_BOND_STATE_NONE) {
-		g_key_file_remove_group(key_file, addr, NULL);
-		goto done;
-	}
-
 	g_key_file_set_integer(key_file, addr, "Type", dev->bdaddr_type);
 
 	g_key_file_set_string(key_file, addr, "Name", dev->name);
@@ -264,7 +252,6 @@ static void store_device_info(struct device *dev)
 		g_key_file_remove_key(key_file, addr, "Services", NULL);
 	}
 
-done:
 	str = g_key_file_to_data(key_file, &length, NULL);
 	g_file_set_contents(DEVICES_FILE, str, length, NULL);
 	g_free(str);
@@ -542,6 +529,33 @@ static void store_link_key(const bdaddr_t *dst, const uint8_t *key,
 	g_key_file_free(key_file);
 }
 
+static void remove_stored_link_key(const bdaddr_t *dst)
+{
+	GKeyFile *key_file;
+	gsize length = 0;
+	char addr[18];
+	char *data;
+
+	key_file = g_key_file_new();
+
+	if (!g_key_file_load_from_file(key_file, DEVICES_FILE, 0, NULL))
+		return;
+
+	ba2str(dst, addr);
+
+	DBG("%s", addr);
+
+	g_key_file_remove_key(key_file, addr, "LinkKey", NULL);
+	g_key_file_remove_key(key_file, addr, "LinkKeyType", NULL);
+	g_key_file_remove_key(key_file, addr, "LinkKeyPinLength", NULL);
+
+	data = g_key_file_to_data(key_file, &length, NULL);
+	g_file_set_contents(DEVICES_FILE, data, length, NULL);
+	g_free(data);
+
+	g_key_file_free(key_file);
+}
+
 static void send_bond_state_change(const bdaddr_t *addr, uint8_t status,
 								uint8_t state)
 {
@@ -2443,6 +2457,8 @@ static void unpair_device_complete(uint8_t status, uint16_t length,
 	if (status != MGMT_STATUS_SUCCESS)
 		return;
 
+	remove_stored_link_key(&rp->addr.bdaddr);
+
 	set_device_bond_state(&rp->addr.bdaddr, HAL_STATUS_SUCCESS,
 							HAL_BOND_STATE_NONE);
 }
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 4/5] android/bluetooth: Add support for caching remote device info
From: Szymon Janc @ 2014-01-21 15:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1390316497-18451-1-git-send-email-szymon.janc@tieto.com>

Cache is limited to DEVICES_CACHE_MAX. Devices are sorted with
timestamp so if cache is full olderst device is removed.
---
 android/bluetooth.c | 72 +++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 56 insertions(+), 16 deletions(-)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index f32dd91..6afde35 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -70,6 +70,8 @@
 /* Default discoverable timeout 120sec as in Android */
 #define DEFAULT_DISCOVERABLE_TIMEOUT 120
 
+#define DEVICES_CACHE_MAX 300
+
 #define BASELEN_PROP_CHANGED (sizeof(struct hal_ev_adapter_props_changed) \
 					+ (sizeof(struct hal_property)))
 
@@ -260,6 +262,27 @@ static void store_device_info(struct device *dev)
 	g_strfreev(uuids);
 }
 
+static void remove_device_info(struct device *dev)
+{
+	GKeyFile *key_file;
+	gsize length = 0;
+	char addr[18];
+	char *str;
+
+	ba2str(&dev->bdaddr, addr);
+
+	key_file = g_key_file_new();
+	g_key_file_load_from_file(key_file, DEVICES_FILE, 0, NULL);
+
+	g_key_file_remove_group(key_file, addr, NULL);
+
+	str = g_key_file_to_data(key_file, &length, NULL);
+	g_file_set_contents(DEVICES_FILE, str, length, NULL);
+	g_free(str);
+
+	g_key_file_free(key_file);
+}
+
 static int device_match(gconstpointer a, gconstpointer b)
 {
 	const struct device *dev = a;
@@ -283,6 +306,35 @@ static struct device *find_device(const bdaddr_t *bdaddr)
 	return NULL;
 }
 
+static void free_device(struct device *dev)
+{
+	g_free(dev->name);
+	g_free(dev->friendly_name);
+	g_slist_free_full(dev->uuids, g_free);
+	g_free(dev);
+}
+
+static void cache_device(struct device *new_dev)
+{
+	struct device *dev;
+	GSList *l;
+
+	if (g_slist_length(devices) < DEVICES_CACHE_MAX)
+		goto done;
+
+	l = g_slist_last(devices);
+	dev = l->data;
+
+	devices = g_slist_remove(bonded_devices, dev);
+	remove_device_info(dev);
+	free_device(dev);
+
+done:
+	new_dev->timestamp = time(NULL);
+	devices = g_slist_prepend(devices, new_dev);
+	store_device_info(new_dev);
+}
+
 static struct device *create_device(const bdaddr_t *bdaddr, uint8_t type)
 {
 	struct device *dev;
@@ -301,19 +353,10 @@ static struct device *create_device(const bdaddr_t *bdaddr, uint8_t type)
 	/* use address for name, will be change if one is present
 	 * eg. in EIR or set by set_property. */
 	dev->name = g_strdup(addr);
-	devices = g_slist_prepend(devices, dev);
 
 	return dev;
 }
 
-static void free_device(struct device *dev)
-{
-	g_free(dev->name);
-	g_free(dev->friendly_name);
-	g_slist_free_full(dev->uuids, g_free);
-	g_free(dev);
-}
-
 static struct device *get_device(const bdaddr_t *bdaddr, uint8_t type)
 {
 	struct device *dev;
@@ -585,7 +628,8 @@ static void set_device_bond_state(const bdaddr_t *addr, uint8_t status,
 	case HAL_BOND_STATE_NONE:
 		if (dev->bond_state == HAL_BOND_STATE_BONDED) {
 			bonded_devices = g_slist_remove(bonded_devices, dev);
-			devices = g_slist_prepend(devices, dev);
+			remove_stored_link_key(&dev->bdaddr);
+			cache_device(dev);
 		}
 		break;
 	case HAL_BOND_STATE_BONDED:
@@ -599,8 +643,6 @@ static void set_device_bond_state(const bdaddr_t *addr, uint8_t status,
 
 	dev->bond_state = state;
 
-	store_device_info(dev);
-
 	send_bond_state_change(&dev->bdaddr, status, state);
 }
 
@@ -1071,8 +1113,6 @@ static void update_found_device(const bdaddr_t *bdaddr, uint8_t bdaddr_type,
 
 		ev->status = HAL_STATUS_SUCCESS;
 		bdaddr2android(bdaddr, ev->bdaddr);
-
-		dev->timestamp = time(NULL);
 	}
 
 	if (eir.class) {
@@ -1100,6 +1140,8 @@ static void update_found_device(const bdaddr_t *bdaddr, uint8_t bdaddr_type,
 		(*num_prop)++;
 	}
 
+	cache_device(dev);
+
 	if (*num_prop)
 		ipc_send_notif(HAL_SERVICE_ID_BLUETOOTH, opcode, size, buf);
 
@@ -2457,8 +2499,6 @@ static void unpair_device_complete(uint8_t status, uint16_t length,
 	if (status != MGMT_STATUS_SUCCESS)
 		return;
 
-	remove_stored_link_key(&rp->addr.bdaddr);
-
 	set_device_bond_state(&rp->addr.bdaddr, HAL_STATUS_SUCCESS,
 							HAL_BOND_STATE_NONE);
 }
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH 5/5] android/bluetooth: Add support for loading caches devices from storage
From: Szymon Janc @ 2014-01-21 15:01 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1390316497-18451-1-git-send-email-szymon.janc@tieto.com>

Info is now stored for all devices and bond state depends on linkkey
being stored. Based on that devices loaded from storage are put either
to cache or to bonded_devices list.
---
 android/bluetooth.c | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index 6afde35..80490f1 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -1688,7 +1688,8 @@ static void clear_uuids(void)
 					sizeof(cp), &cp, NULL, NULL, NULL);
 }
 
-static void create_device_from_info(GKeyFile *key_file, const char *peer)
+static struct device *create_device_from_info(GKeyFile *key_file,
+							const char *peer)
 {
 	struct device *dev;
 	uint8_t type;
@@ -1703,7 +1704,7 @@ static void create_device_from_info(GKeyFile *key_file, const char *peer)
 	str2ba(peer, &bdaddr);
 	dev = create_device(&bdaddr, type);
 
-	dev->bond_state = HAL_BOND_STATE_BONDED;
+	dev->bond_state = HAL_BOND_STATE_NONE;
 
 	str = g_key_file_get_string(key_file, peer, "Name", NULL);
 	if (str) {
@@ -1739,6 +1740,8 @@ static void create_device_from_info(GKeyFile *key_file, const char *peer)
 
 		g_strfreev(uuids);
 	}
+
+	return dev;
 }
 
 static struct mgmt_link_key_info *get_key_info(GKeyFile *key_file, const char *peer)
@@ -1771,6 +1774,14 @@ failed:
 	return info;
 }
 
+static int device_timestamp_cmp(gconstpointer  a, gconstpointer  b)
+{
+	const struct device *deva = a;
+	const struct device *devb = b;
+
+	return deva->timestamp < devb->timestamp;
+}
+
 static void load_devices_info(bt_bluetooth_ready cb)
 {
 	GKeyFile *key_file;
@@ -1787,16 +1798,24 @@ static void load_devices_info(bt_bluetooth_ready cb)
 
 	for (i = 0; i < len; i++) {
 		struct mgmt_link_key_info *key_info;
+		struct device *dev;
 
-		create_device_from_info(key_file, devs[i]);
+		dev = create_device_from_info(key_file, devs[i]);
 
 		key_info = get_key_info(key_file, devs[i]);
-		if (key_info)
+		if (key_info) {
 			keys = g_slist_prepend(keys, key_info);
+			bonded_devices = g_slist_prepend(bonded_devices, dev);
+			dev->bond_state = HAL_BOND_STATE_BONDED;
+		} else {
+			devices = g_slist_prepend(devices, dev);
+		}
 
 		/* TODO ltk */
 	}
 
+	devices = g_slist_sort(devices, device_timestamp_cmp);
+
 	load_link_keys(keys, cb);
 	g_strfreev(devs);
 	g_slist_free_full(keys, g_free);
-- 
1.8.3.2


^ permalink raw reply related

* Re: [PATCH_v2 1/2] android/hidhost: Fix miscalculation of get report event notification length
From: Szymon Janc @ 2014-01-21 15:20 UTC (permalink / raw)
  To: Ravi kumar Veeramally; +Cc: linux-bluetooth
In-Reply-To: <1390307059-7772-1-git-send-email-ravikumar.veeramally@linux.intel.com>

Hi Ravi,

On Tuesday 21 of January 2014 14:24:18 Ravi kumar Veeramally wrote:
> Event length is size of struct + data len (if any). It is miscalulated.
> ---
>  android/hidhost.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/android/hidhost.c b/android/hidhost.c
> index 3da77c8..108493a 100644
> --- a/android/hidhost.c
> +++ b/android/hidhost.c
> @@ -371,7 +371,7 @@ static void bt_hid_notify_get_report(struct hid_device *dev, uint8_t *buf,
>  	ba2str(&dev->dst, address);
>  	DBG("device %s", address);
>  
> -	ev_len = sizeof(*ev) + sizeof(struct hal_ev_hidhost_get_report) + 1;
> +	ev_len = sizeof(*ev);
>  
>  	if (!((buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_INPUT)) ||
>  			(buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_OUTPUT)) ||
> 

Both patches applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH BlueZ 1/2] android/A2DP: Add retry logic to Audio IPC
From: Szymon Janc @ 2014-01-21 15:24 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1390312859-27349-1-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Tuesday 21 of January 2014 16:00:58 Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> In case the audio HAL disconnects without cleaning up its endpoints treat
> it as unclean disconnection and attempt to reconnect.
> ---
>  android/a2dp.c      | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++---
>  android/audio-ipc.c | 13 +++++++---
>  android/audio-ipc.h |  2 +-
>  android/ipc.c       |  9 +++----
>  android/ipc.h       |  3 ++-
>  5 files changed, 83 insertions(+), 12 deletions(-)

Both patches applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH 0/1] HIDP: Add a special case for the Dualshock 4
From: Frank Praznik @ 2014-01-21 16:01 UTC (permalink / raw)
  To: David Herrmann, Simon Wood; +Cc: Frank Praznik, linux-bluetooth@vger.kernel.org
In-Reply-To: <CANq1E4Ruo6C9gFbv=ZdtmVmvYC61UFW1AR+C_LVUEA3xj9iO9A@mail.gmail.com>

On 1/21/2014 03:26, David Herrmann wrote:
> Hi
>
> On Tue, Jan 21, 2014 at 3:00 AM,  <simon@mungewell.org> wrote:
>>> This adds a special case in the HIDP core for the Dualshock 4
>> controller.
>>> The controller only recognizes output reports with the report type 0x52
>> and only accepts reports sent via the ctrl channel.
>>
>> Which part of the system is 'at fault' here, is it simply the DS4 behaving
>> incorrectly or that Bluez is not picking up some data or that 'we' are
>> just the incorrect method to send the data (in the hid-sony kernel
>> driver)?
> No-one is at fault. Well, strictly speaking the DS4 is, as it has to
> accept SET_REPORT and asynchronous OUTPUT_REPORTs, but it doesn't.
> That's quite common. What we actually want is HIDP to provide to
> functions, one to call SET_REPORT and one to do the async
> OUTPUT_REPORT is currently does.
>
> I implemented this some time ago here:
>    http://cgit.freedesktop.org/~dvdhrm/linux/log/?h=hid
>
> Maybe it's time to get that merged. But that hack here is ugly and not
> the way to go.
>
> Thanks
> David
Believe me, I know that my hack is ugly :).  The raw_request 
functionality in your repo is exactly what is needed in this scenario.  
I have the Bluetooth work on the Sony driver module done, so now it's 
just a matter of waiting on if or when this gets merged.

^ permalink raw reply

* Re: [PATCH 0/1] HIDP: Add a special case for the Dualshock 4
From: David Herrmann @ 2014-01-21 16:34 UTC (permalink / raw)
  To: Frank Praznik; +Cc: Simon Wood, Frank Praznik, linux-bluetooth@vger.kernel.org
In-Reply-To: <52DE99CA.8030305@gmail.com>

Hi

On Tue, Jan 21, 2014 at 5:01 PM, Frank Praznik <frank.praznik@gmail.com> wrote:
> On 1/21/2014 03:26, David Herrmann wrote:
>>
>> Hi
>>
>> On Tue, Jan 21, 2014 at 3:00 AM,  <simon@mungewell.org> wrote:
>>>>
>>>> This adds a special case in the HIDP core for the Dualshock 4
>>>
>>> controller.
>>>>
>>>> The controller only recognizes output reports with the report type 0x52
>>>
>>> and only accepts reports sent via the ctrl channel.
>>>
>>> Which part of the system is 'at fault' here, is it simply the DS4
>>> behaving
>>> incorrectly or that Bluez is not picking up some data or that 'we' are
>>> just the incorrect method to send the data (in the hid-sony kernel
>>> driver)?
>>
>> No-one is at fault. Well, strictly speaking the DS4 is, as it has to
>> accept SET_REPORT and asynchronous OUTPUT_REPORTs, but it doesn't.
>> That's quite common. What we actually want is HIDP to provide to
>> functions, one to call SET_REPORT and one to do the async
>> OUTPUT_REPORT is currently does.
>>
>> I implemented this some time ago here:
>>    http://cgit.freedesktop.org/~dvdhrm/linux/log/?h=hid
>>
>> Maybe it's time to get that merged. But that hack here is ugly and not
>> the way to go.
>>
>> Thanks
>> David
>
> Believe me, I know that my hack is ugly :).  The raw_request functionality
> in your repo is exactly what is needed in this scenario.  I have the
> Bluetooth work on the Sony driver module done, so now it's just a matter of
> waiting on if or when this gets merged.

My backlog is continuously growing.. it's not the only patch-series I
have pending for too long, I'm sincerely sorry. I'm working hard on
getting all that stuff out, but note that I will not be able to get
this ready before FOSDEM (in 2 weeks). So if you want to pick this up
before 3rd of February, I would be more than glad about it. I will
review any changes. Otherwise, you'd have to wait for at least 2 more
weeks before I can send it out.

Also feel free to extract any small part of the series if you don't
feel confident about the other stuff. So you can just move the
raw_request()/raw_report() into a separate patch. We *definitely* need
this callback, so I'd be fine if we add it early.

Cheers
David

^ permalink raw reply

* Re: [PATCH BlueZ v2 01/18] doc: Add GATT API
From: Marcel Holtmann @ 2014-01-21 16:50 UTC (permalink / raw)
  To: Claudio Takahasi; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <1390310814-19880-2-git-send-email-claudio.takahasi@openbossa.org>

Hi Claudio,

> This patch proposes an unified GATT API for local and remote services.
> ---
> doc/gatt-api.txt | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 145 insertions(+)
> create mode 100644 doc/gatt-api.txt
> 
> diff --git a/doc/gatt-api.txt b/doc/gatt-api.txt
> new file mode 100644
> index 0000000..df60fb8
> --- /dev/null
> +++ b/doc/gatt-api.txt
> @@ -0,0 +1,145 @@
> +BlueZ D-Bus GATT API description
> +********************************
> +
> +GATT local and remote services share the same high-level D-Bus API. Local
> +refers to GATT based service exported by a BlueZ plugin or an external
> +application. Remote refers to GATT services exported by the peer.
> +
> +BlueZ acts as a proxy, translating ATT operations to D-Bus method calls and
> +Properties (or the opposite). Support for D-Bus Object Manager is mandatory for
> +external services to allow seamless GATT declarations (Service, Characteristic
> +and Descriptors) discovery.
> +
> +Service hierarchy
> +=================
> +
> +GATT remote and local service representation. Object path for local services
> +is freely definable.
> +
> +External applications implementing local services must register the services
> +using GattServiceManager1 registration method and must implement the methods
> +and properties defined in GattService1 interface.
> +
> +Service		org.bluez
> +Interface	org.bluez.GattService1 [Experimental]
> +Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX
> +
> +Methods		void Release()
> +
> +			Release this service. At this point, it will not be
> +			used by BlueZ anymore and can be destroyed by the
> +			owner. Method applicable to external GATT services
> +			implementations only (GATT servers).
> +
> +Properties	string UUID [read-only]
> +
> +			128-bit service UUID.
> +
> +		array{object} Includes [read-only]: Not implemented
> +
> +			Array of object paths representing the included
> +			services of this service.
> +
> +
> +Characteristic hierarchy
> +========================
> +
> +For local GATT defined services, the object paths need to follow the service
> +path hierarchy and are freely definable.
> +
> +Service		org.bluez
> +Interface	org.bluez.Characteristic1 [Experimental]
> +Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY

this is an all or nothing deal. So better GattCharacteristic1.

> +
> +Properties	string UUID [read-only]
> +
> +			128-bit characteristic UUID.
> +
> +		object Service [read-only]
> +
> +			Object path of the GATT service the characteristc
> +			belongs to.
> +
> +		array{byte} Value [read-write]
> +
> +			Value read from the remote Bluetooth device or from
> +			the external application implementing GATT services.
> +
> +		array{string} Flags [read-only, optional]
> +
> +			Defines how the characteristic value can be used. See
> +			Core spec page 1898, "Table 3.5: Characteristic
> +			Properties bit field" and page 1900, "Table 3.8:
> +			Characteristic Extended Properties bit field". Allowed
> +			values: "broadcast", "read", "write-without-response",
> +			"write", "notify", "indicate",
> +			"authenticated-signed-writes", "reliable-write", and
> +			"writable-auxiliaries".
> +
> +
> +Characteristic Descriptors hierarchy
> +====================================
> +
> +Local or remote GATT characteristic descriptors hierarchy.
> +
> +Service		org.bluez
> +Interface	org.bluez.Descriptor1 [Experimental]
> +Object path	[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY/descriptorZZZ

Same here. GattDescriptor1.

> +
> +Properties	string UUID [read-only]
> +
> +			128-bit descriptor UUID.
> +
> +		object Characteristic [read-only]
> +
> +			Object path of the GATT characteristc the descriptor
> +			belongs to.
> +
> +		array{byte} Value [read-write]
> +
> +			Raw characteristic descriptor value read from the
> +			remote Bluetooth device or from the external
> +			application implementing GATT services.
> +
> +		string Permissions [read-only]: To be defined
> +
> +			Defines read/write authentication and authorization
> +			requirements.
> +
> +Service Manager hierarchy
> +=============================
> +
> +Service Manager allows external applications to register GATT based
> +services. Services must follow the API for Service and Characteristic
> +described above.
> +
> +Local GATT services, characteristics and characteristic descriptors are
> +discovered automatically using the D-Bus Object Manager interface.
> +
> +Service		org.bluez
> +Interface	org.bluez.GattServiceManager1 [Experimental]
> +Object path	/org/bluez

Here we could discuss to use GattManager1 to make it shorter, but I am not sure if that actually helps. I currently tend to leave it as GattServiceManager1.

> +
> +Methods		RegisterService(object service, dict options)
> +
> +			Registers remote application service exported under
> +			interface GattService1. Characteristic objects must
> +			be hierarchical to their service and must use the
> +			interface Characteristic1. D-Bus Object Manager is
> +			used to fetch the exported objects.
> +
> +			"service" object path together with the D-Bus system
> +			bus connection ID define the identification of the
> +			application registering a GATT based service.
> +
> +			Possible errors: org.bluez.Error.InvalidArguments
> +					 org.bluez.Error.AlreadyExists
> +
> +		UnregisterService(object service)
> +
> +			This unregisters the service that has been
> +			previously registered. The object path parameter
> +			must match the same value that has been used
> +			on registration.
> +
> +			Possible errors: org.bluez.Error.DoesNotExist

Regards

Marcel


^ permalink raw reply

* Re: [PATCH 2/5] android/bluetooth: Use defines for settings and devices files paths
From: Marcel Holtmann @ 2014-01-21 16:54 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth@vger.kernel.org development, Szymon Janc
In-Reply-To: <1390316497-18451-3-git-send-email-szymon.janc@tieto.com>

Hi Szymon,

> ---
> android/bluetooth.c | 24 +++++++++++-------------
> 1 file changed, 11 insertions(+), 13 deletions(-)
> 
> diff --git a/android/bluetooth.c b/android/bluetooth.c
> index 8f08122..3314267 100644
> --- a/android/bluetooth.c
> +++ b/android/bluetooth.c
> @@ -54,6 +54,9 @@
> 
> #define DUT_MODE_FILE "/sys/kernel/debug/bluetooth/hci%u/dut_mode"
> 
> +#define SETTINGS_FILE ANDROID_STORAGEDIR"/settings"
> +#define DEVICES_FILE ANDROID_STORAGEDIR"/devices”

is there any good reason to keep cached devices together with the bonded devices? I get the feeling a cached device should be safe to throw away. So deleting the cache file should not cause any problems. Meaning it should be a separate file.

Regards

Marcel


^ permalink raw reply

* Re: [PATCH 2/5] android/bluetooth: Use defines for settings and devices files paths
From: Szymon Janc @ 2014-01-21 17:41 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Szymon Janc, linux-bluetooth@vger.kernel.org development
In-Reply-To: <2F525C49-B02B-4A87-8CAE-633BF53A8ADF@holtmann.org>

Hi Marcel,

On Tuesday 21 January 2014 08:54:35 Marcel Holtmann wrote:
> Hi Szymon,
>=20
> > ---
> > android/bluetooth.c | 24 +++++++++++-------------
> > 1 file changed, 11 insertions(+), 13 deletions(-)
> >=20
> > diff --git a/android/bluetooth.c b/android/bluetooth.c
> > index 8f08122..3314267 100644
> > --- a/android/bluetooth.c
> > +++ b/android/bluetooth.c
> > @@ -54,6 +54,9 @@
> >=20
> > #define DUT_MODE_FILE "/sys/kernel/debug/bluetooth/hci%u/dut_mode"
> >=20
> > +#define SETTINGS_FILE ANDROID_STORAGEDIR"/settings"
> > +#define DEVICES_FILE ANDROID_STORAGEDIR"/devices=E2=80=9D
>=20
> is there any good reason to keep cached devices together with the bon=
ded
> devices? I get the feeling a cached device should be safe to throw aw=
ay. So
> deleting the cache file should not cause any problems. Meaning it sho=
uld be
> a separate file.

I'm fine with having separate files too (even have this implemented on =
my=20
local branch), but wanted to avoid handling multiple files. Anyway, add=
/remove=20
bond doesn't happen that often so maybe this is not a problem.

So, is "device_cache" name OK? Or just "cache"?

--=20
Szymon K. Janc
szymon.janc@gmail.com

^ permalink raw reply

* Re: [PATCH 2/5] android/bluetooth: Use defines for settings and devices files paths
From: Marcel Holtmann @ 2014-01-21 19:13 UTC (permalink / raw)
  To: Szymon Janc; +Cc: Szymon Janc, linux-bluetooth@vger.kernel.org development
In-Reply-To: <1699475.kPZvhNixD9@athlon>

Hi Szymon,

>>> ---
>>> android/bluetooth.c | 24 +++++++++++-------------
>>> 1 file changed, 11 insertions(+), 13 deletions(-)
>>> 
>>> diff --git a/android/bluetooth.c b/android/bluetooth.c
>>> index 8f08122..3314267 100644
>>> --- a/android/bluetooth.c
>>> +++ b/android/bluetooth.c
>>> @@ -54,6 +54,9 @@
>>> 
>>> #define DUT_MODE_FILE "/sys/kernel/debug/bluetooth/hci%u/dut_mode"
>>> 
>>> +#define SETTINGS_FILE ANDROID_STORAGEDIR"/settings"
>>> +#define DEVICES_FILE ANDROID_STORAGEDIR"/devices”
>> 
>> is there any good reason to keep cached devices together with the bonded
>> devices? I get the feeling a cached device should be safe to throw away. So
>> deleting the cache file should not cause any problems. Meaning it should be
>> a separate file.
> 
> I'm fine with having separate files too (even have this implemented on my 
> local branch), but wanted to avoid handling multiple files. Anyway, add/remove 
> bond doesn't happen that often so maybe this is not a problem.
> 
> So, is "device_cache" name OK? Or just "cache”?

I would just do “cache” and see where it takes us.

Regards

Marcel


^ permalink raw reply

* Re: [PATCH BlueZ v2 01/18] doc: Add GATT API
From: Claudio Takahasi @ 2014-01-21 19:40 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg
  Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <B5AE7C1F-664D-4859-9793-E853DFF02FC5@holtmann.org>

Hi Marcel/Johan:

On Tue, Jan 21, 2014 at 1:50 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Claudio,
>
>> This patch proposes an unified GATT API for local and remote services.
>> ---
>> doc/gatt-api.txt | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 145 insertions(+)
>> create mode 100644 doc/gatt-api.txt
>>
>> diff --git a/doc/gatt-api.txt b/doc/gatt-api.txt
>> new file mode 100644
>> index 0000000..df60fb8
>> --- /dev/null
>> +++ b/doc/gatt-api.txt
>> @@ -0,0 +1,145 @@
>> +BlueZ D-Bus GATT API description
>> +********************************
>> +
>> +GATT local and remote services share the same high-level D-Bus API. Local
>> +refers to GATT based service exported by a BlueZ plugin or an external
>> +application. Remote refers to GATT services exported by the peer.
>> +
>> +BlueZ acts as a proxy, translating ATT operations to D-Bus method calls and
>> +Properties (or the opposite). Support for D-Bus Object Manager is mandatory for
>> +external services to allow seamless GATT declarations (Service, Characteristic
>> +and Descriptors) discovery.
>> +
>> +Service hierarchy
>> +=================
>> +
>> +GATT remote and local service representation. Object path for local services
>> +is freely definable.
>> +
>> +External applications implementing local services must register the services
>> +using GattServiceManager1 registration method and must implement the methods
>> +and properties defined in GattService1 interface.
>> +
>> +Service              org.bluez
>> +Interface    org.bluez.GattService1 [Experimental]
>> +Object path  [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX
>> +
>> +Methods              void Release()
>> +
>> +                     Release this service. At this point, it will not be
>> +                     used by BlueZ anymore and can be destroyed by the
>> +                     owner. Method applicable to external GATT services
>> +                     implementations only (GATT servers).
>> +
>> +Properties   string UUID [read-only]
>> +
>> +                     128-bit service UUID.
>> +
>> +             array{object} Includes [read-only]: Not implemented
>> +
>> +                     Array of object paths representing the included
>> +                     services of this service.
>> +
>> +
>> +Characteristic hierarchy
>> +========================
>> +
>> +For local GATT defined services, the object paths need to follow the service
>> +path hierarchy and are freely definable.
>> +
>> +Service              org.bluez
>> +Interface    org.bluez.Characteristic1 [Experimental]
>> +Object path  [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY
>
> this is an all or nothing deal. So better GattCharacteristic1.

OK. It will be changed in the next patchset.

>
>> +
>> +Properties   string UUID [read-only]
>> +
>> +                     128-bit characteristic UUID.
>> +
>> +             object Service [read-only]
>> +
>> +                     Object path of the GATT service the characteristc
>> +                     belongs to.
>> +
>> +             array{byte} Value [read-write]
>> +
>> +                     Value read from the remote Bluetooth device or from
>> +                     the external application implementing GATT services.
>> +
>> +             array{string} Flags [read-only, optional]
>> +
>> +                     Defines how the characteristic value can be used. See
>> +                     Core spec page 1898, "Table 3.5: Characteristic
>> +                     Properties bit field" and page 1900, "Table 3.8:
>> +                     Characteristic Extended Properties bit field". Allowed
>> +                     values: "broadcast", "read", "write-without-response",
>> +                     "write", "notify", "indicate",
>> +                     "authenticated-signed-writes", "reliable-write", and
>> +                     "writable-auxiliaries".
>> +
>> +
>> +Characteristic Descriptors hierarchy
>> +====================================
>> +
>> +Local or remote GATT characteristic descriptors hierarchy.
>> +
>> +Service              org.bluez
>> +Interface    org.bluez.Descriptor1 [Experimental]
>> +Object path  [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/serviceXX/charYYYY/descriptorZZZ
>
> Same here. GattDescriptor1.

OK. It will be changed in the next patchset.

>
>> +
>> +Properties   string UUID [read-only]
>> +
>> +                     128-bit descriptor UUID.
>> +
>> +             object Characteristic [read-only]
>> +
>> +                     Object path of the GATT characteristc the descriptor
>> +                     belongs to.
>> +
>> +             array{byte} Value [read-write]
>> +
>> +                     Raw characteristic descriptor value read from the
>> +                     remote Bluetooth device or from the external
>> +                     application implementing GATT services.
>> +
>> +             string Permissions [read-only]: To be defined
>> +
>> +                     Defines read/write authentication and authorization
>> +                     requirements.
>> +
>> +Service Manager hierarchy
>> +=============================
>> +
>> +Service Manager allows external applications to register GATT based
>> +services. Services must follow the API for Service and Characteristic
>> +described above.
>> +
>> +Local GATT services, characteristics and characteristic descriptors are
>> +discovered automatically using the D-Bus Object Manager interface.
>> +
>> +Service              org.bluez
>> +Interface    org.bluez.GattServiceManager1 [Experimental]
>> +Object path  /org/bluez
>
> Here we could discuss to use GattManager1 to make it shorter, but I am not sure if that actually helps. I currently tend to leave it as GattServiceManager1.

I prefer GattManager1. I have two reasons:
* "Service" is included in the methods names: RegisterService and
UnregisterService
* GattManager1 name is more generic and we can use it for other GATT
methods not directly related to "Service". At the moment, I don't have
examples, but I was thinking on potential methods related to GATT
Client.

Marcel/Johan: Please define which name will be used.

>
>> +
>> +Methods              RegisterService(object service, dict options)
>> +
>> +                     Registers remote application service exported under
>> +                     interface GattService1. Characteristic objects must
>> +                     be hierarchical to their service and must use the
>> +                     interface Characteristic1. D-Bus Object Manager is
>> +                     used to fetch the exported objects.
>> +
>> +                     "service" object path together with the D-Bus system
>> +                     bus connection ID define the identification of the
>> +                     application registering a GATT based service.
>> +
>> +                     Possible errors: org.bluez.Error.InvalidArguments
>> +                                      org.bluez.Error.AlreadyExists
>> +
>> +             UnregisterService(object service)
>> +
>> +                     This unregisters the service that has been
>> +                     previously registered. The object path parameter
>> +                     must match the same value that has been used
>> +                     on registration.
>> +
>> +                     Possible errors: org.bluez.Error.DoesNotExist
>
> Regards
>
> Marcel

Regards,
Claudio

^ permalink raw reply

* [PATCH v2 1/2] android: Add btmgmt to debug builds
From: Andrzej Kaczmarek @ 2014-01-21 19:46 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek

---
 android/Android.mk | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/android/Android.mk b/android/Android.mk
index e66d70a..e3a31c1 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -296,3 +296,33 @@ LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
 
 include $(BUILD_PREBUILT)
+
+#
+# btmgmt
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+	../tools/btmgmt.c \
+	../lib/bluetooth.c \
+	../lib/sdp.c \
+	../monitor/mainloop.c \
+	../src/shared/io-mainloop.c \
+	../src/shared/mgmt.c \
+	../src/shared/queue.c \
+	../src/shared/util.c \
+	../src/uuid-helper.c \
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/.. \
+	$(LOCAL_PATH)/../src \
+	$(LOCAL_PATH)/../lib \
+
+LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := btmgmt
+
+include $(BUILD_EXECUTABLE)
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH v2 2/2] android: Add l2ping to debug builds
From: Andrzej Kaczmarek @ 2014-01-21 19:46 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek
In-Reply-To: <1390333570-13196-1-git-send-email-andrzej.kaczmarek@tieto.com>

---
 android/Android.mk | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/android/Android.mk b/android/Android.mk
index e3a31c1..3b8d471 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -326,3 +326,25 @@ LOCAL_MODULE_TAGS := debug
 LOCAL_MODULE := btmgmt
 
 include $(BUILD_EXECUTABLE)
+
+#
+# l2ping
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+	../tools/l2ping.c \
+	../lib/bluetooth.c \
+	../lib/hci.c \
+
+LOCAL_C_INCLUDES := \
+	$(LOCAL_PATH)/../lib \
+
+LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
+LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE := l2ping
+
+include $(BUILD_EXECUTABLE)
-- 
1.8.5.2


^ permalink raw reply related

* Re: [PATCH BlueZ v2 01/18] doc: Add GATT API
From: Johan Hedberg @ 2014-01-21 19:48 UTC (permalink / raw)
  To: Claudio Takahasi
  Cc: Marcel Holtmann, linux-bluetooth@vger.kernel.org development
In-Reply-To: <CAKT1EBc-VL5M0c1yt8LpGvaTyyE7P=9w5jGOZs7wUpRpsS7A8Q@mail.gmail.com>

Hi Claudio,

On Tue, Jan 21, 2014, Claudio Takahasi wrote:
> >> +Interface    org.bluez.GattServiceManager1 [Experimental]
> >> +Object path  /org/bluez
> >
> > Here we could discuss to use GattManager1 to make it shorter, but I
> > am not sure if that actually helps. I currently tend to leave it as
> > GattServiceManager1.
> 
> I prefer GattManager1. I have two reasons:
> * "Service" is included in the methods names: RegisterService and
> UnregisterService
> * GattManager1 name is more generic and we can use it for other GATT
> methods not directly related to "Service". At the moment, I don't have
> examples, but I was thinking on potential methods related to GATT
> Client.
> 
> Marcel/Johan: Please define which name will be used.

I'm voting for GattManager1, but Marcel has veto rights :)

Johan

^ permalink raw reply

* Re: [PATCH BlueZ v2 01/18] doc: Add GATT API
From: Marcel Holtmann @ 2014-01-21 19:51 UTC (permalink / raw)
  To: Johan Hedberg
  Cc: Claudio Takahasi, linux-bluetooth@vger.kernel.org development
In-Reply-To: <20140121194842.GA3342@x220.p-661hnu-f1>

Hi Johan,

>>>> +Interface    org.bluez.GattServiceManager1 [Experimental]
>>>> +Object path  /org/bluez
>>> 
>>> Here we could discuss to use GattManager1 to make it shorter, but I
>>> am not sure if that actually helps. I currently tend to leave it as
>>> GattServiceManager1.
>> 
>> I prefer GattManager1. I have two reasons:
>> * "Service" is included in the methods names: RegisterService and
>> UnregisterService
>> * GattManager1 name is more generic and we can use it for other GATT
>> methods not directly related to "Service". At the moment, I don't have
>> examples, but I was thinking on potential methods related to GATT
>> Client.
>> 
>> Marcel/Johan: Please define which name will be used.
> 
> I'm voting for GattManager1, but Marcel has veto rights :)

lets go with GattManager1 and see where it takes us.

Regards

Marcel


^ permalink raw reply

* [PATCH 60/73] drivers/bluetooth: delete non-required instances of include <linux/init.h>
From: Paul Gortmaker @ 2014-01-21 21:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Paul Gortmaker, Marcel Holtmann, Gustavo Padovan,
	Johan Hedberg, linux-bluetooth
In-Reply-To: <1390339396-3479-1-git-send-email-paul.gortmaker@windriver.com>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/bluetooth/ath3k.c       | 1 -
 drivers/bluetooth/bcm203x.c     | 1 -
 drivers/bluetooth/bfusb.c       | 1 -
 drivers/bluetooth/bluecard_cs.c | 1 -
 drivers/bluetooth/bpa10x.c      | 1 -
 drivers/bluetooth/bt3c_cs.c     | 1 -
 drivers/bluetooth/btuart_cs.c   | 1 -
 drivers/bluetooth/dtl1_cs.c     | 1 -
 8 files changed, 8 deletions(-)

diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 41ec6f9..427f280 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -20,7 +20,6 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/errno.h>
diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c
index 364f82b..40db9a9 100644
--- a/drivers/bluetooth/bcm203x.c
+++ b/drivers/bluetooth/bcm203x.c
@@ -26,7 +26,6 @@
 
 #include <linux/atomic.h>
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/errno.h>
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index 3138699..48b71f0 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -24,7 +24,6 @@
 #include <linux/module.h>
 
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/errno.h>
diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 57427de..0aae563 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/sched.h>
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
index 8a31991..40281c0 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -23,7 +23,6 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/sched.h>
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 73d8799..f3508fe 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -24,7 +24,6 @@
 #include <linux/module.h>
 
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/delay.h>
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index a03ecc2..057104e 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/delay.h>
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 52eed1f..5bb80e4 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -23,7 +23,6 @@
 #include <linux/module.h>
 
 #include <linux/kernel.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/delay.h>
-- 
1.8.4.1

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox