Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp147688lqz; Fri, 29 Mar 2024 11:20:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXAX916oKJHnBUgNzH9ghH6EtXAV1SpV4HP43/Y2WZlBMCQjuLdLpZwzQdyGXlgcNpY0WaSDkt/BENkuWI1fn1Qw4BX0k9Ncy4nBifcYQ== X-Google-Smtp-Source: AGHT+IEzTu+wE6vAgdXeYageb97O36A8OB4lEH/r0szkNqtxHDbdXqoprz6NrPjD7ZJQWFwNvCOq X-Received: by 2002:a17:902:bd42:b0:1e0:2b2c:2e45 with SMTP id b2-20020a170902bd4200b001e02b2c2e45mr2841539plx.49.1711736456334; Fri, 29 Mar 2024 11:20:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711736456; cv=pass; d=google.com; s=arc-20160816; b=PatDgniYaSj20gtNkKUMm/Y9NYPXVogUw31DmxEXq0ZrzBCPKTsDa8Y1bgoWPFG959 XoTvJv8CioetAfNAumQQL3weOYZbYXdNybc/7jIVlG5Kg4qSIw/Jh59dhbpowDEvXXOF dUdrT7b0b8aLvnH0ra+BjBIi/NjY6oehBaT+6Ev/CBS15edZ4YTifgPeDYVRwS1a1L4D gc4KLFcSJLTqU0+hD9EmanrjIsb5py9afDCna9BdZUppZWYCdRIVBGcobNXuFeljwCiK /I7cWdvO67+SC4VOdfgDZtTXo1uMF6eLFtDuU4rWqUH3evg3ubozVLBjlD0k6NhUdEqq BmiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=BGIi56S4cHYx60VIaqFluzUsNJwImiynIgSRpvsBCX4=; fh=UGEvyA8ZsS5Xti6/JCuQm9GweAGKKrHrNwT0M2duaDU=; b=dhxBRaF1/n5tBIG8+nChex9MP/lSfj0ybBN+JQBQyqycxuRpns3oXcwlqBN68unvvD 5jE51kOdYRLHOAf5nhq7+xIcBl2T+8cUK/H6faN8k/yWtBnBjDUrdHgJQLmPQhnx92I8 QZEo9Zz0FyeYYM5lTCTW/ptEhIx7V/ywfwTC6U+bVTZikIJotbhQw2aarlyL7oVQpy/K Pz44R9wdBDG2tQduOBrq56vjKLExsdrN9yAmoiUQgmRc7Qv728NgC3/ZD0uTMOwEjLLp NXO9OdOnJOemNksumAz9uLRNIf6S2X1kCnVP/MVoW8KqvpaZm7PHKiEXxTjoUj8SswLL Y2Pg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MGXxKrLM; 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-5619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5619-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c4-20020a170903234400b001e0ccfd7816si4258017plh.532.2024.03.29.11.20.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 11:20:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-5619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MGXxKrLM; 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-5619-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-5619-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 34480B2134B for ; Fri, 29 Mar 2024 18:20:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 597F38565D; Fri, 29 Mar 2024 18:20:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="MGXxKrLM" 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 D40A541206 for ; Fri, 29 Mar 2024 18:20:49 +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=1711736451; cv=none; b=Nd32I06e31gbjIkjDQ9NH5/AlninfH1S6YIBUn2gfUz0AOp6F8923oqqbdQo5061EVdaMNFPoUkM23OssYmYcGd4Ee+PFIB/jPqnv2/VjmR6dQKUoEvla0GgyHeNpLVPjNweX+MX2p8aAeFooD+enD0zRU+Cwdh9nFtZd3PArds= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711736451; c=relaxed/simple; bh=boFoSsVM2rVyX1CYu9KgTui1U/h24BvBeCzVUIc+77E=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=E8+UXtycqn+DjHz9lz9USFhuWQL78twkBNfF8MkVaccODZt1rRalAOkCmemu7rKPWfc/BtOnPAydWHkVNlxVPnq35WiVpcXhiheiHHbjHR7z+NcbObr16eGv97cZ05GDdi8RpIa2OFOnHcX5x1TQivjJWThrE02qO/2PTgqQenY= 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=MGXxKrLM; 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 (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42THfAia007617; Fri, 29 Mar 2024 18:20:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=BGIi56S4cHYx60VIaqFluzUsNJwImiynIgSRpvsBCX4=; b=MG XxKrLMNk9ocWx8ojYQLiPdRqK/mgJrITrePG0CP36+Puex1xfOi0fBv+Rgeu42CW dIt2IMEtsKTze30ywUqa9fBMJV3YsZna90JwroD5OWx70PeLngiFeCFjclkWV13a e4GjSMOu7bOahL6vJ56djK7s9QYlRojuBjq/xyHvoI2v9mzMp7kkxtrmXLuZ2ddH tx8UqTvyZebCkYXAhQ5DUc0XlwvGFEm+Qnjjs5VLREFbFshQXB8hkZyJ6ZPA4rVx yIc0RewVwWua7Q49B4SbIzOyzPoPEsA1WHd8UscwGx0Zko1drsPC14UZsg58UmLG BQ+Wwb2mFLo1/k+HMlvA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3x5np2a339-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Mar 2024 18:20:47 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42TIKk46001962 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Mar 2024 18:20:46 GMT Received: from [10.110.124.221] (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; Fri, 29 Mar 2024 11:20:46 -0700 Message-ID: Date: Fri, 29 Mar 2024 11:20:45 -0700 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 5/6] wifi: ath12k: refactor smps configuration Content-Language: en-US To: Pradeep Kumar Chitrapu , CC: References: <20240329173926.17741-1-quic_pradeepc@quicinc.com> <20240329173926.17741-6-quic_pradeepc@quicinc.com> From: Jeff Johnson In-Reply-To: <20240329173926.17741-6-quic_pradeepc@quicinc.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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: 6cfo8GvaKZRe1osxuOWRzBNR497u9KYm X-Proofpoint-GUID: 6cfo8GvaKZRe1osxuOWRzBNR497u9KYm 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-29_13,2024-03-28_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 spamscore=0 bulkscore=0 mlxscore=0 malwarescore=0 clxscore=1015 suspectscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2403210001 definitions=main-2403290163 On 3/29/2024 10:39 AM, Pradeep Kumar Chitrapu wrote: > Move fetching smps value to a new function and use u16_get_bits s/smps/SMPS/ here and in the next line > to extract smps value from capabilities. This will help in > extending the functionality when SMPS support in 6 GHz band gets > added in subsequent patches. > > Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 > > Signed-off-by: Pradeep Kumar Chitrapu > --- > drivers/net/wireless/ath/ath12k/mac.c | 32 ++++++++++++++++----------- > 1 file changed, 19 insertions(+), 13 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c > index 7e296140439a..b4114dd22bf0 100644 > --- a/drivers/net/wireless/ath/ath12k/mac.c > +++ b/drivers/net/wireless/ath/ath12k/mac.c > @@ -1963,18 +1963,29 @@ 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, remove inline since it is static the compiler will inline it if it makes sense to do so (doesn't that fix the ath12k-check issue in the 6/6 patch)? > + int *smps) > +{ > + if (!ht_cap->ht_supported) > + return -EOPNOTSUPP; > + > + *smps = u16_get_bits(ht_cap->cap, IEEE80211_HT_CAP_SM_PS); > + > + if (*smps >= ARRAY_SIZE(ath12k_smps_map)) > + return -EINVAL; > + > + return 0; > +} > + > static void ath12k_peer_assoc_h_smps(struct ieee80211_sta *sta, > struct ath12k_wmi_peer_assoc_arg *arg) > { > const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap; > int smps; > > - if (!ht_cap->ht_supported) > + if (ath12k_get_smps_from_capa(ht_cap, &smps)) > return; > > - smps = ht_cap->cap & IEEE80211_HT_CAP_SM_PS; > - smps >>= IEEE80211_HT_CAP_SM_PS_SHIFT; > - > switch (smps) { > case WLAN_HT_CAP_SM_PS_STATIC: > arg->static_mimops_flag = true; > @@ -2448,16 +2459,11 @@ static int ath12k_setup_peer_smps(struct ath12k *ar, struct ath12k_vif *arvif, > const u8 *addr, > const struct ieee80211_sta_ht_cap *ht_cap) > { > - int smps; > + int smps, ret = 0; > > - if (!ht_cap->ht_supported) > - return 0; > - > - smps = ht_cap->cap & IEEE80211_HT_CAP_SM_PS; > - smps >>= IEEE80211_HT_CAP_SM_PS_SHIFT; > - > - if (smps >= ARRAY_SIZE(ath12k_smps_map)) > - return -EINVAL; > + ret = ath12k_get_smps_from_capa(ht_cap, &smps); > + if (ret < 0) > + return ret; > > return ath12k_wmi_set_peer_param(ar, addr, arvif->vdev_id, > WMI_PEER_MIMO_PS_STATE,