diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2011-10-11 12:37:48 +0200 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-10-13 21:45:10 +0200 |
commit | 793c2f1cb9d722231290daf1744e6c5b7269f445 (patch) | |
tree | b46ea72bcadbce72fd76241f852bdc2d358a4c4a /include | |
parent | Bluetooth: EWS: rewrite L2CAP ERTM txseq calculation (diff) | |
download | linux-793c2f1cb9d722231290daf1744e6c5b7269f445.tar.xz linux-793c2f1cb9d722231290daf1744e6c5b7269f445.zip |
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')
-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) return (txseq << L2CAP_CTRL_TXSEQ_SHIFT) & L2CAP_CTRL_TXSEQ; } -#define __is_iframe(ctrl) (!((ctrl) & L2CAP_CTRL_FRAME_TYPE)) -#define __is_sframe(ctrl) ((ctrl) & L2CAP_CTRL_FRAME_TYPE) +static inline bool __is_sframe(struct l2cap_chan *chan, __u32 ctrl) +{ + if (test_bit(FLAG_EXT_CTRL, &chan->flags)) + return ctrl & L2CAP_EXT_CTRL_FRAME_TYPE; + else + return ctrl & L2CAP_CTRL_FRAME_TYPE; +} + +static inline __u32 __set_sframe(struct l2cap_chan *chan) +{ + if (test_bit(FLAG_EXT_CTRL, &chan->flags)) + return L2CAP_EXT_CTRL_FRAME_TYPE; + else + return L2CAP_CTRL_FRAME_TYPE; +} + static inline __u8 __get_ctrl_sar(struct l2cap_chan *chan, __u32 ctrl) { if (test_bit(FLAG_EXT_CTRL, &chan->flags)) |