Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1544815pxb; Fri, 24 Sep 2021 06:57:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDCnv/rS8oeyWxt1nT0WPY/Jg9IT8bs/0ND8BvXGrpjk2/PW7wICnOcl+GxXYt85GDz9xy X-Received: by 2002:a17:907:2633:: with SMTP id aq19mr11533672ejc.534.1632491820986; Fri, 24 Sep 2021 06:57:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632491820; cv=none; d=google.com; s=arc-20160816; b=xtBH9NwUV9lvydqs0Ol0wJ+R6Ya0l4lf8hCy+0aFrwzr6BmW6TaYTLTkdyPQiSBfB5 Ec2FDIrbxcfZgyySOf1rkt9RowfN6uWkgJFU5F/msLJ3D5v1iEKCmP3N0BmatTbL1vXN tBy8m+xHAhmTqljYU3LBVzyKad27w1wHPBkGY2nrYwGn5oNF+i/LbUOA+4CyKrqcannz hmz/Kgwe6I8Ce2FFZYbe5zmpvHtwrV7uXZ+LgdEik0RIw/XF+GkImaFgV5jZMWx3vT7M fl+/kUkwZB+uIglYP0mb0JB8UjarUfb4sbRGNlglW250M7QMzLkhkx7GXyBLrpQ6RkSc B6vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Kz5TrqcLU+ze8Yfi6qwiX1dvpIqN0ksd5g5a+3awDeg=; b=NXDb8Z2wGbxvmPgPR4ISx58Dn50czFzvbGa/LP3kH7aQjH79vi2l0SLCtUo6DBoJVh 5s0+BuU3I6QIABd5IHhHUuH17mcXk5pUygMZzmPG5jSwEjsZS1O+FN6eocc5bjgsMIc7 7WsTn5rlS1f/wM9klvecAEDYw9eXIoyQeyES+Gp42LNZ13NOkoP2n6JB6nSI+ePtnC3E 0zsfAAi+GBxjmyNAuknGxKMjF9/uuxL5FrLRIffB5aFiAr2NlYynEFwJHyO+CVl9f3kk R79W7itDkph3YplUg9dffIxAyiVcDMtPvb0qX6zR0xg0NeluqC1Ov5GiYRs8vj8rGdSn PtDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IGX6xsmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si9268331eds.333.2021.09.24.06.56.31; Fri, 24 Sep 2021 06:57:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IGX6xsmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240807AbhIXN4N (ORCPT + 99 others); Fri, 24 Sep 2021 09:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234616AbhIXN4K (ORCPT ); Fri, 24 Sep 2021 09:56:10 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2D53C061613 for ; Fri, 24 Sep 2021 06:54:37 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id pf3-20020a17090b1d8300b0019e081aa87bso7644906pjb.0 for ; Fri, 24 Sep 2021 06:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=Kz5TrqcLU+ze8Yfi6qwiX1dvpIqN0ksd5g5a+3awDeg=; b=IGX6xsmxueczgFJR3x6mOdbU7KRPAnhnANNs+jc6CmAmQjVc2LlFTYhDk4c5eY9WSO mZxc+Uhoyr/PuybtyIxgtyOFIw/cTdm5nzqbZ1rcuPlv4TBJgI2cgl+cg3k3P85+5xqL UxeH7QhnVUDCEyORBzEnNLgW3IfN/8p+/hpcQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Kz5TrqcLU+ze8Yfi6qwiX1dvpIqN0ksd5g5a+3awDeg=; b=IyXlkS9hs2lC5mMfBoa+4/xW5W/MEGCMy3W85cg6Pf1cjiTrrz38VGV5eWbpXGSWZM pHutDdNHrYceMIdbP8Jaj3UVR3kZIfFqOBN0K+f5KJvgSVLOV9GuuEBl+c1tYjtttCgP q1hBdvpjxmiTKaQY0dKfVHec3jyvx0G7rthCf+qizxQ/xZQQPieFPzGoea77hSGP1ljc 6j2r9aRbEbGCKKrInB8jC88XuJPsI6xKZ4azuFiA/WxFhG5FugBYoImT7r2rwEp/gxsP S3H/xOQ3BPqpa1X1vnwyR393x8dpmxJrBXP8TJq0XDXwz53D1x6TADnaSuJP/ThEP6tW NSgQ== X-Gm-Message-State: AOAM530CWxtWpeqvFsF9jDmKlQqskXVndoJmUjvn0HWPH5aPUiS3nOO/ 85wz6cOSpLmcwgJFDUAQHhf+jw== X-Received: by 2002:a17:90a:130f:: with SMTP id h15mr2428449pja.183.1632491677501; Fri, 24 Sep 2021 06:54:37 -0700 (PDT) Received: from localhost ([2620:15c:202:201:973:9109:7e32:e4da]) by smtp.gmail.com with UTF8SMTPSA id n26sm9509706pfo.19.2021.09.24.06.54.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Sep 2021 06:54:37 -0700 (PDT) Date: Fri, 24 Sep 2021 06:54:35 -0700 From: Matthias Kaehlcke To: Marcel Holtmann Cc: Zijun Hu , Johan Hedberg , Luiz Augusto von Dentz , open list , linux-bluetooth , linux-arm-msm@vger.kernel.org, bgodavar@codeaurora.org, c-hbandi@codeaurora.org, hemantg@codeaurora.org, rjliao@codeaurora.org, tjiang@codeaurora.org Subject: Re: [PATCH v10] Bluetooth: btusb: Add support using different nvm for variant WCN6855 controller Message-ID: References: <1631614096-24613-1-git-send-email-zijuhu@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 24, 2021 at 12:10:41PM +0200, Marcel Holtmann wrote: > Hi Zijun, > > > the RF performance of wcn6855 soc chip from different foundries will be > > difference, so we should use different nvm to configure them. > > > > Signed-off-by: Zijun Hu > > --- > > drivers/bluetooth/btusb.c | 50 +++++++++++++++++++++++++++++++++++------------ > > 1 file changed, 37 insertions(+), 13 deletions(-) > > > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > > index 928cbfa4c42d..6dc645698e30 100644 > > --- a/drivers/bluetooth/btusb.c > > +++ b/drivers/bluetooth/btusb.c > > @@ -3161,6 +3161,9 @@ static int btusb_set_bdaddr_wcn6855(struct hci_dev *hdev, > > #define QCA_DFU_TIMEOUT 3000 > > #define QCA_FLAG_MULTI_NVM 0x80 > > > > +#define WCN6855_2_0_RAM_VERSION_GF 0x400c1200 > > +#define WCN6855_2_1_RAM_VERSION_GF 0x400c1211 > > + > > struct qca_version { > > __le32 rom_version; > > __le32 patch_version; > > @@ -3192,6 +3195,7 @@ static const struct qca_device_info qca_devices_table[] = { > > { 0x00000302, 28, 4, 16 }, /* Rome 3.2 */ > > { 0x00130100, 40, 4, 16 }, /* WCN6855 1.0 */ > > { 0x00130200, 40, 4, 16 }, /* WCN6855 2.0 */ > > + { 0x00130201, 40, 4, 16 }, /* WCN6855 2.1 */ > > }; > > > > static int btusb_qca_send_vendor_req(struct usb_device *udev, u8 request, > > @@ -3346,6 +3350,31 @@ static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev, > > return err; > > } > > > > +static void btusb_generate_qca_nvm_name(char *fwname, > > + size_t max_size, > > + struct qca_version *ver, > > + char *variant) > > +{ > > you are really not listening to review feedback. Use “const char *variant”. Yeah, also as I mentioned earlier, this function has all the information to determine the variant itself, there is no need to clutter btusb_setup_qca_load_nvm() and the interface of this function with variant stuff, it should be internal business of btusb_generate_qca_nvm_name(). > > > + char *sep = (strlen(variant) == 0) ? "" : "_"; > > This is crazy. It can also go away if the function determines the variant itself.