From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796207331; b=ptJd35fjfLJlpdVsrpEsjvJuurfk/GSC28UE9ixAWMhxjEyhv9PzFjKhvPlYKJwRbwI0 8nxs2W2cIaWWYldUrMJLnZTTg+SLOzcUK0z/fmZgTIX53WnijK/wQEFCiAQbTX4Zto3W7 Ggvt2i2cT0Z6e8w5P0UtAFB7hO8x9ApKtEz2ZhIqqN+NMcuY1eoOdk6JSwExr0CHJ2461 ec7IydN8S0lZwDZQsj3Iw/tku18nu+8OGF00u9PLjisOWkLTAtyln+VaQyL5J7upilOul VfRzlwJiKqF9y9rarjYM79rabGJlvSxjyQq35aHIeysPwvOsOiCZcb7iJnAsCcV2JsA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796207331; 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-Proofpoint-Spam-Details-Enc:X-Proofpoint-GUID: X-Proofpoint-ORIG-GUID:X-Authority-Analysis:X-Proofpoint-Spam-Info: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=qgpdldiCfe7d4n8u8h3uEpivnry2dWF136p0BoSiTus=; b=l8wpd9dXSduWoyfEhibNstIsux7LQCIWO+zLTDgKwnkFvgPgbi1rkA5CRphx9veWGjMz Vu8NAS6Me+RVEkZk4gRjPsTB1aUZHrE9uqnB45AUiOWy6gvQpi3otk/BNa8pAtagJVy37 uUAL9AmqtXWezM2vuCg0P64j5iq2ScWGmOhC/WKJEifSiKqBlXWfhcQmz4zCDXhcjEIT6 jdIx4R30adiXTeokY+6ggZe0B9fkUnA6GQOecuumGlK4XzQ9QVatBwHLCqeOrN76jY7bW uYMJNq9KSbb1CQoWNlU3eI2Ne3iyZoS0hiT5brK8GfFLG7K2GjtzDO8o7S/5iqSd7HA== 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=PIShiSZP; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=C3HDLjcz; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 BB361606A32C for ; Wed, 2 Dec 2026 10:28:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BB361606A32C 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=PIShiSZP; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=C3HDLjcz Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B26p9VX018878 for ; Wed, 2 Dec 2026 10:28:49 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= qgpdldiCfe7d4n8u8h3uEpivnry2dWF136p0BoSiTus=; b=PIShiSZPATBcAYhr aA0hYPCu+BhpuGFna5t/xhVc9V4sNEqgKxByEN54jqLiYmwb0UR47eGLGYeyVctX o33lLCjVJ0oR7EQFaj3lpbSmAInrqKjDI2fSrJk3xFnkpr/yxx0GaM46PEYLax5A kMO2+9a4b3cj6JA76gLZC4+OJ8cKX1Zfo/bbZvZU4ti6ok6rzgfsoE5S+5p54yzP /55N+vyioJ9QqXMoGjtIao9vK7Xc4kVoJDxvXrismQinKNBzHo8/tqPEoM75Ia/T izrJ8K9C3NShAV2ecfFwau3wI5ODlRom3Q0UctO+cfyz4VgNGoxT+VyTLYG8ZdHh Afzdmg== 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 4ja4k0b26r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 10:28:49 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-ce0f6cf2a01so1385202a12.1 for ; Wed, 02 Dec 2026 02:28:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796207329; x=1796812129; 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=qgpdldiCfe7d4n8u8h3uEpivnry2dWF136p0BoSiTus=; b=C3HDLjczCOuo/e+0Uk0LNWm9RxUHIzEImDdEfu0qTUljIJ61vO8d5guVlf87acvsuI p4JZRphTX4oP3IA0A80HgnXkH7Osog5tGdUCzC8oSq1mR2egleECM3BJ6byvQnOa12H9 gWYpXKmM+ublIdHjrQ0XyS4vgFUY+Z1CMAsa4h+PRCjmy/GrnPyGClXxLLmqkLjy4s/V u9mQ9i1aJUzO/Tr4xcXwCrIPHSBIuevJn+eG5MgzS3erWlEZWEWhPZgxWuWaEly+K+ZJ STE/QXQiSBauwwwMzMD09c3mAq/RdRXeon5yuZlupJuO4Uzp1R0h+fnZl5bPQWBQaOnf GlPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796207329; x=1796812129; 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=qgpdldiCfe7d4n8u8h3uEpivnry2dWF136p0BoSiTus=; b=LH8ce7b3WLDjWwF+Zz6+EdLn1sMUnUldtczvn0OchdfjTsY+/4jysPdjZKYffhSt5J +s/awCUcHHkLwWlFo1mvWd/VP3IPXSnr24HeiOhmz5HiRDP7xcy0QAnP8lNFIMwt+8Gw hSDO+/p8IaNsLsTHDCy9hDVjfP29OuW5CpY3ykvAUxo6YvuM49Y1cEVGfWHqDFcfJlu6 ECp/RaYCnnmkg6NoDe1nGq9nK71Y7drEYRGtRElXGBYLlPwDoOZlG6IWnThe2VpUFmi2 Um5z8LYn0uaB4gV+Smc2Jifh84mBQZWp0ltdHQQJP8Devs8qiBX20jQ0WboOVXEUWa8J hcUg== X-Forwarded-Encrypted: i=1; AL+hErHoGnEkBFRKzYrhaWFtA1EqbpvtLSswP/8pxc26NjFIifJ4EUUmKw0fCj9IQ7JgoYvxlonmxlsUqJkSPQM=@vger.kernel.org X-Gm-Message-State: APuU4Z9Hz/pzHSWfz49Pn8oRu8J2o/hd10WH+btO8l8iRmP60mTjvKcM HcK0FQauzsR4VmCt4kG6kpXEakhEOseMf2tSO3nNkvpTaaDQDI+FOTP6Yp1LbyTL7/XavtwLI84 LqbEjOPn6jeNLEUuHSWkLydlYbxPePcBBe1SNGWRCWkaekcUQFptsjaAZV9imh25hCuDipm3l6Q == X-Gm-Gg: AZFdTZfJE1dKNMtL7Q4NZW4RxFh75OPMspoticIsZDFwcSzbUqa83400OzlZp1qrEqS rU0gSmzmQwV4yxx9KFfcznleZrFiXqSt9IR5a0iCQ3jFsS3qO6PLYez+xODpORHRFnytZ6f0rBo p/IAvKgcgMs3IMAucLNKiwUtnNdAj0gOfvfGlsXWOWrWXdgL+CvFm7Fo0I/LC8pxMkTBGAe9BD9 LP8P4Pzff1Y4dyYhJ9I1OYV2sy8+5hF1OBxmP7GNcJz6bAS7nxv34A+DSxcdLfAvyWnKBL9zz0S oG+XBVQDHFUG52zJkhIvNcHDtmHIKqkwxMYCKI9wnwCRO3CSigF08ujbXXb7uRH9YUTKsttB1Yx jPqnz6FsqtmsitIvDz/uO7FPjiXCudJGomNPq/1ycvhSHPmoCX54qxEllAXYrcoz/0yrOFJRaDS iWuhf19Y5dTbUgTZhfwGx3kutRXKgFRiFLDR6i7AJ4vSsqCqF1mil9j9VTldXsEj/CgpDs6+8= X-Received: by 2002:a05:6a21:1014:b0:3e1:d119:ee35 with SMTP id adf61e73a8af0-4014ae820bbmr45332179637.12.1796207328622; Wed, 02 Dec 2026 02:28:48 -0800 (PST) X-Received: by 2002:a05:6a21:1014:b0:3e1:d119:ee35 with SMTP id adf61e73a8af0-4014ae820bbmr45332150637.12.1796207328127; Wed, 02 Dec 2026 02:28:48 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 02:28:47 -0800 (PST) From: Pooventhiran G Date: Wed, 02 Dec 2026 15:58:02 +0530 Subject: [PATCH wireless-next v5 07/19] wifi: ieee80211: define API to check if frame is class 3 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-7-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-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA0MSBTYWx0ZWRfX5JAyECcIs+/c svBG3TtxSmjC50nvRJ6dEcTl9ksW7j/iHGHQYLCcpK1n9+GLfrZQcFxl9/8qLDtcv3AmmtxXPbY JjOGdm5WU1RtgtwV2W29qgRW/i+ln8Df7gyX2d8M4r4cdxiuS/jWex/aPmcTUPBC3EXCOTFiwsC M6rSd9ImczpPmZIu2YgbzBsEDYNKWqVkp4xl3szYYc49CW9Ou7lj1FCBX7e1Be67k/GjnCEhfou KE7PPlAWhX9Ex1Jgs8eGriGdMBehvkBANEV3tPjefqebw812Gip7Q0jwSRrpPowiGi3uMtvCOPN eTbvHYNZydWKJmqe/8e9aAplgcKR3zX5DheU1OdAo8Zfi7ke3ustYRad3L0mZ9LORvyFj9OOY+P QwWovtHN3yEy3IPcDhhCA7l6s41uryReA3XoDJDDOVj8Kx/pbjpov9XolFv2aaFTEWqTlI0jHG6 Vi1/75abdzBnaxcDS4A== X-Proofpoint-GUID: Wf4B2uykWXoOLP2EH0TVTAVVoIon3-fT X-Proofpoint-ORIG-GUID: Wf4B2uykWXoOLP2EH0TVTAVVoIon3-fT X-Authority-Analysis: v=2.4 cv=I+Tw19gg c=1 sm=1 tr=0 ts=6b0ff2e1 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=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=e1lpAkfDEvgZfVEreGkA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA0MSBTYWx0ZWRfX+ILI6HFBViY8 LxN/kPEmPLRaQ9vr31KHa7uT3KVC/JKq/BZSaTDcaULlkf7870h8Gt1q4v16hqMa1mFhjZXiHjb T4DwD9HuJRWh3ycO0LGdQXIEpdJUvP0= 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 impostorscore=0 suspectscore=0 clxscore=1015 malwarescore=0 spamscore=0 phishscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020041 IEEE Std 802.11-2024, subclause 11.3.3, classifies a list of frames as class 3 and these frames are expected only if the STAs are at least authenticated and associated. Define an API to check if a frame is class 3 according to these conditions. This can be used to filter frames in both TX and RX. The API simply classifies the listed frames as class 3 and does not check if the STAs are in expected states. Signed-off-by: Pooventhiran G --- include/linux/ieee80211.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 3ac98fbd6146..3a916b8e4b6e 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -2941,4 +2941,47 @@ struct ieee80211_cip_cap { u8 v; } __packed; +/** + * ieee80211_is_class3 - check if this frame @skb is a class 3 frame + * @skb: frame to check + * + * This function checks the frame class simply based on the list defined in + * IEEE Std 802.11-2024, subclause 11.3.3. It does not verify whether the frame + * is unicast or related STA states. + * + * Return: %true if it is class3, %false otherwise + */ +static inline bool ieee80211_is_class3(struct sk_buff *skb) +{ + struct ieee80211_mgmt *mgmt = (void *)skb->data; + __le16 fc = mgmt->frame_control; + u8 category; + + /* Data frames */ + if (ieee80211_is_data(fc)) + return true; + + /* Management frames */ + if (ieee80211_is_action(fc)) { + if (ieee80211_has_protected(fc)) + return true; + + if (skb->len < IEEE80211_MIN_ACTION_SIZE(category)) + return false; + category = mgmt->u.action.category; + + if (category != WLAN_CATEGORY_PUBLIC && + category != WLAN_CATEGORY_SELF_PROTECTED && + category != WLAN_CATEGORY_UNPROT_DMG) + return true; + } + + /* Control frames */ + if (ieee80211_is_back(fc) || ieee80211_is_back_req(fc) || + ieee80211_is_pspoll(fc)) + return true; + + return false; +} + #endif /* LINUX_IEEE80211_H */ -- 2.34.1