Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp638661lqd; Wed, 24 Apr 2024 12:13:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDXE2YA5nEs8g5E+gtFw7UnFjYQs2twgZOJN4uhZ75+cf9xESAwL6lWBKrENNetG40XFLQnkdwZpJ7dS4v5PwIL9iWe+3oGwTrETEAUw== X-Google-Smtp-Source: AGHT+IFFkNC7+7E5eRy3jcodFMl0EV8KAIn2oYGzNMcoEr0zEaj9a4s+LalP1HHiEXQmsSOOzdAN X-Received: by 2002:a17:906:d8a:b0:a55:b272:e90b with SMTP id m10-20020a1709060d8a00b00a55b272e90bmr3338653eji.35.1713986003683; Wed, 24 Apr 2024 12:13:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713986003; cv=pass; d=google.com; s=arc-20160816; b=awJcOcnwDbxAItQbTXOB/m2DmG5RZWw1vUKFOO/gehhSmRWGTV9NcI7Xbt+S2HU5DC WES1TOQei8IX84QDtA6MZIfzwGNzzGKWbGPijStwLFWBVtr5GH4/6o5uzKhNDhHUbuw6 3WG9dqybVzufDnuivIYzgPuhOXbywc4npbjymnJqkveIdCBkwo+LURWEJnjaV1s5hgMo hQdjHGEGgcILsMscYkiOr8l+e4LChjlzvAA1F1vxmg2yIX9aKuL3qVu1Yj/KqBQbAhSK BtlcBzCklV1+qzgaqPltwAbx62Q0zn7P4KLf4xmm2dy3UKYqu84ZaQUXgAxA0zeVzySs INPQ== 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=GNR5ZG45cMIWRKNGu0U/QMwlCmdiO6btpuWlJSoBvKI=; fh=sG9jhBHEsNc76hLve58zfxxmeh0GUKp4yFB8ltJHOnE=; b=t1ekhPMERTUJlDbGWYHJptb+AwWlZXt2Uk+wc7g9fV3onCM2xEZBRWfTqS2SFuTYtd cQJ7p2CTU4aOvjuxYhLfgMEquM8iC9KFBMVg4EjPiddKhbq4aOnV4VCWn8otP6PUgaNy DUZ59/W1YD31eThsph7rviSuyDOJzL3k/E2En3P4+5JIwwNZ7fp2Ybku2jLnj6e6BeJq xOc43ZhCWv6LMCfjoYELe5HCwz+RgfnQ/Z8/kD07rrL8hOflIJ6R8922TfyT56woVWLp 6X2ISdDMp2QDquY+ewClgvCPYz4P6q3SslFUd8UefacSGdm3niHc/ovq7XzHpguEVckR xyjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AWNuxc9M; 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-6782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6782-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bt15-20020a170906b14f00b00a52539d45edsi9010462ejb.470.2024.04.24.12.13.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 12:13:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AWNuxc9M; 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-6782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6782-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 43F041F21DDC for ; Wed, 24 Apr 2024 19:13:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EFC3F22EEF; Wed, 24 Apr 2024 19:12:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="AWNuxc9M" X-Original-To: linux-wireless@vger.kernel.org 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 6BF8A23776 for ; Wed, 24 Apr 2024 19:12:41 +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=1713985962; cv=none; b=hd8b4kuSr6afqrPTDWigXiWXVBGUGrbCbTsE4b3X+0YdaIOvikqsrmnja6LobOo4Y9idFpA+uUtW0NY9aFQErFsdE77JqzQkgu3xJr+ECL84pfgkTsp1yywbUgoTWYdNs5wikWMuEHL5CKBVb7xyeKFQZfxQdEQz2PZZPKvOHeE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713985962; c=relaxed/simple; bh=Xk9faGhdQ79IG4WEfm1+3Q4cx6D0wZ1JUIBDFNym32g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LJlgGL6rmBGfX1aMsCmnqzh0hijd6XTwlqxZ4xNOQapMxtwIMT3oHTcM2F5Cf0u4vFx0XkEFhrvSVnkQIrH/3VdAwiYgGnlGLUbxRI9qz6thG2lS1SMTdUf1iGCXmMK2tSI7Ti11jXBRCK9nq1DM48eR+s2uNCa0mMddGDd4DVw= 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=AWNuxc9M; 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 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 43OJB7P4004079; Wed, 24 Apr 2024 19:11:54 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=GNR5ZG45cMIWRKNGu0U/ QMwlCmdiO6btpuWlJSoBvKI=; b=AWNuxc9Mwpub/P9UrjRaVgdUrICLnTlnJNwV 0XpDNpQpm3ebadrYbbSnJdxnOHWpbIaPe8W9uhAlmacmCflM+nKq97sJCzGuBMFi 9xV+WflhLonXdR4xW1i3TuBvLIjKjakBSE0KybafR6MiP9ZIJloZqgu4bZoo32nt 2RJDXB5aRKgLnGDfnlyiBKYs5aUvSmVqjmZSHLy7ei04OTcU/QDDA2p9D17n10Es f5h3zFozI1GCWc9mW0cVZqPAHFIgvcHrQ9H41KlWErxnun6Qj9WPPVPPQgbKTDpv JwXC9kdpbmH4nySlK7Gpnb0WAc7GyANJ+0CDJJiPHb1NFITiQw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xpv9dhyt6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 19:11:54 +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 43OJBrlL015981 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 19:11:53 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.1544.9; Wed, 24 Apr 2024 12:11:53 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu Subject: [PATCH V3 6/6] wifi: ath12k: support SMPS configuration for 6 GHz Date: Wed, 24 Apr 2024 12:11:41 -0700 Message-ID: <20240424191141.32549-7-quic_pradeepc@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240424191141.32549-1-quic_pradeepc@quicinc.com> References: <20240424191141.32549-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-GUID: CozjNFerZD4feJH4BPnyINx0mQdFSqCM X-Proofpoint-ORIG-GUID: CozjNFerZD4feJH4BPnyINx0mQdFSqCM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-04-24_16,2024-04-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 suspectscore=0 impostorscore=0 mlxlogscore=999 bulkscore=0 clxscore=1015 phishscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404240091 Parse SMPS configuration from IEs and configure. Without this, SMPS is not enabled for 6 GHz band. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Pradeep Kumar Chitrapu --- drivers/net/wireless/ath/ath12k/mac.c | 29 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 65688e55c285..44e853893ec5 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -2086,13 +2086,18 @@ static void ath12k_peer_assoc_h_he_6ghz(struct ath12k *ar, ampdu_factor)) - 1; } -static inline int ath12k_get_smps_from_capa(const struct ieee80211_sta_ht_cap *ht_cap, - int *smps) +static int ath12k_get_smps_from_capa(const struct ieee80211_sta_ht_cap *ht_cap, + const struct ieee80211_he_6ghz_capa *he_6ghz_capa, + int *smps) { - if (!ht_cap->ht_supported) + if (!ht_cap->ht_supported && !he_6ghz_capa->capa) return -EOPNOTSUPP; - *smps = u16_get_bits(ht_cap->cap, IEEE80211_HT_CAP_SM_PS); + if (ht_cap->ht_supported) + *smps = u16_get_bits(ht_cap->cap, IEEE80211_HT_CAP_SM_PS); + else + *smps = le16_get_bits(he_6ghz_capa->capa, + IEEE80211_HE_6GHZ_CAP_SM_PS); if (*smps >= ARRAY_SIZE(ath12k_smps_map)) return -EINVAL; @@ -2103,10 +2108,11 @@ static inline int ath12k_get_smps_from_capa(const struct ieee80211_sta_ht_cap *h static void ath12k_peer_assoc_h_smps(struct ieee80211_sta *sta, struct ath12k_wmi_peer_assoc_arg *arg) { + const struct ieee80211_he_6ghz_capa *he_6ghz_capa = &sta->deflink.he_6ghz_capa; const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap; int smps; - if (ath12k_get_smps_from_capa(ht_cap, &smps)) + if (ath12k_get_smps_from_capa(ht_cap, he_6ghz_capa, &smps)) return; switch (smps) { @@ -2580,11 +2586,12 @@ static void ath12k_peer_assoc_prepare(struct ath12k *ar, static int ath12k_setup_peer_smps(struct ath12k *ar, struct ath12k_vif *arvif, const u8 *addr, - const struct ieee80211_sta_ht_cap *ht_cap) + const struct ieee80211_sta_ht_cap *ht_cap, + const struct ieee80211_he_6ghz_capa *he_6ghz_capa) { int smps, ret = 0; - ret = ath12k_get_smps_from_capa(ht_cap, &smps); + ret = ath12k_get_smps_from_capa(ht_cap, he_6ghz_capa, &smps); if (ret < 0) return ret; @@ -2637,7 +2644,8 @@ static void ath12k_bss_assoc(struct ath12k *ar, } ret = ath12k_setup_peer_smps(ar, arvif, bss_conf->bssid, - &ap_sta->deflink.ht_cap); + &ap_sta->deflink.ht_cap, + &ap_sta->deflink.he_6ghz_capa); if (ret) { ath12k_warn(ar->ab, "failed to setup peer SMPS for vdev %d: %d\n", arvif->vdev_id, ret); @@ -3944,7 +3952,8 @@ static int ath12k_station_assoc(struct ath12k *ar, return 0; ret = ath12k_setup_peer_smps(ar, arvif, sta->addr, - &sta->deflink.ht_cap); + &sta->deflink.ht_cap, + &sta->deflink.he_6ghz_capa); if (ret) { ath12k_warn(ar->ab, "failed to setup peer SMPS for vdev %d: %d\n", arvif->vdev_id, ret); @@ -8766,7 +8775,7 @@ static int ath12k_mac_hw_register(struct ath12k_hw *ah) * for each band for a dual band capable radio. It will be tricky to * handle it when the ht capability different for each band. */ - if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS) + if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz) wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS; wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID; -- 2.17.1