From patchwork Wed Jul 10 02:18:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baochen Qiang X-Patchwork-Id: 13728792 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 6B13E63B9 for ; Wed, 10 Jul 2024 02:18:48 +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=1720577929; cv=none; b=LsbycR7i9TqD8P9yREtFfQsfnDXj3EI1bbQsW7R6LLSiUpechCEzskd+JAwi9FywqDulJbHzGrDJVqDCVxLvrQWnZmE1hLTGal70K2KlllamASSBmlHlnllvA6CUTdFNEyRfm3LsS3Mm8x3yrq4EBn1kTjcRHSF4F2l7MIjAADU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720577929; c=relaxed/simple; bh=fqYW4RMwoDWSp3yx1TAjL1JXZZN5IlS20Nqkt/3kJ5I=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=KNyfvTHddv8YRAh8GuehjcdgFOO9wYy8fK8GdPsfS38jE/I6Kwi5rAsE1S9QL6OjVPPSRplVTuK1te30o9KDHUZTrFXweXaOWsMrO9T2UAAEHQpJ8q5F1BzxCyzKbmqVuRRJf1JEllggGFjflBzE/pH/5YvdN1B7YWJukcCucss= 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=XW5eNj9c; 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="XW5eNj9c" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46A1nhgo017547; Wed, 10 Jul 2024 02:18:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=74zCitBFb9ZjqhxUh6FLue Pgb223C7VIcVMrRZVNv9Y=; b=XW5eNj9cNzR7zRuGkRNcl9ogvhbG5M9XlTWDCx /TCGu7Wi0w1ws4eOl8jfwk9qgU6zYX46+0RGn3BQxBwmPTgzBdjJsI8e2eKkfM4N 7/FMPefmAKM3YEkPRsStTURDYVhOvdHt+ArfrURIkGYA9++uAZpSafOFzmvGC6ON djicKLfh1gZPYwCc2c13Sbl1mAkwPza3lZ0HNu3glPRWdoHAkR1OY/ZCuMNYiwK7 SJ9LRaYY79vshgzZelbXP+t7Gyw34cMynXzXmisAOTbrwDVFD3Sy3yTpH0u+VW9m BSWnBF/ZHfwNItfYLtUQAHxfvvWmfXrvk52b2UtUE/X31Cjg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 406wg407k2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 02:18:44 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 46A2IhHa022120 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jul 2024 02:18:43 GMT Received: from bqiang-SFF.qca.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Tue, 9 Jul 2024 19:18:42 -0700 From: Baochen Qiang To: CC: , Subject: [PATCH] wifi: ath12k: fix invalid AMPDU factor calculation in ath12k_peer_assoc_h_he() Date: Wed, 10 Jul 2024 10:18:19 +0800 Message-ID: <20240710021819.87216-1-quic_bqiang@quicinc.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 8mg2sFKn-IDCCw-vX9zAgxe2KWhWtQgx X-Proofpoint-GUID: 8mg2sFKn-IDCCw-vX9zAgxe2KWhWtQgx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-09_12,2024-07-09_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 clxscore=1011 impostorscore=0 malwarescore=0 mlxscore=0 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2407100016 Currently ampdu_factor is wrongly calculated in ath12k_peer_assoc_h_he(), fix it. This is found during code review. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Baochen Qiang --- drivers/net/wireless/ath/ath12k/mac.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) base-commit: 9fddbf081f2da3a20fecda0b58adacbf1379e304 diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 8106297f0bc1..a7b86e6a2655 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -2196,9 +2196,8 @@ static void ath12k_peer_assoc_h_he(struct ath12k *ar, * request, then use MAX_AMPDU_LEN_FACTOR as 16 to calculate max_ampdu * length. */ - ampdu_factor = (he_cap->he_cap_elem.mac_cap_info[3] & - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK) >> - IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK; + ampdu_factor = u8_get_bits(he_cap->he_cap_elem.mac_cap_info[3], + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK); if (ampdu_factor) { if (sta->deflink.vht_cap.vht_supported)