Re: [PATCH 3/4] Bluetooth: convert force_active variable to flag in l2cap chan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux