From patchwork Sat Nov 26 15:42:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 26257 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4699835wrr; Sat, 26 Nov 2022 07:46:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf62gvybRlYENcbIHc/XDD28fqD1YeqAzVywRGMLodA5SGaN7U8/tBsI0FF2eJIQeAcGrDR9 X-Received: by 2002:a05:6402:3203:b0:467:b8c9:a7fa with SMTP id g3-20020a056402320300b00467b8c9a7famr25402639eda.25.1669477617982; Sat, 26 Nov 2022 07:46:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669477617; cv=none; d=google.com; s=arc-20160816; b=XwORGCU3pTGrsRHaIHiOETZZcCPIbL6WqxzduoTiNsRurWaPcCaeZrQxcoWiVGrphz Uy1LJS2JWjKL0mUu5BWYLaZ1om1G6+S3zfzxxshvBeuBbT2mFLDxaIz+T93UB4CXf1iF 4yxgmhzhlPBJz4w+IJoOJrI1smaHBgrohmE44QpzLXLYdh8+VOFjntx/Y8dGgLbV+RUG Z+xOYrQKGFrAfI/cZx6bw5mWvELw9zxXulVhrnAUChr6FgdtXWSH15oCy08GdQUxuiDR 4zLOZOhkCkeLUIupcAxn+E/NfCTFj6NQ969hUkC9zsY3DwPSJRljV7IaPTNQNT3G3Gc4 7mqA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd20-20020a1709069b9400b007ae8b1704d0si6803160ejc.68.2022.11.26.07.46.34; Sat, 26 Nov 2022 07:46:57 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750574162654585879?= X-GMAIL-MSGID: =?utf-8?q?1750574162654585879?= 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)))