提交 af7985bf 编写于 作者: J Jefferson Delfes 提交者: Gustavo Padovan

Bluetooth: Fix flags of mgmt_device_found event

Change flags field to matches userspace structure.
This field needs to be converted to little endian before forward it.
Signed-off-by: NJefferson Delfes <jefferson.delfes@openbossa.org>
Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
上级 11778716
......@@ -444,7 +444,7 @@ struct mgmt_ev_auth_failed {
struct mgmt_ev_device_found {
struct mgmt_addr_info addr;
__s8 rssi;
__u8 flags[4];
__le32 flags;
__le16 eir_len;
__u8 eir[0];
} __packed;
......
......@@ -3546,9 +3546,9 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
ev->addr.type = link_to_bdaddr(link_type, addr_type);
ev->rssi = rssi;
if (cfm_name)
ev->flags[0] |= MGMT_DEV_FOUND_CONFIRM_NAME;
ev->flags |= MGMT_DEV_FOUND_CONFIRM_NAME;
if (!ssp)
ev->flags[0] |= MGMT_DEV_FOUND_LEGACY_PAIRING;
ev->flags |= MGMT_DEV_FOUND_LEGACY_PAIRING;
if (eir_len > 0)
memcpy(ev->eir, eir, eir_len);
......@@ -3558,6 +3558,7 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
dev_class, 3);
ev->eir_len = cpu_to_le16(eir_len);
ev->flags = cpu_to_le32(ev->flags);
ev_size = sizeof(*ev) + eir_len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册