Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2958513lqp; Mon, 25 Mar 2024 14:34:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1fUk1isJcVm9ToFcTuHAeifevLc6J4ZTerCg/DPgUd/n8gqY0t5uwGiJXgiJuVv3G1KlI+RjnvHZsWzrx9Mk9/maa9pjj49gUhrvNtQ== X-Google-Smtp-Source: AGHT+IFOAQPvIneEDvmYen6kpFg04UDLoMriquZufa0qvVY38tr8qBw4YTyq+CHTkl9ADYZ98JV6 X-Received: by 2002:a17:902:fc45:b0:1e0:7f78:624d with SMTP id me5-20020a170902fc4500b001e07f78624dmr8714977plb.57.1711402466924; Mon, 25 Mar 2024 14:34:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711402466; cv=pass; d=google.com; s=arc-20160816; b=X0HNf0j9Y9rpooI5VcpEnfU5OXRjVFqvx+S5SQ1pZtW34VW4YRXIg8njkQFJxkWRNc 2YR8GKSnz17T9gZh0ScAFzWlMD1JN7uj8/StOCrNK+BsdFjsDJFTiRUzouNvGny69/3l 6vC8CPM60FlRvGXJ36r8O6Vn+fm/jS8ZPIbq2UldDXxVZn03YoxmEmeiCdryrM9DKwDv Ck7w/kj3mfxzNpAV88XGxGKyVSn+wFGbnkrQiwrCb85ZXrVuSLhFabGF0W5/p3gTtL7+ 8l/iKsY2RwOZ8BKMCSyY8EvfGNToeAWgEr9F9syYb+2rGdsQAkjji1Wx1fVYCKERszlQ rwNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tU23UPfNOPTrO8hM+t0tGI1IwzPcFzJaXNTcLje4Vm0=; fh=A5eQsd9pcd+LZSsDABi2kisZAvlWI5KS0oXL4UBVifI=; b=KyUHF2gNj69WPmajmtWZzBgx5Y6VWytYrlGivY2ls/A3vGIQ0oJroQ9SF380w5jJET s7K9IExi79ODnaicSPpF9rrly244iI0mk0ymHXsAZfk8YDQiWhJ+EkxrSptWIq5v49Ns /yQk80M5jn9apI/D44tELPFbPBOS+qX0tFVC0Xnxyvk3XXissbOlz0rELE5jUemBJhnL AF6tZCc/jbmF992jXOBkT7GZlZihyBm4LemYBrClP7ALCN9OG7A+uSIDkxYSX0yjoM5P +1n2k3MwhstNA2bbPVLnLgV25M9p/2O8Za1/q/EZLKuGYDRtO8HObMXESNKWlWYThA8y Gh6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=l+L2uYOC; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-5251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5251-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q1-20020a170902eb8100b001e096d44064si6061001plg.368.2024.03.25.14.34.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 14:34:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=l+L2uYOC; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-5251-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5251-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EC7832E853A for ; Mon, 25 Mar 2024 21:23:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C2C36DCE8; Mon, 25 Mar 2024 21:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="l+L2uYOC" X-Original-To: linux-wireless@vger.kernel.org Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 C05A35D744 for ; Mon, 25 Mar 2024 21:23:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711401805; cv=none; b=E4zFVHBpwPtwi9J8bIGK1XzCgDw7MAW/vkme74CpATW3RFmXD3SHokqaEofqAqcN4z6Nna0qDOH8FvPu8wiUR3su4pjdNXf/RnQ9Ofbw5xjdGMNV9Kd2AMF3B2bRLRYg5Mf07P/LaXwoR/TvDXmIedglzs3YeYSr7ZR1AhzyDgA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711401805; c=relaxed/simple; bh=Fbq4cXafuZUlDedEIwaKx13jRMDK93tRzHHXld4Fv/s=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UBVdCbetGIpb9pCCvPFEA0+rc1JAnQEQEH8sIB3zW/B+PxAUabGE6jJ14q/G6lGcDHoBe4CP/37+RYTYDTLmtkUMqyuWO4bJ0RxhTRHCgeWLBEJARUMaYDlHCL2jTewdxkBlQpxDSS0wF54AGQKinAwoZDScyQxzT9yao4ICaLg= 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=l+L2uYOC; arc=none smtp.client-ip=205.220.180.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 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42PKj9r8013346; Mon, 25 Mar 2024 21:23:20 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-type; s=qcppdkim1; bh=tU23UPfNOPTrO8hM+t0t GI1IwzPcFzJaXNTcLje4Vm0=; b=l+L2uYOC1qIAB63bIx2+0JC0tnbpZAjk+9kR 9U0rqMLjjonDP/NQF9qTzmw+Eqj+KFr0SYuwQBolv40DzxyfJgl+qNwu0mIvX+SE EDTyXjt4Dc5kAmSStc4H2jOs30fcbP69T9pGnwrN9/s0qL7rYRkowBuQNI9bwX9s m/uIcwJj1Pk+mSZPC8htdekdIDUXSYRDBk+/XZGPLmzYGZZIWTsSCHjZNPu8Djo/ wPJC8KpOWX+78FubwcYUHkPUSGw22FRZRULtVQTpxHcowQ3qKVfnOI23/JgCRr/m 5zN1n5Ou9mwOv3qtlwvVPCZRukVfmZaIzrzphxgvs5o3mUP2og== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x34hssv8g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Mar 2024 21:23:19 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42PLNIG3010567 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Mar 2024 21:23:18 GMT Received: from pradeepc2-linux.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.1118.40; Mon, 25 Mar 2024 14:23:18 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , Avula Sri Charan Subject: [PATCH 4/6] wifi: ath12k: add 6 GHz params in peer assoc command Date: Mon, 25 Mar 2024 14:23:02 -0700 Message-ID: <20240325212304.28241-5-quic_pradeepc@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240325212304.28241-1-quic_pradeepc@quicinc.com> References: <20240325212304.28241-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: kdxmGLufTWpprEKQbYdnqL6oR4BAm-Fd X-Proofpoint-GUID: kdxmGLufTWpprEKQbYdnqL6oR4BAm-Fd 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-03-25_21,2024-03-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 impostorscore=0 clxscore=1015 mlxlogscore=999 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2403250132 Currently A-MPDU aggregation parameters are not being configured during peer association for 6 GHz band. Hence, extract these parameters from station's capabilities received in association request and send to firmware. Without this, A-MPDU aggregation is not happening in 6 GHz band. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Co-developed-by: Avula Sri Charan Signed-off-by: Avula Sri Charan Signed-off-by: Pradeep Kumar Chitrapu --- drivers/net/wireless/ath/ath12k/mac.c | 56 ++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 6d7df18ec424..7e296140439a 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -1910,6 +1910,59 @@ static void ath12k_peer_assoc_h_he(struct ath12k *ar, } } +static void ath12k_peer_assoc_h_he_6ghz(struct ath12k *ar, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct ath12k_wmi_peer_assoc_arg *arg) +{ + const struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap; + struct cfg80211_chan_def def; + enum nl80211_band band; + u8 ampdu_factor; + + if (WARN_ON(ath12k_mac_vif_chan(vif, &def))) + return; + + band = def.chan->band; + + if (!arg->he_flag || band != NL80211_BAND_6GHZ || !sta->deflink.he_6ghz_capa.capa) + return; + + if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_40) + arg->bw_40 = true; + + if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80) + arg->bw_80 = true; + + if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) + arg->bw_160 = true; + + if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_320) + arg->bw_320 = true; + + arg->peer_he_caps_6ghz = le16_to_cpu(sta->deflink.he_6ghz_capa.capa); + arg->peer_mpdu_density = + ath12k_parse_mpdudensity(u32_get_bits(arg->peer_he_caps_6ghz, + IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START)); + + /* From IEEE Std 802.11ax-2021 - Section 10.12.2: An HE STA shall be capable of + * receiving A-MPDU where the A-MPDU pre-EOF padding length is up to the value + * indicated by the Maximum A-MPDU Length Exponent Extension field in the HE + * Capabilities element and the Maximum A-MPDU Length Exponent field in HE 6 GHz + * Band Capabilities element in the 6 GHz band. + * + * Here, we are extracting the Max A-MPDU Exponent Extension from HE caps and + * factor is the Maximum A-MPDU Length Exponent from HE 6 GHZ Band capability. + */ + ampdu_factor = u8_get_bits(he_cap->he_cap_elem.mac_cap_info[3], + IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_MASK) + + u32_get_bits(arg->peer_he_caps_6ghz, + IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP); + + arg->peer_max_mpdu = (1u << (IEEE80211_HE_6GHZ_MAX_AMPDU_FACTOR + + ampdu_factor)) - 1; +} + static void ath12k_peer_assoc_h_smps(struct ieee80211_sta *sta, struct ath12k_wmi_peer_assoc_arg *arg) { @@ -2382,6 +2435,7 @@ static void ath12k_peer_assoc_prepare(struct ath12k *ar, ath12k_peer_assoc_h_ht(ar, vif, sta, arg); ath12k_peer_assoc_h_vht(ar, vif, sta, arg); ath12k_peer_assoc_h_he(ar, vif, sta, arg); + ath12k_peer_assoc_h_he_6ghz(ar, vif, sta, arg); ath12k_peer_assoc_h_eht(ar, vif, sta, arg); ath12k_peer_assoc_h_qos(ar, vif, sta, arg); ath12k_peer_assoc_h_phymode(ar, vif, sta, arg); @@ -8029,7 +8083,7 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah) ieee80211_hw_set(hw, SUPPORTS_TX_FRAG); ieee80211_hw_set(hw, REPORTS_LOW_ACK); - if (ht_cap & WMI_HT_CAP_ENABLED) { + if ((ht_cap & WMI_HT_CAP_ENABLED) || ar->supports_6ghz) { ieee80211_hw_set(hw, AMPDU_AGGREGATION); ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW); ieee80211_hw_set(hw, SUPPORTS_REORDERING_BUFFER); -- 2.17.1