From patchwork Wed Jun 14 19:08:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 9787299 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4D87760325 for ; Wed, 14 Jun 2017 19:08:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FA87268AE for ; Wed, 14 Jun 2017 19:08:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 347DE28520; Wed, 14 Jun 2017 19:08:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC6F9268AE for ; Wed, 14 Jun 2017 19:08:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751665AbdFNTIq (ORCPT ); Wed, 14 Jun 2017 15:08:46 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33761 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbdFNTIp (ORCPT ); Wed, 14 Jun 2017 15:08:45 -0400 Received: by mail-wr0-f195.google.com with SMTP id x23so1929851wrb.0 for ; Wed, 14 Jun 2017 12:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ouiJ3EJG89LktaibGop02V7SoZ8VaKg+mPNaHQZJTk0=; b=C4XdhBx3dw0Oi930N2pYjfD5N8smCFpw1doueA9rf8/W7Hi5Lsi11y4CGyXXaCM6FQ qTW39UVFDzS2IzT4mRLXFntw/oTcTh/X8xEgtjkd5vHgImUXJ14dtiHay98OXgut/bOk Mi0BzlQFxLUNLBQaRXM3Frhr+eEruanMwZX6TeVkkXPPuqof6OWLI9lwuSWcw62ln6J7 646JwdUHqe3NU/6/bldyB/xCMdIq+vkowC2TF0yjSPHZmJzCbKi9VfDZXd5/lEQ23sdP Hb5otD3xaq2X/BJuGaeXjhZONTF6wXEkapSN1U6sQ3rg5ohbB5MmWW0BLATsSSz4vgzS eXtw== 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; bh=ouiJ3EJG89LktaibGop02V7SoZ8VaKg+mPNaHQZJTk0=; b=Fh1yoEjYQzDGv514dZawPhzkeAy3AHazh0tOCY9rREt/bzvu/7oFD8Rzt2DfeEE3SU vNkSM4GMIvkQB+3qCkbFQFj/eEgJKE5qGFO2T+3859gwjdZg42FuNmfYIx5zZHCRE5+h LYTRexFdrotk8IAV71Dg9bhvB24gxz3f87B6q8U3mcDN7y4EEPzOa7vWBuJcDypOhg4z +vUmQXJVT1fqgHSZwNftAbbUp+Fb5GZLZm3oOopQ7BpDyqEqBFN7oHUmpxZodPWvBaOQ PswYzOsDb3eD41xeNp8GHNiRnaxRsCLCF0m5KmbBzZ39XB2FBnWTHfs8R8KM+H63ljUQ pALA== X-Gm-Message-State: AKS2vOy2pyhgdAqqQBsPjxvyZpEoj35LpGdG4Nizo1LxeR5e+s3eADIZ 0mDJfx8MeYaIe1BA5jY= X-Received: by 10.223.133.181 with SMTP id 50mr1149084wrt.27.1497467323547; Wed, 14 Jun 2017 12:08:43 -0700 (PDT) Received: from localhost.localdomain (188.29.165.87.threembb.co.uk. [188.29.165.87]) by smtp.gmail.com with ESMTPSA id m73sm1004549wmi.25.2017.06.14.12.08.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jun 2017 12:08:43 -0700 (PDT) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Malcolm Priestley Subject: [PATCH 1/2] staging: rtl8192e: remove dead private call to _rtl92e_ioctl. Date: Wed, 14 Jun 2017 20:08:24 +0100 Message-Id: <20170614190825.4125-1-tvboxspy@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A RTL_IOCTL_WPA_SUPPLICANT call is a proprietary version of wpa supplicant. All kernel calls use SIOCSIWENCODEEXT call via wireless handlers already used in this driver. Remove dead code. Signed-off-by: Malcolm Priestley --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 126 --------------------------- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 2 - 2 files changed, 128 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index a4d1bac4a844..aca52654825b 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -2275,131 +2275,6 @@ static int _rtl92e_set_mac_adr(struct net_device *dev, void *mac) return 0; } -/* based on ipw2200 driver */ -static int _rtl92e_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) -{ - struct r8192_priv *priv = rtllib_priv(dev); - struct iwreq *wrq = (struct iwreq *)rq; - int ret = -1; - struct rtllib_device *ieee = priv->rtllib; - u32 key[4]; - const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - struct iw_point *p = &wrq->u.data; - struct ieee_param *ipw = NULL; - - mutex_lock(&priv->wx_mutex); - - switch (cmd) { - case RTL_IOCTL_WPA_SUPPLICANT: - if (p->length < sizeof(struct ieee_param) || !p->pointer) { - ret = -EINVAL; - goto out; - } - - ipw = memdup_user(p->pointer, p->length); - if (IS_ERR(ipw)) { - ret = PTR_ERR(ipw); - goto out; - } - - if (ipw->cmd == IEEE_CMD_SET_ENCRYPTION) { - if (ipw->u.crypt.set_tx) { - if (strcmp(ipw->u.crypt.alg, "CCMP") == 0) - ieee->pairwise_key_type = KEY_TYPE_CCMP; - else if (strcmp(ipw->u.crypt.alg, "TKIP") == 0) - ieee->pairwise_key_type = KEY_TYPE_TKIP; - else if (strcmp(ipw->u.crypt.alg, "WEP") == 0) { - if (ipw->u.crypt.key_len == 13) - ieee->pairwise_key_type = - KEY_TYPE_WEP104; - else if (ipw->u.crypt.key_len == 5) - ieee->pairwise_key_type = - KEY_TYPE_WEP40; - } else { - ieee->pairwise_key_type = KEY_TYPE_NA; - } - - if (ieee->pairwise_key_type) { - if (is_zero_ether_addr(ieee->ap_mac_addr)) - ieee->iw_mode = IW_MODE_ADHOC; - memcpy((u8 *)key, ipw->u.crypt.key, 16); - rtl92e_enable_hw_security_config(dev); - rtl92e_set_swcam(dev, 4, - ipw->u.crypt.idx, - ieee->pairwise_key_type, - (u8 *)ieee->ap_mac_addr, - 0, key, 0); - rtl92e_set_key(dev, 4, ipw->u.crypt.idx, - ieee->pairwise_key_type, - (u8 *)ieee->ap_mac_addr, - 0, key); - if (ieee->iw_mode == IW_MODE_ADHOC) { - rtl92e_set_swcam(dev, - ipw->u.crypt.idx, - ipw->u.crypt.idx, - ieee->pairwise_key_type, - (u8 *)ieee->ap_mac_addr, - 0, key, 0); - rtl92e_set_key(dev, - ipw->u.crypt.idx, - ipw->u.crypt.idx, - ieee->pairwise_key_type, - (u8 *)ieee->ap_mac_addr, - 0, key); - } - } - if ((ieee->pairwise_key_type == - KEY_TYPE_CCMP) && - ieee->pHTInfo->bCurrentHTSupport) { - rtl92e_writeb(dev, 0x173, 1); - } - - } else { - memcpy((u8 *)key, ipw->u.crypt.key, 16); - if (strcmp(ipw->u.crypt.alg, "CCMP") == 0) - ieee->group_key_type = KEY_TYPE_CCMP; - else if (strcmp(ipw->u.crypt.alg, "TKIP") == 0) - ieee->group_key_type = KEY_TYPE_TKIP; - else if (strcmp(ipw->u.crypt.alg, "WEP") == 0) { - if (ipw->u.crypt.key_len == 13) - ieee->group_key_type = - KEY_TYPE_WEP104; - else if (ipw->u.crypt.key_len == 5) - ieee->group_key_type = - KEY_TYPE_WEP40; - } else - ieee->group_key_type = KEY_TYPE_NA; - - if (ieee->group_key_type) { - rtl92e_set_swcam(dev, ipw->u.crypt.idx, - ipw->u.crypt.idx, - ieee->group_key_type, - broadcast_addr, 0, key, - 0); - rtl92e_set_key(dev, ipw->u.crypt.idx, - ipw->u.crypt.idx, - ieee->group_key_type, - broadcast_addr, 0, key); - } - } - } - - ret = rtllib_wpa_supplicant_ioctl(priv->rtllib, &wrq->u.data, - 0); - kfree(ipw); - break; - default: - ret = -EOPNOTSUPP; - break; - } - -out: - mutex_unlock(&priv->wx_mutex); - - return ret; -} - - static irqreturn_t _rtl92e_irq(int irq, void *netdev) { struct net_device *dev = netdev; @@ -2542,7 +2417,6 @@ static const struct net_device_ops rtl8192_netdev_ops = { .ndo_open = _rtl92e_open, .ndo_stop = _rtl92e_close, .ndo_tx_timeout = _rtl92e_tx_timeout, - .ndo_do_ioctl = _rtl92e_ioctl, .ndo_set_rx_mode = _rtl92e_set_multicast, .ndo_set_mac_address = _rtl92e_set_mac_adr, .ndo_validate_addr = eth_validate_addr, diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index 0335823e2766..9d3089cb6a5a 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -102,8 +102,6 @@ #define PHY_RSSI_SLID_WIN_MAX 100 -#define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30) - #define TxBBGainTableLength 37 #define CCKTxBBGainTableLength 23