Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] Add handling of single contact's fields handled in VCARD structure
From: Rafał Michalski @ 2010-08-20  9:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafał Michalski

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



[-- Attachment #2: 0001-Add-handling-of-single-contact-s-fields-handled-in-V.patch --]
[-- Type: text/x-patch, Size: 7785 bytes --]

From 09a00e743a8aa8f11b88f9fc440029970b030e04 Mon Sep 17 00:00:00 2001
From: Rafal Michalski <michalski.raf@gmail.com>
Date: Fri, 20 Aug 2010 09:00:33 +0200
Subject: [PATCH 1/2] Add handling of single contact's fields handled in VCARD structure

After pulling contacts these fields weren't present in downloaded
VCARD structure in spite of that these fields existed (not empty).

This patch adds handling of fields: BDAY, NICKNAME, URL, PHOTO
To solve this problem extending number of columns and queries of database
was needed especially. Displaying these fields is done by genaral
functions: vcard_printf_tag, vcard_printf_slash_tag.
Of course fields mentioned above were added to phonebook_contact structure
as char * type to save gained data.
---
 plugins/phonebook-tracker.c |   29 ++++++++++++++----
 plugins/vcard.c             |   68 +++++++++++++++++++++++++++++++++++++++++++
 plugins/vcard.h             |    4 ++
 3 files changed, 95 insertions(+), 6 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index 1109968..fd92125 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -43,16 +43,16 @@
 #define TRACKER_RESOURCES_INTERFACE "org.freedesktop.Tracker1.Resources"
 
 #define TRACKER_DEFAULT_CONTACT_ME "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#default-contact-me"
-#define CONTACTS_ID_COL 21
-#define PULL_QUERY_COL_AMOUNT 22
+#define CONTACTS_ID_COL 25
+#define PULL_QUERY_COL_AMOUNT 26
 #define COL_HOME_NUMBER 0
 #define COL_HOME_EMAIL 7
 #define COL_WORK_NUMBER 8
 #define COL_FAX_NUMBER 16
 #define COL_WORK_EMAIL 17
-#define COL_DATE 18
-#define COL_SENT 19
-#define COL_ANSWERED 20
+#define COL_DATE 22
+#define COL_SENT 23
+#define COL_ANSWERED 24
 
 #define CONTACTS_QUERY_ALL						\
 	"SELECT ?v nco:fullname(?c) "					\
@@ -62,6 +62,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:photo(?c) "						\
 	"\"NOTACALL\" \"false\" \"false\" ?c "				\
 	"WHERE { "							\
 		"?c a nco:PersonContact . "				\
@@ -106,6 +108,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:photo(?c) "						\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -151,6 +155,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:photo(?c) "						\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -196,6 +202,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew)"	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:photo(?c) "						\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -239,6 +247,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:photo(?c) "						\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -306,6 +316,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f  nco:emailAddress(?ew)"	\
+	"nco:birthDate(<%s>) nco:nickname(<%s>) nco:websiteUrl(<%s>) "	\
+	"nco:photo(<%s>) "						\
 	"\"NOTACALL\" \"false\" \"false\" <%s> "			\
 	"WHERE { "							\
 		"<%s> a nco:Contact . "					\
@@ -774,6 +786,10 @@ add_entry:
 	contact->region = g_strdup(reply[13]);
 	contact->postal = g_strdup(reply[14]);
 	contact->country = g_strdup(reply[15]);
+	contact->birthday = g_strdup(reply[18]);
+	contact->nickname = g_strdup(reply[19]);
+	contact->website = g_strdup(reply[20]);
+	contact->photo = g_strdup(reply[21]);
 
 	set_call_type(contact, reply[COL_DATE], reply[COL_SENT],
 			reply[COL_ANSWERED]);
@@ -978,7 +994,8 @@ int phonebook_get_entry(const char *folder, const char *id,
 	data->vcardentry = TRUE;
 
 	query = g_strdup_printf(CONTACTS_QUERY_FROM_URI, id, id, id, id, id,
-						id, id, id, id, id, id, id);
+						id, id, id, id, id, id, id,
+						id, id, id, id);
 
 	ret = query_tracker(query, PULL_QUERY_COL_AMOUNT, pull_contacts, data);
 
diff --git a/plugins/vcard.c b/plugins/vcard.c
index 18b5952..05a8a13 100644
--- a/plugins/vcard.c
+++ b/plugins/vcard.c
@@ -256,6 +256,56 @@ static void vcard_printf_number(GString *vcards, uint8_t format,
 	vcard_printf(vcards, buf, number);
 }
 
+static void vcard_printf_tag(GString *vcards, const char *tag,
+					const char *category, const char *fld)
+{
+	char *separator = "", *type = "";
+	char buf[LEN_MAX];
+
+	if (tag == NULL || strlen(tag) == 0)
+		return;
+
+	if (fld == NULL || strlen(fld) == 0)
+		return;
+
+	if (category && strlen(category)) {
+		separator = ";";
+		type = "TYPE=";
+	} else {
+		category = "";
+	}
+
+	snprintf(buf, LEN_MAX, "%s%s%s%s", tag, separator, type, category);
+
+	vcard_printf(vcards, "%s:%s", buf, fld);
+}
+
+static void vcard_printf_slash_tag(GString *vcards, const char *tag,
+					const char *category, const char *fld)
+{
+	int len;
+	char *separator = "", *type = "";
+	char buf[LEN_MAX], field[LEN_MAX];
+
+	if (tag == NULL || strlen(tag) == 0)
+		return;
+
+	if (fld == NULL || (len = strlen(fld)) == 0)
+		return;
+
+	if (category && strlen(category)) {
+		separator = ";";
+		type = "TYPE=";
+	} else {
+		category = "";
+	}
+
+	snprintf(buf, LEN_MAX, "%s%s%s%s", tag, separator, type, category);
+
+	add_slash(field, fld, LEN_MAX, len);
+	vcard_printf(vcards, "%s:%s", buf, field);
+}
+
 static void vcard_printf_email(GString *vcards, const char *email)
 {
 	int len = 0;
@@ -354,6 +404,20 @@ void phonebook_add_contact(GString *vcards, struct phonebook_contact *contact,
 	if (filter & FILTER_ADR)
 		vcard_printf_adr(vcards, contact);
 
+	if (filter & FILTER_BDAY)
+		vcard_printf_tag(vcards, "BDAY", NULL, contact->birthday);
+
+	if (filter & FILTER_NICKNAME)
+		vcard_printf_slash_tag(vcards, "NICKNAME", NULL,
+							contact->nickname);
+
+	if (filter & FILTER_URL)
+		vcard_printf_slash_tag(vcards, "URL", "INTERNET",
+							contact->website);
+
+	if (filter & FILTER_PHOTO)
+		vcard_printf_tag(vcards, "PHOTO", NULL, contact->photo);
+
 	if (filter & FILTER_X_IRMC_CALL_DATETIME)
 		vcard_printf_datetime(vcards, contact);
 
@@ -392,6 +456,10 @@ void phonebook_contact_free(struct phonebook_contact *contact)
 	g_free(contact->region);
 	g_free(contact->postal);
 	g_free(contact->country);
+	g_free(contact->birthday);
+	g_free(contact->nickname);
+	g_free(contact->website);
+	g_free(contact->photo);
 	g_free(contact->datetime);
 	g_free(contact);
 }
diff --git a/plugins/vcard.h b/plugins/vcard.h
index fa571e4..a9809ea 100644
--- a/plugins/vcard.h
+++ b/plugins/vcard.h
@@ -55,6 +55,10 @@ struct phonebook_contact {
 	char *region;
 	char *postal;
 	char *country;
+	char *birthday;
+	char *nickname;
+	char *website;
+	char *photo;
 	char *datetime;
 	int calltype;
 };
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH 2/2] Add handling of ORG contact's fields handled in VCARD structure
From: Rafał Michalski @ 2010-08-20  9:45 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafał Michalski

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



[-- Attachment #2: 0002-Add-handling-of-ORG-contact-s-fields-handled-in-VCAR.patch --]
[-- Type: text/x-patch, Size: 8312 bytes --]

From 44a30279e45df82ae4ceed254a7f895331073414 Mon Sep 17 00:00:00 2001
From: Rafal Michalski <michalski.raf@gmail.com>
Date: Fri, 20 Aug 2010 09:01:29 +0200
Subject: [PATCH 2/2] Add handling of ORG contact's fields handled in VCARD structure

After pulling contacts these fields weren't present in downloaded
VCARD structure in spite of that these fields existed (not empty).

This patch adds handling of fields grouped under ORG tag.
To solve this problem extending number of columns and queries of database
was needed especially. Of course fields mentioned above were added to
phonebook_contact structure as char * type to save gained data.
---
 plugins/phonebook-tracker.c |   38 +++++++++++++++++++++++++++-----------
 plugins/vcard.c             |   30 ++++++++++++++++++++++++++++++
 plugins/vcard.h             |    3 +++
 3 files changed, 60 insertions(+), 11 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index fd92125..3f63dcb 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -43,16 +43,16 @@
 #define TRACKER_RESOURCES_INTERFACE "org.freedesktop.Tracker1.Resources"
 
 #define TRACKER_DEFAULT_CONTACT_ME "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#default-contact-me"
-#define CONTACTS_ID_COL 25
-#define PULL_QUERY_COL_AMOUNT 26
+#define CONTACTS_ID_COL 28
+#define PULL_QUERY_COL_AMOUNT 29
 #define COL_HOME_NUMBER 0
 #define COL_HOME_EMAIL 7
 #define COL_WORK_NUMBER 8
 #define COL_FAX_NUMBER 16
 #define COL_WORK_EMAIL 17
-#define COL_DATE 22
-#define COL_SENT 23
-#define COL_ANSWERED 24
+#define COL_DATE 25
+#define COL_SENT 26
+#define COL_ANSWERED 27
 
 #define CONTACTS_QUERY_ALL						\
 	"SELECT ?v nco:fullname(?c) "					\
@@ -63,7 +63,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
 	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
-	"nco:photo(?c) "						\
+	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"\"NOTACALL\" \"false\" \"false\" ?c "				\
 	"WHERE { "							\
 		"?c a nco:PersonContact . "				\
@@ -83,6 +84,7 @@
 		"?c nco:hasAffiliation ?a . "				\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"}"
 
@@ -109,7 +111,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
 	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
-	"nco:photo(?c) "						\
+	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -130,6 +133,7 @@
 		"?c nco:hasAffiliation ?a . "				\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"} ORDER BY DESC(nmo:receivedDate(?call))"
 
@@ -156,7 +160,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
 	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
-	"nco:photo(?c) "						\
+	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -177,6 +182,7 @@
 		"?c nco:hasAffiliation ?a . "				\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"} ORDER BY DESC(nmo:receivedDate(?call))"
 
@@ -203,7 +209,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew)"	\
 	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
-	"nco:photo(?c) "						\
+	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -223,6 +230,7 @@
 		"?c nco:hasAffiliation ?a . "				\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"} ORDER BY DESC(nmo:sentDate(?call))"
 
@@ -248,7 +256,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
 	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
-	"nco:photo(?c) "						\
+	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -268,6 +277,7 @@
 	"OPTIONAL { ?c nco:hasAffiliation ?a . "			\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"} UNION { "							\
 		"?call a nmo:Call ; "					\
@@ -285,6 +295,7 @@
 	"OPTIONAL { ?c nco:hasAffiliation ?a . "			\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"} } ORDER BY DESC(nmo:receivedDate(?call))"
 
@@ -317,7 +328,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f  nco:emailAddress(?ew)"	\
 	"nco:birthDate(<%s>) nco:nickname(<%s>) nco:websiteUrl(<%s>) "	\
-	"nco:photo(<%s>) "						\
+	"nco:photo(<%s>) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"\"NOTACALL\" \"false\" \"false\" <%s> "			\
 	"WHERE { "							\
 		"<%s> a nco:Contact . "					\
@@ -337,6 +349,7 @@
 		"<%s> nco:hasAffiliation ?a . "				\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . }" 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . }"		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"}"
 
@@ -790,6 +803,9 @@ add_entry:
 	contact->nickname = g_strdup(reply[19]);
 	contact->website = g_strdup(reply[20]);
 	contact->photo = g_strdup(reply[21]);
+	contact->company = g_strdup(reply[22]);
+	contact->department = g_strdup(reply[23]);
+	contact->title = g_strdup(reply[24]);
 
 	set_call_type(contact, reply[COL_DATE], reply[COL_SENT],
 			reply[COL_ANSWERED]);
diff --git a/plugins/vcard.c b/plugins/vcard.c
index 05a8a13..0eed8ae 100644
--- a/plugins/vcard.c
+++ b/plugins/vcard.c
@@ -321,6 +321,30 @@ static void vcard_printf_email(GString *vcards, const char *email)
 	}
 }
 
+static gboolean org_fields_present(struct phonebook_contact *contact)
+{
+	if (contact->company && strlen(contact->company))
+		return TRUE;
+
+	if (contact->department && strlen(contact->department))
+		return TRUE;
+
+	if (contact->title && strlen(contact->title))
+		return TRUE;
+
+	return FALSE;
+}
+
+static void vcard_printf_org(GString *vcards,
+					struct phonebook_contact *contact)
+{
+	if (org_fields_present(contact) == FALSE)
+		return;
+
+	vcard_printf(vcards, "ORG:%s;%s;%s", contact->company,
+				contact->department, contact->title);
+}
+
 static void vcard_printf_adr(GString *vcards, struct phonebook_contact *contact)
 {
 	if (address_fields_present(contact) == FALSE) {
@@ -418,6 +442,9 @@ void phonebook_add_contact(GString *vcards, struct phonebook_contact *contact,
 	if (filter & FILTER_PHOTO)
 		vcard_printf_tag(vcards, "PHOTO", NULL, contact->photo);
 
+	if (filter & FILTER_ORG)
+		vcard_printf_org(vcards, contact);
+
 	if (filter & FILTER_X_IRMC_CALL_DATETIME)
 		vcard_printf_datetime(vcards, contact);
 
@@ -460,6 +487,9 @@ void phonebook_contact_free(struct phonebook_contact *contact)
 	g_free(contact->nickname);
 	g_free(contact->website);
 	g_free(contact->photo);
+	g_free(contact->company);
+	g_free(contact->department);
+	g_free(contact->title);
 	g_free(contact->datetime);
 	g_free(contact);
 }
diff --git a/plugins/vcard.h b/plugins/vcard.h
index a9809ea..0f52425 100644
--- a/plugins/vcard.h
+++ b/plugins/vcard.h
@@ -59,6 +59,9 @@ struct phonebook_contact {
 	char *nickname;
 	char *website;
 	char *photo;
+	char *company;
+	char *department;
+	char *title;
 	char *datetime;
 	int calltype;
 };
-- 
1.6.3.3


^ permalink raw reply related

* Re: [PATCH v2] Bluetooth: Implement LE Set Advertise Enable cmd
From: Ville Tervo @ 2010-08-20 10:31 UTC (permalink / raw)
  To: ext Anderson Briglia; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <1282232558-14472-1-git-send-email-anderson.briglia@openbossa.org>

Hi,

On Thu, Aug 19, 2010 at 05:42:38PM +0200, ext Anderson Briglia wrote:
> This patch implements LE Set Advertise Enable command for dual mode and
> Low Energy hci controllers. It also adds new HCI flags in order to
> indicate the Advertising state for userland applications and kernel
> itself.
> 
> Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
> ---
>  include/net/bluetooth/hci.h |    6 ++++++
>  net/bluetooth/hci_event.c   |   27 +++++++++++++++++++++++++++
>  2 files changed, 33 insertions(+), 0 deletions(-)

Patch looks good to me, but I don't have working hardware to verify it currently.


-- 
Ville

^ permalink raw reply

* Re: [PATCH] bluetooth: fix not setting security level when creating a rfcomm session
From: Ville Tervo @ 2010-08-20 10:55 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <1282215970-32758-1-git-send-email-luiz.dentz@gmail.com>

On Thu, Aug 19, 2010 at 01:06:10PM +0200, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
> 
> This cause 'No Bonding' to be used if userspace has not yet been paired
> with remote device since the l2cap socket used to create the rfcomm
> session does not have any security level set.

Looks good.

> Signed-off-by: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>

Acked-by: Ville Tervo <ville.tervo@nokia.com>

-- 
Ville

^ permalink raw reply

* Re: [PATCH 0/8] Clean up Obex btio.[ch] and make it self contained
From: Luiz Augusto von Dentz @ 2010-08-20 11:39 UTC (permalink / raw)
  To: Zhenhua Zhang; +Cc: linux-bluetooth
In-Reply-To: <1282227676-15381-1-git-send-email-zhenhua.zhang@intel.com>

Hi,

On Thu, Aug 19, 2010 at 5:21 PM, Zhenhua Zhang <zhenhua.zhang@intel.com> wrote:
> Hi,
>
> This series of patches is to seperate btio.[ch] from src to btio directory. To make btio.[ch] self contained for obexd, there're some cleanup work:

Sounds good, this should make it easier to maintain those in sync with
other projects using it.

> 1. remove unused bt_io_set(). It is neither used by bluez or obexd.
> 2. remove unused SCO/L2RAW related code for Obexd. Note: BlueZ code requires SCO/L2RAW related functions. We may consider to add them back later.

Im not so sure if we want to have this code removed, obviously after
that in case of changes/fixes they may not apply cleanly in all
projects, so keeping them in sync won't be as easy anymore.

> 3. replace void *userdata with gpointer userdata. To make it consistent with bluez btio.c
> 4. refactor hci_devba into devid2ba. Remove dependence with hci*.h
> 5. Remove libbluetooth dependence for obexd.

This is fine as long as the other copies have this changes too.


-- 
Luiz Augusto von Dentz
Computer Engineer

^ permalink raw reply

* Re: [PATCH 1/2] Add handling of single contact's fields handled in VCARD structure
From: Johan Hedberg @ 2010-08-20 12:25 UTC (permalink / raw)
  To: Rafał Michalski; +Cc: linux-bluetooth
In-Reply-To: <AANLkTin5i+qBUga7sjMQFMCxHgafP8H4Lbd1+zfM1Jcf@mail.gmail.com>

Hi Rafal,

On Fri, Aug 20, 2010, Rafał Michalski wrote:
> From 09a00e743a8aa8f11b88f9fc440029970b030e04 Mon Sep 17 00:00:00 2001
> From: Rafal Michalski <michalski.raf@gmail.com>
> Date: Fri, 20 Aug 2010 09:00:33 +0200
> Subject: [PATCH 1/2] Add handling of single contact's fields handled in VCARD structure
> 
> After pulling contacts these fields weren't present in downloaded
> VCARD structure in spite of that these fields existed (not empty).
> 
> This patch adds handling of fields: BDAY, NICKNAME, URL, PHOTO
> To solve this problem extending number of columns and queries of database
> was needed especially. Displaying these fields is done by genaral
> functions: vcard_printf_tag, vcard_printf_slash_tag.
> Of course fields mentioned above were added to phonebook_contact structure
> as char * type to save gained data.
> ---
>  plugins/phonebook-tracker.c |   29 ++++++++++++++----
>  plugins/vcard.c             |   68 +++++++++++++++++++++++++++++++++++++++++++
>  plugins/vcard.h             |    4 ++
>  3 files changed, 95 insertions(+), 6 deletions(-)

Thanks. This patch has now been pushed upstream.

Johan

^ permalink raw reply

* Re: [PATCH 2/2] Add handling of ORG contact's fields handled in VCARD structure
From: Johan Hedberg @ 2010-08-20 12:26 UTC (permalink / raw)
  To: Rafał Michalski; +Cc: linux-bluetooth
In-Reply-To: <AANLkTimU5SnF1D0xJ=qEKsqgJSWNmv+USpViaaUV+bQ0@mail.gmail.com>

Hi Rafal,

On Fri, Aug 20, 2010, Rafał Michalski wrote:
> From 44a30279e45df82ae4ceed254a7f895331073414 Mon Sep 17 00:00:00 2001
> From: Rafal Michalski <michalski.raf@gmail.com>
> Date: Fri, 20 Aug 2010 09:01:29 +0200
> Subject: [PATCH 2/2] Add handling of ORG contact's fields handled in VCARD structure
> 
> After pulling contacts these fields weren't present in downloaded
> VCARD structure in spite of that these fields existed (not empty).
> 
> This patch adds handling of fields grouped under ORG tag.
> To solve this problem extending number of columns and queries of database
> was needed especially. Of course fields mentioned above were added to
> phonebook_contact structure as char * type to save gained data.
> ---
>  plugins/phonebook-tracker.c |   38 +++++++++++++++++++++++++++-----------
>  plugins/vcard.c             |   30 ++++++++++++++++++++++++++++++
>  plugins/vcard.h             |    3 +++
>  3 files changed, 60 insertions(+), 11 deletions(-)

And this one is also upstream. Thanks.

Johan

^ permalink raw reply

* [PATCH] Remove dup VCard2.1 SDP format for OPP
From: Tom Counihan @ 2010-08-20 12:34 UTC (permalink / raw)
  To: linux-bluetooth

OPP SDP record appears to have a duplicate
entry for Supported Formats List.

---
 plugins/opp.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/plugins/opp.c b/plugins/opp.c
index cd46464..05f944f 100644
--- a/plugins/opp.c
+++ b/plugins/opp.c
@@ -83,7 +83,6 @@
   <attribute id=\"0x0303\">                                    \
     <sequence>                                                 \
       <uint8 value=\"0x01\"/>                                  \
-      <uint8 value=\"0x01\"/>                                  \
       <uint8 value=\"0x02\"/>                                  \
       <uint8 value=\"0x03\"/>                                  \
       <uint8 value=\"0x04\"/>                                  \
-- 
1.7.1.1

^ permalink raw reply related

* Re: [PATCH] Remove dup VCard2.1 SDP format for OPP
From: Johan Hedberg @ 2010-08-20 12:59 UTC (permalink / raw)
  To: Tom Counihan; +Cc: linux-bluetooth
In-Reply-To: <AANLkTin+CRVwKgC+UaDK6q4PRrw9eGi3c7++PSxWODcu@mail.gmail.com>

Hi Tom,

On Fri, Aug 20, 2010, Tom Counihan wrote:
> OPP SDP record appears to have a duplicate
> entry for Supported Formats List.
> 
> ---
>  plugins/opp.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)

The patch looks fine but doesn't apply against latest git:

error: patch failed: plugins/opp.c:83
error: plugins/opp.c: patch does not apply
Patch failed at 0001 Remove dup VCard2.1 SDP format for OPP

Could you make sure that it applies cleanly to latest git and then
resend? Thanks.

Johan

^ permalink raw reply

* Re: [PATCH] Remove dup VCard2.1 SDP format for OPP
From: Tom Counihan @ 2010-08-20 13:32 UTC (permalink / raw)
  To: Tom Counihan, linux-bluetooth
In-Reply-To: <20100820125948.GA16376@jh-x301>

On Fri, Aug 20, 2010 at 1:59 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi Tom,
>
> On Fri, Aug 20, 2010, Tom Counihan wrote:
>> OPP SDP record appears to have a duplicate
>> entry for Supported Formats List.
>>
>> ---
>>  plugins/opp.c |    1 -
>>  1 files changed, 0 insertions(+), 1 deletions(-)
>
> The patch looks fine but doesn't apply against latest git:
>
> error: patch failed: plugins/opp.c:83
> error: plugins/opp.c: patch does not apply
> Patch failed at 0001 Remove dup VCard2.1 SDP format for OPP
>
> Could you make sure that it applies cleanly to latest git and then
> resend? Thanks.

I'll send again - I'm assuming that the cause here is we had a race
condition between inbound patches?
>
> Johan
>

^ permalink raw reply

* Re: [PATCH] Remove dup VCard2.1 SDP format for OPP
From: Tom Counihan @ 2010-08-20 13:39 UTC (permalink / raw)
  To: Tom Counihan, linux-bluetooth
In-Reply-To: <AANLkTi=YeYGdojmXt-0gRdXPafsupP6CZc4r7dj2ufAg@mail.gmail.com>

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

Hi Johan,

Attaching patch as an attachment - hopefully all should be fine now.

Warm Regards
Tom.

On Fri, Aug 20, 2010 at 2:32 PM, Tom Counihan
<tomcounihan@googlemail.com> wrote:
> On Fri, Aug 20, 2010 at 1:59 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
>> Hi Tom,
>>
>> On Fri, Aug 20, 2010, Tom Counihan wrote:
>>> OPP SDP record appears to have a duplicate
>>> entry for Supported Formats List.
>>>
>>> ---
>>>  plugins/opp.c |    1 -
>>>  1 files changed, 0 insertions(+), 1 deletions(-)
>>
>> The patch looks fine but doesn't apply against latest git:
>>
>> error: patch failed: plugins/opp.c:83
>> error: plugins/opp.c: patch does not apply
>> Patch failed at 0001 Remove dup VCard2.1 SDP format for OPP
>>
>> Could you make sure that it applies cleanly to latest git and then
>> resend? Thanks.
>
> I'll send again - I'm assuming that the cause here is we had a race
> condition between inbound patches?
>>
>> Johan
>>
>

[-- Attachment #2: 0001-Remove-dup-VCard2.1-SDP-format-for-OPP.patch --]
[-- Type: application/octet-stream, Size: 758 bytes --]

From ab7d7fbf60a016b491200f4c5eaf100188dd5d7b Mon Sep 17 00:00:00 2001
From: Tom Counihan <tomcounihan@googlemail.com>
Date: Fri, 20 Aug 2010 14:20:53 +0100
Subject: [PATCH] Remove dup VCard2.1 SDP format for OPP

OPP SDP record appears to have a duplicate
entry for Supported Formats List.
---
 plugins/opp.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/plugins/opp.c b/plugins/opp.c
index cd46464..05f944f 100644
--- a/plugins/opp.c
+++ b/plugins/opp.c
@@ -83,7 +83,6 @@
   <attribute id=\"0x0303\">					\
     <sequence>							\
       <uint8 value=\"0x01\"/>					\
-      <uint8 value=\"0x01\"/>					\
       <uint8 value=\"0x02\"/>					\
       <uint8 value=\"0x03\"/>					\
       <uint8 value=\"0x04\"/>					\
-- 
1.7.1.1


^ permalink raw reply related

* Re: [PATCH] Remove dup VCard2.1 SDP format for OPP
From: Johan Hedberg @ 2010-08-20 15:58 UTC (permalink / raw)
  To: Tom Counihan; +Cc: linux-bluetooth
In-Reply-To: <AANLkTim9y59pMzPGSkZi431oTAjEjdiEtQHnt_-D2z85@mail.gmail.com>

Hi Tom,

On Fri, Aug 20, 2010, Tom Counihan wrote:
> Attaching patch as an attachment - hopefully all should be fine now.

Yes, it was fine. The patch is now upstream. Thanks.

Johan

^ permalink raw reply

* [PATCH 2nd version] Makefile.am fixes
From: Marcel Mol @ 2010-08-20 16:32 UTC (permalink / raw)
  To: linux-bluetooth

vcard.[ch] is not related to pbap, but to phonebook backend
---
 Makefile.am |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 07fc27d..fdc4f7e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,8 +52,7 @@ builtin_modules += ftp
 builtin_sources += plugins/ftp.c
 
 builtin_modules += pbap
-builtin_sources += plugins/pbap.c plugins/phonebook.h \
-			plugins/vcard.h plugins/vcard.c
+builtin_sources += plugins/pbap.c
 
 builtin_modules += irmc
 builtin_sources += plugins/irmc.c
@@ -61,6 +60,8 @@ builtin_sources += plugins/irmc.c
 builtin_modules += syncevolution
 builtin_sources += plugins/syncevolution.c
 
+builtin_sources += plugins/phonebook.h plugins/vcard.h plugins/vcard.c
+
 builtin_nodist += plugins/phonebook.c
 
 libexec_PROGRAMS += src/obexd
@@ -99,7 +100,6 @@ src/plugin.$(OBJEXT): src/builtin.h
 
 src/builtin.h: src/genbuiltin $(builtin_sources)
 	$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
-
 endif
 
 if CLIENT
-- 
1.7.2.1


^ permalink raw reply related

* [PATCH] Makefile.am fixes
From: Marcel Mol @ 2010-08-20 16:32 UTC (permalink / raw)
  To: linux-bluetooth

phonebook.h should not be under _nodist.
vcard.[ch] is not related to pbap, but to phonebook backend
---
 Makefile.am |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 07fc27d..fdc4f7e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,8 +52,7 @@ builtin_modules += ftp
 builtin_sources += plugins/ftp.c
 
 builtin_modules += pbap
-builtin_sources += plugins/pbap.c plugins/phonebook.h \
-			plugins/vcard.h plugins/vcard.c
+builtin_sources += plugins/pbap.c
 
 builtin_modules += irmc
 builtin_sources += plugins/irmc.c
@@ -61,6 +60,8 @@ builtin_sources += plugins/irmc.c
 builtin_modules += syncevolution
 builtin_sources += plugins/syncevolution.c
 
+builtin_sources += plugins/phonebook.h plugins/vcard.h plugins/vcard.c
+
 builtin_nodist += plugins/phonebook.c
 
 libexec_PROGRAMS += src/obexd
@@ -99,7 +100,6 @@ src/plugin.$(OBJEXT): src/builtin.h
 
 src/builtin.h: src/genbuiltin $(builtin_sources)
 	$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
-
 endif
 
 if CLIENT
-- 
1.7.2.1


^ permalink raw reply related

* Re: PAN performance
From: Han @ 2010-08-20 16:50 UTC (permalink / raw)
  To: Arun Kumar, linux-bluetooth
In-Reply-To: <AANLkTik5Q0CpUu=wpz_X8An1h6ShTku19xUff3O39Bkx@mail.gmail.com>

Hi Arun,
I was able to transfer pictures and file over BT in fair good speed. I
yet to test the actual bps though.  I will check out the
configurations...
thanks
Han

On Thu, Aug 19, 2010 at 10:55 PM, Arun Kumar <arunkat@gmail.com> wrote:
> Hello Han,
>
> just curious--are you able to get good performance[upto 3 Mbps] with non-pan
> bluez profiles? as BT speeds depend on HCI transports too used below viz.
> UARTS. They may not be configured optimally for BR/EDR high speeds...
>
> --
> Best Regards,
> Arun Kumar Singh
>
>
>> On Fri, Aug 20, 2010 at 9:27 AM, Han <keepsimple@gmail.com> wrote:
>>>
>>> Hi,
>>> I have been using bluetooth PAN to run some personal programs. One
>>> thing I noticed is that PAN seems to be very slow (i.e. not up to
>>> 3Mbps for BT 2.0). I have bluetooth 2.0 adapters on my laptops and I
>>> do SSH over PAN.  Whenever I run a GUI application (on sshd server), i
>>> see the GUI response is very slow.  It is not video or anything so I
>>> don't think it needs up to 3Mbps. Is this slowness over PAN expected?
>>>
>>> Thanks.
>>> Han
>>> --
>>> 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

* Re: PAN performance
From: Han @ 2010-08-20 16:52 UTC (permalink / raw)
  To: steven bluez; +Cc: linux-bluetooth
In-Reply-To: <AANLkTikch9E6mw-YErX7-85yivWVAh2E2iRS3eBc1hp5@mail.gmail.com>

On Thu, Aug 19, 2010 at 11:59 PM, steven bluez <steven.bluez@gmail.com> wrote:
>
> Hi Han,
> On Fri, Aug 20, 2010 at 9:27 AM, Han <keepsimple@gmail.com> wrote:
>>
>> Hi,
>> I have been using bluetooth PAN to run some personal programs. One
>> thing I noticed is that PAN seems to be very slow (i.e. not up to
>> 3Mbps for BT 2.0). I have bluetooth 2.0 adapters on my laptops and I
>> do SSH over PAN.  Whenever I run a GUI application (on sshd server), i
>> see the GUI response is very slow.  It is not video or anything so I
>> don't think it needs up to 3Mbps. Is this slowness over PAN expected?
>>
>> Thanks.
>> Han
>> --
>> 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
>
> I think is depending upon the vendor you have. I had a chip which had no
> issues like yours and the 3mbps doesnt come into the scenario you expect
> instead you  get 1-2mbps in bluetooth. If it's bidi direction it might
> vary...My experience of pan would be around 1.5mpbs MAX

I noticed the difference between chips as well. But i saw the issue
even with one of mine better BT doggles ;-).  Btw,  I tried to use
"ssh -C -X"  options and now the latency is much better.

>
> Regards,
> Steven
>

^ permalink raw reply

* [PATCH v3] Firmware download for Qualcomm Bluetooth devices
From: Matthew Wilson @ 2010-08-20 21:37 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: marcel, johan.hedberg, rshaffer, Matthew Wilson
In-Reply-To: <4C6BFF05.5040506@codeaurora.org>

Configures device address from hciattach parameter.
UART speed limited to 115200.
Requires separate device specific firmware.
---
 Makefile.tools             |    3 +-
 tools/hciattach.c          |   10 ++
 tools/hciattach.h          |    1 +
 tools/hciattach_qualcomm.c |  279 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 292 insertions(+), 1 deletions(-)
 create mode 100644 tools/hciattach_qualcomm.c

diff --git a/Makefile.tools b/Makefile.tools
index 8ee1972..1c46542 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -24,7 +24,8 @@ tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \
 						tools/hciattach_st.c \
 						tools/hciattach_ti.c \
 						tools/hciattach_tialt.c \
-						tools/hciattach_ath3k.c
+						tools/hciattach_ath3k.c \
+						tools/hciattach_qualcomm.c
 tools_hciattach_LDADD = lib/libbluetooth.la
 
 tools_hciconfig_SOURCES = tools/hciconfig.c tools/csr.h tools/csr.c \
diff --git a/tools/hciattach.c b/tools/hciattach.c
index 5662f57..ad2afa4 100644
--- a/tools/hciattach.c
+++ b/tools/hciattach.c
@@ -312,6 +312,11 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti)
 	return ath3k_post(fd, u->pm);
 }
 
+static int qualcomm(int fd, struct uart_t *u, struct termios *ti)
+{
+	return qualcomm_init(fd, u->speed, ti, u->bdaddr);
+}
+
 static int read_check(int fd, void *buf, int count)
 {
 	int res;
@@ -1116,6 +1121,11 @@ struct uart_t uart[] = {
 
 	{ "ath3k",    0x0000, 0x0000, HCI_UART_ATH3K, 115200, 115200,
 			FLOW_CTL, DISABLE_PM, NULL, ath3k_ps, ath3k_pm  },
+
+	/* QUALCOMM BTS */
+	{ "qualcomm",   0x0000, 0x0000, HCI_UART_H4,   115200, 115200,
+				FLOW_CTL, NULL, qualcomm },
+
 	{ NULL, 0 }
 };
 
diff --git a/tools/hciattach.h b/tools/hciattach.h
index c133321..2d26b77 100644
--- a/tools/hciattach.h
+++ b/tools/hciattach.h
@@ -52,3 +52,4 @@ int stlc2500_init(int fd, bdaddr_t *bdaddr);
 int bgb2xx_init(int dd, bdaddr_t *bdaddr);
 int ath3k_init(int fd, char *bdaddr, int speed);
 int ath3k_post(int fd, int pm);
+int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr);
diff --git a/tools/hciattach_qualcomm.c b/tools/hciattach_qualcomm.c
new file mode 100644
index 0000000..31ca3c8
--- /dev/null
+++ b/tools/hciattach_qualcomm.c
@@ -0,0 +1,279 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2005-2010  Marcel Holtmann <marcel@holtmann.org>
+ *  Copyright (c) 2010, Code Aurora Forum. All rights reserved.
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <syslog.h>
+#include <termios.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/poll.h>
+#include <sys/param.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <sys/uio.h>
+
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/hci.h>
+#include <bluetooth/hci_lib.h>
+
+#include "hciattach.h"
+
+#define FAILIF(x, args...) do {   \
+	if (x) {					  \
+		fprintf(stderr, ##args);  \
+		return -1;				  \
+	}							  \
+} while(0)
+
+typedef struct {
+	uint8_t uart_prefix;
+	hci_event_hdr hci_hdr;
+	evt_cmd_complete cmd_complete;
+	uint8_t status;
+	uint8_t data[16];
+} __attribute__((packed)) command_complete_t;
+
+
+static int read_command_complete(int fd, unsigned short opcode, unsigned char len) {
+	command_complete_t resp;
+	unsigned char vsevent[512];
+	int n;
+
+	/* Read reply. */
+	n = read_hci_event(fd, vsevent, sizeof(vsevent));
+	FAILIF(n < 0, "Failed to read response");
+
+	FAILIF(vsevent[1] != 0xFF, "Failed to read response");
+
+	n = read_hci_event(fd, (unsigned char *)&resp, sizeof(resp));
+	FAILIF(n < 0, "Failed to read response");
+
+	FAILIF(resp.hci_hdr.evt != EVT_CMD_COMPLETE, /* event must be event-complete */
+		   "Error in response: not a cmd-complete event, "
+		   "but 0x%02x!\n", resp.hci_hdr.evt);
+
+	FAILIF(resp.hci_hdr.plen < 4, /* plen >= 4 for EVT_CMD_COMPLETE */
+		   "Error in response: plen is not >= 4, but 0x%02x!\n",
+		   resp.hci_hdr.plen);
+
+	/* cmd-complete event: opcode */
+	FAILIF(resp.cmd_complete.opcode != 0,
+		   "Error in response: opcode is 0x%04x, not 0!",
+		   resp.cmd_complete.opcode);
+
+	return resp.status == 0 ? 0 : -1;
+}
+
+static int qualcomm_load_firmware(int fd, const char *firmware, const char *bdaddr_s) {
+
+	int fw = open(firmware, O_RDONLY);
+
+	fprintf(stdout, "Opening firmware file: %s\n", firmware);
+
+	FAILIF(fw < 0,
+		   "Could not open firmware file %s: %s (%d).\n",
+		   firmware, strerror(errno), errno);
+
+	fprintf(stdout, "Uploading firmware...\n");
+	do {
+		/* Read each command and wait for a response. */
+		unsigned char data[1024];
+		unsigned char cmdp[1 + sizeof(hci_command_hdr)];
+		hci_command_hdr *cmd = (hci_command_hdr *)(cmdp + 1);
+		int nr;
+		nr = read(fw, cmdp, sizeof(cmdp));
+		if (!nr)
+			break;
+		FAILIF(nr != sizeof(cmdp), "Could not read H4 + HCI header!\n");
+		FAILIF(*cmdp != HCI_COMMAND_PKT, "Command is not an H4 command packet!\n");
+
+		FAILIF(read(fw, data, cmd->plen) != cmd->plen,
+			   "Could not read %d bytes of data for command with opcode %04x!\n",
+			   cmd->plen,
+			   cmd->opcode);
+
+		if ((data[0] == 1) && (data[1] == 2) && (data[2] == 6)) {
+			bdaddr_t bdaddr;
+			if (bdaddr_s != NULL) {
+				(void) str2ba(bdaddr_s, &bdaddr);
+				memcpy(&data[3], &bdaddr, sizeof(bdaddr_t));
+			}
+		}
+
+		{
+			int nw;
+			struct iovec iov_cmd[2];
+			iov_cmd[0].iov_base = cmdp;
+			iov_cmd[0].iov_len	= sizeof(cmdp);
+			iov_cmd[1].iov_base = data;
+			iov_cmd[1].iov_len	= cmd->plen;
+			nw = writev(fd, iov_cmd, 2);
+			FAILIF(nw != (int) sizeof(cmdp) + cmd->plen,
+				   "Could not send entire command (sent only %d bytes)!\n",
+				   nw);
+		}
+
+		/* Wait for response */
+		if (read_command_complete(fd,
+					  cmd->opcode,
+					  cmd->plen) < 0) {
+			return -1;
+		}
+
+	} while(1);
+	fprintf(stdout, "Firmware upload successful.\n");
+
+	close(fw);
+	return 0;
+}
+
+int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr)
+{
+	struct timespec tm = {0, 50000};
+	char cmd[5];
+	unsigned char resp[100];		/* Response */
+	char fw[100];
+	int n;
+
+	memset(resp,'\0', 100);
+
+	/* Get Manufacturer and LMP version */
+	cmd[0] = HCI_COMMAND_PKT;
+	cmd[1] = 0x01;
+	cmd[2] = 0x10;
+	cmd[3] = 0x00;
+
+	do {
+		n = write(fd, cmd, 4);
+		if (n < 0) {
+			perror("Failed to write init command (READ_LOCAL_VERSION_INFORMATION)");
+			return -1;
+		}
+		if (n < 4) {
+			fprintf(stderr, "Wanted to write 4 bytes, could only write %d. Stop\n", n);
+			return -1;
+		}
+
+		/* Read reply. */
+		if (read_hci_event(fd, resp, 100) < 0) {
+			perror("Failed to read init response (READ_LOCAL_VERSION_INFORMATION)");
+			return -1;
+		}
+
+		/* Wait for command complete event for our Opcode */
+	} while (resp[4] != cmd[1] && resp[5] != cmd[2]);
+
+	/* Verify manufacturer */
+	if ((resp[11] & 0xFF) != 0x1d)
+		fprintf(stderr,"WARNING : module's manufacturer is not Qualcomm\n");
+
+	/* Print LMP version */
+	fprintf(stderr, "Qualcomm module LMP version : 0x%02x\n", resp[10] & 0xFF);
+
+	/* Print LMP subversion */
+	{
+		unsigned short lmp_subv = resp[13] | (resp[14] << 8);
+
+		fprintf(stderr, "Qualcomm module LMP sub-version : 0x%04x\n", lmp_subv);
+
+	}
+
+	/* Get SoC type */
+	cmd[0] = HCI_COMMAND_PKT;
+	cmd[1] = 0x00;
+	cmd[2] = 0xFC;
+	cmd[3] = 0x01;
+	cmd[4] = 0x06;
+
+	do {
+		n = write(fd, cmd, 5);
+		if (n < 0) {
+			perror("Failed to write init command");
+			return -1;
+		}
+		if (n < 5) {
+			fprintf(stderr, "Wanted to write 5 bytes, could only write %d. Stop\n", n);
+			return -1;
+		}
+
+		/* Read reply. */
+		if ((n = read_hci_event(fd, resp, 100)) < 0) {
+			perror("Failed to read init response");
+			return -1;
+		}
+
+	} while (resp[3] != 0 && resp[4] != 2);
+
+	snprintf(fw, sizeof(fw),
+		"/etc/firmware/%c%c%c%c%c%c_%c%c%c%c.bin",
+		resp[18], resp[19], resp[20], resp[21],
+		resp[22], resp[23],
+		resp[32], resp[33], resp[34], resp[35]);
+
+	/* Wait for command complete event for our Opcode */
+	if (read_hci_event(fd, resp, 100) < 0) {
+		perror("Failed to read init response");
+		return -1;
+	}
+
+	qualcomm_load_firmware(fd, fw, bdaddr);
+
+	/* Reset */
+	cmd[0] = HCI_COMMAND_PKT;
+	cmd[1] = 0x03;
+	cmd[2] = 0x0C;
+	cmd[3] = 0x00;
+
+	do {
+		n = write(fd, cmd, 4);
+		if (n < 0) {
+			perror("Failed to write reset command");
+			return -1;
+		}
+		if (n < 4) {
+			fprintf(stderr, "Wanted to write 4 bytes, could only write %d. Stop\n", n);
+			return -1;
+		}
+
+		/* Read reply. */
+		if ((n = read_hci_event(fd, resp, 100)) < 0) {
+			perror("Failed to read reset response");
+			return -1;
+		}
+
+	} while (resp[4] != cmd[1] && resp[5] != cmd[2]);
+
+	nanosleep(&tm, NULL);
+	return 0;
+}
-- 
1.7.1.1

--
Matthew Wilson
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

^ permalink raw reply related

* HCIConfig - BD Address not updated automatically
From: Cayetanot, Sebastien @ 2010-08-20 22:15 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org

All,

I'm currently facing an issue regarding the command hciconfig.

On my device :

I have run hciconfig hci0 in order to check if the hci interface is up and to get the BD_Addr.

I sent an hcitool cmd to change the BD_Addr. The command is accepted.

Just after I run the Ifconfig command but the BD_Addr is not changed it still the old one.

If I use a linux laptop to scan BT device, the device is seen with changed BD_Addr.

I have sent the hci command manually to read th BD_Addr on my device and the BD_Addr return is the one modified.

Just after by running Ifconfig, the BD_Addr is updated.

Is it normal that hciconfig never read the BD_Addr automatically ? even if I do a HIC reset.

My feeling is that the BD_Addr is read one time at the beginning and never updated until we manually read the BD_Addr using the hci command.

Any idea? 

Regards
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply

* Re: [PATCH v3] Firmware download for Qualcomm Bluetooth devices
From: Johan Hedberg @ 2010-08-20 22:37 UTC (permalink / raw)
  To: Matthew Wilson; +Cc: linux-bluetooth, marcel, rshaffer
In-Reply-To: <1282340251-10676-1-git-send-email-mtwilson@codeaurora.org>

Hi Matt,

On Fri, Aug 20, 2010, Matthew Wilson wrote:
> Configures device address from hciattach parameter.
> UART speed limited to 115200.
> Requires separate device specific firmware.
> ---
>  Makefile.tools             |    3 +-
>  tools/hciattach.c          |   10 ++
>  tools/hciattach.h          |    1 +
>  tools/hciattach_qualcomm.c |  279 ++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 292 insertions(+), 1 deletions(-)
>  create mode 100644 tools/hciattach_qualcomm.c

Thanks, the patch applies cleanly now. However, I spotted a couple of
whitespace/coding style issues that would be good to get fixed before
pushing this upstream:

> +#define FAILIF(x, args...) do {   \
> +	if (x) {					  \
> +		fprintf(stderr, ##args);  \
> +		return -1;				  \
> +	}							  \
> +} while(0)

Before each \ at the end of the line you use a mix of tabs and spaces.
Please just use tabs.

> +typedef struct {
> +	uint8_t uart_prefix;
> +	hci_event_hdr hci_hdr;
> +	evt_cmd_complete cmd_complete;
> +	uint8_t status;
> +	uint8_t data[16];
> +} __attribute__((packed)) command_complete_t;
> +
> +

Why the two consecutive empty lines? Please remove one.

> +static int read_command_complete(int fd, unsigned short opcode, unsigned char len) {

This one looks like it goes beyond 80 columns. Please split it. Also,
the coding style is to put the opening brace of a function on its own
line.

> +	FAILIF(resp.hci_hdr.evt != EVT_CMD_COMPLETE, /* event must be event-complete */
> +		   "Error in response: not a cmd-complete event, "
> +		   "but 0x%02x!\n", resp.hci_hdr.evt);

Mixed tabs and spaces for indentation. Please just use tabs.

> +	FAILIF(resp.hci_hdr.plen < 4, /* plen >= 4 for EVT_CMD_COMPLETE */
> +		   "Error in response: plen is not >= 4, but 0x%02x!\n",
> +		   resp.hci_hdr.plen);

Same here.

> +
> +	/* cmd-complete event: opcode */
> +	FAILIF(resp.cmd_complete.opcode != 0,
> +		   "Error in response: opcode is 0x%04x, not 0!",
> +		   resp.cmd_complete.opcode);

And here.

> +static int qualcomm_load_firmware(int fd, const char *firmware, const char *bdaddr_s) {

This one goes beyond 80 columns too and the opening brace should be on
its own line.

> +	FAILIF(fw < 0,
> +		   "Could not open firmware file %s: %s (%d).\n",
> +		   firmware, strerror(errno), errno);

Mixed tabs and spaces for indentation.

> +		FAILIF(read(fw, data, cmd->plen) != cmd->plen,
> +			   "Could not read %d bytes of data for command with opcode %04x!\n",
> +			   cmd->plen,
> +			   cmd->opcode);

Same here.

> +			FAILIF(nw != (int) sizeof(cmdp) + cmd->plen,
> +				   "Could not send entire command (sent only %d bytes)!\n",
> +				   nw);

And here.

> +		if (read_command_complete(fd,
> +					  cmd->opcode,
> +					  cmd->plen) < 0) {

And here. Why do you split it into three lines when it all fits within
80 columns?

Johan

^ permalink raw reply

* Re: HCIConfig - BD Address not updated automatically
From: Marcel Holtmann @ 2010-08-21  8:36 UTC (permalink / raw)
  To: Cayetanot, Sebastien; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <79C392C3A040A44895195AED5DB296F7AC3F2A46@irsmsx502.ger.corp.intel.com>

Hi Sebastien,

> I'm currently facing an issue regarding the command hciconfig.
> 
> On my device :
> 
> I have run hciconfig hci0 in order to check if the hci interface is up and to get the BD_Addr.
> 
> I sent an hcitool cmd to change the BD_Addr. The command is accepted.
> 
> Just after I run the Ifconfig command but the BD_Addr is not changed it still the old one.
> 
> If I use a linux laptop to scan BT device, the device is seen with changed BD_Addr.
> 
> I have sent the hci command manually to read th BD_Addr on my device and the BD_Addr return is the one modified.
> 
> Just after by running Ifconfig, the BD_Addr is updated.
> 
> Is it normal that hciconfig never read the BD_Addr automatically ? even if I do a HIC reset.
> 
> My feeling is that the BD_Addr is read one time at the beginning and never updated until we manually read the BD_Addr using the hci command.
> 
> Any idea? 

this pretty simple, only because you change the BD_ADDR with its vendor
command, it is not magically being used. Neither in software nor in the
firmware of the device. You need to do a soft reset to make this address
active. And then ensure that the kernel HCI layer knows that the reset
has happened.

Which hardware manufacture is this and what type of transport are you
using?

Regards

Marcel



^ permalink raw reply

* Re: [PATCH] Makefile.am fixes
From: Marcel Holtmann @ 2010-08-21  8:39 UTC (permalink / raw)
  To: Marcel Mol; +Cc: linux-bluetooth
In-Reply-To: <201008201635.o7KGZLs1009991@joshua.mesa.nl>

Hi Marcel,

> phonebook.h should not be under _nodist.

yes it should. It is auto-generated.

> vcard.[ch] is not related to pbap, but to phonebook backend
> ---
>  Makefile.am |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Did you verify that "fakeroot make distcheck" still works properly after
your changes?

Regards

Marcel



^ permalink raw reply

* Re: [PATCH] Makefile.am fixes
From: Marcel J.E. Mol @ 2010-08-21 12:47 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth
In-Reply-To: <1282379964.23399.223.camel@localhost.localdomain>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset*=utf-8''%E2%80%9Cus-ascii, Size: 1388 bytes --]

On Sat, Aug 21, 2010 at 10:39:24AM +0200, Marcel Holtmann wrote:
> Hi Marcel,
> 
> > phonebook.h should not be under _nodist.
> 
> yes it should. It is auto-generated.

Hm, I don't think phonebook.h is generated, phonebook.c more
or less is.... But anyway, this part of the change message is bogus.
Phonebook.h was not part of builtin_nodist. 
Sorry about that. I'll resend the patch without this sentence.

> > vcard.[ch] is not related to pbap, but to phonebook backend
> > ---
> >  Makefile.am |    6 +++---
> >  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> Did you verify that "fakeroot make distcheck" still works properly after
> your changes?

This fails with an error message about builtin.h. But the same error
happens without the Makefile.am patch.
(probably because distcheck builds in a separate builddir apart from
the actual source tree and builtin.h is generated in the builddir tree)

Thanks,

-Marcel
-- 
     ======--------         Marcel J.E. Mol                MESA Consulting B.V.
    =======---------        ph. +31-(0)6-54724868          P.O. Box 112
    =======---------        marcel@mesa.nl                 2630 AC  Nootdorp
__==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
 They couldn't think of a number,           Linux user 1148  --  counter.li.org
    so they gave me a name!  -- Rupert Hine  --  www.ruperthine.com

^ permalink raw reply

* 2.6.36-rc1 on zaurus: bluetooth regression
From: Pavel Machek @ 2010-08-21 15:24 UTC (permalink / raw)
  To: rpurdie, lenz, kernel list, arminlitzel, Cyril Hrubis,
	thommycheck, linux-arm-kernel, dbaryshkov, omegamoon, eric.y.miao,
	utx, zaurus-devel, Rafael J. Wysocki, linux-bluetooth

Hi!

Good news is that it boots, suspends and resumes.

Bad news is that bluetooth broke for me. I'm using CF bluetooth
card.

Socket 0 Bridge:   	[pxa2xx-pcmcia] 	(bus ID: pxa2xx-pcmcia)
	Configuration:	state: on	ready: yes
			Voltage: 3.3V Vcc: 3.3V Vpp: 0.0V
Socket 0 Device 0:	[serial_cs]		(bus ID: 0.0)
	Configuration:	state: on
	Product Name:   Compact Flash Bluetooth Card 
	Identification:	manf_id: 0x0279	card_id: 0x950b
			function: 2 (serial)
			prod_id(1): "Compact Flash" (0x95521410)
			prod_id(2): "Bluetooth Card" (0x7664fb1d)
			prod_id(3): --- (---)
			prod_id(4): --- (---)
Socket 1 Bridge:   	[pxa2xx-pcmcia] 	(bus ID: pxa2xx-pcmcia)
	Configuration:	state: on	ready: yes
			Voltage: 3.3V Vcc: 3.3V Vpp: 0.0V
Socket 1 Device 0:	[ide-cs]		(bus ID: 1.0)
	Configuration:	state: on
	Product Name:   HITACHI microdrive 
	Identification:	manf_id: 0x0319	card_id: 0x0000
			function: 4 (fixed disk)
			prod_id(1): "HITACHI" (0xf4f43949)
			prod_id(2): "microdrive" (0xa6d76178)
			prod_id(3): --- (---)
			prod_id(4): --- (---)


In 2.6.35, I have lots of messages in the syslog, and speed is slow,
but it works.

Aug 19 08:01:06 toy kernel: bcsp_recv: Out-of-order packet arrived, got 3 expected 2
Aug 19 08:01:06 toy kernel: bcsp_recv: Out-of-order packet arrived, got 4 expected 2
Aug 19 08:01:11 toy kernel: bcsp_recv: Short BCSP packet
Aug 19 08:01:11 toy kernel: bcsp_recv: Out-of-order packet arrived, got 3 expected 2
Aug 19 08:01:11 toy kernel: bcsp_recv: Out-of-order packet arrived, got 4 expected 2
Aug 19 08:01:12 toy kernel: bcsp_recv: Out-of-order packet arrived, got 5 expected 2
Aug 19 08:01:16 toy kernel: bcsp_recv: Short BCSP packet
Aug 19 08:01:16 toy kernel: bcsp_recv: Out-of-order packet arrived, got 2 expected 1
Aug 19 08:01:16 toy kernel: bcsp_recv: Out-of-order packet arrived, got 3 expected 1
Aug 19 08:01:16 toy kernel: bcsp_recv: Out-of-order packet arrived, got 4 expected 1

In 2.6.36-rc1, I get:

Aug 20 08:38:27 toy bluetoothd[1318]: HCI dev 0 down
Aug 20 08:38:27 toy bluetoothd[1318]: Adapter /org/bluez/1318/hci0 has been disabled
Aug 20 08:38:27 toy bluetoothd[1318]: Stopping security manager 0
Aug 20 08:38:27 toy kernel: pcmcia_socket pcmcia_socket0: pccard: card ejected from slot 0
Aug 20 08:38:27 toy kernel: PM: Removing info for pcmcia:0.0
Aug 20 08:38:27 toy kernel: PM: Removing info for No Bus:ttyS0
Aug 20 08:38:27 toy bluetoothd[1318]: HCI dev 0 unregistered
Aug 20 08:38:27 toy bluetoothd[1318]: Unregister path: /org/bluez/1318/hci0
Aug 20 08:38:27 toy kernel: PM: Removing info for No Bus:hci0
Aug 20 08:38:27 toy kernel: PM: Adding info for No Bus:ttyS0
Aug 20 08:38:31 toy kernel: pcmcia_socket pcmcia_socket0: pccard: PCMCIA card inserted into slot 0
Aug 20 08:38:31 toy kernel: pcmcia 0.0: pcmcia: registering new device pcmcia0.0 (IRQ: 201)
Aug 20 08:38:31 toy kernel: PM: Adding info for pcmcia:0.0
Aug 20 08:38:31 toy kernel: PM: Removing info for No Bus:ttyS0
Aug 20 08:38:31 toy kernel: 0.0: ttyS0 at I/O 0xc48402f8 (irq = 201) is a 16C950/954
Aug 20 08:38:31 toy kernel: PM: Adding info for No Bus:ttyS0
Aug 20 08:38:36 toy bluetoothd[1318]: HCI dev 0 registered
Aug 20 08:38:36 toy kernel: PM: Adding info for No Bus:hci0
Aug 20 08:38:36 toy kernel: bcsp_recv: Out-of-order packet arrived, got 1 expected 0
Aug 20 08:38:37 toy bluetoothd[1318]: accept: Socket operation on non-socket (88)
Aug 20 08:38:37 toy bluetoothd[1318]: HCI dev 0 up
Aug 20 08:38:37 toy bluetoothd[1318]: Starting security manager 0
Aug 20 08:38:37 toy kernel: bcsp_recv: Short BCSP packet
Aug 20 08:38:39 toy kernel: PM: Removing info for No Bus:rfcomm1
Aug 20 08:38:39 toy kernel: PM: Adding info for No Bus:rfcomm1
Aug 20 08:38:40 toy pand[1546]: Bluetooth PAN daemon version 4.66
Aug 20 08:38:40 toy pand[1546]: Connecting to 00:21:BA:FF:2D:37
Aug 20 08:38:40 toy kernel: hci_cmd_task: hci0 command tx timeout
Aug 20 08:38:42 toy bluetoothd[1318]: Can't read version info for /org/bluez/1318/hci0: Connection timed out (110)
Aug 20 08:38:44 toy modprobe: FATAL: Could not load /lib/modules/2.6.36-rc1/modules.dep: No such file or directory 

Any ideas?
							Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* Re: 2.6.36-rc1 on zaurus: bluetooth regression
From: Marek Vasut @ 2010-08-21 17:32 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Pavel Machek, rpurdie, lenz, kernel list, arminlitzel,
	Cyril Hrubis, thommycheck, dbaryshkov, omegamoon, eric.y.miao,
	utx, zaurus-devel, Rafael J. Wysocki, linux-bluetooth
In-Reply-To: <20100821152445.GA1536@ucw.cz>

Dne So 21. srpna 2010 17:24:45 Pavel Machek napsal(a):
> Hi!
> 
> Good news is that it boots, suspends and resumes.
> 
> Bad news is that bluetooth broke for me. I'm using CF bluetooth
> card.
> 
> Socket 0 Bridge:   	[pxa2xx-pcmcia] 	(bus ID: pxa2xx-pcmcia)
> 	Configuration:	state: on	ready: yes
> 			Voltage: 3.3V Vcc: 3.3V Vpp: 0.0V
> Socket 0 Device 0:	[serial_cs]		(bus ID: 0.0)
> 	Configuration:	state: on
> 	Product Name:   Compact Flash Bluetooth Card
> 	Identification:	manf_id: 0x0279	card_id: 0x950b
> 			function: 2 (serial)
> 			prod_id(1): "Compact Flash" (0x95521410)
> 			prod_id(2): "Bluetooth Card" (0x7664fb1d)
> 			prod_id(3): --- (---)
> 			prod_id(4): --- (---)
> Socket 1 Bridge:   	[pxa2xx-pcmcia] 	(bus ID: pxa2xx-pcmcia)
> 	Configuration:	state: on	ready: yes
> 			Voltage: 3.3V Vcc: 3.3V Vpp: 0.0V
> Socket 1 Device 0:	[ide-cs]		(bus ID: 1.0)
> 	Configuration:	state: on
> 	Product Name:   HITACHI microdrive
> 	Identification:	manf_id: 0x0319	card_id: 0x0000
> 			function: 4 (fixed disk)
> 			prod_id(1): "HITACHI" (0xf4f43949)
> 			prod_id(2): "microdrive" (0xa6d76178)
> 			prod_id(3): --- (---)
> 			prod_id(4): --- (---)
> 
> 
> In 2.6.35, I have lots of messages in the syslog, and speed is slow,
> but it works.
> 
> Aug 19 08:01:06 toy kernel: bcsp_recv: Out-of-order packet arrived, got 3
> expected 2 Aug 19 08:01:06 toy kernel: bcsp_recv: Out-of-order packet
> arrived, got 4 expected 2 Aug 19 08:01:11 toy kernel: bcsp_recv: Short
> BCSP packet
> Aug 19 08:01:11 toy kernel: bcsp_recv: Out-of-order packet arrived, got 3
> expected 2 Aug 19 08:01:11 toy kernel: bcsp_recv: Out-of-order packet
> arrived, got 4 expected 2 Aug 19 08:01:12 toy kernel: bcsp_recv:
> Out-of-order packet arrived, got 5 expected 2 Aug 19 08:01:16 toy kernel:
> bcsp_recv: Short BCSP packet
> Aug 19 08:01:16 toy kernel: bcsp_recv: Out-of-order packet arrived, got 2
> expected 1 Aug 19 08:01:16 toy kernel: bcsp_recv: Out-of-order packet
> arrived, got 3 expected 1 Aug 19 08:01:16 toy kernel: bcsp_recv:
> Out-of-order packet arrived, got 4 expected 1
> 
> In 2.6.36-rc1, I get:
> 
> Aug 20 08:38:27 toy bluetoothd[1318]: HCI dev 0 down
> Aug 20 08:38:27 toy bluetoothd[1318]: Adapter /org/bluez/1318/hci0 has been
> disabled Aug 20 08:38:27 toy bluetoothd[1318]: Stopping security manager 0
> Aug 20 08:38:27 toy kernel: pcmcia_socket pcmcia_socket0: pccard: card
> ejected from slot 0 Aug 20 08:38:27 toy kernel: PM: Removing info for
> pcmcia:0.0
> Aug 20 08:38:27 toy kernel: PM: Removing info for No Bus:ttyS0
> Aug 20 08:38:27 toy bluetoothd[1318]: HCI dev 0 unregistered
> Aug 20 08:38:27 toy bluetoothd[1318]: Unregister path: /org/bluez/1318/hci0
> Aug 20 08:38:27 toy kernel: PM: Removing info for No Bus:hci0
> Aug 20 08:38:27 toy kernel: PM: Adding info for No Bus:ttyS0
> Aug 20 08:38:31 toy kernel: pcmcia_socket pcmcia_socket0: pccard: PCMCIA
> card inserted into slot 0 Aug 20 08:38:31 toy kernel: pcmcia 0.0: pcmcia:
> registering new device pcmcia0.0 (IRQ: 201) Aug 20 08:38:31 toy kernel:
> PM: Adding info for pcmcia:0.0
> Aug 20 08:38:31 toy kernel: PM: Removing info for No Bus:ttyS0
> Aug 20 08:38:31 toy kernel: 0.0: ttyS0 at I/O 0xc48402f8 (irq = 201) is a
> 16C950/954 Aug 20 08:38:31 toy kernel: PM: Adding info for No Bus:ttyS0
> Aug 20 08:38:36 toy bluetoothd[1318]: HCI dev 0 registered
> Aug 20 08:38:36 toy kernel: PM: Adding info for No Bus:hci0
> Aug 20 08:38:36 toy kernel: bcsp_recv: Out-of-order packet arrived, got 1
> expected 0 Aug 20 08:38:37 toy bluetoothd[1318]: accept: Socket operation
> on non-socket (88) Aug 20 08:38:37 toy bluetoothd[1318]: HCI dev 0 up
> Aug 20 08:38:37 toy bluetoothd[1318]: Starting security manager 0
> Aug 20 08:38:37 toy kernel: bcsp_recv: Short BCSP packet
> Aug 20 08:38:39 toy kernel: PM: Removing info for No Bus:rfcomm1
> Aug 20 08:38:39 toy kernel: PM: Adding info for No Bus:rfcomm1
> Aug 20 08:38:40 toy pand[1546]: Bluetooth PAN daemon version 4.66
> Aug 20 08:38:40 toy pand[1546]: Connecting to 00:21:BA:FF:2D:37
> Aug 20 08:38:40 toy kernel: hci_cmd_task: hci0 command tx timeout
> Aug 20 08:38:42 toy bluetoothd[1318]: Can't read version info for
> /org/bluez/1318/hci0: Connection timed out (110) Aug 20 08:38:44 toy
> modprobe: FATAL: Could not load /lib/modules/2.6.36-rc1/modules.dep: No
> such file or directory
> 
> Any ideas?
> 							Pavel

Could it be due to the PCMCIA timings changes on pxa I did? Try reverting that 
change and retry.

^ permalink raw reply

* RE: [PATCH 0/8] Clean up Obex btio.[ch] and make it self contained
From: Zhang, Zhenhua @ 2010-08-23  1:13 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <AANLkTi=B=GoXrymjfKAnXuRDiTe7Uxqdiqs831nsWRb-@mail.gmail.com>

Hi Luiz,

Luiz Augusto von Dentz wrote:
> Hi,
> 
> On Thu, Aug 19, 2010 at 5:21 PM, Zhenhua Zhang
> <zhenhua.zhang@intel.com> wrote: 
>> Hi,
>> 
>> This series of patches is to seperate btio.[ch] from src to btio
>> directory. To make btio.[ch] self contained for obexd, there're some
>> cleanup work:  
> 
> Sounds good, this should make it easier to maintain those in sync with
> other projects using it.
> 
>> 1. remove unused bt_io_set(). It is neither used by bluez or obexd.
>> 2. remove unused SCO/L2RAW related code for Obexd. Note: BlueZ code
>> requires SCO/L2RAW related functions. We may consider to add them
>> back later.  
> 
> Im not so sure if we want to have this code removed, obviously after
> that in case of changes/fixes they may not apply cleanly in all
> projects, so keeping them in sync won't be as easy anymore.

You're right. For such code used in BlueZ, I will keep them to make sync easier. So now I am cleaning up BlueZ's btio.[ch]. Before I complete that part, I just want to send out what I plan to change for btio.[ch] to collect review comments earlier. The patches for BlueZ will be send out later.

>> 3. replace void *userdata with gpointer userdata. To make it
>> consistent with bluez btio.c 
>> 4. refactor hci_devba into devid2ba. Remove dependence with hci*.h
>> 5. Remove libbluetooth dependence for obexd.
> 
> This is fine as long as the other copies have this changes too.

Regards,
Zhenhua

^ 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