From patchwork Mon Mar 10 20:02:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 14010591 X-Patchwork-Delegate: johannes@sipsolutions.net 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 50CD71CD205 for ; Mon, 10 Mar 2025 20:02:46 +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=1741636968; cv=none; b=KwS/ELgIoR5n/mu6nF/2XTk5gCBAuwIAR8K3sBU7uFfLkUwCUT20BdoSN9htDAFE286jXvpiAgsr6o5bXJvqvcHNunJMzA/b4Zd/RypzpJbY3Ec1DKjSFvE9301LLZ9p9P0TPYVfb+IK38n9ZaSMhwqr42ICih0etx+unvpeX+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741636968; c=relaxed/simple; bh=RVdGRhcjf3Ir0WT5VtfPAR24+Tt0G/5RlYlntd0kF4c=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZtWmhONGdPoGlL/LTiCfOJg82wN0nnTr8GAaPpBOMOY1ebxpfbKcUXLVRXHNnm4QKTCIBl7JuT9XDuTvJ7wdMMWtzz39EZv4CzR2ShmlJHU1iFjboCDuKPywDvg9cySYMchtghgvZA2UideWsxHnNXr8ZHfJlbBv+Z0Vz+Ow/00= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=bQkMxjrE; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="bQkMxjrE" 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 52AIdV0C025100 for ; Mon, 10 Mar 2025 20:02:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=ocngaqNuTAm FDtQ/nMV7R7IQxYddeURnB+NCuAeJxDc=; b=bQkMxjrE+aIY7f5CVBT6y3z8BJV baYMO+blcPkp7ZjMK/JeN7e8kjbm7/6MgRQRbx6GAbKmCXa4Nnj4D+fABjvRKZYZ al/MRWfRYWkAu56cov6HIVUrPEMKrbeKPpqIRDv7539GN8z2X31B/A7KxkSmjoXQ d6o3dTbXhkg+yuNUyfiW+B82K5hxHwe8AssxN/bhwWmja1TMQONPSFrBRiotbPvc FVbfh0t1cUgYCDcSIYkMXcuGPn8cCUz7aPUwxyYmIDM0gOq921e+D66LY+K1Xjr+ QOfWbs28la5WHI4vG895qJQGskZyRt33IXzTWESkT4wN376alX1GE0NSqrg== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 458ex6x1v7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 10 Mar 2025 20:02:45 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-2ff58318acaso13226878a91.0 for ; Mon, 10 Mar 2025 13:02:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741636964; x=1742241764; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ocngaqNuTAmFDtQ/nMV7R7IQxYddeURnB+NCuAeJxDc=; b=c6DCWdxlMDb4aHkuv4W2+nTThinR3G9kJNa6OBWMWVhXpqrLDzek7GgLoVWhtMqEth m9kLtFBNekEaLIPnC2jQpmiO6zUfIp19pdwoW/QPRF9vwgtvckCXtP2AcxzPEPJ+ZTKU C95mj3tuCSiEhz8VGRH1sKuxBb1cfXr5bZO9t0A85xqPENkoHiGoj7ZL/FvUNWEWNk94 wga+gJsiuz2fZi6D1OyZsay+vweOdtg9W8o6rCRlTR1+5sDwE0XxRSTzlzfvwxhhCA0O dKK35cFQKl2/GPVP2ca72d3epx40QT1YB/PDSV20iYJlcycPqhpopS+hnWBxXPdGo6jh TUlA== X-Gm-Message-State: AOJu0YxSS2B5SKBZsHYB80YtQ4RBLIKIqYifqDgYIJ+OL0cXiQZQa1T8 Y6q3nh8AgMfXXJ9RUhf0szQMpcSFdyb04BwkUiSfIskJIkNDGbX6gsOp/QlxzIGrhz2aVrdyu7x TMtBViTFjO9Hu+Fo9o8reGtjvna+dN+zMY3y2WyaFivGMAgmEGy9R3kaVl8KCd8MXNg72qhGonQ == X-Gm-Gg: ASbGncsuqLWlRup/5UXB5klHpa9d3sZKDgNhTL/EnONZsB0CVf/gB31i2nmBV3NKdAr ZdizDG0j6nmHtMLfOYwLNC3z9cMJqp/89EpT3l8+K1GQ9MLPhwb3lFOz4G6ewhMWqy/vhA5s/dJ qB5Apv2Foh491esmniG8bp+wLlexn7dJHaYkuSUHjnosU3G7Om6W7cH7DGhmYRbNVNCrIZ/j7O6 F+KvybiLDgUE0XqYgB1psDDaWClrad77pzbo5j1Xl6hYaNqXGy37/8t+ZvIfSAB85LWuU6tWmCi nGXNbc81Q72Zqlk/HwcaHU5V0XzKjPvgOOjEqOvA6/P45u+S0uCNYGSxS1CbNZYx7AvWnpA= X-Received: by 2002:a05:6a20:72a5:b0:1f0:e7e2:b295 with SMTP id adf61e73a8af0-1f544acd6a7mr17950239637.5.1741636962024; Mon, 10 Mar 2025 13:02:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPVM55Ipm+xg8CMpt0MVYTdLPhq0VahYP883c6p2nk/KwVbYVK9hWRJxAp3Mx4wa3aPTOijw== X-Received: by 2002:a05:6a20:72a5:b0:1f0:e7e2:b295 with SMTP id adf61e73a8af0-1f544acd6a7mr17950208637.5.1741636961690; Mon, 10 Mar 2025 13:02:41 -0700 (PDT) Received: from alokad-linux.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-736cbe3fb3fsm3730419b3a.83.2025.03.10.13.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Mar 2025 13:02:41 -0700 (PDT) From: Aloka Dixit To: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, ath11k@lists.infradead.org Cc: Rameshkumar Sundaram , Muna Sinada , Aloka Dixit Subject: [PATCH v4 1/3] wifi: nl80211: add link id of transmitted profile for MLO MBSSID Date: Mon, 10 Mar 2025 13:02:35 -0700 Message-Id: <20250310200237.652950-2-aloka.dixit@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250310200237.652950-1-aloka.dixit@oss.qualcomm.com> References: <20250310200237.652950-1-aloka.dixit@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Authority-Analysis: v=2.4 cv=G8bmE8k5 c=1 sm=1 tr=0 ts=67cf4565 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=diLcHdusufV46o6eeBsA:9 a=N3MwnUSRF2nazewGnDsO:22 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-GUID: mT4suaRxNxTlbCjC97sMMDOCm046caMe X-Proofpoint-ORIG-GUID: mT4suaRxNxTlbCjC97sMMDOCm046caMe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-10_07,2025-03-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 phishscore=0 malwarescore=0 mlxscore=0 suspectscore=0 clxscore=1015 bulkscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 impostorscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503100155 From: Rameshkumar Sundaram During non-transmitted (nontx) profile configuration, interface index of the transmitted (tx) profile is used to retrieve the wireless device (wdev) associated with it. With MLO, this 'wdev' may be part of an MLD with more than one link, hence only interface index is not sufficient anymore to retrieve the correct tx profile. Add a new attribute to configure link id of tx profile. Signed-off-by: Rameshkumar Sundaram Co-developed-by: Muna Sinada Signed-off-by: Muna Sinada Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- include/net/cfg80211.h | 2 ++ include/uapi/linux/nl80211.h | 6 ++++++ net/wireless/nl80211.c | 14 ++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 6b170a8d086c..0f7a4f410d45 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1286,11 +1286,13 @@ struct cfg80211_crypto_settings { * struct cfg80211_mbssid_config - AP settings for multi bssid * * @tx_wdev: pointer to the transmitted interface in the MBSSID set + * @tx_link_id: link ID of the transmitted profile in an MLD, default is 0. * @index: index of this AP in the multi bssid group. * @ema: set to true if the beacons should be sent out in EMA mode. */ struct cfg80211_mbssid_config { struct wireless_dev *tx_wdev; + u8 tx_link_id; u8 index; bool ema; }; diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 9d8ecf20ef0d..ed2a181a2557 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -8022,6 +8022,11 @@ enum nl80211_sar_specs_attrs { * Setting this flag is permitted only if the driver advertises EMA support * by setting wiphy->ema_max_profile_periodicity to non-zero. * + * @NL80211_MBSSID_CONFIG_ATTR_TX_LINK_ID: Link ID of the transmitted profile. + * This parameter is mandatory if the transmitted profile is part of an MLD + * and the interface getting configured is a non-transmitted profile. For all + * other cases it will be ignored. + * * @__NL80211_MBSSID_CONFIG_ATTR_LAST: Internal * @NL80211_MBSSID_CONFIG_ATTR_MAX: highest attribute */ @@ -8033,6 +8038,7 @@ enum nl80211_mbssid_config_attributes { NL80211_MBSSID_CONFIG_ATTR_INDEX, NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX, NL80211_MBSSID_CONFIG_ATTR_EMA, + NL80211_MBSSID_CONFIG_ATTR_TX_LINK_ID, /* keep last */ __NL80211_MBSSID_CONFIG_ATTR_LAST, diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 2c4e06610a79..0ebbce9fbaf4 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -469,6 +469,8 @@ nl80211_mbssid_config_policy[NL80211_MBSSID_CONFIG_ATTR_MAX + 1] = { [NL80211_MBSSID_CONFIG_ATTR_INDEX] = { .type = NLA_U8 }, [NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX] = { .type = NLA_U32 }, [NL80211_MBSSID_CONFIG_ATTR_EMA] = { .type = NLA_FLAG }, + [NL80211_MBSSID_CONFIG_ATTR_TX_LINK_ID] = + NLA_POLICY_MAX(NLA_U8, IEEE80211_MLD_MAX_NUM_LINKS), }; static const struct nla_policy @@ -5561,6 +5563,18 @@ static int nl80211_parse_mbssid_config(struct wiphy *wiphy, } config->tx_wdev = tx_netdev->ieee80211_ptr; + + if (config->tx_wdev->valid_links) { + if (!tb[NL80211_MBSSID_CONFIG_ATTR_TX_LINK_ID]) + return -ENOLINK; + + config->tx_link_id = + nla_get_u8(tb[NL80211_MBSSID_CONFIG_ATTR_TX_LINK_ID]); + + if (!(config->tx_wdev->valid_links & + BIT(config->tx_link_id))) + return -ENOLINK; + } } else { config->tx_wdev = dev->ieee80211_ptr; } From patchwork Mon Mar 10 20:02:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 14010593 X-Patchwork-Delegate: johannes@sipsolutions.net 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 6576A1C5F1B for ; Mon, 10 Mar 2025 20:03:04 +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=1741636986; cv=none; b=hBov+POUt2/08fnqHTGxot1Y0AxMtr7BaUBs1OR1+N/TG1LtCmyPss7qWLO9xvRW2e9ozNFTOj3bvnUXl+1MfMd4doIWYTyaeXc5DOTPC0gzDKgpsEzZhMtpaPv2LlFG6hkIGGPBGKuGuhe7eIsny/ndMhvSwsfICMsd7v6wMY0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741636986; c=relaxed/simple; bh=pAJ5QKq30G3KiD0Sl+Cq+xTa5UngGfKmfAwe2Bfmgf0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pg0gXNJrBUuxC+F4k919UhzQLngX1C8ZP5zj/pMDdkliB2S9+m4y4M0IpCcu4AFZTVU1Bva/9X1kttqjCVDcVdca0RY1IpWHa9CEa2mw4+lirTBhmO2FVjIoC5euT8FxReKtL3IkZqfCoMx1nvddw0lSCizwKDaeo9K2Ji0zLCI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Wooyv9uu; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Wooyv9uu" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52AJUfZr026807 for ; Mon, 10 Mar 2025 20:03:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=S79CPSYbAlP EM+1hCV8/ZAXzHytaMLVa0S+9cZNXjHs=; b=Wooyv9uuDFPW23hVQUrC0SW7GvL rWsaOtGAuauF6RJV+iyzwRfCDz0kg1KxJNDTNO92TyQMjDC/wWQ7XTwuV9dxyzie zoc/QJN89tfs+qxGR0O9jDGitLVjCUJw/Fyb95mPhVaHsoC0Hb6o6uyOWU5R4ttP HOngnAWoLUKLw/0PD/8Yyz3BeZ2JYEGDmwbGbO2p9P9lzVeIwggaE3B4LDLOl3f5 51BVMfnKucpZrixTQQ6pL9npH8YtU6+O2/Ne1BX7GNkfxtBNlakX2xodP7lw+51b +9DMW1pRD0KDtF7/5tgCnJg7MuCg6H9OBhOYF5NgiR+UqDu+ZO9pXVtlcjw== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 458f0pwykp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 10 Mar 2025 20:03:02 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-225505d1ca5so33117565ad.2 for ; Mon, 10 Mar 2025 13:03:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741636963; x=1742241763; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S79CPSYbAlPEM+1hCV8/ZAXzHytaMLVa0S+9cZNXjHs=; b=vY+Iwm/DF7yj3M54qRD0N0JB0Br1pINHDEr6UJ3os7c0Osc56KpNgGLQ4xO1d7CYzw uXXPVMGxzXa5W2AC6bZnc53lyVrk4lZJzXrwBHwdG9eAL8t6WSIDLzHVnlqrIlfwMla1 WL6PLdcP/FvL9bZmwlNhlZciGVjXEp6hSoCbKdzlwML8wKkSzwBOIV6+5V39J+WlV9hl nkBL3t73qAwjKoDy0GzuAgpsXqbJLalRQBahNRcj5gsaQNk5zcKwrMUYtQiEh6FQ1EK7 FmUy8p84rIorHXQjkmmZ4zIS366etqWOXowr4+jjM8/2+ynEtIlf6+mHqEeiAL7kbHmG Y1Jw== X-Gm-Message-State: AOJu0YxrmRD2IKBzmfxT7VVOZCZjE6v0oUTcp2yZ4jGCHoscIPyB22mo vsuAtG7hWPJz4KggG/o3mEWWzDEpPTKeaspO9MgdudCgTTQnc0Ypm0V4OBQ7L+OfIcJROd5nW7U CAhIz5RAAYM1bLr742FU4+aJJgmMqLC9/QSCRrDy3aRr7bgTvohX+XNK+mbSaFLVTNml9C4g07w == X-Gm-Gg: ASbGncukIRYZB5ftl/Qo51AxgZzd34o3lEb5afCngugaXnXljmk3AijTBJ8LaU1CGfQ ESAoOdmYtSEZjnrGRZ74+SnFOzLL5HdwXEmHVtnQNx0xUDme5DjB22lKTrVmhxWtsvu0vT03hFi 85wOk4zJUT/XvUz9DWdbd9CGPwBw0BSCswedHxzEDgKMXQAfy8L3+PU6H7lsdjGNRiNjn6xEJSO w3He3wpNBYEGIq6bOgSzc8nUssbLRM3J0OL1D+ezjDYlHbNDn4WhS9w6iYQa0XB/5BB5NzGxR+y UVums0mgYBWc4eUXMhDn70nF5a6edtr7AmmYX7RCjRz3IKFbEsNatz2p/FLEx6+PDA3Lf5o= X-Received: by 2002:a05:6a00:88f:b0:736:7270:4d18 with SMTP id d2e1a72fcca58-736eb7efd4amr1337209b3a.14.1741636963261; Mon, 10 Mar 2025 13:02:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFXCq+vRnozdUctoKHLjwxtBxFPJeYy6YJ+VPqL2S9RbIQ2fVffLz0jTXfaYb2+hu27oRfGdw== X-Received: by 2002:a05:6a00:88f:b0:736:7270:4d18 with SMTP id d2e1a72fcca58-736eb7efd4amr1337176b3a.14.1741636962731; Mon, 10 Mar 2025 13:02:42 -0700 (PDT) Received: from alokad-linux.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-736cbe3fb3fsm3730419b3a.83.2025.03.10.13.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Mar 2025 13:02:42 -0700 (PDT) From: Aloka Dixit To: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, ath11k@lists.infradead.org Cc: Rameshkumar Sundaram , Muna Sinada , Aloka Dixit Subject: [PATCH v4 2/3] wifi: mac80211: restructure tx profile retrieval for MLO MBSSID Date: Mon, 10 Mar 2025 13:02:36 -0700 Message-Id: <20250310200237.652950-3-aloka.dixit@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250310200237.652950-1-aloka.dixit@oss.qualcomm.com> References: <20250310200237.652950-1-aloka.dixit@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: Iruq0BVvQsaX0d1dx3BH4t5JvXgy7keT X-Authority-Analysis: v=2.4 cv=KK2gDEFo c=1 sm=1 tr=0 ts=67cf4577 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=X_0Cl_4B8EXWqmMzkNwA:9 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: Iruq0BVvQsaX0d1dx3BH4t5JvXgy7keT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-10_07,2025-03-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 clxscore=1015 malwarescore=0 adultscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 spamscore=0 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503100155 From: Rameshkumar Sundaram For MBSSID, each vif (struct ieee80211_vif) stores another vif pointer for the transmitting profile of MBSSID set. This won't suffice for MLO as there may be multiple links, each of which can be part of different MBSSID sets. Hence the information needs to be stored per-link. Additionally, the transmitted profile itself may be part of an MLD hence storing vif will not suffice either. Fix MLO by storing an instance of struct ieee80211_bss_conf for each link. Modify following operations to reflect the above structure updates: - channel switch completion - BSS color change completion - Removing nontransmitted links in ieee80211_stop_mbssid() - drivers retrieving the transmitted link for beacon templates. Signed-off-by: Rameshkumar Sundaram Co-developed-by: Muna Sinada Signed-off-by: Muna Sinada Co-developed-by: Aloka Dixit Signed-off-by: Aloka Dixit --- drivers/net/wireless/ath/ath11k/mac.c | 10 ++- drivers/net/wireless/ath/ath12k/mac.c | 22 +++++- drivers/net/wireless/virtual/mac80211_hwsim.c | 7 +- include/net/mac80211.h | 7 +- net/mac80211/cfg.c | 64 ++++++++++------ net/mac80211/ieee80211_i.h | 2 + net/mac80211/iface.c | 73 +++++++++++++------ 7 files changed, 128 insertions(+), 57 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index 97816916abac..8191ee14a1fd 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1531,8 +1531,14 @@ static int ath11k_mac_set_vif_params(struct ath11k_vif *arvif, static struct ath11k_vif *ath11k_mac_get_tx_arvif(struct ath11k_vif *arvif) { - if (arvif->vif->mbssid_tx_vif) - return ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif); + struct ieee80211_bss_conf *link_conf, *tx_bss_conf; + + lockdep_assert_wiphy(arvif->ar->hw->wiphy); + + link_conf = &arvif->vif->bss_conf; + tx_bss_conf = wiphy_dereference(arvif->ar->hw->wiphy, link_conf->tx_bss_conf); + if (tx_bss_conf) + return ath11k_vif_to_arvif(tx_bss_conf->vif); return NULL; } diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index dfa05f0ee6c9..84da77bf245b 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -582,12 +582,26 @@ static int ath12k_mac_vif_link_chan(struct ieee80211_vif *vif, u8 link_id, static struct ath12k_link_vif *ath12k_mac_get_tx_arvif(struct ath12k_link_vif *arvif) { + struct ieee80211_bss_conf *link_conf, *tx_bss_conf; + struct ath12k *ar = arvif->ar; struct ath12k_vif *tx_ahvif; - if (arvif->ahvif->vif->mbssid_tx_vif) { - tx_ahvif = ath12k_vif_to_ahvif(arvif->ahvif->vif->mbssid_tx_vif); - if (tx_ahvif) - return &tx_ahvif->deflink; + lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); + + link_conf = ath12k_mac_get_link_bss_conf(arvif); + if (!link_conf) { + ath12k_warn(ar->ab, + "unable to access bss link conf for link %u required to retrieve transmitting link conf\n", + arvif->link_id); + return NULL; + } + + tx_bss_conf = wiphy_dereference(ath12k_ar_to_hw(ar)->wiphy, + link_conf->tx_bss_conf); + if (tx_bss_conf) { + tx_ahvif = ath12k_vif_to_ahvif(tx_bss_conf->vif); + return wiphy_dereference(tx_ahvif->ah->hw->wiphy, + tx_ahvif->link[tx_bss_conf->link_id]); } return NULL; diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index d0d9dab7f11f..40866098b531 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -2271,7 +2271,7 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, { struct mac80211_hwsim_link_data *link_data = arg; u32 link_id = link_data->link_id; - struct ieee80211_bss_conf *link_conf; + struct ieee80211_bss_conf *link_conf, *tx_bss_conf; struct mac80211_hwsim_data *data = container_of(link_data, struct mac80211_hwsim_data, link_data[link_id]); @@ -2290,10 +2290,11 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, vif->type != NL80211_IFTYPE_OCB) return; - if (vif->mbssid_tx_vif && vif->mbssid_tx_vif != vif) + tx_bss_conf = rcu_access_pointer(link_conf->tx_bss_conf); + if (tx_bss_conf && tx_bss_conf != link_conf) return; - if (vif->bss_conf.ema_ap) { + if (link_conf->ema_ap) { struct ieee80211_ema_beacons *ema; u8 i = 0; diff --git a/include/net/mac80211.h b/include/net/mac80211.h index c498f685d01f..f7ceba974749 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -682,6 +682,9 @@ struct ieee80211_parsed_tpe { * responder functionality. * @ftmr_params: configurable lci/civic parameter when enabling FTM responder. * @nontransmitted: this BSS is a nontransmitted BSS profile + * @tx_bss_conf: Pointer to the BSS configuration of transmitting interface + * if MBSSID is enabled. This pointer is RCU-protected due to CSA finish + * and BSS color change flows accessing it. * @transmitter_bssid: the address of transmitter AP * @bssid_index: index inside the multiple BSSID set * @bssid_indicator: 2^bssid_indicator is the maximum number of APs in set @@ -804,6 +807,7 @@ struct ieee80211_bss_conf { struct ieee80211_ftm_responder_params *ftmr_params; /* Multiple BSSID data */ bool nontransmitted; + struct ieee80211_bss_conf __rcu *tx_bss_conf; u8 transmitter_bssid[ETH_ALEN]; u8 bssid_index; u8 bssid_indicator; @@ -2023,7 +2027,6 @@ enum ieee80211_neg_ttlm_res { * @txq: the multicast data TX queue * @offload_flags: 802.3 -> 802.11 enapsulation offload flags, see * &enum ieee80211_offload_flags. - * @mbssid_tx_vif: Pointer to the transmitting interface if MBSSID is enabled. */ struct ieee80211_vif { enum nl80211_iftype type; @@ -2052,8 +2055,6 @@ struct ieee80211_vif { bool probe_req_reg; bool rx_mcast_action_reg; - struct ieee80211_vif *mbssid_tx_vif; - /* must be last */ u8 drv_priv[] __aligned(sizeof(void *)); }; diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 09708a060bb7..eeaead57e556 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -146,8 +146,8 @@ static int ieee80211_set_ap_mbssid_options(struct ieee80211_sub_if_data *sdata, struct ieee80211_bss_conf *link_conf) { struct ieee80211_sub_if_data *tx_sdata; + struct ieee80211_bss_conf *old; - sdata->vif.mbssid_tx_vif = NULL; link_conf->bssid_index = 0; link_conf->nontransmitted = false; link_conf->ema_ap = false; @@ -156,14 +156,26 @@ static int ieee80211_set_ap_mbssid_options(struct ieee80211_sub_if_data *sdata, if (sdata->vif.type != NL80211_IFTYPE_AP || !params->tx_wdev) return -EINVAL; + old = sdata_dereference(link_conf->tx_bss_conf, sdata); + if (old) + return -EALREADY; + tx_sdata = IEEE80211_WDEV_TO_SUB_IF(params->tx_wdev); if (!tx_sdata) return -EINVAL; if (tx_sdata == sdata) { - sdata->vif.mbssid_tx_vif = &sdata->vif; + rcu_assign_pointer(link_conf->tx_bss_conf, link_conf); } else { - sdata->vif.mbssid_tx_vif = &tx_sdata->vif; + struct ieee80211_bss_conf *tx_bss_conf; + + tx_bss_conf = sdata_dereference(tx_sdata->vif.link_conf[params->tx_link_id], + sdata); + if (rcu_access_pointer(tx_bss_conf->tx_bss_conf) != tx_bss_conf) + return -EINVAL; + + rcu_assign_pointer(link_conf->tx_bss_conf, tx_bss_conf); + link_conf->nontransmitted = true; link_conf->bssid_index = params->index; } @@ -1669,7 +1681,6 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev, kfree(link_conf->ftmr_params); link_conf->ftmr_params = NULL; - sdata->vif.mbssid_tx_vif = NULL; link_conf->bssid_index = 0; link_conf->nontransmitted = false; link_conf->ema_ap = false; @@ -1683,6 +1694,9 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev, ieee80211_free_key_list(local, &keys); } + ieee80211_stop_mbssid(sdata); + RCU_INIT_POINTER(link_conf->tx_bss_conf, NULL); + link_conf->enable_beacon = false; sdata->beacon_rate_set = false; sdata->vif.cfg.ssid_len = 0; @@ -3700,6 +3714,7 @@ void ieee80211_csa_finish(struct ieee80211_vif *vif, unsigned int link_id) { struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); struct ieee80211_local *local = sdata->local; + struct ieee80211_bss_conf *tx_bss_conf; struct ieee80211_link_data *link_data; if (WARN_ON(link_id >= IEEE80211_MLD_MAX_NUM_LINKS)) @@ -3713,25 +3728,24 @@ void ieee80211_csa_finish(struct ieee80211_vif *vif, unsigned int link_id) return; } - /* TODO: MBSSID with MLO changes */ - if (vif->mbssid_tx_vif == vif) { + tx_bss_conf = rcu_dereference(link_data->conf->tx_bss_conf); + if (tx_bss_conf == link_data->conf) { /* Trigger ieee80211_csa_finish() on the non-transmitting * interfaces when channel switch is received on * transmitting interface */ - struct ieee80211_sub_if_data *iter; - - list_for_each_entry_rcu(iter, &local->interfaces, list) { - if (!ieee80211_sdata_running(iter)) - continue; + struct ieee80211_link_data *iter; - if (iter == sdata || iter->vif.mbssid_tx_vif != vif) + for_each_sdata_link(local, iter) { + if (iter->sdata == sdata || + rcu_access_pointer(iter->conf->tx_bss_conf) != tx_bss_conf) continue; - wiphy_work_queue(iter->local->hw.wiphy, - &iter->deflink.csa.finalize_work); + wiphy_work_queue(iter->sdata->local->hw.wiphy, + &iter->csa.finalize_work); } } + wiphy_work_queue(local->hw.wiphy, &link_data->csa.finalize_work); rcu_read_unlock(); @@ -4833,17 +4847,19 @@ ieee80211_color_change_bss_config_notify(struct ieee80211_link_data *link, ieee80211_link_info_change_notify(sdata, link, changed); - if (!sdata->vif.bss_conf.nontransmitted && sdata->vif.mbssid_tx_vif) { - struct ieee80211_sub_if_data *child; + if (!link->conf->nontransmitted && + rcu_access_pointer(link->conf->tx_bss_conf)) { + struct ieee80211_link_data *tmp; - list_for_each_entry(child, &sdata->local->interfaces, list) { - if (child != sdata && child->vif.mbssid_tx_vif == &sdata->vif) { - child->vif.bss_conf.he_bss_color.color = color; - child->vif.bss_conf.he_bss_color.enabled = enable; - ieee80211_link_info_change_notify(child, - &child->deflink, - BSS_CHANGED_HE_BSS_COLOR); - } + for_each_sdata_link(sdata->local, tmp) { + if (tmp->sdata == sdata || + rcu_access_pointer(tmp->conf->tx_bss_conf) != link->conf) + continue; + + tmp->conf->he_bss_color.color = color; + tmp->conf->he_bss_color.enabled = enable; + ieee80211_link_info_change_notify(tmp->sdata, tmp, + BSS_CHANGED_HE_BSS_COLOR); } } } diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 845888ac3d2c..68c6be894a28 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -2794,6 +2794,8 @@ int ieee80211_mgd_assoc_ml_reconf(struct ieee80211_sub_if_data *sdata, void ieee80211_process_ml_reconf_resp(struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, size_t len); +void ieee80211_stop_mbssid(struct ieee80211_sub_if_data *sdata); + #if IS_ENABLED(CONFIG_MAC80211_KUNIT_TEST) #define EXPORT_SYMBOL_IF_MAC80211_KUNIT(sym) EXPORT_SYMBOL_IF_KUNIT(sym) #define VISIBLE_IF_MAC80211_KUNIT diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 33c7c62d19f5..540fccb58c1f 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -726,30 +726,57 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do ieee80211_add_virtual_monitor(local); } -static void ieee80211_stop_mbssid(struct ieee80211_sub_if_data *sdata) +void ieee80211_stop_mbssid(struct ieee80211_sub_if_data *sdata) { - struct ieee80211_sub_if_data *tx_sdata, *non_tx_sdata, *tmp_sdata; - struct ieee80211_vif *tx_vif = sdata->vif.mbssid_tx_vif; + struct ieee80211_sub_if_data *tx_sdata; + struct ieee80211_bss_conf *link_conf, *tx_bss_conf; + struct ieee80211_link_data *tx_link, *link; + unsigned int link_id; - if (!tx_vif) - return; + lockdep_assert_wiphy(sdata->local->hw.wiphy); + + /* Check if any of the links of current sdata is an MBSSID. */ + for_each_vif_active_link(&sdata->vif, link_conf, link_id) { + tx_bss_conf = sdata_dereference(link_conf->tx_bss_conf, sdata); + if (!tx_bss_conf) + continue; - tx_sdata = vif_to_sdata(tx_vif); - sdata->vif.mbssid_tx_vif = NULL; + tx_sdata = vif_to_sdata(tx_bss_conf->vif); + RCU_INIT_POINTER(link_conf->tx_bss_conf, NULL); - list_for_each_entry_safe(non_tx_sdata, tmp_sdata, - &tx_sdata->local->interfaces, list) { - if (non_tx_sdata != sdata && non_tx_sdata != tx_sdata && - non_tx_sdata->vif.mbssid_tx_vif == tx_vif && - ieee80211_sdata_running(non_tx_sdata)) { - non_tx_sdata->vif.mbssid_tx_vif = NULL; - dev_close(non_tx_sdata->wdev.netdev); + /* If we are not tx sdata reset tx sdata's tx_bss_conf to avoid recusrion while + * closing tx sdata at the end of outer loop below. + */ + if (sdata != tx_sdata) { + tx_link = sdata_dereference(tx_sdata->link[tx_bss_conf->link_id], tx_sdata); + if (!tx_link) + continue; + + RCU_INIT_POINTER(tx_link->conf->tx_bss_conf, NULL); + } + + /* loop through sdatas to find if any of their links + * belong to same MBSSID set as the one getting deleted. + */ + for_each_sdata_link(tx_sdata->local, link) { + struct ieee80211_sub_if_data *link_sdata = link->sdata; + + if (link_sdata == sdata || link_sdata == tx_sdata || + rcu_access_pointer(link->conf->tx_bss_conf) != tx_bss_conf) + continue; + + RCU_INIT_POINTER(link->conf->tx_bss_conf, NULL); + + /* Remove all links of matching MLD until dynamic link + * removal can be supported. + */ + cfg80211_stop_iface(link_sdata->wdev.wiphy, &link_sdata->wdev, GFP_KERNEL); } - } - if (sdata != tx_sdata && ieee80211_sdata_running(tx_sdata)) { - tx_sdata->vif.mbssid_tx_vif = NULL; - dev_close(tx_sdata->wdev.netdev); + /* If we are not tx sdata, remove links of tx sdata and proceed */ + if (sdata != tx_sdata && ieee80211_sdata_running(tx_sdata)) + cfg80211_stop_iface(tx_sdata->wdev.wiphy, + &tx_sdata->wdev, GFP_KERNEL); } } @@ -757,21 +784,25 @@ static int ieee80211_stop(struct net_device *dev) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - /* close dependent VLAN and MBSSID interfaces before locking wiphy */ + /* close dependent VLAN interfaces before locking wiphy */ if (sdata->vif.type == NL80211_IFTYPE_AP) { struct ieee80211_sub_if_data *vlan, *tmpsdata; list_for_each_entry_safe(vlan, tmpsdata, &sdata->u.ap.vlans, u.vlan.list) dev_close(vlan->dev); - - ieee80211_stop_mbssid(sdata); } guard(wiphy)(sdata->local->hw.wiphy); wiphy_work_cancel(sdata->local->hw.wiphy, &sdata->activate_links_work); + /* Close the dependent MBSSID interfaces with wiphy lock as we may be + * terminating its partner links too in case of MLD. + */ + if (sdata->vif.type == NL80211_IFTYPE_AP) + ieee80211_stop_mbssid(sdata); + ieee80211_do_stop(sdata, true); return 0; From patchwork Mon Mar 10 20:02:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 14010592 X-Patchwork-Delegate: quic_jjohnson@quicinc.com 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 321A41C5D40 for ; Mon, 10 Mar 2025 20:03:03 +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=1741636985; cv=none; b=X2vnaZS3ypdq82qT9LM6z7pwRJ+sMH0dAdf1wyTXqDZ6V6uO74mKfvhgvPKXogqXymbYLWI3yCiXp0mwB34qMO/tb/j9IlIZuRB/nQ9Sm8LKT+OlBBc7fh/2gEF6GfuP9ETgaQ3cXoskW5T0FJ4SiQPUqiPQJ7bSgV0b3zsV5yE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741636985; c=relaxed/simple; bh=mQoafSNJB5Y5HEOClyQOX9wjI8Q/en+Jt45gSH4/81g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=crE1lWcEKglqBuU9fOqiXToiXmX5wd1p0MwBHLvDkKn97cMut3V4EVPL4uUmP/yQLoNQD5t14dPRX713R+letkY6wM+scl4lJKdQn9CsmJYBNi4QharE3JLhoLrLKftx0bgmlasHmo3HY3NyHBtiOhMceetVyUbclPcFhg97N5I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=RH+a65gf; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="RH+a65gf" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52A9Ysab002995 for ; Mon, 10 Mar 2025 20:03:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=CxCnj6Zj5VR O/FPhZdIDI/wmFlKcODkCa+QWZkj1+Zw=; b=RH+a65gf3igh27enEED6eEC6Jof GqB21+cIFcdQ4pfSxzMCXNCWzqRRwJE3jMP9ifyvv+XE/xGRCmDtGS4ByumoLA6N urPZK73JxJ5pJVItFgdLdUYCOcSVBFk9UG8GKqJHlFE7X4sU6zG/u9RvQTzsqqQe kyRk5J4AXAYkF7ExdbFacvUIFeuNDc+SMv9WEhcUvXp7j4O8IZZajgo+2/0Y4c/z RaI+821MltoW3VpwBjTQHoiF5zeBQI6cd6EPN9buCAIxkbWjfKpr3w5SBbwR0a4u JnaBxb4mUroFEtXu7Fjn4gQsPV6yV57fHTADq4cjCJBK0E/OqoMIHAguLuw== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 458f0pwykr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 10 Mar 2025 20:03:02 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2240fea0482so120722985ad.3 for ; Mon, 10 Mar 2025 13:03:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741636964; x=1742241764; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CxCnj6Zj5VRO/FPhZdIDI/wmFlKcODkCa+QWZkj1+Zw=; b=PvBjAbXrJgNw2seH1lexR3Y+6oDAU9kfR7dCQ76gYhfno3lpEjg0//+fVAKWFsoKwp LPQt+rclxXAA5LlKLsHNUIIXZt6Ggai65pDUYpCMYYTL6y7/xfnqxvCgOLOL7tHhty5w U43/mncNNWX4Z1MkTg+jySNDhf9qigQTQ+qr9//9REuil3v1WML3W/HlD5Uu4x8Q1pVb ClFxXjvWuBPAzcmfYeMiAu8QZCz9P5X4uZP3tBJ7VVIV4VgBM6bEtoDUvap6LDMkYRKR x9ZFYNtBF+K2fKSL8WxCBkcosH8wood8nPgCsAzfd/txsHpy+Hj96hOaJWPqjbz1IR2+ apUg== X-Gm-Message-State: AOJu0YyytKFftikkGaBpWe/EDFBR/lzw1buIEzU4rowbISnQv4rdNxfc wv2h4FzTWn2LE/ESjfWQHn9ns5QorIgjS1DdtsKBa5lmK/Y0G0RD1X6OzMNzDHEpnvLZTzC303D nMe5jwcINjuamkS5B0lZzJ67uCOxMdYCgn815ioVJqPN1qHNs6NpN965mebmxw4PKFabKEiydYw == X-Gm-Gg: ASbGnctPKQhIJOUBHiVqQVRg+EWlse0m22IszMT3MwTWBsDG8Qwmtr9eWq6mVKNFyIb /UngWSF0et1OOVadWqwqPtDavpRAoFMDXMb5WUQGE2ypTWhwDOU8XwkjQm881Hzvkg8dG9iyx4j mndC8x1zr/yfT7iwMpwshgXcRYzSYQatL6PFXGJZiiCdec0/y1Us56Nq0G9E3CoQHsFM4D6jqg4 1HDMjjBwZFNEYWtgkD8vNueSy73lTq6K4/XU6tFOpO7Q8MSpYHK8bEzNjnh9edlQexsUnFCMAS4 gnxh+AwkV/5ID53fQiShIIrbxNuqefq25lNjAGoPwViY+DLCylePD9+xDTQSSAuXBIWQ3TQ= X-Received: by 2002:a05:6a00:4b11:b0:736:42a8:a742 with SMTP id d2e1a72fcca58-736aa9fe534mr21641346b3a.11.1741636964178; Mon, 10 Mar 2025 13:02:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvidx5KJkTSjAEJB9ZDmQS2NOn+ARs6ZuQieF+UAKqF8f27/e5SRU3C4Z9miHp/2u6CPhRxQ== X-Received: by 2002:a05:6a00:4b11:b0:736:42a8:a742 with SMTP id d2e1a72fcca58-736aa9fe534mr21641314b3a.11.1741636963771; Mon, 10 Mar 2025 13:02:43 -0700 (PDT) Received: from alokad-linux.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-736cbe3fb3fsm3730419b3a.83.2025.03.10.13.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Mar 2025 13:02:43 -0700 (PDT) From: Aloka Dixit To: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, ath11k@lists.infradead.org Cc: Aloka Dixit Subject: [PATCH v4 3/3] wifi: ath12k: pass link_conf for tx_arvif retrieval Date: Mon, 10 Mar 2025 13:02:37 -0700 Message-Id: <20250310200237.652950-4-aloka.dixit@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250310200237.652950-1-aloka.dixit@oss.qualcomm.com> References: <20250310200237.652950-1-aloka.dixit@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-GUID: 9wpbqbkoCw41RSD9FUirr6MGuQAnuBiE X-Authority-Analysis: v=2.4 cv=KK2gDEFo c=1 sm=1 tr=0 ts=67cf4576 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=Vs1iUdzkB0EA:10 a=EUspDBNiAAAA:8 a=66aBALrjW5AsI7a0044A:9 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: 9wpbqbkoCw41RSD9FUirr6MGuQAnuBiE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-10_07,2025-03-07_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=787 clxscore=1015 malwarescore=0 adultscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 spamscore=0 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502100000 definitions=main-2503100155 Three out of four callers to ath12k_mac_get_tx_arvif() have link_conf pointer already set for other operations. Pass it as a parameter. Modify ath12k_control_beaconing() to set link_conf first. Signed-off-by: Aloka Dixit --- drivers/net/wireless/ath/ath12k/mac.c | 31 +++++++++++++++------------ 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 84da77bf245b..200a2a8ff166 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -580,22 +580,16 @@ static int ath12k_mac_vif_link_chan(struct ieee80211_vif *vif, u8 link_id, return 0; } -static struct ath12k_link_vif *ath12k_mac_get_tx_arvif(struct ath12k_link_vif *arvif) +static struct ath12k_link_vif * +ath12k_mac_get_tx_arvif(struct ath12k_link_vif *arvif, + struct ieee80211_bss_conf *link_conf) { - struct ieee80211_bss_conf *link_conf, *tx_bss_conf; + struct ieee80211_bss_conf *tx_bss_conf; struct ath12k *ar = arvif->ar; struct ath12k_vif *tx_ahvif; lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); - link_conf = ath12k_mac_get_link_bss_conf(arvif); - if (!link_conf) { - ath12k_warn(ar->ab, - "unable to access bss link conf for link %u required to retrieve transmitting link conf\n", - arvif->link_id); - return NULL; - } - tx_bss_conf = wiphy_dereference(ath12k_ar_to_hw(ar)->wiphy, link_conf->tx_bss_conf); if (tx_bss_conf) { @@ -1729,7 +1723,7 @@ static int ath12k_mac_setup_bcn_tmpl(struct ath12k_link_vif *arvif) return -ENOLINK; } - tx_arvif = ath12k_mac_get_tx_arvif(arvif); + tx_arvif = ath12k_mac_get_tx_arvif(arvif, link_conf); if (tx_arvif) { if (tx_arvif != arvif && arvif->is_up) return 0; @@ -1799,6 +1793,7 @@ static void ath12k_control_beaconing(struct ath12k_link_vif *arvif, { struct ath12k_wmi_vdev_up_params params = {}; struct ath12k_vif *ahvif = arvif->ahvif; + struct ieee80211_bss_conf *link_conf; struct ath12k_link_vif *tx_arvif; struct ath12k *ar = arvif->ar; int ret; @@ -1831,7 +1826,15 @@ static void ath12k_control_beaconing(struct ath12k_link_vif *arvif, params.aid = ahvif->aid; params.bssid = arvif->bssid; - tx_arvif = ath12k_mac_get_tx_arvif(arvif); + link_conf = ath12k_mac_get_link_bss_conf(arvif); + if (!link_conf) { + ath12k_warn(ar->ab, + "unable to access bss link conf for link %u required to retrieve transmitting link conf\n", + arvif->link_id); + return; + } + + tx_arvif = ath12k_mac_get_tx_arvif(arvif, link_conf); if (tx_arvif) { params.tx_bssid = tx_arvif->bssid; params.nontx_profile_idx = info->bssid_index; @@ -7868,7 +7871,7 @@ static int ath12k_mac_setup_vdev_params_mbssid(struct ath12k_link_vif *arvif, return -ENOLINK; } - tx_arvif = ath12k_mac_get_tx_arvif(arvif); + tx_arvif = ath12k_mac_get_tx_arvif(arvif, link_conf); if (!tx_arvif) return 0; @@ -9322,7 +9325,7 @@ ath12k_mac_update_vif_chan(struct ath12k *ar, params.aid = ahvif->aid; params.bssid = arvif->bssid; - tx_arvif = ath12k_mac_get_tx_arvif(arvif); + tx_arvif = ath12k_mac_get_tx_arvif(arvif, link_conf); if (tx_arvif) { params.tx_bssid = tx_arvif->bssid; params.nontx_profile_idx = link_conf->bssid_index;