From patchwork Sun Oct 30 17:33:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13027 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1894216wru; Sun, 30 Oct 2022 10:36:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5WbYdNxAhABOU+lMV18Rhz6+77CwrT5BGk+VSlwnq7NLhiSm/z/2bNrHiA0vxusyhx4BSd X-Received: by 2002:a17:906:d550:b0:7ad:d2f1:dba5 with SMTP id cr16-20020a170906d55000b007add2f1dba5mr948744ejc.52.1667151390729; Sun, 30 Oct 2022 10:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667151390; cv=none; d=google.com; s=arc-20160816; b=LL5CVYbVXDIVGxSPBeiJb0v6G7Gdhs/nOrhN5pYY6BShG3IUBLZvq9H0AMNlT6URIr 1M8AeUztafoccput/YpUThGnM8arrky/EVMGX+hCxVKuV7t4Jyi9i4VGthtamM+8gGvE lW854NfaSrBJ+tNSfKk0wb0dwwux5nLDssVK+IxgnJrTxqwAzbfCNV30MS+ZjYNCIi/e ySHtLxeZBmeHrAX9VPLNrHqaKGLpSChB3WCYN64yxh7zFD6/dNyi11wvEqyBA6u7Ms44 t80x3nWXhKQJQ1nPrGDsHx1DGFpOddFhRg09jTsz5wUhCX+B0Dun08dSQRkA9M01p9mb /2JA== 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=Jr1Pf/cAP0ppjRSAqASGtNYX03PHXCDu94XYIiGeu1k=; b=sUxRU5uyb3Ln04B0dLZum42uBHdGNoZbpWKZUXfybgfCTGq21NUHkiVWyt1wTZdXiu MueZwJrJFCP7V/FlNuAMhFcRXepoGThb4gJh7nx1E4bnaDkLx8blFduQabfjf9KeZ3xK JhMhQp1GuuKbQCZwBDaE2kJfeM5qLAkE3AF+pQOVvvo8wNggcKfJ460g0rHuNBQqfT1t InRx9JOADavGXQkI61qATlEUm7SJyPI5Vlf9Biifmsn4Jku1FJ21ii9mC5OS3603cvnC GD/SLsr0Giti/Tz0d02nZ1U1d7+Yo8kA9SSV4laR803/S7I6EQc+WiPxPrft1YbmY6Om mFcA== 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 jg6-20020a170907970600b007a6ec03b13bsi5999765ejc.799.2022.10.30.10.36.07; Sun, 30 Oct 2022 10:36:30 -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 S229996AbiJ3ReY (ORCPT + 99 others); Sun, 30 Oct 2022 13:34:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229849AbiJ3Rdx (ORCPT ); Sun, 30 Oct 2022 13:33:53 -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 BC3039FC8 for ; Sun, 30 Oct 2022 10:33:52 -0700 (PDT) Received: from ipservice-092-217-067-184.092.217.pools.vodafone-ip.de ([92.217.67.184] 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 1opCBv-000469-7D; Sun, 30 Oct 2022 18:33:47 +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 v2 08/13] staging: r8188eu: replace GetAddr1Ptr call in OnAction_p2p Date: Sun, 30 Oct 2022 18:33:21 +0100 Message-Id: <20221030173326.1588647-9-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221030173326.1588647-1-martin@kaiser.cx> References: <20221030173326.1588647-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?1748134937117444624?= X-GMAIL-MSGID: =?utf-8?q?1748134937117444624?= Define a struct ieee80211_mgmt in OnAction_p2p and use it to check the destination address. This replaces a call to the driver-specific GetAddr1Ptr function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 64d01da9c814..6d95d3bc23e6 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3834,6 +3834,7 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) { + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; u8 *frame_body; u8 OUI_Subtype; u8 *pframe = precv_frame->rx_data; @@ -3841,7 +3842,7 @@ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_fram struct wifidirect_info *pwdinfo = &padapter->wdinfo; /* check RA matches or not */ - if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */ + if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */ return; frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));