Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Remove device OOB data if it was discovered in band
From: Szymon Janc @ 2012-11-19 14:46 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

OOB authentication mechanism should be used only if pairing process
has been activated by previous OOB information exchange (Core Spec
4.0 , vol. 1, Part A, 5.1.4.3). Stored OOB data for specific device
should be removed if that device was discovered in band later on.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
---

This could also be done by userspace but would require calling remove remote
OOB data mgmt command for every device found. Userspace could also track for
which devices OOB data were added but this could be problematic as OOB data
persists userspace restart. Doing it in kernel seems better.


 net/bluetooth/hci_event.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 9f5c5f2..cda5bac 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1946,6 +1946,8 @@ static void hci_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb)
 	for (; num_rsp; num_rsp--, info++) {
 		bool name_known, ssp;
 
+		hci_remove_remote_oob_data(hdev, &info->bdaddr);
+
 		bacpy(&data.bdaddr, &info->bdaddr);
 		data.pscan_rep_mode	= info->pscan_rep_mode;
 		data.pscan_period_mode	= info->pscan_period_mode;
-- 
1.7.9.5


^ permalink raw reply related

* Re: [PATCH BlueZ 2/2] l2test: Add support to test auto select PSM
From: Syam Sidhardhan @ 2012-11-19 14:09 UTC (permalink / raw)
  To: Syam Sidhardhan, linux-bluetooth
In-Reply-To: <20121116080528.GA9653@x220>

Hi Johan,

On Fri, Nov 16, 2012 at 1:35 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi Syam,
>
> On Fri, Nov 09, 2012, Syam Sidhardhan wrote:
>> This patch enable us to test the auto select PSM by passing
>> PSM value as 0.
>>
>> Ex: l2test -d -P 0
>> l2test[2585]: Waiting for connection on psm 4099 ...
>> ---
>>  test/l2test.c |    4 +---
>>  1 files changed, 1 insertions(+), 3 deletions(-)
>>
>> diff --git a/test/l2test.c b/test/l2test.c
>> index 7645681..72ad4ba 100644
>> --- a/test/l2test.c
>> +++ b/test/l2test.c
>> @@ -87,7 +87,7 @@ static long buffer_size = 2048;
>>
>>  /* Default addr and psm and cid */
>>  static bdaddr_t bdaddr;
>> -static unsigned short psm = 0x1011;
>> +static unsigned short psm = 0;
>>  static unsigned short cid = 0;
>>
>>  /* Default number of frames to send (-1 = infinite) */
>> @@ -375,8 +375,6 @@ static int do_connect(char *svr)
>>               addr.l2_cid = htobs(cid);
>>       else if (psm)
>>               addr.l2_psm = htobs(psm);
>> -     else
>> -             goto error;
>>
>>       if (connect(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0 ) {
>>               syslog(LOG_ERR, "Can't connect: %s (%d)",
>
> At least the second chunk is for the initiating (client) part, not the
> server (which the commit message implies you're dealing with). There's
> no "auto select" for the client.
>

True. While preparing the patch it got misplaced.
I'll send an updated version.

Thanks,
Syam.

^ permalink raw reply

* Re: [PATCH BlueZ 2/4] gdbus: Automatically register '/' path
From: Lucas De Marchi @ 2012-11-19 13:18 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <CABBYNZJ79UfsU9=ejGSEBGueca1FJouKt15LpukEy6TtK+QFYg@mail.gmail.com>

On Mon, Nov 19, 2012 at 10:49 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> Hi Lucas,
>
> On Mon, Nov 19, 2012 at 2:06 PM, Lucas De Marchi
> <lucas.demarchi@profusion.mobi> wrote:
>> Hi Luiz,
>>
>> On Mon, Nov 19, 2012 at 6:46 AM, Luiz Augusto von Dentz
>> <luiz.dentz@gmail.com> wrote:
>>> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>>>
>>> This makes g_dbus_setup_bus to automatically register '/' path so
>>> user application that don't export any interface on '/' will have it
>>> registered for ObjectManager.
>>>
>>> Note that it is now required to call g_dbus_close before exit.
>>
>> I'm no really fan of this. Why do we need to register '/' now?  If we
>> are not going to support ObjectManager interfaces in subtrees, it
>> would be easier to just move the ObjectManager to the shortest path
>> registered rather than always registering '/'.
>
> Maybe I should have made clear this in the description, if you look at
> the spec it suggest that each sub-tree root should implement
> ObjectManager, the current implementation does that but if you think
> about it probably doesn't make sense to have sub-trees because that
> would creates extra round trips that ObjectManager was meant to

HUmn... I think you are a bit confused now.

1 entire tree can be managed by a single ObjectManager, or multiple
ones if there are objects that are not interesting to everybody and
only a few types of clients would be interested in the objects changed
beyond that path.

Example:

/org/bluez
  - ObjectManager
/org/bluez/adapter/bla/bli
  - MyInterfaceWithLotsOfObjects

If you put only 1 ObjectManager it means you get called for each
change in /org/bluez/adapter/bla/bli even though most of the clients
will not be interested in that. Therefore the spec allows you to
attach another ObjectManager in /org/bluez/adapter/[...]  so the first
ObjectManager only send updates and "manage" the objects until the
path containing another ObjectManager.

I do think we don't really need that feature right now. I think we are
fine with a single ObjectManager in "/", but always registering "/"
IMO is not the right solution.

> prevent, also Im not completely sure now but I remember someone
> mentioning the '/' is kind special and should always be available no
> matter what, so by registering '/' directly on g_dbus_setup_bus we
> guarantee we have it always and that no sub-tree is going to be
> generated since '/' is the root no matter what path the user code
> register.

Kind of true... what really needs to be treated are calls to
Introspectable interface on "/". This is used by tools like d-feet to
navigate the tree (looking for the "<node ...>" tags) -- I *think*
this is also used by some bindings like python's. If you look in other
projects around, they prefer using the project's namespace rather than
"/"  (examples: systemd, udisks, policykit, dconf).

So, if we register "/", but not an Introspectable interface in there,
it means we will break tools like d-feet. If we don't register it,
libdbus will handle the messages to Introspectable (this is why other
projects don't even bother about "/").


Lucas De Marchi

^ permalink raw reply

* Re: [PATCH BlueZ 2/4] gdbus: Automatically register '/' path
From: Luiz Augusto von Dentz @ 2012-11-19 12:49 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <CAMOw1v7Y3EORhpSyydjhieG4Owx=0d5QAp=G66RweF7-cCshXQ@mail.gmail.com>

Hi Lucas,

On Mon, Nov 19, 2012 at 2:06 PM, Lucas De Marchi
<lucas.demarchi@profusion.mobi> wrote:
> Hi Luiz,
>
> On Mon, Nov 19, 2012 at 6:46 AM, Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
>> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>>
>> This makes g_dbus_setup_bus to automatically register '/' path so
>> user application that don't export any interface on '/' will have it
>> registered for ObjectManager.
>>
>> Note that it is now required to call g_dbus_close before exit.
>
> I'm no really fan of this. Why do we need to register '/' now?  If we
> are not going to support ObjectManager interfaces in subtrees, it
> would be easier to just move the ObjectManager to the shortest path
> registered rather than always registering '/'.

Maybe I should have made clear this in the description, if you look at
the spec it suggest that each sub-tree root should implement
ObjectManager, the current implementation does that but if you think
about it probably doesn't make sense to have sub-trees because that
would creates extra round trips that ObjectManager was meant to
prevent, also Im not completely sure now but I remember someone
mentioning the '/' is kind special and should always be available no
matter what, so by registering '/' directly on g_dbus_setup_bus we
guarantee we have it always and that no sub-tree is going to be
generated since '/' is the root no matter what path the user code
register.

--
Luiz Augusto von Dentz

^ permalink raw reply

* Re: [PATCH BlueZ 2/4] gdbus: Automatically register '/' path
From: Lucas De Marchi @ 2012-11-19 12:06 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1353314786-11427-2-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Mon, Nov 19, 2012 at 6:46 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This makes g_dbus_setup_bus to automatically register '/' path so
> user application that don't export any interface on '/' will have it
> registered for ObjectManager.
>
> Note that it is now required to call g_dbus_close before exit.

I'm no really fan of this. Why do we need to register '/' now?  If we
are not going to support ObjectManager interfaces in subtrees, it
would be easier to just move the ObjectManager to the shortest path
registered rather than always registering '/'.


Lucas De Marchi

^ permalink raw reply

* Re: [PATCH] bluetooth: Increase HCI command tx timeout
From: Johan Hedberg @ 2012-11-19 10:01 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <1370568.JbBC3GLxi1@uw000953>

Hi Szymon,

On Mon, Nov 19, 2012, Szymon Janc wrote:
> On Monday 12 of November 2012 12:01:05 Janc Szymon wrote:
> > Read Local OOB Data command can take more than 1 second on some chips.
> > e.g. on CSR 0a12:0001 first call to Read Local OOB Data after reset
> > takes about 1300ms resulting in tx timeout error.
> > 
> > [27698.368655] Bluetooth: hci0 command 0x0c57 tx timeout
> > 
> > 2012-10-31 15:53:36.178585 < HCI Command: Read Local OOB Data (0x03|0x0057) plen 0
> > 2012-10-31 15:53:37.496996 > HCI Event: Command Complete (0x0e) plen 36
> >     Read Local OOB Data (0x03|0x0057) ncmd 1
> >     status 0x00
> >     hash 0x92219d9b447f2aa9dc12dda2ae7bae6a
> >     randomizer 0xb1948d0febe4ea38ce85c4e66313beba
> > 
> > Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> > ---
> > 
> > Spec doesn't seem to be posing any restrictions on how fast should HCI response...
> > I've increased timeout to 2 secs as this seems to fix this for me, but maybe this
> > could be increased to something more, like 5 secs or sth to minimize tx timeout
> > chance for other slow chips?  If chip doesn't response for command it is FUBAR
> > anyway and having longer timeout would not make things that much worse (and
> > could even improve things on slow chips..).
> > 
> > 
> >  include/net/bluetooth/hci.h |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> > index 4bbabd8..45eee08 100644
> > --- a/include/net/bluetooth/hci.h
> > +++ b/include/net/bluetooth/hci.h
> > @@ -154,7 +154,7 @@ enum {
> >  #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
> >  #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
> >  #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
> > -#define HCI_CMD_TIMEOUT		msecs_to_jiffies(1000)	/* 1 second */
> > +#define HCI_CMD_TIMEOUT		msecs_to_jiffies(2000)	/* 2 seconds */
> >  #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
> >  #define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
> >  
> > 
> 
> ping

I'm fine with this but an ack from Marcel or Gustavo would be good.

Johan

^ permalink raw reply

* Re: [PATCH] bluetooth: Increase HCI command tx timeout
From: Szymon Janc @ 2012-11-19  9:46 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org
In-Reply-To: <1352714465-17015-1-git-send-email-szymon.janc@tieto.com>

On Monday 12 of November 2012 12:01:05 Janc Szymon wrote:
> Read Local OOB Data command can take more than 1 second on some chips.
> e.g. on CSR 0a12:0001 first call to Read Local OOB Data after reset
> takes about 1300ms resulting in tx timeout error.
> 
> [27698.368655] Bluetooth: hci0 command 0x0c57 tx timeout
> 
> 2012-10-31 15:53:36.178585 < HCI Command: Read Local OOB Data (0x03|0x0057) plen 0
> 2012-10-31 15:53:37.496996 > HCI Event: Command Complete (0x0e) plen 36
>     Read Local OOB Data (0x03|0x0057) ncmd 1
>     status 0x00
>     hash 0x92219d9b447f2aa9dc12dda2ae7bae6a
>     randomizer 0xb1948d0febe4ea38ce85c4e66313beba
> 
> Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> ---
> 
> Spec doesn't seem to be posing any restrictions on how fast should HCI response...
> I've increased timeout to 2 secs as this seems to fix this for me, but maybe this
> could be increased to something more, like 5 secs or sth to minimize tx timeout
> chance for other slow chips?  If chip doesn't response for command it is FUBAR
> anyway and having longer timeout would not make things that much worse (and
> could even improve things on slow chips..).
> 
> 
>  include/net/bluetooth/hci.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> index 4bbabd8..45eee08 100644
> --- a/include/net/bluetooth/hci.h
> +++ b/include/net/bluetooth/hci.h
> @@ -154,7 +154,7 @@ enum {
>  #define HCI_DISCONN_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
>  #define HCI_PAIRING_TIMEOUT	msecs_to_jiffies(60000)	/* 60 seconds */
>  #define HCI_INIT_TIMEOUT	msecs_to_jiffies(10000)	/* 10 seconds */
> -#define HCI_CMD_TIMEOUT		msecs_to_jiffies(1000)	/* 1 second */
> +#define HCI_CMD_TIMEOUT		msecs_to_jiffies(2000)	/* 2 seconds */
>  #define HCI_ACL_TX_TIMEOUT	msecs_to_jiffies(45000)	/* 45 seconds */
>  #define HCI_AUTO_OFF_TIMEOUT	msecs_to_jiffies(2000)	/* 2 seconds */
>  
> 

ping

^ permalink raw reply

* [PATCH BlueZ 4/4] core: Make use of g_dbus_close
From: Luiz Augusto von Dentz @ 2012-11-19  8:46 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1353314786-11427-1-git-send-email-luiz.dentz@gmail.com>

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

---
 src/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main.c b/src/main.c
index 414849a..1ca6015 100644
--- a/src/main.c
+++ b/src/main.c
@@ -383,6 +383,7 @@ static void disconnect_dbus(void)
 
 	set_dbus_connection(NULL);
 
+	g_dbus_close(conn);
 	dbus_connection_unref(conn);
 }
 
-- 
1.7.11.7


^ permalink raw reply related

* [PATCH BlueZ 3/4] gdbus: Fix not calling dbus_connection_close for private connections
From: Luiz Augusto von Dentz @ 2012-11-19  8:46 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1353314786-11427-1-git-send-email-luiz.dentz@gmail.com>

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

dbus_bus_get_private documentation says:

  "Unlike dbus_bus_get(), always creates a new connection. This
  connection will not be saved or recycled by libdbus. Caller owns a
  reference to the bus and must either close it or know it to be closed
  prior to releasing this reference."
---
 gdbus/mainloop.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdbus/mainloop.c b/gdbus/mainloop.c
index 49e6538..4771f20 100644
--- a/gdbus/mainloop.c
+++ b/gdbus/mainloop.c
@@ -328,6 +328,7 @@ DBusConnection *g_dbus_setup_private(DBusBusType type, const char *name,
 	if (g_dbus_connect(conn, name, error))
 		return conn;
 
+	dbus_connection_close(conn);
 	dbus_connection_unref(conn);
 	return NULL;
 }
-- 
1.7.11.7


^ permalink raw reply related

* [PATCH BlueZ 2/4] gdbus: Automatically register  '/' path
From: Luiz Augusto von Dentz @ 2012-11-19  8:46 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1353314786-11427-1-git-send-email-luiz.dentz@gmail.com>

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

This makes g_dbus_setup_bus to automatically register '/' path so
user application that don't export any interface on '/' will have it
registered for ObjectManager.

Note that it is now required to call g_dbus_close before exit.
---
 gdbus/gdbus.h    |  1 +
 gdbus/mainloop.c | 55 ++++++++++++++++++++++++++++++-------------------------
 gdbus/object.c   |  2 +-
 3 files changed, 32 insertions(+), 26 deletions(-)

diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index ba49621..5056340 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -53,6 +53,7 @@ DBusConnection *g_dbus_setup_bus(DBusBusType type, const char *name,
 
 DBusConnection *g_dbus_setup_private(DBusBusType type, const char *name,
 							DBusError *error);
+void g_dbus_close(DBusConnection *connection);
 
 gboolean g_dbus_request_name(DBusConnection *connection, const char *name,
 							DBusError *error);
diff --git a/gdbus/mainloop.c b/gdbus/mainloop.c
index 099b67f..49e6538 100644
--- a/gdbus/mainloop.c
+++ b/gdbus/mainloop.c
@@ -286,27 +286,36 @@ static gboolean setup_bus(DBusConnection *conn, const char *name,
 	return TRUE;
 }
 
-DBusConnection *g_dbus_setup_bus(DBusBusType type, const char *name,
+static gboolean g_dbus_connect(DBusConnection *conn, const char *name,
 							DBusError *error)
 {
-	DBusConnection *conn;
-
-	conn = dbus_bus_get(type, error);
-
 	if (error != NULL) {
 		if (dbus_error_is_set(error) == TRUE)
-			return NULL;
+			return FALSE;
 	}
 
-	if (conn == NULL)
-		return NULL;
+	if (setup_bus(conn, name, error) == FALSE)
+		return FALSE;
 
-	if (setup_bus(conn, name, error) == FALSE) {
-		dbus_connection_unref(conn);
-		return NULL;
-	}
+	if (!g_dbus_register_interface(conn, "/", NULL, NULL, NULL, NULL, NULL,
+									NULL))
+		return FALSE;
 
-	return conn;
+	return TRUE;
+}
+
+DBusConnection *g_dbus_setup_bus(DBusBusType type, const char *name,
+							DBusError *error)
+{
+	DBusConnection *conn;
+
+	conn = dbus_bus_get(type, error);
+
+	if (g_dbus_connect(conn, name, error))
+		return conn;
+
+	dbus_connection_unref(conn);
+	return NULL;
 }
 
 DBusConnection *g_dbus_setup_private(DBusBusType type, const char *name,
@@ -316,20 +325,16 @@ DBusConnection *g_dbus_setup_private(DBusBusType type, const char *name,
 
 	conn = dbus_bus_get_private(type, error);
 
-	if (error != NULL) {
-		if (dbus_error_is_set(error) == TRUE)
-			return NULL;
-	}
-
-	if (conn == NULL)
-		return NULL;
+	if (g_dbus_connect(conn, name, error))
+		return conn;
 
-	if (setup_bus(conn, name, error) == FALSE) {
-		dbus_connection_unref(conn);
-		return NULL;
-	}
+	dbus_connection_unref(conn);
+	return NULL;
+}
 
-	return conn;
+void g_dbus_close(DBusConnection *connection)
+{
+	g_dbus_unregister_interface(connection, "/", NULL);
 }
 
 gboolean g_dbus_request_name(DBusConnection *connection, const char *name,
diff --git a/gdbus/object.c b/gdbus/object.c
index 43154f3..2a2982d 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -615,7 +615,7 @@ static struct interface_data *find_interface(GSList *interfaces,
 
 	for (list = interfaces; list; list = list->next) {
 		struct interface_data *iface = list->data;
-		if (!strcmp(name, iface->name))
+		if (g_strcmp0(name, iface->name) == 0)
 			return iface;
 	}
 
-- 
1.7.11.7


^ permalink raw reply related

* [PATCH BlueZ 1/4] gdbus: Fix having multiple path exporting ObjectManager
From: Luiz Augusto von Dentz @ 2012-11-19  8:46 UTC (permalink / raw)
  To: linux-bluetooth

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

ObjectManager should only be available on the root path so if the
current is a child of the object being registered the root should be
changed.
---
 gdbus/object.c | 35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/gdbus/object.c b/gdbus/object.c
index 3101ca6..43154f3 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -84,6 +84,8 @@ struct property_data {
 	DBusMessage *message;
 };
 
+static struct generic_data *root = NULL;
+
 static gboolean process_changes(gpointer user_data);
 static void process_properties_from_interface(struct generic_data *data,
 						struct interface_data *iface);
@@ -574,11 +576,7 @@ static void emit_interfaces_added(struct generic_data *data)
 	if (parent == NULL)
 		return;
 
-	/* Find root data */
-	while (parent->parent)
-		parent = parent->parent;
-
-	signal = dbus_message_new_signal(parent->path,
+	signal = dbus_message_new_signal(root->path,
 					DBUS_INTERFACE_OBJECT_MANAGER,
 					"InterfacesAdded");
 	if (signal == NULL)
@@ -948,11 +946,7 @@ static void emit_interfaces_removed(struct generic_data *data)
 	if (parent == NULL)
 		return;
 
-	/* Find root data */
-	while (parent->parent)
-		parent = parent->parent;
-
-	signal = dbus_message_new_signal(parent->path,
+	signal = dbus_message_new_signal(root->path,
 					DBUS_INTERFACE_OBJECT_MANAGER,
 					"InterfacesRemoved");
 	if (signal == NULL)
@@ -1008,6 +1002,9 @@ static void generic_unregister(DBusConnection *connection, void *user_data)
 	g_slist_foreach(data->objects, reset_parent, data->parent);
 	g_slist_free(data->objects);
 
+	if (root == data)
+		root = NULL;
+
 	dbus_connection_unref(data->conn);
 	g_free(data->introspect);
 	g_free(data->path);
@@ -1175,6 +1172,20 @@ static void add_interface(struct generic_data *data,
 	data->process_id = g_idle_add(process_changes, data);
 }
 
+static void set_root(struct generic_data *data)
+{
+	if (root != NULL) {
+		data->objects = g_slist_prepend(data->objects, root);
+		root->parent = data;
+		remove_interface(root, DBUS_INTERFACE_OBJECT_MANAGER);
+	}
+
+	add_interface(data, DBUS_INTERFACE_OBJECT_MANAGER,
+					manager_methods, manager_signals,
+					NULL, data, NULL);
+	root = data;
+}
+
 static struct generic_data *object_path_ref(DBusConnection *connection,
 							const char *path)
 {
@@ -1209,9 +1220,7 @@ static struct generic_data *object_path_ref(DBusConnection *connection,
 
 	/* Only root path export ObjectManager interface */
 	if (data->parent == NULL)
-		add_interface(data, DBUS_INTERFACE_OBJECT_MANAGER,
-					manager_methods, manager_signals,
-					NULL, data, NULL);
+		set_root(data);
 
 	add_interface(data, DBUS_INTERFACE_PROPERTIES, properties_methods,
 					properties_signals, NULL, data, NULL);
-- 
1.7.11.7


^ permalink raw reply related

* Bluez/Obexd upstream test result_20121102(bluez-4.101.851+ obexd-0.47.69)
From: Li, XiaX @ 2012-11-19  8:36 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]

Hi all,

QA finished upstream testing. The test is for bluez-4.101.851 and obexd-0.47.69. Against last, BlueZ is changed from 4.101.767 to 4.101.851, Obexd is changed from 0.47.67 to 0.47.69.
In this test, totally ran 100 case: 72 Pass, 10 Fail. Other 18 are blocked or unavailable (some cases validation method is still in investigating). The pass rate is 88% (pass / <pass + fail>). Ofono has not caught up with the BlueZ API changing in HFP profile.

New bugs:
===============================================
No

Re-open bugs:
===============================================
No

Verified bugs:
===============================================
No

Testing Environment
==============================================
Hardware:  netbook Eeepc 1005HA | Acer AspireOne NAV50
Image:     netbook-ia32-pinetrail-tizen_20120424.2
Linux Kernel: v3.4-rc7
bluez-4.101.851.gce084da-1.1.i586
obexd-0.47.69.gb10bcae-1.1.i586
obexd-server-0.47.69.gb10bcae-1.1.i586
connman-1.9.19.gf5d62e4-1.1.i586
ofono-1.11-1.i686
Pulseaudio: 67602d8743e8e529919bb9fbb956aa77724a8e50 (oct, 6th)

For detailed test results, please see attached file.

Thanks
Li Xia


[-- Attachment #2: Bluetooth_upstream_quality_20121119.txt --]
[-- Type: text/plain, Size: 7550 bytes --]

== Detail Result ==
[PASS]: case passed <br>
[FAIL]: case failed <br>
[Block]: case is blocked by one bug <br>
[N/A]: case not available to be tested

=== Audio-A2DP ===
  [PASS] A2DP_001: audio sink connect/re-connect 
  [PASS] A2DP_002: stereo headset playback 
  [PASS] A2DP_003: stereo headset voice record 
  [PASS] A2DP_004: Codec support: SBC 
  [PASS] A2DP_005: Playback music on line
  [PASS] A2DP_006: SINK role, as speaker for other device music playing
    With some BT headset, we ever met issue [https://bugs.meego.com/show_bug.cgi?id=25480 Bug#25480 A2DP-source: pulseaudio fails to create bluez_sink and bluez_source]

=== Audio-AVRCP ===
  [PASS] AVRCP_001: Volume Up/Down
  [Block] AVRCP_002: Play/Pause (by unavailable media-player)
  [Block] AVRCP_003: Next/Privious (by unavailable media-player)
  [PASS] AVRCP_004: Connection Establish/Release
  [N/A] AVRCP_005: Audio metadata get.
    We still try to find avaliable media-player to support AVRCP-1.4

=== Audio-HFP ===
    Ofono needs to update its API, since BlueZ already took the changes. Here is bug [https://bugs.meego.com/show_bug.cgi?id=25748 Bug#25748 HFP: Ofono List-modems shows no modem after paired with phone]
  [FAIL] HFP_001: RFCOMM connection on AG
    Need install sbc for latest pulseaudio 
  [FAIL] HFP_002: list (ofono) hfp modem 
  [FAIL] HFP_003: HFP modem establishment (Ofono)
  [FAIL] HFP_004: Audio SNK and SRC establishment  
  [FAIL] HFP_005: voicecall, audio creates BT SNK/SRC 
  [FAIL] HFP_006: redirect AG SNK/SRC to local SRC/SNK
    BlueZ interface has some regression, bug is reported as [https://bugs.meego.com/show_bug.cgi?id=25473 Bug#25473 HFP: latest bluez cannot support pulseaudio to create bluez_sink and bluez_source]
    Pulseaudio has new crash bug: [https://bugs.meego.com/show_bug.cgi?id=25593 Bug#25593 Pulseaudio crashes after connect BT sink to alsa source]  
  [FAIL] HFP_007: Check AT-commands from HF part
  [FAIL] HFP_008: Connect BT Headset to HFP phone

=== Audio-HSP ===
  [PASS] HSP_001: Use mono headset to play music
  *** DUT is a Netbook, unable to take phone ***
  [N/A] HSP_002: Take incoming call by button-press
  [N/A] HSP_003: Audio transfer between AG and HS
  [PASS] HSP_004: Adjust Volume Up/Down

=== OBEX-FTP ===
  [PASS] FTP_001: pull/push files from/to server.
  [PASS] FTP_002: browse server files 
  [PASS] FTP_003: Client "delete file", "rename file"
  [PASS] FTP_004: Server enables FTP parameter  
  [PASS] FTP_005: Server sets sharing root path
  [PASS] FTP_006: Server handles all requirements
  [PASS] FTP_007: Server has ability to set permission for FTP
  [PASS] FTP_008: FTP data-rate about 30k/s~230k/s
  [PASS] FTP_009: Big size file transferred stable

=== OBEX-OPP ===
  [PASS] OPP_001: pull un-patterned object from server. 
  [PASS] OPP_002: Server enables OPP parameter
  [PASS] OPP_003: During object transferring, the progress is clear

=== OBEX-PBAP ===
  [PASS] PBAP_001: Client gets phone book entries from server
  [PASS] PBAP_002: Client gets ICH, OCH, MCH and CCH from server
  [FAIL] PBAP_003: PSE can provide PBAP daemon by enabling corresponding parameter
  Case failed due to [https://bugs.meego.com/show_bug.cgi?id=25598 Bug#25598, PBAP server fails to open /telecom/pb.vcf file]
  [PASS] PBAP_004: Both sides support vCard2.1/vCard3.0

=== OBEX-SYNC ===
  [PASS] SYNC_001: Server enables SYNC daemon
  [PASS] SYNC_002: During sync, Server can show "syncing..."
  [PASS] SYNC_003: client can set PIM fetching from INT
  [PASS] SYNC_004: Server get/put entire phonebook from/to client. 
  [PASS] SYNC_005: Client can support vCard2.1, vCard3.0

=== OBEX-MAP MCE ===
  [FAIL] MAP_001: MCE can browse message/folder list on MSE 
    Regression happened on client side, bug is reported as [https://bugs.meego.com/show_bug.cgi?id=25595 Bug#25595 MAP client fail to get message list from Samsung GT-i9100]
  [BLOCK] MAP_002: MCE can upload local message to MSE
  [BLOCK] MAP_003: MCE can delete the message on MSE side
  [BLOCK] MAP_004: MCE can take use of MSE to send message

=== Network-PAN ===
  [PASS] PAN_001: PANU can init nap0 device connect to NAP
  [PASS] PAN_002: PANU can get ip address or assigned static ip
  [PASS] PAN_003: PANU can logon internet website 
  [N/A] PAN_004: NAP can init bridge bnep 
  [N/A] PAN_005: NAP can support one or multiple PANU connection
  [N/A] PAN_006: NAP can have DHCP responding to each PANU
  Current connman does not support DHCP functions.

=== Network-BNEP ===
  [PASS] BNEP_001: Check BNEP support on DUT

=== Network-DUN ===
  [PASS] DUN_001: GW (DUT) can parse a series of AT commands from the data terminal. 
  [PASS] DUN_002: DT can build up rfcomm device by bluetooth and DUN modem by Ofono.
  [PASS] DUN_003: DT can use Ofono to dial up special service number ("*99#").
  [PASS] DUN_004: When network connected, DT can log on website in internet.

=== SIM-SAP ===
  The SAP test method is still in investigation. 
  [N/A] SAP_001: Server can enable a module to register Client
  [N/A] SAP_002: Server can power on/off SIM Card or reset it 
  [N/A] SAP_003: Server can disconnect Client  
  [N/A] SAP_004: Server can disconnect SIM
  [N/A] SAP_005: Client can connect to Server SIM
  [N/A] SAP_006: Client can power on Server SIM
  [N/A] SAP_007: Client can disconnect Server

=== Generic-GAP ===
  [PASS] GAP_001: PSCAN/ISCAN mode setting.
  [PASS] GAP_002: Active pairing to another bluetooth device.
  [PASS] GAP_003: Passive pairing, accepte pair master requirement
  [PASS] GAP_004: SSP supports 
  [PASS] GAP_005: If lost link-key, it needs re-pair 
  [PASS] GAP_006: reboot DUT with link-key restored, no need to re-pair 
  [PASS] GAP_007: Pair can be released

=== Generic-SDP ===
  [PASS] SDP_001: browse available service list in local
  [PASS] SDP_002: browse available service list from remote
  [PASS] SDP_003: browse service by RecHandle for detail info
  [PASS] SDP_004: Server can answer SDP searching request
  [PASS] SDP_005: Server can add/del/update service records

=== Others-HID ===
  [PASS] HID_001: Host can search nearby HID device.
  [PASS] HID_002: [BAT] Host can connect to HID device.
  [PASS] HID_003: Host can handle multiple human input/output devices.

=== HCI ===
  [PASS] HCI_001: Build hci connection between Dev_A and Dev_B.
  [PASS] HCI_002: Receive ACL data with HCI.
  [PASS] HCI_003: Send ACL data with HCI.
  [PASS] HCI_004: Change name of remote Dev by HCI.
  [PASS] HCI_005: Change class of remote Dev by HCI.
  [PASS] HCI_006: Read local HCI controller information.
  [PASS] HCI_007: Read remote HCI controller information.

=== L2CAP ===
  [PASS] L2CAP_001: Build l2cap connection between Dev_A and Dev_B.  
  [PASS] L2CAP_002: Dev_A and Dev_B take l2cap protocol to do pingpong.

=== RFCOMM ===
  [PASS] RFCOMM_001: Build rfcomm connection between Dev_A and Dev_B.  
  [PASS] RFCOMM_002: Dev_A and Dev_B take rfcomm protocol to do pingpong.

=== Settings ===
  [PASS] SET_001: [BAT] No error output during bluetoothd startup process.

=== Bluetooth Utils ===
Some basic checking for hciconfig, hcitool, sdptool commands. 
  [PASS] BTCMD_001: hciconfig -a
  [PASS] BTCMD_002: hciconfig <adapter> piscan
  [PASS] BTCMD_003: hciconfig <adapter> up/down  
  [PASS] BTCMD_004: hcitool scan
  [PASS] BTCMD_005: sdptool browse local
  [PASS] BTCMD_006: sdptool browse <ermote MAC>
  [PASS] BTCMD_007: sdptool add/del

^ permalink raw reply

* Re: [PATCH v4 09/16] sbc: Use simd primitive if doing msbc on neon
From: Siarhei Siamashka @ 2012-11-18 23:46 UTC (permalink / raw)
  To: frederic.dalleau; +Cc: linux-bluetooth
In-Reply-To: <50A4C2BF.3050807@linux.intel.com>

On Thu, 15 Nov 2012 11:23:59 +0100
Frédéric Dalleau <frederic.dalleau@linux.intel.com> wrote:

> Hi,
> On 11/14/2012 08:27 PM, Siarhei Siamashka wrote:
> > On Tue, 30 Oct 2012 10:39:28 +0100
> >> +	if (state->increment == 1)
> >> +		state->sbc_analyze_8s = sbc_analyze_1b_8s_simd;
> >>   #endif
> >>   }
> >
> > This is not enough. As I commented earlier in
> >      http://permalink.gmane.org/gmane.linux.bluez.kernel/31567
> >
> > "neon code also provides optimized "sbc_enc_process_input_*" functions,
> > which are not going to work correctly for mSBC:
> >
> > 	state->sbc_enc_process_input_8s_le = sbc_enc_process_input_8s_le_neon;
> > 	state->sbc_enc_process_input_8s_be = sbc_enc_process_input_8s_be_neon;"
> 
> Indeed, this is a mistake :
> I wanted to use the neon analysis in conjonction with simd input processing.
> 
> Instead, the patch would look like this :
> + if (state->increment == 1) {
> + 	state->sbc_enc_process_input_8s_be = 	
> +					sbc_enc_process_input_8s_be;
> +	state->sbc_enc_process_input_8s_le =
> +					sbc_enc_process_input_8s_le;
> + }
> Damned it is 82 chars long!
> 
> Unfortunately I can't test this one. I can't even build it. I could but 
> that's gonna take a lot of time.

I can test the patches on ARM. But what I'm asking is just to restore
*all* function pointers (not state->sbc_analyze_8s alone) to C
implementations for ARM NEON in the case if "state->increment == 1".
This minor modification should be enough.

Also building and testing is not too difficult when having an arm
crosscompiler (I believe ubuntu even has it packaged) and qemu. The
whole process may look like this:

$ apt-get install qemu-user
$ apt-get install gcc-arm-linux-gnueabihf
$ arm-linux-gnueabihf-gcc -O2 -march=armv7-a -mfpu=neon \
          -static -I. -DVERSION=\"\" \
          -o sbcenc src/sbcenc.c sbc/*.c
$ qemu-arm -cpu cortex-a8 ./sbcenc test.au > test.sbc

-- 
Best regards,
Siarhei Siamashka

^ permalink raw reply

* Re: [PATCH BlueZ] audio: Bump A2DP version to 1.03
From: Johan Hedberg @ 2012-11-16 14:22 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1353071513-32182-1-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Fri, Nov 16, 2012, Luiz Augusto von Dentz wrote:
> In addition remove support of setting DelayReporting in audio.conf as
> it should always be supported in the service record since it doesn't
> mean the endpoint must support it because it is actually negotiated
> during the stream configuration.
> ---
>  profiles/audio/a2dp.c  | 19 ++++---------------
>  profiles/audio/avdtp.c | 20 +++-----------------
>  profiles/audio/avdtp.h |  2 +-
>  3 files changed, 8 insertions(+), 33 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply

* Re: [RFC v1 03/16] manager: Extend FindAdapter with "default" pattern
From: Luiz Augusto von Dentz @ 2012-11-16 13:29 UTC (permalink / raw)
  To: Mikel Astiz; +Cc: linux-bluetooth@vger.kernel.org, Mikel Astiz
In-Reply-To: <1352992159-11559-4-git-send-email-mikel.astiz.oss@gmail.com>

Hi Mikel,

On Thu, Nov 15, 2012 at 5:09 PM, Mikel Astiz <mikel.astiz.oss@gmail.com> wrote:
> From: Mikel Astiz <mikel.astiz@bmw-carit.de>
>
> Extend the supported values in the given pattern in order to return the
> default adapter if "default" is given.
> ---
>  doc/manager-api.txt | 1 +
>  src/manager.c       | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/doc/manager-api.txt b/doc/manager-api.txt
> index 8497141..b0d534d 100644
> --- a/doc/manager-api.txt
> +++ b/doc/manager-api.txt
> @@ -27,6 +27,7 @@ Object path   /
>                         patterns are "hci0" or "00:11:22:33:44:55". Other
>                         supported values are:
>                                 "any"
> +                               "default"
>
>                         Possible errors: org.bluez.Error.InvalidArguments
>                                          org.bluez.Error.NoSuchAdapter
> diff --git a/src/manager.c b/src/manager.c
> index 3088dd9..79d049b 100644
> --- a/src/manager.c
> +++ b/src/manager.c
> @@ -110,7 +110,9 @@ static DBusMessage *find_adapter(DBusConnection *conn,
>         } else if (!strncmp(pattern, "hci", 3) && strlen(pattern) >= 4) {
>                 dev_id = atoi(pattern + 3);
>                 adapter = manager_find_adapter_by_id(dev_id);
> -       } else {
> +       } else if (!strcmp(pattern, "default"))
> +               adapter = manager_find_adapter_by_id(default_adapter_id);
> +       else {
>                 bdaddr_t bdaddr;
>                 str2ba(pattern, &bdaddr);
>                 adapter = manager_find_adapter(&bdaddr);
> --
> 1.7.11.7

Hmm, I though we would have a property e.g. DefaultAdapter because
with ObjectManager you also get the properties so once you do
GetManagedObjects you discover what is the default one. It could also
be a property of the Adapter interface e.g. boolean Default but if it
changes we actually have to emit 2 signals so it would no be an atomic
operation as it should be.


--
Luiz Augusto von Dentz

^ permalink raw reply

* [PATCH BlueZ] audio: Bump A2DP version to 1.03
From: Luiz Augusto von Dentz @ 2012-11-16 13:11 UTC (permalink / raw)
  To: linux-bluetooth

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

In addition remove support of setting DelayReporting in audio.conf as
it should always be supported in the service record since it doesn't
mean the endpoint must support it because it is actually negotiated
during the stream configuration.
---
 profiles/audio/a2dp.c  | 19 ++++---------------
 profiles/audio/avdtp.c | 20 +++-----------------
 profiles/audio/avdtp.h |  2 +-
 3 files changed, 8 insertions(+), 33 deletions(-)

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 7799420..50c0f43 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -109,7 +109,6 @@ struct a2dp_server {
 	GSList *sources;
 	uint32_t source_record_id;
 	uint32_t sink_record_id;
-	uint16_t version;
 	gboolean sink_enabled;
 	gboolean source_enabled;
 };
@@ -1087,7 +1086,7 @@ static struct avdtp_sep_ind endpoint_ind = {
 	.delayreport		= endpoint_delayreport_ind,
 };
 
-static sdp_record_t *a2dp_record(uint8_t type, uint16_t avdtp_ver)
+static sdp_record_t *a2dp_record(uint8_t type)
 {
 	sdp_list_t *svclass_id, *pfseq, *apseq, *root;
 	uuid_t root_uuid, l2cap_uuid, avdtp_uuid, a2dp_uuid;
@@ -1096,7 +1095,7 @@ static sdp_record_t *a2dp_record(uint8_t type, uint16_t avdtp_ver)
 	sdp_record_t *record;
 	sdp_data_t *psm, *version, *features;
 	uint16_t lp = AVDTP_UUID;
-	uint16_t a2dp_ver = 0x0102, feat = 0x000f;
+	uint16_t a2dp_ver = 0x0103, avdtp_ver = 0x0103, feat = 0x000f;
 
 	record = sdp_record_alloc();
 	if (!record)
@@ -1170,7 +1169,6 @@ static struct a2dp_server *find_server(GSList *list, const bdaddr_t *src)
 int a2dp_register(const bdaddr_t *src, GKeyFile *config)
 {
 	gboolean source = TRUE, sink = FALSE;
-	gboolean delay_reporting = FALSE;
 	char *str;
 	GError *err = NULL;
 	struct a2dp_server *server;
@@ -1212,7 +1210,7 @@ proceed:
 
 		server = g_new0(struct a2dp_server, 1);
 
-		av_err = avdtp_init(src, config, &server->version);
+		av_err = avdtp_init(src, config);
 		if (av_err < 0) {
 			g_free(server);
 			return av_err;
@@ -1222,15 +1220,6 @@ proceed:
 		servers = g_slist_append(servers, server);
 	}
 
-	if (config)
-		delay_reporting = g_key_file_get_boolean(config, "A2DP",
-						"DelayReporting", NULL);
-
-	if (delay_reporting)
-		server->version = 0x0103;
-	else
-		server->version = 0x0102;
-
 	server->source_enabled = source;
 
 	server->sink_enabled = sink;
@@ -1341,7 +1330,7 @@ struct a2dp_sep *a2dp_add_sep(const bdaddr_t *src, uint8_t type,
 	if (*record_id != 0)
 		goto add;
 
-	record = a2dp_record(type, server->version);
+	record = a2dp_record(type);
 	if (!record) {
 		error("Unable to allocate new service record");
 		avdtp_unregister_sep(sep->lsep);
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 75b81fe..e38c95b 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -331,7 +331,6 @@ struct avdtp_remote_sep {
 
 struct avdtp_server {
 	bdaddr_t src;
-	uint16_t version;
 	GIOChannel *io;
 	GSList *seps;
 	GSList *sessions;
@@ -1392,9 +1391,6 @@ static gboolean avdtp_getcap_cmd(struct avdtp *session, uint8_t transaction,
 		goto failed;
 	}
 
-	if (get_all && session->server->version < 0x0103)
-		return avdtp_unknown_cmd(session, transaction, cmd);
-
 	if (!sep->ind->get_capability(session, sep, get_all, &caps,
 							&err, sep->user_data))
 		goto failed;
@@ -2785,7 +2781,7 @@ static gboolean avdtp_discover_resp(struct avdtp *session,
 	int ret = 0;
 	gboolean getcap_pending = FALSE;
 
-	if (session->version >= 0x0103 && session->server->version >= 0x0103)
+	if (session->version >= 0x0103)
 		getcap_cmd = AVDTP_GET_ALL_CAPABILITIES;
 	else
 		getcap_cmd = AVDTP_GET_CAPABILITIES;
@@ -3717,8 +3713,7 @@ int avdtp_delay_report(struct avdtp *session, struct avdtp_stream *stream,
 				stream->lsep->state != AVDTP_STATE_STREAMING)
 		return -EINVAL;
 
-	if (!stream->delay_reporting || session->version < 0x0103 ||
-					session->server->version < 0x0103)
+	if (!stream->delay_reporting || session->version < 0x0103)
 		return -EINVAL;
 
 	stream->delay = delay;
@@ -3868,12 +3863,11 @@ void avdtp_get_peers(struct avdtp *session, bdaddr_t *src, bdaddr_t *dst)
 		bacpy(dst, &session->dst);
 }
 
-int avdtp_init(const bdaddr_t *src, GKeyFile *config, uint16_t *version)
+int avdtp_init(const bdaddr_t *src, GKeyFile *config)
 {
 	GError *err = NULL;
 	gboolean tmp, master = TRUE;
 	struct avdtp_server *server;
-	uint16_t ver = 0x0102;
 
 	if (!config)
 		goto proceed;
@@ -3893,17 +3887,9 @@ int avdtp_init(const bdaddr_t *src, GKeyFile *config, uint16_t *version)
 	else
 		auto_connect = tmp;
 
-	if (g_key_file_get_boolean(config, "A2DP", "DelayReporting", NULL))
-		ver = 0x0103;
-
 proceed:
 	server = g_new0(struct avdtp_server, 1);
 
-	server->version = ver;
-
-	if (version)
-		*version = server->version;
-
 	server->io = avdtp_server_socket(src, master);
 	if (!server->io) {
 		g_free(server);
diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h
index 7b330b9..cdf39bf 100644
--- a/profiles/audio/avdtp.h
+++ b/profiles/audio/avdtp.h
@@ -309,5 +309,5 @@ void avdtp_get_peers(struct avdtp *session, bdaddr_t *src, bdaddr_t *dst);
 gboolean avdtp_stream_setup_active(struct avdtp *session);
 void avdtp_set_device_disconnect(struct avdtp *session, gboolean dev_dc);
 
-int avdtp_init(const bdaddr_t *src, GKeyFile *config, uint16_t *version);
+int avdtp_init(const bdaddr_t *src, GKeyFile *config);
 void avdtp_exit(const bdaddr_t *src);
-- 
1.7.11.7


^ permalink raw reply related

* Hard freeze after 'rfkill block bluetooth'
From: Jiri Kosina @ 2012-11-16 12:47 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: linux-bluetooth, linux-kernel, linux-usb

Hi,

I got a hard freeze with HEAD at 1b42fc4 (i.e. past -rc4) after running 
rfkill block bluetooth.

Screen capture can be found at

	http://www.jikos.cz/jikos/junk/IMAG0264.jpg

(sorry for the bad picture quality, but I believe it's readable).

I am not able to reproduce it again.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply

* Re: [RFC] Bluetooth: Add BT_DEFER_SETUP option to sco socket
From: Frédéric Dalleau @ 2012-11-16 12:10 UTC (permalink / raw)
  To: Gustavo Padovan, linux-bluetooth
In-Reply-To: <20121115203029.GA2026@joana>

Hi Gustavo,

On 11/15/2012 09:30 PM, Gustavo Padovan wrote:
>>   	mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type);
>> +	defered = hci_proto_defered(hdev, &ev->bdaddr, ev->link_type);
>
> I'm not really happy with this hci_proto thing. Weed need to think more on
> this.

Since hci_proto_connect_ind returns an int, what about using 16 bits for
HCI_LM_* flags, and 16 bits for additional flags (from hci_core.h), 
including one to indicate deferred setup.

Frédéric

^ permalink raw reply

* [PATCH v2] neard: Set device class in device object
From: Frédéric Danis @ 2012-11-16  9:35 UTC (permalink / raw)
  To: linux-bluetooth

As soon as we have info related to a new device,
device object will be created if it does not exist yet.
So removing adapter_remove_device().
---
 plugins/neard.c |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/plugins/neard.c b/plugins/neard.c
index 8f8381c..ff754c3 100644
--- a/plugins/neard.c
+++ b/plugins/neard.c
@@ -39,7 +39,6 @@
 #include "manager.h"
 #include "device.h"
 #include "eir.h"
-#include "storage.h"
 #include "agent.h"
 #include "hcid.h"
 #include "event.h"
@@ -267,30 +266,30 @@ static int process_eir(struct btd_adapter *adapter, uint8_t *eir, size_t size,
 
 	DBG("hci%u remote:%s", adapter_get_dev_id(adapter), remote_address);
 
-	device = adapter_find_device(adapter, remote_address);
+	device = adapter_get_device(adapter, remote_address);
+	if (!device) {
+		DBG("failed to create device object");
+		eir_data_free(&eir_data);
+		return -ENOMEM;
+	}
 
 	/* If already paired do nothing */
-	if (device && device_is_paired(device)) {
+	if (device_is_paired(device)) {
 		DBG("already paired");
 		eir_data_free(&eir_data);
 		return 1;
 	}
 
 	/* Pairing in progress... */
-	if (device && device_is_bonding(device, NULL)) {
+	if (device_is_bonding(device, NULL)) {
 		DBG("pairing in progress");
 		eir_data_free(&eir_data);
 		return -EINPROGRESS;
 	}
 
-	/* If we have unpaired device hanging around, purge it */
-	if (device)
-		adapter_remove_device(adapter, device, TRUE);
-
 	/* store OOB data */
 	if (eir_data.class != 0)
-		write_remote_class(adapter_get_address(adapter),
-					&eir_data.addr, eir_data.class);
+		device_set_class(device, eir_data.class);
 
 	/* TODO handle incomplete name? */
 	if (eir_data.name)
-- 
1.7.9.5


^ permalink raw reply related

* Re: [PATCH 8/8] neard: Set device class in device object
From: Johan Hedberg @ 2012-11-16  8:24 UTC (permalink / raw)
  To: Frédéric Danis; +Cc: linux-bluetooth
In-Reply-To: <1353000701-16605-8-git-send-email-frederic.danis@linux.intel.com>

Hi Frédéric,

On Thu, Nov 15, 2012, Frédéric Danis wrote:
> This will create a new device object and generate DeviceCreated signal
> ---
>  plugins/neard.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Your commit message doesn't explain why the old object needs to be
removed (imo it shouldn't need to be removed).

The other patches in this set have been applied.

> +	device = adapter_get_device(adapter, remote_address);
> +
>  	/* store OOB data */

Missing check for failed adapter_get_device() return (NULL).

Johan

^ permalink raw reply

* Re: [PATCH BlueZ 2/2] gdbus: Replace leading spaces with tabs
From: Johan Hedberg @ 2012-11-16  8:07 UTC (permalink / raw)
  To: Syam Sidhardhan; +Cc: linux-bluetooth
In-Reply-To: <1351000626-22632-2-git-send-email-s.syam@samsung.com>

Hi Syam,

On Tue, Oct 23, 2012, Syam Sidhardhan wrote:
> Trivial formatting fix.
> ---
>  gdbus/object.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)

This patch has been applied. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH BlueZ 2/2] l2test: Add support to test auto select PSM
From: Johan Hedberg @ 2012-11-16  8:05 UTC (permalink / raw)
  To: Syam Sidhardhan; +Cc: linux-bluetooth
In-Reply-To: <1352449889-5149-2-git-send-email-s.syam@samsung.com>

Hi Syam,

On Fri, Nov 09, 2012, Syam Sidhardhan wrote:
> This patch enable us to test the auto select PSM by passing
> PSM value as 0.
> 
> Ex: l2test -d -P 0
> l2test[2585]: Waiting for connection on psm 4099 ...
> ---
>  test/l2test.c |    4 +---
>  1 files changed, 1 insertions(+), 3 deletions(-)
> 
> diff --git a/test/l2test.c b/test/l2test.c
> index 7645681..72ad4ba 100644
> --- a/test/l2test.c
> +++ b/test/l2test.c
> @@ -87,7 +87,7 @@ static long buffer_size = 2048;
>  
>  /* Default addr and psm and cid */
>  static bdaddr_t bdaddr;
> -static unsigned short psm = 0x1011;
> +static unsigned short psm = 0;
>  static unsigned short cid = 0;
>  
>  /* Default number of frames to send (-1 = infinite) */
> @@ -375,8 +375,6 @@ static int do_connect(char *svr)
>  		addr.l2_cid = htobs(cid);
>  	else if (psm)
>  		addr.l2_psm = htobs(psm);
> -	else
> -		goto error;
>  
>  	if (connect(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0 ) {
>  		syslog(LOG_ERR, "Can't connect: %s (%d)",

At least the second chunk is for the initiating (client) part, not the
server (which the commit message implies you're dealing with). There's
no "auto select" for the client.

Johan

^ permalink raw reply

* Re: [RFC 2/4] Bluetooth: Fix sending L2CAP Create Chan Req
From: Marcel Holtmann @ 2012-11-15 23:56 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1352996096-27374-2-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

> When receiving Physical Link Completed event we need to create L2CAP
> channel with L2CAP Create Chan Request. Current code was sending
> this command only if connection was pending (which is probably
> needed in channel move case). If channel is not moved but created
> Create Chan should be sent for outgoing channel which is checked
> with BT_CONNECT flag.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/l2cap_core.c |   29 ++++++++++++++++++-----------
>  1 file changed, 18 insertions(+), 11 deletions(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply

* Re: [RFC 4/4] Bluetooth: Set local_amp_id after getting Phylink Completed evt
From: Marcel Holtmann @ 2012-11-15 23:54 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1352996096-27374-4-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

> local_amp_id is used in l2cap_physical_cfm and shall be set up
> before calling it.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/amp.c |    1 +
>  1 file changed, 1 insertion(+)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply

* Re: [RFC 3/4] Bluetooth: Remove unneeded local_amp_id initialization
From: Marcel Holtmann @ 2012-11-15 23:53 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1352996096-27374-3-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

> local_amp_id is already set in l2cap_connect() which is called several
> lines above.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  net/bluetooth/l2cap_core.c |    1 -
>  1 file changed, 1 deletion(-)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



^ permalink raw reply


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