Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6960588rdb; Tue, 2 Jan 2024 22:38:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGONuqXy3Sw3eA0qhIyoTQY8RMzCYYYGjS2ulfohYOaplFHP9WnSS/FMcpzImkj4I4hAmsz X-Received: by 2002:a05:620a:2584:b0:781:ae70:a1d2 with SMTP id x4-20020a05620a258400b00781ae70a1d2mr7204024qko.119.1704263918598; Tue, 02 Jan 2024 22:38:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704263918; cv=none; d=google.com; s=arc-20160816; b=zxcC5OerJ0MOiH3sEwqr5f4VtPFbVVgamx6napapho07scgkENWD7h7ZTAme6Kc1Bc N7JiVdHv9/W9J3g8+HzOyzjX3+Mdt5g5Cq/Pha7cUcE3e6USGgQGrFsG2/NHrUKly8tm piFnVKZgUxsj+ymSA3L11/7c/6bPiEQuL3BpXWjQZ5nejYtclggQAWWakBU3+7uaON8q 0gadMlhVKaiRTM9Hyutbmcp5ofjvHhKc+7x8eqODrdpos2gkMaL9PEZMjZ2N2EebE2nw F/NSRiWjCGiZY+4ZUp+z3BvFQ1OhkkDe/1Q1j0UrP0CbNufSanH+uQcvu0horYkhq1N2 FeTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=6mtgjMrHnorYxe7ayCJzySEgYbdMD5ryqzkqWuNmhR4=; fh=MxTMBbpPis+LJg6f98kFxxaQtu01YonzaHniHOzTjro=; b=bkHaOTx18HskQpPzGxkqLlJ6xnwpHQkcynCB47jgvEZx6C9JGQyC0tw7sbrBR9ncTQ qFHBka5Za108anx/vntQM7iZh4+MYiSMLwwSxXYYk6BBoyqiRV/Vocw/+B6a8kxfElUy gnwh0lQQUZz0kgafxcv/NSzFATuf8VIjyoEKkhwOk6Ec2GZ0W/Zfj101LuHdaHDGamQ2 7l2rOBLscJiLYhFYZaXJy/3+WPD4l4t8RuHOxZpzeERwrWvC7cwJNXBy9yCeNkIJ4enE XlQKYpo5ywbADgHCpR68YflcU/mphRy/261/VE0inJHoo3jI2yifucx6UrJHGz88ETZy vHFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LYV102nO; spf=pass (google.com: domain of linux-wireless+bounces-1432-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c20-20020a05620a135400b00781c8308ca4si5202263qkl.337.2024.01.02.22.38.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 22:38:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1432-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LYV102nO; spf=pass (google.com: domain of linux-wireless+bounces-1432-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1432-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5D6181C22F54 for ; Wed, 3 Jan 2024 06:38:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47088182DF; Wed, 3 Jan 2024 06:38:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="LYV102nO" 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 E7E56182AA for ; Wed, 3 Jan 2024 06:38:06 +0000 (UTC) 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 (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4036MLls013700; Wed, 3 Jan 2024 06:38:05 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=6mtgjMrHnorYxe7ayCJzySEgYbdMD5ryqzkqWuNmhR4=; b=LY V102nO9QddAKn91rv5B2DJskPWyAojh9qJvAiIIlWN+5tlmV0qZ4R0GVjzKLUCD+ 71qdi42Jzde5enR8QmAzetlYubBD95vpTqJcv5KaHF4GQIvErscNWQa4U+14BlCr zoHIETxejC7wyqTubCzUSvHF6w23Q0Dl0chxnOwKt6V/EK2vhaC/M0BehIKyGV6j 2SwApXFF1FmUQ+NXJCBEZumrN1x6bBDZJnzsI1mUKggbO805vc9MA46OcHDmsRa/ n9ng1byYkUd5B4bpMxdJyRuCdc1b4mj221DGkrnj1ufRva8ZB3JVrZIfLJj6U0QT PnwHEPES3deKHSlV8aiw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vd27yg1ex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Jan 2024 06:38:04 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4036c4JK009960 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 3 Jan 2024 06:38:04 GMT Received: from hu-periyasa-blr.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; Tue, 2 Jan 2024 22:38:02 -0800 From: Karthikeyan Periyasamy To: CC: , Karthikeyan Periyasamy Subject: [PATCH 08/10] wifi: ath12k: Refactor mac callback of ampdu action Date: Wed, 3 Jan 2024 12:07:29 +0530 Message-ID: <20240103063731.3356060-9-quic_periyasa@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240103063731.3356060-1-quic_periyasa@quicinc.com> References: <20240103063731.3356060-1-quic_periyasa@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: DetE6UMgI7S1FeesTy8_X4IokACohyux X-Proofpoint-ORIG-GUID: DetE6UMgI7S1FeesTy8_X4IokACohyux X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 mlxlogscore=556 adultscore=0 clxscore=1015 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401030053 To support single wiphy abstraction, introduce link/radio specific helper function in the mac80211 callback ampdu_action(). This way, the callback can be extended to handle multiple link/radio in the future. 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-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Karthikeyan Periyasamy --- drivers/net/wireless/ath/ath12k/mac.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 1566b43029cd..c505bac365f6 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -5901,14 +5901,13 @@ static int ath12k_mac_op_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx return ret; } -static int ath12k_mac_op_ampdu_action(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ieee80211_ampdu_params *params) +static int ath12k_mac_ampdu_action(struct ath12k_vif *arvif, + struct ieee80211_ampdu_params *params) { - struct ath12k *ar = hw->priv; + struct ath12k *ar = arvif->ar; int ret = -EINVAL; - mutex_lock(&ar->conf_mutex); + lockdep_assert_held(&ar->conf_mutex); switch (params->action) { case IEEE80211_AMPDU_RX_START: @@ -5929,8 +5928,25 @@ static int ath12k_mac_op_ampdu_action(struct ieee80211_hw *hw, break; } + return ret; +} + +static int ath12k_mac_op_ampdu_action(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_ampdu_params *params) +{ + struct ath12k *ar = hw->priv; + struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif); + int ret = -EINVAL; + + mutex_lock(&ar->conf_mutex); + ret = ath12k_mac_ampdu_action(arvif, params); mutex_unlock(&ar->conf_mutex); + if (ret) + ath12k_warn(ar->ab, "pdev idx %d unable to perform ampdu action %d ret %d\n", + ar->pdev_idx, params->action, ret); + return ret; } -- 2.34.1