From patchwork Sun Jan 8 18:57:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 40542 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1817693wrt; Sun, 8 Jan 2023 11:05:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXvc/ppbRJD7HlQPgjq5JNHwO8PoRNNCSe14c5/6XTfk3aMRDZI5CrTrSpeX5wOVIt6vAc0q X-Received: by 2002:a05:6402:2932:b0:47e:bdb8:9133 with SMTP id ee50-20020a056402293200b0047ebdb89133mr61659278edb.38.1673204717105; Sun, 08 Jan 2023 11:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673204717; cv=none; d=google.com; s=arc-20160816; b=e1SSHDrZLab6IrnzYT86+NeKV6gyqtksYKFCVB3Bo7fE7E4MADiT8ezikwad4V5Gs+ NsGtUotohxeVHamzHRUgX3EqoZWYw6A5ENUbcUTlA0oxv5GfTYtMzN2lxATC+wwW7jFv 8UKTGq0Rle5/kNPrbpf/KmDmqAUQ3GTUOlTFvN1ebKmFfbI546/Wb3Hp0ubAGeKlS2v4 VBb+nPHO7Sg3By9jgIgEQGOCJG04b/svU0Mz0u6MFD+zGgxieFgiQW6cz0xcsMo+24Y/ zVIVq6aRSdVERyncX4FBr6luaU8mG9oTtIJVAJUNUfaKNkGfI8oOQrb3gDBVYUQgtk8i xoJA== 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=SFilvH1g/Bb+qK7QsmXseOAddGVaE8m9tWzulwv+2ZM=; b=rJW/da8avbiO8dx3rIgnmL8IuoeZC/+BjOjXNB+R158OZTD2adtAM3GFAsFMg9w3eu yAVL3KABMoF93rQq3XYuZk9e2MLt7cLR9u4/sGVM5pywuT7U89KFn4xk6+wgI+Mq0DrM JQbhLtpoMHF0ieqBQRch5F660vjnIpNoV60DydrjFmOSmiU273CYDkopY+K/088MzmM2 42kpMQQY0jBotRIZbwDnLhi7Tlu/OqBKRXQ6AXXFNLfF/XIjzAJWosO3u73IUGankrY+ T/6v4ZhYStuF8oldetSGBImzyOLpoQM+nLOqme0/ezVw/pXpJ8upqPKFEzNRskdUfnMl Q/6A== 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 ji1-20020a170907980100b0084514612c2fsi7338488ejc.613.2023.01.08.11.04.54; Sun, 08 Jan 2023 11:05:17 -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 S236095AbjAHS6x (ORCPT + 99 others); Sun, 8 Jan 2023 13:58:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236242AbjAHS6G (ORCPT ); Sun, 8 Jan 2023 13:58:06 -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 9704EE00C for ; Sun, 8 Jan 2023 10:58:05 -0800 (PST) Received: from dslb-188-096-147-053.188.096.pools.vodafone-ip.de ([188.96.147.53] 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 1pEaro-0003b8-H6; Sun, 08 Jan 2023 19:58: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 12/13] staging: r8188eu: xmit_priv's vcs is not used Date: Sun, 8 Jan 2023 19:57:37 +0100 Message-Id: <20230108185738.597105-13-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230108185738.597105-1-martin@kaiser.cx> References: <20230108185738.597105-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?1754482309541555366?= X-GMAIL-MSGID: =?utf-8?q?1754482309541555366?= The vcs component in struct xmit_priv is set but not used. We can remove vcs and the rtw_update_protection function, whose only job is to set vcs. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme.c | 5 ---- drivers/staging/r8188eu/core/rtw_xmit.c | 34 ---------------------- drivers/staging/r8188eu/include/rtw_xmit.h | 2 -- drivers/staging/r8188eu/os_dep/os_intfs.c | 1 - 4 files changed, 42 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c index b272123626ac..fb7d0e161fdd 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme.c +++ b/drivers/staging/r8188eu/core/rtw_mlme.c @@ -444,8 +444,6 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex if (check_fwstate(pmlmepriv, _FW_LINKED) && is_same_network(&pmlmepriv->cur_network.network, pnetwork)) { update_network(&pmlmepriv->cur_network.network, pnetwork, adapter, true); - rtw_update_protection(adapter, (pmlmepriv->cur_network.network.IEs) + sizeof(struct ndis_802_11_fixed_ie), - pmlmepriv->cur_network.network.IELength); } } @@ -1027,9 +1025,6 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net break; } - rtw_update_protection(padapter, (cur_network->network.IEs) + - sizeof(struct ndis_802_11_fixed_ie), - (cur_network->network.IELength)); rtw_update_ht_cap(padapter, cur_network->network.IEs, cur_network->network.IELength); } diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 1cd560630de3..8b055e3fbfa5 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1099,40 +1099,6 @@ s32 rtw_put_snap(u8 *data, u16 h_proto) return SNAP_SIZE + sizeof(u16); } -void rtw_update_protection(struct adapter *padapter, u8 *ie, uint ie_len) -{ - uint protection; - u8 *perp; - int erp_len; - struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - struct registry_priv *pregistrypriv = &padapter->registrypriv; - - switch (pxmitpriv->vcs_setting) { - case DISABLE_VCS: - pxmitpriv->vcs = NONE_VCS; - break; - case ENABLE_VCS: - break; - case AUTO_VCS: - default: - perp = rtw_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len); - if (!perp) { - pxmitpriv->vcs = NONE_VCS; - } else { - protection = (*(perp + 2)) & BIT(1); - if (protection) { - if (pregistrypriv->vcs_type == RTS_CTS) - pxmitpriv->vcs = RTS_CTS; - else - pxmitpriv->vcs = CTS_TO_SELF; - } else { - pxmitpriv->vcs = NONE_VCS; - } - } - break; - } -} - void rtw_count_tx_stats(struct adapter *padapter, struct xmit_frame *pxmitframe, int sz) { struct sta_info *psta = NULL; diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 77d79c43209f..abac0103b53a 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -268,7 +268,6 @@ struct xmit_priv { uint frag_len; struct adapter *adapter; u8 vcs_setting; - u8 vcs; u64 tx_bytes; u64 tx_pkts; u64 tx_drop; @@ -311,7 +310,6 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf); void rtw_count_tx_stats(struct adapter *padapter, struct xmit_frame *pxmitframe, int sz); -void rtw_update_protection(struct adapter *padapter, u8 *ie, uint ie_len); s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattrib); s32 rtw_put_snap(u8 *data, u16 h_proto); diff --git a/drivers/staging/r8188eu/os_dep/os_intfs.c b/drivers/staging/r8188eu/os_dep/os_intfs.c index ae03d39de092..f022f6b1cf3e 100644 --- a/drivers/staging/r8188eu/os_dep/os_intfs.c +++ b/drivers/staging/r8188eu/os_dep/os_intfs.c @@ -393,7 +393,6 @@ static void rtw_init_default_value(struct adapter *padapter) /* xmit_priv */ pxmitpriv->vcs_setting = pregistrypriv->vrtl_carrier_sense; - pxmitpriv->vcs = pregistrypriv->vcs_type; pxmitpriv->frag_len = pregistrypriv->frag_thresh; /* mlme_priv */