Bluetooth: Management API changes in Bluetooth to update remote Class.
When connection initiated from the remote device the class of device information is required to be updated to userspace through this event. Change-Id: I97d715a0b80e12d414ecf03d099955c8b12c82b4 Signed-off-by: Srinivas Krovvidi <skrovvid@codeaurora.org>
This commit is contained in:
@@ -1041,6 +1041,7 @@ int mgmt_encrypt_change(u16 index, bdaddr_t *bdaddr, u8 status);
|
|||||||
|
|
||||||
/* LE SMP Management interface */
|
/* LE SMP Management interface */
|
||||||
int le_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, void *cp);
|
int le_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, void *cp);
|
||||||
|
int mgmt_remote_class(u16 index, bdaddr_t *bdaddr, u8 dev_class[3]);
|
||||||
|
|
||||||
/* HCI info for socket */
|
/* HCI info for socket */
|
||||||
#define hci_pi(sk) ((struct hci_pinfo *) sk)
|
#define hci_pi(sk) ((struct hci_pinfo *) sk)
|
||||||
|
|||||||
@@ -342,3 +342,8 @@ struct mgmt_ev_encrypt_change {
|
|||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
|
||||||
|
#define MGMT_EV_REMOTE_CLASS 0x0017
|
||||||
|
struct mgmt_ev_remote_class {
|
||||||
|
bdaddr_t bdaddr;
|
||||||
|
__u8 dev_class[3];
|
||||||
|
} __packed;
|
||||||
|
|||||||
@@ -1678,6 +1678,8 @@ static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *sk
|
|||||||
}
|
}
|
||||||
|
|
||||||
memcpy(conn->dev_class, ev->dev_class, 3);
|
memcpy(conn->dev_class, ev->dev_class, 3);
|
||||||
|
/* For incoming connection update remote class to userspace */
|
||||||
|
mgmt_remote_class(hdev->id, &ev->bdaddr, ev->dev_class);
|
||||||
conn->state = BT_CONNECT;
|
conn->state = BT_CONNECT;
|
||||||
|
|
||||||
hci_dev_unlock(hdev);
|
hci_dev_unlock(hdev);
|
||||||
|
|||||||
@@ -2905,3 +2905,14 @@ int mgmt_encrypt_change(u16 index, bdaddr_t *bdaddr, u8 status)
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mgmt_remote_class(u16 index, bdaddr_t *bdaddr, u8 dev_class[3])
|
||||||
|
{
|
||||||
|
struct mgmt_ev_remote_class ev;
|
||||||
|
|
||||||
|
memset(&ev, 0, sizeof(ev));
|
||||||
|
|
||||||
|
bacpy(&ev.bdaddr, bdaddr);
|
||||||
|
memcpy(ev.dev_class, dev_class, 3);
|
||||||
|
|
||||||
|
return mgmt_event(MGMT_EV_REMOTE_CLASS, index, &ev, sizeof(ev), NULL);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user