From: Marcel Holtmann <marcel@holtmann.org>
To: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH trivial 2/4] Bluetooth: Define L2CAP conf continuation flag
Date: Wed, 23 May 2012 13:05:07 +0200 [thread overview]
Message-ID: <1337771107.15105.74.camel@aeonflux> (raw)
In-Reply-To: <1337761883-3190-2-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
> Define Continuation flag which the only flag used from Flags field
> in L2CAP Configuration Request and Response.
>
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
> include/net/bluetooth/l2cap.h | 3 +++
> net/bluetooth/l2cap_core.c | 10 +++++-----
> 2 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
> index 7bc4019..8980cbf 100644
> --- a/include/net/bluetooth/l2cap.h
> +++ b/include/net/bluetooth/l2cap.h
> @@ -271,6 +271,9 @@ struct l2cap_conf_rsp {
> #define L2CAP_CONF_PENDING 0x0004
> #define L2CAP_CONF_EFS_REJECT 0x0005
>
> +/* configuration req/rsp continuation flag */
> +#define L2CAP_CONF_FLAG_CONTINUATION 0
> +
> struct l2cap_conf_opt {
> __u8 type;
> __u8 len;
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index b644f40..75a8b66 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -2963,7 +2963,7 @@ done:
> }
>
> req->dcid = cpu_to_le16(chan->dcid);
> - req->flags = cpu_to_le16(0);
> + req->flags = __constant_cpu_to_le16(0);
>
> return ptr - data;
> }
> @@ -3183,7 +3183,7 @@ done:
> }
> rsp->scid = cpu_to_le16(chan->dcid);
> rsp->result = cpu_to_le16(result);
> - rsp->flags = cpu_to_le16(0x0000);
> + rsp->flags = __constant_cpu_to_le16(0);
>
> return ptr - data;
> }
> @@ -3282,7 +3282,7 @@ static int l2cap_parse_conf_rsp(struct l2cap_chan *chan, void *rsp, int len, voi
> }
>
> req->dcid = cpu_to_le16(chan->dcid);
> - req->flags = cpu_to_le16(0x0000);
> + req->flags = __constant_cpu_to_le16(0);
>
> return ptr - data;
> }
> @@ -3637,7 +3637,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
> memcpy(chan->conf_req + chan->conf_len, req->data, len);
> chan->conf_len += len;
>
> - if (flags & 0x0001) {
> + if (flags & BIT(L2CAP_CONF_FLAG_CONTINUATION)) {
do we really wanna do the BIT() over just defining it as 0x01.
Especially since there is only one flag right now. And the BIT() only
makes real sense if we use an enum.
Regards
Marcel
next prev parent reply other threads:[~2012-05-23 11:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-23 8:31 [PATCH trivial 1/4] Bluetooth: Use defined link key size Andrei Emeltchenko
2012-05-23 8:31 ` [PATCH trivial 2/4] Bluetooth: Define L2CAP conf continuation flag Andrei Emeltchenko
2012-05-23 11:05 ` Marcel Holtmann [this message]
2012-05-23 12:44 ` [PATCHv3] " Andrei Emeltchenko
2012-05-23 12:46 ` Marcel Holtmann
2012-05-23 8:31 ` [PATCH trivial 3/4] Bluetooth: Preserve flags values Andrei Emeltchenko
2012-05-23 11:07 ` Marcel Holtmann
2012-05-23 8:31 ` [PATCH trivial 4/4] Bluetooth: trivial: Remove empty line Andrei Emeltchenko
2012-05-23 11:08 ` Marcel Holtmann
2012-05-23 11:04 ` [PATCH trivial 1/4] Bluetooth: Use defined link key size Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1337771107.15105.74.camel@aeonflux \
--to=marcel@holtmann.org \
--cc=Andrei.Emeltchenko.news@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox