Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Fix not responding Not Found for filtered vcard-listing
From: Luiz Augusto von Dentz @ 2010-10-15  9:45 UTC (permalink / raw)
  To: linux-bluetooth

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

In this case entries may be found but it still may not match the filter
criteria.
---
 plugins/pbap.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/plugins/pbap.c b/plugins/pbap.c
index 13742da..11cb678 100644
--- a/plugins/pbap.c
+++ b/plugins/pbap.c
@@ -398,12 +398,6 @@ static void cache_ready_notify(void *user_data)
 		goto done;
 	}
 
-	if (pbap->cache.entries == NULL) {
-		pbap->cache.valid = TRUE;
-		obex_object_set_io_flags(pbap, G_IO_ERR, -ENOENT);
-		return;
-	}
-
 	/*
 	 * Don't free the sorted list content: this list contains
 	 * only the reference for the "real" cache entry.
@@ -412,6 +406,12 @@ static void cache_ready_notify(void *user_data)
 			pbap->params->searchattrib,
 			(const char *) pbap->params->searchval);
 
+	if (sorted == NULL) {
+		pbap->cache.valid = TRUE;
+		obex_object_set_io_flags(pbap, G_IO_ERR, -ENOENT);
+		return;
+	}
+
 	/* Computing offset considering first entry of the phonebook */
 	l = g_slist_nth(sorted, pbap->params->liststartoffset);
 
-- 
1.7.1


^ permalink raw reply related

* Re: [PATCH] Bluetooth: Fix non-SSP auth request for HIGH security level sockets
From: Marcel Holtmann @ 2010-10-15  9:16 UTC (permalink / raw)
  To: johan.hedberg; +Cc: linux-bluetooth, Johan Hedberg
In-Reply-To: <1287128769-5078-1-git-send-email-johan.hedberg@gmail.com>

Hi Johan,

> When initiating dedicated bonding a L2CAP raw socket with HIGH security
> level is used. The kernel is supposed to trigger the authentication
> request in this case but this doesn't happen currently for non-SSP
> (pre-2.1) devices. The reason is that the authentication request happens
> in the remote extended features callback which never gets called for
> non-SSP devices. This patch fixes the issue by requesting also
> authentiation in the (normal) remote features callback in the case of
> non-SSP devices.
> 
> This rule is applied only for HIGH security level which might at first
> seem unintuitive since on the server socket side MEDIUM is already
> enough for authentication. However, for the clients we really want to
> prefer the server side to decide the authentication requrement in most
> cases, and since most client sockets use MEDIUM it's better to be
> avoided on the kernel side for these sockets. The important socket to
> request it for is the dedicated bonding one and that socket uses HIGH
> security level.
> 
> The patch is based on the initial investigation and patch proposal from
> Andrei Emeltchenko <endrei.emeltchenko@nokia.com>.
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>

so I had a quick review here on this one. Looks fine to me and it makes
sense.

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

Regards

Marcel



^ permalink raw reply

* [PATCH] Bluetooth: Fix non-SSP auth request for HIGH security level sockets
From: johan.hedberg @ 2010-10-15  7:46 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Johan Hedberg

From: Johan Hedberg <johan.hedberg@nokia.com>

When initiating dedicated bonding a L2CAP raw socket with HIGH security
level is used. The kernel is supposed to trigger the authentication
request in this case but this doesn't happen currently for non-SSP
(pre-2.1) devices. The reason is that the authentication request happens
in the remote extended features callback which never gets called for
non-SSP devices. This patch fixes the issue by requesting also
authentiation in the (normal) remote features callback in the case of
non-SSP devices.

This rule is applied only for HIGH security level which might at first
seem unintuitive since on the server socket side MEDIUM is already
enough for authentication. However, for the clients we really want to
prefer the server side to decide the authentication requrement in most
cases, and since most client sockets use MEDIUM it's better to be
avoided on the kernel side for these sockets. The important socket to
request it for is the dedicated bonding one and that socket uses HIGH
security level.

The patch is based on the initial investigation and patch proposal from
Andrei Emeltchenko <endrei.emeltchenko@nokia.com>.

Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
---
 net/bluetooth/hci_event.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index bfef5ba..84093b0 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1175,6 +1175,12 @@ static inline void hci_remote_features_evt(struct hci_dev *hdev, struct sk_buff
 				hci_send_cmd(hdev,
 					HCI_OP_READ_REMOTE_EXT_FEATURES,
 							sizeof(cp), &cp);
+			} else if (!ev->status && conn->out &&
+					conn->sec_level == BT_SECURITY_HIGH) {
+				struct hci_cp_auth_requested cp;
+				cp.handle = ev->handle;
+				hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED,
+							sizeof(cp), &cp);
 			} else {
 				conn->state = BT_CONNECTED;
 				hci_proto_connect_cfm(conn, ev->status);
-- 
1.7.1


^ permalink raw reply related

* Re: [PATCH 0/2] Fix regression on suspend on opening
From: Johan Hedberg @ 2010-10-15  7:21 UTC (permalink / raw)
  To: Dmitriy Paliy; +Cc: linux-bluetooth
In-Reply-To: <1287125828-5479-1-git-send-email-dmitriy.paliy@nokia.com>

Hi Dmitriy,

On Fri, Oct 15, 2010, Dmitriy Paliy wrote:
> This fixes regression when doing suspend on opening obex stream. If
> obex_write_stream returns length of buffer, it is treated as an error
> response later on, which is not correct.
> 
> Negative values returned by obex_write_stream are error codes, while
> positive ones mean length of buffer. Positive values are never used
> afterwards in the code. Therefore, due to this reason, and for being
> compliant with obex_read_stream, which also returns 0 only, it was
> decided to remove return of positive value representing length at all.
> 
> Result of such is also some code cleanup that removes unnecessary return
> len when it is zero.
> 
> A typo is fixed in comments as well.

Both patches have been pushed upstream. Thanks. Btw, don't be afraid to
put this kind of explanations in the commit messages themselves since
that info is easier to find in a couple of years time than this cover
letter email.

Johan

^ permalink raw reply

* [PATCH 2/2] Code cleanup: unnecessary operation and typo removed
From: Dmitriy Paliy @ 2010-10-15  6:57 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Dmitriy Paliy
In-Reply-To: <1287125828-5479-1-git-send-email-dmitriy.paliy@nokia.com>

Code cleanup: unnecessary operation 'return len;' removed and typo in
comments immidiately to immediately corrected.
---
 src/obex.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/obex.c b/src/obex.c
index 4e1db9c..adfcc95 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -678,7 +678,6 @@ add_header:
 	if (len == 0) {
 		g_free(os->buf);
 		os->buf = NULL;
-		return len;
 	}
 
 	os->offset += len;
@@ -818,7 +817,7 @@ static void cmd_get(struct obex_session *os, obex_t *obex, obex_object_t *obj)
 		OBEX_ObjectAddHeader (obex, obj, OBEX_HDR_BODY,
 				hd, 0, OBEX_FL_STREAM_START);
 
-		/* Try to write to stream and suspend the stream immidiately
+		/* Try to write to stream and suspend the stream immediately
 		 * if no data available to send. */
 		err = obex_write_stream(os, obex, obj);
 		if (err == -EAGAIN) {
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 1/2] Fix regression on suspend on opening
From: Dmitriy Paliy @ 2010-10-15  6:57 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Dmitriy Paliy
In-Reply-To: <1287125828-5479-1-git-send-email-dmitriy.paliy@nokia.com>

This fixes regression on suspend on opening when obex_write_stream
returns length of buffer, which is treated as error response
afterwards.
---
 src/obex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/obex.c b/src/obex.c
index d1ac339..4e1db9c 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -683,7 +683,7 @@ add_header:
 
 	os->offset += len;
 
-	return len;
+	return 0;
 }
 
 static gboolean handle_async_io(void *object, int flags, int err,
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 0/2] Fix regression on suspend on opening
From: Dmitriy Paliy @ 2010-10-15  6:57 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

This fixes regression when doing suspend on opening obex stream. If
obex_write_stream returns length of buffer, it is treated as an error
response later on, which is not correct.

Negative values returned by obex_write_stream are error codes, while
positive ones mean length of buffer. Positive values are never used
afterwards in the code. Therefore, due to this reason, and for being
compliant with obex_read_stream, which also returns 0 only, it was
decided to remove return of positive value representing length at all.

Result of such is also some code cleanup that removes unnecessary return
len when it is zero.

A typo is fixed in comments as well.

Br,
Dmitriy


^ permalink raw reply

* Re: [PATCH] Update Gustavo's email in AUTHORS
From: Johan Hedberg @ 2010-10-15  5:59 UTC (permalink / raw)
  To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1287098803-22806-1-git-send-email-padovan@profusion.mobi>

Hi Gustavo,

On Thu, Oct 14, 2010, Gustavo F. Padovan wrote:
> ---
>  AUTHORS |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/AUTHORS b/AUTHORS
> index 8e0a012..e063569 100644
> --- a/AUTHORS
> +++ b/AUTHORS
> @@ -35,7 +35,7 @@ Pekka Pessi <pekka.pessi@nokia.com>
>  Siarhei Siamashka <siarhei.siamashka@nokia.com>
>  Nick Pelly <npelly@google.com>
>  Lennart Poettering <lennart@poettering.net>
> -Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
> +Gustavo F. Padovan <padovan@profusion.mobi>
>  Marc-Andre Lureau <marc-andre.lureau@nokia.com>
>  Bea Lam <bea.lam@nokia.com>
>  Zygo Blaxell <zygo.blaxell@xandros.com>

Pushed upstream. Thanks.

Johan

^ permalink raw reply

* [PATCH] Update Gustavo's email in AUTHORS
From: Gustavo F. Padovan @ 2010-10-14 23:26 UTC (permalink / raw)
  To: linux-bluetooth

---
 AUTHORS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 8e0a012..e063569 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -35,7 +35,7 @@ Pekka Pessi <pekka.pessi@nokia.com>
 Siarhei Siamashka <siarhei.siamashka@nokia.com>
 Nick Pelly <npelly@google.com>
 Lennart Poettering <lennart@poettering.net>
-Gustavo F. Padovan <gustavo@las.ic.unicamp.br>
+Gustavo F. Padovan <padovan@profusion.mobi>
 Marc-Andre Lureau <marc-andre.lureau@nokia.com>
 Bea Lam <bea.lam@nokia.com>
 Zygo Blaxell <zygo.blaxell@xandros.com>
-- 
1.7.3.1


^ permalink raw reply related

* [PATCH] fix oops in l2cap_connect_req
From: Nathan Holstein @ 2010-10-14 22:37 UTC (permalink / raw)
  To: linux-kernel, linux-bluetooth

(Please keep me in the CC list, I'm not subscribed to lkml)

[1] L2CAP module dereferences an uninitialized pointer within l2cap_connect_req.

[2] I'm currently testing a 2.6.35 kernel on a Nexus One with backported
patches from bluetooth-2.6.  When testing against certain BT devices, I'm seeing
a null-pointer deref.  The crash is caused by this portion of commit e9aeb2dd:

@@ -2966,6 +2991,15 @@ sendresp:
                                        L2CAP_INFO_REQ, sizeof(info), &info);
        }

+       if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT) &&
+                               result == L2CAP_CR_SUCCESS) {
+               u8 buf[128];
+               l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT;
+               l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ,
+                                       l2cap_build_conf_req(sk, buf), buf);
+               l2cap_pi(sk)->num_conf_req++;
+       }
+
        return 0;
 }

Multiple error cases jump to the response & sendresp labels prior to
initializing
the "sk" variable.  In the case I'm currently seeing, the remote BT
device fails to
properly secure the ACL, making this crash 100% reproducible.

[3] Bluetooth, L2CAP

[4] This bug appears to be in the mainline 2.6.36-rc? kernel, in addition to
 multiple Bluetooth development trees

The following patch fixes the crash.


   --nathan

---
In error cases when the ACL is insecure or we fail to allocate a new
struct sock, we jump to the "response" label.  If so, "sk" will be
uninitialized and the kernel crashes.

Signed-off-by: Nathan Holstein <nathan.holstein@gmail.com>
---
 net/bluetooth/l2cap.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index d527b10..10ae0af 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -2911,7 +2911,7 @@ static inline int l2cap_connect_req(struct
l2cap_conn *conn, struct l2cap_cmd_hd
 	struct l2cap_chan_list *list = &conn->chan_list;
 	struct l2cap_conn_req *req = (struct l2cap_conn_req *) data;
 	struct l2cap_conn_rsp rsp;
-	struct sock *parent, *uninitialized_var(sk);
+	struct sock *parent, *sk = 0;
 	int result, status = L2CAP_CS_NO_INFO;

 	u16 dcid = 0, scid = __le16_to_cpu(req->scid);
@@ -3020,7 +3020,7 @@ sendresp:
 					L2CAP_INFO_REQ, sizeof(info), &info);
 	}

-	if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT) &&
+	if (sk && !(l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT) &&
 				result == L2CAP_CR_SUCCESS) {
 		u8 buf[128];
 		l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT;
-- 
1.7.2.3

^ permalink raw reply related

* Re: [PATCH] fix oops in l2cap_connect_req
From: Gustavo F. Padovan @ 2010-10-14 21:37 UTC (permalink / raw)
  To: Nathan Holstein; +Cc: linux-kernel, linux-bluetooth
In-Reply-To: <AANLkTi=CNW1pu-YdvmViqHxfw-_TDzvLkj15Ai_aANWo@mail.gmail.com>

Hi Nathan,

* Nathan Holstein <nathan.holstein@gmail.com> [2010-10-14 18:37:53 -0400]:

> (Please keep me in the CC list, I'm not subscribed to lkml)
> 
> [1] L2CAP module dereferences an uninitialized pointer within l2cap_connect_req.
> 
> [2] I'm currently testing a 2.6.35 kernel on a Nexus One with backported
> patches from bluetooth-2.6.  When testing against certain BT devices, I'm seeing
> a null-pointer deref.  The crash is caused by this portion of commit e9aeb2dd:
> 
> @@ -2966,6 +2991,15 @@ sendresp:
>                                         L2CAP_INFO_REQ, sizeof(info), &info);
>         }
> 
> +       if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT) &&
> +                               result == L2CAP_CR_SUCCESS) {
> +               u8 buf[128];
> +               l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT;
> +               l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ,
> +                                       l2cap_build_conf_req(sk, buf), buf);
> +               l2cap_pi(sk)->num_conf_req++;
> +       }
> +
>         return 0;
>  }
> 
> Multiple error cases jump to the response & sendresp labels prior to
> initializing
> the "sk" variable.  In the case I'm currently seeing, the remote BT
> device fails to
> properly secure the ACL, making this crash 100% reproducible.
> 
> [3] Bluetooth, L2CAP
> 
> [4] This bug appears to be in the mainline 2.6.36-rc? kernel, in addition to
>  multiple Bluetooth development trees
> 
> The following patch fixes the crash.
> 
> 
>    --nathan
> 
> ---
> In error cases when the ACL is insecure or we fail to allocate a new
> struct sock, we jump to the "response" label.  If so, "sk" will be
> uninitialized and the kernel crashes.
> 
> Signed-off-by: Nathan Holstein <nathan.holstein@gmail.com>
> ---
>  net/bluetooth/l2cap.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
> index d527b10..10ae0af 100644
> --- a/net/bluetooth/l2cap.c
> +++ b/net/bluetooth/l2cap.c
> @@ -2911,7 +2911,7 @@ static inline int l2cap_connect_req(struct
> l2cap_conn *conn, struct l2cap_cmd_hd
>  	struct l2cap_chan_list *list = &conn->chan_list;
>  	struct l2cap_conn_req *req = (struct l2cap_conn_req *) data;
>  	struct l2cap_conn_rsp rsp;
> -	struct sock *parent, *uninitialized_var(sk);
> +	struct sock *parent, *sk = 0;

Your fix is right, but please make *sk = NULL here.
When I wrote that code I thought is was a false positive, but no, it's
bug. :(


-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply

* Re: [PATCH] Fix not responding Not Found when no entry is found
From: Johan Hedberg @ 2010-10-14 20:35 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1287063243-23296-1-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

On Thu, Oct 14, 2010, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
> 
> Accourding to PBAP spec PSE must reply Not Found when:
> 
> "The function was recognized and all the parameters are proper, but the
> vCard handle or the phone book object could not be found."
> ---
>  plugins/pbap.c              |   15 +++++++++++++++
>  plugins/phonebook-tracker.c |   12 +++++++++---
>  2 files changed, 24 insertions(+), 3 deletions(-)

Pushed upstream. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH] Unref pending call in fallback scenario.
From: Johan Hedberg @ 2010-10-14 20:34 UTC (permalink / raw)
  To: Lukasz Rymanowski; +Cc: linux-bluetooth, Par-Gunnar.p.HJALMDAHL
In-Reply-To: <1287069227-4076-1-git-send-email-lukasz.rymanowski@tieto.com>

Hi Lukasz,

On Thu, Oct 14, 2010, Lukasz Rymanowski wrote:
> Drop the reference to pending call in fallback scenario.
> Otherwise, dbus will assert once timer expires.
> ---
>  src/agent.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/agent.c b/src/agent.c
> index c7fdbd4..b65a550 100644
> --- a/src/agent.c
> +++ b/src/agent.c
> @@ -706,6 +706,7 @@ static int request_fallback(struct agent_request *req,
>  		return -EINVAL;
>  
>  	dbus_pending_call_cancel(req->call);
> +	dbus_pending_call_unref(req->call);
>  
>  	msg = dbus_message_copy(req->msg);
>  

Good catch. The patch has been pushed upstream. Over the last few years
I've bumped into this libdbus issue several times but it seems this
particular code path (request_fallback) gets triggered seldom enough for
it to not have surfaced earlier. I also vaguely remember that this got
fixed in newer D-Bus versions so those might not assert in this case
anymore.

Johan

^ permalink raw reply

* [PATCH] Unref pending call in fallback scenario.
From: Lukasz Rymanowski @ 2010-10-14 15:13 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Par-Gunnar.p.HJALMDAHL, Lukasz Rymanowski

Drop the reference to pending call in fallback scenario.
Otherwise, dbus will assert once timer expires.
---
 src/agent.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/agent.c b/src/agent.c
index c7fdbd4..b65a550 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -706,6 +706,7 @@ static int request_fallback(struct agent_request *req,
 		return -EINVAL;
 
 	dbus_pending_call_cancel(req->call);
+	dbus_pending_call_unref(req->call);
 
 	msg = dbus_message_copy(req->msg);
 
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH] Fix not responding Not Found when no entry is found
From: Luiz Augusto von Dentz @ 2010-10-14 13:34 UTC (permalink / raw)
  To: linux-bluetooth

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

Accourding to PBAP spec PSE must reply Not Found when:

"The function was recognized and all the parameters are proper, but the
vCard handle or the phone book object could not be found."
---
 plugins/pbap.c              |   15 +++++++++++++++
 plugins/phonebook-tracker.c |   12 +++++++++---
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/plugins/pbap.c b/plugins/pbap.c
index 948f9df..13742da 100644
--- a/plugins/pbap.c
+++ b/plugins/pbap.c
@@ -228,6 +228,9 @@ static void phonebook_size_result(const char *buffer, size_t bufsize,
 	struct aparam_header *hdr = (struct aparam_header *) aparam;
 	uint16_t phonebooksize;
 
+	if (vcards < 0)
+		vcards = 0;
+
 	DBG("vcards %d", vcards);
 
 	phonebooksize = htons(vcards);
@@ -248,6 +251,11 @@ static void query_result(const char *buffer, size_t bufsize, int vcards,
 
 	DBG("");
 
+	if (vcards < 0) {
+		obex_object_set_io_flags(pbap, G_IO_ERR, -ENOENT);
+		return;
+	}
+
 	if (!pbap->buffer)
 		pbap->buffer = g_string_new_len(buffer, bufsize);
 	else
@@ -389,6 +397,13 @@ static void cache_ready_notify(void *user_data)
 		pbap->buffer = g_string_new_len(aparam, sizeof(aparam));
 		goto done;
 	}
+
+	if (pbap->cache.entries == NULL) {
+		pbap->cache.valid = TRUE;
+		obex_object_set_io_flags(pbap, G_IO_ERR, -ENOENT);
+		return;
+	}
+
 	/*
 	 * Don't free the sorted list content: this list contains
 	 * only the reference for the "real" cache entry.
diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index 39e4c81..2da825b 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -924,6 +924,11 @@ static void pull_contacts(char **reply, int num_fields, void *user_data)
 	gboolean cdata_present = FALSE;
 	char *home_addr, *work_addr;
 
+	if (num_fields < 0) {
+		data->cb(NULL, 0, num_fields, 0, data->user_data);
+		goto fail;
+	}
+
 	DBG("reply %p", reply);
 
 	if (reply == NULL)
@@ -1031,8 +1036,9 @@ done:
 				g_slist_length(data->contacts), 0,
 				data->user_data);
 
-	g_slist_free(data->contacts);
 	g_string_free(vcards, TRUE);
+fail:
+	g_slist_free(data->contacts);
 	g_free(data);
 }
 
@@ -1042,7 +1048,7 @@ static void add_to_cache(char **reply, int num_fields, void *user_data)
 	char *formatted;
 	int i;
 
-	if (reply == NULL)
+	if (reply == NULL || num_fields < 0)
 		goto done;
 
 	/* the first element is the URI, always not empty */
@@ -1075,7 +1081,7 @@ static void add_to_cache(char **reply, int num_fields, void *user_data)
 	return;
 
 done:
-	if (num_fields == 0)
+	if (num_fields <= 0)
 		cache->ready_cb(cache->user_data);
 
 	g_free(cache);
-- 
1.7.1


^ permalink raw reply related

* Re: [PATCH] Bluetooth: TI_ST bluetooth driver
From: Gustavo F. Padovan @ 2010-10-14 13:31 UTC (permalink / raw)
  To: pavan_savoy; +Cc: linux-bluetooth, marcel, greg, linux-kernel
In-Reply-To: <1286814803-6740-1-git-send-email-pavan_savoy@ti.com>

Hi Pavan,

* pavan_savoy@ti.com <pavan_savoy@ti.com> [2010-10-11 12:33:23 -0400]:

> From: Pavan Savoy <pavan_savoy@ti.com>
> 
> Gustavo, Marcel,
> 
> I have taken care of most of the comments which you provided.
> Couple of them like usage of goto's, I didn't handle since
> I am not doing much error handling repeatedly there.
> 
> I have also removed the 2 states like _REGISTERED, _RUNNING which
> were not required and the flags associated with it.
> I have taken care of other style comments.
> 
> Please review and provide your comments,
> 
> -- patch description --
> 
> This is the bluetooth protocol driver for the TI WiLink7 chipsets.
> Texas Instrument's WiLink chipsets combine wireless technologies
> like BT, FM, GPS and WLAN onto a single chip.
> 
> This Bluetooth driver works on top of the TI_ST shared transport
> line discipline driver which also allows other drivers like
> FM V4L2 and GPS character driver to make use of the same UART interface.
> 
> Kconfig and Makefile modifications to enable the Bluetooth
> driver for Texas Instrument's WiLink 7 chipset.
> 
> Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
> ---
>  drivers/bluetooth/Kconfig    |   10 +
>  drivers/bluetooth/Makefile   |    1 +
>  drivers/bluetooth/btwilink.c |  455 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 466 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/bluetooth/btwilink.c
> 
> diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
> index 02deef4..e0d67dd 100644
> --- a/drivers/bluetooth/Kconfig
> +++ b/drivers/bluetooth/Kconfig
> @@ -219,4 +219,14 @@ config BT_ATH3K
>  	  Say Y here to compile support for "Atheros firmware download driver"
>  	  into the kernel or say M to compile it as module (ath3k).
>  
> +config BT_WILINK
> +	tristate "BlueZ bluetooth driver for TI ST"
> +	depends on TI_ST
> +	help
> +	  This enables the Bluetooth driver for Texas Instrument's BT/FM/GPS
> +	  combo devices. This makes use of shared transport line discipline
> +	  core driver to communicate with the BT core of the combo chip.
> +
> +	  Say Y here to compile support for Texas Instrument's WiLink7 driver
> +	  into the kernel or say M to compile it as module.
>  endmenu
> diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
> index 71bdf13..5351b62 100644
> --- a/drivers/bluetooth/Makefile
> +++ b/drivers/bluetooth/Makefile
> @@ -28,3 +28,4 @@ hci_uart-$(CONFIG_BT_HCIUART_BCSP)	+= hci_bcsp.o
>  hci_uart-$(CONFIG_BT_HCIUART_LL)	+= hci_ll.o
>  hci_uart-$(CONFIG_BT_HCIUART_ATH3K)	+= hci_ath.o
>  hci_uart-objs				:= $(hci_uart-y)
> +obj-$(CONFIG_BT_WILINK)			:= btwilink.o

sort this after:
obj-$(CONFIG_BT_MRVL_SDIO)      += btmrvl_sdio.o

> diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c
> new file mode 100644
> index 0000000..e0bde79
> --- /dev/null
> +++ b/drivers/bluetooth/btwilink.c
> @@ -0,0 +1,455 @@
> +/*
> + *  Texas Instrument's Bluetooth Driver For Shared Transport.
> + *
> + *  Bluetooth Driver acts as interface between HCI CORE and
> + *  TI Shared Transport Layer.
> + *
> + *  Copyright (C) 2009-2010 Texas Instruments
> + *  Author: Raja Mani <raja_mani@ti.com>
> + *	Pavan Savoy <pavan_savoy@ti.com>
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License version 2 as
> + *  published by the Free Software Foundation.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> + *
> + */
> +
> +#include <linux/platform_device.h>
> +#include <net/bluetooth/bluetooth.h>
> +#include <net/bluetooth/hci_core.h>
> +
> +#include <linux/ti_wilink_st.h>
> +
> +/* Bluetooth Driver Version */
> +#define VERSION               "1.0"
> +
> +/* Defines number of seconds to wait for reg completion
> + * callback getting called from ST (in case,registration
> + * with ST returns PENDING status)
> + */
> +#define BT_REGISTER_TIMEOUT   6000	/* 6 sec */
> +
> +/**
> + * struct ti_st - BT driver operation structure
> + * @hdev: hci device pointer which binds to bt driver
> + * @flags: used locally,to maintain various BT driver status
> + * @streg_cbdata: to hold ST registration callback status
> + * @st_write: write function pointer of ST driver
> + * @wait_for_btdrv_reg_completion - completion sync between ti_st_open
> + *	and ti_st_registration_completion_cb.
> + */
> +struct ti_st {
> +	struct hci_dev *hdev;
> +	char streg_cbdata;
> +	long (*st_write) (struct sk_buff *);
> +	struct completion wait_for_btdrv_reg_completion;

wait_for_btdrv_reg_completion is too big.

> +};
> +
> +static int reset;
> +
> +/* Increments HCI counters based on pocket ID (cmd,acl,sco) */
> +static inline void ti_st_tx_complete(struct ti_st *hst, int pkt_type)
> +{
> +	struct hci_dev *hdev;
> +	hdev = hst->hdev;
> +
> +	/* Update HCI stat counters */
> +	switch (pkt_type) {
> +	case HCI_COMMAND_PKT:
> +		hdev->stat.cmd_tx++;
> +		break;
> +
> +	case HCI_ACLDATA_PKT:
> +		hdev->stat.acl_tx++;
> +		break;
> +
> +	case HCI_SCODATA_PKT:
> +		hdev->stat.sco_tx++;
> +		break;
> +	}
> +}
> +
> +/* ------- Interfaces to Shared Transport ------ */
> +
> +/* Called by ST layer to indicate protocol registration completion
> + * status.ti_st_open() function will wait for signal from this
> + * API when st_register() function returns ST_PENDING.
> + */
> +static void st_registration_completion_cb(void *priv_data, char data)
> +{
> +	struct ti_st *lhst = (struct ti_st *)priv_data;
> +	/* ti_st_open() function needs value of 'data' to know
> +	 * the registration status(success/fail),So have a back
> +	 * up of it.
> +	 */
> +	lhst->streg_cbdata = data;
> +
> +	/* Got a feedback from ST for BT driver registration
> +	 * request.Wackup ti_st_open() function to continue
> +	 * it's open operation.
> +	 */
> +	complete(&lhst->wait_for_btdrv_reg_completion);
> +}
> +
> +/* Called by Shared Transport layer when receive data is
> + * available */
> +static long st_receive(void *priv_data, struct sk_buff *skb)
> +{
> +	int err;
> +	struct ti_st *lhst = (struct ti_st *)priv_data;
> +
> +	if (skb == NULL) {
> +		BT_ERR("Invalid SKB received from ST");

I don't think this error message is worth.

> +		return -EFAULT;
> +	}

Make this (!skb) or the check below (lhst == NULL). Try to use only one
pattern in your code.


> +
> +	if (!lhst) {
> +		kfree_skb(skb);
> +		BT_ERR("Invalid ti_st memory,freeing SKB");

I don't think this error message is worth.

> +		return -EFAULT;
> +	}
> +
> +	skb->dev = (struct net_device *)lhst->hdev;

Blank line here.

> +	/* Forward skb to HCI CORE layer */
> +	err = hci_recv_frame(skb);
> +	if (err) {
> +		kfree_skb(skb);
> +		BT_ERR("Unable to push skb to HCI CORE(%d),freeing SKB",

Turn this message into:

"Unable to push skb to HCI core(%d)"

> +				err);
> +		return err;
> +	}
> +
> +	lhst->hdev->stat.byte_rx += skb->len;
> +	return 0;
> +}
> +
> +/* ------- Interfaces to HCI layer ------ */
> +
> +/* Called from HCI core to initialize the device */
> +static int ti_st_open(struct hci_dev *hdev)
> +{
> +	static struct st_proto_s ti_st_proto;

Usually we declare this outside of the function like this:

static struct usb_driver ath3k_driver = {
	.name           = "ath3k",
	.probe          = ath3k_probe,
	.disconnect     = ath3k_disconnect,
	.id_table       = ath3k_table,
};


> +	unsigned long timeleft;
> +	struct ti_st *hst;
> +	int err;
> +	err = 0;

No need to set err to 0 here.

> +
> +	BT_DBG("%s %p", hdev->name, hdev);

Skip a line here.

> +	hst = hdev->driver_data;
> +
> +	/* Populate BT driver info required by ST */
> +	memset(&ti_st_proto, 0, sizeof(ti_st_proto));
> +
> +	/* BT driver ID */
> +	ti_st_proto.type = ST_BT;
> +
> +	/* Receive function which called from ST */
> +	ti_st_proto.recv = st_receive;
> +
> +	/* Callback to be called when registration is pending */
> +	ti_st_proto.reg_complete_cb = st_registration_completion_cb;
> +
> +	/* send in the hst to be received at registration complete callback
> +	 * and during st's receive
> +	 */
> +	ti_st_proto.priv_data = hst;
> +
> +	/* Register with ST layer */

No need for this comment, your function name already set that.

> +	err = st_register(&ti_st_proto);
> +	if (err == -EINPROGRESS) {
> +		/* Prepare wait-for-completion handler data structures.
> +		 * Needed to syncronize this and st_registration_completion_cb()
> +		 * functions.
> +		 */
> +		init_completion(&hst->wait_for_btdrv_reg_completion);
> +
> +		/* Reset ST registration callback status flag , this value
> +		 * will be updated in ti_st_registration_completion_cb()
> +		 * function whenever it called from ST driver.
> +		 */
> +		hst->streg_cbdata = -EINPROGRESS;
> +
> +		/* ST is busy with other protocol registration(may be busy with
> +		 * firmware download).So,Wait till the registration callback
> +		 * (passed as a argument to st_register() function) getting
> +		 * called from ST.
> +		 */
> +		BT_DBG(" %s waiting for reg completion signal from ST",
> +				__func__);

BT_DBG already have __func__.

> +
> +		timeleft =
> +			wait_for_completion_timeout

this could be:

		timeleft = wait_for_completion_timeout

> +			(&hst->wait_for_btdrv_reg_completion,
> +			 msecs_to_jiffies(BT_REGISTER_TIMEOUT));
> +		if (!timeleft) {
> +			BT_ERR("Timeout(%d sec),didn't get reg"
> +					"completion signal from ST",
> +					BT_REGISTER_TIMEOUT / 1000);
> +			return -ETIMEDOUT;
> +		}
> +
> +		/* Is ST registration callback called with ERROR value? */
> +		if (hst->streg_cbdata != 0) {
> +			BT_ERR("ST reg completion CB called with invalid"
> +					"status %d", hst->streg_cbdata);
> +			return -EAGAIN;
> +		}
> +		err = 0;
> +	} else if (err == -1) {

Use the error macro instead of -1

> +		BT_ERR("st_register failed %d", err);
> +		return -EAGAIN;
> +	}
> +
> +	/* Do we have proper ST write function? */
> +	if (ti_st_proto.write != NULL) {
> +		/* We need this pointer for sending any Bluetooth pkts */
> +		hst->st_write = ti_st_proto.write;

Didn't get this. Who sets ti_st_proto.write()?

> +	} else {
> +		BT_ERR("failed to get ST write func pointer");
> +
> +		/* Undo registration with ST */
> +		err = st_unregister(ST_BT);
> +		if (err < 0)
> +			BT_ERR("st_unregister failed %d", err);
> +
> +		hst->st_write = NULL;
> +		return -EAGAIN;
> +	}
> +
> +	/* Registration with ST layer is completed successfully,
> +	 * now chip is ready to accept commands from HCI CORE.
> +	 * Mark HCI Device flag as RUNNING
> +	 */

I don't think this comment is worth, your code already says that.
But one can argue here that comments are always good. ;)

> +	set_bit(HCI_RUNNING, &hdev->flags);
> +	return err;
> +}
> +
> +/* Close device */
> +static int ti_st_close(struct hci_dev *hdev)
> +{
> +	int err = 0;
> +	struct ti_st *hst;
> +
> +	hst = hdev->driver_data;
> +
> +	/* Clear HCI device RUNNING flag */
> +	if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
> +		BT_ERR("HCI not RUNNING?");

That's is not a error, just return 0.

> +
> +	/* continue to unregister from transport */
> +	err = st_unregister(ST_BT);
> +	if (err != 0) {
> +		hst->st_write = NULL;
> +		BT_ERR("st_unregister failed %d", err);
> +		return -EBUSY;
> +	}
> +
> +	hst->st_write = NULL;
> +	return err;

This should be better:

	if (err)
		BT_ERR("st_unregister failed %d", err);

	hst->st_write = NULL;
	return err;

> +}
> +
> +/* Called from HCI CORE , Sends frames to Shared Transport */
> +static int ti_st_send_frame(struct sk_buff *skb)
> +{
> +	struct hci_dev *hdev;
> +	struct ti_st *hst;
> +	long len;
> +
> +	if (skb == NULL) {
> +		BT_ERR("Invalid skb received from HCI CORE");
> +		return -ENOMEM;
> +	}
> +
> +	hdev = (struct hci_dev *)skb->dev;
> +	if (!hdev) {
> +		BT_ERR("SKB received for invalid HCI Device (hdev=NULL)");
> +		return -ENODEV;
> +	}
> +
> +	if (!test_bit(HCI_RUNNING, &hdev->flags)) {
> +		BT_ERR("Device is not running");

Remove the last 3 BT_ERR

> +		return -EBUSY;
> +	}
> +
> +	hst = (struct ti_st *)hdev->driver_data;
> +
> +	/* Prepend skb with frame type */
> +	memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
> +
> +	BT_DBG(" %s: type %d len %d", hdev->name, bt_cb(skb)->pkt_type,
> +			skb->len);
> +
> +	/* Insert skb to shared transport layer's transmit queue.
> +	 * Freeing skb memory is taken care in shared transport layer,
> +	 * so don't free skb memory here.
> +	 */
> +	if (!hst->st_write) {
> +		kfree_skb(skb);
> +		BT_ERR(" Can't write to ST, st_write null?");
> +		return -EAGAIN;
> +	}
> +
> +	len = hst->st_write(skb);
> +	if (len < 0) {
> +		kfree_skb(skb);
> +		BT_ERR(" ST write failed (%ld)", len);
> +		return -EAGAIN;
> +	}
> +
> +	/* ST accepted our skb. So, Go ahead and do rest */
> +	hdev->stat.byte_tx += len;
> +	ti_st_tx_complete(hst, bt_cb(skb)->pkt_type);
> +
> +	return 0;
> +}
> +
> +static void ti_st_destruct(struct hci_dev *hdev)
> +{
> +	if (!hdev) {
> +		BT_ERR("Destruct called with invalid HCI Device"
> +				"(hdev=NULL)");
> +		return;
> +	}
> +
> +	BT_DBG("%s", hdev->name);
> +
> +	/* free ti_st memory */
> +	if (hdev->driver_data != NULL)
> +		kfree(hdev->driver_data);
> +
> +	return;

No return; here

> +}
> +
> +/* Creates new HCI device */
> +static int ti_st_register_dev(struct ti_st *hst)
> +{
> +	struct hci_dev *hdev;
> +
> +	/* Initialize and register HCI device */
> +	hdev = hci_alloc_dev();
> +	if (!hdev) {
> +		BT_ERR("Can't allocate HCI device");
> +		return -ENOMEM;
> +	}
> +	BT_DBG(" HCI device allocated. hdev= %p", hdev);
> +
> +	hst->hdev = hdev;
> +	hdev->bus = HCI_UART;
> +	hdev->driver_data = hst;
> +	hdev->open = ti_st_open;
> +	hdev->close = ti_st_close;
> +	hdev->flush = NULL;
> +	hdev->send = ti_st_send_frame;
> +	hdev->destruct = ti_st_destruct;
> +	hdev->owner = THIS_MODULE;
> +
> +	if (reset)
> +		set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
> +
> +	if (hci_register_dev(hdev) < 0) {
> +		BT_ERR("Can't register HCI device");
> +		hci_free_dev(hdev);
> +		return -ENODEV;
> +	}
> +
> +	BT_DBG(" HCI device registered. hdev= %p", hdev);
> +	return 0;
> +}
> +
> +
> +static int bt_ti_probe(struct platform_device *pdev)
> +{
> +	int err;
> +	static struct ti_st *hst;
> +	err = 0;
> +
> +	BT_DBG(" Bluetooth Driver Version %s", VERSION);
> +
> +	/* Allocate local resource memory */

I don't think this comment is needed.

> +	hst = kzalloc(sizeof(struct ti_st), GFP_KERNEL);
> +	if (!hst) {
> +		BT_ERR("Can't allocate control structure");

remove the BT_ERR

> +		return -ENFILE;

-ENOMEM

> +	}
> +
> +	/* Expose "hciX" device to user space */
> +	err = ti_st_register_dev(hst);
> +	if (err) {
> +		/* Release local resource memory */

I don't think this comment is needed.

> +		kfree(hst);
> +
> +		BT_ERR("Unable to expose hci0 device(%d)", err);

Are you sure that this is hci0?

> +		return err;
> +	}
> +
> +	dev_set_drvdata(&pdev->dev, hst);
> +	return err;
> +}
> +
> +static int bt_ti_remove(struct platform_device *pdev)
> +{
> +	struct ti_st *hst;
> +
> +	hst = dev_get_drvdata(&pdev->dev);
> +	/* Deallocate local resource's memory  */
> +	if (hst) {
> +		struct hci_dev *hdev = hst->hdev;
> +		if (hdev == NULL) {
> +			BT_ERR("Invalid hdev memory");
> +			kfree(hst);
> +		} else {
> +			ti_st_close(hdev);
> +			hci_unregister_dev(hdev);
> +			/* Free HCI device memory */
> +			hci_free_dev(hdev);
> +		}
> +	}
> +	return 0;
> +}
> +
> +static struct platform_driver bt_ti_driver = {
> +	.probe = bt_ti_probe,
> +	.remove = bt_ti_remove,
> +	.driver = {
> +		.name = "ti_st_bluetooth",
> +		.owner = THIS_MODULE,
> +	},
> +};
> +
> +/* ------- Module Init/Exit interfaces ------ */
> +static int __init bt_drv_init(void)
> +{
> +long ret = 0;

Skip a line and don't set ret to 0.

> +	ret = platform_driver_register(&bt_ti_driver);
> +	if (ret != 0) {
> +		BT_ERR("bt_ti platform drv registration failed");
> +		return -1;

Why -1?

> +	}
> +	return 0;
> +}
> +
> +static void __exit bt_drv_exit(void)
> +{
> +	platform_driver_unregister(&bt_ti_driver);
> +}
> +
> +module_init(bt_drv_init);
> +module_exit(bt_drv_exit);
> +
> +/* ------ Module Info ------ */
> +
> +module_param(reset, bool, 0644);
> +MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
> +MODULE_AUTHOR("Raja Mani <raja_mani@ti.com>");
> +MODULE_DESCRIPTION("Bluetooth Driver for TI Shared Transport" VERSION);
> +MODULE_VERSION(VERSION);
> +MODULE_LICENSE("GPL");
> -- 
> 1.6.5
> 
> --
> 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

-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply

* [PATCH 2/2] Code cleanup: immidiately to immediately in comments
From: Dmitriy Paliy @ 2010-10-14 12:35 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Dmitriy Paliy
In-Reply-To: <1287059730-10988-1-git-send-email-dmitriy.paliy@nokia.com>

---
 src/obex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/obex.c b/src/obex.c
index 4e1db9c..5f6ad47 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -818,7 +818,7 @@ static void cmd_get(struct obex_session *os, obex_t *obex, obex_object_t *obj)
 		OBEX_ObjectAddHeader (obex, obj, OBEX_HDR_BODY,
 				hd, 0, OBEX_FL_STREAM_START);
 
-		/* Try to write to stream and suspend the stream immidiately
+		/* Try to write to stream and suspend the stream immediately
 		 * if no data available to send. */
 		err = obex_write_stream(os, obex, obj);
 		if (err == -EAGAIN) {
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 1/2] Fix regression on suspend on opening
From: Dmitriy Paliy @ 2010-10-14 12:35 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Dmitriy Paliy
In-Reply-To: <1287059730-10988-1-git-send-email-dmitriy.paliy@nokia.com>

This fixes regression on suspend on opening when obex_write_stream
returns length of buffer, which is treated as error response
afterwards.
---
 src/obex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/obex.c b/src/obex.c
index d1ac339..4e1db9c 100644
--- a/src/obex.c
+++ b/src/obex.c
@@ -683,7 +683,7 @@ add_header:
 
 	os->offset += len;
 
-	return len;
+	return 0;
 }
 
 static gboolean handle_async_io(void *object, int flags, int err,
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 0/2] Fix regression on suspend on opening
From: Dmitriy Paliy @ 2010-10-14 12:35 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

This fixes regression when doing suspend on opening obex stream. If
obex_write_stream returns length of buffer, it is treated as error
reponse, which is not correct.

A typo is fixed in comments as well.

Br,
Dmitriy


^ permalink raw reply

* Re: [PATCH -next] bluetooth: fix hidp kconfig dependency warning
From: Gustavo F. Padovan @ 2010-10-14 12:18 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, akpm, Marcel Holtmann, linux-bluetooth
In-Reply-To: <20101013181652.7ddf481e.randy.dunlap@oracle.com>

Hi Randy,

* Randy Dunlap <randy.dunlap@oracle.com> [2010-10-13 18:16:52 -0700]:

> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> Fix kconfig dependency warning to satisfy dependencies:
> 
> warning: (BT_HIDP && NET && BT && BT_L2CAP && INPUT || USB_HID && HID_SUPPORT && USB && INPUT) selects HID which has unmet direct dependencies (HID_SUPPORT && INPUT)
> 
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
>  net/bluetooth/hidp/Kconfig |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply

* Re: Pull request git://gitorious.org/bluez-mcap-hdp/mcap-hdp.git for_upstream
From: Johan Hedberg @ 2010-10-14 11:15 UTC (permalink / raw)
  To: Jose Antonio Santos Cadenas; +Cc: linux-bluetooth
In-Reply-To: <AANLkTimBnzJzW_YLjW+NJq-MJ_aEMtSFNy_eKS5v70N4@mail.gmail.com>

Hi Jose,

On Thu, Oct 14, 2010, Jose Antonio Santos Cadenas wrote:
> The following changes since commit 6b9deca15d0824ad5b3c38f8c0dd3a3c482572ea:
> 
>   TODO: Device Name Characteristic for Low Energy (2010-10-13 22:26:59 +0300)
> 
> are available in the git repository at:
>   git://gitorious.org/bluez-mcap-hdp/mcap-hdp.git for_upstream
> 
> José Antonio Santos Cadenas (7):
>       Connect echo channel
>       Initial steps to send echo data
>       Generate random echo packet
>       Create a function for closing mcl correctly
>       Notify channel deletion correctly
>       Separate private echo data from data channels
>       Add initial support for deleting an echo channel
> 
> Santiago Carot-Nemesio (8):
>       Add support to initiate echo
>       Remove unnecessary variable
>       Set watcher to check echo response
>       Check echo response
>       Add timeout to wait for echo reply
>       Abort echo channel if connection was not successful
>       Remove MDL when delete operation fails with INVALID_MDLID error
>       Remove unnecessary function
> 
>  health/hdp.c       |  431 +++++++++++++++++++++++++++++++++++++++++-----------
>  health/hdp_types.h |    5 +-
>  health/mcap.c      |   14 ++-
>  3 files changed, 361 insertions(+), 89 deletions(-)

Pushed upstream. Thanks.

Johan

^ permalink raw reply

* Pull request git://gitorious.org/bluez-mcap-hdp/mcap-hdp.git for_upstream
From: Jose Antonio Santos Cadenas @ 2010-10-14 10:57 UTC (permalink / raw)
  To: linux-bluetooth

The following changes since commit 6b9deca15d0824ad5b3c38f8c0dd3a3c482572ea:

  TODO: Device Name Characteristic for Low Energy (2010-10-13 22:26:59 +0300)

are available in the git repository at:
  git://gitorious.org/bluez-mcap-hdp/mcap-hdp.git for_upstream

José Antonio Santos Cadenas (7):
      Connect echo channel
      Initial steps to send echo data
      Generate random echo packet
      Create a function for closing mcl correctly
      Notify channel deletion correctly
      Separate private echo data from data channels
      Add initial support for deleting an echo channel

Santiago Carot-Nemesio (8):
      Add support to initiate echo
      Remove unnecessary variable
      Set watcher to check echo response
      Check echo response
      Add timeout to wait for echo reply
      Abort echo channel if connection was not successful
      Remove MDL when delete operation fails with INVALID_MDLID error
      Remove unnecessary function

 health/hdp.c       |  431 +++++++++++++++++++++++++++++++++++++++++-----------
 health/hdp_types.h |    5 +-
 health/mcap.c      |   14 ++-
 3 files changed, 361 insertions(+), 89 deletions(-)

^ permalink raw reply

* Re: Query regarding Virtual simulators
From: Suraj Sumangala @ 2010-10-14  6:03 UTC (permalink / raw)
  To: steven bluez
  Cc: Marcel Holtmann, gustavo, Suraj Sumangala,
	linux-bluetooth@vger.kernel.org
In-Reply-To: <AANLkTincuwLZnBhjj=vrmghDEcmZhL=dy1VP=SH6vK_Y@mail.gmail.com>

Hi Steven,

On 10/14/2010 10:57 AM, steven bluez wrote:
> HI MARCEL,GUSTAVO,Suraj
>
>                   If I am developing a profile thats not yet been
> implemented in bluez and if i dont have a Hardware that supports the
> profile.How can i validate it to fix a situation that this profile
> really works.Is there any virutal dummy simulators?
> Do help me out by giving certain ideas on how to perform the same? .
>
> Thanks,
> Steven

I am not sure about any virtual dummy simulator.
But, you should be able to write a dummy agent and test the profile 
against PTS if the profile is supported by it.

PTS would be able to give you a fair idea of what is missing.

It would be great if you can send a mail to the community regarding the 
profile and how you intent to implement it. There would be people with 
access to the hardware and they would be able to guide you accordingly.

Regards
Suraj


^ permalink raw reply

* Query regarding Virtual simulators
From: steven bluez @ 2010-10-14  5:27 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo F. Padovan", Suraj Sumangala; +Cc: linux-bluetooth

HI MARCEL,GUSTAVO,Suraj

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0If I am developing a profile thats not y=
et been
implemented in bluez and if i dont have a Hardware that supports the
profile.How can i validate it to fix a situation that this profile
really works.Is there any virutal dummy simulators?
Do help me out by giving certain ideas on how to perform the same? .

Thanks,
Steven

^ permalink raw reply

* Re: Firmware versioning best practices: ath3k-2.fw rename or replace ath3k-1.fw ?
From: Suraj Sumangala @ 2010-10-14  4:23 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Kevin Hayes, Luis Rodriguez, Marcel Holtmann, Henry Ptasinski,
	Suraj Sumangala, David Woodhouse, linux-bluetooth,
	linux-kernel@vger.kernel.org, linux-wireless
In-Reply-To: <AANLkTik9oYwspVG4KFbMMq63SpBp++iZe=vxOSQhxRki@mail.gmail.com>

Hi Luis,

On 10/13/2010 11:39 PM, Luis R. Rodriguez wrote:
> Does HCI support uploading firmware? Can't we resolve this blacklist
> crap issue if devices just used HCI to upload firmware?

HCI does not support uploading firmware. But HCI does provide options 
for vendor specific commands that can be used for uploading firmware as 
long as your device has enough intelligence to understand the command 
when it comes.

This is what we do for AR300x serial devices. We do not download 
firmware,  but we do download all configuration entries as VS HCI commands.
>
>    Luis

Regards
Suraj

^ permalink raw reply


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