Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796207353; b=AqgzIEa+BDT2oOdGFzVQvBZUbJm83keidrh+SY+okeGIM1bwRWxqfD6yDE2a7Yve6TDN my54zkIfwbLgB+1EzSmMP9255YsrchlP+Ql1lUR4s2wP0kOgQZgBUMx00XA1rwR3i82HE o32p1VyWQwCMPM2Q9+q3IJ0LgFyIzCQEnDGE7HXgJQfk+hmV/KBpqOvNvSZ4s6wKhi1fm Ay/dhglCGg7g88Q4tuY+uh9v5mw6I5FvnI6xHMQaQcgpLDXNm7NXXDIOmz7s7c6vG1uoP nEpIe0mVRi387a8WkIZo6U8ZiUF+auM2KBgQow7kSCqv2cUrE4ztwgVgK2G69cZ9m/w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796207353; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg: X-Received:X-Received:Received:From:Date:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding:Message-Id:References: In-Reply-To:To:Cc:X-Mailer:X-Authority-Analysis:X-Proofpoint-GUID: X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Info: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=IIjrLizjpMDxKoGjdXJka1gi9Pz8T4QZJRtgDYJd3tM=; b=m0D549YIV2n2MAZ7gP6lhkCwIQsHOkUJisxlyDs2Mrz3MKHaPDHiAjHBZRrnSjFeQwtX oicnZR2Wa5EcM4nMZnrHmcFp9j+klZM/6Q3Ys8e7e60p6K1yFla927WwUsvUPvz6XIv9C HOz8Av/9D7JK5QIxwFul7GPMs+wH9/oCmgtbyt4E2AeLBDz3djLujvRf7hnSacfh2LHpC N/oecrQbtuiJBqODGy96pFp5PBTzrKcTNWa8RHjKqDXVnVFP9Rb3iJhbN+QrZl1sjKLtF 67FU9whlo/55M2ELSqUwS4awMXdvmHIWBLNpUfATjnlbFKjlSIPGXvf4B6W7ECRFcRw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=fwrSKimF; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=TseSxXdW; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57641606A33B for ; Wed, 2 Dec 2026 10:29:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 57641606A33B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=fwrSKimF; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=TseSxXdW Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B2AB6c83653795 for ; Wed, 2 Dec 2026 10:29:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= IIjrLizjpMDxKoGjdXJka1gi9Pz8T4QZJRtgDYJd3tM=; b=fwrSKimFTlWXb/og +wT3meg30/AGz8pue5iPyuPFzLwwmg2bHJzC2n8rDAx76Z/qFCM88yYPqvLQ4NIw W84GUScBPiuo2t8B3aqX3RJeSwat2Akc1kizSpWTBnd0Pbma32ADkeenXDNskhhH 23aVmWbpvNI72Gkp2EXb323gAC68A7nL4x1+Z8gqX9uc1NW/nMBMF3xSw54lEKL9 hfm5x7pxT/Qr2BkP/XyElDilqHRMV+VSyHgYaapL6u/uT8PxH5fnRuG3Xbbn1/6i qKW6AO5rbyoVRcfueJA6UzVJAbe1f4RJf07rEoErOwztDx7YDVtxpvC/9Pee8VNI GNsUFw== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jahbx02fj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 10:29:12 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-cd3b9e70f88so8113467a12.0 for ; Wed, 02 Dec 2026 02:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796207352; x=1796812152; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=IIjrLizjpMDxKoGjdXJka1gi9Pz8T4QZJRtgDYJd3tM=; b=TseSxXdWanl1TxKHjjko2wO7BOwV3G/B08hR3i1X3M5UBclfl7osXr15n+NYfDWdRk RqDoTB/jieYK0zTYtpkOfNSwcvmfytPsNNODIT92TZipUdPH35dJLcxDEvoV3Jrg1TQU Xr/5c5bgSyy3Krh9v/LLw8WLCPU0lT23W2snzpif3RzNUR6AOL6RJjjQAS1gYNAFhqvN PkkzvxQTahAM6bTvHFu+ZPuv8c0wnXu+PT2XeLo396uwyE4xZUkUq9TjsMHx5EaLLWh3 Ipv61jeLjcrNqfgcIsrT+IcMPG7iu5Pebgf2kjq38IM8GIf8WyVgm3aVmri5s2umx3Q7 y7sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796207352; x=1796812152; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=IIjrLizjpMDxKoGjdXJka1gi9Pz8T4QZJRtgDYJd3tM=; b=HMQZGcttNEkc372d0bxif4viaZVhXuw+eGTu3h6eWnzYMMrPkWObiCIXi9EUoEgFjT 9m5OIYhkdKalQ/EBs+elkK9xLKfB7apjocijl+Kn1gygnEdVHdGprhdOZfSOhMn5hYWW +oyeF4fFo+/j2DFL+Yn82z1F4MSa3VMmeUwaW2GZDUiZ0QQnf9AE3iEuxOkWiHkfvDT5 Js28A8Kg/cTalPWr2J5AqTBC5H4WKXQ3vYdiIJz7Q7ewdlnHi7cLSAdSt/jbtYXEqxU7 5WeQUfe/wlopbhqh9KboNV69XDy63/1Przr37WCw7xcaoBwrjHta+8hbOllgpUArIgwD FNlQ== X-Gm-Message-State: APuU4Z+o6gzrj9e7HcCveWa2wzWJ1cU3s9qIS8GVc3Ul9qUv09h+hcgU VzJJn7eIAXKeOGFcPl2TuwIXnyyg/zqNUbklCVlxZ3+CMj8HZo1TLeIMA7hxQ4DL+TJP5SIY6DQ 3puhaQRNKKWgqjpRO0X1UKljXS7hMzAEn+o9uii4rHAd6MGK588fZrfG8JsrzNyuHad75 X-Gm-Gg: AZFdTZdR04FLI2ZvgxhAxXtQfSDrBUDdPlKyh2lZHyGycg8ixqx5PrljRiJF6EEpf6d EevJm06W+/GWmJ0rtJqaJQa2beD39kzdjYzU1wrfESck7NxmjY/sf5fmI01ME3foLj1L97yJ9kb D3VEgnfdS6CN135giUsMJzxE9YquKqFGYKo4m/A1Kn+5j4MJqhK7d8aYD8rHG2rjjTdecrseNj9 6em2tmiasWiXY6mPTpXUVLFnfstbeV3jL9xMosmdm5tB7BZTqOU0PY63LvuAif7YOlOhB4qJAXl lrpr8BwrDUnTubZlA45QexDZPRUm3OuIwc/OGE5opRA0+DypiylkOSXxh3/JPkoKdBCUj5TI6hP chHzAQyQd5+sLdScljBe8pzaU/IEOBZ4lo26CYCVgoBE6YRD0Jvu0iPIw2NKlaNY3AL8GHKNneb 8hXgtdc7kKrnqN59auyeBTRDFfnbhAUEwKzi9o6qjjablPiEw/JFYRH/47aY6Ve95g1f6mJNU= X-Received: by 2002:a05:6a21:e113:b0:3fa:ab6:3879 with SMTP id adf61e73a8af0-4014db64243mr49858367637.49.1796207351973; Wed, 02 Dec 2026 02:29:11 -0800 (PST) X-Received: by 2002:a05:6a21:e113:b0:3fa:ab6:3879 with SMTP id adf61e73a8af0-4014db64243mr49858348637.49.1796207351512; Wed, 02 Dec 2026 02:29:11 -0800 (PST) Received: from hu-pooventh-blr.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cde6d026d6fsm21699027a12.19.2026.12.02.02.29.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 02:29:11 -0800 (PST) From: Pooventhiran G Date: Wed, 02 Dec 2026 15:58:12 +0530 Subject: [PATCH wireless-next v5 17/19] wifi: mac80211: add mac80211 support to handle NL80211_CMD_SET_ST_CTX X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261202-smd-v5-17-1b020be65c7c@oss.qualcomm.com> References: <20261202-smd-v5-0-1b020be65c7c@oss.qualcomm.com> In-Reply-To: <20261202-smd-v5-0-1b020be65c7c@oss.qualcomm.com> To: Johannes Berg Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, pooventhiran.g@oss.qualcomm.com X-Mailer: b4 0.14.3 X-Authority-Analysis: v=2.4 cv=K5+3jCWI c=1 sm=1 tr=0 ts=6b0ff2f8 cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=CfIXnFgf48XKRvpxHxsA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-GUID: hKsb3EB9UoBgdDe8SKniocw0sLvixsOL X-Proofpoint-ORIG-GUID: hKsb3EB9UoBgdDe8SKniocw0sLvixsOL X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA0MSBTYWx0ZWRfXzEH9LYj0wTPo JGUgrDERxShKe6tOYGC39EVTF88v7CaWgkIw04CFMJWQmQ4Fb4yL16HV02Ml4IQtmOZawXW6HzR PhtB5o2enGhcRlXUlkC14VE3rp1cMpw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA0MSBTYWx0ZWRfX/36g6Bfr4mZL nd3QdXHEGdAdU1hPLnk8FIRdzOYuW+HeI5JnSsRB5mrOVwcZfYev6QFzOJVMDWhb/tnxnvHqJDx Jp4SVYLxhRnBTZmpVaTgRkpFHrqJ4FY/H6s776av5Tb7aTRJT0HNh2OOLcPdeJI8d0n1Sfrbevy tFxOdgzFZohTUe3eU6z6QpigWOY6NNR/8CL5KjjL91MvMU7+9n2+Gvha7BmgwlCx2V0wKYNJNdP uSeUax67oj/BdHZrZZgMDRBd6ybqTh6DA9B3olHsoFOdFUVyF52HZFj5F1/lZoC6jRvFQj5jnOt puGrKDsX7O+VJcKYzu10svqhcSetCZ+5VMmdluqJfnZH9a9r96OmgHW1Bkl8u/S1LiEWZezkTvX zYP5EFT4Q7jw3QmnnG1xt0EB+IEWQ69BvdMwwdFMXkasTAavdynqxxiPIfQXlNxpaLIvO62GgoA hHBkac1P9wTsA/JPk2w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_02,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 phishscore=0 spamscore=0 impostorscore=0 malwarescore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020041 cfg80211 supports NL80211_CMD_SET_ST_CTX on the target AP MLD for userspace to program the station's dynamic context on the TX and RX queues. Add mac80211 support to handle this command in driver and lower layers so that the context is installed and the target AP MLD is ready to continue data transfer with the non-AP MLD from where it may have left off at the current AP MLD. This facilitates the seamless roaming benefit of the ST procedure. Signed-off-by: Pooventhiran G --- include/net/mac80211.h | 5 +++++ net/mac80211/cfg.c | 30 ++++++++++++++++++++++++++++++ net/mac80211/driver-ops.h | 24 ++++++++++++++++++++++++ net/mac80211/trace.h | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index be8406bb0d73..6b500d039374 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -4807,6 +4807,8 @@ enum ieee80211_sta_st_state { * notification frame. * @sta_notify_st: Notifies low level driver about IEEE 802.11bn ST substate * transition of a station. The callback can sleep. + * @set_st_ctx: Set the ST context for the non-AP MLD. This is used on the + * target AP MLD side to program dynamic context. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -5224,6 +5226,9 @@ struct ieee80211_ops { struct ieee80211_vif *vif, struct ieee80211_sta *sta, enum ieee80211_sta_st_state state); + int (*set_st_ctx)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct cfg80211_smd_transition_info *st_info); }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 0a4ba00c962e..9f0083fa7dd9 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -6351,6 +6351,35 @@ ieee80211_set_nan_non_evac_channels(struct wiphy *wiphy, return ieee80211_nan_set_non_evac_channels(sdata, channels); } +static int ieee80211_set_st_ctx(struct wiphy *wiphy, struct wireless_dev *wdev, + const u8 *addr, + struct cfg80211_smd_transition_info *st_info) +{ + struct ieee80211_local *local = wiphy_priv(wiphy); + struct ieee80211_sub_if_data *sdata; + struct sta_info *sta; + + lockdep_assert_wiphy(wiphy); + + sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); + + if (sdata->vif.type != NL80211_IFTYPE_AP && + sdata->vif.type != NL80211_IFTYPE_AP_VLAN) + return -EOPNOTSUPP; + + sta = sta_info_get_bss(sdata, addr); + if (!sta) + return -ENOENT; + if (!sta->sta.smd_sta || + sta->st_state != IEEE80211_STA_ST_PREPARED) + return -EINVAL; + + if (!wiphy_dereference(wiphy, sta->ptk[sta->ptk_idx])) + return -EINVAL; + + return drv_set_st_ctx(local, sdata, &sta->sta, st_info); +} + const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, @@ -6474,4 +6503,5 @@ const struct cfg80211_ops mac80211_config_ops = { .nan_set_local_sched = ieee80211_set_local_nan_sched, .nan_set_peer_sched = ieee80211_set_peer_nan_sched, .nan_set_non_evac_channels = ieee80211_set_nan_non_evac_channels, + .set_st_ctx = ieee80211_set_st_ctx, }; diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 8b35f3f89f78..5cef900b7809 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1793,4 +1793,28 @@ void drv_sta_notify_st(struct ieee80211_local *local, struct ieee80211_sta *sta, enum ieee80211_sta_st_state state); +static inline int drv_set_st_ctx(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct ieee80211_sta *sta, + struct cfg80211_smd_transition_info *st_info) +{ + int ret; + + if (!local->ops->set_st_ctx) + return -EOPNOTSUPP; + + sdata = get_bss_sdata(sdata); + + lockdep_assert_wiphy(local->hw.wiphy); + + if (!check_sdata_in_driver(sdata)) + return -EIO; + + trace_drv_set_st_ctx(local, sdata, sta, st_info); + ret = local->ops->set_st_ctx(&local->hw, &sdata->vif, sta, st_info); + trace_drv_return_int(local, ret); + + return ret; +} + #endif /* __MAC80211_DRIVER_OPS */ diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index 00464c6f3ae7..c996f99ea1b2 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -3454,6 +3454,42 @@ TRACE_EVENT(drv_sta_notify_st, ) ); +TRACE_EVENT(drv_set_st_ctx, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct ieee80211_sta *sta, + struct cfg80211_smd_transition_info *st_info), + + TP_ARGS(local, sdata, sta, st_info), + + TP_STRUCT__entry( + LOCAL_ENTRY + VIF_ENTRY + STA_ENTRY + __field(u8, st_type) + __field(u8, dl_tid_bitmap) + __field(u8, ul_tid_bitmap) + ), + + TP_fast_assign( + struct ieee80211_st_ctx *ctx = st_info->ctx; + + LOCAL_ASSIGN; + VIF_ASSIGN; + STA_ASSIGN; + __entry->st_type = st_info->type; + __entry->dl_tid_bitmap = ctx->dl.valid_tid_bmap; + __entry->ul_tid_bitmap = ctx->ul.valid_tid_bmap; + ), + + TP_printk(LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT + ", ST type=%u DL TIDs: 0x%x, UL TIDs: 0x%x", + LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, + __entry->st_type, + __entry->dl_tid_bitmap, __entry->ul_tid_bitmap + ) +); + #endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */ #undef TRACE_INCLUDE_PATH -- 2.34.1