Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4336402ybg; Mon, 8 Jun 2020 05:27:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP5gIIb3KtuAiG1ozD2iRbP8vZEUCaxXaADsm6sAQkhe1eckcJVv3GhiUgn+s7A+vwmNhz X-Received: by 2002:a17:906:f2c2:: with SMTP id gz2mr13265999ejb.260.1591619270783; Mon, 08 Jun 2020 05:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591619270; cv=none; d=google.com; s=arc-20160816; b=yyQMt0ZRuQ3sM7YhKZahEuGQec7b00GU9sj3rTamDAIRiGfOJBen0y0v0PmhRTatUs HkzsO2aM380iy5VkUi6KP8cUbo0ToxQEQixLYtkq5eKZy79GPsuGrWGYRiTtEPzdNvxP W3hCE/3HUaB4vHnoSsNqdMzCrTF28F/oGFfVpD4tOWpfCNlfxOwJLhxHoAkVXbwObmXN BoXf1PkdvnCwlTe5emkUGH66CfQ5gYdjPs1hOSqqI4rGmtIgIgBcNoZcyHUlGRsn+2LU TQOFdfmfWkwIvIjLXC2iqY5nqmMQXo8nXZpkB0cSm6bpLke6W7/dRx61U+RHmlscfgZ2 olyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:ironport-sdr:ironport-sdr; bh=DCjLCliuFqLyUhXydcGNdRtNcJawyU8vaASH9R3YHZ8=; b=TExaxxfj5paGilU5Q4iPpqJW8t10yDVRt2Y1QBRyshM6DvJQGfOaHtjTNV8th+Ooyr AERyoqPJOmIPnTH9Fq2v7FHxO+sLKK+/lYZdQ3ojwjC0Zfdg3HeQBnNS16cLU/AvYo0b dZfzpANEhoPPvyEIRlFsCekKUA+GIBpJPGBxKGrw9KPGOjsuWgxp0s5zVVYiXuS0/8zk HiF2YSLF62UtZ7j+Qy8Rq4Ux5yx0EvfGgV74aM0IRIauEZ6qgH0O2Aze/JLdfeqn8ofH oo14lln9Py3lZQayooJL7SdWRv5EGtAYJulco7yVMjeYa+GDKkIL+6zuL+MBqptrAMn6 cIQA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si8675326edn.352.2020.06.08.05.27.17; Mon, 08 Jun 2020 05:27:50 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729745AbgFHM1E (ORCPT + 99 others); Mon, 8 Jun 2020 08:27:04 -0400 Received: from mga04.intel.com ([192.55.52.120]:42400 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729741AbgFHM1E (ORCPT ); Mon, 8 Jun 2020 08:27:04 -0400 IronPort-SDR: ptxMuvMXS6KjsowJ4LW6k7gk7DY2p1z5cqg9LBcyD//PWVQl6G/6QVmCkVOZbpd9r+rvf/rlKM pY7JK8dd0DDg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2020 05:27:03 -0700 IronPort-SDR: 5bj2ltmlxAmLZKQ7OHj8T2nlpPXOpGfVCE669MxQgDGqYA4NRC2T6nliB6ptofLqbASEhfBxMU 24ZInZKLMNiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,487,1583222400"; d="scan'208";a="313863089" Received: from unknown (HELO intel-Lenovo-Legion-Y540-15IRH-PG0.iind.intel.com) ([10.224.186.95]) by FMSMGA003.fm.intel.com with ESMTP; 08 Jun 2020 05:27:01 -0700 From: Kiran K To: linux-bluetooth@vger.kernel.org Cc: ravishankar.srivatsa@intel.com, kiraank@gmail.com, Chethan T N , Ps AyappadasX , Kiran K Subject: [PATCH v3 2/2] Bluetooth : Config debug feature based on available support Date: Mon, 8 Jun 2020 17:57:47 +0530 Message-Id: <20200608122747.10714-2-kiran.k@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200608122747.10714-1-kiran.k@intel.com> References: <20200608122747.10714-1-kiran.k@intel.com> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Chethan T N This patch shall enable the Intel telemetry exception format based on the supported features Signed-off-by: Chethan T N Signed-off-by: Ps AyappadasX Signed-off-by: Kiran K --- drivers/bluetooth/btintel.c | 27 +++++++++++++++++++++++++++ drivers/bluetooth/btintel.h | 9 +++++++-- drivers/bluetooth/btusb.c | 2 ++ 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index cb7d62883b18..f9463f0c3ee2 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -787,6 +787,33 @@ int btintel_read_debug_features(struct hci_dev *hdev, } EXPORT_SYMBOL_GPL(btintel_read_debug_features); +int btintel_config_debug_features(struct hci_dev *hdev, + const struct intel_debug_features *features) +{ + struct sk_buff *skb; + u8 mask_ddc[11] = { 0x0a, 0x92, 0x02, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; + + if (!features) + return -EINVAL; + + if (!(features->page1[0] & 0x3f)) { + bt_dev_info(hdev, "Telemety exception format not supported"); + return 0; + } + + skb = __hci_cmd_sync(hdev, 0xfc8b, 11, mask_ddc, HCI_INIT_TIMEOUT); + if (IS_ERR(skb)) { + bt_dev_err(hdev, "Setting Intel telemetry ddc write event mask failed (%ld)", + PTR_ERR(skb)); + return PTR_ERR(skb); + } + + kfree_skb(skb); + return 0; +} +EXPORT_SYMBOL_GPL(btintel_config_debug_features); + 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 7cd813fc5db4..63743b89dad9 100644 --- a/drivers/bluetooth/btintel.h +++ b/drivers/bluetooth/btintel.h @@ -92,10 +92,10 @@ int btintel_read_boot_params(struct hci_dev *hdev, int btintel_download_firmware(struct hci_dev *dev, const struct firmware *fw, u32 *boot_param); void btintel_reset_to_bootloader(struct hci_dev *hdev); - int btintel_read_debug_features(struct hci_dev *hdev, struct intel_debug_features *features); - +int btintel_config_debug_features(struct hci_dev *hdev, + const struct intel_debug_features *features); #else static inline int btintel_check_bdaddr(struct hci_dev *hdev) @@ -201,4 +201,9 @@ static inline int btintel_read_debug_features(struct hci_dev *hdev, return -EOPNOTSUPP; } +static inline int btintel_config_debug_features(struct hci_dev *hdev, + const struct intel_debug_features *features) +{ + return -EOPNOTSUPP; +} #endif diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 1d36141ebe65..b1573004ffac 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2547,6 +2547,8 @@ static int btusb_setup_intel_new(struct hci_dev *hdev) */ btintel_read_debug_features(hdev, &debug_features); + btintel_config_debug_features(hdev, &debug_features); + /* Read the Intel version information after loading the FW */ err = btintel_read_version(hdev, &ver); if (err) -- 2.17.1