Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3806374rdb; Thu, 14 Sep 2023 03:19:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPBc7OS9sfP0ME+Lfp7ETxAD+ZV5JC6b4wJvvOUt+a90Bkwc0ne+i1gIt+1rcHWAo3upZp X-Received: by 2002:a17:90a:1506:b0:274:7de5:10c7 with SMTP id l6-20020a17090a150600b002747de510c7mr755744pja.11.1694686757544; Thu, 14 Sep 2023 03:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694686757; cv=none; d=google.com; s=arc-20160816; b=oieedmlRPsS/Xd1JwwHJ2Xpo9YoaZnk55igXJYIcscUSNL+ZdI62YJk95hIKgFis/7 szYVpdZ8hXr3P9gS2dwb2xSDj+t4GQct92UbTGvdwedbwiURn99eX/DAN8UTijwHy4Yc QMKSV7FrFgVj4LJ4jSmU7DN/JLGxYLAOCYJPnU4axEhkmbeVV32/USDAn+6wgz14f7rk UzD4Gl16YVXLbE5oPSrlz91t1T5wiLLrJXn+GNFetKiHOlDfa2qguwxgmOigbXrhoOWg AxLm1MC7z9I7cy/TmPaL7g4W2S4KtsTxs4+8FjZ2ud/uHN+gkoiu+hJwCvRetE4XKVEM P3/w== 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=dq7mwd2sR5af3L0FTEgLiPmtJpKpoS1HavSs9d9XTEs=; fh=R7jN8qUJXbrMn2MmiosToC7UwR5vJ9696qG6xzfWa9Q=; b=DPAehdW3Ae6EXFT+NzUSzjobUInGGEmoV2TEs/kIr3RfLiCaHsLJHl7acy6AnirohM N2nI+dx6qtFG2Y0dVCtVn48g31HljbAOj4KMJP+mmwOmtlxugTcfa6C631S354Xnh32M sIzDeqdlW6wV1z5U8jbWPDfOwRaz1203aUPAc+VQenhOj6o3FpLKUwgjAeMfRY0x7Ty0 pSE2HnPkTufO27l8KxBOytY7qomAM9vUSDIfAEbGng2eC6a57IQF3tTppdP8CBLLvIda PeUkYbOEGdDBBgocRnPn6OfMIchfGuQC3EBvPv8m4TUM3nvfDTLduqKDA528qnHLlRnR 5M9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PNLsami0; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id fv16-20020a17090b0e9000b0026823d86469si1398494pjb.24.2023.09.14.03.19.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 03:19:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PNLsami0; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id EAFAC825A0F0; Thu, 14 Sep 2023 02:09:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236984AbjINJJN (ORCPT + 57 others); Thu, 14 Sep 2023 05:09:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236624AbjINJJB (ORCPT ); Thu, 14 Sep 2023 05:09:01 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19C521FDA for ; Thu, 14 Sep 2023 02:08:19 -0700 (PDT) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38E8sBFu016507; Thu, 14 Sep 2023 09:08:07 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=dq7mwd2sR5af3L0FTEgLiPmtJpKpoS1HavSs9d9XTEs=; b=PNLsami0jVL/xh/jXPCd+GVcvZlDCo6LvTfpzWh/AYUR7r6wBAo7QdghAa1wGOMB9AUm aXBlnK3h8zUxgD0ZrkjPgxZpjTBVnNtuVHAcsVO+H8LxuXUCh1Zvamq7jhBl6vs4eTau 3ees1CycTazI1LSbt50SfklNbv6cxIL/aKnZ7/nFz/bzeQhvLbiPyuhepYau/EYlb4PS 6t0kFQBlFUQj6BvHW1VbYufxwrRBcKtJ2VyBJZOsK+Fb/rffXx+iN3cvZyTpElDWKaOD vGb6xYZDNVG/mIEO1Ulw/dMiaHdFI/pyH7KHs6c4m2HVyJ0RwBUd9Ik2inONH3MAy0A8 BA== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t3v4g8h9r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 09:08:07 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38E986IB004345 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Sep 2023 09:08:06 GMT Received: from wgong-HP3-Z230-SFF-Workstation.qca.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.1118.36; Thu, 14 Sep 2023 02:08:04 -0700 From: Wen Gong To: CC: , , , Subject: [PATCH v2 1/4] wifi: ath12k: add configure country code for WCN7850 Date: Thu, 14 Sep 2023 05:07:43 -0400 Message-ID: <20230914090746.23560-2-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230914090746.23560-1-quic_wgong@quicinc.com> References: <20230914090746.23560-1-quic_wgong@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: PeV1UonD9pS52-ObNABlk6QmBQ0tixDC X-Proofpoint-GUID: PeV1UonD9pS52-ObNABlk6QmBQ0tixDC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-14_07,2023-09-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 lowpriorityscore=0 suspectscore=0 adultscore=0 spamscore=0 impostorscore=0 clxscore=1015 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309140078 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 14 Sep 2023 02:09:27 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Add handler to send WMI_SET_CURRENT_COUNTRY_CMDID to firmware which is used for WCN7850. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Wen Gong --- drivers/net/wireless/ath/ath12k/wmi.c | 36 +++++++++++++++++++++++++++ drivers/net/wireless/ath/ath12k/wmi.h | 13 ++++++++++ 2 files changed, 49 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 9ed33e2d6da0..d22ff9c2326a 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -2844,6 +2844,42 @@ int ath12k_wmi_send_init_country_cmd(struct ath12k *ar, return ret; } +int ath12k_wmi_send_set_current_country_cmd(struct ath12k *ar, + struct wmi_set_current_country_params *param) +{ + struct ath12k_wmi_pdev *wmi = ar->wmi; + struct wmi_set_current_country_cmd *cmd; + struct sk_buff *skb; + int ret; + + skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd)); + if (!skb) + return -ENOMEM; + + cmd = (struct wmi_set_current_country_cmd *)skb->data; + cmd->tlv_header = + ath12k_wmi_tlv_cmd_hdr(WMI_TAG_SET_CURRENT_COUNTRY_CMD, + sizeof(*cmd)); + + cmd->pdev_id = cpu_to_le32(ar->pdev->pdev_id); + memcpy(&cmd->new_alpha2, ¶m->alpha2, sizeof(param->alpha2)); + ret = ath12k_wmi_cmd_send(wmi, skb, WMI_SET_CURRENT_COUNTRY_CMDID); + + ath12k_dbg(ar->ab, ATH12K_DBG_WMI, + "set current country pdev id %d alpha2 %c%c\n", + ar->pdev->pdev_id, + param->alpha2[0], + param->alpha2[1]); + + if (ret) { + ath12k_warn(ar->ab, + "failed to send WMI_SET_CURRENT_COUNTRY_CMDID: %d\n", ret); + dev_kfree_skb(skb); + } + + return ret; +} + int ath12k_wmi_send_twt_enable_cmd(struct ath12k *ar, u32 pdev_id) { diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h index 8c047a9623f9..fead9eba0791 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h @@ -3892,6 +3892,16 @@ struct ath12k_wmi_eht_rate_set_params { #define MAX_6G_REG_RULES 5 #define REG_US_5G_NUM_REG_RULES 4 +struct wmi_set_current_country_params { + u8 alpha2[REG_ALPHA2_LEN]; +}; + +struct wmi_set_current_country_cmd { + __le32 tlv_header; + __le32 pdev_id; + __le32 new_alpha2; +} __packed; + enum wmi_start_event_param { WMI_VDEV_START_RESP_EVENT = 0, WMI_VDEV_RESTART_RESP_EVENT, @@ -4879,6 +4889,9 @@ int ath12k_wmi_send_bcn_offload_control_cmd(struct ath12k *ar, u32 vdev_id, u32 bcn_ctrl_op); int ath12k_wmi_send_init_country_cmd(struct ath12k *ar, struct ath12k_wmi_init_country_arg *arg); +int +ath12k_wmi_send_set_current_country_cmd(struct ath12k *ar, + struct wmi_set_current_country_params *param); int ath12k_wmi_peer_rx_reorder_queue_setup(struct ath12k *ar, int vdev_id, const u8 *addr, dma_addr_t paddr, u8 tid, -- 2.40.1