Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp444140pxb; Wed, 14 Apr 2021 20:50:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxawP3rC59R0Hp3s3ytf8QgKeZjZmY2oNfvx7Y3O6Ti+YR3zUaoo/N9aMYZHf0/gs9QTmYs X-Received: by 2002:a62:1591:0:b029:251:27c2:c185 with SMTP id 139-20020a6215910000b029025127c2c185mr1475522pfv.33.1618458606906; Wed, 14 Apr 2021 20:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618458606; cv=none; d=google.com; s=arc-20160816; b=Dj8YaL7lfRcgkkmuoqza7t+5IXs2KeZrcv5WS4UT5+T+speE60R9g4qmWfMsGjASoH Ya2QiKfKjKwRmDMP5Un2hfCsPaJq2WooJB18NPVPozcaSfg9HPhTBfDsD/KMpIlPD/i2 9P0v+EaStvhDRhc0NV2vbieANQP0vbTQRIaqxuiRNOp847KqV8DFOQiI/EmvIM49SmdJ XFGdau75iExTAR25V52e4+qEjYIV3ikdnX6KTjRaPDD9E0I2qiAgxS6QnunUAaXAQ3iH fldlSJ+8PYIexXDQgBnBfcFO2SdaYlLsCHuC7zA8zFixENd7u9xwCkGHJrT6n94ZDfpO n3Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=FZCSSHtw1WoIqt3XaKyqydiVfHgb9N2SQusHdX7BDVo=; b=bTvWBSF80bYeJE5Ji29VZijSOaR5Vg1AaP0F1pVrjGxFiJh7LlHysqwpXbknagF9XC pPmmZD7osRbfjQ/Vn/zCrrJ6l6SUzhqjXWX5gVKk6tLDmzxf7ooEH9wW790S+ML10qL3 J1deRbxmGHlrlqJv2TC1v6gYC/3m08oeqqJTbBdbMUcwe7xXNojO5roknnYBxgilPbsq a9CU2zbcriExIM6soZRiPdpxv1/txGCGbjHQHKOVDRYRdCHcHFKzgM0LOhUzh/jalxss tTaS7Df03Ig7a2La1dZITq9h/olLG4ZMrXVXeL3Peu5gdGTMQbaLsnmuKx44GHAkYc8h ndQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aQb9tWM4; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k13si1801222plk.217.2021.04.14.20.49.34; Wed, 14 Apr 2021 20:50:06 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=aQb9tWM4; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229457AbhDODsc (ORCPT + 99 others); Wed, 14 Apr 2021 23:48:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbhDODsc (ORCPT ); Wed, 14 Apr 2021 23:48:32 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8D91C061574 for ; Wed, 14 Apr 2021 20:48:08 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id w8so28365912lfr.0 for ; Wed, 14 Apr 2021 20:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FZCSSHtw1WoIqt3XaKyqydiVfHgb9N2SQusHdX7BDVo=; b=aQb9tWM4TXoxN+blGBXFDvpHf632nGMryqeAP9DQzrK6daDrVeU0YAHPJE/bqo6gMG socD0dFKGXBsMFN5kSkATkh35DigDaQ1AESHZD4ezZtoAVas0Y6UcsEgUbGL5bEJLU3b +bSAsSu825z2FjsKjqiEc65UZeUzUKgM9Ji8b+D9V6/dAHoNX8KJ4hjvOGb7o0YgxrgY jvfQloFvQHejZEaGb49wHBCLfBJbjF5f7Vg6yeKeVBh4KMHN/Dt3D9JuVT1PoaEMBuvb o0vHQF/kImxqRZe/8QW4QnkDtiSSeIIAb55r/I+5cJAmmBxzOYxPGMK5C1LVp/VfxRrp Rqhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FZCSSHtw1WoIqt3XaKyqydiVfHgb9N2SQusHdX7BDVo=; b=kzXN7FAO2KF7PD/1BOYWKKXcuHLCborkZgDWiHRONsgktCwIfl0RDqYmdIFz9TxB13 +6kCkJdFI4yNRvNJi45Xwb6XwM4fdFU7QhF3wFd3gmxeYIbddeHiMlF01hiyJ+VkrZ3F 2hifVo3ol2UWRBm/kf3+DsDvSePRiUDvuodGscqeU70E13WY2buJULcChnDVO3jXDEVC XP7SRfBcp++kUsGrean+l8by9AJgfpaOhbc5YdD1dIHjKLbxd4TBY7yOD8rOfx8KrBfz Tu+E+pwuI8oI5yTvzc7vyFg19Rbv02cEppOovhD7D0VHSRD7Iodp9eS/kRVDPQqB3tTV 4JdQ== X-Gm-Message-State: AOAM530XZJPnq3IDa/56/HBQGr1TYgrHDrk2juvqPG7twyrfT9Fp7i6O 6WQytN1QRSHr6EGzxo480y6E2nlP1QvXefsiiDBt1bI7vfKuiads X-Received: by 2002:a19:ee13:: with SMTP id g19mr973345lfb.451.1618458486772; Wed, 14 Apr 2021 20:48:06 -0700 (PDT) MIME-Version: 1.0 References: <20210414043857.371176-1-hj.tedd.an@gmail.com> <6D9FBA0A-3058-4C96-8CFD-6BE5B585DE8E@holtmann.org> <34494443-5CE2-40F1-95DF-EF05914BD741@intel.com> In-Reply-To: <34494443-5CE2-40F1-95DF-EF05914BD741@intel.com> From: Archie Pusaka Date: Thu, 15 Apr 2021 11:47:55 +0800 Message-ID: Subject: Re: [BlueZ] monitor: Fix the incorrect vendor name To: "An, Tedd" Cc: Marcel Holtmann , "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Tedd, On Thu, 15 Apr 2021 at 10:26, An, Tedd wrote: > > Hi Marcel, > > =EF=BB=BFOn 4/14/21, 3:09 AM, "Marcel Holtmann" wro= te: > > Hi Tedd, > > > This patch fixes the vendor name is alwasy shown as "Microsoft" eve= n > > 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(in= t 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 =3D index_list[index_current].manufacturer; > > - msft_opcode =3D index_list[index_current].msft_opcode; > > - } else { > > + else > > manufacturer =3D fallback_manufacturer; > > - msft_opcode =3D BT_HCI_CMD_NOP; > > - } > > - > > - if (msft_opcode !=3D BT_HCI_CMD_NOP) > > - return "Microsoft"; > > seems we have a bug here, but the fix can not be correct either. If w= e are running on Intel firmware and the Microsoft extension is used, it sho= uld 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 R= ealtek. (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. localhost ~ # hcitool cmd 0x3f 0xf0 0x00 < HCI Command: ogf 0x3f, ocf 0x00f0, plen 1 00 > HCI Event: 0x0e plen 22 02 F0 FC 00 00 3F 00 00 00 00 00 00 00 08 23 79 54 33 77 88 97 68 > I changed the v2 to RFC for your further comments. > > Regards > > Marcel > > Regards, > Tedd > Cheers, Archie