Commit a967892c authored by Marcel Holtmann's avatar Marcel Holtmann

[Bluetooth] Track the class of device value

The class of device is only available from an inquiry response or
from the connection request. In the case of an incoming connection
the value can be taken from the request and stored in the hci_conn
structure. For an outgoing connection the value from the inquiry
cache is used or it is set to zero.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 94a43cc9
......@@ -152,6 +152,7 @@ struct hci_conn {
__u16 state;
__u8 type;
__u8 out;
__u8 dev_class[3];
__u32 link_mode;
unsigned long pend;
......
......@@ -74,6 +74,7 @@ void hci_acl_connect(struct hci_conn *conn)
cp.pscan_rep_mode = ie->data.pscan_rep_mode;
cp.pscan_mode = ie->data.pscan_mode;
cp.clock_offset = ie->data.clock_offset | __cpu_to_le16(0x8000);
memcpy(conn->dev_class, ie->data.dev_class, 3);
}
cp.pkt_type = __cpu_to_le16(hdev->pkt_type & ACL_PTYPE_MASK);
......
......@@ -555,6 +555,7 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
return;
}
}
memcpy(conn->dev_class, ev->dev_class, 3);
conn->state = BT_CONNECT;
hci_dev_unlock(hdev);
......
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