From 9cc327f59d73357e953cc3f6d5b19daac1c1f54b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 6 May 2020 01:26:58 +0200 Subject: [PATCH] monitor: Set msft_opcode for Microsoft vendor extension Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- monitor/packet.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/monitor/packet.c b/monitor/packet.c index 252a690..07ee067 100755 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -274,7 +274,8 @@ struct index_data { uint8_t type; uint8_t bdaddr[6]; uint16_t manufacturer; - size_t frame; + uint16_t msft_opcode; + size_t frame; }; static struct index_data index_list[MAX_INDEX]; @@ -3899,6 +3900,7 @@ void packet_monitor(struct timeval *tv, struct ucred *cred, index_list[index].type = ni->type; memcpy(index_list[index].bdaddr, ni->bdaddr, 6); index_list[index].manufacturer = fallback_manufacturer; + index_list[index].msft_opcode = BT_HCI_CMD_NOP; } addr2str(ni->bdaddr, str); @@ -3959,6 +3961,15 @@ void packet_monitor(struct timeval *tv, struct ucred *cred, if (index < MAX_INDEX) { memcpy(index_list[index].bdaddr, ii->bdaddr, 6); index_list[index].manufacturer = manufacturer; + + if (manufacturer == 2) { + /* + * All Intel controllers that support the + * Microsoft vendor extension are using + * 0xFC1E for VsMsftOpCode. + */ + index_list[index].msft_opcode = 0xFC1E; + } } addr2str(ii->bdaddr, str); -- 2.7.4