2012-03-09 17:27:35

by Rafal Garbat

[permalink] [raw]
Subject: [PATCH] Bluetooth: Finalize discovery after discover message was rejected.

Finalize discovery and disconnect l2cap after discover
message was rejected.
---
audio/avdtp.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/audio/avdtp.c b/audio/avdtp.c
index cd66fd4..64e5800 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -3064,6 +3064,12 @@ static gboolean avdtp_parse_rej(struct avdtp *session,
return FALSE;
error("DISCOVER request rejected: %s (%d)",
avdtp_strerror(&err), err.err.error_code);
+ if (session->discov_cb) {
+ session->discov_cb(session, session->seps,
+ &err, session->user_data);
+ session->discov_cb = NULL;
+ session->used_data = NULL;
+ }
return TRUE;
case AVDTP_GET_CAPABILITIES:
case AVDTP_GET_ALL_CAPABILITIES:
--
on behalf of ST-Ericsson



2012-04-04 11:17:56

by Rafal Garbat

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Finalize discovery after discover message was rejected.

On 04/04/2012 01:10 PM, Johan Hedberg wrote:
> On Wed, Apr 04, 2012, Johan Hedberg wrote:
>> Hi Rafal,
>>
>> On Wed, Apr 04, 2012, Garbat Rafal wrote:
>>>> The patch looks ok'ish but it doesn't compile:
>>>>
>>>> audio/avdtp.c: In function ‘avdtp_parse_rej’:
>>>> audio/avdtp.c:3071:11: error: ‘struct avdtp’ has no member named ‘used_data’
>>>>
>>>> Secondly, please use a "avdtp:" prefix for the commit message
>>>> ("Bluetooth" is only reserved for kernel patches) and remove the '.'
>>> >from the end of the summary line.
>>>> Johan
>>> Sorry, just a nasty typo. Will fix it and send patch once again.
>> The thing I'm more worried about is that this seems to imply that you've
>> neither run the code nor even tried to compile it. Is that the case?
> I.e. how do you know that the patch is correct if you haven't tested it?
>
> Johan
It was tested (special use case with one of the carkits we had) and I
did this typo when I was porting
this from the other project. Sorry, it was done in a hurry.

2012-04-04 11:10:02

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Finalize discovery after discover message was rejected.

On Wed, Apr 04, 2012, Johan Hedberg wrote:
> Hi Rafal,
>
> On Wed, Apr 04, 2012, Garbat Rafal wrote:
> > >The patch looks ok'ish but it doesn't compile:
> > >
> > >audio/avdtp.c: In function ‘avdtp_parse_rej’:
> > >audio/avdtp.c:3071:11: error: ‘struct avdtp’ has no member named ‘used_data’
> > >
> > >Secondly, please use a "avdtp:" prefix for the commit message
> > >("Bluetooth" is only reserved for kernel patches) and remove the '.'
> > >from the end of the summary line.
> > >
> > >Johan
> >
> > Sorry, just a nasty typo. Will fix it and send patch once again.
>
> The thing I'm more worried about is that this seems to imply that you've
> neither run the code nor even tried to compile it. Is that the case?

I.e. how do you know that the patch is correct if you haven't tested it?

Johan

2012-04-04 11:08:34

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Finalize discovery after discover message was rejected.

Hi Rafal,

On Wed, Apr 04, 2012, Garbat Rafal wrote:
> >The patch looks ok'ish but it doesn't compile:
> >
> >audio/avdtp.c: In function ‘avdtp_parse_rej’:
> >audio/avdtp.c:3071:11: error: ‘struct avdtp’ has no member named ‘used_data’
> >
> >Secondly, please use a "avdtp:" prefix for the commit message
> >("Bluetooth" is only reserved for kernel patches) and remove the '.'
> >from the end of the summary line.
> >
> >Johan
>
> Sorry, just a nasty typo. Will fix it and send patch once again.

The thing I'm more worried about is that this seems to imply that you've
neither run the code nor even tried to compile it. Is that the case?

Johan

2012-04-04 11:05:27

by Rafal Garbat

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Finalize discovery after discover message was rejected.

Hi Johan

On 04/04/2012 12:20 PM, Johan Hedberg wrote:
> Hi Rafal,
>
> On Fri, Mar 09, 2012, Rafal Garbat wrote:
>> Finalize discovery and disconnect l2cap after discover
>> message was rejected.
>> ---
>> audio/avdtp.c | 6 ++++++
>> 1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/audio/avdtp.c b/audio/avdtp.c
>> index cd66fd4..64e5800 100644
>> --- a/audio/avdtp.c
>> +++ b/audio/avdtp.c
>> @@ -3064,6 +3064,12 @@ static gboolean avdtp_parse_rej(struct avdtp *session,
>> return FALSE;
>> error("DISCOVER request rejected: %s (%d)",
>> avdtp_strerror(&err), err.err.error_code);
>> + if (session->discov_cb) {
>> + session->discov_cb(session, session->seps,
>> + &err, session->user_data);
>> + session->discov_cb = NULL;
>> + session->used_data = NULL;
>> + }
>> return TRUE;
>> case AVDTP_GET_CAPABILITIES:
>> case AVDTP_GET_ALL_CAPABILITIES:
> The patch looks ok'ish but it doesn't compile:
>
> audio/avdtp.c: In function ‘avdtp_parse_rej’:
> audio/avdtp.c:3071:11: error: ‘struct avdtp’ has no member named ‘used_data’
>
> Secondly, please use a "avdtp:" prefix for the commit message
> ("Bluetooth" is only reserved for kernel patches) and remove the '.'
> from the end of the summary line.
>
> Johan

Sorry, just a nasty typo. Will fix it and send patch once again.

Rafal

2012-04-04 10:20:47

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Finalize discovery after discover message was rejected.

Hi Rafal,

On Fri, Mar 09, 2012, Rafal Garbat wrote:
> Finalize discovery and disconnect l2cap after discover
> message was rejected.
> ---
> audio/avdtp.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/audio/avdtp.c b/audio/avdtp.c
> index cd66fd4..64e5800 100644
> --- a/audio/avdtp.c
> +++ b/audio/avdtp.c
> @@ -3064,6 +3064,12 @@ static gboolean avdtp_parse_rej(struct avdtp *session,
> return FALSE;
> error("DISCOVER request rejected: %s (%d)",
> avdtp_strerror(&err), err.err.error_code);
> + if (session->discov_cb) {
> + session->discov_cb(session, session->seps,
> + &err, session->user_data);
> + session->discov_cb = NULL;
> + session->used_data = NULL;
> + }
> return TRUE;
> case AVDTP_GET_CAPABILITIES:
> case AVDTP_GET_ALL_CAPABILITIES:

The patch looks ok'ish but it doesn't compile:

audio/avdtp.c: In function ‘avdtp_parse_rej’:
audio/avdtp.c:3071:11: error: ‘struct avdtp’ has no member named ‘used_data’

Secondly, please use a "avdtp:" prefix for the commit message
("Bluetooth" is only reserved for kernel patches) and remove the '.'
from the end of the summary line.

Johan