aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2011-10-11 07:04:31 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-10-11 09:44:44 -0400
commitd57b0e8b8990419b7b7ae0dda5cc4452720b3c7c (patch)
tree1e08d57106396709bdfc261d86b7fd85c00ca8cd /net
parentd4b8d1c9c1564f4cbce86cbbee099fadf735b226 (diff)
Bluetooth: convert flushable variable to flag in l2cap chan
flushable variable inside l2cap_chan is a logical one and can be easily converted to flag. Added flags in l2cap_chan structure. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/l2cap_core.c3
-rw-r--r--net/bluetooth/l2cap_sock.c12
2 files changed, 10 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 3158cec9e274..b21ecfffcaa9 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1253,7 +1253,8 @@ static void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb)
1253 1253
1254 BT_DBG("chan %p, skb %p len %d", chan, skb, skb->len); 1254 BT_DBG("chan %p, skb %p len %d", chan, skb, skb->len);
1255 1255
1256 if (!chan->flushable && lmp_no_flush_capable(hcon->hdev)) 1256 if (!test_bit(FLAG_FLUSHABLE, &chan->flags) &&
1257 lmp_no_flush_capable(hcon->hdev))
1257 flags = ACL_START_NO_FLUSH; 1258 flags = ACL_START_NO_FLUSH;
1258 else 1259 else
1259 flags = ACL_START; 1260 flags = ACL_START;
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 61f1f623091d..99782cb4f0b4 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -446,7 +446,8 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ch
446 break; 446 break;
447 447
448 case BT_FLUSHABLE: 448 case BT_FLUSHABLE:
449 if (put_user(chan->flushable, (u32 __user *) optval)) 449 if (put_user(test_bit(FLAG_FLUSHABLE, &chan->flags),
450 (u32 __user *) optval))
450 err = -EFAULT; 451 err = -EFAULT;
451 452
452 break; 453 break;
@@ -655,7 +656,10 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch
655 } 656 }
656 } 657 }
657 658
658 chan->flushable = opt; 659 if (opt)
660 set_bit(FLAG_FLUSHABLE, &chan->flags);
661 else
662 clear_bit(FLAG_FLUSHABLE, &chan->flags);
659 break; 663 break;
660 664
661 case BT_POWER: 665 case BT_POWER:
@@ -931,7 +935,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
931 chan->sec_level = pchan->sec_level; 935 chan->sec_level = pchan->sec_level;
932 chan->role_switch = pchan->role_switch; 936 chan->role_switch = pchan->role_switch;
933 chan->force_reliable = pchan->force_reliable; 937 chan->force_reliable = pchan->force_reliable;
934 chan->flushable = pchan->flushable; 938 chan->flags = pchan->flags;
935 chan->force_active = pchan->force_active; 939 chan->force_active = pchan->force_active;
936 } else { 940 } else {
937 941
@@ -962,7 +966,7 @@ static void l2cap_sock_init(struct sock *sk, struct sock *parent)
962 chan->sec_level = BT_SECURITY_LOW; 966 chan->sec_level = BT_SECURITY_LOW;
963 chan->role_switch = 0; 967 chan->role_switch = 0;
964 chan->force_reliable = 0; 968 chan->force_reliable = 0;
965 chan->flushable = BT_FLUSHABLE_OFF; 969 chan->flags = 0;
966 chan->force_active = BT_POWER_FORCE_ACTIVE_ON; 970 chan->force_active = BT_POWER_FORCE_ACTIVE_ON;
967 971
968 } 972 }