From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796207326; b=xzZMEVEisLycwlmCExRVbol8RZYMHSWtHwfZtr/1MtZy14qHeE61SWru9atvdxJqCsjL bepabNUgMxNmsVxFKx166weDP6SeuzLBd0sa3YRyQrEHsUfQbjV785qxh0jhtYFCzYIY3 1O3m2hdoqPonZUjvI2GNME19Gq9tSoLWDLwoZYMnmZXX3A7g0HKIYHiB1MNPF9KJvqBeI 3MYuUbcQrRvk1o2TaRHsa+1eUGqQW4fS+o44ZRnbiVT99fDaXIZY2PFQDnZ0ubjDjrhY3 8N73UGW8LmlGcqladuUaerqzDuH+FbTO/As978D4YsagGB79WnDW7rV78N919FKZTZw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796207326; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: 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-Spam-Info:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-ORIG-GUID:X-Proofpoint-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=H4dvADIsOF+0CjnY8RV3mEFAMnAEBO1GiNoRz+0g+Kg=; b=WDY1iG2yeqtmxYalEIqUlTk0OPpYh7tGghCxZQ52Xx45p++b4vO5xYG7a5EXWvlTfIVN UZuiG7ESUiTTnXy1PcQGFl0KC07yZPgsiytvm2JHjDSN7xIhzI25GsAapdwveJ9Zyg/eG OMtaE/Otsa/WENfiUbV4iXLTBo/RUOm9Ei7n+vD4Kxe6rwmRuvgF/Z6JROK8tFSGrprrs er8ZMh5iwVxkoD3M3DTOfNdi4Duke6T3mgLb4pZdiwEGM67OXxEEuFRyloYsXTBdeGouY 5zd2YHGV4ILCc/NJIFJ/0E629JitD9JSaGQYQq3SiWoziNn/2+Yc+k1lVDTXaagARNA== 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=MmotOdki; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=Fe4Pn8Qr; 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 99822606A338 for ; Wed, 2 Dec 2026 10:28:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 99822606A338 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=MmotOdki; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=Fe4Pn8Qr Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B26p6xP2382937 for ; Wed, 2 Dec 2026 10:28:45 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= H4dvADIsOF+0CjnY8RV3mEFAMnAEBO1GiNoRz+0g+Kg=; b=MmotOdkigH5VovFS GspMnleoZHnz8DmRf/+vX0MRewIUic0Lwf54GRwL2Pyk0YJWZmddaXt5HtZaPdvH /Lfo3+gkACAKOKkXS3KtgqhAPurmoMdElzOd5JAW5IeVNT+efwAFOzQ/nDIqnsux Yk97PPmbw6igXYP+fz+7SiuT/pYWS2ENZNWg7oJpQJ9XiLhYSiiQ+qGl0I3D0XBa 2uXxFJSev0KnMFzpvi49vdSbtg3D4tAL4t+pza8Jv8HksrMNwkTVU4PxUdCi7ME0 6g1Aplrht2LjRZKZ7Os7TyARaOgThPjfiKheIG0KXvvW+aL1cFCbIG/YntazuB2A jrt4pw== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ja5p9jv7b-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 10:28:44 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-cde00369ef5so7936913a12.3 for ; Wed, 02 Dec 2026 02:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796207324; x=1796812124; 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=H4dvADIsOF+0CjnY8RV3mEFAMnAEBO1GiNoRz+0g+Kg=; b=Fe4Pn8Qr2JtLH5kDyKoZEYfAUzScBxw011S5/qa31ImXfEc9tLVAE3g9GM8y8KP9fZ bOuLJHEE4lW+mxn4R4kNbH4o5/NajVOJkDtoZ97XV5rEj7CrX60WKwAxZtM4581TvA+v vSKe+5V0ZH9c7zfGgoQUOKP8iUZHqk4sC9DwOqYxjefRGlOgJcOjwXCu5xurRrrYdKGm N+ad4+0lVegt/ayAQRiotDobeag3TxPaK74Z5mfIeja7SEGQsXFIPXVHFAeB4TiLyQ/6 SuVhDvPdMmbdIRrinDhRLaY0WyeLY7Wrd16qEVy2NoR8Kgb8vtxS7B+dHm6ylxOPZcLt gA4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796207324; x=1796812124; 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=H4dvADIsOF+0CjnY8RV3mEFAMnAEBO1GiNoRz+0g+Kg=; b=YUnWDvaVYIPL1nITxKJrYCRA5KmIp+8gtGxYoN2tUZBZ1SSfOQldmzj4N8nP63SeJ1 oAeP3ARTk5m3LF6//9W49sFdrw9LASye1BhAB5G1oZuGif0mGb6FxKiZEF1J0DL6HQzF QnMEJHQ6TMMwBhHN7O2Ca1qQbFE47K7I21jOLNhxR+Y0RtgYxRyjr1CQEhv6rxH2eGLg ZyjKK6Qjpzfgj5lQgJ7qpQOEcYTPZDiqipX3qWwxZyEiE9HD5e4Ry6oEcWKQsZ7URN7p //XK84JXCF4hPAU4F090hPLB/mtGfv1i2MdhJi97hLPRZLNs7hXRBbdJn/h8vFWr8zHg ncMA== X-Forwarded-Encrypted: i=1; AL+hErH4vY+PS/EkcdH6Yw1Zh4Ers+heaiUa4+sUx9djRvCoFcDQFQdQD3MyZudbPpBII2A7HNLiIU1hymvkPYQ=@vger.kernel.org X-Gm-Message-State: APuU4Z++IMWOU6XQFx+m2rMyZHRI45mE/lpdZz7S0uevPhsdFGFR+83d NIvQ2h3OSfYCA04luHRf94G51CfLOUuUThjKm8OQdBUlc1Fj1uEAHWRuFBF+wsBlWIVC1van3BL VzEC+cdYrHJTuLFTG+QoWclTdEdvFql6QEJSmNEyDCbcWVuehbkWyfl80Ww0FqSoah4FyJt/RDw == X-Gm-Gg: AZFdTZeI31+e7Ho15DGRk02B0B7L5N2UzFoQYpTF7K/IT0r6v/cy/6zr2GNMtPzBquf 8gwRVY716kXa7A6/tnqWThxYxltOhUVWkfS46WFfZJqgykKgbZfgUPktyQ6GOgiibG+uk68zaCb AC49cNhRdkgsQ8ayrljLfaJsrfBTAMlgc2br4fYWAsDTkvMKf6HEEeUdA+BCg5KND/bkoPsePpb rFL0SFypsFLq6P8Jq9uCyOc8MJBoC8hldHESiLPICAx3Yhhf4a0ua1FsP3kSVru4xkdSxngqFQb WgFwKC6Jn0a7EL7hDa5wqmzDIwP1i8Sm1Rq5vcohRIw/uzXwh8Vee3D0CVOinyh7AQGdAhARG9x tGlGR3Ss68lKkiupdj00eW7aNa35JPk4WIuvDFuq5dKgHC54iMYCyFJgSfgp7Xd8IHKcLNA4rbn WQCYYV49sobaJW10PypTJYRhhgIvarfYYqIfdBaibzkk+MqK0/ec73KMVIGkfljUREsCOBkMA= X-Received: by 2002:a05:6a21:7a8e:b0:3f8:7d30:49fe with SMTP id adf61e73a8af0-4014e64fee8mr42005961637.51.1796207324187; Wed, 02 Dec 2026 02:28:44 -0800 (PST) X-Received: by 2002:a05:6a21:7a8e:b0:3f8:7d30:49fe with SMTP id adf61e73a8af0-4014e64fee8mr42005933637.51.1796207323638; Wed, 02 Dec 2026 02:28:43 -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.28.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 02:28:43 -0800 (PST) From: Pooventhiran G Date: Wed, 02 Dec 2026 15:58:00 +0530 Subject: [PATCH wireless-next v5 05/19] wifi: nl80211: define interfaces for ST context transfer X-Mailing-List: linux-kernel@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-5-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=Ft6QbGrq c=1 sm=1 tr=0 ts=6b0ff2dd cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=EbOpiEzdjQQ3061yfEEA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA0MSBTYWx0ZWRfX3aFXp+lSZ/sH RGwAt+nRsNNluTxOBfEL71VIyUNa3QlEoVLIwchEiizhalUdPAIcrDJw/Gw7rujP58UFBKdKTN9 k1iYYSC12lR4xVPyvH1IWiIq8fWW/n8= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA0MSBTYWx0ZWRfX42caySSXo/ZI 24zH8T2nofYmUWDbYtIbTjB7269QklpJCLWthYad5RUPi1ANLYj3pmxCSyWlobLX8pC8LGY0fEn jw/kw/lp84Iu7z91iGlgMkiFOdiVidGs8tsvqtgyxsN8lQdjrNfihTOq05c4Z+SL7hMzaNeEDuZ ysYWiWTNhSJ7libb3GBlbGMh7u66zW4JU65padXXIR7NGR4WmyjZ+OAXXKTFpedWtmIBY7hj9ih 3FpiFToYNzkWaqx9mB6FT8504SwqCnvpG3zLzgV6Bxc0YYChvhJogtlVJ+3faCZrO0KYbtQ5phd OWvvxq4DQHP1707gyo42Nhshb2zrRbGR/YI/RhZGBrnLuEpzbgV8qstUGF3Np0pS+s2gkmR+yd9 ISWEsESJNnDIpEYINvCdf31CDHHpADE9EaCetq5nkFs6GKxZUm56hJEqYsE0GMwsdZfhx8INTro ZqGBcDjnl2wyo178y8Q== X-Proofpoint-ORIG-GUID: cq3GL9e326lr9ixhEOlhE94uL7Cj-rn7 X-Proofpoint-GUID: cq3GL9e326lr9ixhEOlhE94uL7Cj-rn7 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 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 clxscore=1015 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020041 Define nl80211 attributes and policies required to pack SMD Transition context along with NL80211_CMD_FRAME to be sent to userspace, and to set and get the context during roaming via current AP MLD and roaming via target AP MLD. Without these, userspace will not be able to transport the context to the target AP MLD, program the context on the target AP MLD TX and RX queues, nor fetch the context on behalf of the target AP MLD if the ST Execution frame is sent directly to the target. Suggested-by: Jouni Malinen Signed-off-by: Pooventhiran G --- include/uapi/linux/nl80211.h | 161 +++++++++++++++++++++++++++++++++++++++++++ net/wireless/nl80211.c | 40 +++++++++++ 2 files changed, 201 insertions(+) diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 5ef6f704be0f..0e59769161dc 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -429,6 +429,19 @@ * ST Execution. * %NL80211_STA_FLAG_ST_{EXECUTING,DL_DRAIN}, on the other hand, can be * set using %NL80211_CMD_SET_STATION on the current AP MLD. + * + * Drivers can use %NL80211_ATTR_ST_CTX to pack the dynamic context of the + * non-AP MLD along with the ST Preparation or ST Execution Request frames in + * the %NL80211_CMD_FRAME event. + * + * On the target AP MLD, this collected context, received in the + * userspace-managed backhaul between the AP MLDs, can be programmed using + * %NL80211_CMD_SET_ST_CTX. + * + * In case the non-AP MLD executes directly with the target AP MLD, the current + * AP MLD can request the context from the driver on the target's behalf using + * %NL80211_CMD_GET_ST_CTX and the response can be reported back using + * %NL80211_CMD_ST_CTX_EVENT. */ /** @@ -1589,6 +1602,19 @@ * addresses (%NL80211_ATTR_MLO_LINKS, each nested link with * %NL80211_ATTR_MLO_LINK_ID, %NL80211_ATTR_BSSID and %NL80211_ATTR_MAC). * + * @NL80211_CMD_SET_ST_CTX: Set the ST dynamic context for a non-AP MLD sent + * from the current AP MLD on the target AP MLD managed by an SMD-ME. + * This command carries %NL80211_ATTR_MLD_ADDR, %NL80211_ATTR_ST_CTX_TYPE, + * and %NL80211_ATTR_ST_CTX. The station must be present on the target AP + * MLD in the "prepared" state with a default key installed. + * @NL80211_CMD_GET_ST_CTX: Get the ST dynamic context for a non-AP MLD + * associated to an AP MLD managed by an SMD-ME. This command carries + * %NL80211_ATTR_MLD_ADDR and %NL80211_ATTR_ST_CTX_TYPE. + * @NL80211_CMD_ST_CTX_EVENT: Event reporting the collected ST context + * (requested via %NL80211_CMD_GET_ST_CTX) to userspace. It carries + * %NL80211_ATTR_MLD_ADDR, %NL80211_ATTR_ST_CTX_TYPE, and + * %NL80211_ATTR_ST_CTX. + * * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ @@ -1876,6 +1902,10 @@ enum nl80211_commands { NL80211_CMD_EXECUTE_SMD_TRANSITION, NL80211_CMD_COMPLETED_SMD_TRANSITION, + NL80211_CMD_SET_ST_CTX, + NL80211_CMD_GET_ST_CTX, + NL80211_CMD_ST_CTX_EVENT, + /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ @@ -3371,6 +3401,12 @@ enum nl80211_commands { * * @NL80211_ATTR_SMD: Flag attribute to indicate that the station has negotiated * SMD. + * @NL80211_ATTR_ST_CTX: Nested attribute associated with ST context data. + * Used with %NL80211_CMD_FRAME, %NL80211_CMD_SET_ST_CTX, and + * %NL80211_CMD_ST_CTX_EVENT. See &enum nl80211_st_ctx. + * @NL80211_ATTR_ST_CTX_TYPE: u8 attribute specifying the type of ST context. + * Used with %NL80211_CMD_FRAME, %NL80211_CMD_SET_ST_CTX, + * %NL80211_CMD_GET_ST_CTX, and %NL80211_CMD_ST_CTX_EVENT. * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined @@ -3980,6 +4016,8 @@ enum nl80211_attrs { NL80211_ATTR_ASSOC_PROTECTED_TWT, NL80211_ATTR_SMD, + NL80211_ATTR_ST_CTX, + NL80211_ATTR_ST_CTX_TYPE, /* add attributes here, update the policy in nl80211.c */ @@ -9343,4 +9381,127 @@ enum nl80211_nan_peer_map_attrs { #define NL80211_NAN_SCHED_NOT_AVAIL_SLOT 0xff +/** + * enum nl80211_st_ctx_type - ST Request Type values + * + * Used with %NL80211_ATTR_ST_CTX_TYPE. + * + * @NL80211_ST_CTX_TYPE_PREP: ST Preparation. + * @NL80211_ST_CTX_TYPE_EXEC: ST Execution. + * @NUM_ST_CTX_TYPES: internal. + * @NL80211_ST_CTX_TYPE_MAX: Max type of ST context. + */ +enum nl80211_st_ctx_type { + NL80211_ST_CTX_TYPE_PREP, + NL80211_ST_CTX_TYPE_EXEC, + + NUM_ST_CTX_TYPES, + NL80211_ST_CTX_TYPE_MAX = NUM_ST_CTX_TYPES - 1, +}; + +/** + * enum nl80211_st_ctx_ba_param - ST Block Ack Context attributes + * + * @__NL80211_ST_CTX_BA_ATTR_INVALID: Invalid attribute. + * @NL80211_ST_CTX_BA_ATTR_BUFF_SIZE: Required (u16) full BA buffer size. + * @NL80211_ST_CTX_BA_ATTR_POLICY: Required (u8) BA policy. + * @NL80211_ST_CTX_BA_ATTR_AMSDU_SUPPORT: Flag attribute to indicate + * AMSDU support. + * @NL80211_ST_CTX_BA_ATTR_TIMEOUT: Required (u16) Block Ack timeout. + * @NL80211_ST_CTX_BA_ATTR_EXT_NO_FRAG: Flag attribute to indicate + * fragmentation support. + * @NL80211_ST_CTX_BA_ATTR_EXT_FRAG_LEVEL: Required (u8) HE fragmentation + * level. + * @NL80211_ST_CTX_BA_ATTR_WINSTARTO: Required (u16) Starting Sequence Number + * of the BA window. + * Applicable only when %NL80211_ST_CTX_INFO_ATTR_BA_PARAMS is used with + * %NL80211_ST_CTX_ATTR_DL. + * @__NL80211_ST_CTX_BA_ATTR_LAST: Last attribute, used internally. + * @NL80211_ST_CTX_BA_ATTR_MAX: Max attribute. + * + * Used with %NL80211_ST_CTX_INFO_ATTR_BA_PARAMS. + */ +enum nl80211_st_ctx_ba_param { + __NL80211_ST_CTX_BA_ATTR_INVALID, + NL80211_ST_CTX_BA_ATTR_BUFF_SIZE, + NL80211_ST_CTX_BA_ATTR_POLICY, + NL80211_ST_CTX_BA_ATTR_AMSDU_SUPPORT, + NL80211_ST_CTX_BA_ATTR_TIMEOUT, + NL80211_ST_CTX_BA_ATTR_EXT_NO_FRAG, + NL80211_ST_CTX_BA_ATTR_EXT_FRAG_LEVEL, + NL80211_ST_CTX_BA_ATTR_WINSTARTO, + + __NL80211_ST_CTX_BA_ATTR_LAST, + NL80211_ST_CTX_BA_ATTR_MAX = __NL80211_ST_CTX_BA_ATTR_LAST - 1 +}; + +/** + * enum nl80211_st_ctx_info - ST Dynamic Context Information + * + * @__NL80211_ST_CTX_INFO_ATTR_INVALID: Invalid attribute. + * @NL80211_ST_CTX_INFO_ATTR_SN: Optional (nested), next SN per-TID to be + * assigned or last SN received per-TID for DL/UL individually addressed + * frames. + * @NL80211_ST_CTX_INFO_ATTR_SN_PER_TID: Per-TID SN (u16) used with + * %NL80211_ST_CTX_INFO_ATTR_SN nest. + * @NL80211_ST_CTX_INFO_ATTR_BA_PARAMS: Optional (nested) Block Ack parameters + * in DL/UL (uses &enum nl80211_st_ctx_ba_param). + * @NL80211_ST_CTX_INFO_ATTR_MGMT_SN: Optional (u16) next SN to be assigned or + * last SN received for DL/UL individually addressed management frames. + * @NL80211_ST_CTX_INFO_ATTR_DL_PN: Optional (binary) starting PN for + * DL individually addressed frames. + * @NL80211_ST_CTX_INFO_ATTR_UL_PN: Optional (nested) last PN received per TID + * for UL individually addressed frames. + * @NL80211_ST_CTX_INFO_ATTR_UL_PN_PER_TID: Per-TID UL PN (binary) used + * with %NL80211_ST_CTX_INFO_ATTR_UL_PN nest. + * @NL80211_ST_CTX_INFO_ATTR_UL_MGMT_PN: Optional (binary) last PN + * received for UL individually addressed management frames. + * @__NL80211_ST_CTX_INFO_ATTR_LAST: Last attribute, used internally. + * @NL80211_ST_CTX_INFO_ATTR_MAX: Max attribute. + * + * This defines the namespace for context information that are either common to + * both DL and UL, or direction-specific. Used with %NL80211_ST_CTX_ATTR_DL and + * %NL80211_ST_CTX_ATTR_UL, appropriately. + */ +enum nl80211_st_ctx_info { + __NL80211_ST_CTX_INFO_ATTR_INVALID, + NL80211_ST_CTX_INFO_ATTR_SN, + NL80211_ST_CTX_INFO_ATTR_SN_PER_TID, + NL80211_ST_CTX_INFO_ATTR_BA_PARAMS, + NL80211_ST_CTX_INFO_ATTR_MGMT_SN, + NL80211_ST_CTX_INFO_ATTR_DL_PN, + NL80211_ST_CTX_INFO_ATTR_UL_PN, + NL80211_ST_CTX_INFO_ATTR_UL_PN_PER_TID, + NL80211_ST_CTX_INFO_ATTR_UL_MGMT_PN, + + __NL80211_ST_CTX_INFO_ATTR_LAST, + NL80211_ST_CTX_INFO_ATTR_MAX = __NL80211_ST_CTX_INFO_ATTR_LAST - 1 +}; + +/** + * enum nl80211_st_ctx - ST Context information + * + * Top-level container for SMD Transition dynamic context. Carried in + * %NL80211_ATTR_ST_CTX with %NL80211_CMD_SET_ST_CTX (target AP MLD) or + * with %NL80211_CMD_FRAME (current AP MLD reporting context to userspace) + * and %NL80211_CMD_ST_CTX_EVENT (current AP MLD reporting the requested + * context on behalf of the target AP MLD). + * + * @__NL80211_ST_CTX_ATTR_INVALID: Invalid attribute. + * @NL80211_ST_CTX_ATTR_DL: Optional (nested) DL parameters. + * See &enum nl80211_st_ctx_dl. + * @NL80211_ST_CTX_ATTR_UL: Optional (nested) UL parameters. + * See &enum nl80211_st_ctx_ul. + * @__NL80211_ST_CTX_ATTR_LAST: Last attribute, used internally. + * @NL80211_ST_CTX_ATTR_MAX: Max attribute. + */ +enum nl80211_st_ctx { + __NL80211_ST_CTX_ATTR_INVALID, + NL80211_ST_CTX_ATTR_DL, + NL80211_ST_CTX_ATTR_UL, + + __NL80211_ST_CTX_ATTR_LAST, + NL80211_ST_CTX_ATTR_MAX = __NL80211_ST_CTX_ATTR_LAST - 1 +}; + #endif /* __LINUX_NL80211_H */ diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f15ddf5a94a6..3e51ce0155d3 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -808,6 +808,43 @@ nl80211_nan_conf_policy[NL80211_NAN_CONF_ATTR_MAX + 1] = { [NL80211_NAN_CONF_INSTANT_COMM] = { .type = NLA_FLAG }, }; +static const struct nla_policy +nl80211_st_ctx_ba_policy[NL80211_ST_CTX_BA_ATTR_MAX + 1] = { + [NL80211_ST_CTX_BA_ATTR_BUFF_SIZE] = { .type = NLA_U16 }, + [NL80211_ST_CTX_BA_ATTR_POLICY] = { .type = NLA_U8 }, + [NL80211_ST_CTX_BA_ATTR_AMSDU_SUPPORT] = { .type = NLA_FLAG }, + [NL80211_ST_CTX_BA_ATTR_TIMEOUT] = { .type = NLA_U16 }, + [NL80211_ST_CTX_BA_ATTR_EXT_NO_FRAG] = { .type = NLA_FLAG }, + [NL80211_ST_CTX_BA_ATTR_EXT_FRAG_LEVEL] = { .type = NLA_U8 }, + [NL80211_ST_CTX_BA_ATTR_WINSTARTO] = { .type = NLA_U16 }, +}; + +static const struct nla_policy +nl80211_st_ctx_info_policy[NL80211_ST_CTX_INFO_ATTR_MAX + 1] = { + [NL80211_ST_CTX_INFO_ATTR_SN] = + NLA_POLICY_NESTED_ARRAY(nl80211_st_ctx_info_policy), + [NL80211_ST_CTX_INFO_ATTR_SN_PER_TID] = { .type = NLA_U16 }, + [NL80211_ST_CTX_INFO_ATTR_BA_PARAMS] = + NLA_POLICY_NESTED_ARRAY(nl80211_st_ctx_ba_policy), + [NL80211_ST_CTX_INFO_ATTR_MGMT_SN] = { .type = NLA_U16 }, + [NL80211_ST_CTX_INFO_ATTR_DL_PN] = + NLA_POLICY_EXACT_LEN(IEEE80211_CCMP_PN_LEN), + [NL80211_ST_CTX_INFO_ATTR_UL_PN] = + NLA_POLICY_NESTED_ARRAY(nl80211_st_ctx_info_policy), + [NL80211_ST_CTX_INFO_ATTR_UL_PN_PER_TID] = + NLA_POLICY_EXACT_LEN(IEEE80211_CCMP_PN_LEN), + [NL80211_ST_CTX_INFO_ATTR_UL_MGMT_PN] = + NLA_POLICY_EXACT_LEN(IEEE80211_CCMP_PN_LEN), +}; + +static const struct nla_policy +nl80211_st_ctx_policy[NL80211_ST_CTX_ATTR_MAX + 1] = { + [NL80211_ST_CTX_ATTR_DL] = + NLA_POLICY_NESTED(nl80211_st_ctx_info_policy), + [NL80211_ST_CTX_ATTR_UL] = + NLA_POLICY_NESTED(nl80211_st_ctx_info_policy), +}; + static const struct netlink_range_validation nl80211_punct_bitmap_range = { .min = 0, .max = 0xffff, @@ -1221,6 +1258,9 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_CIP_CAPABILITIES] = { .type = NLA_U8 }, [NL80211_ATTR_ASSOC_PROTECTED_TWT] = { .type = NLA_FLAG }, [NL80211_ATTR_SMD] = { .type = NLA_FLAG }, + [NL80211_ATTR_ST_CTX] = NLA_POLICY_NESTED(nl80211_st_ctx_policy), + [NL80211_ATTR_ST_CTX_TYPE] = + NLA_POLICY_MAX(NLA_U8, NL80211_ST_CTX_TYPE_MAX), }; /* policy for the key attributes */ -- 2.34.1