Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp12368746rwb; Sat, 26 Nov 2022 08:02:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf7qciyuCaySPKX/TvcCMfAsl9q6ANvwIAWRAyUrOZrj+uEXT6AhqaKn2XQ225R6E/KV8aSO X-Received: by 2002:a17:90b:b17:b0:218:a733:25ec with SMTP id bf23-20020a17090b0b1700b00218a73325ecmr34160922pjb.152.1669478573599; Sat, 26 Nov 2022 08:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669478573; cv=none; d=google.com; s=arc-20160816; b=dH1uRlf+Z/0ebN+ZHg3gwf/EVCxQ4eEcnCgLR3hr9gFu5jfOFgZQTMq1Voiuy6sotp /VJuU+z3PcrXMKeeiui+LWq8UY2FOnD2tjRgMxoJ7PfaTA8hGaQw6hSuGm1iHcXLpSYj 3kZ/KIZUWXUm3dTVafGbtmHNagCApquuSHxfZfLmgEmE0QYY4uMY5cPuY+6zRuJilFRV jb5y62uZ1iCPms+2GsuY5DH+KV5fDYt+ASgx99mPFO5urGz08sAl8dO5e3HxvC35aXVp bxT28CFqmdXXjMThrhQUgvlLLE65ZiHItlZ5MQv6XKFw1+oC5D3WHT8/lamnL63L3KQV 6GzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=l753tbCo1OB4IKFxAr1TSEAfpZbLkLwJP+fWvZWNETI=; b=uT2w8xHtY4uMajUVplKJbD3x+aru3RdpH/NnjFEmg8GazyTckpuGxfeCRvEganUH5L MiYsB4Ai1knCZD96qm5mhb0d4RyoT4i3YR+AtV0vB3XFSa7KAmCWf0NpxRhqUQcnePuk ZFu0hAKN7f8eU1ONgqYQNzl5v0CZ5+pAHGQPQJDw1cpuiNpuYroQVLO9VfGIfSt3CYqd uXFnjjCkXg507wEA8zjEEFCySKsN/TgBbGtxVcLTwgqFVzlCtBa4TkbidKWUcrGUQe09 4koy8zwXHHN7sU6GRkoa+dN57r7qVkmbasXbrYoeccAhA3oVLk352ql2aJB/FkExRtqQ h12g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a056a00150100b00562dd22d708si6991064pfu.189.2022.11.26.08.02.43; Sat, 26 Nov 2022 08:02:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbiKZPnT (ORCPT + 84 others); 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: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, struct recv_frame *precv_fram if (!(pmlmeinfo->state & WIFI_FW_AUTH_STATE)) return; - offset = (GetPrivacy(pframe)) ? 4 : 0; + offset = ieee80211_has_protected(hdr->frame_control) ? 4 : 0; seq = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 2)); status = le16_to_cpu(*(__le16 *)((size_t)pframe + WLAN_HDR_A3_LEN + offset + 4)); diff --git a/drivers/staging/r8188eu/include/wifi.h b/drivers/staging/r8188eu/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) |= cpu_to_le16(_PRIVACY_) -#define GetPrivacy(pbuf) \ - (((*(__le16 *)(pbuf)) & cpu_to_le16(_PRIVACY_)) != 0) - #define GetFrameType(pbuf) \ (le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(3) | BIT(2))) -- 2.30.2