All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emeltchenko Andrei <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 3/4] Bluetooth: convert force_active variable to flag in l2cap chan
Date: Tue, 11 Oct 2011 12:44:57 +0300	[thread overview]
Message-ID: <20111011094454.GC19953@aemeltch-MOBL1> (raw)
In-Reply-To: <20111011075032.GB19953@aemeltch-MOBL1>

Hi Gustavo,

On Tue, Oct 11, 2011 at 10:50:34AM +0300, Emeltchenko Andrei wrote:
> > > @@ -942,7 +946,8 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
> > >  			set_bit(FLAG_FORCE_RELIABLE, &chan->flags);
> > >  		if (test_bit(FLAG_FLUSHABLE, &pchan->flags))
> > >  			set_bit(FLAG_FLUSHABLE, &chan->flags);
> > > -		chan->force_active = pchan->force_active;
> > > +		if (test_bit(FLAG_FORCE_ACTIVE, &pchan->flags))
> > > +			set_bit(FLAG_FORCE_ACTIVE, &chan->flags);
> > >  	} else {
> > >  
> > >  		switch (sk->sk_type) {
> > > @@ -973,8 +978,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
> > >  		chan->role_switch = 0;
> > >  		clear_bit(FLAG_FORCE_RELIABLE, &chan->flags);
> > >  		clear_bit(FLAG_FLUSHABLE, &chan->flags);
> > > -		chan->force_active = BT_POWER_FORCE_ACTIVE_ON;
> > > -
> > > +		set_bit(FLAG_FORCE_ACTIVE, &chan->flags);
> > 
> > One last comment: set chan->flags to 0 here, the just to set the bits that
> > needs to be 1 at initialization.
> 
> Sorry do not understand this :-(
> 
> Do you mean assign chan->flags = 0; and set_bit only for
> FLAG_FORCE_ACTIVE?

Just sent patches with cumulative difference below:


diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 3ca71b4..4b388b7 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -979,9 +979,7 @@ static void l2cap_sock_init(struct sock *sk, struct
sock *parent)
                chan->fcs  = L2CAP_FCS_CRC16;
                chan->tx_win = L2CAP_DEFAULT_TX_WINDOW;
                chan->sec_level = BT_SECURITY_LOW;
-               clear_bit(FLAG_ROLE_SWITCH, &chan->flags);
-               clear_bit(FLAG_FORCE_RELIABLE, &chan->flags);
-               clear_bit(FLAG_FLUSHABLE, &chan->flags);
+               chan->flags = 0;
                set_bit(FLAG_FORCE_ACTIVE, &chan->flags);
        }


Best regards 
Andrei Emeltchenko 


  reply	other threads:[~2011-10-11  9:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10  7:33 [PATCH 1/4] Bluetooth: convert flushable variable to flag in l2cap chan Emeltchenko Andrei
2011-10-10  7:33 ` [PATCH 2/4] Bluetooth: convert force_reliable " Emeltchenko Andrei
2011-10-10  7:33 ` [PATCH 3/4] Bluetooth: convert force_active " Emeltchenko Andrei
2011-10-10 21:07   ` Gustavo Padovan
2011-10-11  7:50     ` Emeltchenko Andrei
2011-10-11  9:44       ` Emeltchenko Andrei [this message]
2011-10-11 10:01         ` Szymon Janc
2011-10-11 10:34           ` Emeltchenko Andrei
2011-10-10  7:33 ` [PATCH 4/4] Bluetooth: convert role_switch " Emeltchenko Andrei
  -- strict thread matches above, loose matches on Subject: below --
2011-10-07 13:54 [PATCH 1/4] Bluetooth: convert flushable " Emeltchenko Andrei
2011-10-07 13:54 ` [PATCH 3/4] Bluetooth: convert force_active " Emeltchenko Andrei

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=20111011094454.GC19953@aemeltch-MOBL1 \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.