aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/l2cap.h
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2011-10-11 06:37:48 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-10-13 15:45:10 -0400
commit793c2f1cb9d722231290daf1744e6c5b7269f445 (patch)
treeb46ea72bcadbce72fd76241f852bdc2d358a4c4a /include/net/bluetooth/l2cap.h
parentfb45de7dbaf2cf8eec43a88bdb98889f0d4d5d5f (diff)
Bluetooth: EWS: rewrite check frame type function
Check frame function uses now information about control field type. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net/bluetooth/l2cap.h')
-rw-r--r--include/net/bluetooth/l2cap.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 3ca24af7ebc5..9444dceaee19 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -548,8 +548,22 @@ static inline __u32 __set_txseq(struct l2cap_chan *chan, __u32 txseq)
548 return (txseq << L2CAP_CTRL_TXSEQ_SHIFT) & L2CAP_CTRL_TXSEQ; 548 return (txseq << L2CAP_CTRL_TXSEQ_SHIFT) & L2CAP_CTRL_TXSEQ;
549} 549}
550 550
551#define __is_iframe(ctrl) (!((ctrl) & L2CAP_CTRL_FRAME_TYPE)) 551static inline bool __is_sframe(struct l2cap_chan *chan, __u32 ctrl)
552#define __is_sframe(ctrl) ((ctrl) & L2CAP_CTRL_FRAME_TYPE) 552{
553 if (test_bit(FLAG_EXT_CTRL, &chan->flags))
554 return ctrl & L2CAP_EXT_CTRL_FRAME_TYPE;
555 else
556 return ctrl & L2CAP_CTRL_FRAME_TYPE;
557}
558
559static inline __u32 __set_sframe(struct l2cap_chan *chan)
560{
561 if (test_bit(FLAG_EXT_CTRL, &chan->flags))
562 return L2CAP_EXT_CTRL_FRAME_TYPE;
563 else
564 return L2CAP_CTRL_FRAME_TYPE;
565}
566
553static inline __u8 __get_ctrl_sar(struct l2cap_chan *chan, __u32 ctrl) 567static inline __u8 __get_ctrl_sar(struct l2cap_chan *chan, __u32 ctrl)
554{ 568{
555 if (test_bit(FLAG_EXT_CTRL, &chan->flags)) 569 if (test_bit(FLAG_EXT_CTRL, &chan->flags))