From patchwork Tue Oct 3 19:33:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hortmann X-Patchwork-Id: 148038 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2307156vqb; Tue, 3 Oct 2023 12:33:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPrU5fy+9PZ+wL53rgpmF8xpIJcXfcVw4Jz6Q/uY5Yn4svx+LOGFM29ECMPCg/gJ0F/R07 X-Received: by 2002:a17:902:8b8c:b0:1c0:aca0:8c44 with SMTP id ay12-20020a1709028b8c00b001c0aca08c44mr564288plb.19.1696361623229; Tue, 03 Oct 2023 12:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696361623; cv=none; d=google.com; s=arc-20160816; b=rGMTaA40xNC2gp51H/CQ+E9S96rSUiwlBKpS9N9AbiesUughtGWZOkKz5TpraBAtwT 26S0whu4HAhjkyR5OjYCpzQYyASo0Hmq0k07roonsTnrrDYCBdx9t9DyCeRPg197Ld2L i9Fle4cvwZ56PDIKhmkOi+eyhWpKW6y/KlAhFRTkhuWLO0HRTmfjaliQ7Tswb/F1uQc5 7De9crkhBYtmjUPyOTKeaw/H96+jDTwbe2S9wS80DV2tGdvCpueEY3NeiypzCeAo3dbM XBNj2AiRrFlvy0W1Sd2fuSiD1+8Six/5WSKxqbQKXUDvnIaYfTHrPqR1H3gCUfkDxYHx 4YmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=0r3DREMiH6yQfDoDU6vaHZLHIyC1HQyFX1F4ZCsk8E0=; fh=Sw1rtAM+hKyOoOQVYiiLzcdjc4spg79Z/tN6UmWUAKs=; b=fGM5SETts7pMyypD0qhs2Dj/7qQOoKcV50dut96j2gDnuI4cWrIVzVAhIxiiYQis38 H9Wf6OxRpRPmpYmCbrcnfczyV8lnqDrS5vGSUbHNKY1x4PfN2It0hYahNmAcgWwc0SvR VB7e/7891w/7ApaHXSLZbC9lLlI3Cqn7Yw0Ts04lUsPw9DaP2b6ci2jXZ3hkd6ERTSgo PdAkS7n9gRrueNCkQJm7xwY+GEoeF69GAbt8jlG4nC0vch450EGnk2OsS6kOBSbWjJwe Iy4ZYg0bWLq1+IwpPHJDTPn8CGWTU5XfjMObm/i/k8yYxUvtkbDCB+/ICmQU3gLK7GlA veNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Zn1GOAQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id q1-20020a170902f34100b001b8b4371af8si1849668ple.648.2023.10.03.12.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:33:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Zn1GOAQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 33A4A81A2076; Tue, 3 Oct 2023 12:33:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240925AbjJCTdN (ORCPT + 17 others); Tue, 3 Oct 2023 15:33:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240909AbjJCTdM (ORCPT ); Tue, 3 Oct 2023 15:33:12 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AA13BD for ; Tue, 3 Oct 2023 12:33:09 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9ae65c0e46fso53939466b.0 for ; Tue, 03 Oct 2023 12:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696361587; x=1696966387; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0r3DREMiH6yQfDoDU6vaHZLHIyC1HQyFX1F4ZCsk8E0=; b=Zn1GOAQ5szKDok5C87nu2G3rJKPVSylxIlZM73iF/Lq4dRY1syxPXD9KuG2Etef9IB l97rwm6hsIuUmaAS3UmyU5ifl2qnPgF4JGF2FpcegAWEyZnbW/05gGkxOCDrL4pj2vtG sCPt69NS2qK7vcEAckvIgw+5JzCdlhzQrpxBgW5FaplEtrZUxveTO0+S10evSnEEMUbI mRyDrBqSxFjqHw7h/2cUesZwprGa8ZKX1qYJqtkaIubwho7PW/N3SA8u0aBcmwR55x6l a41zNfXSThlPewQUMgDpu7EGHqGVe/8e4CROKpti+bh8sbpqyInFTaMdBhP7+GeEsBVn CwPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696361587; x=1696966387; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0r3DREMiH6yQfDoDU6vaHZLHIyC1HQyFX1F4ZCsk8E0=; b=CzGejyala7OkDJEnFQDwMPORs2ZqV8H2t3fqtYv8/vx6wZGIcOZLITfjisoLgb7ngb 9vQXAZv7Uz4KYItdmBQP/VW14Ob/J+i1ot4cdMZoMNyU622Br6Uhno6EoDo9g+YnVBDi sJBKWaoXNKJjkjJHTM2wa4lrHw/NjcWxRnslXElFP9ZvmtIeApavxGsE+aWk3UxvwL59 2HRGsz0hThllhxRWXalbsuiKZFzDk+QgP0wYjEwJmxXX1uTZjGRymg/tX4bVofluSYQj gs6u8hXlc+xV2tYsM5rO75h5bwWeqt4qRr3w1lCBd4b+YhIMIwDQMCvUiYWOIUvcbZ+q h++A== X-Gm-Message-State: AOJu0YzpSjwNKgdbWkaamUv6Vux120PiD30q5aDPK3o+3/Up7FmIF3Zl F7LwO4fuyFCOmhxlJfsooOo= X-Received: by 2002:a17:906:5194:b0:9a1:b4f9:b1db with SMTP id y20-20020a170906519400b009a1b4f9b1dbmr154888ejk.1.1696361587272; Tue, 03 Oct 2023 12:33:07 -0700 (PDT) Received: from matrix-ESPRIMO-P710 (p579356c7.dip0.t-ipconnect.de. [87.147.86.199]) by smtp.gmail.com with ESMTPSA id va17-20020a17090711d100b009aa292a2df2sm1512913ejb.217.2023.10.03.12.33.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:33:07 -0700 (PDT) Date: Tue, 3 Oct 2023 21:33:05 +0200 From: Philipp Hortmann To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 01/11] staging: rtl8192e: Remove function _rtl92e_wx_set_rawtx() Message-ID: <96196bf0f45934e8e49f1d185165e2a36f5bca7d.1696360403.git.philipp.g.hortmann@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 03 Oct 2023 12:33:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778764085750018529 X-GMAIL-MSGID: 1778764085750018529 Remove function _rtl92e_wx_set_rawtx() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann --- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 24 +-------------- drivers/staging/rtl8192e/rtllib.h | 4 --- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 32 -------------------- 3 files changed, 1 insertion(+), 59 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index e7be89833b59..f28e70a0da4f 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -122,25 +122,6 @@ static int _rtl92e_wx_get_power(struct net_device *dev, return rtllib_wx_get_power(priv->rtllib, info, wrqu, extra); } -static int _rtl92e_wx_set_rawtx(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - struct r8192_priv *priv = rtllib_priv(dev); - int ret; - - if (priv->hw_radio_off) - return 0; - - mutex_lock(&priv->wx_mutex); - - ret = rtllib_wx_set_rawtx(priv->rtllib, info, wrqu, extra); - - mutex_unlock(&priv->wx_mutex); - - return ret; -} - static int _rtl92e_wx_adapter_power_status(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -1044,9 +1025,6 @@ static const struct iw_priv_args r8192_private_args[] = { }, { SIOCIWFIRSTPRIV + 0x1, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "activescan" - }, { - SIOCIWFIRSTPRIV + 0x2, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "rawtx" }, { SIOCIWFIRSTPRIV + 0x6, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_NONE, @@ -1072,7 +1050,7 @@ static const struct iw_priv_args r8192_private_args[] = { static iw_handler r8192_private_handler[] = { (iw_handler)_rtl92e_wx_set_debug, /*SIOCIWSECONDPRIV*/ (iw_handler)_rtl92e_wx_set_scan_type, - (iw_handler)_rtl92e_wx_set_rawtx, + (iw_handler)NULL, (iw_handler)NULL, (iw_handler)NULL, (iw_handler)NULL, diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index d3ac6ea71030..98b8b7db027e 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1755,10 +1755,6 @@ int rtllib_wx_get_freq(struct rtllib_device *ieee, struct iw_request_info *a, union iwreq_data *wrqu, char *b); void rtllib_wx_sync_scan_wq(void *data); -int rtllib_wx_set_rawtx(struct rtllib_device *ieee, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra); - int rtllib_wx_get_name(struct rtllib_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra); diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c index bd2b8bba86eb..f32584291704 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c @@ -436,38 +436,6 @@ int rtllib_wx_get_mode(struct rtllib_device *ieee, struct iw_request_info *a, } EXPORT_SYMBOL(rtllib_wx_get_mode); -int rtllib_wx_set_rawtx(struct rtllib_device *ieee, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int *parms = (int *)extra; - int enable = (parms[0] > 0); - short prev = ieee->raw_tx; - - mutex_lock(&ieee->wx_mutex); - - if (enable) - ieee->raw_tx = 1; - else - ieee->raw_tx = 0; - - netdev_info(ieee->dev, "raw TX is %s\n", - ieee->raw_tx ? "enabled" : "disabled"); - - if (ieee->iw_mode == IW_MODE_MONITOR) { - if (prev == 0 && ieee->raw_tx) - netif_carrier_on(ieee->dev); - - if (prev && ieee->raw_tx == 1) - netif_carrier_off(ieee->dev); - } - - mutex_unlock(&ieee->wx_mutex); - - return 0; -} -EXPORT_SYMBOL(rtllib_wx_set_rawtx); - int rtllib_wx_get_name(struct rtllib_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { From patchwork Tue Oct 3 19:33:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hortmann X-Patchwork-Id: 148039 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2307212vqb; Tue, 3 Oct 2023 12:33:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmXfHPRJHKa0sgfjv6KlqDdm4kjlnjuy6LSazRXeTappzDImJ64EWJ6siIM71D4gR8ZxzG X-Received: by 2002:a17:903:41d2:b0:1c7:71d2:a96a with SMTP id u18-20020a17090341d200b001c771d2a96amr692506ple.12.1696361628566; Tue, 03 Oct 2023 12:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696361628; cv=none; d=google.com; s=arc-20160816; b=pob3R9lJBBgIQH+8Yw9occ6VXamsqDVcMxoV0enZCRR3fQV9AZbNsFULrM//+TeuMQ 63G/GWA5iflcYDyhi1uhwbiTS7Skfuzt3KStw26VaK3ihyYnR1xCVJe3xVfT7bNnhbQX fI3s4dJH1NdWzh2eV4cbrEV3Dfmp5GpskhwMlt6e0oRWzrNP2zHDZ7OcxCxvXiAzxnx1 0lIsd8z7UieubB20hgTn3yWfR9PNFe13+/sscqa7xz8X7PMmCwr9dHZ8zRAVs1+1DrT5 nucSQ+LP2apVPphhLNx5QOec0lw1JSmaIxD4sfzzkZcRsSljV2qR4T0YtP9w/uweJw+8 qTFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=t+kgI4c8aoHedz3AgEryt8ujyL2qg+dNsB9glGz9XwY=; fh=Sw1rtAM+hKyOoOQVYiiLzcdjc4spg79Z/tN6UmWUAKs=; b=AVHjWhgwMpwcSY8pax2vurJjUfOUa7+QgqdujTdoX2GIp9VZnCCUndcQo+hJmSzZgW IKrTSub5L26HnK3tfwmiklZ3udHSD12+Rip7Kkd2OsZ9dTPiVvMc913g2cbebsryyXC5 CFDNTpgmWxWTJIiJz9cRmQ+tXn5XzFCoNNxlsEG+Q7QYiN7g5YKXueiFgw5Tnc1SmlYB aTztDocANQPWHSdzZ2UOjyNhupKXRMHsbKOa10BefOQo5wEhBQcBOZTFO/M7hGhqQQb/ 7RPwlbWP/2011UPeqk04PYgNCy5qUEizzMB88QEEQPeIn5u8OYy7Q6Fj1gOjOwugLW4t KXtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=by0+W7lZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id w9-20020a1709026f0900b001c60ec1e650si2040800plk.82.2023.10.03.12.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:33:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=by0+W7lZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id CF0998168238; Tue, 3 Oct 2023 12:33:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240954AbjJCTd0 (ORCPT + 17 others); Tue, 3 Oct 2023 15:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240932AbjJCTdV (ORCPT ); Tue, 3 Oct 2023 15:33:21 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5972BE5 for ; Tue, 3 Oct 2023 12:33:16 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9b2d64c9307so53299566b.1 for ; Tue, 03 Oct 2023 12:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696361595; x=1696966395; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=t+kgI4c8aoHedz3AgEryt8ujyL2qg+dNsB9glGz9XwY=; b=by0+W7lZOnVTd+CeJ6UEyhkgVW0kK5swvMDxwirX4el15LysY4e77w1Tr1iqHYO6ym G/mfUWxcQLQtPmy4T5cu6qYSHOkZPgvk/1yMZdOCckMw13dX4Dd/MYzVcLgfmOVYnfA4 MPI0eaHO7LdwX0uJZFbmC4PFR5QqkFc5ViLyn3vrNaDw8ZIpnjBJfE6KsZgxkBCLyXnz bbRyeyxP0RMHp9zqlt2PrdAlMtAgz6XHEnOGOHRpPrNodxFDq3/jmvpFouGNmrMQYmxo nKHbM6PzX5Z+ABTTTZBS19ydT7bgp8lKqOVh5MDUiEFxzW4fEmsHD1Xv54XYhkvZ7kng Jp7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696361595; x=1696966395; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=t+kgI4c8aoHedz3AgEryt8ujyL2qg+dNsB9glGz9XwY=; b=lbSedoGMyDYereCZhyb9n9/o42SBrU66P3bkTxJpE/JWROoMHk8rOuF634pQqE37s7 B/XI/f/mu6f3l2OGSZ/kk4fUGpglYXFuu5PExhgXrB4h8DSd+WXSmyut7Sfa2uTgGrv8 zrFhEDFM4PQW2fDwgqPTyBSuagP18KZ/MeDoiCKPcMazh2T78QrSIPUlulWeM97DQZ2Z NhSZ3XYSwp5PFTyy6P+X0vJif7E1STYKjtuFKiO5zXQYDqTgNUh42p8kDmtL0VwdNb7Y LajCG/XeBK2JNlq6MIX1Ihv0gjbSrUhLMZ6JgGlCaWZKizzgdAV4bR06o9On6/4FCMXi jWwg== X-Gm-Message-State: AOJu0Yz/5wscov5IjKA6lYXGbKQg0J7ES2WsdtdWBe5Z31k73fChFiCx NZ/szTZ68fgqdsOjnLGIl84= X-Received: by 2002:a05:6402:190f:b0:523:220e:a6ca with SMTP id e15-20020a056402190f00b00523220ea6camr122415edz.3.1696361594395; Tue, 03 Oct 2023 12:33:14 -0700 (PDT) Received: from matrix-ESPRIMO-P710 (p579356c7.dip0.t-ipconnect.de. [87.147.86.199]) by smtp.gmail.com with ESMTPSA id v18-20020aa7dbd2000000b00535204ffdb4sm1295199edt.72.2023.10.03.12.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:33:14 -0700 (PDT) Date: Tue, 3 Oct 2023 21:33:12 +0200 From: Philipp Hortmann To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 02/11] staging: rtl8192e: Remove equation in function rtllib_xmit_inter() Message-ID: <970cd327eaecab8565e7486bbf62e1440a3b44b7.1696360403.git.philipp.g.hortmann@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 12:33:40 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778764091020427354 X-GMAIL-MSGID: 1778764091020427354 Remove equation with raw_tx in function rtllib_xmit_inter() as it is always true. Signed-off-by: Philipp Hortmann --- drivers/staging/rtl8192e/rtllib_tx.c | 476 +++++++++++++-------------- 1 file changed, 229 insertions(+), 247 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c index 53ad5e3fb174..8d8ce22c5f09 100644 --- a/drivers/staging/rtl8192e/rtllib_tx.c +++ b/drivers/staging/rtl8192e/rtllib_tx.c @@ -576,289 +576,271 @@ static int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) goto success; } - if (likely(ieee->raw_tx == 0)) { - if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) { - netdev_warn(ieee->dev, "skb too small (%d).\n", - skb->len); - goto success; - } - /* Save source and destination addresses */ - ether_addr_copy(dest, skb->data); - ether_addr_copy(src, skb->data + ETH_ALEN); - - memset(skb->cb, 0, sizeof(skb->cb)); - ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto); - - if (ieee->iw_mode == IW_MODE_MONITOR) { - txb = rtllib_alloc_txb(1, skb->len, GFP_ATOMIC); - if (unlikely(!txb)) { - netdev_warn(ieee->dev, - "Could not allocate TXB\n"); - goto failed; - } + if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) { + netdev_warn(ieee->dev, "skb too small (%d).\n", + skb->len); + goto success; + } + /* Save source and destination addresses */ + ether_addr_copy(dest, skb->data); + ether_addr_copy(src, skb->data + ETH_ALEN); - txb->encrypted = 0; - txb->payload_size = cpu_to_le16(skb->len); - skb_put_data(txb->fragments[0], skb->data, skb->len); + memset(skb->cb, 0, sizeof(skb->cb)); + ether_type = ntohs(((struct ethhdr *)skb->data)->h_proto); - goto success; + if (ieee->iw_mode == IW_MODE_MONITOR) { + txb = rtllib_alloc_txb(1, skb->len, GFP_ATOMIC); + if (unlikely(!txb)) { + netdev_warn(ieee->dev, + "Could not allocate TXB\n"); + goto failed; } - if (skb->len > 282) { - if (ether_type == ETH_P_IP) { - const struct iphdr *ip = (struct iphdr *) - ((u8 *)skb->data + 14); - if (ip->protocol == IPPROTO_UDP) { - struct udphdr *udp; - - udp = (struct udphdr *)((u8 *)ip + - (ip->ihl << 2)); - if (((((u8 *)udp)[1] == 68) && - (((u8 *)udp)[3] == 67)) || - ((((u8 *)udp)[1] == 67) && - (((u8 *)udp)[3] == 68))) { - bdhcp = true; - ieee->LPSDelayCnt = 200; - } + txb->encrypted = 0; + txb->payload_size = cpu_to_le16(skb->len); + skb_put_data(txb->fragments[0], skb->data, skb->len); + + goto success; + } + + if (skb->len > 282) { + if (ether_type == ETH_P_IP) { + const struct iphdr *ip = (struct iphdr *) + ((u8 *)skb->data + 14); + if (ip->protocol == IPPROTO_UDP) { + struct udphdr *udp; + + udp = (struct udphdr *)((u8 *)ip + + (ip->ihl << 2)); + if (((((u8 *)udp)[1] == 68) && + (((u8 *)udp)[3] == 67)) || + ((((u8 *)udp)[1] == 67) && + (((u8 *)udp)[3] == 68))) { + bdhcp = true; + ieee->LPSDelayCnt = 200; } - } else if (ether_type == ETH_P_ARP) { - netdev_info(ieee->dev, - "=================>DHCP Protocol start tx ARP pkt!!\n"); - bdhcp = true; - ieee->LPSDelayCnt = - ieee->current_network.tim.tim_count; } + } else if (ether_type == ETH_P_ARP) { + netdev_info(ieee->dev, + "=================>DHCP Protocol start tx ARP pkt!!\n"); + bdhcp = true; + ieee->LPSDelayCnt = + ieee->current_network.tim.tim_count; } + } - skb->priority = rtllib_classify(skb, IsAmsdu); - crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; - encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && crypt && crypt->ops; - if (!encrypt && ieee->ieee802_1x && - ieee->drop_unencrypted && ether_type != ETH_P_PAE) { - stats->tx_dropped++; - goto success; - } - if (crypt && !encrypt && ether_type == ETH_P_PAE) { - struct eapol *eap = (struct eapol *)(skb->data + - sizeof(struct ethhdr) - SNAP_SIZE - - sizeof(u16)); - netdev_dbg(ieee->dev, - "TX: IEEE 802.11 EAPOL frame: %s\n", - eap_get_type(eap->type)); - } + skb->priority = rtllib_classify(skb, IsAmsdu); + crypt = ieee->crypt_info.crypt[ieee->crypt_info.tx_keyidx]; + encrypt = !(ether_type == ETH_P_PAE && ieee->ieee802_1x) && crypt && crypt->ops; + if (!encrypt && ieee->ieee802_1x && + ieee->drop_unencrypted && ether_type != ETH_P_PAE) { + stats->tx_dropped++; + goto success; + } + if (crypt && !encrypt && ether_type == ETH_P_PAE) { + struct eapol *eap = (struct eapol *)(skb->data + + sizeof(struct ethhdr) - SNAP_SIZE - + sizeof(u16)); + netdev_dbg(ieee->dev, + "TX: IEEE 802.11 EAPOL frame: %s\n", + eap_get_type(eap->type)); + } - /* Advance the SKB to the start of the payload */ - skb_pull(skb, sizeof(struct ethhdr)); + /* Advance the SKB to the start of the payload */ + skb_pull(skb, sizeof(struct ethhdr)); - /* Determine total amount of storage required for TXB packets */ - bytes = skb->len + SNAP_SIZE + sizeof(u16); + /* Determine total amount of storage required for TXB packets */ + bytes = skb->len + SNAP_SIZE + sizeof(u16); - if (encrypt) - fc = RTLLIB_FTYPE_DATA | IEEE80211_FCTL_PROTECTED; - else - fc = RTLLIB_FTYPE_DATA; + if (encrypt) + fc = RTLLIB_FTYPE_DATA | IEEE80211_FCTL_PROTECTED; + else + fc = RTLLIB_FTYPE_DATA; - if (qos_activated) - fc |= IEEE80211_STYPE_QOS_DATA; - else - fc |= IEEE80211_STYPE_DATA; + if (qos_activated) + fc |= IEEE80211_STYPE_QOS_DATA; + else + fc |= IEEE80211_STYPE_DATA; - if (ieee->iw_mode == IW_MODE_INFRA) { - fc |= IEEE80211_FCTL_TODS; - /* To DS: Addr1 = BSSID, Addr2 = SA, - * Addr3 = DA - */ - ether_addr_copy(header.addr1, + if (ieee->iw_mode == IW_MODE_INFRA) { + fc |= IEEE80211_FCTL_TODS; + /* To DS: Addr1 = BSSID, Addr2 = SA, + * Addr3 = DA + */ + ether_addr_copy(header.addr1, + ieee->current_network.bssid); + ether_addr_copy(header.addr2, src); + if (IsAmsdu) + ether_addr_copy(header.addr3, ieee->current_network.bssid); - ether_addr_copy(header.addr2, src); - if (IsAmsdu) - ether_addr_copy(header.addr3, - ieee->current_network.bssid); - else - ether_addr_copy(header.addr3, dest); - } + else + ether_addr_copy(header.addr3, dest); + } - bIsMulticast = is_multicast_ether_addr(header.addr1); + bIsMulticast = is_multicast_ether_addr(header.addr1); - header.frame_control = cpu_to_le16(fc); + header.frame_control = cpu_to_le16(fc); - /* Determine fragmentation size based on destination (multicast - * and broadcast are not fragmented) - */ - if (bIsMulticast) { - frag_size = MAX_FRAG_THRESHOLD; - qos_ctl |= QOS_CTL_NOTCONTAIN_ACK; - } else { - frag_size = ieee->fts; - qos_ctl = 0; + /* Determine fragmentation size based on destination (multicast + * and broadcast are not fragmented) + */ + if (bIsMulticast) { + frag_size = MAX_FRAG_THRESHOLD; + qos_ctl |= QOS_CTL_NOTCONTAIN_ACK; + } else { + frag_size = ieee->fts; + qos_ctl = 0; + } + + if (qos_activated) { + hdr_len = RTLLIB_3ADDR_LEN + 2; + + /* in case we are a client verify acm is not set for this ac */ + while (unlikely(ieee->wmm_acm & (0x01 << skb->priority))) { + netdev_info(ieee->dev, "skb->priority = %x\n", + skb->priority); + if (wme_downgrade_ac(skb)) + break; + netdev_info(ieee->dev, "converted skb->priority = %x\n", + skb->priority); } - if (qos_activated) { - hdr_len = RTLLIB_3ADDR_LEN + 2; - - /* in case we are a client verify acm is not set for this ac */ - while (unlikely(ieee->wmm_acm & (0x01 << skb->priority))) { - netdev_info(ieee->dev, "skb->priority = %x\n", - skb->priority); - if (wme_downgrade_ac(skb)) - break; - netdev_info(ieee->dev, "converted skb->priority = %x\n", - skb->priority); - } + qos_ctl |= skb->priority; + header.qos_ctrl = cpu_to_le16(qos_ctl & RTLLIB_QOS_TID); - qos_ctl |= skb->priority; - header.qos_ctrl = cpu_to_le16(qos_ctl & RTLLIB_QOS_TID); + } else { + hdr_len = RTLLIB_3ADDR_LEN; + } + /* Determine amount of payload per fragment. Regardless of if + * this stack is providing the full 802.11 header, one will + * eventually be affixed to this fragment -- so we must account + * for it when determining the amount of payload space. + */ + bytes_per_frag = frag_size - hdr_len; + if (ieee->config & + (CFG_RTLLIB_COMPUTE_FCS | CFG_RTLLIB_RESERVE_FCS)) + bytes_per_frag -= RTLLIB_FCS_LEN; + /* Each fragment may need to have room for encrypting + * pre/postfix + */ + if (encrypt) { + bytes_per_frag -= crypt->ops->extra_mpdu_prefix_len + + crypt->ops->extra_mpdu_postfix_len + + crypt->ops->extra_msdu_prefix_len + + crypt->ops->extra_msdu_postfix_len; + } + /* Number of fragments is the total bytes_per_frag / + * payload_per_fragment + */ + nr_frags = bytes / bytes_per_frag; + bytes_last_frag = bytes % bytes_per_frag; + if (bytes_last_frag) + nr_frags++; + else + bytes_last_frag = bytes_per_frag; + + /* When we allocate the TXB we allocate enough space for the + * reserve and full fragment bytes (bytes_per_frag doesn't + * include prefix, postfix, header, FCS, etc.) + */ + txb = rtllib_alloc_txb(nr_frags, frag_size + + ieee->tx_headroom, GFP_ATOMIC); + if (unlikely(!txb)) { + netdev_warn(ieee->dev, "Could not allocate TXB\n"); + goto failed; + } + txb->encrypted = encrypt; + txb->payload_size = cpu_to_le16(bytes); + + if (qos_activated) + txb->queue_index = UP2AC(skb->priority); + else + txb->queue_index = WME_AC_BE; + + for (i = 0; i < nr_frags; i++) { + skb_frag = txb->fragments[i]; + tcb_desc = (struct cb_desc *)(skb_frag->cb + + MAX_DEV_ADDR_SIZE); + if (qos_activated) { + skb_frag->priority = skb->priority; + tcb_desc->queue_index = UP2AC(skb->priority); } else { - hdr_len = RTLLIB_3ADDR_LEN; + skb_frag->priority = WME_AC_BE; + tcb_desc->queue_index = WME_AC_BE; } - /* Determine amount of payload per fragment. Regardless of if - * this stack is providing the full 802.11 header, one will - * eventually be affixed to this fragment -- so we must account - * for it when determining the amount of payload space. - */ - bytes_per_frag = frag_size - hdr_len; - if (ieee->config & - (CFG_RTLLIB_COMPUTE_FCS | CFG_RTLLIB_RESERVE_FCS)) - bytes_per_frag -= RTLLIB_FCS_LEN; + skb_reserve(skb_frag, ieee->tx_headroom); - /* Each fragment may need to have room for encrypting - * pre/postfix - */ if (encrypt) { - bytes_per_frag -= crypt->ops->extra_mpdu_prefix_len + - crypt->ops->extra_mpdu_postfix_len + - crypt->ops->extra_msdu_prefix_len + - crypt->ops->extra_msdu_postfix_len; + if (ieee->hwsec_active) + tcb_desc->bHwSec = 1; + else + tcb_desc->bHwSec = 0; + skb_reserve(skb_frag, + crypt->ops->extra_mpdu_prefix_len + + crypt->ops->extra_msdu_prefix_len); + } else { + tcb_desc->bHwSec = 0; } - /* Number of fragments is the total bytes_per_frag / - * payload_per_fragment - */ - nr_frags = bytes / bytes_per_frag; - bytes_last_frag = bytes % bytes_per_frag; - if (bytes_last_frag) - nr_frags++; - else - bytes_last_frag = bytes_per_frag; + frag_hdr = skb_put_data(skb_frag, &header, hdr_len); - /* When we allocate the TXB we allocate enough space for the - * reserve and full fragment bytes (bytes_per_frag doesn't - * include prefix, postfix, header, FCS, etc.) + /* If this is not the last fragment, then add the + * MOREFRAGS bit to the frame control */ - txb = rtllib_alloc_txb(nr_frags, frag_size + - ieee->tx_headroom, GFP_ATOMIC); - if (unlikely(!txb)) { - netdev_warn(ieee->dev, "Could not allocate TXB\n"); - goto failed; - } - txb->encrypted = encrypt; - txb->payload_size = cpu_to_le16(bytes); - - if (qos_activated) - txb->queue_index = UP2AC(skb->priority); - else - txb->queue_index = WME_AC_BE; - - for (i = 0; i < nr_frags; i++) { - skb_frag = txb->fragments[i]; - tcb_desc = (struct cb_desc *)(skb_frag->cb + - MAX_DEV_ADDR_SIZE); - if (qos_activated) { - skb_frag->priority = skb->priority; - tcb_desc->queue_index = UP2AC(skb->priority); - } else { - skb_frag->priority = WME_AC_BE; - tcb_desc->queue_index = WME_AC_BE; - } - skb_reserve(skb_frag, ieee->tx_headroom); - - if (encrypt) { - if (ieee->hwsec_active) - tcb_desc->bHwSec = 1; - else - tcb_desc->bHwSec = 0; - skb_reserve(skb_frag, - crypt->ops->extra_mpdu_prefix_len + - crypt->ops->extra_msdu_prefix_len); - } else { - tcb_desc->bHwSec = 0; - } - frag_hdr = skb_put_data(skb_frag, &header, hdr_len); - - /* If this is not the last fragment, then add the - * MOREFRAGS bit to the frame control - */ - if (i != nr_frags - 1) { - frag_hdr->frame_control = cpu_to_le16(fc | - IEEE80211_FCTL_MOREFRAGS); - bytes = bytes_per_frag; - - } else { - /* The last fragment has the remaining length */ - bytes = bytes_last_frag; - } - if ((qos_activated) && (!bIsMulticast)) { - frag_hdr->seq_ctrl = - cpu_to_le16(rtllib_query_seqnum(ieee, skb_frag, - header.addr1)); - frag_hdr->seq_ctrl = - cpu_to_le16(le16_to_cpu(frag_hdr->seq_ctrl) << 4 | i); - } else { - frag_hdr->seq_ctrl = - cpu_to_le16(ieee->seq_ctrl[0] << 4 | i); - } - /* Put a SNAP header on the first fragment */ - if (i == 0) { - rtllib_put_snap(skb_put(skb_frag, - SNAP_SIZE + - sizeof(u16)), ether_type); - bytes -= SNAP_SIZE + sizeof(u16); - } + if (i != nr_frags - 1) { + frag_hdr->frame_control = cpu_to_le16(fc | + IEEE80211_FCTL_MOREFRAGS); + bytes = bytes_per_frag; - skb_put_data(skb_frag, skb->data, bytes); - - /* Advance the SKB... */ - skb_pull(skb, bytes); - - /* Encryption routine will move the header forward in - * order to insert the IV between the header and the - * payload - */ - if (encrypt) - rtllib_encrypt_fragment(ieee, skb_frag, - hdr_len); - if (ieee->config & - (CFG_RTLLIB_COMPUTE_FCS | CFG_RTLLIB_RESERVE_FCS)) - skb_put(skb_frag, 4); + } else { + /* The last fragment has the remaining length */ + bytes = bytes_last_frag; } - if ((qos_activated) && (!bIsMulticast)) { - if (ieee->seq_ctrl[UP2AC(skb->priority) + 1] == 0xFFF) - ieee->seq_ctrl[UP2AC(skb->priority) + 1] = 0; - else - ieee->seq_ctrl[UP2AC(skb->priority) + 1]++; + frag_hdr->seq_ctrl = + cpu_to_le16(rtllib_query_seqnum(ieee, skb_frag, + header.addr1)); + frag_hdr->seq_ctrl = + cpu_to_le16(le16_to_cpu(frag_hdr->seq_ctrl) << 4 | i); } else { - if (ieee->seq_ctrl[0] == 0xFFF) - ieee->seq_ctrl[0] = 0; - else - ieee->seq_ctrl[0]++; + frag_hdr->seq_ctrl = + cpu_to_le16(ieee->seq_ctrl[0] << 4 | i); } - } else { - if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) { - netdev_warn(ieee->dev, "skb too small (%d).\n", - skb->len); - goto success; + /* Put a SNAP header on the first fragment */ + if (i == 0) { + rtllib_put_snap(skb_put(skb_frag, + SNAP_SIZE + + sizeof(u16)), ether_type); + bytes -= SNAP_SIZE + sizeof(u16); } - txb = rtllib_alloc_txb(1, skb->len, GFP_ATOMIC); - if (!txb) { - netdev_warn(ieee->dev, "Could not allocate TXB\n"); - goto failed; - } + skb_put_data(skb_frag, skb->data, bytes); - txb->encrypted = 0; - txb->payload_size = cpu_to_le16(skb->len); - skb_put_data(txb->fragments[0], skb->data, skb->len); + /* Advance the SKB... */ + skb_pull(skb, bytes); + + /* Encryption routine will move the header forward in + * order to insert the IV between the header and the + * payload + */ + if (encrypt) + rtllib_encrypt_fragment(ieee, skb_frag, + hdr_len); + if (ieee->config & + (CFG_RTLLIB_COMPUTE_FCS | CFG_RTLLIB_RESERVE_FCS)) + skb_put(skb_frag, 4); + } + + if ((qos_activated) && (!bIsMulticast)) { + if (ieee->seq_ctrl[UP2AC(skb->priority) + 1] == 0xFFF) + ieee->seq_ctrl[UP2AC(skb->priority) + 1] = 0; + else + ieee->seq_ctrl[UP2AC(skb->priority) + 1]++; + } else { + if (ieee->seq_ctrl[0] == 0xFFF) + ieee->seq_ctrl[0] = 0; + else + ieee->seq_ctrl[0]++; } success: From patchwork Tue Oct 3 19:33:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hortmann X-Patchwork-Id: 148040 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2307253vqb; Tue, 3 Oct 2023 12:33:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjdEW4Ql+lP9INgnvVgaY6bP+gsQcSGtbvAudA9KH1RY1q7+1zTI1593N/krJru5jKk6bI X-Received: by 2002:a05:6a00:3a08:b0:690:cae9:714d with SMTP id fj8-20020a056a003a0800b00690cae9714dmr522417pfb.13.1696361635725; Tue, 03 Oct 2023 12:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696361635; cv=none; d=google.com; s=arc-20160816; b=brQPxabALoqhdLT4VAM6SLX2ovXpQQS2eU7zcqBtLzIwYLLI44NGnzeqF5rzQTj2S4 v1x50rPl06le1mfjsRRsCmqNzFBNddHGLxULwhP1CK23wq9WIlqAV/hzOzV5BT5CRB7Z ZTgYGKFUO/px91OLT0WAz59UvH1m5FQ5O1H0c+4OyBZwOxKlCvZUxRDMNUb0ji04dwez U7lVToc+z0fsPSh6li8fm1Aj0PypB75vntUsJMvkxn5Yh/H/sDpvpmDL7mNj9RxdC3C7 NN8UM+m+pgwP3IIALhr13Mm3q96lE3u1v1STCZ5HikjNxITA7v7DTixjpRZFMKCYVQm0 AtBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=UFQqJ8FnoiDbXQTYRHGl9/H4vusMfHOBvbL9wqGrJ38=; fh=Sw1rtAM+hKyOoOQVYiiLzcdjc4spg79Z/tN6UmWUAKs=; b=B1Dyq2eQYPgsh0k0akpriho8m3NPVBrNH4eunDm/rdcnzoixpoYQJuEy1X/2jdt0HK zipvZvpwVUas4Qy//bPrPLXPbH9DUi7EWZOWJ4kUGAALmg4wozjcQrYUNEm1pplrl68n lb77gu2QpJxvyzFWUR8HsZemAqQCFopZKo/kbSABgfaZZSmSeTtEIJBTct6cFECMJEtr UrWKkxYWbwrM9PMIOj6IH7XJ6C6HRHwKaZvmiBLNKN+edEsKEceCiK3HPzO+d2xDWXto YVgIfCt3PCsaQvbzGh/tfIc+V72Xq9n+38nI4rKKd/PwBsemRhWua6gQxCk3xh9IJeUL 4dpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MGG5wmR5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id m7-20020a655307000000b0056535e2b751si2145523pgq.782.2023.10.03.12.33.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:33:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MGG5wmR5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id F06CE82E7B1A; Tue, 3 Oct 2023 12:33:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240947AbjJCTdv (ORCPT + 17 others); Tue, 3 Oct 2023 15:33:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240957AbjJCTdt (ORCPT ); Tue, 3 Oct 2023 15:33:49 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8BB9E8 for ; Tue, 3 Oct 2023 12:33:44 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9b27f99a356so44422266b.0 for ; Tue, 03 Oct 2023 12:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696361623; x=1696966423; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UFQqJ8FnoiDbXQTYRHGl9/H4vusMfHOBvbL9wqGrJ38=; b=MGG5wmR53DQOLU9H5/kh2c7rukUg3P5GlEJXQk1+vHi8FAvJwVXfHb8K/FKmwzWaFx qsJO/Lfvz7IxYZ5F6s1HnLOEz0pF1ErKAw9psBdjFd+ZfzCEfVgjQKzCZRFS5hFK8cDM 1o1qnWDuZ760liqPxngO6jQiRAwe5/ycz/KMD807RPVmcSH/LLfdQUwfQqUA5MGM2ryr gK81XvEaKrvwL/D7iYrYt61fJ+lfIyQC1/UJsBZOmFxHxl80Y6oUYI/ex9nyDI19XaX+ Hm2oI6qBuzek0efiwRoXmwWYOOaSQKXbJtKraF5jDf2f47bALi1dJ0XaNPhBq83cbK7a C68w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696361623; x=1696966423; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UFQqJ8FnoiDbXQTYRHGl9/H4vusMfHOBvbL9wqGrJ38=; b=Cowr+0tMbNjXVrG7h0OtL8a4uav/yT7zEHEeYnySke5GJpiLLm9jIeUekiGGZz+nJY F694lJTQTelKYMF/0TgmZt47bj6eJefCyK79MZ9t2KJ0ewyfpNbxXSF2G3Rdd4MYDqkz fKhLsXV8gjLme/W0v+KEuTdQwo2i2BwkY2GqoDaiTEfKxc/op5l9DzDmF/noSq9lkkLf QHh5DE5tJKwRyZu76cwcYtqY5Wh2WtfKgWH+/dG6mvYrVvjNcEuShxVCf2kY8nO8cfUW NyBS08lx8zQo1btjeoJb4+8NjC+1fLd0PC2HGAsuvxtoCIF1K+rSFEjt12qP9KAs9kj6 mUPg== X-Gm-Message-State: AOJu0YzG4Hm/bpjSnc4liIxsBXwk38Q4AzSkqsao2Gf4vUatGNk+vR3R TfiBTMN6EDkw6OOl9djLToifVBuUib0= X-Received: by 2002:a17:906:109e:b0:9a1:f96c:4bb9 with SMTP id u30-20020a170906109e00b009a1f96c4bb9mr77552eju.6.1696361623196; Tue, 03 Oct 2023 12:33:43 -0700 (PDT) Received: from matrix-ESPRIMO-P710 (p579356c7.dip0.t-ipconnect.de. [87.147.86.199]) by smtp.gmail.com with ESMTPSA id j24-20020a170906411800b009b65a698c16sm1489645ejk.220.2023.10.03.12.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:33:42 -0700 (PDT) Date: Tue, 3 Oct 2023 21:33:41 +0200 From: Philipp Hortmann To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 06/11] staging: rtl8192e: Remove function _rtl92e_wx_set_promisc_mode() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 03 Oct 2023 12:33:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778764098329068112 X-GMAIL-MSGID: 1778764098329068112 Remove function _rtl92e_wx_set_promisc_mode() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann --- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 47 +--------------------- drivers/staging/rtl8192e/rtllib.h | 4 +- drivers/staging/rtl8192e/rtllib_softmac.c | 43 -------------------- 3 files changed, 2 insertions(+), 92 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index f28e70a0da4f..2f5acdd71339 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -918,48 +918,6 @@ static int _rtl92e_wx_get_gen_ie(struct net_device *dev, return ret; } -#define OID_RT_INTEL_PROMISCUOUS_MODE 0xFF0101F6 - -static int _rtl92e_wx_set_promisc_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - struct r8192_priv *priv = rtllib_priv(dev); - struct rtllib_device *ieee = priv->rtllib; - - u32 info_buf[3]; - - u32 oid; - u32 promiscuous_on; - u32 fltr_src_sta_frame; - - if (copy_from_user(info_buf, wrqu->data.pointer, sizeof(info_buf))) - return -EFAULT; - - oid = info_buf[0]; - promiscuous_on = info_buf[1]; - fltr_src_sta_frame = info_buf[2]; - - if (oid == OID_RT_INTEL_PROMISCUOUS_MODE) { - ieee->intel_promiscuous_md_info.promiscuous_on = - (promiscuous_on) ? (true) : (false); - ieee->intel_promiscuous_md_info.fltr_src_sta_frame = - (fltr_src_sta_frame) ? (true) : (false); - (promiscuous_on) ? - (rtllib_EnableIntelPromiscuousMode(dev, false)) : - (rtllib_DisableIntelPromiscuousMode(dev, false)); - - netdev_info(dev, - "=======>%s(), on = %d, filter src sta = %d\n", - __func__, promiscuous_on, - fltr_src_sta_frame); - } else { - return -1; - } - - return 0; -} - static int _rtl92e_wx_get_promisc_mode(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -1037,9 +995,6 @@ static const struct iw_priv_args r8192_private_args[] = { SIOCIWFIRSTPRIV + 0xb, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_NONE, "lps_force" - }, { - SIOCIWFIRSTPRIV + 0x16, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, "setpromisc" }, { SIOCIWFIRSTPRIV + 0x17, 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 45, "getpromisc" @@ -1070,7 +1025,7 @@ static iw_handler r8192_private_handler[] = { (iw_handler)NULL, (iw_handler)NULL, (iw_handler)NULL, - (iw_handler)_rtl92e_wx_set_promisc_mode, + (iw_handler)NULL, (iw_handler)_rtl92e_wx_get_promisc_mode, }; diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 546eedfeb43e..a02e8c976ca0 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1701,9 +1701,7 @@ void rtllib_stop_protocol(struct rtllib_device *ieee); void rtllib_EnableNetMonitorMode(struct net_device *dev, bool bInitState); void rtllib_DisableNetMonitorMode(struct net_device *dev, bool bInitState); -void rtllib_EnableIntelPromiscuousMode(struct net_device *dev, bool bInitState); -void rtllib_DisableIntelPromiscuousMode(struct net_device *dev, - bool bInitState); + void rtllib_softmac_stop_protocol(struct rtllib_device *ieee); void rtllib_softmac_start_protocol(struct rtllib_device *ieee); diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 11395dbc9d4d..206f8e05d5d0 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -406,49 +406,6 @@ void rtllib_DisableNetMonitorMode(struct net_device *dev, ieee->AllowAllDestAddrHandler(dev, false, !bInitState); } -/* Enables the specialized promiscuous mode required by Intel. - * In this mode, Intel intends to hear traffics from/to other STAs in the - * same BSS. Therefore we don't have to disable checking BSSID and we only need - * to allow all dest. BUT: if we enable checking BSSID then we can't recv - * packets from other STA. - */ -void rtllib_EnableIntelPromiscuousMode(struct net_device *dev, - bool bInitState) -{ - bool bFilterOutNonAssociatedBSSID = false; - - struct rtllib_device *ieee = netdev_priv_rsl(dev); - - netdev_info(dev, "========>Enter Intel Promiscuous Mode\n"); - - ieee->AllowAllDestAddrHandler(dev, true, !bInitState); - ieee->SetHwRegHandler(dev, HW_VAR_CECHK_BSSID, - (u8 *)&bFilterOutNonAssociatedBSSID); - - ieee->net_promiscuous_md = true; -} -EXPORT_SYMBOL(rtllib_EnableIntelPromiscuousMode); - -/* Disables the specialized promiscuous mode required by Intel. - * See MgntEnableIntelPromiscuousMode for detail. - */ -void rtllib_DisableIntelPromiscuousMode(struct net_device *dev, - bool bInitState) -{ - bool bFilterOutNonAssociatedBSSID = true; - - struct rtllib_device *ieee = netdev_priv_rsl(dev); - - netdev_info(dev, "========>Exit Intel Promiscuous Mode\n"); - - ieee->AllowAllDestAddrHandler(dev, false, !bInitState); - ieee->SetHwRegHandler(dev, HW_VAR_CECHK_BSSID, - (u8 *)&bFilterOutNonAssociatedBSSID); - - ieee->net_promiscuous_md = false; -} -EXPORT_SYMBOL(rtllib_DisableIntelPromiscuousMode); - static void rtllib_send_probe(struct rtllib_device *ieee) { struct sk_buff *skb; From patchwork Tue Oct 3 19:33:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hortmann X-Patchwork-Id: 148041 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2307438vqb; Tue, 3 Oct 2023 12:34:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9WarkzXjDFhHGXocHXSv8D1BRra/OnegfnXYwR1J3du0UABoab3ZKzfwaPjxVHlbsD4LL X-Received: by 2002:a05:6a20:1047:b0:14d:72e2:686a with SMTP id gt7-20020a056a20104700b0014d72e2686amr378643pzc.36.1696361655190; Tue, 03 Oct 2023 12:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696361655; cv=none; d=google.com; s=arc-20160816; b=z2TukLHHVnNBH5cx6IqMsJs/LKQ7uSRXVXdQ0jnXQK3I7/lLD8UKr++q6zMQ0yVjXe 3yElzzeUFF0uYGNc0B0EKeA5JXtzinF7i+vRgVcFmGlDiJ4Vii/M9hvaitV5HYgVPMqi 5BVm3ffiAEAmfzBhvT1WHuDJDZicFTmHVF86O/w0c0nNMnvjdvW6C/M855ilx+9F8zrH SZc92qAfCFyVZbBI/bd4KxBs8RKGQWJCwf288tt2xpGmYh6+mmFiKyO9yz14aSHocQEY +mpsRus+GYjnAx/c7PNVEihVopj1Z8S7f/bBJ3LNSwlRnDoVFf0Bcm+6ecoCt1BV4vUP RQjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=o0RrMuYVrq3C/m7QhaLpLvy+gp+gXjLQFOpM9VmMeE8=; fh=Sw1rtAM+hKyOoOQVYiiLzcdjc4spg79Z/tN6UmWUAKs=; b=Zugdjf0pMF62Ufc6Vw4ocSje3AK8vi8cHK2ubKeO+xeIhaSrEHg/0E9X+hG3TQLJ8G 4WLeub9WivH1h6pI38wFWAVH82+fMcCMqQaFi/zc2gO4pOTqRij4FhIx5vFl9oKYCoed tsmcp2i3WyXzZ+cvXM65BN5Qpcv7XlLZtiDCceaeB4MfYeMrydRo0Zxhy78jdN1mQJcd skaD9bpkaaPHXQpWQdkF7e9l90RS55gCgC5PWl5kHZHKsUsUeHekV0Oahe5uLycUm9x0 tLOd+mb6KmRC0HYUZERoh/HRpVvMU+Ay+uZ3PR3ZMSYXSL6qukinYPGgNKiFuNqodlzw DUyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iwoIcPtt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id g14-20020a056a001a0e00b006934390d0casi2124079pfv.36.2023.10.03.12.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:34:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iwoIcPtt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5035A818CCA9; Tue, 3 Oct 2023 12:34:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240940AbjJCTeA (ORCPT + 17 others); Tue, 3 Oct 2023 15:34:00 -0400 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 S240956AbjJCTd5 (ORCPT ); Tue, 3 Oct 2023 15:33:57 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E40D0AF for ; Tue, 3 Oct 2023 12:33:50 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9ae65c0e46fso53973066b.0 for ; Tue, 03 Oct 2023 12:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696361629; x=1696966429; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=o0RrMuYVrq3C/m7QhaLpLvy+gp+gXjLQFOpM9VmMeE8=; b=iwoIcPttLzx6IH16t+lS2xK0hLtXCfq7lrNyN4pyNL0jS83yk07Lj+VfRIMbgTnCZ9 LuRDwVF6zYXyECW2mziwWSVCU9OCH741fknCOBJZTfv5NphHLFj8iMp0mBQH1unIs2pe SfUS+y9L8ldURcniaigBxmI84GOm7WbkMpnt+lPw4we+iqlLY3E5HshEFsQDwdgOnMuc MBIPF0tnnqwQSphtXhA0gSTtF5X+hIIrSstMskbng2F6M7Bq76xyXthU1OhD9v7peDj1 mS9wodYNgoyFlWH3CdI+/o0u+C65tRIp94hXBkOR4aP8adDzX4QGBI1LwQ3pEJ65GIPr KBYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696361629; x=1696966429; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=o0RrMuYVrq3C/m7QhaLpLvy+gp+gXjLQFOpM9VmMeE8=; b=GgB1sakdpoxWFM/l6YWWBZRcw6ZCFjm7uSJHJuONPw/rSEDlJ44He10KCR7Jy8l1+N uCThJ1AAZvsC7bP0aoldpMVIpZ8BPCiM52Xef0WOBatSsQyZERA/mCzW3o5VvAVhCjgz M/maaiVyATin/5Whgnyjm3vYRtEtsTozxAMim/NuUEn9uQvhoEUTQQVv1Z0TskNPL4Uu /E8jYWyF+zXHi0j3Cr4EbMXQBfWEY9M1An88hwCQuqXKaP3oEbS3iP7iw8BvS3yaBMAJ 9f+6r2ALA3uDtgVHfz4GHwKQupYa7GHC+yeAWHirsuJaz0hphU1ePF2WI5G3wa7tUv7+ yCiQ== X-Gm-Message-State: AOJu0YyWOUXPM7yUiEvt1evMG39VdNWklm0YHjkDjO3EXrf02aEq9OB7 hS+m417ecQQMXF1w31Frt6Y= X-Received: by 2002:a17:906:29a:b0:9a6:ae76:d6ae with SMTP id 26-20020a170906029a00b009a6ae76d6aemr101117ejf.3.1696361629349; Tue, 03 Oct 2023 12:33:49 -0700 (PDT) Received: from matrix-ESPRIMO-P710 (p579356c7.dip0.t-ipconnect.de. [87.147.86.199]) by smtp.gmail.com with ESMTPSA id kj6-20020a170907764600b009b2c9476726sm1535909ejc.21.2023.10.03.12.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:33:49 -0700 (PDT) Date: Tue, 3 Oct 2023 21:33:47 +0200 From: Philipp Hortmann To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 07/11] staging: rtl8192e: Remove function _rtl92e_wx_get_promisc_mode() Message-ID: <8b1735a3f249b1cf73189e98a07e134c5cd50974.1696360404.git.philipp.g.hortmann@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 03 Oct 2023 12:34:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778764118719550591 X-GMAIL-MSGID: 1778764118719550591 Remove function _rtl92e_wx_get_promisc_mode() as this functionality is not commonly used and the tool to access it is deprecated. Signed-off-by: Philipp Hortmann --- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 34 ---------------------- 1 file changed, 34 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c index 2f5acdd71339..d0b68b258af7 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c @@ -918,25 +918,6 @@ static int _rtl92e_wx_get_gen_ie(struct net_device *dev, return ret; } -static int _rtl92e_wx_get_promisc_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - struct r8192_priv *priv = rtllib_priv(dev); - struct rtllib_device *ieee = priv->rtllib; - - mutex_lock(&priv->wx_mutex); - - snprintf(extra, 45, "PromiscuousMode:%d, FilterSrcSTAFrame:%d", - ieee->intel_promiscuous_md_info.promiscuous_on, - ieee->intel_promiscuous_md_info.fltr_src_sta_frame); - wrqu->data.length = strlen(extra) + 1; - - mutex_unlock(&priv->wx_mutex); - - return 0; -} - #define IW_IOCTL(x) ((x) - SIOCSIWCOMMIT) static iw_handler r8192_wx_handlers[] = { [IW_IOCTL(SIOCGIWNAME)] = _rtl92e_wx_get_name, @@ -995,9 +976,6 @@ static const struct iw_priv_args r8192_private_args[] = { SIOCIWFIRSTPRIV + 0xb, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, IW_PRIV_TYPE_NONE, "lps_force" - }, { - SIOCIWFIRSTPRIV + 0x17, - 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 45, "getpromisc" } }; @@ -1015,18 +993,6 @@ static iw_handler r8192_private_handler[] = { (iw_handler)NULL, (iw_handler)_rtl92e_wx_set_lps_awake_interval, (iw_handler)_rtl92e_wx_set_force_lps, - (iw_handler)NULL, - (iw_handler)NULL, - (iw_handler)NULL, - (iw_handler)NULL, - (iw_handler)NULL, - (iw_handler)NULL, - (iw_handler)NULL, - (iw_handler)NULL, - (iw_handler)NULL, - (iw_handler)NULL, - (iw_handler)NULL, - (iw_handler)_rtl92e_wx_get_promisc_mode, }; static struct iw_statistics *_rtl92e_get_wireless_stats(struct net_device *dev) From patchwork Tue Oct 3 19:34:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hortmann X-Patchwork-Id: 148042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp2307719vqb; Tue, 3 Oct 2023 12:34:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEK/H+B8jabVhoiGrBY1gLpGyWW1N5ivOSJRzFLF8uYhdwcFeE+VKbcsOLBse/mwR5gcmQc X-Received: by 2002:a9d:7383:0:b0:6b9:cba0:93a9 with SMTP id j3-20020a9d7383000000b006b9cba093a9mr169447otk.31.1696361693551; Tue, 03 Oct 2023 12:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696361693; cv=none; d=google.com; s=arc-20160816; b=Evqs3V5vJNd2CQ7m+mBUaJuACsPtOk4RvMUZkSAXOBRuRCQQf2THHgl2YOM+i8o27E OkR3S593uuimEew2rjnId8EBm4QlD6m046XqUX9Jq3YEAi3YJtIcptOwFVTlFHBtEP7Z N45JRGA+Uzu3Acc8hx4QD99T0vtjLSj/LDhUt3/2Wrl7EsVEf0ZSXKmXB5nGlJZ1R7a8 /eEDsJmLIOAtdX+WXu8bS6OOFyCcVwzDnbqY3L4t3AyAsn13P0nG0rDDibfZJ/jUfFgE CugvLZXyeVQ0dwKFG15EhMQEy++ulAFh9bbFtAoZfwZ8Cnmzq1JeB4Uqfmvsg77mR0S7 WgJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=UjGjxI6eGVPYNgs9C+/srpj1zkswroX+k2Y9drOlyqk=; fh=Sw1rtAM+hKyOoOQVYiiLzcdjc4spg79Z/tN6UmWUAKs=; b=UjRHGW/vQfFjRnRSFTEUdAkLt1jB8yKOTwQkXyoNkawysdR5pcSahkDe0xSs6Epw90 29KD1/n90ejok9u2ZEgz3n4JSFFlUJDGwP8+8bfe2mq8iaUtVsQQdwnPKWVAunW0cmap jkDSlqL0vlqTbYVkux4Cv+ntoeRa04wPXLRpLQPqqnQ9jxgzNqvERDLgfkWN9VYU3eFz rrx2GznyLUg8s9/x9BvCTuvuWlCmidiF3Jp5t+hJr8EwQ6RZJKzUh44s0UcGYWlItISK a15VAzg1lqsn0219eDOeK5mJSL5QqNCNkHgXkuvlHm9IvjrqtQkHPM0t8eJmUIf/AUB/ Fcww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dKVYiu+L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bs65-20020a632844000000b005653316de6fsi2021062pgb.271.2023.10.03.12.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:34:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dKVYiu+L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 893D481A2372; Tue, 3 Oct 2023 12:34:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240967AbjJCTea (ORCPT + 17 others); Tue, 3 Oct 2023 15:34:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240986AbjJCTe0 (ORCPT ); Tue, 3 Oct 2023 15:34:26 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D8B810E for ; Tue, 3 Oct 2023 12:34:20 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-9b2d64c9307so53346166b.1 for ; Tue, 03 Oct 2023 12:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696361659; x=1696966459; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UjGjxI6eGVPYNgs9C+/srpj1zkswroX+k2Y9drOlyqk=; b=dKVYiu+L+bRmMxF2a+H+rCpLlxxzL5CjiQNQ4+LmTeRBaOOgmGmZihUynJDyf6fjqu 3808sYCdFuCz+GPutRJ66d/hTOal0uDqRPHPaKNREhTDiDgf9LbDdgSHN2qsVDRRPrSo 2nMp/kb1a9plWkdGxaG1GAEK6hdfBtW+WkcEHCAtgMnZRZwXqa1WyzYRPhFz54EzwMxa WmjjHVdmzsANY1E8oMYYtiWW1fASAN45hnc6y6RmsHjgBlIf8hO4rrhpyP3G4sd+SEsK QrNicZUO22eAls083J8CBgQRiWngSThY//p1kPFoPdAiRumvzKJNJ7GGexK5/NQWE7In Bu3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696361659; x=1696966459; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UjGjxI6eGVPYNgs9C+/srpj1zkswroX+k2Y9drOlyqk=; b=SDBuVQvvcpSrQ4I8iFG/L1ngCHk/Qii8Cb8yM/jUUJ3saMJ1PgmvoU57zzexl1+0O0 hP90qCH5Cd5EmbGscY9OfTrTlnpR2MPlJ6QGLoySzLYsK/r1KVlGFuja0hne715Iiquy DxZWNnSCsqJetNJlpgWoB98crc5WT9k3c6hiab5kjoUBbOU9+dX1P1c/7pwIFawLDSOd wF+nMMvrX/oFOUO5hJ31e2mHzbZgOiwlKNcF7ek3e9gGWyc9G13QOiHcvxFNlqXP7OXG FXN7iFynFUeJzGmCq1xvMuUjfF2HItGN1kp+L/Cl8XpRRVTvrPBDuvbbCT69NOUO7brC S9Vw== X-Gm-Message-State: AOJu0YxpY4/SSXFoHh5fKFX8S+/1DUTtg8VIGOeJFKXhOi7hTrkLQqEH GWPsznYpfgpq82Q5TJcPrm0= X-Received: by 2002:a17:906:7389:b0:9b2:71f2:bd11 with SMTP id f9-20020a170906738900b009b271f2bd11mr98352ejl.4.1696361659029; Tue, 03 Oct 2023 12:34:19 -0700 (PDT) Received: from matrix-ESPRIMO-P710 (p579356c7.dip0.t-ipconnect.de. [87.147.86.199]) by smtp.gmail.com with ESMTPSA id v10-20020a1709060b4a00b009ae5e46210asm1528773ejg.99.2023.10.03.12.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 12:34:18 -0700 (PDT) Date: Tue, 3 Oct 2023 21:34:17 +0200 From: Philipp Hortmann To: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 11/11] staging: rtl8192e: Remove constant variable bToOtherSTA Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 03 Oct 2023 12:34:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778764159170764189 X-GMAIL-MSGID: 1778764159170764189 Remove variable bToOtherSTA as it is set to 0 and unchanged. The equations result accordingly. Remove dead code. Signed-off-by: Philipp Hortmann --- drivers/staging/rtl8192e/rtllib_rx.c | 32 +++++++++++----------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 9a5fdf16f6a1..124c1651856b 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -1244,7 +1244,6 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, u8 bssid[ETH_ALEN] = {0}; size_t hdrlen = 0; - bool bToOtherSTA = false; int ret = 0, i = 0; fc = le16_to_cpu(hdr->frame_control); @@ -1278,8 +1277,6 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, /* Filter MGNT Frame */ if (type == RTLLIB_FTYPE_MGMT) { - if (bToOtherSTA) - goto rx_dropped; if (rtllib_rx_frame_mgmt(ieee, skb, rx_stats, type, stype)) goto rx_dropped; else @@ -1289,10 +1286,8 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, /* Filter WAPI DATA Frame */ /* Update statstics for AP roaming */ - if (!bToOtherSTA) { - ieee->link_detect_info.NumRecvDataInPeriod++; - ieee->link_detect_info.NumRxOkInPeriod++; - } + ieee->link_detect_info.NumRecvDataInPeriod++; + ieee->link_detect_info.NumRxOkInPeriod++; /* Data frame - extract src/dst addresses */ rtllib_rx_extract_addr(ieee, hdr, dst, src, bssid); @@ -1308,7 +1303,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, /* Send pspoll based on moredata */ if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->sta_sleep == LPS_IS_SLEEP) && - (ieee->polling) && (!bToOtherSTA)) { + (ieee->polling)) { if (WLAN_FC_MORE_DATA(fc)) { /* more data bit is set, let's request a new frame * from the AP @@ -1334,8 +1329,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, /* Get TS for Rx Reorder */ hdr = (struct ieee80211_hdr *)skb->data; if (ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data) - && !is_multicast_ether_addr(hdr->addr1) - && (!bToOtherSTA)) { + && !is_multicast_ether_addr(hdr->addr1)) { TID = Frame_QoSTID(skb->data); SeqNum = WLAN_GET_SEQ_SEQ(sc); rtllib_get_ts(ieee, (struct ts_common_info **)&ts, hdr->addr2, TID, @@ -1366,18 +1360,16 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, /* Update WAPI PN */ /* Check if leave LPS */ - if (!bToOtherSTA) { - if (ieee->bIsAggregateFrame) - nr_subframes = rxb->nr_subframes; - else - nr_subframes = 1; - if (unicast) - ieee->link_detect_info.NumRxUnicastOkInPeriod += nr_subframes; - rtllib_rx_check_leave_lps(ieee, unicast, nr_subframes); - } + if (ieee->bIsAggregateFrame) + nr_subframes = rxb->nr_subframes; + else + nr_subframes = 1; + if (unicast) + ieee->link_detect_info.NumRxUnicastOkInPeriod += nr_subframes; + rtllib_rx_check_leave_lps(ieee, unicast, nr_subframes); /* Indicate packets to upper layer or Rx Reorder */ - if (!ieee->ht_info->cur_rx_reorder_enable || ts == NULL || bToOtherSTA) + if (!ieee->ht_info->cur_rx_reorder_enable || ts == NULL) rtllib_rx_indicate_pkt_legacy(ieee, rx_stats, rxb, dst, src); else RxReorderIndicatePacket(ieee, rxb, ts, SeqNum);