From patchwork Fri Dec 2 09:31:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 28830 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp738869wrr; Fri, 2 Dec 2022 01:46:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf5sv3/tw1sjT0kx1vDpcJNzV1DRQqnAf73rhYip53zkES8W7SFib8un/Tab6Wbtupz7+rM0 X-Received: by 2002:aa7:cf03:0:b0:46b:35dc:cf4d with SMTP id a3-20020aa7cf03000000b0046b35dccf4dmr20330126edy.423.1669974366329; Fri, 02 Dec 2022 01:46:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669974366; cv=none; d=google.com; s=arc-20160816; b=laQ3Uq45ftC6llae+2fvpnPKHzRGFMJUzm3HsftOWTafr/s/vlQpCnFRxqSA4McoMu yVdGvv20DBlnvp46y/+piCUFb1YMIJRQZxLr7DBe/EOJCifAycW73JWN/H45gMilP3ZO WTyYWybSCxZ1zy0toSND42oMeN4za3VIiRnpGSYFidOQplkSMDosgV4MP+QysSD09iqA BRQaXcHbBellpE5kH1Y50zEOEgG3CmWRrb2kvs+Xf5ecy5i+KlK5Z+lmpJhl2aiUoMCc 5ncxGqGUBBBGFB+ovH+kMXRprxyGMEc5uZi9nMvWPz8/jBFN6xjxTKb3p8oTPV3mS+ky ZItg== 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=cq4J0F4KXv/cd0s5xpjf8slws79emXa1cLEna5YUAvw=; b=l3Uwwvh3JTiWdRzrVRKCjoKTOtZVfc0Q7lwjh8ukSGBGMAGG3xgtMtEVehF+3/LMFM 00Q/dhAZKbMJ/FzLNF0jU84BRdu8BWyh70Xbyu/tJS/RxJaaF0BrUVjyb38muC1YKsJ/ 0WyzfqrxgLH5OeqPnc7UNIY2h09c1GRbdMVJMbdx1Ksw06bVq2CeJf8vodBnJtQJQX8b dGUzund4QCfjoRskJd9GKMrgbE+KJz6bOimahP52Tfchj36Nx7G094rnjD027Vf8hzIe cZXXLT/ApmzokqAqq7r+aa0qdYCIfqwGeqPs2udXCOERAlvgKZigaJb788YvFUrQRYfV PyJQ== 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 gt7-20020a1709072d8700b007309e8d567fsi7037687ejc.145.2022.12.02.01.45.42; Fri, 02 Dec 2022 01:46:06 -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 S231661AbiLBJc3 (ORCPT + 99 others); Fri, 2 Dec 2022 04:32:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232708AbiLBJcV (ORCPT ); Fri, 2 Dec 2022 04:32:21 -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 B859EBE111 for ; Fri, 2 Dec 2022 01:32:20 -0800 (PST) Received: from ipservice-092-217-087-074.092.217.pools.vodafone-ip.de ([92.217.87.74] 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 1p12P0-0001zC-3F; Fri, 02 Dec 2022 10:32:14 +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 2/2] staging: r8188eu: use subtype helper in rtw_check_bcn_info Date: Fri, 2 Dec 2022 10:31:59 +0100 Message-Id: <20221202093159.404111-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221202093159.404111-1-martin@kaiser.cx> References: <20221202093159.404111-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?1751095041232157895?= X-GMAIL-MSGID: =?utf-8?q?1751095041232157895?= Use ieee80211_is_beacon to check the frame subtype in rtw_check_bcn_info. Replace the call to the driver-specific GetFrameSubType function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_wlan_util.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c index da3465d6bb0f..f1ebb5358cb9 100644 --- a/drivers/staging/r8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c @@ -874,9 +874,10 @@ void VCS_update(struct adapter *padapter, struct sta_info *psta) int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) { + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)pframe; unsigned int len; unsigned char *p; - unsigned short val16, subtype; + unsigned short val16; struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network; /* u8 wpa_ie[255], rsn_ie[255]; */ u16 wpa_len = 0, rsn_len = 0; @@ -908,9 +909,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) if (!bssid) return _FAIL; - subtype = GetFrameSubType(pframe) >> 4; - - if (subtype == WIFI_BEACON) + if (ieee80211_is_beacon(mgmt->frame_control)) bssid->Reserved[0] = 1; bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len;