* Re: [PATCH v2 00/11] Audio HAL implementation
From: Luiz Augusto von Dentz @ 2014-01-16 14:13 UTC (permalink / raw)
To: Andrzej Kaczmarek; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <1389809037-11575-1-git-send-email-andrzej.kaczmarek@tieto.com>
Hi Andrzej,
On Wed, Jan 15, 2014 at 8:03 PM, Andrzej Kaczmarek
<andrzej.kaczmarek@tieto.com> wrote:
> Hi,
>
> changes v1 -> v2
> - fixed comments from Luiz
> - removed "codec_" prefix from function related to SBC codec
> - additional patch to implement set_parameters for audio device
> (A2dpSuspend is initialized this way)
> - changes dummy buffer size to 20*512 which is inline with Bluedroid
> (AudioFlinger does crash when closing output stream when set to 512)
>
>
> Andrzej Kaczmarek (10):
> android/hal-audio: Add support to register audio endpoints
> android/hal-audio: Add support to unregister audio endpoints
> android/hal-audio: Add support to open output stream
> android/hal-audio: Add support to close output stream
> android/hal-audio: Add support to resume output stream
> android/hal-audio: Add support to suspend output stream
> android/hal-audio: Handle audio preset from stream
> android/hal-audio: Fix module loading
> android/hal-audio: Fix AudioFlinger crash
> android/hal-audio: Implement set_parameters for device
>
> Lukasz Rymanowski (1):
> android/hal-audio: Add audio_ipc_cmd
>
> android/Makefile.am | 1 +
> android/hal-audio.c | 729 +++++++++++++++++++++++++++++++++++++++++++++++++---
> 2 files changed, 696 insertions(+), 34 deletions(-)
>
> --
> 1.8.5.2
Pushed, thanks.
--
Luiz Augusto von Dentz
^ permalink raw reply
* [PATCH] enable Atheros 0cf3:311e for firmware upload
From: oliver @ 2014-01-16 14:37 UTC (permalink / raw)
To: acho, marcel, gustavo, johan.hedberg, linux-bluetooth
Cc: Oliver Neukum, Oliver Neukum
From: Oliver Neukum <oliver@neukum.org>
The device will bind to btusb without firmware, but with the original
buggy firmware device discovery does not work. No devices are detected.
Device descriptor without firmware:
T: Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0cf3 ProdID=311e Rev= 0.01
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
with firmware:
T: Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0cf3 ProdID=311e Rev= 0.02
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
Signed-off-by: Oliver Neukum <oneukum@suse.de>
---
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..b0a875b 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -77,6 +77,7 @@ static const struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x0CF3, 0x3004) },
{ USB_DEVICE(0x0CF3, 0x3008) },
{ USB_DEVICE(0x0CF3, 0x311D) },
+ { USB_DEVICE(0x0CF3, 0x311E) },
{ USB_DEVICE(0x0CF3, 0x817a) },
{ USB_DEVICE(0x13d3, 0x3375) },
{ USB_DEVICE(0x04CA, 0x3004) },
@@ -119,6 +120,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x311E), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index c0ff34f..e15b580 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -144,6 +144,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x817a), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
--
1.8.4
^ permalink raw reply related
* [PATCH] enable Atheros 0cf3:311e for firmware upload
From: oliver @ 2014-01-16 14:37 UTC (permalink / raw)
To: acho, marcel, gustavo, johan.hedberg, linux-bluetooth
Cc: Oliver Neukum, Oliver Neukum
In-Reply-To: <1389883031-10752-1-git-send-email-oliver@neukum.org>
From: Oliver Neukum <oliver@neukum.org>
The device will bind to btusb without firmware, but with the original
buggy firmware device discovery does not work. No devices are detected.
Device descriptor without firmware:
T: Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0cf3 ProdID=311e Rev= 0.01
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
with firmware:
T: Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0cf3 ProdID=311e Rev= 0.02
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
Signed-off-by: Oliver Neukum <oneukum@suse.de>
---
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..b0a875b 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -77,6 +77,7 @@ static const struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x0CF3, 0x3004) },
{ USB_DEVICE(0x0CF3, 0x3008) },
{ USB_DEVICE(0x0CF3, 0x311D) },
+ { USB_DEVICE(0x0CF3, 0x311E) },
{ USB_DEVICE(0x0CF3, 0x817a) },
{ USB_DEVICE(0x13d3, 0x3375) },
{ USB_DEVICE(0x04CA, 0x3004) },
@@ -119,6 +120,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x311E), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index c0ff34f..e15b580 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -144,6 +144,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x817a), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
--
1.8.4
^ permalink raw reply related
* Re: [PATCH v2] android/bluetooth: Fix discovering new devices
From: Szymon Janc @ 2014-01-16 14:50 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
In-Reply-To: <20140116135032.GA1267@x220.p-661hnu-f1>
Hi,
On Thursday 16 of January 2014 15:50:32 Johan Hedberg wrote:
> Hi Szymon,
>
> On Thu, Jan 16, 2014, Szymon Janc wrote:
> > @@ -983,12 +994,15 @@ static void update_found_device(const bdaddr_t *bdaddr, uint8_t bdaddr_type,
> > eir_parse(&eir, data, data_len);
> >
> > dev = find_device(bdaddr);
> > - if (!dev) {
> > + if (!dev || !dev->found) {
>
> I think this would still deserve a code comment here explaining why
> dev->found is important. Other than that the patch is fine, so feel free
> to push it yourself once you've added the comment.
Pushed.
--
Best regards,
Szymon Janc
^ permalink raw reply
* [PATCH 1/2] android: Add btmgmt to debug builds
From: Andrzej Kaczmarek @ 2014-01-16 14:52 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Andrzej Kaczmarek
---
android/Android.mk | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/android/Android.mk b/android/Android.mk
index 7e97ec8..b3e6a50 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -282,3 +282,39 @@ LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := bluetoothd-snoop
include $(BUILD_EXECUTABLE)
+
+#
+# btmgmt
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ ../tools/btmgmt.c \
+ ../monitor/mainloop.c \
+ ../lib/bluetooth.c \
+ ../lib/sdp.c \
+ ../src/eir.c \
+ ../src/glib-helper.c \
+ ../src/shared/io-mainloop.c \
+ ../src/shared/mgmt.c \
+ ../src/shared/queue.c \
+ ../src/shared/util.c \
+
+LOCAL_C_INCLUDES := \
+ $(call include-path-for, glib) \
+ $(call include-path-for, glib)/glib \
+ $(LOCAL_PATH)/.. \
+ $(LOCAL_PATH)/../src \
+ $(LOCAL_PATH)/../lib \
+
+LOCAL_SHARED_LIBRARIES := \
+ libglib \
+
+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 2/2] android: Add l2ping to debug builds
From: Andrzej Kaczmarek @ 2014-01-16 14:52 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Andrzej Kaczmarek
In-Reply-To: <1389883945-10707-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 b3e6a50..d2009d7 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -318,3 +318,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
* [PATCH] add firmware update for Atheros 0cf3:311f
From: oliver @ 2014-01-16 15:02 UTC (permalink / raw)
To: acho, marcel, gustavo, johan.hedberg, linux-bluetooth
Cc: Oliver Neukum, Oliver Neukum
From: Oliver Neukum <oliver@neukum.org>
The device is not functional without firmware.
The device without firmware:
T: Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0cf3 ProdID=311f Rev=00.01
C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
The device with firmware:
T: Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0cf3 ProdID=3007 Rev=00.01
C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
Signed-off-by: Oliver Neukum <oneukum@suse.de>
---
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 b0a875b..3822621 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -78,6 +78,7 @@ static const struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x0CF3, 0x3008) },
{ USB_DEVICE(0x0CF3, 0x311D) },
{ USB_DEVICE(0x0CF3, 0x311E) },
+ { USB_DEVICE(0x0CF3, 0x311F) },
{ USB_DEVICE(0x0CF3, 0x817a) },
{ USB_DEVICE(0x13d3, 0x3375) },
{ USB_DEVICE(0x04CA, 0x3004) },
@@ -121,6 +122,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311E), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x311F), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index e15b580..9f61dde 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -145,6 +145,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x311f), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x817a), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
--
1.8.4
^ permalink raw reply related
* [PATCH] add firmware update for Atheros 0cf3:311f
From: oliver @ 2014-01-16 15:02 UTC (permalink / raw)
To: acho, marcel, gustavo, johan.hedberg, linux-bluetooth
Cc: Oliver Neukum, Oliver Neukum
In-Reply-To: <1389884578-18479-1-git-send-email-oliver@neukum.org>
From: Oliver Neukum <oliver@neukum.org>
The device is not functional without firmware.
The device without firmware:
T: Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0cf3 ProdID=311f Rev=00.01
C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
The device with firmware:
T: Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#= 4 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0cf3 ProdID=3007 Rev=00.01
C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
Signed-off-by: Oliver Neukum <oneukum@suse.de>
---
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 b0a875b..3822621 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -78,6 +78,7 @@ static const struct usb_device_id ath3k_table[] = {
{ USB_DEVICE(0x0CF3, 0x3008) },
{ USB_DEVICE(0x0CF3, 0x311D) },
{ USB_DEVICE(0x0CF3, 0x311E) },
+ { USB_DEVICE(0x0CF3, 0x311F) },
{ USB_DEVICE(0x0CF3, 0x817a) },
{ USB_DEVICE(0x13d3, 0x3375) },
{ USB_DEVICE(0x04CA, 0x3004) },
@@ -121,6 +122,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
{ USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311E), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x311F), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index e15b580..9f61dde 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -145,6 +145,7 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x0cf3, 0x3008), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x311e), .driver_info = BTUSB_ATH3012 },
+ { USB_DEVICE(0x0cf3, 0x311f), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x0cf3, 0x817a), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
{ USB_DEVICE(0x04ca, 0x3004), .driver_info = BTUSB_ATH3012 },
--
1.8.4
^ permalink raw reply related
* [PATCH] android/a2dp: Fix typo in condition
From: Andrzej Kaczmarek @ 2014-01-16 15:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Andrzej Kaczmarek
---
android/a2dp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/android/a2dp.c b/android/a2dp.c
index 9b168ed..2288912 100644
--- a/android/a2dp.c
+++ b/android/a2dp.c
@@ -1262,7 +1262,7 @@ static void bt_stream_open(const void *buf, uint16_t len)
return;
}
- if (avdtp_stream_get_transport(setup->stream, &fd, NULL, NULL, NULL)) {
+ if (!avdtp_stream_get_transport(setup->stream, &fd, NULL, NULL, NULL)) {
error("avdtp_stream_get_transport: failed");
audio_ipc_send_rsp(AUDIO_OP_OPEN_STREAM, AUDIO_STATUS_FAILED);
return;
--
1.8.5.2
^ permalink raw reply related
* Re: [PATCH] android/a2dp: Fix typo in condition
From: Luiz Augusto von Dentz @ 2014-01-16 15:54 UTC (permalink / raw)
To: Andrzej Kaczmarek; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <1389886700-21480-1-git-send-email-andrzej.kaczmarek@tieto.com>
Hi Andrzej,
On Thu, Jan 16, 2014 at 5:38 PM, Andrzej Kaczmarek
<andrzej.kaczmarek@tieto.com> wrote:
> ---
> android/a2dp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/android/a2dp.c b/android/a2dp.c
> index 9b168ed..2288912 100644
> --- a/android/a2dp.c
> +++ b/android/a2dp.c
> @@ -1262,7 +1262,7 @@ static void bt_stream_open(const void *buf, uint16_t len)
> return;
> }
>
> - if (avdtp_stream_get_transport(setup->stream, &fd, NULL, NULL, NULL)) {
> + if (!avdtp_stream_get_transport(setup->stream, &fd, NULL, NULL, NULL)) {
> error("avdtp_stream_get_transport: failed");
> audio_ipc_send_rsp(AUDIO_OP_OPEN_STREAM, AUDIO_STATUS_FAILED);
> return;
> --
> 1.8.5.2
Applied, thanks.
--
Luiz Augusto von Dentz
^ permalink raw reply
* Re: [PATCH 1/2] android: Add btmgmt to debug builds
From: Marcel Holtmann @ 2014-01-16 22:08 UTC (permalink / raw)
To: Andrzej Kaczmarek; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <1389883945-10707-1-git-send-email-andrzej.kaczmarek@tieto.com>
Hi Andrzej,
> android/Android.mk | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/android/Android.mk b/android/Android.mk
> index 7e97ec8..b3e6a50 100644
> --- a/android/Android.mk
> +++ b/android/Android.mk
> @@ -282,3 +282,39 @@ LOCAL_MODULE_TAGS := optional
> LOCAL_MODULE := bluetoothd-snoop
>
> include $(BUILD_EXECUTABLE)
> +
> +#
> +# btmgmt
> +#
> +
> +include $(CLEAR_VARS)
> +
> +LOCAL_SRC_FILES := \
> + ../tools/btmgmt.c \
> + ../monitor/mainloop.c \
> + ../lib/bluetooth.c \
> + ../lib/sdp.c \
> + ../src/eir.c \
> + ../src/glib-helper.c \
> + ../src/shared/io-mainloop.c \
> + ../src/shared/mgmt.c \
> + ../src/shared/queue.c \
> + ../src/shared/util.c \
> +
> +LOCAL_C_INCLUDES := \
> + $(call include-path-for, glib) \
> + $(call include-path-for, glib)/glib \
> + $(LOCAL_PATH)/.. \
> + $(LOCAL_PATH)/../src \
> + $(LOCAL_PATH)/../lib \
> +
> +LOCAL_SHARED_LIBRARIES := \
> + libglib \
have Johan fix the dependency on GLib instead. It should not be needed anymore.
Regards
Marcel
^ permalink raw reply
* Questions on BlueZ 5.13: device creation API + persistent hid/input pipeline
From: Petri Gynther @ 2014-01-16 22:17 UTC (permalink / raw)
To: linux-bluetooth
linux-bluetooth:
I'm running BlueZ 5.13 userland + backported BlueZ kernel modules on
an embedded system that I'm working on. The kernel on the system is
2.6.37-based. I ported uhid driver manually from 3.12.
I'm successfully using Bluetooth classic HID remote control and
Bluetooth LE HoG remote control on this system. However, I have two
questions:
1) The Bluetooth classic remote that I'm using is not discoverable. It
is only connectable. When the remote is not paired, it sends its
Bluetooth MAC address to the host via IR, and the host needs to add
this device to BlueZ's discovered devices database. But, how can I do
that via D-Bus API? BlueZ 5 porting guide specifically mentions that "
... we decided to simply get rid of explicit CreateDevice /
CreatePairedDevice methods and instead dynamically create device
objects as they are discovered during device discovery."
So, is there no API available to add non-discoverable devices in BlueZ 5?
I have worked around this issue by manually adding this remote to
<storage path>, so that bluetoothd creates the device on reboot via
device_create_from_storage(). But, I would prefer not to restart
bluetoothd every time a non-discoverable device needs to be added.
2) There is a difference in HID vs HoG hid/input pipeline persistence.
When the Bluetooth classic HID remote disconnects, the corresponding
hid and input kernel devices are destroyed. And when it reconnects,
hid and input devices are created again. This adds a lot of
unnecessary delay at reconnect. And, the first keypress is always lost
on reconnect.
In contrast, for the Bluetooth LE HoG remote, the hid/input pipeline
is persistent. When HoG remote disconnects, hid and input devices
remain in the system and are reused when the HoG remote reconnects.
Is there a way to make Bluetooth classic HID behave the same as HoG,
i.e. retain the hid and input kernel devices on disconnect and reuse
them on reconnect?
^ permalink raw reply
* Re: Questions on BlueZ 5.13: device creation API + persistent hid/input pipeline
From: Marcel Holtmann @ 2014-01-16 22:30 UTC (permalink / raw)
To: Petri Gynther; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <CAGXr9JHw-S5XdXEcp3APN9OKadt7LuoPQmJ2RZkAsRZ8dDJB-w@mail.gmail.com>
Hi Petri,
> I'm running BlueZ 5.13 userland + backported BlueZ kernel modules on
> an embedded system that I'm working on. The kernel on the system is
> 2.6.37-based. I ported uhid driver manually from 3.12.
>
> I'm successfully using Bluetooth classic HID remote control and
> Bluetooth LE HoG remote control on this system. However, I have two
> questions:
>
> 1) The Bluetooth classic remote that I'm using is not discoverable. It
> is only connectable. When the remote is not paired, it sends its
> Bluetooth MAC address to the host via IR, and the host needs to add
> this device to BlueZ's discovered devices database. But, how can I do
> that via D-Bus API? BlueZ 5 porting guide specifically mentions that "
> ... we decided to simply get rid of explicit CreateDevice /
> CreatePairedDevice methods and instead dynamically create device
> objects as they are discovered during device discovery."
>
> So, is there no API available to add non-discoverable devices in BlueZ 5?
>
> I have worked around this issue by manually adding this remote to
> <storage path>, so that bluetoothd creates the device on reboot via
> device_create_from_storage(). But, I would prefer not to restart
> bluetoothd every time a non-discoverable device needs to be added.
I have never heard of a remote that uses IR to setup the pairing. A creative way of doing out-of-band pairing.
What I think you are looking for is what the PS3 controllers do when the share their details over USB and then after that connect over Bluetooth HID. Have a look at plugins/sixaxis.c to see how they do it. BlueZ has a plugin API for doing exactly these kind of automated setup/pairing type of cases.
So you want to write a plugin for this remote.
The other plugin you might want to look at is plugins/autopair.c if it actually requires to also create an encrypted link.
> 2) There is a difference in HID vs HoG hid/input pipeline persistence.
> When the Bluetooth classic HID remote disconnects, the corresponding
> hid and input kernel devices are destroyed. And when it reconnects,
> hid and input devices are created again. This adds a lot of
> unnecessary delay at reconnect. And, the first keypress is always lost
> on reconnect.
>
> In contrast, for the Bluetooth LE HoG remote, the hid/input pipeline
> is persistent. When HoG remote disconnects, hid and input devices
> remain in the system and are reused when the HoG remote reconnects.
>
> Is there a way to make Bluetooth classic HID behave the same as HoG,
> i.e. retain the hid and input kernel devices on disconnect and reuse
> them on reconnect?
HID and HoG work a little bit different. HID uses a kernel transport driver while HoG uses /dev/uhid to do the work. Porting HID over to use /dev/uhid is certainly a possibility. We have considered that, but nobody has done that work yet.
Please remember that HID (with HIDP) is finding its right place in /sys device tree. While all HoG using /dev/uhid are considered virtual devices. There is a semi proposal that we agreed on New Orleans during the PlumbersConf, but I have no idea if David actually implemented it.
Another option is to make the HIDP transport smarter and persistent by integrating it into BlueZ 5’s kernel mgmt support. That however means you will need a much more recent Bluetooth subsystem. So 2.6.37 is not getting you anywhere near that even if we change HIDP support.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] add firmware update for Atheros 0cf3:311f
From: Marcel Holtmann @ 2014-01-16 22:48 UTC (permalink / raw)
To: Oliver Neukum
Cc: Yu-Chen Cho, Gustavo F. Padovan, Johan Hedberg,
linux-bluetooth@vger.kernel.org development, Oliver Neukum
In-Reply-To: <1389884578-18479-2-git-send-email-oliver@neukum.org>
Hi Oliver,
> The device is not functional without firmware.
>
> The device without firmware:
> T: Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
> D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
> P: Vendor=0cf3 ProdID=311f Rev=00.01
> C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
> I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
>
> The device with firmware:
> T: Bus=02 Lev=02 Prnt=02 Port=05 Cnt=01 Dev#= 4 Spd=12 MxCh= 0
> D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
> P: Vendor=0cf3 ProdID=3007 Rev=00.01
> C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
> I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
>
> Signed-off-by: Oliver Neukum <oneukum@suse.de>
> ---
> drivers/bluetooth/ath3k.c | 2 ++
> drivers/bluetooth/btusb.c | 1 +
> 2 files changed, 3 insertions(+)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] enable Atheros 0cf3:311e for firmware upload
From: Marcel Holtmann @ 2014-01-16 22:48 UTC (permalink / raw)
To: Oliver Neukum
Cc: Yu-Chen Cho, Gustavo F. Padovan, Johan Hedberg,
linux-bluetooth@vger.kernel.org development, Oliver Neukum
In-Reply-To: <1389883031-10752-2-git-send-email-oliver@neukum.org>
Hi Oliver,
> The device will bind to btusb without firmware, but with the original
> buggy firmware device discovery does not work. No devices are detected.
>
> Device descriptor without firmware:
> T: Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
> D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
> P: Vendor=0cf3 ProdID=311e Rev= 0.01
> C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
> I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
> E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
> E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
> I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
> I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
> I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
> I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
> I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
> I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
>
> with firmware:
> T: Bus=03 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
> D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
> P: Vendor=0cf3 ProdID=311e Rev= 0.02
> C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
> I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
> E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
> E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
> I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
> I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
> I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
> I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
> I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
> I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
> E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
> E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
>
> Signed-off-by: Oliver Neukum <oneukum@suse.de>
> ---
> drivers/bluetooth/ath3k.c | 2 ++
> drivers/bluetooth/btusb.c | 1 +
> 2 files changed, 3 insertions(+)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply
* Re: Questions on BlueZ 5.13: device creation API + persistent hid/input pipeline
From: Petri Gynther @ 2014-01-16 23:03 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <F4C3DE28-E297-42B1-9FA2-B3335DF0F080@holtmann.org>
Hi Marcel,
Thanks for your reply. Please see inline.
On Thu, Jan 16, 2014 at 2:30 PM, Marcel Holtmann <marcel@holtmann.org> wrot=
e:
> Hi Petri,
>
>> I'm running BlueZ 5.13 userland + backported BlueZ kernel modules on
>> an embedded system that I'm working on. The kernel on the system is
>> 2.6.37-based. I ported uhid driver manually from 3.12.
>>
>> I'm successfully using Bluetooth classic HID remote control and
>> Bluetooth LE HoG remote control on this system. However, I have two
>> questions:
>>
>> 1) The Bluetooth classic remote that I'm using is not discoverable. It
>> is only connectable. When the remote is not paired, it sends its
>> Bluetooth MAC address to the host via IR, and the host needs to add
>> this device to BlueZ's discovered devices database. But, how can I do
>> that via D-Bus API? BlueZ 5 porting guide specifically mentions that "
>> ... we decided to simply get rid of explicit CreateDevice /
>> CreatePairedDevice methods and instead dynamically create device
>> objects as they are discovered during device discovery."
>>
>> So, is there no API available to add non-discoverable devices in BlueZ 5=
?
>>
>> I have worked around this issue by manually adding this remote to
>> <storage path>, so that bluetoothd creates the device on reboot via
>> device_create_from_storage(). But, I would prefer not to restart
>> bluetoothd every time a non-discoverable device needs to be added.
>
> I have never heard of a remote that uses IR to setup the pairing. A creat=
ive way of doing out-of-band pairing.
>
> What I think you are looking for is what the PS3 controllers do when the =
share their details over USB and then after that connect over Bluetooth HID=
. Have a look at plugins/sixaxis.c to see how they do it. BlueZ has a plugi=
n API for doing exactly these kind of automated setup/pairing type of cases=
.
>
> So you want to write a plugin for this remote.
>
> The other plugin you might want to look at is plugins/autopair.c if it ac=
tually requires to also create an encrypted link.
>
Thank you for this info. I will look into plugins/sixaxis.c and
plugins/autopair.c.
>> 2) There is a difference in HID vs HoG hid/input pipeline persistence.
>> When the Bluetooth classic HID remote disconnects, the corresponding
>> hid and input kernel devices are destroyed. And when it reconnects,
>> hid and input devices are created again. This adds a lot of
>> unnecessary delay at reconnect. And, the first keypress is always lost
>> on reconnect.
>>
>> In contrast, for the Bluetooth LE HoG remote, the hid/input pipeline
>> is persistent. When HoG remote disconnects, hid and input devices
>> remain in the system and are reused when the HoG remote reconnects.
>>
>> Is there a way to make Bluetooth classic HID behave the same as HoG,
>> i.e. retain the hid and input kernel devices on disconnect and reuse
>> them on reconnect?
>
> HID and HoG work a little bit different. HID uses a kernel transport driv=
er while HoG uses /dev/uhid to do the work. Porting HID over to use /dev/uh=
id is certainly a possibility. We have considered that, but nobody has done=
that work yet.
>
> Please remember that HID (with HIDP) is finding its right place in /sys d=
evice tree. While all HoG using /dev/uhid are considered virtual devices. T=
here is a semi proposal that we agreed on New Orleans during the PlumbersCo=
nf, but I have no idea if David actually implemented it.
>
> Another option is to make the HIDP transport smarter and persistent by in=
tegrating it into BlueZ 5=E2=80=99s kernel mgmt support. That however means=
you will need a much more recent Bluetooth subsystem. So 2.6.37 is not get=
ting you anywhere near that even if we change HIDP support.
>
> Regards
>
> Marcel
>
I'm using BlueZ kernel modules (bluetooth, hidp) from Linux
backports-3.13-rc2-1, so that is pretty recent code. Works fine on top
of 2.6.37. However, my HID and input drivers come from 2.6.37, as they
are not available in backports-3.13-rc2-1.
I understand the difference between HID and HoG. Both hidp and uhid
are hid_ll_drivers. HID input reports stay entirely in kernel, whereas
HoG is handled in bluetoothd and input reports are passed back to
kernel via /dev/uhid.
Assuming the latest HIDP code, what kind of effort would it be to make
the hid/input pipeline persistent when HID remote disconnects and
reconnects?
-- Petri
^ permalink raw reply
* [PATCH 00/11] HIDHost E2E tests and fixes
From: Ravi kumar Veeramally @ 2014-01-16 23:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
Patch set contains few fixes which are noticed while writing
tests and success test cases for hidhost.
Ravi kumar Veeramally (11):
android/hidhost: Fix connection state notification on profile
unregister
android/hidhost: Fix miscalculation of get report event struct length
android/hidhost: Remove unnecessary check
android/tester: Add HIDhost Connect test
android/tester: Add HIDhost Disconnect test
android/tester: Add HIDhost VirtualUnplug test
android/tester: Add HIDhost GetProtocol test
android/tester: Add HIDhost SetProtocol test
android/tester: Add HIDhost GetReport test
android/tester: Add HIDhost SetReport test
android/tester: Add HIDhost SendData test
android/android-tester.c | 517 ++++++++++++++++++++++++++++++++++++++++++++++-
android/hal-hidhost.c | 3 +-
android/hidhost.c | 14 +-
3 files changed, 511 insertions(+), 23 deletions(-)
--
1.8.3.2
^ permalink raw reply
* [PATCH 01/11] android/hidhost: Fix connection state notification on profile unregister
From: Ravi kumar Veeramally @ 2014-01-16 23:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1389914751-18545-1-git-send-email-ravikumar.veeramally@linux.intel.com>
Issue found while writing end2end tests. Usually profile unregister is
called when final cleanup of bluetoothd. Freeing connected hid devices
through g_slist_foreach is a asynchronous call. Profile is cleaned up
and and ipc also complete cleanup. But free_hid_devices tries to notify
hal which doesn't exist that time. So behaviour is unexpected.
---
android/hidhost.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/android/hidhost.c b/android/hidhost.c
index aed9899..c004063 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
@@ -1328,7 +1328,6 @@ static void free_hid_devices(gpointer data, gpointer user_data)
{
struct hid_device *dev = data;
- bt_hid_notify_state(dev, HAL_HIDHOST_STATE_DISCONNECTED);
hid_device_free(dev);
}
--
1.8.3.2
^ permalink raw reply related
* [PATCH 02/11] android/hidhost: Fix miscalculation of get report event struct length
From: Ravi kumar Veeramally @ 2014-01-16 23:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1389914751-18545-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/hal-hidhost.c | 3 ++-
android/hidhost.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index fd3ad2d..5445d08 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -73,7 +73,8 @@ static void handle_get_report(void *buf, uint16_t len)
{
struct hal_ev_hidhost_get_report *ev = buf;
- if (len != sizeof(*ev) + ev->len) {
+ if (len != sizeof(*ev) + sizeof(struct hal_ev_hidhost_get_report)
+ + ev->len) {
error("invalid get report event, aborting");
exit(EXIT_FAILURE);
}
diff --git a/android/hidhost.c b/android/hidhost.c
index c004063..8a2668c 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
@@ -371,13 +371,14 @@ 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) + sizeof(struct hal_ev_hidhost_get_report);
if (!((buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_INPUT)) ||
(buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_OUTPUT)) ||
(buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_FEATURE)))) {
ev = g_malloc0(ev_len);
ev->status = buf[0];
+ ev->len = 0;
bdaddr2android(&dev->dst, ev->bdaddr);
goto send;
}
--
1.8.3.2
^ permalink raw reply related
* [PATCH 03/11] android/hidhost: Remove unnecessary check
From: Ravi kumar Veeramally @ 2014-01-16 23:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1389914751-18545-1-git-send-email-ravikumar.veeramally@linux.intel.com>
HID device will return unsupported or invalid response for unsupported
or invalid get/set protocol request. Need not to check prior to that.
---
android/hidhost.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/android/hidhost.c b/android/hidhost.c
index 8a2668c..968b6f2 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
@@ -900,11 +900,6 @@ static void bt_hid_get_protocol(const void *buf, uint16_t len)
dev = l->data;
- if (dev->boot_dev) {
- status = HAL_STATUS_UNSUPPORTED;
- goto failed;
- }
-
hdr = HID_MSG_GET_PROTOCOL | cmd->mode;
fd = g_io_channel_unix_get_fd(dev->ctrl_io);
@@ -955,11 +950,6 @@ static void bt_hid_set_protocol(const void *buf, uint16_t len)
dev = l->data;
- if (dev->boot_dev) {
- status = HAL_STATUS_UNSUPPORTED;
- goto failed;
- }
-
hdr = HID_MSG_SET_PROTOCOL | cmd->mode;
fd = g_io_channel_unix_get_fd(dev->ctrl_io);
--
1.8.3.2
^ permalink raw reply related
* [PATCH 04/11] android/tester: Add HIDhost Connect test
From: Ravi kumar Veeramally @ 2014-01-16 23:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1389914751-18545-1-git-send-email-ravikumar.veeramally@linux.intel.com>
Emulated HID SDP and L2CAP Control and Interrupt channels.
---
android/android-tester.c | 231 +++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 221 insertions(+), 10 deletions(-)
diff --git a/android/android-tester.c b/android/android-tester.c
index 6f0e962..0888a68 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -69,6 +69,16 @@ struct socket_data {
bool test_channel;
};
+struct hidhost_generic_data {
+ bthh_status_t expected_status;
+ int expected_conn_state;
+ int expected_cb_count;
+ bthh_protocol_mode_t expected_protocol_mode;
+ int expected_report;
+ bthh_callbacks_t expected_hal_cb;
+ int expected_report_size;
+};
+
#define WAIT_FOR_SIGNAL_TIME 2 /* in seconds */
#define EMULATOR_SIGNAL "emulator_started"
@@ -97,6 +107,14 @@ struct test_data {
int cb_count;
GSList *expected_properties_list;
+
+ /* hidhost */
+ uint16_t sdp_handle;
+ uint16_t sdp_cid;
+ uint16_t ctrl_handle;
+ uint16_t ctrl_cid;
+ uint16_t intr_handle;
+ uint16_t intr_cid;
};
static char exec_dir[PATH_MAX + 1];
@@ -1933,15 +1951,6 @@ static bt_callbacks_t bt_callbacks = {
.le_test_mode_cb = NULL
};
-static bthh_callbacks_t bthh_callbacks = {
- .size = sizeof(bthh_callbacks),
- .connection_state_cb = NULL,
- .hid_info_cb = NULL,
- .protocol_mode_cb = NULL,
- .idle_time_cb = NULL,
- .get_report_cb = NULL,
- .virtual_unplug_cb = NULL
-};
static void setup(struct test_data *data)
{
@@ -3076,7 +3085,80 @@ clean:
close(sock_fd);
}
-static void setup_hidhost_interface(const void *test_data)
+static void hidhost_connection_state_cb(bt_bdaddr_t *bd_addr,
+ bthh_connection_state_t state)
+{
+ struct test_data *data = tester_get_data();
+ const struct hidhost_generic_data *test = data->test_data;
+
+ data->cb_count++;
+
+ if (state == BTHH_CONN_STATE_CONNECTED)
+ tester_setup_complete();
+
+ if (test && test->expected_hal_cb.connection_state_cb)
+ test->expected_hal_cb.connection_state_cb(bd_addr, state);
+}
+
+static void hidhost_virual_unplug_cb(bt_bdaddr_t *bd_addr, bthh_status_t status)
+{
+ struct test_data *data = tester_get_data();
+ const struct hidhost_generic_data *test = data->test_data;
+
+ data->cb_count++;
+
+ if (test && test->expected_hal_cb.virtual_unplug_cb)
+ test->expected_hal_cb.virtual_unplug_cb(bd_addr, status);
+}
+
+static void hidhost_hid_info_cb(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid)
+{
+ struct test_data *data = tester_get_data();
+ const struct hidhost_generic_data *test = data->test_data;
+
+ data->cb_count++;
+
+ if (test && test->expected_hal_cb.hid_info_cb)
+ test->expected_hal_cb.hid_info_cb(bd_addr, hid);
+}
+
+static void hidhost_protocol_mode_cb(bt_bdaddr_t *bd_addr,
+ bthh_status_t status,
+ bthh_protocol_mode_t mode)
+{
+ struct test_data *data = tester_get_data();
+ const struct hidhost_generic_data *test = data->test_data;
+
+ data->cb_count++;
+
+ if (test && test->expected_hal_cb.protocol_mode_cb)
+ test->expected_hal_cb.protocol_mode_cb(bd_addr, status, mode);
+}
+
+static void hidhost_get_report_cb(bt_bdaddr_t *bd_addr, bthh_status_t status,
+ uint8_t *report, int size)
+{
+ struct test_data *data = tester_get_data();
+ const struct hidhost_generic_data *test = data->test_data;
+
+ data->cb_count++;
+
+ if (test && test->expected_hal_cb.get_report_cb)
+ test->expected_hal_cb.get_report_cb(bd_addr, status, report,
+ size);
+}
+
+static bthh_callbacks_t bthh_callbacks = {
+ .size = sizeof(bthh_callbacks),
+ .connection_state_cb = hidhost_connection_state_cb,
+ .hid_info_cb = hidhost_hid_info_cb,
+ .protocol_mode_cb = hidhost_protocol_mode_cb,
+ .idle_time_cb = NULL,
+ .get_report_cb = hidhost_get_report_cb,
+ .virtual_unplug_cb = hidhost_virual_unplug_cb
+};
+
+static void setup_hidhost(const void *test_data)
{
struct test_data *data = tester_get_data();
bt_status_t status;
@@ -3105,10 +3187,135 @@ static void setup_hidhost_interface(const void *test_data)
tester_setup_failed();
return;
}
+}
+static void setup_hidhost_interface(const void *test_data)
+{
+ setup_hidhost(test_data);
tester_setup_complete();
}
+static void hid_sdp_cid_hook_cb(const void *data, uint16_t len, void *user_data)
+{
+ struct test_data *t_data = tester_get_data();
+ struct bthost *bthost = hciemu_client_get_host(t_data->hciemu);
+ uint8_t pdu[] = { 0x07, /* PDU id */
+ 0x00, 0x00, /* Transaction id */
+ 0x01, 0x71, /* Response length */
+ 0x01, 0x6E, /* Attributes length */
+ 0x36, 0x01, 0x6b, 0x36, 0x01, 0x68, 0x09, 0x00,
+ 0x00, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x09, 0x00,
+ 0x01, 0x35, 0x03, 0x19, 0x11, 0x24, 0x09, 0x00,
+ 0x04, 0x35, 0x0d, 0x35, 0x06, 0x19, 0x01, 0x00,
+ 0x09, 0x00, 0x11, 0x35, 0x03, 0x19, 0x00, 0x11,
+ 0x09, 0x00, 0x05, 0x35, 0x03, 0x19, 0x10, 0x02,
+ 0x09, 0x00, 0x06, 0x35, 0x09, 0x09, 0x65, 0x6e,
+ 0x09, 0x00, 0x6a, 0x09, 0x01, 0x00, 0x09, 0x00,
+ 0x09, 0x35, 0x08, 0x35, 0x06, 0x19, 0x11, 0x24,
+ 0x09, 0x01, 0x00, 0x09, 0x00, 0x0d, 0x35, 0x0f,
+ 0x35, 0x0d, 0x35, 0x06, 0x19, 0x01, 0x00, 0x09,
+ 0x00, 0x13, 0x35, 0x03, 0x19, 0x00, 0x11, 0x09,
+ 0x01, 0x00, 0x25, 0x1e, 0x4c, 0x6f, 0x67, 0x69,
+ 0x74, 0x65, 0x63, 0x68, 0x20, 0x42, 0x6c, 0x75,
+ 0x65, 0x74, 0x6f, 0x6f, 0x74, 0x68, 0x20, 0x4d,
+ 0x6f, 0x75, 0x73, 0x65, 0x20, 0x4d, 0x35, 0x35,
+ 0x35, 0x62, 0x09, 0x01, 0x01, 0x25, 0x0f, 0x42,
+ 0x6c, 0x75, 0x65, 0x74, 0x6f, 0x6f, 0x74, 0x68,
+ 0x20, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x09, 0x01,
+ 0x02, 0x25, 0x08, 0x4c, 0x6f, 0x67, 0x69, 0x74,
+ 0x65, 0x63, 0x68, 0x09, 0x02, 0x00, 0x09, 0x01,
+ 0x00, 0x09, 0x02, 0x01, 0x09, 0x01, 0x11, 0x09,
+ 0x02, 0x02, 0x08, 0x80, 0x09, 0x02, 0x03, 0x08,
+ 0x21, 0x09, 0x02, 0x04, 0x28, 0x01, 0x09, 0x02,
+ 0x05, 0x28, 0x01, 0x09, 0x02, 0x06, 0x35, 0x74,
+ 0x35, 0x72, 0x08, 0x22, 0x25, 0x6e, 0x05, 0x01,
+ 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01,
+ 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x08,
+ 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x08,
+ 0x81, 0x02, 0x05, 0x01, 0x09, 0x30, 0x09, 0x31,
+ 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c,
+ 0x95, 0x02, 0x81, 0x06, 0x09, 0x38, 0x15, 0x81,
+ 0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x81, 0x06,
+ 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x81, 0x06, 0x05,
+ 0x09, 0x19, 0x09, 0x29, 0x10, 0x15, 0x00, 0x25,
+ 0x01, 0x95, 0x08, 0x75, 0x01, 0x81, 0x02, 0xc0,
+ 0xc0, 0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01,
+ 0x85, 0x10, 0x75, 0x08, 0x95, 0x06, 0x15, 0x00,
+ 0x26, 0xff, 0x00, 0x09, 0x01, 0x81, 0x00, 0x09,
+ 0x01, 0x91, 0x00, 0xc0, 0x09, 0x02, 0x07, 0x35,
+ 0x08, 0x35, 0x06, 0x09, 0x04, 0x09, 0x09, 0x01,
+ 0x00, 0x09, 0x02, 0x08, 0x28, 0x00, 0x09, 0x02,
+ 0x09, 0x28, 0x01, 0x09, 0x02, 0x0a, 0x28, 0x01,
+ 0x09, 0x02, 0x0b, 0x09, 0x01, 0x00, 0x09, 0x02,
+ 0x0c, 0x09, 0x0c, 0x80, 0x09, 0x02, 0x0d, 0x28,
+ 0x00, 0x09, 0x02, 0x0e, 0x28, 0x01,
+ 0x00 /* no continuation */};
+
+ bthost_send_cid(bthost, t_data->sdp_handle, t_data->sdp_cid,
+ (void *)pdu, sizeof(pdu));
+}
+
+static void hid_sdp_search_cb(uint16_t handle, uint16_t cid, void *user_data)
+{
+ struct test_data *data = tester_get_data();
+ struct bthost *bthost = hciemu_client_get_host(data->hciemu);
+
+ data->sdp_handle = handle;
+ data->sdp_cid = cid;
+
+ bthost_add_cid_hook(bthost, handle, cid, hid_sdp_cid_hook_cb, NULL);
+}
+
+static void emu_powered_complete(uint16_t opcode, uint8_t status,
+ const void *param, uint8_t len,
+ void *user_data)
+{
+ struct test_data *data = tester_get_data();
+ const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu);
+ bt_bdaddr_t bdaddr;
+ bt_status_t bt_status;
+
+ switch (opcode) {
+ case BT_HCI_CMD_WRITE_SCAN_ENABLE:
+ case BT_HCI_CMD_LE_SET_ADV_ENABLE:
+ break;
+ default:
+ return;
+ }
+
+ if (status) {
+ tester_setup_failed();
+ return;
+ }
+
+ data->cb_count = 0;
+ bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr);
+ bt_status = data->if_hid->connect(&bdaddr);
+ if (bt_status != BT_STATUS_SUCCESS)
+ tester_setup_failed();
+
+}
+
+static void setup_hidhost_connect(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ struct bthost *bthost;
+
+ setup_hidhost(test_data);
+
+ bthost = hciemu_client_get_host(data->hciemu);
+
+ /* Emulate SDP (PSM = 1) */
+ bthost_add_l2cap_server(bthost, 1, hid_sdp_search_cb, NULL);
+ /* Emulate Control Channel (PSM = 17) */
+ bthost_add_l2cap_server(bthost, 17, NULL, NULL);
+ /* Emulate Interrupt Channel (PSM = 19) */
+ bthost_add_l2cap_server(bthost, 19, NULL, NULL);
+
+ bthost_set_cmd_complete_cb(bthost, emu_powered_complete, data);
+ bthost_write_scan_enable(bthost, 0x03);
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -3454,5 +3661,9 @@ int main(int argc, char *argv[])
test_bredrle("HIDHost Init", NULL, setup_hidhost_interface,
test_dummy, teardown);
+ test_bredrle("HIDHost Connect Success",
+ NULL, setup_hidhost_connect,
+ test_dummy, teardown);
+
return tester_run();
}
--
1.8.3.2
^ permalink raw reply related
* [PATCH 05/11] android/tester: Add HIDhost Disconnect test
From: Ravi kumar Veeramally @ 2014-01-16 23:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1389914751-18545-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/android-tester.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 0888a68..8edabb1 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -3316,6 +3316,30 @@ static void setup_hidhost_connect(const void *test_data)
bthost_write_scan_enable(bthost, 0x03);
}
+static void hid_discon_cb(bt_bdaddr_t *bd_addr, bthh_connection_state_t state)
+{
+ if (state == BTHH_CONN_STATE_DISCONNECTED)
+ tester_test_passed();
+}
+
+static const struct hidhost_generic_data hidhost_test_disconnect = {
+ .expected_hal_cb.connection_state_cb = hid_discon_cb,
+};
+
+static void test_hidhost_disconnect(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu);
+ bt_bdaddr_t bdaddr;
+ bt_status_t bt_status;
+
+ data->cb_count = 0;
+ bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr);
+ bt_status = data->if_hid->disconnect(&bdaddr);
+ if (bt_status != BT_STATUS_SUCCESS)
+ tester_test_failed();
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -3665,5 +3689,9 @@ int main(int argc, char *argv[])
NULL, setup_hidhost_connect,
test_dummy, teardown);
+ test_bredrle("HIDHost Disconnect Success",
+ &hidhost_test_disconnect, setup_hidhost_connect,
+ test_hidhost_disconnect, teardown);
+
return tester_run();
}
--
1.8.3.2
^ permalink raw reply related
* [PATCH 06/11] android/tester: Add HIDhost VirtualUnplug test
From: Ravi kumar Veeramally @ 2014-01-16 23:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1389914751-18545-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/android-tester.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 8edabb1..2adbba1 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -3340,6 +3340,20 @@ static void test_hidhost_disconnect(const void *test_data)
tester_test_failed();
}
+static void test_hidhost_virtual_unplug(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu);
+ bt_bdaddr_t bdaddr;
+ bt_status_t bt_status;
+
+ data->cb_count = 0;
+ bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr);
+ bt_status = data->if_hid->virtual_unplug(&bdaddr);
+ if (bt_status != BT_STATUS_SUCCESS)
+ tester_test_failed();
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -3693,5 +3707,9 @@ int main(int argc, char *argv[])
&hidhost_test_disconnect, setup_hidhost_connect,
test_hidhost_disconnect, teardown);
+ test_bredrle("HIDHost VirtualUnplug Success",
+ &hidhost_test_disconnect, setup_hidhost_connect,
+ test_hidhost_virtual_unplug, teardown);
+
return tester_run();
}
--
1.8.3.2
^ permalink raw reply related
* [PATCH 07/11] android/tester: Add HIDhost GetProtocol test
From: Ravi kumar Veeramally @ 2014-01-16 23:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1389914751-18545-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/android-tester.c | 101 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 99 insertions(+), 2 deletions(-)
diff --git a/android/android-tester.c b/android/android-tester.c
index 2adbba1..56be850 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -3195,6 +3195,64 @@ static void setup_hidhost_interface(const void *test_data)
tester_setup_complete();
}
+#define HID_GET_REPORT_PROTOCOL 0x60
+#define HID_GET_BOOT_PROTOCOL 0x61
+
+static void hid_prepare_reply_protocol_mode(const void *data, uint16_t len)
+{
+ struct test_data *t_data = tester_get_data();
+ struct bthost *bthost = hciemu_client_get_host(t_data->hciemu);
+ uint8_t pdu[2] = { 0, 0 };
+ uint16_t pdu_len = 0;
+
+ pdu_len = 2;
+ pdu[0] = 0xa0;
+ pdu[1] = 0x00;
+
+ bthost_send_cid(bthost, t_data->ctrl_handle, t_data->ctrl_cid,
+ (void *)pdu, pdu_len);
+}
+
+static void hid_intr_cid_hook_cb(const void *data, uint16_t len,
+ void *user_data)
+{
+}
+
+static void hid_intr_connect_cb(uint16_t handle, uint16_t cid, void *user_data)
+{
+ struct test_data *data = tester_get_data();
+ struct bthost *bthost = hciemu_client_get_host(data->hciemu);
+
+ data->intr_handle = handle;
+ data->intr_cid = cid;
+
+ bthost_add_cid_hook(bthost, handle, cid, hid_intr_cid_hook_cb, NULL);
+}
+
+static void hid_ctrl_cid_hook_cb(const void *data, uint16_t len,
+ void *user_data)
+{
+ uint8_t header = ((uint8_t *) data)[0];
+
+ switch (header) {
+ case HID_GET_REPORT_PROTOCOL:
+ case HID_GET_BOOT_PROTOCOL:
+ hid_prepare_reply_protocol_mode(data, len);
+ break;
+ }
+}
+
+static void hid_ctrl_connect_cb(uint16_t handle, uint16_t cid, void *user_data)
+{
+ struct test_data *data = tester_get_data();
+ struct bthost *bthost = hciemu_client_get_host(data->hciemu);
+
+ data->ctrl_handle = handle;
+ data->ctrl_cid = cid;
+
+ bthost_add_cid_hook(bthost, handle, cid, hid_ctrl_cid_hook_cb, NULL);
+}
+
static void hid_sdp_cid_hook_cb(const void *data, uint16_t len, void *user_data)
{
struct test_data *t_data = tester_get_data();
@@ -3308,9 +3366,9 @@ static void setup_hidhost_connect(const void *test_data)
/* Emulate SDP (PSM = 1) */
bthost_add_l2cap_server(bthost, 1, hid_sdp_search_cb, NULL);
/* Emulate Control Channel (PSM = 17) */
- bthost_add_l2cap_server(bthost, 17, NULL, NULL);
+ bthost_add_l2cap_server(bthost, 17, hid_ctrl_connect_cb, NULL);
/* Emulate Interrupt Channel (PSM = 19) */
- bthost_add_l2cap_server(bthost, 19, NULL, NULL);
+ bthost_add_l2cap_server(bthost, 19, hid_intr_connect_cb, NULL);
bthost_set_cmd_complete_cb(bthost, emu_powered_complete, data);
bthost_write_scan_enable(bthost, 0x03);
@@ -3354,6 +3412,41 @@ static void test_hidhost_virtual_unplug(const void *test_data)
tester_test_failed();
}
+static void hid_protocol_mode_cb(bt_bdaddr_t *bd_addr, bthh_status_t status,
+ bthh_protocol_mode_t mode)
+{
+ struct test_data *data = tester_get_data();
+ const struct hidhost_generic_data *test = data->test_data;
+
+ if (data->cb_count == test->expected_cb_count &&
+ status == test->expected_status &&
+ mode == test->expected_protocol_mode)
+ tester_test_passed();
+ else
+ tester_test_failed();
+}
+
+static const struct hidhost_generic_data hidhost_test_get_protocol = {
+ .expected_hal_cb.protocol_mode_cb = hid_protocol_mode_cb,
+ .expected_cb_count = 1,
+ .expected_protocol_mode = BTHH_BOOT_MODE,
+ .expected_status = BTHH_OK,
+};
+
+static void test_hidhost_get_protocol(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu);
+ bt_bdaddr_t bdaddr;
+ bt_status_t bt_status;
+
+ data->cb_count = 0;
+ bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr);
+ bt_status = data->if_hid->get_protocol(&bdaddr, BTHH_REPORT_MODE);
+ if (bt_status != BT_STATUS_SUCCESS)
+ tester_test_failed();
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -3711,5 +3804,9 @@ int main(int argc, char *argv[])
&hidhost_test_disconnect, setup_hidhost_connect,
test_hidhost_virtual_unplug, teardown);
+ test_bredrle("HIDHost GetProtocol Success",
+ &hidhost_test_get_protocol, setup_hidhost_connect,
+ test_hidhost_get_protocol, teardown);
+
return tester_run();
}
--
1.8.3.2
^ permalink raw reply related
* [PATCH 08/11] android/tester: Add HIDhost SetProtocol test
From: Ravi kumar Veeramally @ 2014-01-16 23:25 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1389914751-18545-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/android-tester.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 56be850..da1fc28 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -3197,6 +3197,8 @@ static void setup_hidhost_interface(const void *test_data)
#define HID_GET_REPORT_PROTOCOL 0x60
#define HID_GET_BOOT_PROTOCOL 0x61
+#define HID_SET_REPORT_PROTOCOL 0x70
+#define HID_SET_BOOT_PROTOCOL 0x71
static void hid_prepare_reply_protocol_mode(const void *data, uint16_t len)
{
@@ -3237,6 +3239,8 @@ static void hid_ctrl_cid_hook_cb(const void *data, uint16_t len,
switch (header) {
case HID_GET_REPORT_PROTOCOL:
case HID_GET_BOOT_PROTOCOL:
+ case HID_SET_REPORT_PROTOCOL:
+ case HID_SET_BOOT_PROTOCOL:
hid_prepare_reply_protocol_mode(data, len);
break;
}
@@ -3447,6 +3451,20 @@ static void test_hidhost_get_protocol(const void *test_data)
tester_test_failed();
}
+static void test_hidhost_set_protocol(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ const uint8_t *hid_addr = hciemu_get_client_bdaddr(data->hciemu);
+ bt_bdaddr_t bdaddr;
+ bt_status_t bt_status;
+
+ data->cb_count = 0;
+ bdaddr2android((const bdaddr_t *) hid_addr, &bdaddr);
+ bt_status = data->if_hid->set_protocol(&bdaddr, BTHH_REPORT_MODE);
+ if (bt_status != BT_STATUS_SUCCESS)
+ tester_test_failed();
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -3808,5 +3826,9 @@ int main(int argc, char *argv[])
&hidhost_test_get_protocol, setup_hidhost_connect,
test_hidhost_get_protocol, teardown);
+ test_bredrle("HIDHost SetProtocol Success",
+ &hidhost_test_get_protocol, setup_hidhost_connect,
+ test_hidhost_set_protocol, teardown);
+
return tester_run();
}
--
1.8.3.2
^ 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