* [PATCH] android/client: Fix uninitialized variable
From: Jerzy Kasenberg @ 2013-11-04 9:55 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jerzy Kasenberg
Pin accept variable was intended to be set to 1
only when pin was typed by user. If no pin was given
accept should be set to 0. This patch fixes this.
---
android/client/if-bt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/android/client/if-bt.c b/android/client/if-bt.c
index 43e8788..fb1b3f3 100644
--- a/android/client/if-bt.c
+++ b/android/client/if-bt.c
@@ -605,7 +605,7 @@ static void pin_reply_p(int argc, const char **argv)
bt_bdaddr_t addr;
bt_pin_code_t pin;
int pin_len = 0;
- int accept;
+ int accept = 0;
RETURN_IF_NULL(if_bluetooth);
VERIFY_ADDR_ARG(2, &addr);
--
1.7.9.5
^ permalink raw reply related
* [PATCH] android/daemon: Implement get adapter name
From: Andrei Emeltchenko @ 2013-11-04 9:39 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1383556934-5481-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
android/adapter.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/android/adapter.c b/android/adapter.c
index cb92f2f..55c495c 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -71,6 +71,8 @@ static void mgmt_local_name_changed_event(uint16_t index, uint16_t length,
{
const struct mgmt_cp_set_local_name *rp = param;
+ DBG("");
+
if (length < sizeof(*rp)) {
error("Wrong size of local name changed parameters");
return;
@@ -1016,13 +1018,14 @@ static void send_adapter_address(void)
g_free(ev);
}
-static bool get_name(void)
+static bool send_adapter_name(void)
{
- DBG("Not implemented");
+ if (!adapter->name)
+ return false;
- /* TODO: Add implementation */
+ adapter_name_changed(adapter->name);
- return false;
+ return true;
}
static bool get_uuids(void)
@@ -1097,7 +1100,7 @@ static bool get_property(void *buf, uint16_t len)
send_adapter_address();
return true;
case HAL_PROP_ADAPTER_NAME:
- return get_name();
+ return send_adapter_name();
case HAL_PROP_ADAPTER_UUIDS:
return get_uuids();
case HAL_PROP_ADAPTER_CLASS:
--
1.7.10.4
^ permalink raw reply related
* Re: [RFC] android/daemon: Implement get adapter name
From: Andrei Emeltchenko @ 2013-11-04 9:34 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1383556934-5481-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
On Mon, Nov 04, 2013 at 11:22:13AM +0200, Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Sorry, there is similar function exist, I will reuse it.
Best regards
Andrei Emeltchenko
>
> ---
> android/adapter.c | 29 ++++++++++++++++++++++++-----
> 1 file changed, 24 insertions(+), 5 deletions(-)
>
> diff --git a/android/adapter.c b/android/adapter.c
> index cb92f2f..8210d1a 100644
> --- a/android/adapter.c
> +++ b/android/adapter.c
> @@ -1016,13 +1016,32 @@ static void send_adapter_address(void)
> g_free(ev);
> }
>
> -static bool get_name(void)
> +static bool send_adapter_name(void)
> {
> - DBG("Not implemented");
> + struct hal_ev_adapter_props_changed *ev;
> + size_t len;
>
> - /* TODO: Add implementation */
> + if (!adapter->name)
> + return false;
>
> - return false;
> + len = sizeof(*ev) + sizeof(struct hal_property) +
> + strlen(adapter->name) + 1;
> +
> + ev = g_malloc0(len);
> +
> + ev->num_props = 1;
> + ev->status = HAL_STATUS_SUCCESS;
> +
> + ev->props[0].type = HAL_PROP_ADAPTER_NAME;
> + ev->props[0].len = strlen(adapter->name) + 1;
> + memcpy(&ev->props[0].val, adapter->name, strlen(adapter->name));
> +
> + ipc_send(notification_io, HAL_SERVICE_ID_BLUETOOTH,
> + HAL_EV_ADAPTER_PROPS_CHANGED, len, ev, -1);
> +
> + g_free(ev);
> +
> + return true;
> }
>
> static bool get_uuids(void)
> @@ -1097,7 +1116,7 @@ static bool get_property(void *buf, uint16_t len)
> send_adapter_address();
> return true;
> case HAL_PROP_ADAPTER_NAME:
> - return get_name();
> + return send_adapter_name();
> case HAL_PROP_ADAPTER_UUIDS:
> return get_uuids();
> case HAL_PROP_ADAPTER_CLASS:
> --
> 1.7.10.4
>
> --
> 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
^ permalink raw reply
* [PATCH BlueZ 2/2] android: Add the missing HAVE_CONFIG_H check daemon files
From: Luiz Augusto von Dentz @ 2013-11-04 9:34 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1383557698-4475-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
android/hid.c | 4 ++++
android/ipc.c | 4 ++++
android/socket.c | 4 ++++
3 files changed, 12 insertions(+)
diff --git a/android/hid.c b/android/hid.c
index 59fc90b..1ee8ed4 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -21,6 +21,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdint.h>
#include <stdbool.h>
#include <errno.h>
diff --git a/android/ipc.c b/android/ipc.c
index 1f52753..e672bf8 100644
--- a/android/ipc.c
+++ b/android/ipc.c
@@ -21,6 +21,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stddef.h>
#include <errno.h>
#include <stdint.h>
diff --git a/android/socket.c b/android/socket.c
index b6eed6e..e32be46 100644
--- a/android/socket.c
+++ b/android/socket.c
@@ -21,6 +21,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <glib.h>
#include <stdbool.h>
--
1.8.3.1
^ permalink raw reply related
* [PATCH BlueZ 1/2] android/hid: Use BT_IO_OPT_SOURCE_BDADDR whenever possible
From: Luiz Augusto von Dentz @ 2013-11-04 9:34 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
android/hid.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/android/hid.c b/android/hid.c
index e660552..59fc90b 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -661,12 +661,11 @@ void bt_hid_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf, uint16_t len)
static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
{
struct hid_device *dev;
- bdaddr_t dst;
+ bdaddr_t src, dst;
char address[18];
uint16_t psm;
GError *gerr = NULL;
GSList *l;
- const bdaddr_t *src = bt_adapter_get_address();
uuid_t uuid;
if (err) {
@@ -675,6 +674,7 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
}
bt_io_get(chan, &err,
+ BT_IO_OPT_SOURCE_BDADDR, &src,
BT_IO_OPT_DEST_BDADDR, &dst,
BT_IO_OPT_PSM, &psm,
BT_IO_OPT_INVALID);
@@ -699,7 +699,7 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
dev->uhid_fd = -1;
bt_string2uuid(&uuid, HID_UUID);
- if (bt_search_service(src, &dev->dst, &uuid,
+ if (bt_search_service(&src, &dev->dst, &uuid,
hid_sdp_search_cb, dev, NULL) < 0) {
error("failed to search sdp details");
hid_device_free(dev);
@@ -732,12 +732,14 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
bool bt_hid_register(GIOChannel *io, const bdaddr_t *addr)
{
GError *err = NULL;
+ const bdaddr_t *src = bt_adapter_get_address();
DBG("");
notification_io = g_io_channel_ref(io);
ctrl_io = bt_io_listen(connect_cb, NULL, NULL, NULL, &err,
+ BT_IO_OPT_SOURCE_BDADDR, &src,
BT_IO_OPT_PSM, L2CAP_PSM_HIDP_CTRL,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
BT_IO_OPT_INVALID);
@@ -748,6 +750,7 @@ bool bt_hid_register(GIOChannel *io, const bdaddr_t *addr)
}
intr_io = bt_io_listen(connect_cb, NULL, NULL, NULL, &err,
+ BT_IO_OPT_SOURCE_BDADDR, &src,
BT_IO_OPT_PSM, L2CAP_PSM_HIDP_INTR,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_LOW,
BT_IO_OPT_INVALID);
--
1.8.3.1
^ permalink raw reply related
* [PATCH] Fix incorrect result type in set_adapter_name
From: Marcin Kraglak @ 2013-11-04 9:31 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcin Kraglak
diff --git a/android/adapter.c b/android/adapter.c
index af62b11..38dec9d 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -880,7 +880,7 @@ static void set_adapter_name_complete(uint8_t status, uint16_t length,
adapter_name_changed(rp->name);
}
-static bool set_adapter_name(uint8_t *name, uint16_t len)
+static uint8_t set_adapter_name(uint8_t *name, uint16_t len)
{
struct mgmt_cp_set_local_name cp;
@@ -890,11 +890,11 @@ static bool set_adapter_name(uint8_t *name, uint16_t len)
if (mgmt_send(adapter->mgmt, MGMT_OP_SET_LOCAL_NAME, adapter->index,
sizeof(cp), &cp, set_adapter_name_complete, NULL,
NULL) > 0)
- return true;
+ return HAL_STATUS_SUCCESS;
error("Failed to set name");
- return false;
+ return HAL_STATUS_FAILED;
}
static void read_info_complete(uint8_t status, uint16_t length, const void *param,
--
1.8.4.1
^ permalink raw reply related
* [RFC] android/daemon: Implement get adapter name
From: Andrei Emeltchenko @ 2013-11-04 9:22 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
android/adapter.c | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/android/adapter.c b/android/adapter.c
index cb92f2f..8210d1a 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -1016,13 +1016,32 @@ static void send_adapter_address(void)
g_free(ev);
}
-static bool get_name(void)
+static bool send_adapter_name(void)
{
- DBG("Not implemented");
+ struct hal_ev_adapter_props_changed *ev;
+ size_t len;
- /* TODO: Add implementation */
+ if (!adapter->name)
+ return false;
- return false;
+ len = sizeof(*ev) + sizeof(struct hal_property) +
+ strlen(adapter->name) + 1;
+
+ ev = g_malloc0(len);
+
+ ev->num_props = 1;
+ ev->status = HAL_STATUS_SUCCESS;
+
+ ev->props[0].type = HAL_PROP_ADAPTER_NAME;
+ ev->props[0].len = strlen(adapter->name) + 1;
+ memcpy(&ev->props[0].val, adapter->name, strlen(adapter->name));
+
+ ipc_send(notification_io, HAL_SERVICE_ID_BLUETOOTH,
+ HAL_EV_ADAPTER_PROPS_CHANGED, len, ev, -1);
+
+ g_free(ev);
+
+ return true;
}
static bool get_uuids(void)
@@ -1097,7 +1116,7 @@ static bool get_property(void *buf, uint16_t len)
send_adapter_address();
return true;
case HAL_PROP_ADAPTER_NAME:
- return get_name();
+ return send_adapter_name();
case HAL_PROP_ADAPTER_UUIDS:
return get_uuids();
case HAL_PROP_ADAPTER_CLASS:
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH] android/client: Fix pin reply call when pin argument missing in cmd
From: Jerzy Kasenberg @ 2013-11-04 8:40 UTC (permalink / raw)
To: Ravi kumar Veeramally, linux-bluetooth
In-Reply-To: <20131101131141.GA30191@x220.p-661hnu-f1>
Hi Ravi,
On 1 November 2013 14:11, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi Ravi,
>
> On Fri, Nov 01, 2013, Ravi kumar Veeramally wrote:
>> If condition checks number of arguments properly but still executes
>> EXEC command. It should display error message and return.
>> ---
>> android/client/if-bt.c | 11 +++++++----
>> 1 file changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/android/client/if-bt.c b/android/client/if-bt.c
>> index 3d97458..2c3cc4a 100644
>> --- a/android/client/if-bt.c
>> +++ b/android/client/if-bt.c
>> @@ -719,12 +719,15 @@ static void pin_reply_p(int argc, const char **argv)
>> RETURN_IF_NULL(if_bluetooth);
>> VERIFY_ADDR_ARG(2, &addr);
>>
>> - if (argc > 3) {
>> - accept = 1;
>> - pin_len = strlen(argv[3]);
>> - memcpy(pin.pin, argv[3], pin_len);
>> + if (argc != 4) {
>> + haltest_error("Usage <address> <pin>\n");
>> + return;
>> }
>>
>> + accept = 1;
>> + pin_len = strlen(argv[3]);
>> + memcpy(pin.pin, argv[3], pin_len);
>> +
>> EXEC(if_bluetooth->pin_reply, &addr, accept, pin_len, &pin);
>
> It seems to me that the original code might have been trying to do (if
> it hadn't been broken like it now is) a negative pin reply in the case
> that no parameter was given. At least I don't see any other code trying
> to call if_bluetooth->pin_reply with accept=1 in haltest. So I'd
> consider fixing that instead.
Idea here was: no pin given set accept to 0, so user would not need to
type accept argument at all.
What is missing though, is initialization of accept to 0.
--
Jerzy
^ permalink raw reply
* Re: [PATCHv3 4/4] android: Pass found uuids to remote_device_properties_cb
From: Szymon Janc @ 2013-11-04 8:32 UTC (permalink / raw)
To: Marcin Kraglak; +Cc: linux-bluetooth
In-Reply-To: <1383552410-2220-4-git-send-email-marcin.kraglak@tieto.com>
Hi Marcin,
> diff --git a/android/adapter.c b/android/adapter.c
> index 0470522..9fe7d7d 100644
> --- a/android/adapter.c
> +++ b/android/adapter.c
> @@ -1486,9 +1486,87 @@ static void browse_req_free(struct browse_req *req)
> g_free(req);
> }
>
> +static void fill_uuids(GSList *list, void *buf)
> +{
> + for (; list; list = (GSList *)g_list_next(list)) {
This should use g_slist_next().
> + memcpy(buf, list->data, sizeof(uint128_t));
> + buf += sizeof(uint128_t);
> + }
> +}
> +
> +static void remote_uuids_callback(struct browse_req *req)
> +{
> + struct hal_ev_remote_device_props *ev;
> + int len;
> +
> + len = sizeof(*ev) + sizeof(struct hal_property) + (sizeof(uint128_t) *
> + g_slist_length(req->uuids));
> + ev = g_malloc(len);
> +
> + ev->status = HAL_STATUS_SUCCESS;
> + bdaddr2android(req->bdaddr, &ev->bdaddr);
> + ev->num_props = 1;
> + ev->props[0].type = HAL_PROP_DEVICE_UUIDS;
> + ev->props[0].len = sizeof(uint128_t) * g_slist_length(req->uuids);
> + fill_uuids(req->uuids, ev->props[0].val);
> +
> + ipc_send(notification_io, HAL_SERVICE_ID_BLUETOOTH,
> + HAL_EV_REMOTE_DEVICE_PROPS, len, ev, -1);
> +
> + g_free(ev);
> +}
> +
> +static int uuid_128_cmp(gconstpointer a, gconstpointer b)
> +{
> + return memcmp(a, b, sizeof(uint128_t));
> +}
> +
> static void update_records(struct browse_req *req, sdp_list_t *recs)
> {
> - /* TODO cache found uuids */
> + for (; recs; recs = recs->next) {
> + sdp_record_t *rec = (sdp_record_t *) recs->data;
> + sdp_list_t *svcclass = NULL;
> + uuid_t uuid128;
> + uuid_t *temp;
> + uint8_t *u;
> +
> + if (!rec)
> + break;
> +
> + if (sdp_get_service_classes(rec, &svcclass) < 0)
> + continue;
> +
> + if (svcclass == NULL)
> + continue;
> +
> + temp = svcclass->data;
> +
> + switch (temp->type) {
> + case SDP_UUID16:
> + sdp_uuid16_to_uuid128(&uuid128, temp);
> + break;
> + case SDP_UUID32:
> + sdp_uuid32_to_uuid128(&uuid128, temp);
> + break;
> + case SDP_UUID128:
> + memcpy(&uuid128, temp, sizeof(uuid_t));
> + break;
> + default:
> + continue;
> + }
> +
> + u = g_malloc(16);/* size of 128 bit uuid */
> + memcpy(u, &uuid128.value.uuid128,
> + sizeof(uuid128.value.uuid128));
> +
> + /* Check if uuid is already added */
> + if (g_slist_find_custom(req->uuids, u, uuid_128_cmp))
> + g_free(u);
> + else
> + req->uuids = g_slist_append(req->uuids, u);
> +
> + sdp_list_free(svcclass, free);
> + }
> }
>
> static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
> @@ -1518,6 +1596,7 @@ static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
> }
>
> done:
> + remote_uuids_callback(req);
> sdp_req_list = g_list_remove(sdp_req_list, req->bdaddr);
> browse_req_free(req);
> }
>
--
BR
Szymon Janc
^ permalink raw reply
* Re: [PATCHv3 2/4] android: Add stub of get_remote_services command
From: Johan Hedberg @ 2013-11-04 8:24 UTC (permalink / raw)
To: Marcin Kraglak; +Cc: linux-bluetooth
In-Reply-To: <1383552410-2220-2-git-send-email-marcin.kraglak@tieto.com>
Hi Marcin,
On Mon, Nov 04, 2013, Marcin Kraglak wrote:
> diff --git a/android/adapter.c b/android/adapter.c
> index 6f2a061..af62b11 100644
> --- a/android/adapter.c
> +++ b/android/adapter.c
> @@ -1459,6 +1459,11 @@ static uint8_t ssp_reply(void *buf, uint16_t len)
> return status;
> }
>
> +static uint8_t get_remote_services(void *buf, uint16_t len)
> +{
> + return HAL_STATUS_UNSUPPORTED;
> +}
> +
> void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
> uint16_t len)
> {
> @@ -1563,6 +1568,11 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
> goto error;
>
> break;
> + case HAL_OP_GET_REMOTE_SERVICES:
> + status = get_remote_services(buf, len);
> + if (status != HAL_STATUS_SUCCESS)
> + goto error;
> + break;
> default:
> DBG("Unhandled command, opcode 0x%x", opcode);
> goto error;
The first two patches have been applied. I still need to do a more
thorough review of the other two before applying, and right this moment
I didn't have time for that.
Johan
^ permalink raw reply
* [PATCHv3 4/4] android: Pass found uuids to remote_device_properties_cb
From: Marcin Kraglak @ 2013-11-04 8:06 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcin Kraglak
In-Reply-To: <1383552410-2220-1-git-send-email-marcin.kraglak@tieto.com>
diff --git a/android/adapter.c b/android/adapter.c
index 0470522..9fe7d7d 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -1486,9 +1486,87 @@ static void browse_req_free(struct browse_req *req)
g_free(req);
}
+static void fill_uuids(GSList *list, void *buf)
+{
+ for (; list; list = (GSList *)g_list_next(list)) {
+ memcpy(buf, list->data, sizeof(uint128_t));
+ buf += sizeof(uint128_t);
+ }
+}
+
+static void remote_uuids_callback(struct browse_req *req)
+{
+ struct hal_ev_remote_device_props *ev;
+ int len;
+
+ len = sizeof(*ev) + sizeof(struct hal_property) + (sizeof(uint128_t) *
+ g_slist_length(req->uuids));
+ ev = g_malloc(len);
+
+ ev->status = HAL_STATUS_SUCCESS;
+ bdaddr2android(req->bdaddr, &ev->bdaddr);
+ ev->num_props = 1;
+ ev->props[0].type = HAL_PROP_DEVICE_UUIDS;
+ ev->props[0].len = sizeof(uint128_t) * g_slist_length(req->uuids);
+ fill_uuids(req->uuids, ev->props[0].val);
+
+ ipc_send(notification_io, HAL_SERVICE_ID_BLUETOOTH,
+ HAL_EV_REMOTE_DEVICE_PROPS, len, ev, -1);
+
+ g_free(ev);
+}
+
+static int uuid_128_cmp(gconstpointer a, gconstpointer b)
+{
+ return memcmp(a, b, sizeof(uint128_t));
+}
+
static void update_records(struct browse_req *req, sdp_list_t *recs)
{
- /* TODO cache found uuids */
+ for (; recs; recs = recs->next) {
+ sdp_record_t *rec = (sdp_record_t *) recs->data;
+ sdp_list_t *svcclass = NULL;
+ uuid_t uuid128;
+ uuid_t *temp;
+ uint8_t *u;
+
+ if (!rec)
+ break;
+
+ if (sdp_get_service_classes(rec, &svcclass) < 0)
+ continue;
+
+ if (svcclass == NULL)
+ continue;
+
+ temp = svcclass->data;
+
+ switch (temp->type) {
+ case SDP_UUID16:
+ sdp_uuid16_to_uuid128(&uuid128, temp);
+ break;
+ case SDP_UUID32:
+ sdp_uuid32_to_uuid128(&uuid128, temp);
+ break;
+ case SDP_UUID128:
+ memcpy(&uuid128, temp, sizeof(uuid_t));
+ break;
+ default:
+ continue;
+ }
+
+ u = g_malloc(16);/* size of 128 bit uuid */
+ memcpy(u, &uuid128.value.uuid128,
+ sizeof(uuid128.value.uuid128));
+
+ /* Check if uuid is already added */
+ if (g_slist_find_custom(req->uuids, u, uuid_128_cmp))
+ g_free(u);
+ else
+ req->uuids = g_slist_append(req->uuids, u);
+
+ sdp_list_free(svcclass, free);
+ }
}
static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
@@ -1518,6 +1596,7 @@ static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
}
done:
+ remote_uuids_callback(req);
sdp_req_list = g_list_remove(sdp_req_list, req->bdaddr);
browse_req_free(req);
}
--
1.8.4.1
^ permalink raw reply related
* [PATCHv3 3/4] android: Initial implementation of get_remote_services
From: Marcin Kraglak @ 2013-11-04 8:06 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcin Kraglak
In-Reply-To: <1383552410-2220-1-git-send-email-marcin.kraglak@tieto.com>
diff --git a/android/adapter.c b/android/adapter.c
index af62b11..0470522 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -35,6 +35,10 @@
#include "src/shared/mgmt.h"
#include "src/glib-helper.h"
#include "src/eir.h"
+#include "lib/sdp.h"
+#include "lib/sdp_lib.h"
+#include "lib/uuid.h"
+#include "src/sdp-client.h"
#include "log.h"
#include "hal-msg.h"
#include "ipc.h"
@@ -45,6 +49,8 @@
#define DEFAULT_IO_CAPABILITY 0x01
static GIOChannel *notification_io = NULL;
+/* This list contains addresses which are asked for records */
+static GList *sdp_req_list;
struct bt_adapter {
uint16_t index;
@@ -63,6 +69,20 @@ struct bt_adapter {
bool discovering;
};
+struct browse_req {
+ bdaddr_t *bdaddr;
+ GSList *uuids;
+ int search_uuid;
+ int reconnect_attempt;
+};
+
+static const uint16_t uuid_list[] = {
+ L2CAP_UUID,
+ PNP_INFO_SVCLASS_ID,
+ PUBLIC_BROWSE_GROUP,
+ 0
+};
+
static struct bt_adapter *adapter;
static GSList *found_devices = NULL;
@@ -1459,9 +1479,80 @@ static uint8_t ssp_reply(void *buf, uint16_t len)
return status;
}
+static void browse_req_free(struct browse_req *req)
+{
+ g_free(req->bdaddr);
+ g_slist_free_full(req->uuids, g_free);
+ g_free(req);
+}
+
+static void update_records(struct browse_req *req, sdp_list_t *recs)
+{
+ /* TODO cache found uuids */
+}
+
+static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
+{
+ struct browse_req *req = user_data;
+ uuid_t uuid;
+
+ /* If we have a valid response and req->search_uuid == 2, then L2CAP
+ * UUID & PNP searching was successful -- we are done */
+ if (err < 0 || req->search_uuid == 2) {
+ if (err == -ECONNRESET && req->reconnect_attempt < 1) {
+ req->search_uuid--;
+ req->reconnect_attempt++;
+ } else {
+ goto done;
+ }
+ }
+
+ update_records(req, recs);
+
+ /* Search for mandatory uuids */
+ if (uuid_list[req->search_uuid]) {
+ sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]);
+ bt_search_service(&adapter->bdaddr, req->bdaddr, &uuid,
+ browse_cb, user_data, NULL);
+ return;
+ }
+
+done:
+ sdp_req_list = g_list_remove(sdp_req_list, req->bdaddr);
+ browse_req_free(req);
+}
+
static uint8_t get_remote_services(void *buf, uint16_t len)
{
- return HAL_STATUS_UNSUPPORTED;
+ struct hal_cmd_get_remote_services *cmd = buf;
+ struct browse_req *req;
+ bdaddr_t *addr;
+ uuid_t uuid;
+ int err;
+
+ addr = g_new0(bdaddr_t, 1);
+ android2bdaddr(&cmd->bdaddr, addr);
+
+ if (g_list_find_custom(sdp_req_list, addr, bdaddr_cmp)) {
+ g_free(addr);
+ return HAL_STATUS_DONE;
+ }
+
+ sdp_req_list = g_list_append(sdp_req_list, addr);
+
+ req = g_new0(struct browse_req, 1);
+ req->bdaddr = addr;
+ sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]);
+
+ err = bt_search_service(&adapter->bdaddr,
+ req->bdaddr, &uuid, browse_cb, req, NULL);
+ if (err) {
+ sdp_req_list = g_list_remove(sdp_req_list, req->bdaddr);
+ browse_req_free(req);
+ return HAL_STATUS_FAILED;
+ }
+
+ return HAL_STATUS_SUCCESS;
}
void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
--
1.8.4.1
^ permalink raw reply related
* [PATCHv3 2/4] android: Add stub of get_remote_services command
From: Marcin Kraglak @ 2013-11-04 8:06 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcin Kraglak
In-Reply-To: <1383552410-2220-1-git-send-email-marcin.kraglak@tieto.com>
diff --git a/android/adapter.c b/android/adapter.c
index 6f2a061..af62b11 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -1459,6 +1459,11 @@ static uint8_t ssp_reply(void *buf, uint16_t len)
return status;
}
+static uint8_t get_remote_services(void *buf, uint16_t len)
+{
+ return HAL_STATUS_UNSUPPORTED;
+}
+
void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
uint16_t len)
{
@@ -1563,6 +1568,11 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
goto error;
break;
+ case HAL_OP_GET_REMOTE_SERVICES:
+ status = get_remote_services(buf, len);
+ if (status != HAL_STATUS_SUCCESS)
+ goto error;
+ break;
default:
DBG("Unhandled command, opcode 0x%x", opcode);
goto error;
--
1.8.4.1
^ permalink raw reply related
* [PATCHv3 1/4] android/hal: Send get_remote_services cmd
From: Marcin Kraglak @ 2013-11-04 8:06 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcin Kraglak
diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c
index 7334d24..88c7b99 100644
--- a/android/hal-bluetooth.c
+++ b/android/hal-bluetooth.c
@@ -515,12 +515,18 @@ static int get_remote_service_record(bt_bdaddr_t *remote_addr, bt_uuid_t *uuid)
static int get_remote_services(bt_bdaddr_t *remote_addr)
{
+ struct hal_cmd_get_remote_services cmd;
+
DBG("bdaddr: %s", bdaddr2str(remote_addr));
if (!interface_ready())
return BT_STATUS_NOT_READY;
- return BT_STATUS_UNSUPPORTED;
+ memcpy(cmd.bdaddr, remote_addr, sizeof(cmd.bdaddr));
+
+ return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH,
+ HAL_OP_GET_REMOTE_SERVICES, sizeof(cmd), &cmd, 0,
+ NULL, NULL);
}
static int start_discovery(void)
--
1.8.4.1
^ permalink raw reply related
* Re: [PATCH] btusb: add realtek 8723 in the blacklist
From: Marcel Holtmann @ 2013-11-04 7:49 UTC (permalink / raw)
To: Bruce.Ma; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <52774AB7.1010609@canonical.com>
Hi Bruce,
> From: Bruce Ma <bruce.ma@canonical.com>
> Date: Tue, 04 Nov 2013 11:21:20 +0800
> Subject: [PATCH] btusb: add Realtek 8723 in the blacklist
>
> The btusb doesn't work with Realtek 8723 bluetooth device,
> so we want to add it to the blacklist.
this is the same answer as last time. I do not randomly blacklist devices for out of tree drivers. Changing the commit message to make this look more innocent is not going to help.
Someone has to do the real work and get the Realtek support integrated into btusb.ko driver.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] btusb: add realtek 8723 in the blacklist
From: Johan Hedberg @ 2013-11-04 7:47 UTC (permalink / raw)
To: Bruce.Ma; +Cc: linux-bluetooth
In-Reply-To: <52774AB7.1010609@canonical.com>
Hi Bruce,
On Mon, Nov 04, 2013, Bruce.Ma wrote:
> From: Bruce Ma <bruce.ma@canonical.com>
> Date: Tue, 04 Nov 2013 11:21:20 +0800
> Subject: [PATCH] btusb: add Realtek 8723 in the blacklist
>
> The btusb doesn't work with Realtek 8723 bluetooth device,
> so we want to add it to the blacklist.
>
> Signed-off-by: Bruce Ma <bruce.ma@canonical.com>
> ---
> drivers/bluetooth/btusb.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index eae58a1..3097ac8 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -138,6 +138,9 @@ static struct usb_device_id blacklist_table[] = {
> { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
> { USB_DEVICE(0x0489, 0xe027), .driver_info = BTUSB_IGNORE },
> + /* Realtek 8723 Bluetooth */
> + { USB_DEVICE(0x0bda, 0xb728), .driver_info = BTUSB_IGNORE },
> +
> /* Atheros AR9285 Malbec with sflash firmware */
> { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
> -- 1.8.1.2
I suppose after adding the device to the blacklist it still doesn't
work? :)
What I mean is, what's the value of this patch if the experience the
user gets is the same both with and without it? Wouldn't it make more
sense to put some effort into fixing btusb so that this hardware *does*
work with it, or alternatively providing a separate driver to support
the hardware (after which it *would* be ok to add the id to the btusb
blacklist).
Johan
^ permalink raw reply
* Re: [PATCHv5 0/7] Improve logging for Android
From: Johan Hedberg @ 2013-11-04 7:34 UTC (permalink / raw)
To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1383319159-13060-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
On Fri, Nov 01, 2013, Andrei Emeltchenko wrote:
> Logging on Android is really important since we do not have specification
> how and in which order hal functions are called, sometimes the only way is
> to examine logs or read Java Bluetooth code.
>
> Changes:
> * v5: Rebased against latest upstream and merged some patches, added several logs.
> * v4: Rebased against latest upstream
> * v3: Merged first two patches.
> * v2: Added thread-safe helpers for printing properties, bdaddr, etc
> after comments that simple printing is not thread-safe. The idea is to
> use TLS (thread local storage) like bionic is doing for strerror for
> example. More info can be found on manpage for pthread_key_create.
>
> This patch series uses debug functions defined already for haltest and
> allows to print very helpful logs on Android target like shown below:
>
> ...
> hal-bluetooth.c:set_adapter_property() prop: type=BT_PROPERTY_ADAPTER_SCAN_MODE len=4 val=BT_SCAN_MODE_NONE
> ...
>
> Andrei Emeltchenko (7):
> android/haltest: Export print property
> android/haltest: Use pointer as parameter for debug
> android/haltest: Fix print device name
> android/hal: Add extra logs to HAL
> android: Add thread-safe helpers
> android: Use thread-safe helpers
> android/daemon: Add logs to trace failed cmd
>
> android/adapter.c | 2 +
> android/client/if-bt.c | 111 +------------------------------------------
> android/client/textconv.c | 114 +++++++++++++++++++++++++++++++++++++++++++++
> android/client/textconv.h | 3 ++
> android/hal-bluetooth.c | 34 +++++++++-----
> android/pthread-local.h | 58 +++++++++++++++++++++++
> 6 files changed, 200 insertions(+), 122 deletions(-)
> create mode 100644 android/pthread-local.h
Patches 1-4 and patch 7 (with a minor modification) have been applied.
Thanks.
Johan
^ permalink raw reply
* [PATCHv2 5/5] android: Pass found uuids to remote_device_properties_cb
From: Marcin Kraglak @ 2013-11-04 7:30 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcin Kraglak
In-Reply-To: <1383550234-14790-1-git-send-email-marcin.kraglak@tieto.com>
diff --git a/android/adapter.c b/android/adapter.c
index 689dd54..0b6fc43 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -1486,9 +1486,87 @@ static void browse_req_free(struct browse_req *req)
g_free(req);
}
+static void fill_uuids(GSList *list, void *buf)
+{
+ for (; list; list = (GSList *)g_list_next(list)) {
+ memcpy(buf, list->data, sizeof(uint128_t));
+ buf += sizeof(uint128_t);
+ }
+}
+
+static void remote_uuids_callback(struct browse_req *req)
+{
+ struct hal_ev_remote_device_props *ev;
+ int len;
+
+ len = sizeof(*ev) + sizeof(struct hal_property) + (sizeof(uint128_t) *
+ g_slist_length(req->uuids));
+ ev = g_malloc(len);
+
+ ev->status = HAL_STATUS_SUCCESS;
+ bdaddr2android(req->bdaddr, &ev->bdaddr);
+ ev->num_props = 1;
+ ev->props[0].type = HAL_PROP_DEVICE_UUIDS;
+ ev->props[0].len = sizeof(uint128_t) * g_slist_length(req->uuids);
+ fill_uuids(req->uuids, ev->props[0].val);
+
+ ipc_send(notification_io, HAL_SERVICE_ID_BLUETOOTH,
+ HAL_EV_REMOTE_DEVICE_PROPS, len, ev, -1);
+
+ g_free(ev);
+}
+
+static int uuid_128_cmp(gconstpointer a, gconstpointer b)
+{
+ return memcmp(a, b, sizeof(uint128_t));
+}
+
static void update_records(struct browse_req *req, sdp_list_t *recs)
{
- /* TODO cache found uuids */
+ for (; recs; recs = recs->next) {
+ sdp_record_t *rec = (sdp_record_t *) recs->data;
+ sdp_list_t *svcclass = NULL;
+ uuid_t uuid128;
+ uuid_t *temp;
+ uint8_t *u;
+
+ if (!rec)
+ break;
+
+ if (sdp_get_service_classes(rec, &svcclass) < 0)
+ continue;
+
+ if (svcclass == NULL)
+ continue;
+
+ temp = svcclass->data;
+
+ switch (temp->type) {
+ case SDP_UUID16:
+ sdp_uuid16_to_uuid128(&uuid128, temp);
+ break;
+ case SDP_UUID32:
+ sdp_uuid32_to_uuid128(&uuid128, temp);
+ break;
+ case SDP_UUID128:
+ memcpy(&uuid128, temp, sizeof(uuid_t));
+ break;
+ default:
+ continue;
+ }
+
+ u = g_malloc(16);/* size of 128 bit uuid */
+ memcpy(u, &uuid128.value.uuid128,
+ sizeof(uuid128.value.uuid128));
+
+ /* Check if uuid is already added */
+ if (g_slist_find_custom(req->uuids, u, uuid_128_cmp))
+ g_free(u);
+ else
+ req->uuids = g_slist_append(req->uuids, u);
+
+ sdp_list_free(svcclass, free);
+ }
}
static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
@@ -1518,6 +1596,7 @@ static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
}
done:
+ remote_uuids_callback(req);
sdp_req_list = g_list_remove(sdp_req_list, req->bdaddr);
browse_req_free(req);
}
--
1.8.4.1
^ permalink raw reply related
* [PATCHv2 4/5] android: Initial implementation of get_remote_services
From: Marcin Kraglak @ 2013-11-04 7:30 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcin Kraglak
In-Reply-To: <1383550234-14790-1-git-send-email-marcin.kraglak@tieto.com>
diff --git a/android/adapter.c b/android/adapter.c
index 8df59e6..689dd54 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -35,6 +35,10 @@
#include "src/shared/mgmt.h"
#include "src/glib-helper.h"
#include "src/eir.h"
+#include "lib/sdp.h"
+#include "lib/sdp_lib.h"
+#include "lib/uuid.h"
+#include "src/sdp-client.h"
#include "log.h"
#include "hal-msg.h"
#include "ipc.h"
@@ -45,6 +49,8 @@
#define DEFAULT_IO_CAPABILITY 0x01
static GIOChannel *notification_io = NULL;
+/* This list contains addresses which are asked for records */
+static GList *sdp_req_list;
struct bt_adapter {
uint16_t index;
@@ -63,6 +69,20 @@ struct bt_adapter {
bool discovering;
};
+struct browse_req {
+ bdaddr_t *bdaddr;
+ GSList *uuids;
+ int search_uuid;
+ int reconnect_attempt;
+};
+
+static const uint16_t uuid_list[] = {
+ L2CAP_UUID,
+ PNP_INFO_SVCLASS_ID,
+ PUBLIC_BROWSE_GROUP,
+ 0
+};
+
static struct bt_adapter *adapter;
static GSList *found_devices = NULL;
@@ -1459,9 +1479,80 @@ static uint8_t ssp_reply(void *buf, uint16_t len)
return status;
}
+static void browse_req_free(struct browse_req *req)
+{
+ g_free(req->bdaddr);
+ g_slist_free_full(req->uuids, g_free);
+ g_free(req);
+}
+
+static void update_records(struct browse_req *req, sdp_list_t *recs)
+{
+ /* TODO cache found uuids */
+}
+
+static void browse_cb(sdp_list_t *recs, int err, gpointer user_data)
+{
+ struct browse_req *req = user_data;
+ uuid_t uuid;
+
+ /* If we have a valid response and req->search_uuid == 2, then L2CAP
+ * UUID & PNP searching was successful -- we are done */
+ if (err < 0 || req->search_uuid == 2) {
+ if (err == -ECONNRESET && req->reconnect_attempt < 1) {
+ req->search_uuid--;
+ req->reconnect_attempt++;
+ } else {
+ goto done;
+ }
+ }
+
+ update_records(req, recs);
+
+ /* Search for mandatory uuids */
+ if (uuid_list[req->search_uuid]) {
+ sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]);
+ bt_search_service(&adapter->bdaddr, req->bdaddr, &uuid,
+ browse_cb, user_data, NULL);
+ return;
+ }
+
+done:
+ sdp_req_list = g_list_remove(sdp_req_list, req->bdaddr);
+ browse_req_free(req);
+}
+
static uint8_t get_remote_services(void *buf, uint16_t len)
{
- return HAL_STATUS_UNSUPPORTED;
+ struct hal_cmd_get_remote_services *cmd = buf;
+ struct browse_req *req;
+ bdaddr_t *addr;
+ uuid_t uuid;
+ int err;
+
+ addr = g_new0(bdaddr_t, 1);
+ android2bdaddr(&cmd->bdaddr, addr);
+
+ if (g_list_find_custom(sdp_req_list, addr, bdaddr_cmp)) {
+ g_free(addr);
+ return HAL_STATUS_DONE;
+ }
+
+ sdp_req_list = g_list_append(sdp_req_list, addr);
+
+ req = g_new0(struct browse_req, 1);
+ req->bdaddr = addr;
+ sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]);
+
+ err = bt_search_service(&adapter->bdaddr,
+ req->bdaddr, &uuid, browse_cb, req, NULL);
+ if (err) {
+ sdp_req_list = g_list_remove(sdp_req_list, req->bdaddr);
+ browse_req_free(req);
+ return HAL_STATUS_FAILED;
+ }
+
+ return HAL_STATUS_SUCCESS;
}
void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
--
1.8.4.1
^ permalink raw reply related
* [PATCHv2 3/5] android: Add stub of get_remote_services command
From: Marcin Kraglak @ 2013-11-04 7:30 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcin Kraglak
In-Reply-To: <1383550234-14790-1-git-send-email-marcin.kraglak@tieto.com>
diff --git a/android/adapter.c b/android/adapter.c
index 0797aa0..8df59e6 100644
--- a/android/adapter.c
+++ b/android/adapter.c
@@ -1459,6 +1459,11 @@ static uint8_t ssp_reply(void *buf, uint16_t len)
return status;
}
+static uint8_t get_remote_services(void *buf, uint16_t len)
+{
+ return HAL_STATUS_UNSUPPORTED;
+}
+
void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
uint16_t len)
{
@@ -1563,6 +1568,11 @@ void bt_adapter_handle_cmd(GIOChannel *io, uint8_t opcode, void *buf,
goto error;
break;
+ case HAL_OP_GET_REMOTE_SERVICES:
+ status = get_remote_services(buf, len);
+ if (status != HAL_STATUS_SUCCESS)
+ goto error;
+ break;
default:
DBG("Unhandled command, opcode 0x%x", opcode);
goto error;
--
1.8.4.1
^ permalink raw reply related
* [PATCHv2 2/5] android/hal: Send get_remote_services cmd
From: Marcin Kraglak @ 2013-11-04 7:30 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcin Kraglak
In-Reply-To: <1383550234-14790-1-git-send-email-marcin.kraglak@tieto.com>
diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c
index 5fb8846..9022fc2 100644
--- a/android/hal-bluetooth.c
+++ b/android/hal-bluetooth.c
@@ -505,12 +505,18 @@ static int get_remote_service_record(bt_bdaddr_t *remote_addr, bt_uuid_t *uuid)
static int get_remote_services(bt_bdaddr_t *remote_addr)
{
+ struct hal_cmd_get_remote_services cmd;
+
DBG("");
if (!interface_ready())
return BT_STATUS_NOT_READY;
- return BT_STATUS_UNSUPPORTED;
+ memcpy(cmd.bdaddr, remote_addr, sizeof(cmd.bdaddr));
+
+ return hal_ipc_cmd(HAL_SERVICE_ID_BLUETOOTH,
+ HAL_OP_GET_REMOTE_SERVICES, sizeof(cmd),
+ &cmd, 0, NULL, NULL);
}
static int start_discovery(void)
--
1.8.4.1
^ permalink raw reply related
* [PATCHv2 1/5] android: Fix typo in get_remote_services command
From: Marcin Kraglak @ 2013-11-04 7:30 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcin Kraglak
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 1587ff2..f381862 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -148,8 +148,8 @@ struct hal_cmd_get_remote_service_rec {
uint8_t uuid[16];
} __attribute__((packed));
-#define HAL_OP_GET_REMOTE_SERVICE 0x0a
-struct hal_cmd_get_remote_service {
+#define HAL_OP_GET_REMOTE_SERVICES 0x0a
+struct hal_cmd_get_remote_services {
uint8_t bdaddr[6];
} __attribute__((packed));
--
1.8.4.1
^ permalink raw reply related
* [PATCH] btusb: add realtek 8723 in the blacklist
From: Bruce.Ma @ 2013-11-04 7:20 UTC (permalink / raw)
To: linux-bluetooth
From: Bruce Ma <bruce.ma@canonical.com>
Date: Tue, 04 Nov 2013 11:21:20 +0800
Subject: [PATCH] btusb: add Realtek 8723 in the blacklist
The btusb doesn't work with Realtek 8723 bluetooth device,
so we want to add it to the blacklist.
Signed-off-by: Bruce Ma <bruce.ma@canonical.com>
---
drivers/bluetooth/btusb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index eae58a1..3097ac8 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -138,6 +138,9 @@ static struct usb_device_id blacklist_table[] = {
{ USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
{ USB_DEVICE(0x0489, 0xe027), .driver_info = BTUSB_IGNORE },
+ /* Realtek 8723 Bluetooth */
+ { USB_DEVICE(0x0bda, 0xb728), .driver_info = BTUSB_IGNORE },
+
/* Atheros AR9285 Malbec with sflash firmware */
{ USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
-- 1.8.1.2
^ permalink raw reply related
* Re: Intel 7260 bluetooth malfunction when it is connected to EHCI bus
From: Hui Wang @ 2013-11-04 5:59 UTC (permalink / raw)
To: Marcel Holtmann
Cc: Tedd An, Johan Hedberg, xiong.y.zhang, Gustavo F. Padovan,
linux-bluetooth@vger.kernel.org development, Kun Yang,
Anthony Wong
In-Reply-To: <9DFD9618-158E-41C4-8183-134A3FC4E61F@holtmann.org>
On 11/03/2013 03:05 AM, Marcel Holtmann wrote:
> Hi Hui,
>
<snip>
>>
>> The attachment lenovo-k4450-btmon-v1.log is the log of intel 7260 init procedure + scan headset + connect headset + play sound.
> I looked through the logs and the controller init is just fine. So in theory this should route the SCO audio frames over HCI. For some reason it does not and I have no idea why not.
>
> That it makes a different between EHCI and XHCI is strange. I can not explain this. Maybe Tedd can help you since I have no further insights in our chips at this moment.
Thanks Marcel for your kind help and analysis.
Tedd, did you reproduce this issue on the machines with intel 7260 BT
module connected to the EHCI bus? Did you have any idea on this issue?
Thanks,
Hui.
>
> Regards
>
> Marcel
>
>
^ permalink raw reply
* [PATCH] tools/hci2hid: properly format device path
From: Matthew Monaco @ 2013-11-04 1:46 UTC (permalink / raw)
To: linux-bluetooth
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(-)
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
^ 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