Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2999432ybb; Sun, 5 Apr 2020 23:15:14 -0700 (PDT) X-Google-Smtp-Source: APiQypK6LVUb4UkhuupDwY8SJOwPaelxXPkZhVt9jleq92D82gbL1wgdJyw40REkLidl7U9kHeUw X-Received: by 2002:a05:6830:15d4:: with SMTP id j20mr16112338otr.303.1586153714362; Sun, 05 Apr 2020 23:15:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586153714; cv=none; d=google.com; s=arc-20160816; b=fHlfPmpdAJbc+Fe2MELc4UVwIrNq/HFyvfehGEPM/5JdsEbkMJyLHjkkqjVQ+e4TbG MoF8KTMw1t6wPWtNTnu++0cLvUNZyfKYCPDvg0PjfnaYc+MPLYdK/QMg3qsfnAEAwGaW XtTpsphgMdlo9v/CJANnt08L4QAHMyq2RrT2q0fP4Z4M9tB26zaTckZP579f+QqWwBap tSDRUBaQNxt229MtTehuYEUUHlmb2U/3eAqd2sNaFpaObeHiAFnojzjRtAkYcfVCtCgJ zpX13Kx9SmegntjOLWK4eDFgB/lTiLM6KJXaV65mcJkL8b3xkZcbeuzlXtawAVYuDUFh vmiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=zahBnPr3ou4l2bQjtaUwvSzFEFTdHIgFJXQqUizuqGA=; b=e80IXUk2hnWbaJ40aZy/FbWzeWgZbpmEMbbwJzefumgdHn/GFm6VXoEiB39g5Fi043 c1eoCaGwxQKWZZBSt38McNdQQG981BAkfvwCyMBzx2D0hGCoLHUgG9/g6wIBwLFWkPpQ IDYWCsOp3bW1XpBumdy54ve3Di6FcnKNKqsmsZ9wwr0MoJa1sFdy4Y7r4oH2iFaSNLqK qLEhWTjIYu5puAglq85yMenFZ9sUfCncVmRFsqudHIa4JeOkxQ4Fc6VnrOSeFPqWzBMp oQt1pOo3kkgqBVL0oDKpTGFk8vo09xpzimLtfYT0ZYN8dt15Bejr3Aw8j/jjZJhEc6Qp /wSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si8142950otg.196.2020.04.05.23.14.44; Sun, 05 Apr 2020 23:15:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726408AbgDFGOo convert rfc822-to-8bit (ORCPT + 99 others); Mon, 6 Apr 2020 02:14:44 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:48383 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbgDFGOn (ORCPT ); Mon, 6 Apr 2020 02:14:43 -0400 Received: from marcel-macbook.fritz.box (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id D7545CED2C; Mon, 6 Apr 2020 08:24:15 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH v5 3/3] Bluetooth: btusb: Indicate Microsoft vendor extension for Intel 9160/9260 From: Marcel Holtmann In-Reply-To: <20200403203058.v5.3.I56c3ba2ec2bcfaadf57575c5c74a03dd4f8487d0@changeid> Date: Mon, 6 Apr 2020 08:14:41 +0200 Cc: Bluetooth Kernel Mailing List , Alain Michaud , Luiz Augusto von Dentz , Johan Hedberg , linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <3361CF04-0C56-4787-9A74-99664DCB4312@holtmann.org> References: <20200404033118.22135-1-mcchou@chromium.org> <20200403203058.v5.3.I56c3ba2ec2bcfaadf57575c5c74a03dd4f8487d0@changeid> To: Miao-chen Chou X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Miao-chen, > This adds a bit mask of driver_info for Microsoft vendor extension and > indicates the support for Intel 9160/9260. This was verified with Intel > ThunderPeak BT controller where msft_opcode is 0xFC1E. > > Signed-off-by: Marcel Holtmann > Signed-off-by: Miao-chen Chou > --- > > Changes in v5: > - Extract the changes on btusb as a different commit. > > Changes in v4: > - Introduce CONFIG_BT_MSFTEXT as a starting point of providing a > framework to use Microsoft extension > - Create include/net/bluetooth/msft.h and net/bluetooth/msft.c to > facilitate functions of Microsoft extension. > > Changes in v3: > - Create net/bluetooth/msft.c with struct msft_vnd_ext defined internally > and change the hdev->msft_ext field to void*. > - Define and expose msft_vnd_ext_set_opcode() for btusb use. > - Init hdev->msft_ext in hci_alloc_dev() and deinit it in hci_free_dev(). > > Changes in v2: > - Define struct msft_vnd_ext and add a field of this type to struct > hci_dev to facilitate the support of Microsoft vendor extension. > > drivers/bluetooth/btusb.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index 3bdec42c96123..f73ad18c04559 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -20,6 +20,7 @@ > > #include > #include > +#include > > #include "btintel.h" > #include "btbcm.h" > @@ -58,6 +59,7 @@ static struct usb_driver btusb_driver; > #define BTUSB_CW6622 0x100000 > #define BTUSB_MEDIATEK 0x200000 > #define BTUSB_WIDEBAND_SPEECH 0x400000 > +#define BTUSB_MSFT_VND_EXT 0x800000 > > static const struct usb_device_id btusb_table[] = { > /* Generic Bluetooth USB device */ > @@ -335,7 +337,8 @@ static const struct usb_device_id blacklist_table[] = { > > /* Intel Bluetooth devices */ > { USB_DEVICE(0x8087, 0x0025), .driver_info = BTUSB_INTEL_NEW | > - BTUSB_WIDEBAND_SPEECH }, > + BTUSB_WIDEBAND_SPEECH | > + BTUSB_MSFT_VND_EXT }, > { USB_DEVICE(0x8087, 0x0026), .driver_info = BTUSB_INTEL_NEW | > BTUSB_WIDEBAND_SPEECH }, > { USB_DEVICE(0x8087, 0x0029), .driver_info = BTUSB_INTEL_NEW | > @@ -3800,6 +3803,12 @@ static int btusb_probe(struct usb_interface *intf, > set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); > set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); > set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks); > + > + /* All Intel controllers that support the Microsoft > + * vendor extension are using 0xFC1E for VsMsftOpCode. > + */ > + if (id->driver_info & BTUSB_MSFT_VND_EXT) > + msft_set_opcode(hdev, 0xFC1E); I decided to actually set the MSFT extension support in the btusb_setup_intel_new handler based on our firmware version information. I think that this will be better than USB products IDs. We can revisit this later, but for now, this should be enough. Johan also applied the whole series and you should base your next steps on bluetooth-next. Regards Marcel