aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-10-20 07:38:51 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-22 05:59:42 -0400
commitf0709e03ac3552b1b048ee171cb96ecaacc6813c (patch)
tree65c888eb7c1d6ad1f34276232a8cddbbcf163c28 /net/bluetooth/l2cap.c
parent4e8402a3f884427f9233ba436459c158d1f2e114 (diff)
[Bluetooth] Advertise L2CAP features mask support
Indicate the support for the L2CAP features mask value when the remote entity tries to negotiate Bluetooth 1.2 specific features. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/l2cap.c')
-rw-r--r--net/bluetooth/l2cap.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 896ae5a9c07a..733c95dbd07e 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -55,7 +55,9 @@
55#define BT_DBG(D...) 55#define BT_DBG(D...)
56#endif 56#endif
57 57
58#define VERSION "2.8" 58#define VERSION "2.9"
59
60static u32 l2cap_feat_mask = 0x0000;
59 61
60static const struct proto_ops l2cap_sock_ops; 62static const struct proto_ops l2cap_sock_ops;
61 63
@@ -1775,16 +1777,27 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, struct l2cap_cmd
1775static inline int l2cap_information_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u8 *data) 1777static inline int l2cap_information_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u8 *data)
1776{ 1778{
1777 struct l2cap_info_req *req = (struct l2cap_info_req *) data; 1779 struct l2cap_info_req *req = (struct l2cap_info_req *) data;
1778 struct l2cap_info_rsp rsp;
1779 u16 type; 1780 u16 type;
1780 1781
1781 type = __le16_to_cpu(req->type); 1782 type = __le16_to_cpu(req->type);
1782 1783
1783 BT_DBG("type 0x%4.4x", type); 1784 BT_DBG("type 0x%4.4x", type);
1784 1785
1785 rsp.type = cpu_to_le16(type); 1786 if (type == L2CAP_IT_FEAT_MASK) {
1786 rsp.result = cpu_to_le16(L2CAP_IR_NOTSUPP); 1787 u8 buf[8];
1787 l2cap_send_cmd(conn, cmd->ident, L2CAP_INFO_RSP, sizeof(rsp), &rsp); 1788 struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) buf;
1789 rsp->type = cpu_to_le16(L2CAP_IT_FEAT_MASK);
1790 rsp->result = cpu_to_le16(L2CAP_IR_SUCCESS);
1791 put_unaligned(cpu_to_le32(l2cap_feat_mask), (__le32 *) rsp->data);
1792 l2cap_send_cmd(conn, cmd->ident,
1793 L2CAP_INFO_RSP, sizeof(buf), buf);
1794 } else {
1795 struct l2cap_info_rsp rsp;
1796 rsp.type = cpu_to_le16(type);
1797 rsp.result = cpu_to_le16(L2CAP_IR_NOTSUPP);
1798 l2cap_send_cmd(conn, cmd->ident,
1799 L2CAP_INFO_RSP, sizeof(rsp), &rsp);
1800 }
1788 1801
1789 return 0; 1802 return 0;
1790} 1803}