diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2011-10-11 06:37:48 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-10-13 15:45:10 -0400 |
commit | 793c2f1cb9d722231290daf1744e6c5b7269f445 (patch) | |
tree | b46ea72bcadbce72fd76241f852bdc2d358a4c4a /include/net | |
parent | fb45de7dbaf2cf8eec43a88bdb98889f0d4d5d5f (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')
-rw-r--r-- | include/net/bluetooth/l2cap.h | 18 |
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)) | 551 | static 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 | |||
559 | static 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 | |||
553 | static inline __u8 __get_ctrl_sar(struct l2cap_chan *chan, __u32 ctrl) | 567 | static 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)) |