* Re: [PATCH 1/3] android: Add support for handling get properties commands
From: Johan Hedberg @ 2013-11-04 19:19 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth
In-Reply-To: <1383579265-24614-1-git-send-email-szymon.janc@tieto.com>
Hi Szymon,
On Mon, Nov 04, 2013, Szymon Janc wrote:
> When this commands is received all properties shall be reported to HAL.
> ---
> android/adapter.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
This patch doesn't compile:
CC android/adapter.o
android/adapter.c: In function ‘get_properties’:
android/adapter.c:1125:2: error: implicit declaration of function ‘send_adapter_address’ [-Werror=implicit-function-declaration]
send_adapter_address();
^
cc1: all warnings being treated as errors
make[1]: *** [android/adapter.o] Error 1
Johan
^ permalink raw reply
* Re: [PATCHv3 1/4] android/daemon: Implement get adapter name
From: Johan Hedberg @ 2013-11-04 19:18 UTC (permalink / raw)
To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1383571358-4942-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
On Mon, Nov 04, 2013, Andrei Emeltchenko wrote:
> Use adapter_name_changed for get_property call.
> ---
> android/adapter.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
All four patches have been applied. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH] android/client: Fix annoying delay in command line
From: Johan Hedberg @ 2013-11-04 19:15 UTC (permalink / raw)
To: Jerzy Kasenberg; +Cc: linux-bluetooth
In-Reply-To: <1383564824-32337-1-git-send-email-jerzy.kasenberg@tieto.com>
Hi Jerzy,
On Mon, Nov 04, 2013, Jerzy Kasenberg wrote:
> Move fflush(stdout) to after prints and user input.
> This removes delay of showing prompt.
> ---
> Same effect could be achieved by calling setbuf(stdout, NULL)
> in terminal_setup() then all fflush calls could be removed.
>
> If you think this should be better approach, I will change it.
>
> android/client/pollhandler.c | 5 -----
> android/client/terminal.c | 6 ++++++
> 2 files changed, 6 insertions(+), 5 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH] android/client: Change interface name to bluetooth
From: Johan Hedberg @ 2013-11-04 19:14 UTC (permalink / raw)
To: Jerzy Kasenberg; +Cc: linux-bluetooth
In-Reply-To: <1383564579-32025-1-git-send-email-jerzy.kasenberg@tieto.com>
Hi Jerzy,
On Mon, Nov 04, 2013, Jerzy Kasenberg wrote:
> This changes 'adapter' to 'bluetooth' as name of HAL interface.
> This name matches name fond in bluetooth.h where all interfaces
> are defined.
> ---
> android/client/if-bt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH BlueZ 1/4] android: Add initial skeleton for a2dp in the daemon
From: Johan Hedberg @ 2013-11-04 19:13 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1383562617-9029-1-git-send-email-luiz.dentz@gmail.com>
Hi Luiz,
On Mon, Nov 04, 2013, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> ---
> android/Android.mk | 1 +
> android/Makefile.am | 1 +
> android/a2dp.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> android/a2dp.h | 25 ++++++++++++++++++++++++
> android/main.c | 9 +++++++++
> 5 files changed, 92 insertions(+)
> create mode 100644 android/a2dp.c
> create mode 100644 android/a2dp.h
All four patches have been applied. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH v2] hid2hci: fix regression in /dev format after moving away from libusb
From: Johan Hedberg @ 2013-11-04 18:11 UTC (permalink / raw)
To: Giovanni Campagna; +Cc: linux-bluetooth
In-Reply-To: <1380798229-4319-1-git-send-email-scampa.giovanni@gmail.com>
Hi Giovanni,
On Thu, Oct 03, 2013, Giovanni Campagna wrote:
> The paths under /dev, in the default udev configuration, are formatted
> with two leading zeros, but the number obtained from sysfs don't have
> them, so we must convert them to integers and reformat them.
> ---
> tools/hid2hci.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply
* [PATCH 2/2] Bluetooth: Refactor hci_disconn_complete_evt
From: Andre Guedes @ 2013-11-04 17:57 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1383587847-16523-1-git-send-email-andre.guedes@openbossa.org>
hci_disconn_complete_evt() logic is more complicated than what it
should be, making it hard to follow and add new features.
So this patch does some code refactoring by handling the error cases
in the beginning of the function and by moving the main flow into the
first level of function scope. No change is done in the event handling
logic itself.
Besides organizing this messy code, this patch makes easier to add
code for handling LE auto connection (which will be added in a further
patch).
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
net/bluetooth/hci_event.c | 53 +++++++++++++++++++++++------------------------
1 file changed, 26 insertions(+), 27 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 560296d..8054e3c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1779,7 +1779,9 @@ static u8 hci_to_mgmt_reason(u8 err)
static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_ev_disconn_complete *ev = (void *) skb->data;
+ u8 reason = hci_to_mgmt_reason(ev->reason);
struct hci_conn *conn;
+ u8 type;
BT_DBG("%s status 0x%2.2x", hdev->name, ev->status);
@@ -1789,40 +1791,37 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
if (!conn)
goto unlock;
- if (ev->status == 0)
- conn->state = BT_CLOSED;
-
if (ev->status) {
mgmt_disconnect_failed(hdev, &conn->dst, conn->type,
conn->dst_type, ev->status);
- } else {
- u8 reason = hci_to_mgmt_reason(ev->reason);
-
- mgmt_device_disconnected(hdev, &conn->dst, conn->type,
- conn->dst_type, reason);
+ goto unlock;
}
- if (ev->status == 0) {
- u8 type = conn->type;
+ conn->state = BT_CLOSED;
- if (type == ACL_LINK && conn->flush_key)
- hci_remove_link_key(hdev, &conn->dst);
- hci_proto_disconn_cfm(conn, ev->reason);
- hci_conn_del(conn);
+ mgmt_device_disconnected(hdev, &conn->dst, conn->type,
+ conn->dst_type, reason);
- /* Re-enable advertising if necessary, since it might
- * have been disabled by the connection. From the
- * HCI_LE_Set_Advertise_Enable command description in
- * the core specification (v4.0):
- * "The Controller shall continue advertising until the Host
- * issues an LE_Set_Advertise_Enable command with
- * Advertising_Enable set to 0x00 (Advertising is disabled)
- * or until a connection is created or until the Advertising
- * is timed out due to Directed Advertising."
- */
- if (type == LE_LINK)
- mgmt_reenable_advertising(hdev);
- }
+ if (conn->type == ACL_LINK && conn->flush_key)
+ hci_remove_link_key(hdev, &conn->dst);
+
+ type = conn->type;
+
+ hci_proto_disconn_cfm(conn, ev->reason);
+ hci_conn_del(conn);
+
+ /* Re-enable advertising if necessary, since it might
+ * have been disabled by the connection. From the
+ * HCI_LE_Set_Advertise_Enable command description in
+ * the core specification (v4.0):
+ * "The Controller shall continue advertising until the Host
+ * issues an LE_Set_Advertise_Enable command with
+ * Advertising_Enable set to 0x00 (Advertising is disabled)
+ * or until a connection is created or until the Advertising
+ * is timed out due to Directed Advertising."
+ */
+ if (type == LE_LINK)
+ mgmt_reenable_advertising(hdev);
unlock:
hci_dev_unlock(hdev);
--
1.8.4
^ permalink raw reply related
* [PATCH 1/2] Bluetooth: Remove unneeded check in hci_disconn_complete_evt()
From: Andre Guedes @ 2013-11-04 17:57 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1383587847-16523-1-git-send-email-andre.guedes@openbossa.org>
According to b644ba336 (patch that introduced HCI_CONN_MGMT_CONNECTED
flag), the HCI_CONN_MGMT_CONNECTED flag tracks when mgmt has been
notified about the connection.
That being said, there is no point in checking this flag in hci_
disconn_complete_evt() since neither mgmt_disconnect_failed() nor
mgmt_device_disconnected() depend on it. Below follows more details:
* mgmt_disconnect_failed() removes pending MGMT_OP_DISCONNECT
commands, it doesn't matter if that connection was notified or not.
* mgmt_device_disconnected() sends the mgmt event only if the link
type is ACL_LINK or LE_LINK. For those connection type, the flag is
always set.
So this patch removes the HCI_CONN_MGMT_CONNECTED check.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
net/bluetooth/hci_event.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 142aa61..560296d 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1792,16 +1792,14 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
if (ev->status == 0)
conn->state = BT_CLOSED;
- if (test_and_clear_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) {
- if (ev->status) {
- mgmt_disconnect_failed(hdev, &conn->dst, conn->type,
- conn->dst_type, ev->status);
- } else {
- u8 reason = hci_to_mgmt_reason(ev->reason);
+ if (ev->status) {
+ mgmt_disconnect_failed(hdev, &conn->dst, conn->type,
+ conn->dst_type, ev->status);
+ } else {
+ u8 reason = hci_to_mgmt_reason(ev->reason);
- mgmt_device_disconnected(hdev, &conn->dst, conn->type,
- conn->dst_type, reason);
- }
+ mgmt_device_disconnected(hdev, &conn->dst, conn->type,
+ conn->dst_type, reason);
}
if (ev->status == 0) {
--
1.8.4
^ permalink raw reply related
* [PATCH 0/2] Disconnect complete refactoring
From: Andre Guedes @ 2013-11-04 17:57 UTC (permalink / raw)
To: linux-bluetooth
Hi all,
This small patch set contains the remaining patches from "[RFC] Disconnect
complete refactoring" patch set which weren't applied due to coding style
issues.
Andre Guedes (2):
Bluetooth: Remove unneeded check in hci_disconn_complete_evt()
Bluetooth: Refactor hci_disconn_complete_evt
net/bluetooth/hci_event.c | 59 ++++++++++++++++++++++-------------------------
1 file changed, 28 insertions(+), 31 deletions(-)
--
1.8.4
^ permalink raw reply
* Re: [RFC 4/5] Bluetooth: Remove unneeded check in hci_disconn_complete_evt()
From: Andre Guedes @ 2013-11-04 17:15 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <4794090B-F1E7-4B60-860A-3BD42CE6CA93@holtmann.org>
Hi Marcel,
On 02/11/13 15:14, Marcel Holtmann wrote:
> Hi Andre,
>
>> According to b644ba336 (patch that introduced HCI_CONN_MGMT_CONNECTED
>> flag), the HCI_CONN_MGMT_CONNECTED flag tracks when mgmt has been
>> notified about the connection.
>>
>> That being said, there is no point in checking this flag in hci_
>> disconn_complete_evt() since neither mgmt_disconnect_failed() nor
>> mgmt_device_disconnected() depend on it. Below follows more details:
>> * mgmt_disconnect_failed() removes pending MGMT_OP_DISCONNECT
>> commands, it doesn't matter if that connection was notified or not.
>> * mgmt_device_disconnected() sends the mgmt event only if the link
>> type is ACL_LINK or LE_LINK. For those connection type, the flag is
>> always set.
>>
>> So this patch removes the HCI_CONN_MGMT_CONNECTED check.
>>
>> Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
>> ---
>> net/bluetooth/hci_event.c | 16 +++++++---------
>> 1 file changed, 7 insertions(+), 9 deletions(-)
>>
>> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
>> index 4673cfb..9225a9c 100644
>> --- a/net/bluetooth/hci_event.c
>> +++ b/net/bluetooth/hci_event.c
>> @@ -1795,16 +1795,14 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
>> if (ev->status == 0)
>> conn->state = BT_CLOSED;
>>
>> - if (test_and_clear_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) {
>> - if (ev->status) {
>> - mgmt_disconnect_failed(hdev, &conn->dst, conn->type,
>> - conn->dst_type, ev->status);
>> - } else {
>> - u8 reason = hci_to_mgmt_reason(ev->reason);
>> + if (ev->status) {
>> + mgmt_disconnect_failed(hdev, &conn->dst, conn->type,
>> + conn->dst_type, ev->status);
>
> something went wrong with the coding style here.
>
>> + } else {
>> + u8 reason = hci_to_mgmt_reason(ev->reason);
>>
>> - mgmt_device_disconnected(hdev, &conn->dst, conn->type,
>> - conn->dst_type, reason);
>> - }
>> + mgmt_device_disconnected(hdev, &conn->dst, conn->type,
>> + conn->dst_type, reason);
>
> And here.
I'm fixing it.
Thanks,
Andre
^ permalink raw reply
* Re: [PATCH] tools/hci2hid: properly format device path
From: Matthew Monaco @ 2013-11-04 16:52 UTC (permalink / raw)
To: Vinicius Costa Gomes, Bastien Nocera; +Cc: linux-bluetooth
In-Reply-To: <20131104164206.GB31305@molly.amr.corp.intel.com>
Ah, didn't see it in git. Sorry about the noise.
On 11/04/2013 09:42 AM, Vinicius Costa Gomes wrote:
> Hi Bastien,
>
> On 17:23 Mon 04 Nov, Bastien Nocera wrote:
>> On Mon, 2013-11-04 at 14:18 -0200, Vinicius Costa Gomes wrote:
>>> Hi Matthew,
>>>
>>> On 18:46 Sun 03 Nov, Matthew Monaco wrote:
>>>> From: Matthew Monaco <matthew.monaco@0x01b.net>
>>>>
>>>> ---
>>>> Hello! I hope this is the correct place to send a bugfix for bluez.
>>>> tools/hid2hci.c | 15 +++++++++------
>>>> 1 file changed, 9 insertions(+), 6 deletions(-)
>>>
>>> The patch itself looks good.
>>>
>>> What I think is missing is a better description of the problem it solves, I
>>> would suggest including in the commit message the values of 'path' for before
>>> and after the patch, for a situation that the current implementation doesn't
>>> work.
>>>
>>> Changing the subject line to something like: "tools: Fix wrong paths for
>>> adapters" would make it easier to tell that this patch is indeed a bug fix.
>>
>> Isn't this the same patch Giovanni sent a couple of weeks ago?
>>
>> http://thread.gmane.org/gmane.linux.bluez.kernel/38329
>
> Yeah, same fix. Thanks for noticing.
>
>>
>> Cheers
>>
>
>
> Cheers,
>
^ permalink raw reply
* Re: [PATCH] tools/hci2hid: properly format device path
From: Vinicius Costa Gomes @ 2013-11-04 16:42 UTC (permalink / raw)
To: Bastien Nocera; +Cc: Matthew Monaco, linux-bluetooth
In-Reply-To: <1383582221.3373.15.camel@nuvo>
Hi Bastien,
On 17:23 Mon 04 Nov, Bastien Nocera wrote:
> On Mon, 2013-11-04 at 14:18 -0200, Vinicius Costa Gomes wrote:
> > Hi Matthew,
> >
> > On 18:46 Sun 03 Nov, Matthew Monaco wrote:
> > > From: Matthew Monaco <matthew.monaco@0x01b.net>
> > >
> > > ---
> > > Hello! I hope this is the correct place to send a bugfix for bluez.
> > > tools/hid2hci.c | 15 +++++++++------
> > > 1 file changed, 9 insertions(+), 6 deletions(-)
> >
> > The patch itself looks good.
> >
> > What I think is missing is a better description of the problem it solves, I
> > would suggest including in the commit message the values of 'path' for before
> > and after the patch, for a situation that the current implementation doesn't
> > work.
> >
> > Changing the subject line to something like: "tools: Fix wrong paths for
> > adapters" would make it easier to tell that this patch is indeed a bug fix.
>
> Isn't this the same patch Giovanni sent a couple of weeks ago?
>
> http://thread.gmane.org/gmane.linux.bluez.kernel/38329
Yeah, same fix. Thanks for noticing.
>
> Cheers
>
Cheers,
--
Vinicius
^ permalink raw reply
* Re: [PATCH v2] hid2hci: fix regression in /dev format after moving away from libusb
From: Vinicius Costa Gomes @ 2013-11-04 16:37 UTC (permalink / raw)
To: Giovanni Campagna; +Cc: linux-bluetooth
In-Reply-To: <1380798229-4319-1-git-send-email-scampa.giovanni@gmail.com>
Hi,
On 13:03 Thu 03 Oct, Giovanni Campagna wrote:
> From: Giovanni Campagna <gcampagna@src.gnome.org>
>
> The paths under /dev, in the default udev configuration, are formatted
> with two leading zeros, but the number obtained from sysfs don't have
> them, so we must convert them to integers and reformat them.
> ---
> tools/hid2hci.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
Ack.
Cheers,
--
Vinicius
^ permalink raw reply
* Re: [PATCH] tools/hci2hid: properly format device path
From: Bastien Nocera @ 2013-11-04 16:23 UTC (permalink / raw)
To: Vinicius Costa Gomes; +Cc: Matthew Monaco, linux-bluetooth
In-Reply-To: <20131104161805.GA32089@molly.amr.corp.intel.com>
On Mon, 2013-11-04 at 14:18 -0200, Vinicius Costa Gomes wrote:
> Hi Matthew,
>
> On 18:46 Sun 03 Nov, Matthew Monaco wrote:
> > From: Matthew Monaco <matthew.monaco@0x01b.net>
> >
> > ---
> > Hello! I hope this is the correct place to send a bugfix for bluez.
> > tools/hid2hci.c | 15 +++++++++------
> > 1 file changed, 9 insertions(+), 6 deletions(-)
>
> The patch itself looks good.
>
> What I think is missing is a better description of the problem it solves, I
> would suggest including in the commit message the values of 'path' for before
> and after the patch, for a situation that the current implementation doesn't
> work.
>
> Changing the subject line to something like: "tools: Fix wrong paths for
> adapters" would make it easier to tell that this patch is indeed a bug fix.
Isn't this the same patch Giovanni sent a couple of weeks ago?
http://thread.gmane.org/gmane.linux.bluez.kernel/38329
Cheers
^ permalink raw reply
* Re: [PATCH] tools/hci2hid: properly format device path
From: Vinicius Costa Gomes @ 2013-11-04 16:18 UTC (permalink / raw)
To: Matthew Monaco; +Cc: linux-bluetooth
In-Reply-To: <963b569308352e0b0fc18a0a17e2b0c0fe721d72.1383529026.git.matthew.monaco@0x01b.net>
Hi Matthew,
On 18:46 Sun 03 Nov, Matthew Monaco wrote:
> From: Matthew Monaco <matthew.monaco@0x01b.net>
>
> ---
> Hello! I hope this is the correct place to send a bugfix for bluez.
> tools/hid2hci.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
The patch itself looks good.
What I think is missing is a better description of the problem it solves, I
would suggest including in the commit message the values of 'path' for before
and after the patch, for a situation that the current implementation doesn't
work.
Changing the subject line to something like: "tools: Fix wrong paths for
adapters" would make it easier to tell that this patch is indeed a bug fix.
>
> diff --git a/tools/hid2hci.c b/tools/hid2hci.c
> index bb8a521..8f22047 100644
> --- a/tools/hid2hci.c
> +++ b/tools/hid2hci.c
> @@ -221,18 +221,21 @@ static int usb_switch_dell(int fd, enum mode mode)
> static int find_device(struct udev_device *udev_dev)
> {
> char path[PATH_MAX];
> - const char *busnum, *devnum;
> + const char *str;
> + long int busnum, devnum;
> int fd;
>
> - busnum = udev_device_get_sysattr_value(udev_dev, "busnum");
> - if (!busnum)
> + str = udev_device_get_sysattr_value(udev_dev, "busnum");
> + if (!str)
> return -1;
> + busnum = strtol(str, NULL, 0);
>
> - devnum = udev_device_get_sysattr_value(udev_dev, "devnum");
> - if (!devnum)
> + str = udev_device_get_sysattr_value(udev_dev, "devnum");
> + if (!str)
> return -1;
> + devnum = strtol(str, NULL, 0);
>
> - snprintf(path, sizeof(path), "/dev/bus/usb/%s/%s", busnum, devnum);
> + snprintf(path, sizeof(path), "/dev/bus/usb/%03d/%03d", busnum, devnum);
>
> fd = open(path, O_RDWR, O_CLOEXEC);
> if (fd < 0) {
> --
> 1.8.4.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Cheers,
--
Vinicius
^ permalink raw reply
* [PATCH] Bluetooth: ath3k: Add support for a new AR3012 device
From: Sujith Manoharan @ 2013-11-04 16:08 UTC (permalink / raw)
To: linux-bluetooth; +Cc: gustavo
T: Bus=02 Lev=01 Prnt=01 Port=04 Cnt=01 Dev#= 9 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0489 ProdID=e05f Rev= 0.02
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=01
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
Reported-by: Joshua Richenhagen <richenhagen@gmail.com>
Signed-off-by: Sujith Manoharan <sujith@msujith.org>
---
drivers/bluetooth/ath3k.c | 2 ++
drivers/bluetooth/btusb.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 6bfc1bb..32582ec 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -96,6 +96,7 @@ static const struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x13d3, 0x3402) },
{ USB_DEVICE(0x0cf3, 0x3121) },
{ USB_DEVICE(0x0cf3, 0xe003) },
+ { USB_DEVICE(0x0489, 0xe05f) },
/* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE02C) },
@@ -138,6 +139,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
/* Atheros AR5BBU22 with sflash firmware */
{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 30868fa..9ce82ef 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -163,6 +163,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
/* Atheros AR5BBU12 with sflash firmware */
{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
--
1.8.4.2
^ permalink raw reply related
* [PATCH 3/3] android: Send current state of all properties while powering adapter
From: Szymon Janc @ 2013-11-04 15:34 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1383579265-24614-1-git-send-email-szymon.janc@tieto.com>
When adapter is powered on it is expected to emit all properties so
that framework could synchronize its state machine with current
state of HAL. There is no need to set scan mode to none on startup
as framework will set scan mode if current mode is different than
desired one.
---
android/adapter.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/android/adapter.c b/android/adapter.c
index 54aed40..17ea72b 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -1485,16 +1485,9 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
switch (opcode) {
case HAL_OP_ENABLE:
- /*
- * In case the controller has connectable and discoverable
- * enabled, make sure to disable it first.
- *
- * It is enough to just clear the connectable setting since
- * at the same time it will automatically clear discoverable
- * setting.
- */
- if (adapter->current_settings & MGMT_SETTING_CONNECTABLE)
- set_mode(MGMT_OP_SET_CONNECTABLE, 0x00);
+ /* Framework expects all properties to be emitted while
+ * enabling adapter */
+ get_properties();
if (adapter->current_settings & MGMT_SETTING_POWERED) {
status = HAL_STATUS_DONE;
--
1.8.4.1
^ permalink raw reply related
* [PATCH 2/3] android: Implement scan_mode property in get property command
From: Szymon Janc @ 2013-11-04 15:34 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1383579265-24614-1-git-send-email-szymon.janc@tieto.com>
This will allow to query current state of scan mode property.
---
android/adapter.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/android/adapter.c b/android/adapter.c
index 78c301c..54aed40 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -1064,11 +1064,11 @@ static bool get_service(void)
static bool get_scan_mode(void)
{
- DBG("Not implemented");
+ DBG("");
- /* TODO: Add implementation */
+ scan_mode_changed();
- return false;
+ return true;
}
static bool get_devices(void)
--
1.8.4.1
^ permalink raw reply related
* [PATCH 1/3] android: Add support for handling get properties commands
From: Szymon Janc @ 2013-11-04 15:34 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
When this commands is received all properties shall be reported to HAL.
---
android/adapter.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/android/adapter.c b/android/adapter.c
index 81b61c1..78c301c 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -1118,6 +1118,19 @@ static bool get_property(void *buf, uint16_t len)
}
}
+static void get_properties(void)
+{
+ send_adapter_address();
+ get_name();
+ get_uuids();
+ get_class();
+ get_type();
+ get_service();
+ get_scan_mode();
+ get_devices();
+ get_disc_timeout();
+}
+
static bool start_discovery(void)
{
struct mgmt_cp_start_discovery cp;
@@ -1502,6 +1515,10 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
goto error;
break;
+ case HAL_OP_GET_ADAPTER_PROPS:
+ get_properties();
+
+ break;
case HAL_OP_GET_ADAPTER_PROP:
if (!get_property(buf, len))
goto error;
--
1.8.4.1
^ permalink raw reply related
* Re: Wireshark and new BlueZ BTSNOOP format
From: Marcel Holtmann @ 2013-11-04 14:40 UTC (permalink / raw)
To: Michal Labedzki; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <CALkxMhFHWv7kxfRKrN3kq8NVRgVyk0vNpiR8ryKTm8s2b_exKQ@mail.gmail.com>
Hi Michal,
> There is a need to add support for latest BTSNOOP format currently
> used in BlueZ (5). I have two questions:
>
> 1. Is BlueZ btsnoop format official and stable? Or invented by BlueZ
> team? (stable? safe?)
the original btsnoop format was done by Symbian and adopted by Frontline. We started using that as well since it was better than what we had before. These are the ones with 1xxx link types.
With BlueZ 5 and kernels 3.5 and newer we introduced a Bluetooth monitor to the kernel that can catch all controllers and can catch early messages as well. Previous hcidump could only read one interface at a time and was not able to catch early init frames.
The link type 2001 is stable.
> 2. Is there any documentation describes this format?
It is documented inside the kernel as include/net/bluetooth/hci_mon.h and that is as close as it gets to documentation. btsnoop v2 takes the BTSnoop header and uses the 2001 link type and then encodes the opcode and index into the flags field. The frame data is always a raw HCI message similar to link type 1001.
> In code I saw two new magic numbers:
> 2001 Bluetooth monitor
> 2002 Bluetooth simulator
> Is Bluetooth simulator completed now?
The simulator is a low-level Low Energy Link Layer simulator. And it is not completed and not stable yet.
> For now Wireshark (>= 1.10, trunk is recommended) provide probably
> full Bluetooth support, all protocols, colours, filtering,
> reassembling. If you find a bug or need new feature please create a
> bug at https://bugs.wireshark.org/bugzilla/buglist.cgi?resolution=---&query_format=advanced&list_id=11093
What also would be interesting is an integration of Bluetooth monitor socket with libpcap so Wireshark can do live capture.
Regards
Marcel
^ permalink raw reply
* Wireshark and new BlueZ BTSNOOP format
From: Michal Labedzki @ 2013-11-04 14:25 UTC (permalink / raw)
To: linux-bluetooth
Hello there,
There is a need to add support for latest BTSNOOP format currently
used in BlueZ (5). I have two questions:
1. Is BlueZ btsnoop format official and stable? Or invented by BlueZ
team? (stable? safe?)
2. Is there any documentation describes this format?
In code I saw two new magic numbers:
2001 Bluetooth monitor
2002 Bluetooth simulator
Is Bluetooth simulator completed now?
For now Wireshark (>= 1.10, trunk is recommended) provide probably
full Bluetooth support, all protocols, colours, filtering,
reassembling. If you find a bug or need new feature please create a
bug at https://bugs.wireshark.org/bugzilla/buglist.cgi?resolution=---&query_format=advanced&list_id=11093
--
Pozdrawiam / Best regards
-------------------------------------------------------------------------------------------------------------
Michał Łabędzki, Software Engineer
Tieto Corporation
Product Development Services
http://www.tieto.com / http://www.tieto.pl
---
ASCII: Michal Labedzki
location: Swobodna 1 Street, 50-088 Wrocław, Poland
room: 5.01 (desk next to 5.08)
---
Please note: The information contained in this message may be legally
privileged and confidential and protected from disclosure. If the
reader of this message is not the intended recipient, you are hereby
notified that any unauthorised use, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to
the message and deleting it from your computer. Thank You.
---
Please consider the environment before printing this e-mail.
---
Tieto Poland spółka z ograniczoną odpowiedzialnością z siedzibą w
Szczecinie, ul. Malczewskiego 26. Zarejestrowana w Sądzie Rejonowym
Szczecin-Centrum w Szczecinie, XIII Wydział Gospodarczy Krajowego
Rejestru Sądowego pod numerem 0000124858. NIP: 8542085557. REGON:
812023656. Kapitał zakładowy: 4 271500 PLN
^ permalink raw reply
* [PATCHv3 4/4] android: Fix printing not NULL terminated strings
From: Andrei Emeltchenko @ 2013-11-04 13:22 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1383571358-4942-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Android passes not NULL terminated strings.
---
android/client/textconv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/android/client/textconv.c b/android/client/textconv.c
index 8e6bdb9..9a2f7e6 100644
--- a/android/client/textconv.c
+++ b/android/client/textconv.c
@@ -258,7 +258,8 @@ char *btproperty2str(const bt_property_t *property)
switch (property->type) {
case BT_PROPERTY_BDNAME:
case BT_PROPERTY_REMOTE_FRIENDLY_NAME:
- sprintf(p, "%s", ((bt_bdname_t *) property->val)->name);
+ snprintf(p, property->len + 1, "%s",
+ ((bt_bdname_t *) property->val)->name);
break;
case BT_PROPERTY_BDADDR:
--
1.7.10.4
^ permalink raw reply related
* [PATCHv3 3/4] android/daemon: Fix setting adapter name
From: Andrei Emeltchenko @ 2013-11-04 13:22 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1383571358-4942-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Android use the full string returned even if we terminate it with '\0'.
---
android/adapter.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/android/adapter.c b/android/adapter.c
index c2a6bf3..45b2d4a 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -145,8 +145,8 @@ static void scan_mode_changed(void)
static void adapter_name_changed(const uint8_t *name)
{
struct hal_ev_adapter_props_changed *ev;
- uint8_t buf[sizeof(*ev) + sizeof(struct hal_property) +
- HAL_MAX_NAME_LENGTH];
+ size_t len = strlen((const char *) name);
+ uint8_t buf[sizeof(*ev) + sizeof(struct hal_property) + len];
memset(buf, 0, sizeof(buf));
ev = (void *) buf;
@@ -154,10 +154,11 @@ static void adapter_name_changed(const uint8_t *name)
ev->num_props = 1;
ev->status = HAL_STATUS_SUCCESS;
ev->props[0].type = HAL_PROP_ADAPTER_NAME;
- ev->props[0].len = HAL_MAX_NAME_LENGTH;
- memcpy(ev->props->val, name, HAL_MAX_NAME_LENGTH);
+ /* Android expects value without NULL terminator */
+ ev->props[0].len = len;
+ memcpy(ev->props->val, name, len);
- DBG("Adapter name changed to: %s", ev->props->val);
+ DBG("Adapter name changed to: %s", name);
ipc_send(notification_io, HAL_SERVICE_ID_BLUETOOTH,
HAL_EV_ADAPTER_PROPS_CHANGED, sizeof(buf), ev, -1);
--
1.7.10.4
^ permalink raw reply related
* [PATCHv3 2/4] android/daemon: Clean up get_address name
From: Andrei Emeltchenko @ 2013-11-04 13:22 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1383571358-4942-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Make function name consistent with the rest of the code.
---
android/adapter.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/android/adapter.c b/android/adapter.c
index 3e43d44..c2a6bf3 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -995,7 +995,7 @@ static bool set_discoverable(uint8_t mode, uint16_t timeout)
return false;
}
-static void send_adapter_address(void)
+static void get_address(void)
{
struct hal_ev_adapter_props_changed *ev;
int len;
@@ -1096,7 +1096,7 @@ static bool get_property(void *buf, uint16_t len)
switch (cmd->type) {
case HAL_PROP_ADAPTER_ADDR:
- send_adapter_address();
+ get_address();
return true;
case HAL_PROP_ADAPTER_NAME:
return get_name();
--
1.7.10.4
^ permalink raw reply related
* [PATCHv3 1/4] android/daemon: Implement get adapter name
From: Andrei Emeltchenko @ 2013-11-04 13:22 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <CABBYNZLUUPkLM_b2DDb=mxc5-QqLrwN9in7XmZGpV+xQ-DpzzQ@mail.gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Use adapter_name_changed for get_property call.
---
android/adapter.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/android/adapter.c b/android/adapter.c
index af461b8..3e43d44 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -1019,11 +1019,12 @@ static void send_adapter_address(void)
static bool get_name(void)
{
- DBG("Not implemented");
+ if (!adapter->name)
+ return false;
- /* TODO: Add implementation */
+ adapter_name_changed((uint8_t *) adapter->name);
- return false;
+ return true;
}
static bool get_uuids(void)
--
1.7.10.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox