summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrei Emeltchenko2011-10-11 12:37:48 +0200
committerGustavo F. Padovan2011-10-13 21:45:10 +0200
commit793c2f1cb9d722231290daf1744e6c5b7269f445 (patch)
treeb46ea72bcadbce72fd76241f852bdc2d358a4c4a /include
parentBluetooth: EWS: rewrite L2CAP ERTM txseq calculation (diff)
downloadkernel-qcow2-linux-793c2f1cb9d722231290daf1744e6c5b7269f445.tar.gz
kernel-qcow2-linux-793c2f1cb9d722231290daf1744e6c5b7269f445.tar.xz
kernel-qcow2-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.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)
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))