From nobody Fri Sep 19 09:04:32 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99294C4167B for ; Sat, 26 Nov 2022 15:43:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbiKZPnT (ORCPT ); Sat, 26 Nov 2022 10:43:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbiKZPnI (ORCPT ); Sat, 26 Nov 2022 10:43:08 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 044D9D13B for ; Sat, 26 Nov 2022 07:43:07 -0800 (PST) Received: from dslb-188-096-151-149.188.096.pools.vodafone-ip.de ([188.96.151.149] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1oyxKY-0000Lt-Fx; Sat, 26 Nov 2022 16:43:02 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 5/5] staging: r8188eu: use ieee80211 helper for protected bit Date: Sat, 26 Nov 2022 16:42:53 +0100 Message-Id: <20221126154253.178275-6-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221126154253.178275-1-martin@kaiser.cx> References: <20221126154253.178275-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use ieee80211_has_protected to check if the "protected" bit is set. Remove the r8188eu driver's internal macro for this check. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/r8188eu/include/wifi.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/= r8188eu/core/rtw_mlme_ext.c index 667f54e313ef..93696892ec7d 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -809,7 +809,7 @@ static void OnAuthClient(struct adapter *padapter, stru= ct recv_frame *precv_fram if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE)) return; =20 - offset =3D (GetPrivacy(pframe)) ? 4 : 0; + offset =3D ieee80211_has_protected(hdr->frame_control) ? 4 : 0; =20 seq =3D le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset= + 2)); status =3D le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + off= set + 4)); diff --git a/drivers/staging/r8188eu/include/wifi.h b/drivers/staging/r8188= eu/include/wifi.h index 2381c519ceaf..254a4bc1a141 100644 --- a/drivers/staging/r8188eu/include/wifi.h +++ b/drivers/staging/r8188eu/include/wifi.h @@ -170,9 +170,6 @@ enum WIFI_REG_DOMAIN { #define SetPrivacy(pbuf) \ *(__le16 *)(pbuf) |=3D cpu_to_le16(_PRIVACY_) =20 -#define GetPrivacy(pbuf) \ - (((*(__le16 *)(pbuf)) & cpu_to_le16(_PRIVACY_)) !=3D 0) - #define GetFrameType(pbuf) \ (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(3) | BIT(2))) =20 --=20 2.30.2