From patchwork Wed Oct 11 14:02:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 151439 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp562467vqb; Wed, 11 Oct 2023 07:04:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtROJ4f1KAWTMG5TjGKblQyuvVbqilS5ITV6mkHHYOdjzjkz+yinLoU0LriCfND3fw3Po9 X-Received: by 2002:a17:902:f24b:b0:1c9:af6a:6d12 with SMTP id j11-20020a170902f24b00b001c9af6a6d12mr5656746plc.5.1697033040620; Wed, 11 Oct 2023 07:04:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697033040; cv=none; d=google.com; s=arc-20160816; b=DlvsYwc3iovLsAFIF8PSW2Z7pyII9AiwD35gpF+sAROcrMsPa7kfkAOV1S3Qr4D6Dn M9MXWPc6Dp6J5lSunDRDKerr4JsF0V4kKERMCIZ4DQ86VNW3ZsI509lrJQcy+x3DrprR v0zV13GCOEYIb+IuizXXIqSlGp5QALyRY3bflHhrsIl3laGerr34TXxxSUgY0hdQ57BB nOR63u4QWWwtDDGZjBVGOEsaVHWKgZVMko30UdJMO5IxFK+XWbZOXqzf6qAjxpq/IAT0 DlFYzKnEzVjqA6BohksaaeicmIGUwnizrWoKMJaw39hCeHZK967tZUt5//k8JGwDKfDZ hNeA== 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=1c7rVblTqhUnyQyMFT2+wmqLcoFYyuo3MM9TAKcllKE=; fh=3hZmsfyLFayC+OxVDRVcXAhF0jfEeN6hMeU54agNFD4=; b=b/+efXumSL5cx8NMpnBopglJYWjWEQG+41RbcaLYQrcSoFR1B5tq4f4G0jrsReMcr4 tpRI54jHle2lp2bTEb//LuCJMzlTUSAo1pjNv/AB0Q5AGWPj7YIcXN6SZP5CVJtRzB7K TskRPhUaUQmr+Lbx8pOY1kAtVb2TLrQQny3qEnuT6ne4XC7geW3O7wu/8TuD6zBwOnPI ialdEAo19yUnkevdLNibClvkdps1BODVKewjoplBHvgaOq3Migclf77PqJXgRywtLuE9 B0qSRaMtuielTOZ5nWyFY0Ig4FQAhHBK+lPY6nrSaOuA7QuZQCTViENCekPpXVLhScat GwAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="oK3IFg/p"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q5-20020a170902a3c500b001c7388413besi153254plb.529.2023.10.11.07.04.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 07:04:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="oK3IFg/p"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A99C981DA39B; Wed, 11 Oct 2023 07:03:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347004AbjJKOD1 (ORCPT + 18 others); Wed, 11 Oct 2023 10:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346999AbjJKODR (ORCPT ); Wed, 11 Oct 2023 10:03:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B0BAC4; Wed, 11 Oct 2023 07:03:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32CB3C433CC; Wed, 11 Oct 2023 14:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697032989; bh=k4v64vdXlavEo9kLUWLKxx3pHDNDWQxvczexvxtQbZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oK3IFg/pFE4zGL1/r/Ct+4u3hGS8StfN/uiWbC/n8TvbMVsHb3gKi7yzdteb91f67 Y8an+OreGiSvHgVCR6ykm3uODlHrl+zH57eCRnNVH2CQxUpRnLDHrjJX5l2p3pwcZ1 OEBucTPuvF9Pghus2KylDa9kV73fRw8MPf1naZO2zJXHC6IqVh5vwkV+kmLHGRZQeX 7hgEq0saCgubgmTWXvUedHbYkjt1In2YhFtgSUY8/iOfHfcaP2KBkU1mSXsrEZpBk/ 0KP9LX610aszxOye0d+NVcSLirMxUDPRPYgSakwWC7hGkR+o+ddsMgjMsBiEyw7r7m RbWV4f5ADf8qA== From: Arnd Bergmann To: Jakub Kicinski Cc: netdev@vger.kernel.org, Greg Kroah-Hartman , linux-wireless@vger.kernel.org, Johannes Berg , linux-wpan@vger.kernel.org, Michael Hennerich , Paolo Abeni , Eric Dumazet , "David S . Miller" , Rodolfo Zitellini , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH v2 06/10] staging: rtl8712: remove unused legacy ioctl handlers Date: Wed, 11 Oct 2023 16:02:21 +0200 Message-Id: <20231011140225.253106-6-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231011140225.253106-1-arnd@kernel.org> References: <20231011140225.253106-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, 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 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 07:03:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779468117792569215 X-GMAIL-MSGID: 1779468117792569215 From: Arnd Bergmann The .ndo_do_ioctl functions are never called, and can just be removed, especially since this is a staging driver. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Arnd Bergmann --- drivers/staging/rtl8712/os_intfs.c | 1 - drivers/staging/rtl8712/osdep_intf.h | 2 - drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 124 ------------------ 3 files changed, 127 deletions(-) diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c index b18e6d9c832b8..121edffbd2507 100644 --- a/drivers/staging/rtl8712/os_intfs.c +++ b/drivers/staging/rtl8712/os_intfs.c @@ -191,7 +191,6 @@ static const struct net_device_ops rtl8712_netdev_ops = { .ndo_start_xmit = r8712_xmit_entry, .ndo_set_mac_address = r871x_net_set_mac_address, .ndo_get_stats = r871x_net_get_stats, - .ndo_do_ioctl = r871x_ioctl, }; struct net_device *r8712_init_netdev(void) diff --git a/drivers/staging/rtl8712/osdep_intf.h b/drivers/staging/rtl8712/osdep_intf.h index 9e75116c987ec..ce823030bfec2 100644 --- a/drivers/staging/rtl8712/osdep_intf.h +++ b/drivers/staging/rtl8712/osdep_intf.h @@ -27,6 +27,4 @@ struct intf_priv { struct completion io_retevt_comp; }; -int r871x_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); - #endif /*_OSDEP_INTF_H_*/ diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index 36f6904d25abc..a4a34c9f00b84 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -36,8 +36,6 @@ #include #include -#define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 0x1E) - #define SCAN_ITEM_SIZE 768 #define MAX_CUSTOM_LEN 64 #define RATE_COUNT 4 @@ -2066,128 +2064,6 @@ static int r871x_wps_start(struct net_device *dev, return 0; } -static int wpa_set_param(struct net_device *dev, u8 name, u32 value) -{ - struct _adapter *padapter = netdev_priv(dev); - - switch (name) { - case IEEE_PARAM_WPA_ENABLED: - padapter->securitypriv.AuthAlgrthm = 2; /* 802.1x */ - switch ((value) & 0xff) { - case 1: /* WPA */ - padapter->securitypriv.ndisauthtype = - Ndis802_11AuthModeWPAPSK; /* WPA_PSK */ - padapter->securitypriv.ndisencryptstatus = - Ndis802_11Encryption2Enabled; - break; - case 2: /* WPA2 */ - padapter->securitypriv.ndisauthtype = - Ndis802_11AuthModeWPA2PSK; /* WPA2_PSK */ - padapter->securitypriv.ndisencryptstatus = - Ndis802_11Encryption3Enabled; - break; - } - break; - case IEEE_PARAM_TKIP_COUNTERMEASURES: - break; - case IEEE_PARAM_DROP_UNENCRYPTED: - /* HACK: - * - * wpa_supplicant calls set_wpa_enabled when the driver - * is loaded and unloaded, regardless of if WPA is being - * used. No other calls are made which can be used to - * determine if encryption will be used or not prior to - * association being expected. If encryption is not being - * used, drop_unencrypted is set to false, else true -- we - * can use this to determine if the CAP_PRIVACY_ON bit should - * be set. - */ - break; - case IEEE_PARAM_PRIVACY_INVOKED: - break; - case IEEE_PARAM_AUTH_ALGS: - return wpa_set_auth_algs(dev, value); - case IEEE_PARAM_IEEE_802_1X: - break; - case IEEE_PARAM_WPAX_SELECT: - /* added for WPA2 mixed mode */ - break; - default: - return -EOPNOTSUPP; - } - return 0; -} - -static int wpa_mlme(struct net_device *dev, u32 command, u32 reason) -{ - struct _adapter *padapter = netdev_priv(dev); - - switch (command) { - case IEEE_MLME_STA_DEAUTH: - if (!r8712_set_802_11_disassociate(padapter)) - return -1; - break; - case IEEE_MLME_STA_DISASSOC: - if (!r8712_set_802_11_disassociate(padapter)) - return -1; - break; - default: - return -EOPNOTSUPP; - } - return 0; -} - -static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p) -{ - struct ieee_param *param; - int ret = 0; - struct _adapter *padapter = netdev_priv(dev); - - if (p->length < sizeof(struct ieee_param) || !p->pointer) - return -EINVAL; - param = memdup_user(p->pointer, p->length); - if (IS_ERR(param)) - return PTR_ERR(param); - switch (param->cmd) { - case IEEE_CMD_SET_WPA_PARAM: - ret = wpa_set_param(dev, param->u.wpa_param.name, - param->u.wpa_param.value); - break; - case IEEE_CMD_SET_WPA_IE: - ret = r871x_set_wpa_ie(padapter, (char *)param->u.wpa_ie.data, - (u16)param->u.wpa_ie.len); - break; - case IEEE_CMD_SET_ENCRYPTION: - ret = wpa_set_encryption(dev, param, p->length); - break; - case IEEE_CMD_MLME: - ret = wpa_mlme(dev, param->u.mlme.command, - param->u.mlme.reason_code); - break; - default: - ret = -EOPNOTSUPP; - break; - } - if (ret == 0 && copy_to_user(p->pointer, param, p->length)) - ret = -EFAULT; - kfree(param); - return ret; -} - -/* based on "driver_ipw" and for hostapd */ -int r871x_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -{ - struct iwreq *wrq = (struct iwreq *)rq; - - switch (cmd) { - case RTL_IOCTL_WPA_SUPPLICANT: - return wpa_supplicant_ioctl(dev, &wrq->u.data); - default: - return -EOPNOTSUPP; - } - return 0; -} - static iw_handler r8711_handlers[] = { NULL, /* SIOCSIWCOMMIT */ r8711_wx_get_name, /* SIOCGIWNAME */