Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6976585pxv; Fri, 30 Jul 2021 07:10:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBWaq/h5Rn5XcvZn7FGfRWnk762FpiyS7vK5azHdSs5XMaXyq+qViCQMh2y4YMleoRaG45 X-Received: by 2002:a92:7d08:: with SMTP id y8mr2061371ilc.111.1627654258581; Fri, 30 Jul 2021 07:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627654258; cv=none; d=google.com; s=arc-20160816; b=aYfV38+f4xbXr3L+Cto8Sjx6Bs73d1ncB9EwRhU0dH3vgwgNnwti1HGkYP1oPlVmO/ 0QxCQjKreqYeEG7hMKTmSyT+8nF1Peey6rfof2jRL0s7Gq4OumUwk7aYZ0DYu2rsH24i uyvjM2WOTWkWL0eoyvBfWux3d0t93SaUzRWrtFcLRKJOzSXqIKz5uFJ0joSJY7JM432w uc6JIvWkMnbxNrCEtw2i0i2gjvCbSP1g/Qb8X6GB3FswKb2Aol6qOUMZfP/eZ4Hc79mt BfOK2aJw80ae37ez8tlxe4qyF9wV2Tow8UHSH8hkGn4ESAdHh2UAT2r+f1oj96ai8wV6 cWQQ== 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=k4RiHniuJd0zcdpdNJ1VQanqJ2oBrE4Nh8Bdh/Ih9O4=; b=wMLbNnxCMvrwipAfTQQQBjtBgi6xzHedIkW76giGqkspVNwXMUcQYqRiYJopRTdiiP 8Aq4ItGdL0qkbT8p3sbBXa2nPSm0pxGxhIQ9nwHre9Ef3RlER8nISTNLrdLNN0uncMEY X1RHJoOuHAfjujoDBfW7B8J1MK27m8O1SQNA1yat4PCfjXA33mBx0wAIT4CNc6kdm3Qh YZ9J04Ojz2gaiIDuyHcSt89qiIFh1VoY2kJpTJ2p/tyjmMFVw1oyLh9XpeS4cYCSnROV e7++UUy75GgTtynUN49ORnXRpswkzcQl+YONAtHlqD+IMui6jsIlgluePJ8jesqsQ6Xu 9C2g== 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 g14si1971953jaj.31.2021.07.30.07.10.46; Fri, 30 Jul 2021 07:10:58 -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 S239126AbhG3OKT convert rfc822-to-8bit (ORCPT + 99 others); Fri, 30 Jul 2021 10:10:19 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:51169 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239107AbhG3OKT (ORCPT ); Fri, 30 Jul 2021 10:10:19 -0400 Received: from smtpclient.apple (p5b3d23f8.dip0.t-ipconnect.de [91.61.35.248]) by mail.holtmann.org (Postfix) with ESMTPSA id 5E752CED2F; Fri, 30 Jul 2021 16:10:13 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Re: [PATCH v11 03/10] Bluetooth: btintel: Read supported offload usecases From: Marcel Holtmann In-Reply-To: <20210727084713.23038-3-kiran.k@intel.com> Date: Fri, 30 Jul 2021 16:10:12 +0200 Cc: linux-bluetooth@vger.kernel.org, ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com Content-Transfer-Encoding: 8BIT Message-Id: <3710CF06-1420-4C39-ADD1-FA39E4909FA9@holtmann.org> References: <20210727084713.23038-1-kiran.k@intel.com> <20210727084713.23038-3-kiran.k@intel.com> To: Kiran K X-Mailer: Apple Mail (2.3654.100.0.2.22) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Kiran, > Read offload usecases supported by controller. > > Signed-off-by: Kiran K > Reviewed-by: Chethan T N > Reviewed-by: Srivatsa Ravishankar > --- > * changes in v11: > - Remove Kconfig related changes > * changes in v10: > - restructure patch to have definition and call of callaback in the > same patch > * changes in v9: > - define a separate patch for core changes > > drivers/bluetooth/btintel.c | 30 ++++++++++++++++++++++++++++++ > drivers/bluetooth/btintel.h | 10 ++++++++++ > drivers/bluetooth/btusb.c | 3 +++ > 3 files changed, 43 insertions(+) > > diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c > index e44b6993cf91..a6b81914766e 100644 > --- a/drivers/bluetooth/btintel.c > +++ b/drivers/bluetooth/btintel.c > @@ -1272,6 +1272,36 @@ int btintel_set_debug_features(struct hci_dev *hdev, > } > EXPORT_SYMBOL_GPL(btintel_set_debug_features); > > +int btintel_configure_offload_usecases(struct hci_dev *hdev) > +{ > + struct sk_buff *skb; > + int err = 0; > + struct intel_offload_usecases *usecases; > + > + skb = __hci_cmd_sync(hdev, 0xfc86, 0, NULL, HCI_INIT_TIMEOUT); > + if (IS_ERR(skb)) { > + bt_dev_err(hdev, "Reading offload usecases failed (%ld)", > + PTR_ERR(skb)); > + return PTR_ERR(skb); > + } > + > + if (skb->len < sizeof(*usecases)) { > + err = -EIO; > + goto error; > + } > + > + usecases = (void *)skb->data; > + > + if (usecases->status) { > + err = -bt_to_errno(skb->data[0]); > + goto error; > + } > +error: > + kfree_skb(skb); > + return err; > +} > +EXPORT_SYMBOL_GPL(btintel_configure_offload_usecases); > + > MODULE_AUTHOR("Marcel Holtmann "); > MODULE_DESCRIPTION("Bluetooth support for Intel devices ver " VERSION); > MODULE_VERSION(VERSION); > diff --git a/drivers/bluetooth/btintel.h b/drivers/bluetooth/btintel.h > index d184064a5e7c..45ca5c4ccf37 100644 > --- a/drivers/bluetooth/btintel.h > +++ b/drivers/bluetooth/btintel.h > @@ -132,6 +132,11 @@ struct intel_debug_features { > __u8 page1[16]; > } __packed; > > +struct intel_offload_usecases { > + __u8 status; > + __u8 preset[8]; > +} __packed; > + > #define INTEL_HW_PLATFORM(cnvx_bt) ((u8)(((cnvx_bt) & 0x0000ff00) >> 8)) > #define INTEL_HW_VARIANT(cnvx_bt) ((u8)(((cnvx_bt) & 0x003f0000) >> 16)) > #define INTEL_CNVX_TOP_TYPE(cnvx_top) ((cnvx_top) & 0x00000fff) > @@ -175,6 +180,7 @@ int btintel_read_debug_features(struct hci_dev *hdev, > struct intel_debug_features *features); > int btintel_set_debug_features(struct hci_dev *hdev, > const struct intel_debug_features *features); > +int btintel_configure_offload_usecases(struct hci_dev *hdev); so usecases is not, it would be offload_use_cases. However btintel_configure_offload is just fine as a function name. With the work from Tedd, this would be removed anyway and all done internally via the hdev->setup(). Regards Marcel