From patchwork Mon Jun 9 07:03:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maharaja Kennadyrajan X-Patchwork-Id: 895176 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 9CA5027FB38 for ; Mon, 9 Jun 2025 07:03:31 +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=1749452613; cv=none; b=j7+o2aGt8OJp5oVILgz25S6csBJPQXzCADp0ridZ/RZKlZogLuVve8o6cXj66eFqfxmdzGoZBRiw2rUaBdIKIPisVJnFo2HNTZOv7Ayc1UmOnrYOyG8qnDM1Y/poqGcK6euqJbrl6NdPbB1lBs8VYim08z1e7E9Tk5Ltur73CLQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749452613; c=relaxed/simple; bh=iWM9lzGpuRAiOGjODpXk0wzzjYAP8Og8FQzRJauU2G0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=uYfGYQic8CwlqXXc5K2pMDCa/1DToeFrkeP+fMcav3T/29QkOaAyWwyWbmu2yNWBYQKMKFad0tBnM4R5411GEaPDXqkrC4s6Z6GYt6882H4io8d9ZH/s0gfH8zXxxSTZgpJGqxT0ukPXQ4BAmlbl19nOcsZpIXkne4xSneKd7W8= 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=mptDO3iE; 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="mptDO3iE" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 558MtGDd029980 for ; Mon, 9 Jun 2025 07:03:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:date:from:in-reply-to:message-id:references:subject:to; s= qcppdkim1; bh=TkHniuGwhATtjmRCx0mJ+lmqn6aiPxC7tNahdgCEHD8=; b=mp tDO3iEyOQG6xck8//jCJ/2zkBVEMA/WGpEveszdhcoemGFLaxQ0kwdusMRxd1Ya1 icKFiXtj4pjV4NQix94rcklDxsS1qBeEcu71CMcJNamDmkDtA3R8rvtsGxiwC8Wd vTwl2ixC+eKcPjjlqOLQigpro2blu3/rnncubWQNystC5Xqc3xTIrCXaDgK9SFhd nya/ZCaoxivRAtss82aBjEI0P468lJgqeCO2SR7f/yoBzgtIUnfwsOscQ++pvk2P BPNUxwK9Bnj+matPrgxz7MXXHZI494Od8Atub3lM0HpiD9K/JTUtv3K8HG2eX2A2 ixKfVFzRw7Dv58GYNGQQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 474ce9n80b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 09 Jun 2025 07:03:30 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2355651d204so37291865ad.2 for ; Mon, 09 Jun 2025 00:03:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749452609; x=1750057409; h=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=TkHniuGwhATtjmRCx0mJ+lmqn6aiPxC7tNahdgCEHD8=; b=tGyRwBfkd/yTjki9R+Pn2Jr219LXOTRXXIMG0i64iWzdH0bAp+UZ1EdDCuvrAmOfEw VPrDx+FKr1TIZt296jmYDNDVNNrl6AllQE8sKZLfsuAGY7Lb7E+O4XFLeHzmg/0JC0UK CyWxz5OxNA0Th9eHEOyuF4ApeN5g5g0Hg/F4DjuPyouiExp6BjKXfshtR+ObpBBOTGtb p9PfOBuYFX96kJXjPH1NzruJbIqfSnKg60NMO2UQ98a73aUkkKpWdpbkSTDSagKzoQN2 PEU5qJLk341SU68nD62vhQDEih8Z1fLFlUo0/hwZKMIYGUOF+pk1VodrQRIc5JwhJVvs 4RDw== X-Gm-Message-State: AOJu0YxXSrVBT6wDxjDZ7AN7f+MpXCTYzshaNMsogTWRbvF+an91HpYF IkOMR43an6Ni3UnxXbaDO8HGsXiJLlRJZVGGZh609hTnrSENwLm0/fArU9h5Kj0iV+gtqKhBIip pD7jTM7A2mQv7N09pftRKOjfG6+K1kDai5pF3Dc7j8++Lmh4aBUqdTbhgo+nAq08FB9mksA== X-Gm-Gg: ASbGncucvXf0JFY2ljiFHyrazSj8lchn1YYuknJFj8Jbs285rbXBXOeJISu3Z0aPFas SikWQzLq40VttxEtebv6ZlP6J38SE+6HTv+W6NFjYh91GkSiStc9my8VsHKXG7it5atnwYUeqHP y5ZQhyctIP83iXPUFMVUZDJ+jAJVvNgl6sFofVUtjpy5dAGjl0M1RrrS5tK/wf2ZjC+kNrfUbSQ NJLv+39rCfBAKmB69BJtNCN660weccrBgt/jEoaKBjq0izWdK1jGTwcQk5m7gcLHcIQ7qW+TIEL KcfvZxO90p06jiH7qw50uTRJBa/H+EF/Mg/h5tjvXwa0Qvo52q0yS3yzTs+sKqlbLK7h2ILQowP jLWD6odTleu80DMg7Pqp3kpsIV0k4T19SmkAVEVA0O8WW/w== X-Received: by 2002:a17:902:f712:b0:235:e1d6:4e22 with SMTP id d9443c01a7336-23601e4bf08mr149124245ad.18.1749452609132; Mon, 09 Jun 2025 00:03:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFHLKxmEWWDPJZnVLwkZ8Lpc+fNnHutzIj+6ajKGEmg2rxhZmOJC+93MV0tgWdvT32Y4Sc/w== X-Received: by 2002:a17:902:f712:b0:235:e1d6:4e22 with SMTP id d9443c01a7336-23601e4bf08mr149123995ad.18.1749452608731; Mon, 09 Jun 2025 00:03:28 -0700 (PDT) Received: from che-siroccolnx03.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-236034050a1sm48592145ad.145.2025.06.09.00.03.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jun 2025 00:03:28 -0700 (PDT) From: Maharaja Kennadyrajan To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Maharaja Kennadyrajan Subject: [PATCH wireless-next 1/2] wifi: mac80211: extend beacon monitoring for MLO Date: Mon, 9 Jun 2025 12:33:18 +0530 Message-Id: <20250609070319.1033874-2-maharaja.kennadyrajan@oss.qualcomm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250609070319.1033874-1-maharaja.kennadyrajan@oss.qualcomm.com> References: <20250609070319.1033874-1-maharaja.kennadyrajan@oss.qualcomm.com> X-Proofpoint-GUID: x-7J75MM1b5r6vxUSO_tz0E_7-L0JaAE X-Authority-Analysis: v=2.4 cv=drjbC0g4 c=1 sm=1 tr=0 ts=68468742 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=6IFa9wvqVegA:10 a=EUspDBNiAAAA:8 a=eANRQvAV50QnJ_dsQ2sA:9 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: x-7J75MM1b5r6vxUSO_tz0E_7-L0JaAE X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjA5MDA1MiBTYWx0ZWRfX6vN1XbsKZq+Z 2kj6LI/qOTeOCu7kNu5xL0Uy0s1yJa1h01CBXgMG+c1kETem6b0sbOuIBvr8Lw+0ogXf9jny/nt Ovtd2tbtg6eIILc1AlRVEWjfLoZiV15DqR0RSiXa7k75Da3bi27vfEzUCmXJTKUOVaWs9IF+h0d viAiPUA84bBsuie1AdgGYNP3XgfV3mJfMfTLIOQfV4tiFxdbypJzUngvtKHwNBPct16Q4k5esPA 4AjBNSb1niurO+3FacsxS2NIds4Ly39eflCss5Y55tMX28LfUk+GB+AvR6vzt0ip5JDb8vCeYbo WhWpGv1/pR07Fja2m0eHHkyEMTdXsyTDZGrsrXcSz+L0ntN8q7OA27W4IvYKh1IbaJSimI79mTi EfHTld2+SAJWN3/gjO9sYX7vDGd56cM89c+Cm0E72o81hZhg1hgauViQx9HQqbTlPlnqAZcC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-09_02,2025-06-05_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 suspectscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 phishscore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506090052 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Currently, reset beacon monitor (ieee80211_sta_reset_beacon_monitor()) timer is handled only for non-AP non-MLD STA and do not support non-AP MLD STA. When the beacon loss occurs in non-AP MLD STA with the current implementation, it is treated as a single link and the timer will reset based on the timeout of the deflink, without checking all the links. Check the CSA flags for all the links in the MLO and decide whether to schedule the work queue for beacon loss. If any of the links has CSA active, then beacon loss work is not scheduled. Also, call the functions ieee80211_sta_reset_beacon_monitor() and ieee80211_sta_reset_conn_monitor() from ieee80211_csa_switch_work() only when all the links are CSA active. Signed-off-by: Maharaja Kennadyrajan --- net/mac80211/mlme.c | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b84150dbfe8c..927fbe6f12f1 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -2439,6 +2439,19 @@ static void ieee80211_csa_switch_work(struct wiphy *wiphy, } } + /* It is not necessary to reset these timers if any link does not + * have an active CSA and that link still receives the beacons + * when other links have active CSA. + */ + for_each_link_data(sdata, link) { + if (!(link->conf && link->conf->csa_active)) + return; + } + + /* Reset the beacon monitor and connection monitor timers when CSA + * is active for all links in MLO when channel switch occurs in all + * the links. + */ ieee80211_sta_reset_beacon_monitor(sdata); ieee80211_sta_reset_conn_monitor(sdata); } @@ -8385,16 +8398,37 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) } } +static bool +ieee80211_is_csa_in_progress(struct ieee80211_sub_if_data *sdata) +{ + /* In MLO, check the CSA flags 'active' and 'waiting_bcn' for all + * the links. + */ + unsigned int link_id; + + guard(rcu)(); + for (link_id = 0; link_id < ARRAY_SIZE(sdata->link); + link_id++) { + struct ieee80211_link_data *link = + rcu_dereference(sdata->link[link_id]); + + if (!link) + continue; + + if (!(link->conf && link->conf->csa_active && + !link->u.mgd.csa.waiting_bcn)) + return false; + } + + return true; +} + static void ieee80211_sta_bcn_mon_timer(struct timer_list *t) { struct ieee80211_sub_if_data *sdata = from_timer(sdata, t, u.mgd.bcn_mon_timer); - if (WARN_ON(ieee80211_vif_is_mld(&sdata->vif))) - return; - - if (sdata->vif.bss_conf.csa_active && - !sdata->deflink.u.mgd.csa.waiting_bcn) + if (ieee80211_is_csa_in_progress(sdata)) return; if (sdata->vif.driver_flags & IEEE80211_VIF_BEACON_FILTER) From patchwork Mon Jun 9 07:03:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maharaja Kennadyrajan X-Patchwork-Id: 895992 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 DBE3C281341 for ; Mon, 9 Jun 2025 07:03:33 +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=1749452615; cv=none; b=H12wlicUSMw4lknpSIkQUFpWa8+v1JfxFIGxxs63+CMZ69u0Wd8mxV/uEE1kHNM5E3uhjQE0L6pdIr/DA1p4QAej4DxIZ1ZemQ1EduNVAm9IzuKVh7DAYh2KSKCuDwyKqNPatZv9C3k5z7HC8WWax8iXTe9Y2L6w77zJnXp+tM8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749452615; c=relaxed/simple; bh=ZVysk2Vun75dajmyOXZgMZFxXkp4xEOVyVppjYPy4Yg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=Kx4fmnB+Jpxd98oK+kRdDwXQzQairQ0Vf80l38GziTuW5Sa2GPXeM/kWkaamH70ZbM6KVXoYD1lrEmmc5+1jePH8L020lEcJnMF9cBFB21V25DWn1cGVHmwQ3PT+22lEqnqMbl028eo3sH3HVcJoNgS01LQeCjAwamU5dWnm/ps= 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=QIGEyq6Y; 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="QIGEyq6Y" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 558NumkW022252 for ; Mon, 9 Jun 2025 07:03:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:date:from:in-reply-to:message-id:references:subject:to; s= qcppdkim1; bh=ndEyXxwKHzZxkb9HPoxEYfe0E1x/mv3R/OXtP7yKgUE=; b=QI GEyq6YdizxHAJvdT77lVikbNQ/dLrZo1uwp1ah+RPVAaql8pzbUnR1zTRlRLbtjT XTW852Jp4M8oWYXOIrpWrrg+tcen76cqt06Z7VbzplMJ76SYAoYOWSH+LZDRyAaw s1LFFJ0zTQfDvL9Nrs2YniUO8ytm7AZ1tbn8druE81wazZVv8Ma+rfkeT3UlCEfz ehbuTNT15I2GLGkvTuppN7MXRNs04Z7qy9Sbn28dB4zhZx+1lUnF0xgaCxPd0QCP 9PhzKSyFZ8bYhxFhUkpQ9KVigwLe1YyG4bpGvYyxE1sPrdOFwHHV1WbcdwbhivG4 WzWM1OW98cODNb0O/Zvg== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 474dt9n4an-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 09 Jun 2025 07:03:32 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-31315427249so5040165a91.1 for ; Mon, 09 Jun 2025 00:03:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749452611; x=1750057411; h=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=ndEyXxwKHzZxkb9HPoxEYfe0E1x/mv3R/OXtP7yKgUE=; b=UjrglBIVPxbFU+tZ8M3I5Zi5mwwv5G6tw62rkZWbRIeYIKqWZ4+An9Wg9mT5CChMb9 a4hYvDLPod3vs6JSeMvB6fYXxHOhD3+O1T48KFraJ1buZOlqL+5XCBJBTFTHNw94Uk3p 2NaoirIfEsYcapz7Z+mBzsyjXyUQKLr4TaVIC+8bdNy7mq5EuhnklJB1KwlidZZlLWqD 63yggpv2HAgkb2XS/wJqKzyo1uBNDwngoqPgIzsZfq5gijDmWd4nGz/tcLohDLRdj/ip Qb82WjikPlCMoegJuwJyUs46BHbscvxFBenqCSTWLeFa9bODLatC/LZ7inUOxUJKu0Vl yM0Q== X-Gm-Message-State: AOJu0YxVk4/0zkAcxTiGKCPtXSBp78D0QMcMi+ZFTNn1PEBdNX1evYif 67zKWorSQQXqgr2inGtRCcOA4l4ozEuf+5vsVfZYyFg91WIxzZIz/lkG5orJ0gIfixnukWk1qfJ RlcY/mlCi15HWyOLO0AZu5h+VL1YxjrJ36EX4enKI9lg+vPdtQugG1AzfA1BujUeIKGV7ug== X-Gm-Gg: ASbGnctlPdgDhcArXxg2ch4GvUM+SPLE1OGvkdsk9a5VEoD7uUyf+WpNougs5Hmnk4L ASOQL115H/3AR/CAZnyF8rz0c83rt6R9xgIomvCHsbyMc0AN3Ct0tlNZTN3WWkowCx1gvwNtN3q TaOsj+7juL7jLqepWk/f2HngdbuVs1jpB1FAhmmrpGC5hVoq0y0IzoVKVTC/yr0VhNT19kPiET4 vKJoXpJlXRq63ZGSTW7WgGT3i7m/AE/YQEHgJV7BHa56sHBbSZRYWe+S3xpB088rrAAGQK0C1NL qGqB+ZUabs35sIM0BOIgVtzfbs3y6dLAzt/xRFvdhPUux/ITsJhVvpqDE1gd8NmyULu6H9hv1NR VkB4qUUQZAwax00qwF84e6W8fVOXxO4wcNDfQxqNYvFcZJQ== X-Received: by 2002:a17:90a:dfc3:b0:2fe:e9c6:689e with SMTP id 98e67ed59e1d1-313472f8a61mr18100394a91.8.1749452610892; Mon, 09 Jun 2025 00:03:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/+E3DxUiWOImebCzrfYm9KFH/fDuimxSDUNHRDL5UTn0t2QZYCraYgw7/2iJm8LWZFxQ0Yw== X-Received: by 2002:a17:90a:dfc3:b0:2fe:e9c6:689e with SMTP id 98e67ed59e1d1-313472f8a61mr18100359a91.8.1749452610402; Mon, 09 Jun 2025 00:03:30 -0700 (PDT) Received: from che-siroccolnx03.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-236034050a1sm48592145ad.145.2025.06.09.00.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jun 2025 00:03:30 -0700 (PDT) From: Maharaja Kennadyrajan To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Maharaja Kennadyrajan Subject: [PATCH wireless-next 2/2] wifi: mac80211: extend connection monitoring for MLO Date: Mon, 9 Jun 2025 12:33:19 +0530 Message-Id: <20250609070319.1033874-3-maharaja.kennadyrajan@oss.qualcomm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250609070319.1033874-1-maharaja.kennadyrajan@oss.qualcomm.com> References: <20250609070319.1033874-1-maharaja.kennadyrajan@oss.qualcomm.com> X-Authority-Analysis: v=2.4 cv=KpNN2XWN c=1 sm=1 tr=0 ts=68468744 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=6IFa9wvqVegA:10 a=EUspDBNiAAAA:8 a=LKpuYLUdS0qzNSG1YBcA:9 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-GUID: VBBdiJLi1Q8stL0KYlHr79F0-X3XOHfV X-Proofpoint-ORIG-GUID: VBBdiJLi1Q8stL0KYlHr79F0-X3XOHfV X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjA5MDA1MyBTYWx0ZWRfXySqScggzOx6K mdde/Ur1a2w76tvUsXYj5M1o6SGXhMl9DqDEPRh4O20aauATb0uL37SA53weHLBgR4Re4iW/qmj Q63jNolc5Q4T6NfI294AzbmP6k8DvnXlw+Z6BlXOv0ju8h06ILOsyGYvUtjIe56RIovCd64PVaY eMrCINOzm3OXe7ibX5NaOV5SW6jg1SpDVaaDBCLDCFd0cfc554B1+T0YErloEZrZ3Xwz3tu/VEB 4WBQYnT6mpskqg9be0nP78Uln9lMAN/5aus/29VgnXN3fhXhUopIuCc2Tt/LHqkeI1yqJGvQ7Xv PWZRn+s2U4HzUU4Jb2FeoXtRVacUCnaPHqVkdIdAExUqgdPYq9Zj6OrTfX9bRys3i86VWaE+02K akBHMqmH0PEXCZsmC12TrqJbguGLmuUVU31eL3mdi1143Ja5nKi+FOi6yzgbRT0sxVyvpzif X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-09_02,2025-06-05_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 spamscore=0 mlxlogscore=999 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506090053 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Currently, reset connection monitor (ieee80211_sta_reset_conn_monitor()) timer is handled only for non-AP non-MLD STA and do not support non-AP MLD STA. The current implementation checks for the CSA active and update the monitor timer with the timeout value of deflink and reset the timer based on the deflink's timeout value else schedule the connection loss work when the deflink is timed out and it won't work for the non-AP MLD STA. Handle the reset connection monitor timer for non-AP MLD STA by updating the monitor timer with the timeout value which is determined based on the link that will expire last among all the links in MLO. If at least one link has not timed out, the timer is updated accordingly with the latest timeout value else schedule the connection loss work when all links have timed out. Remove the MLO-related WARN_ON() checks in the beacon and connection monitoring logic code paths as they support MLO now. Signed-off-by: Maharaja Kennadyrajan --- net/mac80211/mlme.c | 79 +++++++++++++++++++++++++++++++-------------- 1 file changed, 54 insertions(+), 25 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 927fbe6f12f1..6a3ef574fba5 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4294,9 +4294,6 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata) lockdep_assert_wiphy(sdata->local->hw.wiphy); - if (WARN_ON(ieee80211_vif_is_mld(&sdata->vif))) - return; - /* * Try sending broadcast probe requests for the last three * probe requests after the first ones failed since some @@ -4342,9 +4339,6 @@ static void ieee80211_mgd_probe_ap(struct ieee80211_sub_if_data *sdata, lockdep_assert_wiphy(sdata->local->hw.wiphy); - if (WARN_ON_ONCE(ieee80211_vif_is_mld(&sdata->vif))) - return; - if (!ieee80211_sdata_running(sdata)) return; @@ -8439,36 +8433,71 @@ static void ieee80211_sta_bcn_mon_timer(struct timer_list *t) &sdata->u.mgd.beacon_connection_loss_work); } +static bool +ieee80211_is_all_links_timed_out(struct ieee80211_sub_if_data *sdata, + unsigned long *latest_timeout) +{ + bool all_links_timed_out = true; + unsigned int link_id; + struct sta_info *sta; + + guard(rcu)(); + sta = sta_info_get(sdata, sdata->vif.cfg.ap_addr); + if (!sta) + return true; + + for (link_id = 0; link_id < ARRAY_SIZE(sta->link); + link_id++) { + struct link_sta_info *link_sta; + unsigned long timeout; + + link_sta = rcu_dereference(sta->link[link_id]); + if (!link_sta) + continue; + + timeout = link_sta->status_stats.last_ack; + if (time_before(timeout, link_sta->rx_stats.last_rx)) + timeout = link_sta->rx_stats.last_rx; + + timeout += IEEE80211_CONNECTION_IDLE_TIME; + + /* latest_timeout holds the timeout of the link + * that will expire last among all links in an + * non-AP MLD STA. This ensures that the connection + * monitor timer is only reset if at least one link + * is still active, and it is scheduled to fire at + * the latest possible timeout. + */ + if (time_is_after_jiffies(timeout)) { + all_links_timed_out = false; + if (time_after(timeout, *latest_timeout)) + *latest_timeout = timeout; + } + } + + return all_links_timed_out; +} + static void ieee80211_sta_conn_mon_timer(struct timer_list *t) { struct ieee80211_sub_if_data *sdata = from_timer(sdata, t, u.mgd.conn_mon_timer); struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_local *local = sdata->local; - struct sta_info *sta; - unsigned long timeout; - - if (WARN_ON(ieee80211_vif_is_mld(&sdata->vif))) - return; - - if (sdata->vif.bss_conf.csa_active && - !sdata->deflink.u.mgd.csa.waiting_bcn) - return; + unsigned long latest_timeout = 0; + bool all_links_timed_out = true; - sta = sta_info_get(sdata, sdata->vif.cfg.ap_addr); - if (!sta) + if (ieee80211_is_csa_in_progress(sdata)) return; - timeout = sta->deflink.status_stats.last_ack; - if (time_before(sta->deflink.status_stats.last_ack, sta->deflink.rx_stats.last_rx)) - timeout = sta->deflink.rx_stats.last_rx; - timeout += IEEE80211_CONNECTION_IDLE_TIME; - - /* If timeout is after now, then update timer to fire at + all_links_timed_out = ieee80211_is_all_links_timed_out(sdata, + &latest_timeout); + /* If latest timeout is after now, then update timer to fire at * the later date, but do not actually probe at this time. */ - if (time_is_after_jiffies(timeout)) { - mod_timer(&ifmgd->conn_mon_timer, round_jiffies_up(timeout)); + if (!all_links_timed_out) { + mod_timer(&ifmgd->conn_mon_timer, + round_jiffies_up(latest_timeout)); return; }