linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: Save remote L2CAP fixed channel mask
Date: Tue, 28 Feb 2012 08:23:17 -0800	[thread overview]
Message-ID: <1330446197.3392.82.camel@aeonflux> (raw)
In-Reply-To: <1330435774-25961-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

> Fixed channel mask needs to be stored to decide whether to
> use A2MP for example. So far save only one relevant byte which
> keeps all information we need.
> 
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
>  include/net/bluetooth/l2cap.h |    1 +
>  net/bluetooth/l2cap_core.c    |    9 +++++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
> index d6d8ec8..a7fd1e1 100644
> --- a/include/net/bluetooth/l2cap.h
> +++ b/include/net/bluetooth/l2cap.h
> @@ -522,6 +522,7 @@ struct l2cap_conn {
>  	unsigned int	mtu;
>  
>  	__u32		feat_mask;
> +	__u8		fc_mask;

make this fixed_chan_mask. The fc_ prefix is confusing.
 
>  	__u8		info_state;
>  	__u8		info_ident;
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index bdcfbf0..0b86a34 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c
> @@ -3209,7 +3209,8 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm
>  		return 0;
>  	}
>  
> -	if (type == L2CAP_IT_FEAT_MASK) {
> +	switch (type) {
> +	case L2CAP_IT_FEAT_MASK:
>  		conn->feat_mask = get_unaligned_le32(rsp->data);
>  
>  		if (conn->feat_mask & L2CAP_FEAT_FIXED_CHAN) {
> @@ -3226,11 +3227,15 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm
>  
>  			l2cap_conn_start(conn);
>  		}
> -	} else if (type == L2CAP_IT_FIXED_CHAN) {
> +		break;
> +
> +	case L2CAP_IT_FIXED_CHAN:
> +		conn->fc_mask = rsp->data[0];
>  		conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE;
>  		conn->info_ident = 0;
>  
>  		l2cap_conn_start(conn);
> +		break;
>  	}

Everything else looks fine to me.

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



      reply	other threads:[~2012-02-28 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28 13:29 [PATCH] Bluetooth: Save remote L2CAP fixed channel mask Andrei Emeltchenko
2012-02-28 16:23 ` Marcel Holtmann [this message]

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=1330446197.3392.82.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;
as well as URLs for NNTP newsgroup(s).