Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2197081pxb; Sat, 27 Feb 2021 14:25:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7aWaaDvpjjLe7casg3M2fkoLakGITQ93evZU65oLOGuZtelHkh4U4T3H1LicNXIqQtr/W X-Received: by 2002:a05:6402:2215:: with SMTP id cq21mr9885942edb.281.1614464758957; Sat, 27 Feb 2021 14:25:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614464758; cv=none; d=google.com; s=arc-20160816; b=xOkThhgChHVBPXydw/vpJROolJTkXbH5X4/u4eeztZ50fIV/efD7pJilduNm/TQbBw Yicz4BDJ8ZizZVjGR7aag0iuHWnxCNKHA/DGf2tIU5YImNDfB2yPdMlky0C378K4F/NN imIDQQcaZnXymXbF/ZrT1TzEv6bY5BHsnD6lo8O5ZvAvAqjm9c2DQJvqDuM3s6n2BuDd lFYytN5sHZIzvJj3brKyPOPiyCz2/3W+qm1ktoD87PQCzV78D4C3K2NrnWZiDjSSzjGI wuwFU4TQ9NdhoV4BdsvuFTwkSKLo3r48NyRwHNacA4kXNknaNQvGfU6L+CIls0D6cc8z P6LA== 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 :dkim-signature; bh=8kMhdvIdhbDz43HUBsLUfT2KZzfyvRCqBeoQrZQZUg0=; b=Jx1LOYaw4ZCUD3Yj8irfo2IeJXms+frer2FhRWmBCR82v2rPmoVkHYoOX4drhTf8Ui qKV6wm2Z0M4rEUuro7D0ZRVr6VGSX7Iti38+YyydOjDrE4mLKNTLD8HgSErPZkQyzDN0 pylssedx5VmJ7y+EgRfTlNT++janDjQIB41sITlDuF+yXpjdxHShdn8SkU0bCDXK4jYY dKbcVxVIBfwJ5i4mBZ4jXVCu/TFNlYu4FH9kxbDtGMfD3XkHWVyOYZDLwXxG8RBhr1n3 FSLFNo+ngKXv3VwSzVqP8nREvLEqzBvKSHLEbEyilRqtghmoGhQvjpK1VH7myhEyrU/o p6Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D2MPLIf6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si8293175edl.307.2021.02.27.14.25.26; Sat, 27 Feb 2021 14:25:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D2MPLIf6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230134AbhB0WX6 (ORCPT + 99 others); Sat, 27 Feb 2021 17:23:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230079AbhB0WXy (ORCPT ); Sat, 27 Feb 2021 17:23:54 -0500 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 598B4C061756 for ; Sat, 27 Feb 2021 14:23:12 -0800 (PST) Received: by mail-lj1-x22a.google.com with SMTP id u4so14889757ljh.6 for ; Sat, 27 Feb 2021 14:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8kMhdvIdhbDz43HUBsLUfT2KZzfyvRCqBeoQrZQZUg0=; b=D2MPLIf6TPmXIWXZoXs6a9mHwzAf4ff/75KanLAXE2KpNAlniYKoHcrG+PjeqM8Ksd DaPv5DKx3tLdwpkvNg7n5/adal9Q9DJpbEjTE21T4KIZU4P1x0eM6MsOG21PJIuhcYMY yn2FPN6AWdXwIDuhdn88tWB8AVhmNhWyNZKm/C/0GJo0pn/fe7hvPwiQXLs1iZMrDrIc gY1qFleDplA7wPmJ1Du60A7tICkOWhlzPpqXVc0w6C6z7occDLPL54GllpdwBfkqfUrT vlOX+Q6bQLYfPp4piy0u0M4d0FlLOJpfNs1+YNlnnNM0qnL4Swdxf4RzYlvgIK9DHZu+ fChQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8kMhdvIdhbDz43HUBsLUfT2KZzfyvRCqBeoQrZQZUg0=; b=RosUhDpzcDV6asQaENDa5NkO7/6N2Xmw3l1qQnuuGZ27rGUNWP4Q3QnA/XvfpzN8IL 5XEqySePY+KRfCxacY3j7ZmrhgqieBC6KE5RPwvkTOJ3YmzHujPPBkD9UE3rXgD4rH85 6E0dWks7nSJWQmr8WZ80WrqKyQ3HmB9Wt+epzoRf1vvGPJjYBVxu9awtX6TXd4g7et2N +s75QBJZfBkAZ+0wLCnwyBpq1y4QjOZXGCDFclZDKvFSZcXX+5yF78Fv+pxNWRFAgGHr vum5vmLobG9M9z1jZxGgz9sA4zthmHdQ3Ux9aquZuklIlu4XcjwbhrlUAs4lar5EPdi9 Aurg== X-Gm-Message-State: AOAM5319se1uYZlvA6xEjdKyU3BdbGmqg9G/xKxXMXYsuT3kjCkZWye4 fORT5Nc3Tke6F7/Hl+Umbas= X-Received: by 2002:a2e:88cb:: with SMTP id a11mr5438089ljk.394.1614464590917; Sat, 27 Feb 2021 14:23:10 -0800 (PST) Received: from alpha (10.177.smarthome.spb.ru. [109.71.177.10]) by smtp.gmail.com with ESMTPSA id w25sm1804278lfn.198.2021.02.27.14.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Feb 2021 14:23:10 -0800 (PST) Received: (nullmailer pid 581544 invoked by uid 1000); Sat, 27 Feb 2021 22:23:09 -0000 From: Ivan Safonov To: Greg Kroah-Hartman Cc: Florian Schilhabel , Larry Finger , Michael Straube , Pascal Terjan , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Ivan Safonov Subject: [PATCH 1/4] staging:rtl8712: replace get_(d|s)a with ieee80211_get_(D|S)A Date: Sun, 28 Feb 2021 01:22:34 +0300 Message-Id: <20210227222236.581490-2-insafonov@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210227222236.581490-1-insafonov@gmail.com> References: <20210227222236.581490-1-insafonov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org get_da()/get_sa() duplicate native ieee80211_get_(D|S)A functions. Remove get_(d|s)a, use ieee80211_get_(D|S)A instead. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8712/rtl871x_recv.c | 4 +-- drivers/staging/rtl8712/wifi.h | 45 -------------------------- 2 files changed, 2 insertions(+), 47 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index eb4e46a7f743..efd783e7ccbc 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -466,8 +466,8 @@ static sint validate_recv_data_frame(struct _adapter *adapter, struct security_priv *psecuritypriv = &adapter->securitypriv; bretry = GetRetry(ptr); - pda = get_da(ptr); - psa = get_sa(ptr); + pda = ieee80211_get_DA((struct ieee80211_hdr *)ptr); + psa = ieee80211_get_SA((struct ieee80211_hdr *)ptr); pbssid = get_hdr_bssid(ptr); if (!pbssid) return _FAIL; diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h index 1b32b3510093..5de0e67b1876 100644 --- a/drivers/staging/rtl8712/wifi.h +++ b/drivers/staging/rtl8712/wifi.h @@ -264,51 +264,6 @@ static inline unsigned char get_tofr_ds(unsigned char *pframe) #define GetAddr4Ptr(pbuf) ((unsigned char *)((addr_t)(pbuf) + 24)) -static inline unsigned char *get_da(unsigned char *pframe) -{ - unsigned char *da; - unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); - - switch (to_fr_ds) { - case 0x00: /* ToDs=0, FromDs=0 */ - da = GetAddr1Ptr(pframe); - break; - case 0x01: /* ToDs=0, FromDs=1 */ - da = GetAddr1Ptr(pframe); - break; - case 0x02: /* ToDs=1, FromDs=0 */ - da = GetAddr3Ptr(pframe); - break; - default: /* ToDs=1, FromDs=1 */ - da = GetAddr3Ptr(pframe); - break; - } - return da; -} - -static inline unsigned char *get_sa(unsigned char *pframe) -{ - unsigned char *sa; - unsigned int to_fr_ds = (GetToDs(pframe) << 1) | GetFrDs(pframe); - - switch (to_fr_ds) { - case 0x00: /* ToDs=0, FromDs=0 */ - sa = GetAddr2Ptr(pframe); - break; - case 0x01: /* ToDs=0, FromDs=1 */ - sa = GetAddr3Ptr(pframe); - break; - case 0x02: /* ToDs=1, FromDs=0 */ - sa = GetAddr2Ptr(pframe); - break; - default: /* ToDs=1, FromDs=1 */ - sa = GetAddr4Ptr(pframe); - break; - } - - return sa; -} - static inline unsigned char *get_hdr_bssid(unsigned char *pframe) { unsigned char *sa; -- 2.26.2