From patchwork Sat Oct 15 15:24:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2957 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp684162wrs; Sat, 15 Oct 2022 08:27:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Wz4SAbnX19pfR1WPNbsSgnA5cEJIf2+9JLCMssAFkA6qCM/dhuilhulX0+8DdxdzjvxeP X-Received: by 2002:aa7:818f:0:b0:562:dc99:8a84 with SMTP id g15-20020aa7818f000000b00562dc998a84mr3489549pfi.30.1665847626225; Sat, 15 Oct 2022 08:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847626; cv=none; d=google.com; s=arc-20160816; b=AIcZCHVqacbUyfm97rtzGJYj91teDGDDERH/oJtUsl8bYgbaOB3PElzWR47aGYzGtt xQZxfB5dG0bAyrrJWliyicwqir6ndC4kZ6Ysgaw7JpazvSvHhYHDK0/8g9GjFnhroE6z gIm2Pcus7euywBQnbhviqEtX9OvUI5LHQ/gaYP/mqTVCWOVHhvJMYILfy0Mr7dXZ7xdU q0R1F9TLL8t/l6TDL/ghchf2nqjA0GX/hjwCSUUeWkREsityO6XByg3jympPDYrYByx7 MxQL+SnIht1TaN5dVEQhZ+PdEoE2A7eCway3VzK3yQ7dKPCDhSho58OjoeVS5vL0khNR GGCA== 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=L0tbaHNtRG3f8JBk9J1jvbQ/YOqeYd5VfTmHojp70DM=; b=BAd0LrD15Kv8OgGxsu2dJGWsYekRCN6YTGSri0JAyu9cfdW5oGiCVvy537951O1tgc zuQmIMuVqXSa/1BLvRFfIMZtlPr1lQAccYmGWpSdDBpWx4Yp8M6jmDwZ82ETNhPVq7/i WPJnbJ7d/wu9Nkt8+6ULZHORWV+IUNFZYIgSOiRZJYPdQMrhEH+Ve6QG/6vCM5X78/e7 fW83oufWghlKE3NqHMTtB/xf5CEJ5bOj6QhWDv3QHoJgY5jeDPFSKqj2TanksKp8m27T ADBXGjesisY71p1gl1tIpf1KlvAsz0bIv/JMsW183gYYSnbsOkAn7ED0MuJDJJY1vIi1 WayQ== 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 v24-20020a631518000000b0046aeec7fe3dsi6086458pgl.703.2022.10.15.08.26.53; Sat, 15 Oct 2022 08:27:06 -0700 (PDT) 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 S229662AbiJOPZA (ORCPT + 99 others); Sat, 15 Oct 2022 11:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbiJOPY6 (ORCPT ); Sat, 15 Oct 2022 11:24:58 -0400 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 A1EB424BE5 for ; Sat, 15 Oct 2022 08:24:55 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojj1t-000722-Vp; Sat, 15 Oct 2022 17:24:50 +0200 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/9] staging: r8188eu: replace one GetAddr3Ptr call Date: Sat, 15 Oct 2022 17:24:32 +0200 Message-Id: <20221015152440.232281-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015152440.232281-1-martin@kaiser.cx> References: <20221015152440.232281-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?1746767840487781139?= X-GMAIL-MSGID: =?utf-8?q?1746767840487781139?= Define a struct ieee80211_mgmt for the message that we process in OnDeAuth. Use this struct to read the bssid. This patch removes one GetAddr3Ptr call, getting us a tiny step closer to removing GetAddr3Ptr. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 07905e2ae8e0..0c4b3b99150d 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -1457,6 +1457,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame) { + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; unsigned short reason; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -1464,8 +1465,7 @@ unsigned int OnDeAuth(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 _SUCCESS; if (pwdinfo->rx_invitereq_info.scan_op_ch_only) {