Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4956283ybb; Tue, 24 Mar 2020 08:20:37 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtrpDREcwv9bpK2l/SYbYq24qu9Itu3f8mzMLIWbIomupjg4n3zgSTMa93QLlz/2xL5TOn5 X-Received: by 2002:a4a:9cc9:: with SMTP id d9mr504595ook.91.1585063236844; Tue, 24 Mar 2020 08:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585063236; cv=none; d=google.com; s=arc-20160816; b=t5kF6GLofVGculHQgyglv70z6McSd6JRe4L0f1J3mD6rRTJDUEqnv7nWzuV3EPvYTF AYyIXLWG/7I2fplUEOoZ5/fw3hzvwCRnSQV9rBYaHCo3AAdIagAlQ5uHmRUd0RORYtPB zovz96RKmralagAPN59bA+V30ffPzu9MGEdstOUgtL0BTAY6WKBZdI+l/bBRkBDts5q/ OswQ1ohCuzWhXIa/O0KcMZqmClrXMyAlWHWtDzE6b2L+XYFakfZAzBYPcDvKqfE8CWif VJVrIdq53jqcyyHuONSmuyiHDcxRnVDZFFYw4n8As+AkrXltM5N0Yq+lF5GTViGL/I5k WKIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=jvYC3UJmjaA3xitsm1baGPk7K/ak6ZEtZLDiW0Hb3kM=; b=xaxhosOSWyOUB+zV+2ExtXtb7zRvfzrlKSLyLy5c4S7py5q/dE0XwgLTd8NHWwX1qc HpM0u33N6q+5cfdsAGG64tP8qieBqYIVQv3uWpVcsBkMwlkxb7RlLE5kDzMo82DdO8cl 6h+xdvQg+PcIsEnKYM++ibLmRyPaapeF3InOifMcRArkFeYokuWHqot7mjPTa1/H2WDM /bhXjijvrhH8HSgfPHy+WRrytGnTneWxWpVIfKxv5S4OoeYVvImDjG+uEFrwXBc9M1d8 82Q9kqmzikgt8hEJJe1MWPF4+1RGbYlkXxhJs/GaapUzT01E4zS6gY8Rzn1Hq3G5Qjd7 zPZA== 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 t19si9541119oif.250.2020.03.24.08.20.21; Tue, 24 Mar 2020 08:20:36 -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 S1728150AbgCXPTR (ORCPT + 99 others); Tue, 24 Mar 2020 11:19:17 -0400 Received: from smtprelay0081.hostedemail.com ([216.40.44.81]:39096 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727561AbgCXPTR (ORCPT ); Tue, 24 Mar 2020 11:19:17 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 881B2181396EB; Tue, 24 Mar 2020 15:19:15 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2525:2553:2560:2563:2682:2685:2828:2859:2892:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4605:5007:6117:6691:7688:7875:7903:8957:9025:9121:10004:10400:10471:10848:11026:11232:11658:11914:12043:12295:12296:12297:12438:12740:12760:12895:13019:13255:13439:14096:14097:14180:14181:14659:14721:21060:21080:21627:30054:30055:30060:30075:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: arch16_165b868a3cd01 X-Filterd-Recvd-Size: 4437 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Tue, 24 Mar 2020 15:19:13 +0000 (UTC) Message-ID: Subject: Re: [PATCH v1 1/2] Bluetooth: btusb: Indicate Microsoft vendor extension for Intel 9460/9560 and 9160/9260 From: Joe Perches To: Alain Michaud Cc: Marcel Holtmann , Miao-chen Chou , Bluetooth Kernel Mailing List , Luiz Augusto von Dentz , Alain Michaud , "David S. Miller" , Jakub Kicinski , Johan Hedberg , LKML , netdev Date: Tue, 24 Mar 2020 08:17:23 -0700 In-Reply-To: References: <20200323072824.254495-1-mcchou@chromium.org> <20200323002820.v1.1.I0e975833a6789e8acc74be7756cd54afde6ba98c@changeid> <04021BE3-63F7-4B19-9F0E-145785594E8C@holtmann.org> <421d27670f2736c88e8c0693e3ff7c0dcfceb40b.camel@perches.com> <57C56801-7F3B-478A-83E9-1D2376C60666@holtmann.org> <03547be94c4944ca672c7aef2dd38b0fb1eedc84.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Tue, 2020-03-24 at 11:10 -0400, Alain Michaud wrote: > On Mon, Mar 23, 2020 at 4:11 PM Joe Perches wrote: > > On Mon, 2020-03-23 at 19:48 +0100, Marcel Holtmann wrote: > > > Hi Joe, > > > > Hello Marcel. > > > > > > > > This adds a bit mask of driver_info for Microsoft vendor extension and > > > > > > indicates the support for Intel 9460/9560 and 9160/9260. See > > > > > > https://docs.microsoft.com/en-us/windows-hardware/drivers/bluetooth/ > > > > > > microsoft-defined-bluetooth-hci-commands-and-events for more information > > > > > > about the extension. This was verified with Intel ThunderPeak BT controller > > > > > > where msft_vnd_ext_opcode is 0xFC1E. > > > > [] > > > > > > diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h > > > > [] > > > > > > @@ -315,6 +315,10 @@ struct hci_dev { > > > > > > __u8 ssp_debug_mode; > > > > > > __u8 hw_error_code; > > > > > > __u32 clock; > > > > > > + __u16 msft_vnd_ext_opcode; > > > > > > + __u64 msft_vnd_ext_features; > > > > > > + __u8 msft_vnd_ext_evt_prefix_len; > > > > > > + void *msft_vnd_ext_evt_prefix; > > > > > > > > msft is just another vendor. > > > > > > > > If there are to be vendor extensions, this should > > > > likely use a blank line above and below and not > > > > be prefixed with msft_ > > > > > > there are other vendors, but all of them are different. So this needs to be prefixed with msft_ actually. But I agree that having empty lines above and below makes it more readable. > > > > So struct hci_dev should become a clutter > > of random vendor extensions? > > > > Perhaps there should instead be something like > > an array of char at the end of the struct and > > various vendor specific extensions could be > > overlaid on that array or just add a void * > > to whatever info that vendors require. > I don't particularly like trailing buffers, but I agree we could > possibly organize this a little better by with a struct. something > like: > > struct msft_vnd_ext { > bool supported; // <-- Clearly calls out if the > extension is supported. > __u16 msft_vnd_ext_opcode; // <-- Note that this also > needs to be provided by the driver. I don't recommend we have this > read from the hardware since we just cause an extra redirection that > isn't necessary. Ideally, this should come from the usb_table const. > __u64 msft_vnd_ext_features; > __u8 msft_vnd_ext_evt_prefix_len; > void *msft_vnd_ext_evt_prefix; > }; > > And then simply add the struct msft_vnd_ext (and any others) to hci_dev. Or use an anonymous union