Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp662599ybl; Fri, 30 Aug 2019 05:26:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTqzORG7TqVg7nL17Ncc9oYS3nVs+QC9y8QuecgzGwIAcGJKp4FRyWvJsQHzu0LIdAM3/v X-Received: by 2002:a65:68c8:: with SMTP id k8mr12627827pgt.192.1567167993043; Fri, 30 Aug 2019 05:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567167993; cv=none; d=google.com; s=arc-20160816; b=qekNxXpcAyPudmlbskXDScfN9SZ4rESUcaX2ZsdVs3QnBxmL1Uv5UoVTfofLaCyTKu db5299A1uJs/rlQQiyTKp9p8TwwCBu8Lv30gAIdPPPZmOyumPXWPtcZJWqlY+os2xDSL tKDyTrM8hHEWMuvSMZz1kfHVAe5etqDlHBld9hIgwlDpHkiSU+PZ4OFDrNxqlw5JtZ+c JEVjy28V65Hv3E4k8fBsD5TnTeDlzW9R3au497CvID72osbJAJklZkEuBN+aQspSRqr4 gWd+qoGCkCM/x1jZUBWNjvN+QHukA23MR1B+PsnjYx+FoElp/fleh5cRTEG57YEHJMfy gVCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:authenticated-by; bh=dQCbLco6iyiFFs3foSkRLIR/LkjfvzsHq6d9IeYoNjY=; b=MYreGyNf+UoYUSRTUEM6ZP/EQ5IzT2VgpLqvHwIMkQge0Mvz0UaZ03syLus8leArvL +5mGQaKkIckn15yjdZFIeBFKJ18+0Lb7+i4bswaV/WqgAPp1ljlzneRWNzRS088Zkppy s2G05+5W9u0fJO6liQ5avovdOCADMlgZ6ln5Mgx16wjxuxzCRCoQraSHtRYzD4pcA8am rOLRlGx0WFtMzJc1viu/CfwaErbnnbInuF15yjm5g3zjBCU9gO4kiVw/yiaR6fMN+XVo +gRiT0+6nWVn81Dy1ES/uwGLZxdxZvmpvdd/bZZTlv0EB2xfddudCBAGIiaYNiwbnlOV jg2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z9si5651794pfr.104.2019.08.30.05.26.17; Fri, 30 Aug 2019 05:26:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727887AbfH3MZW (ORCPT + 99 others); Fri, 30 Aug 2019 08:25:22 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:55690 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727751AbfH3MZW (ORCPT ); Fri, 30 Aug 2019 08:25:22 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x7UCPFGC027683, This message is accepted by code: ctloc85258 Received: from RS-CAS02.realsil.com.cn (ms1.realsil.com.cn[172.29.17.3](maybeforged)) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x7UCPFGC027683 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 30 Aug 2019 20:25:15 +0800 Received: from laptop-alex (172.29.36.155) by RS-CAS02.realsil.com.cn (172.29.17.3) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 30 Aug 2019 20:05:45 +0800 Date: Fri, 30 Aug 2019 20:05:30 +0800 From: Alex Lu To: Marcel Holtmann CC: Johan Hedberg , , , Max Chou Subject: [PATCH 2/2] Bluetooth: btrtl: Add firmware version print Message-ID: <20190830120530.GA3299@laptop-alex> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [172.29.36.155] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Lu This patch is used to print fw version for debug convenience Signed-off-by: Alex Lu --- drivers/bluetooth/btrtl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c index b7487ab99eed..7219eb98d02d 100644 --- a/drivers/bluetooth/btrtl.c +++ b/drivers/bluetooth/btrtl.c @@ -151,6 +151,8 @@ static const struct id_table ic_id_table[] = { .cfg_name = "rtl_bt/rtl8822b_config" }, }; +static struct sk_buff *btrtl_read_local_version(struct hci_dev *hdev); + static const struct id_table *btrtl_match_ic(u16 lmp_subver, u16 hci_rev, u8 hci_ver, u8 hci_bus) { @@ -368,6 +370,8 @@ static int rtl_download_firmware(struct hci_dev *hdev, int frag_len = RTL_FRAG_LEN; int ret = 0; int i; + struct sk_buff *skb; + struct hci_rp_read_local_version *rp; dl_cmd = kmalloc(sizeof(struct rtl_download_cmd), GFP_KERNEL); if (!dl_cmd) @@ -406,6 +410,18 @@ static int rtl_download_firmware(struct hci_dev *hdev, data += RTL_FRAG_LEN; } + skb = btrtl_read_local_version(hdev); + if (IS_ERR(skb)) { + ret = PTR_ERR(skb); + rtl_dev_err(hdev, "read local version failed"); + goto out; + } + + rp = (struct hci_rp_read_local_version *)skb->data; + rtl_dev_info(hdev, "rtl: fw version 0x%04x%04x", + __le16_to_cpu(rp->hci_rev), __le16_to_cpu(rp->lmp_subver)); + kfree_skb(skb); + out: kfree(dl_cmd); return ret; -- 2.21.0