Commit 978c93b9 authored by Andrei Emeltchenko's avatar Andrei Emeltchenko Committed by Johan Hedberg

Bluetooth: Save remote L2CAP fixed channel mask

Fixed channel mask needs to be stored to decide whether to
use A2MP for example. So far save only one relevant byte which
keeps all information we need.
Signed-off-by: default avatarAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 89bb46d0
...@@ -522,6 +522,7 @@ struct l2cap_conn { ...@@ -522,6 +522,7 @@ struct l2cap_conn {
unsigned int mtu; unsigned int mtu;
__u32 feat_mask; __u32 feat_mask;
__u8 fixed_chan_mask;
__u8 info_state; __u8 info_state;
__u8 info_ident; __u8 info_ident;
......
...@@ -3209,7 +3209,8 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm ...@@ -3209,7 +3209,8 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm
return 0; return 0;
} }
if (type == L2CAP_IT_FEAT_MASK) { switch (type) {
case L2CAP_IT_FEAT_MASK:
conn->feat_mask = get_unaligned_le32(rsp->data); conn->feat_mask = get_unaligned_le32(rsp->data);
if (conn->feat_mask & L2CAP_FEAT_FIXED_CHAN) { if (conn->feat_mask & L2CAP_FEAT_FIXED_CHAN) {
...@@ -3226,11 +3227,15 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm ...@@ -3226,11 +3227,15 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm
l2cap_conn_start(conn); l2cap_conn_start(conn);
} }
} else if (type == L2CAP_IT_FIXED_CHAN) { break;
case L2CAP_IT_FIXED_CHAN:
conn->fixed_chan_mask = rsp->data[0];
conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE; conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_DONE;
conn->info_ident = 0; conn->info_ident = 0;
l2cap_conn_start(conn); l2cap_conn_start(conn);
break;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment