From patchwork Mon Nov 14 20:19:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 625472 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7479EC4332F for ; Mon, 14 Nov 2022 20:19:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237534AbiKNUTf (ORCPT ); Mon, 14 Nov 2022 15:19:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237527AbiKNUT3 (ORCPT ); Mon, 14 Nov 2022 15:19:29 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37F3E138 for ; Mon, 14 Nov 2022 12:19:28 -0800 (PST) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AEJumbM031918; Mon, 14 Nov 2022 20:19:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=XkwC1tjp8mBwQXMFVTcAc8jop9rJhH315qvrWFxW6T4=; b=QjI5TKYx8OkrJoGkqV+/+Y4Flz9FQLKc6W7vr5wPK2mgOW0Xl0XSJGcp/RGiLXr7XgG9 2A7hJ4T7OCFxGYwgywBIq3agRgL3ZKIKYC6aBj57sGMrbE1ASoQ2WbSq8SdBiLRDwNdE utA/nGOnmxeC67xW1nblCeBGzaQ7zGIcu2cSNY+02w8T6tXSCGqov/cSGhZSscHRvhpC jRxlqKPuFSsDd0F6DwFqSFGBJG1ZW/gj2p7gsZnGRmwvnChfEaJHeQTRi2qjHRDj1cO/ S7jb6AGOBne+4sbkgKvAvH8wJ8fdEfPCWai8hZbU6WmzfNZhyVh6Gvxc511CHVit8VbQ qQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3kus8cgku0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Nov 2022 20:19:25 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2AEKJN5B028462 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Nov 2022 20:19:24 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 14 Nov 2022 12:19:23 -0800 From: Aloka Dixit To: , Subject: [PATCH v2 08/10] ath11k: move vif parameter setting in a different function Date: Mon, 14 Nov 2022 12:19:10 -0800 Message-ID: <20221114201912.22893-9-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221114201912.22893-1-quic_alokad@quicinc.com> References: <20221114201912.22893-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: hWddIsEsQzOYXify49bQtl8m_eJG-W9_ X-Proofpoint-ORIG-GUID: hWddIsEsQzOYXify49bQtl8m_eJG-W9_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-14_13,2022-11-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211140143 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Move the configuration of struct ath11k_vif parameters rsnie_present, and wpaie_present to a separate function. Tested-on : IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1 Signed-off-by: Aloka Dixit --- v2: Changed calls to mac80211 APIs to include MLO link ID. drivers/net/wireless/ath/ath11k/mac.c | 41 ++++++++++++++++----------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 64886f9a0358..eef7fe61b7d9 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1353,28 +1353,14 @@ static int ath11k_mac_op_config(struct ieee80211_hw *hw, u32 changed) return ret; } -static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) +static void ath11k_mac_setup_bcn_tmpl_vif_params(struct ath11k_vif *arvif, + struct sk_buff *bcn) { - struct ath11k *ar = arvif->ar; - struct ath11k_base *ab = ar->ab; - struct ieee80211_hw *hw = ar->hw; - struct ieee80211_vif *vif = arvif->vif; - struct ieee80211_mutable_offsets offs = {}; - struct sk_buff *bcn; struct ieee80211_mgmt *mgmt; u8 *ies; - int ret; - - if (arvif->vdev_type != WMI_VDEV_TYPE_AP) - return 0; - - bcn = ieee80211_beacon_get_template(hw, vif, &offs, 0); - if (!bcn) { - ath11k_warn(ab, "failed to get beacon template from mac80211\n"); - return -EPERM; - } ies = bcn->data + ieee80211_get_hdrlen_from_skb(bcn); + mgmt = (struct ieee80211_mgmt *)bcn->data; ies += sizeof(mgmt->u.beacon); if (cfg80211_find_ie(WLAN_EID_RSN, ies, (skb_tail_pointer(bcn) - ies))) @@ -1388,7 +1374,28 @@ static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) arvif->wpaie_present = true; else arvif->wpaie_present = false; +} + +static int ath11k_mac_setup_bcn_tmpl(struct ath11k_vif *arvif) +{ + struct ath11k *ar = arvif->ar; + struct ath11k_base *ab = ar->ab; + struct ieee80211_hw *hw = ar->hw; + struct ieee80211_vif *vif = arvif->vif; + struct ieee80211_mutable_offsets offs = {}; + struct sk_buff *bcn; + int ret; + + if (arvif->vdev_type != WMI_VDEV_TYPE_AP) + return 0; + + bcn = ieee80211_beacon_get_template(hw, vif, &offs); + if (!bcn) { + ath11k_warn(ab, "failed to get beacon template from mac80211\n"); + return -EPERM; + } + ath11k_mac_setup_bcn_tmpl_vif_params(arvif, bcn); ret = ath11k_wmi_bcn_tmpl(ar, arvif->vdev_id, &offs, bcn); kfree_skb(bcn);