Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp62211pxb; Thu, 15 Apr 2021 22:58:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVXKWD//9delSNc3O4reT+T1tLfA4upg0MmaYzwxcQGUc2469MgxBlM6+hZyWCqLkF8QQi X-Received: by 2002:a17:906:168f:: with SMTP id s15mr6847483ejd.144.1618552726721; Thu, 15 Apr 2021 22:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618552726; cv=none; d=google.com; s=arc-20160816; b=ihIAw0rOi1aELo/x59++Ly3sptwJ6bHKSFInGNMr4HnSgx5QluD8XC0XPMP8a0EYji 6Hd4OesB6E4me+79SscHO6yS5bubQjv7WLcaJDOLFmGpdQCSCnSoq9RR8Kpg11eYzOsY DvIuNOQ7sRfZ/uRyfUMW4aVTO+oQB6Ca5XFCBDB8TLbInJuha0PP9nbJgcYrcnLpOA6T 1ZWDjwO7Hq5BiPPjKwGglD+rkh7+6duIOHWZyDfTE1rnAUK1no5lRQv52usO5w0U4ld0 QIOHUOslcLHiZrWfHUxsiwanTnDrNpr7+IoHrgCU4G5VlY/Ajq9nrTSKND1FcdmDZUeP uBxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=VrJ6cMqRlaiu5MhCNAVtTYij2v5fR9sKxFOBkVoofGg=; b=fTAu2z7unwQBJaXCGi+qe9dsj8fGU7MKUHJ1qBY8qM8XDTii20P4lUXGg0dH1072d0 l1+YkJzINJcr4NynawXGdzZYUe85ccwn/e1vkzxmh3NPdHFCxiO15gD8JYmzeErJVOir li74oIqX7BdikMccHPQfGTahElGWViE9A7U8AkOPuKFLHUFg8v6HkNAs7FfgkrFG2TnP 1LeK68280h8INfaqbvw3l9kfygKyaHyoPEqG9lZEgLPV5L4qEAb+jTDgr6KvHwKKZbWh Wwa+OXX5rwo9Urt0lEuaE9SltHAHUWm7Ujedbuj+/9llGfuc/DqZoHWRoaEu5HFNDAoj XdsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si4073257edc.561.2021.04.15.22.58.04; Thu, 15 Apr 2021 22:58:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229719AbhDPFXy convert rfc822-to-8bit (ORCPT + 99 others); Fri, 16 Apr 2021 01:23:54 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:33629 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbhDPFXx (ORCPT ); Fri, 16 Apr 2021 01:23:53 -0400 Received: from marcel-macbook.holtmann.net (p4ff9f74c.dip0.t-ipconnect.de [79.249.247.76]) by mail.holtmann.org (Postfix) with ESMTPSA id 82FADCED15; Fri, 16 Apr 2021 07:31:11 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: [BlueZ] monitor: Fix the incorrect vendor name From: Marcel Holtmann In-Reply-To: Date: Fri, 16 Apr 2021 07:23:25 +0200 Cc: "An, Tedd" , "linux-bluetooth@vger.kernel.org" Content-Transfer-Encoding: 8BIT Message-Id: <852D4FDC-5A9E-45B0-83AD-95DB203022B0@holtmann.org> References: <20210414043857.371176-1-hj.tedd.an@gmail.com> <6D9FBA0A-3058-4C96-8CFD-6BE5B585DE8E@holtmann.org> <34494443-5CE2-40F1-95DF-EF05914BD741@intel.com> To: Archie Pusaka X-Mailer: Apple Mail (2.3654.60.0.2.21) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Archie, >>> This patch fixes the vendor name is alwasy shown as "Microsoft" even >>> though a different vendor. >>> >>> < HCI Command: Microsoft Secure Send (0x3f|0x0009) plen 249 >>> Type: Data fragment (0x01) >>>> HCI Event: Command Complete (0x0e) plen 4 >>> Microsoft Secure Send (0x3f|0x0009) ncmd 31 >>> Status: Success (0x00) >>> --- >>> monitor/packet.c | 12 +++--------- >>> 1 file changed, 3 insertions(+), 9 deletions(-) >>> >>> diff --git a/monitor/packet.c b/monitor/packet.c >>> index d729a01cc..91d2294ff 100644 >>> --- a/monitor/packet.c >>> +++ b/monitor/packet.c >>> @@ -9325,18 +9325,12 @@ static const char *get_supported_command(int bit) >>> >>> static const char *current_vendor_str(void) >>> { >>> - uint16_t manufacturer, msft_opcode; >>> + uint16_t manufacturer; >>> >>> - if (index_current < MAX_INDEX) { >>> + if (index_current < MAX_INDEX) >>> manufacturer = index_list[index_current].manufacturer; >>> - msft_opcode = index_list[index_current].msft_opcode; >>> - } else { >>> + else >>> manufacturer = fallback_manufacturer; >>> - msft_opcode = BT_HCI_CMD_NOP; >>> - } >>> - >>> - if (msft_opcode != BT_HCI_CMD_NOP) >>> - return "Microsoft"; >> >> seems we have a bug here, but the fix can not be correct either. If we are running on Intel firmware and the Microsoft extension is used, it should show Microsoft and not Intel for the vendor commands. >> >> I submitted v2 and I think I took care of the msft_opcode handling but I realized that the msft_event_opcode is also like msft_opcode - each vendor will have a different value. >> I know the msft_event_code for Intel, which is 0x50, but don't know for Realtek. (Do you happen to know?) > > On my Realtek device the msft_event_code is 8 bytes long: 0x23 0x79 > 0x54 0x33 0x77 0x88 0x97 0x68. I remember having seen different event prefixes for Realtek controllers. However after re-testing it seems to be the same. My latest 5.1 dongle has this: > HCI Event: Command Complete (0x0e) plen 22 Microsoft Extension (0x3f|0x00f0) ncmd 2 Read Supported Features (0x00) Status: Success (0x00) Features: 0x3f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 RSSI Monitoring feature for BR/EDR RSSI Monitoring feature for LE connections RSSI Monitoring of LE advertisements Advertising Monitoring of LE advertisements Verifying the validity of P-192 and P-256 keys Continuous Advertising Monitoring Event prefix length: 8 23 79 54 33 77 88 97 68 And my older 4.2 dongle has this: > HCI Event: Command Complete (0x0e) plen 22 Microsoft Extension (0x3f|0x00f0) ncmd 2 Read Supported Features (0x00) Status: Success (0x00) Features: 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 RSSI Monitoring feature for BR/EDR RSSI Monitoring feature for LE connections RSSI Monitoring of LE advertisements Advertising Monitoring of LE advertisements Event prefix length: 8 23 79 54 33 77 88 97 68 Regards Marcel