Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2901141rwd; Fri, 2 Jun 2023 17:03:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4dcJOZth0e2vYMXfTMqbzH+68mYJnNJT7n21DJH9mGocd9Voj+vNfSVBvlr/UzowU9OUXv X-Received: by 2002:a05:6a00:198d:b0:64a:c673:d064 with SMTP id d13-20020a056a00198d00b0064ac673d064mr11590058pfl.17.1685750602834; Fri, 02 Jun 2023 17:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685750602; cv=none; d=google.com; s=arc-20160816; b=rqBqTg2scG1lU7i6HJy9aHiyg5VGTvc2kIa643VodcGRtrT1+FGnA0g+LtVRzZH1tn Tet1qs3Ea5xp5efY8X6CwWFsGuyvw2I6sdrfSIis6da8zBlLcJqsLouappi1S9dOnJN+ JM91bD1PbmMDkSIpzRp0wMASiT/W7zqSToX+2RZJkhtlyjDj5foiSErcjkuRVNqZojyQ lQXbtfT0EPaIoEI8hYMej8vprYM/gVitroxxW93kOOPh0T9ax3SyL2kFUn8UpPJsohSy 4PA8GaxiBOOepDdyIKPeuWk+YWXVW7Wxp7Ni13mTX5u3TkJVlRsEnQwEw5tIV+2GJhZG SWIQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8b1h2DQO68IcHj/aQhqkYwM0M9daVEgGsEnC80uRmwU=; b=yVi2wt1RGCXiQ1IRzWOfr0GHVWCuxR2Tz5lzTPOZ3KdOATQ7sGNwFnA+ClkJohgrEQ RlCihd2OlKT4ZCuTJ9St2bL1RdIFLsMGhVNPp33H1l4x+C1s4oKw+QNp3f0iLUZDsvy1 Qh/5gdzHmEzIywT5yYmxHvMn2gYEGDEvBPQ49o8+5kN0d4gQjaPuHJrmys6whPRY/aIn iHnK/N+CHav1oQP3KX/84Uk5hUsgnGI3ZtzT7GU5dVsQr8La3vsel/FUYOMWQPiNY5eQ KIuSRnbL53p3xvE8kP4IwfcFSlSBPah7TbUKE2s7pjajSH1KPvaCH6JzXI3nsDAMVItq tzPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Omo9WwNB; 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 w66-20020a623045000000b0063f032d78efsi1454223pfw.269.2023.06.02.17.03.13; Fri, 02 Jun 2023 17:03:22 -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=Omo9WwNB; 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 S236854AbjFBX6x (ORCPT + 64 others); Fri, 2 Jun 2023 19:58:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236745AbjFBX6v (ORCPT ); Fri, 2 Jun 2023 19:58:51 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D26011A6 for ; Fri, 2 Jun 2023 16:58:50 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 352NtBUJ001437; Fri, 2 Jun 2023 23:58:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=8b1h2DQO68IcHj/aQhqkYwM0M9daVEgGsEnC80uRmwU=; b=Omo9WwNBiaGC3rp585qqbg13jIK/3wuD7EthUAL5dGoVBlW/6vp1k6SwmW6YHPPGTkmO tVcyHbujAQfUToa5VmQXEtcy44RpP8PufLTQfW4R7wbZTJfoqOfZy7psurNtw2qu6zY4 wRCJGEDajUPWkkEaT81jmcnh5QLQ2vmCP+j3trHLOQ9eVUjEfgGN0PPz4Z/SBsp7SJra KE37UGkHat0bYNYIBG8Xwj/mY3VtFVXnCNRjab81i/lTiHFNW93vyXEH0d04etfcpCP4 d2KydGxt9/zJLSMqekUc8AuZYPfPgbv9oERrgOKzR1vmW7Q68Ik5HbPvtOqVLktWHfgD /w== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qyb6f20pt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 02 Jun 2023 23:58:39 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 352Nwd31017570 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 2 Jun 2023 23:58:39 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Fri, 2 Jun 2023 16:58:38 -0700 From: Aloka Dixit To: , CC: Aloka Dixit Subject: [PATCH v4 10/11] wifi: ath12k: parse WMI service ready ext2 event Date: Fri, 2 Jun 2023 16:58:19 -0700 Message-ID: <20230602235820.23912-11-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230602235820.23912-1-quic_alokad@quicinc.com> References: <20230602235820.23912-1-quic_alokad@quicinc.com> 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 nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 1k79qdKd5IwaspwOUYWlJ21qHMk33uVW X-Proofpoint-ORIG-GUID: 1k79qdKd5IwaspwOUYWlJ21qHMk33uVW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-02_18,2023-06-02_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 clxscore=1015 bulkscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2306020189 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,URIBL_BLOCKED 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 Parse WMI service ready ext2 event. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit --- v4: No change from v3. v3: No change from v2. v2: No change from v1. drivers/net/wireless/ath/ath12k/wmi.c | 48 +++++++++++++++++++++++++++ drivers/net/wireless/ath/ath12k/wmi.h | 16 +++++++++ 2 files changed, 64 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 9e48e1bce549..df7609b4adda 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -62,7 +62,23 @@ struct ath12k_wmi_svc_rdy_ext_parse { bool dma_ring_cap_done; }; +struct ath12k_wmi_svc_rdy_ext2_arg { + u32 reg_db_version; + u32 hw_min_max_tx_power_2ghz; + u32 hw_min_max_tx_power_5ghz; + u32 chwidth_num_peer_caps; + u32 preamble_puncture_bw; + u32 max_user_per_ppdu_ofdma; + u32 max_user_per_ppdu_mumimo; + u32 target_cap_flags; + u32 eht_cap_mac_info[WMI_MAX_EHTCAP_MAC_SIZE]; + u32 max_num_linkview_peers; + u32 max_num_msduq_supported_per_tid; + u32 default_num_msduq_supported_per_tid; +}; + struct ath12k_wmi_svc_rdy_ext2_parse { + struct ath12k_wmi_svc_rdy_ext2_arg arg; struct ath12k_wmi_dma_ring_caps_parse dma_caps_parse; bool dma_ring_cap_done; bool spectral_bin_scaling_done; @@ -4098,6 +4114,26 @@ static int ath12k_service_ready_ext_event(struct ath12k_base *ab, return ret; } +static int ath12k_pull_svc_ready_ext2(struct ath12k_wmi_pdev *wmi_handle, + const void *ptr, + struct ath12k_wmi_svc_rdy_ext2_arg *arg) +{ + const struct wmi_service_ready_ext2_event *ev = ptr; + + if (!ev) + return -EINVAL; + + arg->reg_db_version = le32_to_cpu(ev->reg_db_version); + arg->hw_min_max_tx_power_2ghz = le32_to_cpu(ev->hw_min_max_tx_power_2ghz); + arg->hw_min_max_tx_power_5ghz = le32_to_cpu(ev->hw_min_max_tx_power_5ghz); + arg->chwidth_num_peer_caps = le32_to_cpu(ev->chwidth_num_peer_caps); + arg->preamble_puncture_bw = le32_to_cpu(ev->preamble_puncture_bw); + arg->max_user_per_ppdu_ofdma = le32_to_cpu(ev->max_user_per_ppdu_ofdma); + arg->max_user_per_ppdu_mumimo = le32_to_cpu(ev->max_user_per_ppdu_mumimo); + arg->target_cap_flags = le32_to_cpu(ev->target_cap_flags); + return 0; +} + static void ath12k_wmi_eht_caps_parse(struct ath12k_pdev *pdev, u32 band, __le32 cap_mac_info[], __le32 cap_phy_info[], @@ -4222,10 +4258,22 @@ static int ath12k_wmi_svc_rdy_ext2_parse(struct ath12k_base *ab, u16 tag, u16 len, const void *ptr, void *data) { + struct ath12k_wmi_pdev *wmi_handle = &ab->wmi_ab.wmi[0]; struct ath12k_wmi_svc_rdy_ext2_parse *parse = data; int ret; switch (tag) { + case WMI_TAG_SERVICE_READY_EXT2_EVENT: + ret = ath12k_pull_svc_ready_ext2(wmi_handle, ptr, + &parse->arg); + if (ret) { + ath12k_warn(ab, + "failed to extract wmi service ready ext2 parameters: %d\n", + ret); + return ret; + } + break; + case WMI_TAG_ARRAY_STRUCT: if (!parse->dma_ring_cap_done) { ret = ath12k_wmi_dma_ring_caps(ab, len, ptr, diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h index 9d0f74122bc6..f41092137565 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h @@ -1925,6 +1925,7 @@ enum wmi_tlv_tag { /* TODO add all the missing cmds */ WMI_TAG_PDEV_PEER_PKTLOG_FILTER_CMD = 0x301, WMI_TAG_PDEV_PEER_PKTLOG_FILTER_INFO, + WMI_TAG_SERVICE_READY_EXT2_EVENT = 0x334, WMI_TAG_FILS_DISCOVERY_TMPL_CMD = 0x344, WMI_TAG_MAC_PHY_CAPABILITIES_EXT = 0x36F, WMI_TAG_REGULATORY_RULE_EXT_STRUCT = 0x3A9, @@ -2612,6 +2613,21 @@ struct ath12k_wmi_soc_hal_reg_caps_params { #define WMI_EHT_MCS_NSS_10_11 GENMASK(11, 8) #define WMI_EHT_MCS_NSS_12_13 GENMASK(15, 12) +struct wmi_service_ready_ext2_event { + __le32 reg_db_version; + __le32 hw_min_max_tx_power_2ghz; + __le32 hw_min_max_tx_power_5ghz; + __le32 chwidth_num_peer_caps; + __le32 preamble_puncture_bw; + __le32 max_user_per_ppdu_ofdma; + __le32 max_user_per_ppdu_mumimo; + __le32 target_cap_flags; + __le32 eht_cap_mac_info[WMI_MAX_EHTCAP_MAC_SIZE]; + __le32 max_num_linkview_peers; + __le32 max_num_msduq_supported_per_tid; + __le32 default_num_msduq_supported_per_tid; +} __packed; + struct ath12k_wmi_mac_phy_caps_ext_params { __le32 hw_mode_id; union { -- 2.39.0