Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f0709e03ac3552b1b048ee171cb96ecaacc6813c
Commit:     f0709e03ac3552b1b048ee171cb96ecaacc6813c
Parent:     4e8402a3f884427f9233ba436459c158d1f2e114
Author:     Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 13:38:51 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:42 2007 -0700

    [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 <[EMAIL PROTECTED]>
---
 net/bluetooth/l2cap.c |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 896ae5a..733c95d 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -55,7 +55,9 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "2.8"
+#define VERSION "2.9"
+
+static u32 l2cap_feat_mask = 0x0000;
 
 static const struct proto_ops l2cap_sock_ops;
 
@@ -1775,16 +1777,27 @@ static inline int l2cap_disconnect_rsp(struct 
l2cap_conn *conn, struct l2cap_cmd
 static inline int l2cap_information_req(struct l2cap_conn *conn, struct 
l2cap_cmd_hdr *cmd, u8 *data)
 {
        struct l2cap_info_req *req = (struct l2cap_info_req *) data;
-       struct l2cap_info_rsp rsp;
        u16 type;
 
        type = __le16_to_cpu(req->type);
 
        BT_DBG("type 0x%4.4x", type);
 
-       rsp.type   = cpu_to_le16(type);
-       rsp.result = cpu_to_le16(L2CAP_IR_NOTSUPP);
-       l2cap_send_cmd(conn, cmd->ident, L2CAP_INFO_RSP, sizeof(rsp), &rsp);
+       if (type == L2CAP_IT_FEAT_MASK) {
+               u8 buf[8];
+               struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) buf;
+               rsp->type   = cpu_to_le16(L2CAP_IT_FEAT_MASK);
+               rsp->result = cpu_to_le16(L2CAP_IR_SUCCESS);
+               put_unaligned(cpu_to_le32(l2cap_feat_mask), (__le32 *) 
rsp->data);
+               l2cap_send_cmd(conn, cmd->ident,
+                                       L2CAP_INFO_RSP, sizeof(buf), buf);
+       } else {
+               struct l2cap_info_rsp rsp;
+               rsp.type   = cpu_to_le16(type);
+               rsp.result = cpu_to_le16(L2CAP_IR_NOTSUPP);
+               l2cap_send_cmd(conn, cmd->ident,
+                                       L2CAP_INFO_RSP, sizeof(rsp), &rsp);
+       }
 
        return 0;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to