* [PATCH] Bluetooth: Replace hard code of fixed channels bit mask
@ 2010-09-16 7:15 haijun liu
2010-09-16 14:16 ` Gustavo F. Padovan
0 siblings, 1 reply; 7+ messages in thread
From: haijun liu @ 2010-09-16 7:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Mat Martineau, dantian.ip
This patch add fixed channels bit mask definition for
L2CAP_FIXCHAN_NULLID
L2CAP_FIXCHAN_SIGNAL
L2CAP_FIXCHAN_CONNLESS
L2CAP_FIXCHAN_A2MP
And replace hard code in source file with the macro.
Signed-off-by: Haijun.Liu <Haijun.Liu@Atheros.com>
---
include/net/bluetooth/l2cap.h | 6 ++++++
net/bluetooth/l2cap.c | 2 +-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 6c24144..e4fe2c7 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -97,6 +97,12 @@ struct l2cap_conninfo {
#define L2CAP_FEAT_FCS 0x00000020
#define L2CAP_FEAT_FIXED_CHAN 0x00000080
+/* L2CAP fixed channel bitmask */
+#define L2CAP_FIXCHAN_NULLID 0x00
+#define L2CAP_FIXCHAN_SIGNAL 0x02
+#define L2CAP_FIXCHAN_CONNLESS 0x04
+#define L2CAP_FIXCHAN_A2MP 0x08
+
/* L2CAP checksum option */
#define L2CAP_FCS_NONE 0x00
#define L2CAP_FCS_CRC16 0x01
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index c784703..23e487e 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -60,7 +60,7 @@
static int disable_ertm = 0;
static u32 l2cap_feat_mask = L2CAP_FEAT_FIXED_CHAN;
-static u8 l2cap_fixed_chan[8] = { 0x02, };
+static u8 l2cap_fixed_chan[8] = { L2CAP_FIXCHAN_SIGNAL, };
static const struct proto_ops l2cap_sock_ops;
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: Replace hard code of fixed channels bit mask
2010-09-16 7:15 [PATCH] Bluetooth: Replace hard code of fixed channels bit mask haijun liu
@ 2010-09-16 14:16 ` Gustavo F. Padovan
[not found] ` <AANLkTik244A2zNFL-yL7CvBKdf3UZDDKq1Ap7HR5+aCR@mail.gmail.com>
2010-09-17 8:50 ` Ville Tervo
0 siblings, 2 replies; 7+ messages in thread
From: Gustavo F. Padovan @ 2010-09-16 14:16 UTC (permalink / raw)
To: haijun liu; +Cc: linux-bluetooth, Mat Martineau, dantian.ip
Hi Haijun,
* haijun liu <liuhaijun.er@gmail.com> [2010-09-16 15:15:18 +0800]:
> This patch add fixed channels bit mask definition for
> L2CAP_FIXCHAN_NULLID
> L2CAP_FIXCHAN_SIGNAL
> L2CAP_FIXCHAN_CONNLESS
> L2CAP_FIXCHAN_A2MP
> And replace hard code in source file with the macro.
>
> Signed-off-by: Haijun.Liu <Haijun.Liu@Atheros.com>
> ---
> include/net/bluetooth/l2cap.h | 6 ++++++
> net/bluetooth/l2cap.c | 2 +-
> 2 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
> index 6c24144..e4fe2c7 100644
> --- a/include/net/bluetooth/l2cap.h
> +++ b/include/net/bluetooth/l2cap.h
> @@ -97,6 +97,12 @@ struct l2cap_conninfo {
> #define L2CAP_FEAT_FCS 0x00000020
> #define L2CAP_FEAT_FIXED_CHAN 0x00000080
>
> +/* L2CAP fixed channel bitmask */
> +#define L2CAP_FIXCHAN_NULLID 0x00
> +#define L2CAP_FIXCHAN_SIGNAL 0x02
> +#define L2CAP_FIXCHAN_CONNLESS 0x04
> +#define L2CAP_FIXCHAN_A2MP 0x08
That's wrong, signaling channel is 0x01, connless is 0x02 and A2MP is
0x03. And if you haven't noted we already have macros for the signaling
and connectionless channels:
#define L2CAP_CID_SIGNALING 0x0001
#define L2CAP_CID_CONN_LESS 0x0002
--
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi
^ permalink raw reply [flat|nested] 7+ messages in thread
* Fwd: [PATCH] Bluetooth: Replace hard code of fixed channels bit mask
[not found] ` <AANLkTik244A2zNFL-yL7CvBKdf3UZDDKq1Ap7HR5+aCR@mail.gmail.com>
@ 2010-09-17 1:08 ` haijun liu
0 siblings, 0 replies; 7+ messages in thread
From: haijun liu @ 2010-09-17 1:08 UTC (permalink / raw)
To: linux-bluetooth
Hi Gustavo,
On Thu, Sep 16, 2010 at 10:16 PM, Gustavo F. Padovan
<padovan@profusion.mobi> wrote:
> Hi Haijun,
>
> * haijun liu <liuhaijun.er@gmail.com> [2010-09-16 15:15:18 +0800]:
>
>> This patch add fixed channels bit mask definition for
>> L2CAP_FIXCHAN_NULLID
>> L2CAP_FIXCHAN_SIGNAL
>> L2CAP_FIXCHAN_CONNLESS
>> L2CAP_FIXCHAN_A2MP
>> And replace hard code in source file with the macro.
>>
>> Signed-off-by: Haijun.Liu <Haijun.Liu@Atheros.com>
>> ---
>> include/net/bluetooth/l2cap.h | 6 ++++++
>> net/bluetooth/l2cap.c | 2 +-
>> 2 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
>> index 6c24144..e4fe2c7 100644
>> --- a/include/net/bluetooth/l2cap.h
>> +++ b/include/net/bluetooth/l2cap.h
>> @@ -97,6 +97,12 @@ struct l2cap_conninfo {
>> #define L2CAP_FEAT_FCS 0x00000020
>> #define L2CAP_FEAT_FIXED_CHAN 0x00000080
>>
>> +/* L2CAP fixed channel bitmask */
>> +#define L2CAP_FIXCHAN_NULLID 0x00
>> +#define L2CAP_FIXCHAN_SIGNAL 0x02
>> +#define L2CAP_FIXCHAN_CONNLESS 0x04
>> +#define L2CAP_FIXCHAN_A2MP 0x08
>
> That's wrong, signaling channel is 0x01, connless is 0x02 and A2MP is
> 0x03. And if you haven't noted we already have macros for the signaling
> and connectionless channels:
>
> #define L2CAP_CID_SIGNALING 0x0001
> #define L2CAP_CID_CONN_LESS 0x0002
>
> --
> Gustavo F. Padovan
> ProFUSION embedded systems - http://profusion.mobi
>
These are not channel id definition, these are feature bit mask values.
And they are used in information exchange process to present FIXED
CHANNELS SUPPORTED.
--
Haijun Liu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: Replace hard code of fixed channels bit mask
2010-09-16 14:16 ` Gustavo F. Padovan
[not found] ` <AANLkTik244A2zNFL-yL7CvBKdf3UZDDKq1Ap7HR5+aCR@mail.gmail.com>
@ 2010-09-17 8:50 ` Ville Tervo
2010-09-17 11:39 ` haijun liu
2010-09-17 18:07 ` Gustavo F. Padovan
1 sibling, 2 replies; 7+ messages in thread
From: Ville Tervo @ 2010-09-17 8:50 UTC (permalink / raw)
To: ext Gustavo F. Padovan
Cc: haijun liu, linux-bluetooth@vger.kernel.org, Mat Martineau,
dantian.ip
Hi Gustavo,
On Thu, Sep 16, 2010 at 04:16:54PM +0200, ext Gustavo F. Padovan wrote:
> Hi Haijun,
>
> * haijun liu <liuhaijun.er@gmail.com> [2010-09-16 15:15:18 +0800]:
>
> > This patch add fixed channels bit mask definition for
> > L2CAP_FIXCHAN_NULLID
> > L2CAP_FIXCHAN_SIGNAL
> > L2CAP_FIXCHAN_CONNLESS
> > L2CAP_FIXCHAN_A2MP
> > And replace hard code in source file with the macro.
> >
> > Signed-off-by: Haijun.Liu <Haijun.Liu@Atheros.com>
> > ---
> > include/net/bluetooth/l2cap.h | 6 ++++++
> > net/bluetooth/l2cap.c | 2 +-
> > 2 files changed, 7 insertions(+), 1 deletions(-)
> >
> > diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
> > index 6c24144..e4fe2c7 100644
> > --- a/include/net/bluetooth/l2cap.h
> > +++ b/include/net/bluetooth/l2cap.h
> > @@ -97,6 +97,12 @@ struct l2cap_conninfo {
> > #define L2CAP_FEAT_FCS 0x00000020
> > #define L2CAP_FEAT_FIXED_CHAN 0x00000080
> >
> > +/* L2CAP fixed channel bitmask */
> > +#define L2CAP_FIXCHAN_NULLID 0x00
> > +#define L2CAP_FIXCHAN_SIGNAL 0x02
> > +#define L2CAP_FIXCHAN_CONNLESS 0x04
> > +#define L2CAP_FIXCHAN_A2MP 0x08
>
> That's wrong, signaling channel is 0x01, connless is 0x02 and A2MP is
> 0x03. And if you haven't noted we already have macros for the signaling
> and connectionless channels:
But these are bit masks and looks ok to me except L2CAP_FIXCHAN_A2MP which I
could not find from the list.. Check Vol 3 Part A 4.13.
> #define L2CAP_CID_SIGNALING 0x0001
> #define L2CAP_CID_CONN_LESS 0x0002
These are channel ids.
--
Ville
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: Replace hard code of fixed channels bit mask
2010-09-17 8:50 ` Ville Tervo
@ 2010-09-17 11:39 ` haijun liu
2010-09-20 9:19 ` Ville Tervo
2010-09-17 18:07 ` Gustavo F. Padovan
1 sibling, 1 reply; 7+ messages in thread
From: haijun liu @ 2010-09-17 11:39 UTC (permalink / raw)
To: Ville Tervo
Cc: ext Gustavo F. Padovan, linux-bluetooth@vger.kernel.org,
Mat Martineau, dantian.ip
Hi Ville,
On Fri, Sep 17, 2010 at 4:50 PM, Ville Tervo <ville.tervo@nokia.com> wrote:
> Hi Gustavo,
>
> On Thu, Sep 16, 2010 at 04:16:54PM +0200, ext Gustavo F. Padovan wrote:
>> Hi Haijun,
>>
>> * haijun liu <liuhaijun.er@gmail.com> [2010-09-16 15:15:18 +0800]:
>>
>> > This patch add fixed channels bit mask definition for
>> > L2CAP_FIXCHAN_NULLID
>> > L2CAP_FIXCHAN_SIGNAL
>> > L2CAP_FIXCHAN_CONNLESS
>> > L2CAP_FIXCHAN_A2MP
>> > And replace hard code in source file with the macro.
>> >
>> > Signed-off-by: Haijun.Liu <Haijun.Liu@Atheros.com>
>> > ---
>> > include/net/bluetooth/l2cap.h | 6 ++++++
>> > net/bluetooth/l2cap.c | 2 +-
>> > 2 files changed, 7 insertions(+), 1 deletions(-)
>> >
>> > diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
>> > index 6c24144..e4fe2c7 100644
>> > --- a/include/net/bluetooth/l2cap.h
>> > +++ b/include/net/bluetooth/l2cap.h
>> > @@ -97,6 +97,12 @@ struct l2cap_conninfo {
>> > #define L2CAP_FEAT_FCS 0x00000020
>> > #define L2CAP_FEAT_FIXED_CHAN 0x00000080
>> >
>> > +/* L2CAP fixed channel bitmask */
>> > +#define L2CAP_FIXCHAN_NULLID 0x00
>> > +#define L2CAP_FIXCHAN_SIGNAL 0x02
>> > +#define L2CAP_FIXCHAN_CONNLESS 0x04
>> > +#define L2CAP_FIXCHAN_A2MP 0x08
>>
>> That's wrong, signaling channel is 0x01, connless is 0x02 and A2MP is
>> 0x03. And if you haven't noted we already have macros for the signaling
>> and connectionless channels:
>
> But these are bit masks and looks ok to me except L2CAP_FIXCHAN_A2MP which I
> could not find from the list.. Check Vol 3 Part A 4.13.
>
>> #define L2CAP_CID_SIGNALING 0x0001
>> #define L2CAP_CID_CONN_LESS 0x0002
>
> These are channel ids.
>
>
> --
> Ville
>
A2MP means AMP Manager Protocol, it's from <<Core_V3.0 + HS.pdf>>
--
Haijun Liu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: Replace hard code of fixed channels bit mask
2010-09-17 8:50 ` Ville Tervo
2010-09-17 11:39 ` haijun liu
@ 2010-09-17 18:07 ` Gustavo F. Padovan
1 sibling, 0 replies; 7+ messages in thread
From: Gustavo F. Padovan @ 2010-09-17 18:07 UTC (permalink / raw)
To: Ville Tervo
Cc: haijun liu, linux-bluetooth@vger.kernel.org, Mat Martineau,
dantian.ip
Hi Ville,
* Ville Tervo <ville.tervo@nokia.com> [2010-09-17 11:50:47 +0300]:
> Hi Gustavo,
>
> On Thu, Sep 16, 2010 at 04:16:54PM +0200, ext Gustavo F. Padovan wrote:
> > Hi Haijun,
> >
> > * haijun liu <liuhaijun.er@gmail.com> [2010-09-16 15:15:18 +0800]:
> >
> > > This patch add fixed channels bit mask definition for
> > > L2CAP_FIXCHAN_NULLID
> > > L2CAP_FIXCHAN_SIGNAL
> > > L2CAP_FIXCHAN_CONNLESS
> > > L2CAP_FIXCHAN_A2MP
> > > And replace hard code in source file with the macro.
> > >
> > > Signed-off-by: Haijun.Liu <Haijun.Liu@Atheros.com>
> > > ---
> > > include/net/bluetooth/l2cap.h | 6 ++++++
> > > net/bluetooth/l2cap.c | 2 +-
> > > 2 files changed, 7 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
> > > index 6c24144..e4fe2c7 100644
> > > --- a/include/net/bluetooth/l2cap.h
> > > +++ b/include/net/bluetooth/l2cap.h
> > > @@ -97,6 +97,12 @@ struct l2cap_conninfo {
> > > #define L2CAP_FEAT_FCS 0x00000020
> > > #define L2CAP_FEAT_FIXED_CHAN 0x00000080
> > >
> > > +/* L2CAP fixed channel bitmask */
> > > +#define L2CAP_FIXCHAN_NULLID 0x00
> > > +#define L2CAP_FIXCHAN_SIGNAL 0x02
> > > +#define L2CAP_FIXCHAN_CONNLESS 0x04
> > > +#define L2CAP_FIXCHAN_A2MP 0x08
> >
> > That's wrong, signaling channel is 0x01, connless is 0x02 and A2MP is
> > 0x03. And if you haven't noted we already have macros for the signaling
> > and connectionless channels:
>
> But these are bit masks and looks ok to me except L2CAP_FIXCHAN_A2MP which I
> could not find from the list.. Check Vol 3 Part A 4.13.
>
> > #define L2CAP_CID_SIGNALING 0x0001
> > #define L2CAP_CID_CONN_LESS 0x0002
>
> These are channel ids.
Yes, you guys are completely right. I was misunderstanding that piece of
code about fixed channels. Thanks for clarify. ;)
--
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: Replace hard code of fixed channels bit mask
2010-09-17 11:39 ` haijun liu
@ 2010-09-20 9:19 ` Ville Tervo
0 siblings, 0 replies; 7+ messages in thread
From: Ville Tervo @ 2010-09-20 9:19 UTC (permalink / raw)
To: ext haijun liu
Cc: ext Gustavo F. Padovan, linux-bluetooth@vger.kernel.org,
Mat Martineau, dantian.ip
On Fri, Sep 17, 2010 at 01:39:30PM +0200, ext haijun liu wrote:
> Hi Ville,
>
> On Fri, Sep 17, 2010 at 4:50 PM, Ville Tervo <ville.tervo@nokia.com> wrote:
> > Hi Gustavo,
> >
> > On Thu, Sep 16, 2010 at 04:16:54PM +0200, ext Gustavo F. Padovan wrote:
> >> Hi Haijun,
> >>
> >> * haijun liu <liuhaijun.er@gmail.com> [2010-09-16 15:15:18 +0800]:
> >>
> >> > This patch add fixed channels bit mask definition for
> >> > L2CAP_FIXCHAN_NULLID
> >> > L2CAP_FIXCHAN_SIGNAL
> >> > L2CAP_FIXCHAN_CONNLESS
> >> > L2CAP_FIXCHAN_A2MP
> >> > And replace hard code in source file with the macro.
> >> >
> >> > Signed-off-by: Haijun.Liu <Haijun.Liu@Atheros.com>
> >> > ---
> >> > include/net/bluetooth/l2cap.h | 6 ++++++
> >> > net/bluetooth/l2cap.c | 2 +-
> >> > 2 files changed, 7 insertions(+), 1 deletions(-)
> >> >
> >> > diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
> >> > index 6c24144..e4fe2c7 100644
> >> > --- a/include/net/bluetooth/l2cap.h
> >> > +++ b/include/net/bluetooth/l2cap.h
> >> > @@ -97,6 +97,12 @@ struct l2cap_conninfo {
> >> > #define L2CAP_FEAT_FCS 0x00000020
> >> > #define L2CAP_FEAT_FIXED_CHAN 0x00000080
> >> >
> >> > +/* L2CAP fixed channel bitmask */
> >> > +#define L2CAP_FIXCHAN_NULLID 0x00
> >> > +#define L2CAP_FIXCHAN_SIGNAL 0x02
> >> > +#define L2CAP_FIXCHAN_CONNLESS 0x04
> >> > +#define L2CAP_FIXCHAN_A2MP 0x08
> >>
> >> That's wrong, signaling channel is 0x01, connless is 0x02 and A2MP is
> >> 0x03. And if you haven't noted we already have macros for the signaling
> >> and connectionless channels:
> >
> > But these are bit masks and looks ok to me except L2CAP_FIXCHAN_A2MP which I
> > could not find from the list.. Check Vol 3 Part A 4.13.
> >
> >> #define L2CAP_CID_SIGNALING 0x0001
> >> #define L2CAP_CID_CONN_LESS 0x0002
> >
> > These are channel ids.
> >
> >
> > --
> > Ville
> >
>
> A2MP means AMP Manager Protocol, it's from <<Core_V3.0 + HS.pdf>>
ok. I am a little bit lost with all AMP acromyns.
--
Ville
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-09-20 9:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-16 7:15 [PATCH] Bluetooth: Replace hard code of fixed channels bit mask haijun liu
2010-09-16 14:16 ` Gustavo F. Padovan
[not found] ` <AANLkTik244A2zNFL-yL7CvBKdf3UZDDKq1Ap7HR5+aCR@mail.gmail.com>
2010-09-17 1:08 ` Fwd: " haijun liu
2010-09-17 8:50 ` Ville Tervo
2010-09-17 11:39 ` haijun liu
2010-09-20 9:19 ` Ville Tervo
2010-09-17 18:07 ` Gustavo F. Padovan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).