monitor: Set msft_opcode for Microsoft vendor extension
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 5 May 2020 23:26:58 +0000 (01:26 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:49 +0000 (14:30 +0530)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
monitor/packet.c

index 252a69014e10cd357f07ebf8718a37561cf56587..07ee0676699f64dd4dbe8886b2dfb6a0cf895ade 100755 (executable)
@@ -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);