Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1443133rwb; Tue, 29 Nov 2022 13:44:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf7s7Po3HyUaDTYfxK16v4KagXDygmW1oZ2NiDgz2QvH9pALm+/olDNQaqAU1V+We6vYhAPL X-Received: by 2002:a17:90b:48c8:b0:213:2912:7a28 with SMTP id li8-20020a17090b48c800b0021329127a28mr62001631pjb.51.1669758270137; Tue, 29 Nov 2022 13:44:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669758270; cv=none; d=google.com; s=arc-20160816; b=QWK5wdjqnHGrH+4aNFKkgcGOMMhX9avYS/pQv/2SLU4AFTYQ5q8YnoYYRV82/qETyn ZZbWbU0uZ7S0mWdNakGhZ8HWkHrTVxEEY290TurrtBonIPKGV+DPH/+sX9aTivsy+naP lXa++czvt9TVD7L6+7tsT1hp1tAOfek11ed+/phr4CN/waEOTvxfeyXJiPXwr78IuCOs sJON/rdRgpYoD8hIV6WbeJKc45NsbGGK9BQpZl+XwTUPg32h7gYNHTcQTQF6hQtpvQDE dGeXx1eSJBFDgmnxS1vVSUsftdn2I4CmPVOI4OhasBwNBfUp3gBEABxNIbVBucvBlNKp A8pA== 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=OtLeSre2S74mgd3s3gUT97rB1yFOLl7gQYAYwnSWSpw=; b=gz/Fh/d/WNwmucw0vspwCEzMD3H89UMigWhIYB4PVJAIhvFRlAn9hqycm4gRvQrWap FCK+usJAd+uJiMsa/zq5b0bP3qGHxGYLnWEECzoSoLKt21sY3UfQP2x04kptr1FmhGV6 RPhYPFVE305WbE8r2qpSNO8R4J3+aCeFdr/95cQ9Jwdowb3iaIm/KlNsUuCmaE+LNY3C lIbLPlBqFB9L0rXqjgEM+fwoZwFKNkS4hccD9fhhfezvG6q/F9AVSfYH3wSjBhoQzz7N 9NBpvETBRxD9kWjWP0tt0oztX6czuZ2gNITLlz7nkYOtR7T8ww3aS08QUy1YguOLWuMt Tlgg== 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 h2-20020a056a00170200b00542c772d478si15903449pfc.247.2022.11.29.13.44.15; Tue, 29 Nov 2022 13:44:30 -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 S236439AbiK2UwK (ORCPT + 84 others); Tue, 29 Nov 2022 15:52:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236315AbiK2UwH (ORCPT ); Tue, 29 Nov 2022 15:52:07 -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 E08565FE7 for ; Tue, 29 Nov 2022 12:52:05 -0800 (PST) Received: from dslb-188-104-061-001.188.104.pools.vodafone-ip.de ([188.104.61.1] 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 1p07aC-0001pO-Aq; Tue, 29 Nov 2022 21:52:00 +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 1/5] staging: r8188eu: use ieee80211_mgmt to parse addresses Date: Tue, 29 Nov 2022 21:51:48 +0100 Message-Id: <20221129205152.128172-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221129205152.128172-1-martin@kaiser.cx> References: <20221129205152.128172-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 Define a struct ieee80211_mgmt in the OnDisassoc function and use it to parse the addresses in the incoming disassoc message. This replaces some driver-specific functions for address parsing. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index d32b2d569e23..b2b2cb57ed04 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1427,6 +1427,7 @@ static void OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) static void OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) { + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; u16 reason; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -1434,8 +1435,7 @@ static void OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) u8 *pframe = precv_frame->rx_data; struct wifidirect_info *pwdinfo = &padapter->wdinfo; - /* check A3 */ - if (!(!memcmp(GetAddr3Ptr(pframe), get_my_bssid(&pmlmeinfo->network), ETH_ALEN))) + if (memcmp(mgmt->bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)) return; if (pwdinfo->rx_invitereq_info.scan_op_ch_only) { @@ -1449,7 +1449,7 @@ static void OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) struct sta_info *psta; struct sta_priv *pstapriv = &padapter->stapriv; - psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe)); + psta = rtw_get_stainfo(pstapriv, mgmt->sa); if (psta) { u8 updated = 0; @@ -1466,7 +1466,7 @@ static void OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame) return; } else { - receive_disconnect(padapter, GetAddr3Ptr(pframe), reason); + receive_disconnect(padapter, mgmt->bssid, reason); } pmlmepriv->LinkDetectInfo.bBusyTraffic = false; } -- 2.30.2