Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6431318pxb; Mon, 8 Nov 2021 08:31:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUCSmfKJURSd6C1eLPU4mRPMoZjHht51/f8Wl5BIMKk7KV5LX4RFWEsVmzH3YogY3iqd/p X-Received: by 2002:a5d:5888:: with SMTP id n8mr524133wrf.234.1636389062306; Mon, 08 Nov 2021 08:31:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636389062; cv=none; d=google.com; s=arc-20160816; b=JMtwkSWJRNrIr9Gikei2HEDPVQSgnUCLDqu6QSQPdiXEmDJ/Bos0krQj40nHOnP6fs 3miwxZBKRoZw6IuRmjNF68S6EB6ClBJ3cALSGOrFl3LTG1yQV+d/Dlv+Gpn8Hx0pL5Vp YZ32euy72n6KMntivXgAego38r7nBPYpqSjjAa8sbD2ZUJ50q7MOmoyfp4RoSz1Jsv9D 3hfTjpVbSxlIRVNrUtWVV/QyoaDimqVcZ97mzkV1e/itWVaRmznUGaKSCsSlfF8XnwUM oWR/RjZ6UWkOXGr2JKfxPfX7gv8tUVjocv1SkvbtygXNEoXfXRbts9+WJ8d25ORSBs6l Rd6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dmarc-filter:sender :dkim-signature; bh=A1GF7ciAhzKFLhXNoAxvAUsh4dNzJRLyoFWA/HdTu3Y=; b=DeX/yzYZPdJht79DChlU+zZRhV2foTmaFYVSV2gSAxwG0jzR28TBtydiBB9Zce9G3V 4bQPMvCVAj2FUI5hFsACfVDHkHM1XZIYMrRndTP49elewHmFJE8RbbLwanOBx+ggc7dx AXqWQMatJywuvUwki6sYOCRec2g2+HGAqaP5yyDAoThgTADiCjlSSPs/niw7utGUoo18 W4sMl5qPVnjavxo5bjGX0W6pz+CArGKqyB05qXkWZEoq7bWZrm3lLxdt2lJ76Hzdz6Ej d7f1Ej0eacCRnSY/diwO566Z5nWnnhT8ozbGLIX1ryzEe1AdYrzrvTM95e+BItiik44h lneA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=Rh+cjppP; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 f21si25481117edf.172.2021.11.08.08.30.44; Mon, 08 Nov 2021 08:31:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@mg.codeaurora.org header.s=smtp header.b=Rh+cjppP; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236683AbhKHNSg (ORCPT + 68 others); Mon, 8 Nov 2021 08:18:36 -0500 Received: from m43-7.mailgun.net ([69.72.43.7]:37923 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235636AbhKHNSf (ORCPT ); Mon, 8 Nov 2021 08:18:35 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1636377351; h=Content-Type: MIME-Version: Message-ID: In-Reply-To: Date: References: Subject: Cc: To: From: Sender; bh=A1GF7ciAhzKFLhXNoAxvAUsh4dNzJRLyoFWA/HdTu3Y=; b=Rh+cjppPIQ5Y2aN+PlzoWR62CTi4H9Ic12iX+Ethu1gx2HmjzNCgaWz6cDnYkZSMQm3baD84 7exQGeG87/03nOoeapZcooP0T/V6EHDaXPc1ECZROaNIwjKpv4splrbpYOSO5+Kq5tjqS1qG dGXkxa0zz9IYkzwXK0rrlzRRzKg= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-west-2.postgun.com with SMTP id 618923069198e3b2569ed8d7 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 08 Nov 2021 13:15:50 GMT Sender: kvalo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id CF458C43460; Mon, 8 Nov 2021 13:15:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from tykki (tynnyri.adurom.net [51.15.11.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo) by smtp.codeaurora.org (Postfix) with ESMTPSA id EBE9CC4338F; Mon, 8 Nov 2021 13:15:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 smtp.codeaurora.org EBE9CC4338F Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=codeaurora.org From: Kalle Valo To: Jouni Malinen Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, Wen Gong Subject: Re: [PATCH] ath11k: add string type to search board data in board-2.bin for WCN6855 References: <20210913181131.194024-1-jouni@codeaurora.org> Date: Mon, 08 Nov 2021 15:15:44 +0200 In-Reply-To: <20210913181131.194024-1-jouni@codeaurora.org> (Jouni Malinen's message of "Mon, 13 Sep 2021 21:11:31 +0300") Message-ID: <87mtmepz3z.fsf@codeaurora.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Jouni Malinen writes: > From: Wen Gong > > Currently ath11k only support string type with bus, chip id and board id > such as "bus=ahb,qmi-chip-id=1,qmi-board-id=4" for ahb bus chip and > "bus=pci,qmi-chip-id=0,qmi-board-id=255" for PCIe bus chip in > board-2.bin. For WCN6855, it is not enough to distinguish all different > chips. > > This is to add a new string type which include bus, chip id, board id, > vendor, device, subsystem-vendor and subsystem-device for WCN6855. > > ath11k will first load board-2.bin and search in it for the board data > with the above parameters, if matched one board data, then download it > to firmware, if not matched any one, then ath11k will download the file > board.bin to firmware. > > Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 > > Signed-off-by: Wen Gong > Signed-off-by: Jouni Malinen > --- > drivers/net/wireless/ath/ath11k/core.c | 27 ++++++++++++++++++++------ > drivers/net/wireless/ath/ath11k/core.h | 13 +++++++++++++ > drivers/net/wireless/ath/ath11k/pci.c | 10 ++++++++++ > drivers/net/wireless/ath/ath11k/qmi.h | 3 +++ > 4 files changed, 47 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c > index 8f09ae827170..a8c6f7cf33d5 100644 > --- a/drivers/net/wireless/ath/ath11k/core.c > +++ b/drivers/net/wireless/ath/ath11k/core.c > @@ -406,11 +406,26 @@ static int ath11k_core_create_board_name(struct ath11k_base *ab, char *name, > scnprintf(variant, sizeof(variant), ",variant=%s", > ab->qmi.target.bdf_ext); > > - scnprintf(name, name_len, > - "bus=%s,qmi-chip-id=%d,qmi-board-id=%d%s", > - ath11k_bus_str(ab->hif.bus), > - ab->qmi.target.chip_id, > - ab->qmi.target.board_id, variant); > + switch (ab->id.bdf_search) { > + case ATH11K_BDF_SEARCH_BUS_AND_BOARD: > + scnprintf(name, name_len, > + "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x,qmi-chip-id=%d,qmi-board-id=%d%s", > + ath11k_bus_str(ab->hif.bus), > + ab->id.vendor, ab->id.device, > + ab->id.subsystem_vendor, > + ab->id.subsystem_device, > + FIELD_GET(ATH11K_CHIP_ID_MASK, ab->qmi.target.chip_id), > + ab->qmi.target.board_id & 0xFF, Why are chip_id and board_id masked? Why cannot we use values directly provided by the firmware? And if we need to mask those, it's better to do them in qmi.c where they are stored: if (resp.chip_info_valid) { ab->qmi.target.chip_id = resp.chip_info.chip_id; ab->qmi.target.chip_family = resp.chip_info.chip_family; } if (resp.board_info_valid) ab->qmi.target.board_id = resp.board_info.board_id; else ab->qmi.target.board_id = 0xFF; -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches