Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1860446rwb; Fri, 2 Dec 2022 02:04:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf66NKAJHP8iNCR9Pn7powsYzgxyw6Ui/57sp7bAP6kbaPMuZqIISpXKI/N9GMITpPZa7LZT X-Received: by 2002:a17:906:2288:b0:7bf:888b:f039 with SMTP id p8-20020a170906228800b007bf888bf039mr14686509eja.429.1669975442308; Fri, 02 Dec 2022 02:04:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669975442; cv=none; d=google.com; s=arc-20160816; b=oCZAZED/QNphHC8D/T/cdXCJq+24Td6jMcfSXK6FFxIsEfCE5b1ks+zIz1O5+PdCRU KPEu9/CKFwQQ1Z/wLLAQ08N2wXlrOFMLPeGN6fiXw76w6LoAiOK25ftMLwRnRotShkBo N+U9TJrzCBedijeoiy2ic4rMsLZw16Sa8jOV6ZrDEnC592AYEs8pSuEscdsNvEC22BbM IQGyuOdwLttzgEA8PUfdfij77kxD1OfgyS8OZRAFo6gIheRp+J9htozmt69JSK2MDPiR a1SFAu5siMiNHla+QgfzlF/Wq189wkZe6lPNR5/EDFQ79wQ5tiPeqLUZ9PQOYgw+9e+4 7sfA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kz10-20020a17090777ca00b0073d81935416si1354230ejc.749.2022.12.02.02.03.40; Fri, 02 Dec 2022 02:04:02 -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 + 84 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 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_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; -- 2.30.2