提交 c7bdd502 编写于 作者: M Marcel Holtmann

[Bluetooth] Update class of device value whenever possible

The class of device value can only be retrieved via inquiry or during
an incoming connection request. Outgoing connections can't ask for the
class of device. To compensate for this the value is stored and copied
via the inquiry cache, but currently only updated via inquiry. This
update should also happen during an incoming connection request.
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 f383f275
...@@ -796,10 +796,14 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk ...@@ -796,10 +796,14 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
if (mask & HCI_LM_ACCEPT) { if (mask & HCI_LM_ACCEPT) {
/* Connection accepted */ /* Connection accepted */
struct inquiry_entry *ie;
struct hci_conn *conn; struct hci_conn *conn;
hci_dev_lock(hdev); hci_dev_lock(hdev);
if ((ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr)))
memcpy(ie->data.dev_class, ev->dev_class, 3);
conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr);
if (!conn) { if (!conn) {
if (!(conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr))) { if (!(conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr))) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册