Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp783404rwd; Thu, 18 May 2023 04:02:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6F39Hn64LQzwKedwUCs73UxsXu19GjoIYRtcC623yujjhZYUkIs6eVhqnR0KNT6j+MA8HS X-Received: by 2002:a05:6a00:1346:b0:643:6b94:374b with SMTP id k6-20020a056a00134600b006436b94374bmr4307520pfu.1.1684407768799; Thu, 18 May 2023 04:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684407768; cv=none; d=google.com; s=arc-20160816; b=Epk1dDXDcR94MQ9T5D8SxeMZk+8B5mSC3AmG8Ip8ISjhjooLTMsR+1LRjnL8BI8/Ay CZt0pyYVxapbqOFZiwfU+VAg1qeLho7BF5se8Hisg7HJVKPHrVpaQ5g4j3C7yvfhCKXa DMAbZFTFNhXKKjgzz1pi+6vKuwHfY0LivWyxNJQrodjBvvnaojNRMFoycllTpdOLRIf+ tu0aZ+oVgyPkknDy2ZR83/hV3Dn2qGj+0CICteUeuccRO9MDhmni73GhlWRiS9/Uy9ia 3xI48iwngqMcuiVi+4YVtg0BInSVJvPteoD8EdjVpLuhUlBegwoSHxv2qB/3QH25vNhf Wm9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+O8R9+PF1o/LWQjR3Z4t4oslJpzFOKFKZAaUDWtXniM=; b=oU5HDuW8y/h7iz1UtPH/wlz3XvH3TMAc1pMnpgnO7fmzoB8k8/j8CVvVDlcu5BpqCl pcnKA+UGhvHnMDauGxyTCCho2bNfP/87aRFvaElG+nveqO0mM34kgZ6XJeKJ1lNdnw/1 a2o037Hq9TFjdK+n2cuh3S47sSpwWKJrTuFYkqvSSdR5vBq/UBMmLiO1v3v7iqhnVATk rS5Rplnsqs776Ltj9HNgmD4IPQajDpGZyx4r5aV0fb/Dj2RDE6aqqiVFKQQ2InAxBbjW k8qKiZZLzSnCExt5gWi9vwPJWhQpYPzmDIxzTLMUmMg5KL6IpUuYfBPGkabfRt05Wups OfcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Rn145ReH; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020aa7950a000000b00643ba887601si1331559pfp.307.2023.05.18.04.02.34; Thu, 18 May 2023 04:02:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Rn145ReH; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230308AbjERK6D (ORCPT + 62 others); Thu, 18 May 2023 06:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbjERK6B (ORCPT ); Thu, 18 May 2023 06:58:01 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98F141713 for ; Thu, 18 May 2023 03:58:00 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34I9jnE4027342; Thu, 18 May 2023 10:57:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=+O8R9+PF1o/LWQjR3Z4t4oslJpzFOKFKZAaUDWtXniM=; b=Rn145ReH2vriJ+fnJ+KkvF+ifVdd/ZpuHwdCJMGElKYiSYTH7QkgcWJ46B6+M2NhmWCd OGt7UFqoeiUg6Ote0INHf6lI+kdIojjVQTDyQ85HZjtmb8i7tQlCDTxPndKN8xtCyZ6E YId/xUEbwiDKLlxZpBF5QkwsaHGrmpFVDLNCBYErE+FXeKj2ASLyp1FNY+x3x5EXBQIx CTJCEuRlAA1rMyEzZ0tW11M5MbMX4Kn54ZtsnqhWUS02ANeI1DVlDJyg5mrT91qz75u0 2E00pqLMR6/V5xxQ00mCWnWflCO7H2f/eIXYFVj1LkmlNZVCxBETdwN8i23sVodB1ChC ng== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qnbxqgsg6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2023 10:57:57 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 34IAvvWs029784 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2023 10:57:57 GMT Received: from cjhuang2-gv.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Thu, 18 May 2023 03:57:55 -0700 From: Carl Huang To: CC: , Subject: [PATCH] wifi: ath12k: check hardware major version for WCN7850 Date: Thu, 18 May 2023 18:57:41 +0800 Message-ID: <20230518105741.1281424-1-quic_cjhuang@quicinc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 4mzUu_X-y5xBKSyKBXCWy11q0mdo0ppL X-Proofpoint-GUID: 4mzUu_X-y5xBKSyKBXCWy11q0mdo0ppL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-18_08,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1011 priorityscore=1501 impostorscore=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305180085 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is to check the hardware major version for WCN7850 so only supported hardware is initialized. Now only WCN7850 with major version 2 is supported. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Carl Huang --- drivers/net/wireless/ath/ath12k/pci.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index 9f174daf324c..5990a55801f0 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -1227,8 +1227,20 @@ static int ath12k_pci_probe(struct pci_dev *pdev, case WCN7850_DEVICE_ID: ab_pci->msi_config = &ath12k_msi_config[0]; ab->static_window_map = false; - ab->hw_rev = ATH12K_HW_WCN7850_HW20; ab_pci->pci_ops = &ath12k_pci_ops_wcn7850; + ath12k_pci_read_hw_version(ab, &soc_hw_version_major, + &soc_hw_version_minor); + switch (soc_hw_version_major) { + case ATH12K_PCI_SOC_HW_VERSION_2: + ab->hw_rev = ATH12K_HW_WCN7850_HW20; + break; + default: + dev_err(&pdev->dev, + "Unknown hardware version found for WCN7850: 0x%x\n", + soc_hw_version_major); + ret = -EOPNOTSUPP; + goto err_pci_free_region; + } break; default: base-commit: 610b78b97bad8f3e77c27a15e9a03cbbb4109697 -- 2.34.1