From patchwork Fri Jan 26 11:52:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kang Yang X-Patchwork-Id: 13532471 X-Patchwork-Delegate: kvalo@adurom.com Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D712F1B592 for ; Fri, 26 Jan 2024 11:53:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706269987; cv=none; b=mB9Z4zz6BR9GiOOGX/P899KPZKCNeVAFwqBExJ4UyrnvzMvsR/3QwUJgqKXo8t4TV/WyKYazHTcoxZyqdUEfjCWS2D6KPZ/uNYy4dMsP2WWaXbKTXcegkQd7y4RwvhAD7D+Y3jAlY4eC6cNQfx9/dYh/2qFgkUmzV7NOIgyHVek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706269987; c=relaxed/simple; bh=9JTFRpgKiRApIlFNZzTkJNFMKUhVmnuqSilwgP67y7Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EUeLUvB5yFVDEkK5cUVXokC3mpRV9OPymLaefQ2ePNJhQdFSG0wbtKPkamGflCmurLfHzNcBdccuEovdBNqdnSKsb/Xl4lWHeciWHlAe7BIrmcBkXKV3ZMjWVOhbYLYUot+UbYaSXsmcRsAduQaIlyZe7wJj6L3VdX/LXZDcJqo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=bArpn9g/; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="bArpn9g/" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40QBekb5020875; Fri, 26 Jan 2024 11:53:03 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=sz+ZIyqwS3LweWJ8AFqYiQKTpKpETqjZgeY3njKqrAg=; b=bA rpn9g/th2Cf6soV/4CnifrunmGw+xQUrorzxDIC6GfpRwri1L2TyTabzm6ekNkUy nql5oyqklL2dOGkdoVsqhFLfJKH/GhivGHyHNSHPTk+4w6WAGZ4gLmcHBNh0nWJc UGO2s18KvVi+kUnJEHKvGKeUttv9ZqCwstDDIS7JKV3tzBvR9qM9HgdV0/CxCUw2 pJAIghzld0aW18xPoJ49vekBAFPEeiL8+Vk0xw1G3ZRVBwD8tfNkL6Gf3dAnnIUK /bdMpKVNTsqSW7GKJ/fSfCcXXvpT5XCZ1iZ/4wIUd34OANdAkGY6ONHQk4V+slEt ZYhJv7r0gU2anMvh+MxA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vv51dgxyd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Jan 2024 11:53:03 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40QBr2PC005667 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 26 Jan 2024 11:53:02 GMT Received: from yk-E5440.qca.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.1118.40; Fri, 26 Jan 2024 03:53:01 -0800 From: Kang Yang To: CC: , Subject: [PATCH v4 09/11] wifi: ath12k: designating channel frequency for ROC scan Date: Fri, 26 Jan 2024 19:52:29 +0800 Message-ID: <20240126115231.356658-10-quic_kangyang@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240126115231.356658-1-quic_kangyang@quicinc.com> References: <20240126115231.356658-1-quic_kangyang@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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-ORIG-GUID: LuMlbOZLrpKozJK2z258YPWG2q1PGVp_ X-Proofpoint-GUID: LuMlbOZLrpKozJK2z258YPWG2q1PGVp_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-25_14,2024-01-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 mlxlogscore=999 phishscore=0 clxscore=1015 mlxscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2401260087 For P2P mode, the WLAN interface may be requested to remain on a specific channel and then to send some management frames on that channel. Now chananel frequency of wmi_mgmt_send_cmd is set as 0. As a result, firmware may choose a default but wrong channel. Fix it by assigning chanfreq field with the ROC channel frequency. This change only applies to WCN7850, other chips are not affected. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Kang Yang Acked-by: Jeff Johnson --- v4: no change. v3: no change. v2: add Tested-on tag of QCN9274. -- drivers/net/wireless/ath/ath12k/wmi.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 34e676799616..9e2c6b98166b 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -732,6 +732,20 @@ static int ath12k_service_ready_event(struct ath12k_base *ab, struct sk_buff *sk return 0; } +static u32 ath12k_wmi_mgmt_get_freq(struct ath12k *ar, + struct ieee80211_tx_info *info) +{ + struct ath12k_base *ab = ar->ab; + u32 freq = 0; + + if (ab->hw_params->single_pdev_only && + ar->scan.is_roc && + (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN)) + freq = ar->scan.roc_freq; + + return freq; +} + struct sk_buff *ath12k_wmi_alloc_skb(struct ath12k_wmi_base *wmi_ab, u32 len) { struct sk_buff *skb; @@ -757,6 +771,7 @@ int ath12k_wmi_mgmt_send(struct ath12k *ar, u32 vdev_id, u32 buf_id, { struct ath12k_wmi_pdev *wmi = ar->wmi; struct wmi_mgmt_send_cmd *cmd; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(frame); struct wmi_tlv *frame_tlv; struct sk_buff *skb; u32 buf_len; @@ -775,7 +790,7 @@ int ath12k_wmi_mgmt_send(struct ath12k *ar, u32 vdev_id, u32 buf_id, sizeof(*cmd)); cmd->vdev_id = cpu_to_le32(vdev_id); cmd->desc_id = cpu_to_le32(buf_id); - cmd->chanfreq = 0; + cmd->chanfreq = cpu_to_le32(ath12k_wmi_mgmt_get_freq(ar, info)); cmd->paddr_lo = cpu_to_le32(lower_32_bits(ATH12K_SKB_CB(frame)->paddr)); cmd->paddr_hi = cpu_to_le32(upper_32_bits(ATH12K_SKB_CB(frame)->paddr)); cmd->frame_len = cpu_to_le32(frame->len);