* Re: [PATCH] patch to request new firmware for AR3011 Chip
From: Luis R. Rodriguez @ 2010-04-27 15:55 UTC (permalink / raw)
To: Suraj Sumangala
Cc: linux-bluetooth@vger.kernel.org, dwmw2@infradead.org,
Luis Rodriguez, Jothikumar Mothilal, marcel@holtmann.org,
Vikram Kandukuri
In-Reply-To: <1272356922.1393.14.camel@atheros013-desktop>
On Tue, Apr 27, 2010 at 01:28:42AM -0700, Suraj Sumangala wrote:
>
> Signed-off-by: Vikram Kandukuri <vkandukuri@atheros.com>
> ---
> drivers/bluetooth/ath3k.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
> index 128cae4..7bda549 100644
> --- a/drivers/bluetooth/ath3k.c
> +++ b/drivers/bluetooth/ath3k.c
> @@ -122,9 +122,12 @@ static int ath3k_probe(struct usb_interface *intf,
>
> data->udev = udev;
>
> - if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
> - kfree(data);
> - return -EIO;
> + if (request_firmware(&firmware, "ath3k-2.fw", &udev->dev) < 0) {
> + BT_DBG("requesting old firmware");
> + if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
> + kfree(data);
> + return -EIO;
> + }
> }
>
> size = max_t(uint, firmware->size, 4096);
>
Looks OK but your subject should be something like:
[PATCH] ath3k: add support for new firmware
And your commit log is empty, other than your subject, please
be a little more descriptive. Describe what are the shiny new bells
and whistles added onto the new firmware. The more description
you can provide, the better.
Luis
^ permalink raw reply
* Re: [PATCH 3/3] SDP
From: Marcel Holtmann @ 2010-04-27 15:50 UTC (permalink / raw)
To: Johan Hedberg; +Cc: Santiago Carot Nemesio, linux-bluetooth
In-Reply-To: <20100427150516.GA11895@jh-x301>
Hi Johan,
> > This patch add memory checks after malloc function is called.
> >
> > >From 7cce3be5a1a1d506f4da71fc394ee3ccf71d8159 Mon Sep 17 00:00:00 2001
> > From: Santiago Carot Nemesio <sancane@gmail.com>
> > Date: Tue, 27 Apr 2010 15:19:44 +0200
> > Subject: [PATCH 3/3] Added memory checks
> >
> >
> > Signed-off-by: Santiago Carot Nemesio <sancane@gmail.com>
not signed-off-by in BlueZ please. That is a kernel requirement.
> I've pushed the first two patches upstream but I did have to fix their
> commit messages before that. If you try "git am" yourself for what you
> sent you'll see that the summary line becomes just "SDP" for all of them
> and it should be more descriptive than that (for examples see the bluez
> commit history).
>
> The third patch should also see these changes but additionally there
> were a few issues I noticed in the actual code:
>
> > u = malloc(sizeof(uuid_t));
> > + if (!u) {
> > + errno = ENOMEM;
> > + goto fail;
> > + }
>
> malloc will set the errno for you on failure so you shouldn't need to do
> it in your code.
>
> > lang = malloc(sizeof(sdp_lang_attr_t));
> > + if (!lang) {
> > + errno = ENOMEM;
> > + goto fail;
>
> Same here.
>
> > - uuid_t *uuid128 = bt_malloc(sizeof(uuid_t));
> > + uuid_t *uuid128 = malloc(sizeof(uuid_t));
>
> This seems unrelated to the other changes in the patch. I don't know the
> exact philosophy of when bt_malloc should be used and when malloc should
> be used (maybe Marcel can comment on that), but I'd simply leave this
> change out of the patch.
Since you are suppose to use bt_free to free the memory, you also should
allocate it with bt_malloc. They are simple wrappers, but important to
make sure all library allocation and freeing is done with the same
function. Not free() or malloc() from library A against another one form
library B.
In most cases this makes no difference, but there are corner cases where
is does make a difference. So please keep bt_malloc() if the memory
needs to be freed by the application.
Regards
Marcel
^ permalink raw reply
* Re: DUN client for oFono and BlueZ
From: Bastien Nocera @ 2010-04-27 15:40 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: ofono, linux-bluetooth@vger.kernel.org
In-Reply-To: <20100427153043.GA3374@vigoh>
On Tue, 2010-04-27 at 12:30 -0300, Gustavo F. Padovan wrote:
> Hi Bastien,
>
>
> * Bastien Nocera <hadess@hadess.net> [2010-04-27 09:15:28 +0100]:
>
> > On Mon, 2010-04-26 at 22:20 -0300, Gustavo F. Padovan wrote:
> > > Hi all,
> > >
> > > I'm starting the DUN Client implementation for the Linux Stack. DUN is
> > > the Bluetooth dial-up network profile. It makes possible share internet
> > > connection between two Bluetooth devices. That is my Google Summer of Code
> > > project for this year.
> >
> > Does this project include anything that will be reusable by non-oFono
> > based projects? Native BT PPP line discipline would have been nice.
> >
>
> Yes, oFono will be only the Agent, you can implement a new one if you
> want.
The ppp implementation in NetworkManager already works for me.
> Also oFono already does the PPP line discipline, so we don't need
> to duplicate such feature in BlueZ.
I thought BT PPP line discipline was a kernel feature.
^ permalink raw reply
* Re: DUN client for oFono and BlueZ
From: Gustavo F. Padovan @ 2010-04-27 15:30 UTC (permalink / raw)
To: Bastien Nocera; +Cc: ofono, linux-bluetooth@vger.kernel.org
In-Reply-To: <1272356128.17421.6781.camel@localhost.localdomain>
Hi Bastien,
* Bastien Nocera <hadess@hadess.net> [2010-04-27 09:15:28 +0100]:
> On Mon, 2010-04-26 at 22:20 -0300, Gustavo F. Padovan wrote:
> > Hi all,
> >
> > I'm starting the DUN Client implementation for the Linux Stack. DUN is
> > the Bluetooth dial-up network profile. It makes possible share internet
> > connection between two Bluetooth devices. That is my Google Summer of Code
> > project for this year.
>
> Does this project include anything that will be reusable by non-oFono
> based projects? Native BT PPP line discipline would have been nice.
>
Yes, oFono will be only the Agent, you can implement a new one if you
want. Also oFono already does the PPP line discipline, so we don't need
to duplicate such feature in BlueZ.
--
Gustavo F. Padovan
http://padovan.org
^ permalink raw reply
* Re: SDP comments
From: Johan Hedberg @ 2010-04-27 15:07 UTC (permalink / raw)
To: Santiago Carot Nemesio; +Cc: linux-bluetooth
In-Reply-To: <1272376267.2157.29.camel@mosquito>
Hi,
On Tue, Apr 27, 2010, Santiago Carot Nemesio wrote:
> It may be interesting to take in mind that some functions in sdp_lib
> such as sdp_list_append or sdp_list_insert_sorted can return NULL if
> there isn't enought memory. Grepping the code i saw sentences like next:
> ...
> ap = sdp_list_append(ap, pds);
> ...
> I think that it can result in a memory leak when the asignation return
> NULL over a not empty list. What do you think?
You're right. However this seems more like a design issue with the
library than something that could be easily fixed. Either we'd have to
break the API or then go for the glib way of calling abort() on memory
allocation failures (which in a way would also be breaking the API).
Johan
^ permalink raw reply
* Re: [PATCH 3/3] SDP
From: Johan Hedberg @ 2010-04-27 15:05 UTC (permalink / raw)
To: Santiago Carot Nemesio; +Cc: linux-bluetooth
In-Reply-To: <1272375578.2157.22.camel@mosquito>
Hi,
On Tue, Apr 27, 2010, Santiago Carot Nemesio wrote:
> This patch add memory checks after malloc function is called.
>
> >From 7cce3be5a1a1d506f4da71fc394ee3ccf71d8159 Mon Sep 17 00:00:00 2001
> From: Santiago Carot Nemesio <sancane@gmail.com>
> Date: Tue, 27 Apr 2010 15:19:44 +0200
> Subject: [PATCH 3/3] Added memory checks
>
>
> Signed-off-by: Santiago Carot Nemesio <sancane@gmail.com>
I've pushed the first two patches upstream but I did have to fix their
commit messages before that. If you try "git am" yourself for what you
sent you'll see that the summary line becomes just "SDP" for all of them
and it should be more descriptive than that (for examples see the bluez
commit history).
The third patch should also see these changes but additionally there
were a few issues I noticed in the actual code:
> u = malloc(sizeof(uuid_t));
> + if (!u) {
> + errno = ENOMEM;
> + goto fail;
> + }
malloc will set the errno for you on failure so you shouldn't need to do
it in your code.
> lang = malloc(sizeof(sdp_lang_attr_t));
> + if (!lang) {
> + errno = ENOMEM;
> + goto fail;
Same here.
> - uuid_t *uuid128 = bt_malloc(sizeof(uuid_t));
> + uuid_t *uuid128 = malloc(sizeof(uuid_t));
This seems unrelated to the other changes in the patch. I don't know the
exact philosophy of when bt_malloc should be used and when malloc should
be used (maybe Marcel can comment on that), but I'd simply leave this
change out of the patch.
Johan
^ permalink raw reply
* SDP comments
From: Santiago Carot Nemesio @ 2010-04-27 13:51 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1272375578.2157.22.camel@mosquito>
Hi,
It may be interesting to take in mind that some functions in sdp_lib
such as sdp_list_append or sdp_list_insert_sorted can return NULL if
there isn't enought memory. Grepping the code i saw sentences like next:
...
ap = sdp_list_append(ap, pds);
...
I think that it can result in a memory leak when the asignation return
NULL over a not empty list. What do you think?
Regards.
^ permalink raw reply
* Re: [PATCH 3/3] SDP
From: Santiago Carot Nemesio @ 2010-04-27 13:39 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1272375425.2157.20.camel@mosquito>
This patch add memory checks after malloc function is called.
>>From 7cce3be5a1a1d506f4da71fc394ee3ccf71d8159 Mon Sep 17 00:00:00 2001
From: Santiago Carot Nemesio <sancane@gmail.com>
Date: Tue, 27 Apr 2010 15:19:44 +0200
Subject: [PATCH 3/3] Added memory checks
Signed-off-by: Santiago Carot Nemesio <sancane@gmail.com>
---
lib/sdp.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 80 insertions(+), 7 deletions(-)
diff --git a/lib/sdp.c b/lib/sdp.c
index 667d412..64f2e96 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -1078,6 +1078,8 @@ static sdp_data_t *extract_int(const void *p, int bufsize, int *len)
}
d = malloc(sizeof(sdp_data_t));
+ if (!d)
+ return NULL;
SDPDBG("Extracting integer\n");
memset(d, 0, sizeof(sdp_data_t));
@@ -1152,6 +1154,9 @@ static sdp_data_t *extract_uuid(const uint8_t *p, int bufsize, int *len,
{
sdp_data_t *d = malloc(sizeof(sdp_data_t));
+ if (!d)
+ return NULL;
+
SDPDBG("Extracting UUID");
memset(d, 0, sizeof(sdp_data_t));
if (sdp_uuid_extract(p, bufsize, &d->val.uuid, len) < 0) {
@@ -1179,6 +1184,8 @@ static sdp_data_t *extract_str(const void *p, int bufsize, int *len)
}
d = malloc(sizeof(sdp_data_t));
+ if (!d)
+ return NULL;
memset(d, 0, sizeof(sdp_data_t));
d->dtd = *(uint8_t *) p;
@@ -1302,6 +1309,9 @@ static sdp_data_t *extract_seq(const void *p, int bufsize, int *len,
sdp_data_t *curr, *prev;
sdp_data_t *d = malloc(sizeof(sdp_data_t));
+ if (!d)
+ return NULL;
+
SDPDBG("Extracting SEQ");
memset(d, 0, sizeof(sdp_data_t));
*len = sdp_extract_seqtype(p, bufsize, &d->dtd, &seqlen);
@@ -1945,10 +1955,17 @@ int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr,
sdp_data_t *d;
for (d = sdpdata->val.dataseq; d; d = d->next) {
uuid_t *u;
- if (d->dtd < SDP_UUID16 || d->dtd > SDP_UUID128)
+ if (d->dtd < SDP_UUID16 || d->dtd > SDP_UUID128) {
+ errno = EINVAL;
goto fail;
+ }
u = malloc(sizeof(uuid_t));
+ if (!u) {
+ errno = ENOMEM;
+ goto fail;
+ }
+
memset(u, 0, sizeof(uuid_t));
*u = d->val.uuid;
*seqp = sdp_list_append(*seqp, u);
@@ -1957,7 +1974,7 @@ int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr,
}
fail:
sdp_list_free(*seqp, free);
- errno = EINVAL;
+ *seqp = NULL;
return -1;
}
@@ -1974,7 +1991,15 @@ int sdp_set_uuidseq_attr(sdp_record_t *rec, uint16_t aid, sdp_list_t *seq)
if (!seq || len == 0)
return -1;
dtds = (void **)malloc(len * sizeof(void *));
+ if (!dtds)
+ return -1;
+
values = (void **)malloc(len * sizeof(void *));
+ if (!values) {
+ free(dtds);
+ return -1;
+ }
+
for (p = seq, i = 0; i < len; i++, p = p->next) {
uuid_t *uuid = (uuid_t *)p->data;
if (uuid)
@@ -2028,6 +2053,10 @@ int sdp_get_lang_attr(const sdp_record_t *rec, sdp_list_t **langSeq)
sdp_data_t *pOffset = pEncoding->next;
if (pEncoding && pOffset) {
lang = malloc(sizeof(sdp_lang_attr_t));
+ if (!lang) {
+ errno = ENOMEM;
+ goto fail;
+ }
lang->code_ISO639 = pCode->val.uint16;
lang->encoding = pEncoding->val.uint16;
lang->base_offset = pOffset->val.uint16;
@@ -2039,6 +2068,10 @@ int sdp_get_lang_attr(const sdp_record_t *rec, sdp_list_t **langSeq)
curr_data = pOffset->next;
}
return 0;
+fail:
+ sdp_list_free(*langSeq, free);
+ *langSeq = NULL;
+ return -1;
}
int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq)
@@ -2069,6 +2102,8 @@ int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq)
if (uuid != NULL) {
profDesc = malloc(sizeof(sdp_profile_desc_t));
+ if (!profDesc)
+ goto fail;
profDesc->uuid = *uuid;
profDesc->version = version;
#ifdef SDP_DEBUG
@@ -2079,6 +2114,10 @@ int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq)
}
}
return 0;
+fail:
+ sdp_list_free(*profDescSeq, free);
+ *profDescSeq = NULL;
+ return -1;
}
int sdp_get_server_ver(const sdp_record_t *rec, sdp_list_t **u16)
@@ -2231,7 +2270,15 @@ static sdp_data_t *access_proto_to_dataseq(sdp_record_t *rec, sdp_list_t *proto)
seqlen = sdp_list_len(proto);
seqDTDs = (void **)malloc(seqlen * sizeof(void *));
+ if (!seqDTDs)
+ return NULL;
+
seqs = (void **)malloc(seqlen * sizeof(void *));
+ if (!seqs) {
+ free(seqDTDs);
+ return NULL;
+ }
+
for (i = 0, p = proto; p; p = p->next, i++) {
sdp_list_t *elt = (sdp_list_t *)p->data;
sdp_data_t *s;
@@ -2350,10 +2397,19 @@ int sdp_set_lang_attr(sdp_record_t *rec, const sdp_list_t *seq)
{
uint8_t uint16 = SDP_UINT16;
int status = 0, i = 0, seqlen = sdp_list_len(seq);
- void **dtds = (void **)malloc(3 * seqlen * sizeof(void *));
- void **values = (void **)malloc(3 * seqlen * sizeof(void *));
+ void **dtds, **values;
const sdp_list_t *p;
+ dtds = (void **)malloc(3 * seqlen * sizeof(void *));
+ if (!dtds)
+ return -1;
+
+ values = (void **)malloc(3 * seqlen * sizeof(void *));
+ if (!values) {
+ free(dtds);
+ return -1;
+ }
+
for (p = seq; p; p = p->next) {
sdp_lang_attr_t *lang = (sdp_lang_attr_t *)p->data;
if (!lang) {
@@ -2455,10 +2511,19 @@ int sdp_set_profile_descs(sdp_record_t *rec, const sdp_list_t *profiles)
uint8_t uuid128 = SDP_UUID128;
uint8_t uint16 = SDP_UINT16;
int i = 0, seqlen = sdp_list_len(profiles);
- void **seqDTDs = (void **)malloc(seqlen * sizeof(void *));
- void **seqs = (void **)malloc(seqlen * sizeof(void *));
+ void **seqDTDs, **seqs;
const sdp_list_t *p;
+ seqDTDs = (void **)malloc(seqlen * sizeof(void *));
+ if (!seqDTDs)
+ return -1;
+
+ seqs = (void **)malloc(seqlen * sizeof(void *));
+ if (!seqs) {
+ free(seqDTDs);
+ return -1;
+ }
+
for (p = profiles; p; p = p->next) {
sdp_data_t *seq;
void *dtds[2], *values[2];
@@ -2642,7 +2707,11 @@ void sdp_uuid32_to_uuid128(uuid_t *uuid128, uuid_t *uuid32)
uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid)
{
- uuid_t *uuid128 = bt_malloc(sizeof(uuid_t));
+ uuid_t *uuid128 = malloc(sizeof(uuid_t));
+
+ if (!uuid128)
+ return NULL;
+
memset(uuid128, 0, sizeof(uuid_t));
switch (uuid->type) {
case SDP_UUID128:
@@ -3087,6 +3156,10 @@ int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec)
sdp_record_t *sdp_record_alloc()
{
sdp_record_t *rec = malloc(sizeof(sdp_record_t));
+
+ if (!rec)
+ return NULL;
+
memset((void *)rec, 0, sizeof(sdp_record_t));
rec->handle = 0xffffffff;
return rec;
--
1.6.3.3
^ permalink raw reply related
* Re: [PATCH 2/3] SDP
From: Santiago Carot Nemesio @ 2010-04-27 13:37 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1272375265.2157.17.camel@mosquito>
This patch set to NULL return value on functions returning 0.
>>From 60e2094bfdb8fcc791b8ef8a64be3e9c0c2274cc Mon Sep 17 00:00:00 2001
From: Santiago Carot Nemesio <sancane@gmail.com>
Date: Tue, 27 Apr 2010 14:09:43 +0200
Subject: [PATCH 2/3] Set to NULL return value on functions returning 0
Signed-off-by: Santiago Carot Nemesio <sancane@gmail.com>
---
lib/sdp.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/sdp.c b/lib/sdp.c
index ca16118..667d412 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -1214,7 +1214,7 @@ static sdp_data_t *extract_str(const void *p, int bufsize, int *len)
default:
SDPERR("Sizeof text string > UINT16_MAX\n");
free(d);
- return 0;
+ return NULL;
}
if (bufsize < n) {
@@ -1771,7 +1771,7 @@ sdp_list_t *sdp_list_append(sdp_list_t *p, void *d)
sdp_list_t *q, *n = malloc(sizeof(sdp_list_t));
if (!n)
- return 0;
+ return NULL;
n->data = d;
n->next = 0;
@@ -1809,7 +1809,7 @@ sdp_list_t *sdp_list_insert_sorted(sdp_list_t *list, void *d,
n = malloc(sizeof(sdp_list_t));
if (!n)
- return 0;
+ return NULL;
n->data = d;
for (q = 0, p = list; p; q = p, p = p->next)
if (f(p->data, d) >= 0)
@@ -3466,7 +3466,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
if (reqtype != SDP_ATTR_REQ_INDIVIDUAL && reqtype != SDP_ATTR_REQ_RANGE) {
errno = EINVAL;
- return 0;
+ return NULL;
}
memset(&rsp_concat_buf, 0, sizeof(sdp_buf_t));
--
1.6.3.3
^ permalink raw reply related
* [PATCH 1/3] SDP
From: Santiago Carot Nemesio @ 2010-04-27 13:34 UTC (permalink / raw)
To: linux-bluetooth
This patch removes some blanks spaces in sdp source code.
>>From a915f0ca83f4b1424eb986f7b4314a2ff09a56fc Mon Sep 17 00:00:00 2001
From: Santiago Carot Nemesio <sancane@gmail.com>
Date: Tue, 27 Apr 2010 13:56:29 +0200
Subject: [PATCH 1/3] Removed blank spaces
Signed-off-by: Santiago Carot Nemesio <sancane@gmail.com>
---
lib/sdp.c | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/lib/sdp.c b/lib/sdp.c
index 7cf710b..ca16118 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -3254,7 +3254,7 @@ static int copy_cstate(uint8_t *pdata, int pdata_len, const sdp_cstate_t *cstate
}
/*
- * This is a service search request.
+ * This is a service search request.
*
* INPUT :
*
@@ -3417,7 +3417,7 @@ end:
}
/*
- * This is a service attribute request.
+ * This is a service attribute request.
*
* INPUT :
*
@@ -3438,7 +3438,7 @@ end:
*
* sdp_list_t *attrid
* Singly linked list containing attribute identifiers desired.
- * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
+ * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
* or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
*
* OUTPUT :
@@ -3448,7 +3448,7 @@ end:
* !0:
* The service record
*/
-sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
+sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
sdp_attrreq_type_t reqtype, const sdp_list_t *attrids)
{
uint32_t reqsize = 0, _reqsize;
@@ -3494,7 +3494,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
pdata += sizeof(uint16_t);
// get attr seq PDU form
- seqlen = gen_attridseq_pdu(pdata, attrids,
+ seqlen = gen_attridseq_pdu(pdata, attrids,
reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16 : SDP_UINT32);
if (seqlen == -1) {
errno = EINVAL;
@@ -3558,7 +3558,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
SDPDBG("sdp_cstate_t length : %d\n", cstate_len);
/*
- * a split response: concatenate intermediate responses
+ * a split response: concatenate intermediate responses
* and the last one (which has cstate_len == 0)
*/
if (cstate_len > 0 || rsp_concat_buf.data_size != 0) {
@@ -3583,7 +3583,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
}
rec = sdp_extract_pdu(pdata, pdata_len, &scanned);
}
-
+
end:
if (reqbuf)
free(reqbuf);
@@ -3676,7 +3676,7 @@ int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata)
/*
* This function starts an asynchronous service search request.
- * The incomming and outgoing data are stored in the transaction structure
+ * The incomming and outgoing data are stored in the transaction structure
* buffers. When there is incomming data the sdp_process function must be
* called to get the data and handle the continuation state.
*
@@ -3771,7 +3771,7 @@ end:
/*
* This function starts an asynchronous service attribute request.
- * The incomming and outgoing data are stored in the transaction structure
+ * The incomming and outgoing data are stored in the transaction structure
* buffers. When there is incomming data the sdp_process function must be
* called to get the data and handle the continuation state.
*
@@ -3796,7 +3796,7 @@ end:
*
* sdp_list_t *attrid_list
* Singly linked list containing attribute identifiers desired.
- * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
+ * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
* or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
*
* OUTPUT :
@@ -3912,7 +3912,7 @@ end:
*
* sdp_list_t *attrid_list
* Singly linked list containing attribute identifiers desired.
- * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
+ * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
* or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
*
@@ -4130,7 +4130,7 @@ int sdp_process(sdp_session_t *session)
pdata += sizeof(uint16_t); /* point to csrc */
/* the first csrc contains the sum of partial csrc responses */
- *pcsrc += bt_get_unaligned((uint16_t *) pdata);
+ *pcsrc += bt_get_unaligned((uint16_t *) pdata);
pdata += sizeof(uint16_t); /* point to the first handle */
rsp_count = csrc * 4;
@@ -4141,8 +4141,8 @@ int sdp_process(sdp_session_t *session)
case SDP_SVC_SEARCH_ATTR_RSP:
rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata));
SDPDBG("Attrlist byte count : %d\n", rsp_count);
-
- /*
+
+ /*
* Number of bytes in the AttributeLists parameter(without
* continuation state) + AttributeListsByteCount field size.
*/
@@ -4168,7 +4168,7 @@ int sdp_process(sdp_session_t *session)
SDPDBG("Cstate length : %d\n", pcstate->length);
- /*
+ /*
* Check out of bound. Continuation state must have at least
* 1 byte: ZERO to indicate that it is not a partial response.
*/
@@ -4202,7 +4202,7 @@ int sdp_process(sdp_session_t *session)
// set the request header's param length
reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t));
-
+
if (sdp_send_req(session, t->reqbuf, reqsize) < 0) {
SDPERR("Error sendind data:%s(%d)", strerror(errno), errno);
status = 0xffff;
@@ -4253,7 +4253,7 @@ end:
*
* sdp_list_t *attrids
* Singly linked list containing attribute identifiers desired.
- * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
+ * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
* or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
*
* OUTPUT :
--
1.6.3.3
^ permalink raw reply related
* Re: obexd OPP pull problem
From: Daniel Abraham @ 2010-04-27 11:51 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <n2h2d5a2c101004270133xa4ea7dd5za238a58f9e67613@mail.gmail.com>
On Tue, Apr 27, 2010 at 11:33 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> This should fix at least the D-Bus error:
>
> http://gitorious.org/obexd/vudentzs-clone/commit/32e48446b6b8cd72e15988c673a60c7fb47b0862
Actually, that's not what I see. I'm using the "pull-business-card"
script (which doesn't use any try-except block), and it doesn't crash
with an exception, even though "dbus-monitor --session" shows the
error (below). Is it lost somehow before it reaches Python's D-Bus
caller object?
method call sender=:1.147 -> dest=:1.142 serial=4 path=/;
interface=org.openobex.Client; member=PullBusinessCard
array [
dict entry(
string "Destination"
variant string "00:1C:26:FC:15:AF"
)
]
string "d.vcf"
method call sender=:1.142 -> dest=org.freedesktop.DBus serial=18
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;
member=AddMatch
string "type='signal',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.147'"
method return sender=:1.142 -> dest=:1.147 reply_serial=4
error sender=:1.142 -> dest=:1.147
error_name=org.openobex.Error.Failed reply_serial=4
string "Method not allowed"
method call sender=:1.142 -> dest=org.freedesktop.DBus serial=21
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;
member=RemoveMatch
string "type='signal',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0=':1.147'"
signal sender=org.freedesktop.DBus -> dest=(null destination)
serial=10 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;
member=NameOwnerChanged
string ":1.147"
string ":1.147"
string ""
^ permalink raw reply
* Re: no client session close in obexd 0.23?
From: Daniel Abraham @ 2010-04-27 10:35 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <o2w2d5a2c101004270010gf01c8228ve01bbbcb3e58fa67@mail.gmail.com>
On Tue, Apr 27, 2010 at 10:10 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> It's a bug, could you please try this:
>
> http://gitorious.org/~vudentz/obexd/vudentzs-clone/commit/fd4e8e2cef72542fb5bc924817f4b409415b3b54
>
> I guess that should fix the problem.
Confirmed, the fix works as intended.
^ permalink raw reply
* Re: [PATCH] SDP memory checks
From: Johan Hedberg @ 2010-04-27 10:15 UTC (permalink / raw)
To: Santiago Carot Nemesio; +Cc: linux-bluetooth
In-Reply-To: <1272353139.2157.8.camel@mosquito>
Hi,
On Tue, Apr 27, 2010, Santiago Carot Nemesio wrote:
> This patch add some memory checks after malloc is called. Also some
> blank spaces at the end of the lines are removed. I observed that
> sometimes functions returns NULL or 0 without any convention. I set
> all to NULL to formalice the source code.
Thanks for the patch. It looks good, but could you split it into two
parts: one patch for the coding style fixes (whitespace, changing 0 to
NULL, etc) and another one to fix the missing malloc error checks. Also
use "git format-patch" to create the patches so that they can be easily
applied using "git am".
Johan
^ permalink raw reply
* Re: [PATCH] Actual code fixing Sixaxis
From: Bastien Nocera @ 2010-04-27 9:52 UTC (permalink / raw)
To: Marcin Tolysz; +Cc: linux-input, linux-bluetooth, ospite
In-Reply-To: <1272318628.3269.44.camel@zony.bied.prout.be>
On Mon, 2010-04-26 at 22:50 +0100, Marcin Tolysz wrote:
> Add change descriptor bit(works on any usb/bt device)
> Make use of physical minimum and maximum while reporting values to userspace
> Add mini howto comment next to replace hid code
> Assume physical maximum is always signed allowing inverting axes by giving max < min
> Swap a few bits in Sixaxis report as they have wrong(hid-wise) endianess
> Sixaxis specific changes
Separate the sixaxis changes from the hid core changes.
> and the most important bit modified HID descriptor:
> 05 01 09 04 A1 01 09 04 A1 02 85 01 75 08 95 01 80 05 09 75 01 95 04
> 14 25 01 09 0C 09 0A 09 09 09 0B 81 02 05 01 09 01 A1 02 75 01 14 25
> 01 95 04 09 90 09 92 09 91 09 93 81 02 C0 05 09 95 09 09 08 09 07 09
> 06 09 05 09 04 09 02 09 01 09 03 09 0D 81 02 75 01 95 0F 80 14 26 FF
> 00 35 80 45 7F 05 01 09 01 75 08 95 02 A0 09 30 09 31 81 02 C0 09 05
> A0 09 32 09 33 81 02 C0 75 08 95 04 80 75 08 95 0C 09 46 34 44 81 02
> 75 08 95 0F 80 75 10 95 01 16 80 01 26 7F 02 45 80 35 7F 09 33 81 02
> 35 80 45 7F 09 34 81 02 95 02 14 26 00 04 36 01 FE 46 00 02 09 35 09
> 36 81 02 14 26 FF 00 34 46 FF 00 75 08 95 30 91 02 75 08 95 30 B1 02
> C0 A1 02 85 02 75 08 95 30 B1 02 C0 A1 02 85 EE 75 08 95 30 B1 02 C0
> A1 02 85 EF 75 08 95 30 B1 02 C0 C0
> convert it into binary using eg. hex2bin.sh and save to
> /lib/firmware/hid/0003:054C:0268:0111.bin
Add a documentation file for that, don't put it in the commit log.
> The two attachments are descriptor as .h file and in my own smart(I have a compiler written in Haskel form/to this format and it could possibly be released under GPL).
> The descriptor is functional but it could be made better... the accelerometers work fine.
> PS. as soon as BT(standard) will start working it will be sufficient to provide fixed HID description.
Again, too much information for a commit log, and line wrapping is 72
characters.
> Signed-off-by: Marcin Tolysz <tolysz@gmail.com>
> ---
> drivers/hid/hid-core.c | 67 +++++++++++++++++++++++++++++++++++++++++++----
> drivers/hid/hid-sony.c | 19 +++++++++++++
> 2 files changed, 80 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 2e2aa75..bb40a19 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -27,6 +27,7 @@
> #include <linux/wait.h>
> #include <linux/vmalloc.h>
> #include <linux/sched.h>
> +#include <linux/firmware.h>
>
> #include <linux/hid.h>
> #include <linux/hiddev.h>
> @@ -333,10 +334,8 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
> return 0;
>
> case HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM:
> - if (parser->global.physical_minimum < 0)
> - parser->global.physical_maximum = item_sdata(item);
> - else
> - parser->global.physical_maximum = item_udata(item);
> + /* always signed value, if it is less then minimum we need to invert axis */
> + parser->global.physical_maximum = item_sdata(item);
> return 0;
Indentation.
> case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT:
> @@ -642,6 +641,10 @@ int hid_parse_report(struct hid_device *device, __u8 *start,
> struct hid_item item;
> __u8 *end;
> int ret;
> + const struct firmware *fw;
> + int fw_fail;
> + const char *file;
> +
> static int (*dispatch_type[])(struct hid_parser *parser,
> struct hid_item *item) = {
> hid_parser_main,
> @@ -652,10 +655,39 @@ int hid_parse_report(struct hid_device *device, __u8 *start,
>
> if (device->driver->report_fixup)
> device->driver->report_fixup(device, start, size);
> + /* Now try to load a hid descriptor from a file firmware
> + if succesful ignoring this fixup thing */
> + /*
> + Mini howto: fixing the descriptor:
> + 1) dump it from /debug/hid/!!device!!/rdesc
> + 2) copy 1st line &edit it
> + 3) convert to bin eg. cat descriptor.txt | hex2bin.sh > descriptor.bin
Has no place in the code itself.
<snip>
> + if (fw_fail)
> + pr_info("To relace HID descriptor place it in /lib/firmaware/%s\n", file);
firmaware?
<snip>
> + pr_info("HID descriptor relaced with /lib/firmaware/%s\n", file);
Typo again.
<snip>
> + if (!fw_fail)
> + release_firmware(fw);
Won't that trigger udev's firmware code and popup PackageKit's firmware
downloader for each and every HID device?
<snip>
> diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
> index 7502a4b..3e094e4 100644
> --- a/drivers/hid/hid-sony.c
> +++ b/drivers/hid/hid-sony.c
As mentioned, need a separate
> @@ -45,6 +45,24 @@ static void sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
> }
>
> /*
> + * There is a few bits that has to be shifted around to make this report more compatibile with
> + * HID standard descriptions, and we want it to be parsable by standard driver
> + */
> +static int sony_raw_event(struct hid_device *hdev, struct hid_report *report, __u8 *rd, int size)
> +{
> + /* for sixaxis connected via usb. */
> + if (rd[0] == 0x01 && size == 49) {
> + swap(rd[41], rd[42]);
> + swap(rd[43], rd[44]);
> + swap(rd[45], rd[46]);
> + swap(rd[47], rd[48]);
> + }
> +
> +return 0;
> +}
Can't this be done for the BT one as well, rather than requiring a
modified firmware? (although the firmware hack could be useful as a
debugging tool).
Cheers
^ permalink raw reply
* Re: Any plan to make telephony backend changeable in runtime?
From: Johan Hedberg @ 2010-04-27 9:42 UTC (permalink / raw)
To: Zhu Yanhai
Cc: linux-bluetooth, Liu, Bing Wei, Martin Xu, Zhu, Peter J,
Zhang, Vivian
In-Reply-To: <4BD68A18.8040608@linux.intel.com>
Hi,
On Tue, Apr 27, 2010, Zhu Yanhai wrote:
> For the moment the telephony driver of BlueZ is chose by the
> configure script (--with-telephony=xxx) and fixed after build. Is
> there any plan to make it configurable during runtime?
Actually the idea has been to remove the AT parsing (and therefore also
the telephony driver) completely from the BlueZ side and instead just
export the RFCOMM socket to an external telephony component. In most
cases this would be ofono (it even has basic AT parsing support already)
but e.g. android would benefit from this too since they could start
using the device framework within bluetoothd and its D-Bus interface for
HFP (right now they've got a completely separate thing for it).
Johan
^ permalink raw reply
* Re: [PATCH] Actual code fixing Sixaxis
From: Antonio Ospite @ 2010-04-27 9:41 UTC (permalink / raw)
To: Marcin Tolysz; +Cc: linux-input, linux-bluetooth, hadess
In-Reply-To: <1272318628.3269.44.camel@zony.bied.prout.be>
[-- Attachment #1: Type: text/plain, Size: 9751 bytes --]
On Mon, 26 Apr 2010 22:50:28 +0100
Marcin Tolysz <tolysz@gmail.com> wrote:
> Add change descriptor bit(works on any usb/bt device)
> Make use of physical minimum and maximum while reporting values to userspace
> Add mini howto comment next to replace hid code
> Assume physical maximum is always signed allowing inverting axes by giving max < min
> Swap a few bits in Sixaxis report as they have wrong(hid-wise) endianess
> Sixaxis specific changes
Hi Marcin,
You might want to send separate patches for hid-core and hid-sony
changes next time. Plus, composing a cover letter that briefly explains
the what and why of your approach could make people more interested as
well. A catchy title like "Overriding HID descriptors" would flash more
than a mere reference to Sixaxis.
About sixaxis, this approach of HID descriptor overriding looks neat,
elegant and way better of what we have now, I am just wondering if it
allows leds/rumble/charging-management support or if a hid driver would
still be needed for those.
Thanks for your work on this, I'll test it once I sort out the
sixaxis cable association problem.
A very brief review follows inlined (mostly syntax remarks).
Regards,
Antonio
> and the most important bit modified HID descriptor:
> 05 01 09 04 A1 01 09 04 A1 02 85 01 75 08 95 01 80 05 09 75 01 95 04
> 14 25 01 09 0C 09 0A 09 09 09 0B 81 02 05 01 09 01 A1 02 75 01 14 25
> 01 95 04 09 90 09 92 09 91 09 93 81 02 C0 05 09 95 09 09 08 09 07 09
> 06 09 05 09 04 09 02 09 01 09 03 09 0D 81 02 75 01 95 0F 80 14 26 FF
> 00 35 80 45 7F 05 01 09 01 75 08 95 02 A0 09 30 09 31 81 02 C0 09 05
> A0 09 32 09 33 81 02 C0 75 08 95 04 80 75 08 95 0C 09 46 34 44 81 02
> 75 08 95 0F 80 75 10 95 01 16 80 01 26 7F 02 45 80 35 7F 09 33 81 02
> 35 80 45 7F 09 34 81 02 95 02 14 26 00 04 36 01 FE 46 00 02 09 35 09
> 36 81 02 14 26 FF 00 34 46 FF 00 75 08 95 30 91 02 75 08 95 30 B1 02
> C0 A1 02 85 02 75 08 95 30 B1 02 C0 A1 02 85 EE 75 08 95 30 B1 02 C0
> A1 02 85 EF 75 08 95 30 B1 02 C0 C0
> convert it into binary using eg. hex2bin.sh and save to
> /lib/firmware/hid/0003:054C:0268:0111.bin
>
> The two attachments are descriptor as .h file and in my own smart(I have a compiler written in Haskel form/to this format and it could possibly be released under GPL).
> The descriptor is functional but it could be made better... the accelerometers work fine.
> PS. as soon as BT(standard) will start working it will be sufficient to provide fixed HID description.
>
Commit messages are usually wrapped to 72/80 chars.
Annotations and stuff not strictly meant for the commit message
usually go between the --- separator and the diffstat output.
> Signed-off-by: Marcin Tolysz <tolysz@gmail.com>
> ---
> drivers/hid/hid-core.c | 67 +++++++++++++++++++++++++++++++++++++++++++----
> drivers/hid/hid-sony.c | 19 +++++++++++++
> 2 files changed, 80 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 2e2aa75..bb40a19 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -27,6 +27,7 @@
> #include <linux/wait.h>
> #include <linux/vmalloc.h>
> #include <linux/sched.h>
> +#include <linux/firmware.h>
>
> #include <linux/hid.h>
> #include <linux/hiddev.h>
> @@ -333,10 +334,8 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
> return 0;
>
> case HID_GLOBAL_ITEM_TAG_PHYSICAL_MAXIMUM:
> - if (parser->global.physical_minimum < 0)
> - parser->global.physical_maximum = item_sdata(item);
> - else
> - parser->global.physical_maximum = item_udata(item);
> + /* always signed value, if it is less then minimum we need to invert axis */
> + parser->global.physical_maximum = item_sdata(item);
> return 0;
maybe you can indent this comment by one more level and put it on two
lines if it's too long.
>
> case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT:
> @@ -642,6 +641,10 @@ int hid_parse_report(struct hid_device *device, __u8 *start,
> struct hid_item item;
> __u8 *end;
> int ret;
> + const struct firmware *fw;
> + int fw_fail;
> + const char *file;
> +
> static int (*dispatch_type[])(struct hid_parser *parser,
> struct hid_item *item) = {
> hid_parser_main,
> @@ -652,10 +655,39 @@ int hid_parse_report(struct hid_device *device, __u8 *start,
>
> if (device->driver->report_fixup)
> device->driver->report_fixup(device, start, size);
> + /* Now try to load a hid descriptor from a file firmware
> + if succesful ignoring this fixup thing */
> + /*
> + Mini howto: fixing the descriptor:
> + 1) dump it from /debug/hid/!!device!!/rdesc
> + 2) copy 1st line &edit it
> + 3) convert to bin eg. cat descriptor.txt | hex2bin.sh > descriptor.bin
> +
> +----hex2bin.sh
> +#!/bin/bash
> +echo -n -e $(tr -d '[:space:]' | sed 's/../\\x&/g')
> +4) place in /lib/firmware/hid/... where the location is provided by kern.log
> +*/
Watch out indentation here too, and if this feature needs some more
explanation you might want to consider adding a file under
Documentation/ and refer to that in the comment.
> + file = kasprintf(GFP_KERNEL, "hid/%04X:%04X:%04X:%04X.bin",
> + device->bus, device->vendor, device->product, device->version);
> +
maybe the name 'file' might me something like 'newdesc_file', but you
choose here, take it just as a loose suggestion.
> + fw_fail = request_firmware(&fw, file, &device->dev);
> +
> + if (fw_fail)
> + pr_info("To relace HID descriptor place it in /lib/firmaware/%s\n", file);
> + else{
space after the else and IIRC when the else block needs parentheses the
convention is to put them to the if block as well, even if it is only
one line.
> + start = fw->data;
> + size = fw->size;
> + pr_info("HID descriptor relaced with /lib/firmaware/%s\n", file);
> + }
> + kfree(file);
>
> device->rdesc = kmalloc(size, GFP_KERNEL);
> - if (device->rdesc == NULL)
> + if (device->rdesc == NULL) {
> + if (!fw_fail)
> + release_firmware(fw);
> return -ENOMEM;
> + }
> memcpy(device->rdesc, start, size);
> device->rsize = size;
>
> @@ -692,6 +724,8 @@ int hid_parse_report(struct hid_device *device, __u8 *start,
> dbg_hid("unbalanced delimiter at end of report description\n");
> goto err;
> }
> + if (!fw_fail)
> + release_firmware(fw);
> vfree(parser);
> return 0;
> }
> @@ -699,6 +733,8 @@ int hid_parse_report(struct hid_device *device, __u8 *start,
>
> dbg_hid("item fetching failed at offset %d\n", (int)(end - start));
> err:
> + if (!fw_fail)
> + release_firmware(fw);
> vfree(parser);
> return ret;
> }
> @@ -878,6 +914,25 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field,
> }
>
> /*
> + * Translate values from logical to physical, exponent is still missing.
> + */
> +static __s32 convert_to_physical(__s32 x, struct hid_field *field)
> +{
> + __s32 min = field->logical_minimum;
> + __s32 max = field->logical_maximum;
> + __s32 pmin = field->physical_minimum;
> + __s32 pmax = field->physical_maximum;
> +/* __s32 uexp = field->unit_exponent; need to find a way how to use it */
> +
> + if ((pmin == pmax) /* would give pmin and covers the case ==0 */
> + || (pmin == min && pmax == max) /* would do nothing */
> + || (min == max)) /* would be div by 0 */
> + return x;
> + else
> + return (pmax - pmin)*(x - min) / (max - min) + pmin;
spaces around the '*'?
> +}
> +
> +/*
> * Analyse a received field, and fetch the data from it. The field
> * content is stored for next report processing (we do differential
> * reporting to the layer).
> @@ -911,7 +966,7 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field,
> for (n = 0; n < count; n++) {
>
> if (HID_MAIN_ITEM_VARIABLE & field->flags) {
> - hid_process_event(hid, field, &field->usage[n], value[n], interrupt);
> + hid_process_event(hid, field, &field->usage[n], convert_to_physical(value[n], field), interrupt);
> continue;
> }
>
> diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
> index 7502a4b..3e094e4 100644
> --- a/drivers/hid/hid-sony.c
> +++ b/drivers/hid/hid-sony.c
> @@ -45,6 +45,24 @@ static void sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
> }
>
> /*
> + * There is a few bits that has to be shifted around to make this report more compatibile with
> + * HID standard descriptions, and we want it to be parsable by standard driver
> + */
> +static int sony_raw_event(struct hid_device *hdev, struct hid_report *report, __u8 *rd, int size)
> +{
> + /* for sixaxis connected via usb. */
> + if (rd[0] == 0x01 && size == 49) {
> + swap(rd[41], rd[42]);
> + swap(rd[43], rd[44]);
> + swap(rd[45], rd[46]);
> + swap(rd[47], rd[48]);
> + }
> +
> +return 0;
> +}
> +
> +
> +/*
> * Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller
> * to "operational". Without this, the ps3 controller will not report any
> * events.
> @@ -151,6 +169,7 @@ static struct hid_driver sony_driver = {
> .probe = sony_probe,
> .remove = sony_remove,
> .report_fixup = sony_report_fixup,
> + .raw_event = sony_raw_event,
> };
>
> static int __init sony_init(void)
> --
> 1.7.0.5
>
>
--
Antonio Ospite
http://ao2.it
PGP public key ID: 0x4553B001
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: obexd OPP pull problem
From: Luiz Augusto von Dentz @ 2010-04-27 8:33 UTC (permalink / raw)
To: Daniel Abraham; +Cc: linux-bluetooth
In-Reply-To: <g2l2d5a2c101004270020mb94d092cnef88b98b147beba0@mail.gmail.com>
Hi,
On Tue, Apr 27, 2010 at 10:20 AM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> Hi,
>
> On Tue, Apr 27, 2010 at 2:12 AM, Daniel Abraham
> <daniel.shrugged@gmail.com> wrote:
>> I'm trying to write a Python script that pulls a business card via OPP
>> (almost the same as the obexd test script "pull-business-card", except
>> it also handles pairing).
>>
>> My problem is that when I call the method "PullBusinessCard", it
>> returns almost immediately, withtout a D-Bus exception (i.e. should be
>> successful), but no output file can be found.
>>
>> Here's what I see in /var/log/messages:
>>
>> Apr 27 01:20:54 dabraham-mobl bluetoothd[1529]: link_key_request
>> (sba=00:21:86:7A:E7:67, dba=00:1C:26:FC:15:AF)
>> Apr 27 01:20:54 dabraham-mobl obex-client[3067]: Transfer(0xd4cb40)
>> Error: Method not allowed
>
> It should return a D-Bus error due to transfer error, which is why it
> doesn't complete the transfer, so it might be a bug in vcard pull
> logic, but why the transfer is failing I don't know it shouldn't
> matter if you are paring or not.
This should fix at least the D-Bus error:
http://gitorious.org/obexd/vudentzs-clone/commit/32e48446b6b8cd72e15988c673a60c7fb47b0862
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply
* [PATCH] patch to request new firmware for AR3011 Chip
From: suraj @ 2010-04-27 8:28 UTC (permalink / raw)
To: linux-bluetooth
Cc: dwmw2, Luis.Rodriguez, Jothikumar.Mothilal, marcel, vkandukuri
In-Reply-To: <1272349190.1393.11.camel@atheros013-desktop>
Signed-off-by: Vikram Kandukuri <vkandukuri@atheros.com>
---
drivers/bluetooth/ath3k.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 128cae4..7bda549 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -122,9 +122,12 @@ static int ath3k_probe(struct usb_interface *intf,
data->udev = udev;
- if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
- kfree(data);
- return -EIO;
+ if (request_firmware(&firmware, "ath3k-2.fw", &udev->dev) < 0) {
+ BT_DBG("requesting old firmware");
+ if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
+ kfree(data);
+ return -EIO;
+ }
}
size = max_t(uint, firmware->size, 4096);
--
1.7.0
^ permalink raw reply related
* Re: DUN client for oFono and BlueZ
From: Bastien Nocera @ 2010-04-27 8:15 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: ofono, linux-bluetooth@vger.kernel.org
In-Reply-To: <20100427012059.GG12813@vigoh>
On Mon, 2010-04-26 at 22:20 -0300, Gustavo F. Padovan wrote:
> Hi all,
>
> I'm starting the DUN Client implementation for the Linux Stack. DUN is
> the Bluetooth dial-up network profile. It makes possible share internet
> connection between two Bluetooth devices. That is my Google Summer of Code
> project for this year.
Does this project include anything that will be reusable by non-oFono
based projects? Native BT PPP line discipline would have been nice.
Cheers
^ permalink raw reply
* Modem emulator and DUN server side for oFono and BlueZ
From: Zhang, Zhenhua @ 2010-04-27 7:53 UTC (permalink / raw)
To: ofono@ofono.org, linux-bluetooth@vger.kernel.org
SGksDQoNCkkgYW0gbm93IHdvcmtpbmcgb24gbW9kZW0gZW11bGF0b3IgYW5kIG9uZSB1c2FnZSBp
cyBmb3IgRFVOIHNlcnZlciByb2xlLiBTaW5jZSBQYWRvdmFuIGlzIHdvcmtpbmcgb24gY2xpZW50
IHJvbGUsIGl0J3MgZ29vZCB0byBzaGFyZSBteSByb3VnaCB0aGlua2luZyBmb3Igc2VydmVyIHNp
ZGUgaW1wbGVtZW50YXRpb24uIEhlcmUgYXJlIHRoZSBzaW1wbGUgc3RlcHMgSSBoYXZlOg0KDQox
LiBDcmVhdGUgYW4gb0Zvbm8gZW11bGF0b3IgYXRvbSBpbiBvRm9uby4gSXQncyB0aGUgZW11bGF0
b3IgbWFuYWdlciB0aGF0IGNvdWxkIGNyZWF0ZSBEVU4sIEhGUCBBRyBvciBTUFAgdHlwZSBlbXVs
YXRvcnMuIEl0IGV4cG9zZXMgZGJ1cyBtZXRob2RzIGxpa2UgQ3JlYXRlRW11bGF0b3IsIERlc3Ry
b3lFbXVsYXRvciwgR2V0UHJvcGVydHksIGV0Yy4NCg0KMi4gRFVOIGFnZW50IHNlcnZlciBpbiBC
bHVlWiB3YXRjaCBvRm9ubyBhbmQgY2FsbCBDcmVhdGVFbXVsYXRvciBhbmQgcGFzcyB0aGUgZmls
ZSBkZXNjcmlwdG9yIHRvIG9Gb25vLiBUaGlzIHNlcnZlciBjb3VsZCBmdXJ0aGVyIGltcGxlbWVu
dCBIRlAgQUcgYW5kIFNQUCBjb25uZWN0aW9uLg0KDQozLiBPbmNlIGFuIGVtdWxhdG9yIGlzIGNy
ZWF0ZWQsIG90aGVyIGF0b20gbGlrZSB2b2ljZWNhbGwsIGdycHMsIHNtcyByZWdpc3RlciB0aGVp
ciBpbnRlcmVzdGVkIEFUIGNvbW1hbmQgaGFuZGxlcnMgdG8gaXQuIFRoZSBnb2FsIGlzIHRoYXQg
d2UgY291bGQgaGFuZGxlIGFsbCBtYW5kYXRvcnkgQVQgY29tbWFuZHMgZGVmaW5lZCBpbiBEVU4g
cHJvZmlsZSBzcGVjLg0KDQo0LiBPbmNlIGEgRFVOIGVtdWxhdG9yIHJlY2VpdmVkIEFURCo5OSMs
IERVTiBjbGllbnQgcGVyZm9ybXMgcHBwIGNvbm5lY3Rpb24gc28gd2UgZm9yd2FyZCBwcHAgY29t
bWFuZCB0byBwcHAgc3RhY2suIEl0IGlzIGRvbmUgYnkgcHBwIHNlcnZlciBzaWRlIGV4dGVuc2lv
bi4gSXQgc2hvdWxkIGJlIHRoZSBzaW1wbGUgY29tbWFuZCBmb3J3YXJkaW5nLg0KDQo1LiBPbmNl
IHRoZSBQUFAgbGluayBvdmVyIERVTiBpcyBlc3RhYmxpc2hlZCwgRFVOIGNsaWVudCBwZXJmb3Jt
cyBDb25uTWFuIGludGVncmF0aW9uIGFuZCBzZXR1cCBJUCBhZGRyZXNzLCBETlMgc2VydmVyLCBl
dGMuDQoNCjYuIE9uY2UgdGhlIEJsdWV0b290aCBsaW5rIGlzIGRpc2Nvbm5lY3RlZCwgd2UgZGVz
dHJveSB0aGUgUFBQIGFuZCBEVU4gZW11bGF0b3IuIElmIGVtdWxhdG9yIGF0b20gaXRzZWxmIGlz
IGRlc3Ryb3llZCwgd2UgZGVzdHJveSB0aGUgUFBQIGFuZCB0aGUgQmx1ZXRvb3RoIGNvbm5lY3Rp
b24uIElmIHRoZSBQUFAgbGluayBpcyBkaXNjb25uZWN0ZWQgYnV0IEJsdWV0b290aCBsaW5rIGlz
IGFsaXZlLCB3ZSBkZXN0cm95IHRoZSBQUFAgYW5kIHN0YXkgZW11bGF0b3IgYWxpdmUuDQoNCkNv
bW1lbnRzIGFyZSB3ZWxjb21lLiA6KQ0KDQpSZWdhcmRzLA0KWmhlbmh1YQ0KIA0K
^ permalink raw reply
* Re: DUN client for oFono and BlueZ
From: Kalle Valo @ 2010-04-27 7:26 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: ofono, linux-bluetooth@vger.kernel.org
In-Reply-To: <20100427063533.GA30819@vigoh>
"Gustavo F. Padovan" <gustavo@padovan.org> writes:
> Hi Kalle,
Hi Gustavo,
>> > 4. Agent server on BlueZ. This one is very similar to the HFP Agent server. At
>> > the end of the DUN agent project I plan to merge the both agent servers. SAP
>> > will take advantage of that merge too.
>> >
>> > 5. oFono DUN agent. Implement the agent handling for DUN.
>>
>> Sorry, I'm not familiar with HFP Agent, but what will this agent
>> actually do on a DUN connection
>
> The agent can request a RFCOMM connection and receive the RFCOMM channel
> via DBus fd-passing. The the DUN plugin can do the handshake.
Ah, that makes perfect sense. Thanks for explaining it.
>> > 6. AT command parser and PPP stack integration with DUN. The biggest task,
>> > where the core of the project is.
>> >
>> > 7. ConnMan integration. Setup of the NAT and Internet Connections.
>>
>> Why NAT is needed? I guess only for connection sharing.
>
> No idea yet, I guess Denis told me about the NAT, but that will be the
> last part of the project, so I'm not caring about it now. I have to
> check on my irc logs.
When I was using bt dun on my laptop (just manually running pppd with
debian's pon script) I didn't need nat at all.
--
Kalle Valo
^ permalink raw reply
* [PATCH] SDP memory checks
From: Santiago Carot Nemesio @ 2010-04-27 7:25 UTC (permalink / raw)
To: linux-bluetooth
This patch add some memory checks after malloc is called. Also some blank spaces at the end of the lines are removed.
I observed that sometimes functions returns NULL or 0 without any convention. I set all to NULL to formalice the source code.
Regards.
diff --git a/lib/sdp.c b/lib/sdp.c
index 7cf710b..04538bd 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -1078,6 +1078,8 @@ static sdp_data_t *extract_int(const void *p, int bufsize, int *len)
}
d = malloc(sizeof(sdp_data_t));
+ if (!d)
+ return NULL;
SDPDBG("Extracting integer\n");
memset(d, 0, sizeof(sdp_data_t));
@@ -1151,6 +1153,8 @@ static sdp_data_t *extract_uuid(const uint8_t *p, int bufsize, int *len,
sdp_record_t *rec)
{
sdp_data_t *d = malloc(sizeof(sdp_data_t));
+ if (!d)
+ return NULL;
SDPDBG("Extracting UUID");
memset(d, 0, sizeof(sdp_data_t));
@@ -1179,6 +1183,8 @@ static sdp_data_t *extract_str(const void *p, int bufsize, int *len)
}
d = malloc(sizeof(sdp_data_t));
+ if (!d)
+ return NULL;
memset(d, 0, sizeof(sdp_data_t));
d->dtd = *(uint8_t *) p;
@@ -1214,7 +1220,7 @@ static sdp_data_t *extract_str(const void *p, int bufsize, int *len)
default:
SDPERR("Sizeof text string > UINT16_MAX\n");
free(d);
- return 0;
+ return NULL;
}
if (bufsize < n) {
@@ -1302,6 +1308,9 @@ static sdp_data_t *extract_seq(const void *p, int bufsize, int *len,
sdp_data_t *curr, *prev;
sdp_data_t *d = malloc(sizeof(sdp_data_t));
+ if (!d)
+ return NULL;
+
SDPDBG("Extracting SEQ");
memset(d, 0, sizeof(sdp_data_t));
*len = sdp_extract_seqtype(p, bufsize, &d->dtd, &seqlen);
@@ -1771,7 +1780,7 @@ sdp_list_t *sdp_list_append(sdp_list_t *p, void *d)
sdp_list_t *q, *n = malloc(sizeof(sdp_list_t));
if (!n)
- return 0;
+ return NULL;
n->data = d;
n->next = 0;
@@ -1809,7 +1818,7 @@ sdp_list_t *sdp_list_insert_sorted(sdp_list_t *list, void *d,
n = malloc(sizeof(sdp_list_t));
if (!n)
- return 0;
+ return NULL;
n->data = d;
for (q = 0, p = list; p; q = p, p = p->next)
if (f(p->data, d) >= 0)
@@ -1949,6 +1958,8 @@ int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr,
goto fail;
u = malloc(sizeof(uuid_t));
+ if (!u)
+ goto fail;
memset(u, 0, sizeof(uuid_t));
*u = d->val.uuid;
*seqp = sdp_list_append(*seqp, u);
@@ -1974,7 +1985,13 @@ int sdp_set_uuidseq_attr(sdp_record_t *rec, uint16_t aid, sdp_list_t *seq)
if (!seq || len == 0)
return -1;
dtds = (void **)malloc(len * sizeof(void *));
+ if (!dtds)
+ return -1;
values = (void **)malloc(len * sizeof(void *));
+ if (!values) {
+ free(dtds);
+ return -1;
+ }
for (p = seq, i = 0; i < len; i++, p = p->next) {
uuid_t *uuid = (uuid_t *)p->data;
if (uuid)
@@ -2028,6 +2045,8 @@ int sdp_get_lang_attr(const sdp_record_t *rec, sdp_list_t **langSeq)
sdp_data_t *pOffset = pEncoding->next;
if (pEncoding && pOffset) {
lang = malloc(sizeof(sdp_lang_attr_t));
+ if (!lang)
+ goto fail;
lang->code_ISO639 = pCode->val.uint16;
lang->encoding = pEncoding->val.uint16;
lang->base_offset = pOffset->val.uint16;
@@ -2039,6 +2058,10 @@ int sdp_get_lang_attr(const sdp_record_t *rec, sdp_list_t **langSeq)
curr_data = pOffset->next;
}
return 0;
+fail:
+ sdp_list_free(*langSeq, free);
+ *langSeq = NULL;
+ return -1;
}
int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq)
@@ -2069,6 +2092,8 @@ int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq)
if (uuid != NULL) {
profDesc = malloc(sizeof(sdp_profile_desc_t));
+ if (!profDesc)
+ goto fail;
profDesc->uuid = *uuid;
profDesc->version = version;
#ifdef SDP_DEBUG
@@ -2079,6 +2104,10 @@ int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq)
}
}
return 0;
+fail:
+ sdp_list_free(*profDescSeq, free);
+ *profDescSeq = NULL;
+ return -1;
}
int sdp_get_server_ver(const sdp_record_t *rec, sdp_list_t **u16)
@@ -2231,7 +2260,15 @@ static sdp_data_t *access_proto_to_dataseq(sdp_record_t *rec, sdp_list_t *proto)
seqlen = sdp_list_len(proto);
seqDTDs = (void **)malloc(seqlen * sizeof(void *));
+ if (!seqDTDs)
+ return NULL;
+
seqs = (void **)malloc(seqlen * sizeof(void *));
+ if (!seqs) {
+ free(seqDTDs);
+ return NULL;
+ }
+
for (i = 0, p = proto; p; p = p->next, i++) {
sdp_list_t *elt = (sdp_list_t *)p->data;
sdp_data_t *s;
@@ -2349,11 +2386,20 @@ int sdp_set_add_access_protos(sdp_record_t *rec, const sdp_list_t *ap)
int sdp_set_lang_attr(sdp_record_t *rec, const sdp_list_t *seq)
{
uint8_t uint16 = SDP_UINT16;
+ void **dtds, **values;
int status = 0, i = 0, seqlen = sdp_list_len(seq);
- void **dtds = (void **)malloc(3 * seqlen * sizeof(void *));
- void **values = (void **)malloc(3 * seqlen * sizeof(void *));
const sdp_list_t *p;
+ dtds = (void **)malloc(3 * seqlen * sizeof(void *));
+ if (!dtds)
+ return -1;
+
+ values = (void **)malloc(3 * seqlen * sizeof(void *));
+ if (!values) {
+ free(dtds);
+ return -1;
+ }
+
for (p = seq; p; p = p->next) {
sdp_lang_attr_t *lang = (sdp_lang_attr_t *)p->data;
if (!lang) {
@@ -2455,10 +2501,18 @@ int sdp_set_profile_descs(sdp_record_t *rec, const sdp_list_t *profiles)
uint8_t uuid128 = SDP_UUID128;
uint8_t uint16 = SDP_UINT16;
int i = 0, seqlen = sdp_list_len(profiles);
- void **seqDTDs = (void **)malloc(seqlen * sizeof(void *));
- void **seqs = (void **)malloc(seqlen * sizeof(void *));
+ void **seqDTDs;
+ void **seqs;
const sdp_list_t *p;
+ seqDTDs = (void **)malloc(seqlen * sizeof(void *));
+ if (!seqDTDs)
+ return -1;
+ seqs = (void **)malloc(seqlen * sizeof(void *));
+ if (!seqs) {
+ free(seqDTDs);
+ return -1;
+ }
for (p = profiles; p; p = p->next) {
sdp_data_t *seq;
void *dtds[2], *values[2];
@@ -2642,7 +2696,11 @@ void sdp_uuid32_to_uuid128(uuid_t *uuid128, uuid_t *uuid32)
uuid_t *sdp_uuid_to_uuid128(uuid_t *uuid)
{
- uuid_t *uuid128 = bt_malloc(sizeof(uuid_t));
+ uuid_t *uuid128 = malloc(sizeof(uuid_t));
+
+ if (!uuid128)
+ return NULL;
+
memset(uuid128, 0, sizeof(uuid_t));
switch (uuid->type) {
case SDP_UUID128:
@@ -2796,7 +2854,17 @@ int sdp_device_record_register_binary(sdp_session_t *session, bdaddr_t *device,
return -1;
}
req = malloc(SDP_REQ_BUFFER_SIZE);
+ if(!req) {
+ errno = ENOMEM;
+ return -1;
+ }
+
rsp = malloc(SDP_RSP_BUFFER_SIZE);
+ if(!rsp) {
+ errno = ENOMEM;
+ return -1;
+ }
+
if (req == NULL || rsp == NULL) {
status = -1;
errno = ENOMEM;
@@ -3087,6 +3155,9 @@ int sdp_record_update(sdp_session_t *session, const sdp_record_t *rec)
sdp_record_t *sdp_record_alloc()
{
sdp_record_t *rec = malloc(sizeof(sdp_record_t));
+
+ if (!rec)
+ return NULL;
memset((void *)rec, 0, sizeof(sdp_record_t));
rec->handle = 0xffffffff;
return rec;
@@ -3254,7 +3325,7 @@ static int copy_cstate(uint8_t *pdata, int pdata_len, const sdp_cstate_t *cstate
}
/*
- * This is a service search request.
+ * This is a service search request.
*
* INPUT :
*
@@ -3417,7 +3488,7 @@ end:
}
/*
- * This is a service attribute request.
+ * This is a service attribute request.
*
* INPUT :
*
@@ -3438,7 +3509,7 @@ end:
*
* sdp_list_t *attrid
* Singly linked list containing attribute identifiers desired.
- * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
+ * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
* or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
*
* OUTPUT :
@@ -3448,7 +3519,7 @@ end:
* !0:
* The service record
*/
-sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
+sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
sdp_attrreq_type_t reqtype, const sdp_list_t *attrids)
{
uint32_t reqsize = 0, _reqsize;
@@ -3494,7 +3565,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
pdata += sizeof(uint16_t);
// get attr seq PDU form
- seqlen = gen_attridseq_pdu(pdata, attrids,
+ seqlen = gen_attridseq_pdu(pdata, attrids,
reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16 : SDP_UINT32);
if (seqlen == -1) {
errno = EINVAL;
@@ -3558,7 +3629,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
SDPDBG("sdp_cstate_t length : %d\n", cstate_len);
/*
- * a split response: concatenate intermediate responses
+ * a split response: concatenate intermediate responses
* and the last one (which has cstate_len == 0)
*/
if (cstate_len > 0 || rsp_concat_buf.data_size != 0) {
@@ -3583,7 +3654,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
}
rec = sdp_extract_pdu(pdata, pdata_len, &scanned);
}
-
+
end:
if (reqbuf)
free(reqbuf);
@@ -3676,7 +3747,7 @@ int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata)
/*
* This function starts an asynchronous service search request.
- * The incomming and outgoing data are stored in the transaction structure
+ * The incomming and outgoing data are stored in the transaction structure
* buffers. When there is incomming data the sdp_process function must be
* called to get the data and handle the continuation state.
*
@@ -3771,7 +3842,7 @@ end:
/*
* This function starts an asynchronous service attribute request.
- * The incomming and outgoing data are stored in the transaction structure
+ * The incomming and outgoing data are stored in the transaction structure
* buffers. When there is incomming data the sdp_process function must be
* called to get the data and handle the continuation state.
*
@@ -3796,7 +3867,7 @@ end:
*
* sdp_list_t *attrid_list
* Singly linked list containing attribute identifiers desired.
- * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
+ * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
* or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
*
* OUTPUT :
@@ -3912,7 +3983,7 @@ end:
*
* sdp_list_t *attrid_list
* Singly linked list containing attribute identifiers desired.
- * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
+ * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
* or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
*
@@ -4130,7 +4201,7 @@ int sdp_process(sdp_session_t *session)
pdata += sizeof(uint16_t); /* point to csrc */
/* the first csrc contains the sum of partial csrc responses */
- *pcsrc += bt_get_unaligned((uint16_t *) pdata);
+ *pcsrc += bt_get_unaligned((uint16_t *) pdata);
pdata += sizeof(uint16_t); /* point to the first handle */
rsp_count = csrc * 4;
@@ -4141,8 +4212,8 @@ int sdp_process(sdp_session_t *session)
case SDP_SVC_SEARCH_ATTR_RSP:
rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata));
SDPDBG("Attrlist byte count : %d\n", rsp_count);
-
- /*
+
+ /*
* Number of bytes in the AttributeLists parameter(without
* continuation state) + AttributeListsByteCount field size.
*/
@@ -4168,7 +4239,7 @@ int sdp_process(sdp_session_t *session)
SDPDBG("Cstate length : %d\n", pcstate->length);
- /*
+ /*
* Check out of bound. Continuation state must have at least
* 1 byte: ZERO to indicate that it is not a partial response.
*/
@@ -4202,7 +4273,7 @@ int sdp_process(sdp_session_t *session)
// set the request header's param length
reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t));
-
+
if (sdp_send_req(session, t->reqbuf, reqsize) < 0) {
SDPERR("Error sendind data:%s(%d)", strerror(errno), errno);
status = 0xffff;
@@ -4253,7 +4324,7 @@ end:
*
* sdp_list_t *attrids
* Singly linked list containing attribute identifiers desired.
- * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
+ * Every element is either a uint16_t(attrSpec = SDP_ATTR_REQ_INDIVIDUAL)
* or a uint32_t(attrSpec=SDP_ATTR_REQ_RANGE)
*
* OUTPUT :
^ permalink raw reply related
* Re: obexd OPP pull problem
From: Luiz Augusto von Dentz @ 2010-04-27 7:20 UTC (permalink / raw)
To: Daniel Abraham; +Cc: linux-bluetooth
In-Reply-To: <t2m2c3916b71004261612i68ccba50h78c83ab3a02713cb@mail.gmail.com>
Hi,
On Tue, Apr 27, 2010 at 2:12 AM, Daniel Abraham
<daniel.shrugged@gmail.com> wrote:
> I'm trying to write a Python script that pulls a business card via OPP
> (almost the same as the obexd test script "pull-business-card", except
> it also handles pairing).
>
> My problem is that when I call the method "PullBusinessCard", it
> returns almost immediately, withtout a D-Bus exception (i.e. should be
> successful), but no output file can be found.
>
> Here's what I see in /var/log/messages:
>
> Apr 27 01:20:54 dabraham-mobl bluetoothd[1529]: link_key_request
> (sba=00:21:86:7A:E7:67, dba=00:1C:26:FC:15:AF)
> Apr 27 01:20:54 dabraham-mobl obex-client[3067]: Transfer(0xd4cb40)
> Error: Method not allowed
It should return a D-Bus error due to transfer error, which is why it
doesn't complete the transfer, so it might be a bug in vcard pull
logic, but why the transfer is failing I don't know it shouldn't
matter if you are paring or not.
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply
* Re: no client session close in obexd 0.23?
From: Luiz Augusto von Dentz @ 2010-04-27 7:10 UTC (permalink / raw)
To: Daniel Abraham; +Cc: linux-bluetooth
In-Reply-To: <h2s2c3916b71004261637le0d83946y724f6ddb538c093@mail.gmail.com>
Hi,
On Tue, Apr 27, 2010 at 2:37 AM, Daniel Abraham
<daniel.shrugged@gmail.com> wrote:
> Thanks!
>
> Followup question - I'm trying to use it, but it throws this exception:
> dbus.exceptions.DBusException: org.openobex.Error.InvalidArguments:
>
> What am I doing wrong? What is the right input?
>
> Here's a sample Python script:
>
> ---
>
> #!/usr/bin/env python
>
> import dbus
>
> bus = dbus.SessionBus()
> proxy = bus.get_object('org.openobex.client', '/')
> client = dbus.Interface(proxy, 'org.openobex.Client')
>
> address = '00:1C:26:FC:15:AF'
>
> print('Opening FTP session')
> path = client.CreateSession({'Target': 'ftp', 'Destination': address})
> print(path)
> client.RemoveSession(path)
> print('FTP session closed')
>
> ---
>
> Output:
>
> Opening FTP session
> /org/openobex/session0
> Traceback (most recent call last):
> File "./test-ftp.py", line 14, in <module>
> client.RemoveSession(path)
> File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 140, in __call__
> **keywords)
> File "/usr/lib/python2.6/site-packages/dbus/connection.py", line
> 630, in call_blocking
> message, timeout)
> dbus.exceptions.DBusException: org.openobex.Error.InvalidArguments:
>
It's a bug, could you please try this:
http://gitorious.org/~vudentz/obexd/vudentzs-clone/commit/fd4e8e2cef72542fb5bc924817f4b409415b3b54
I guess that should fix the problem.
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply
* Any plan to make telephony backend changeable in runtime?
From: Zhu Yanhai @ 2010-04-27 6:54 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Liu, Bing Wei, Martin Xu, Zhu, Peter J, Zhang, Vivian
Hi,
For the moment the telephony driver of BlueZ is chose by the configure
script (--with-telephony=xxx) and fixed after build. Is there any plan
to make it configurable during runtime?
Thanks,
Zhu Yanhai
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox