From patchwork Fri Nov 6 22:17:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 320869 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1674588ilc; Fri, 6 Nov 2020 14:18:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNC427nv2J9aeSK1xybE2YUTOpyQ962p9QrX/VHw1CEW0YfoAVm4vs8uH4noHbIxSG+bOI X-Received: by 2002:a17:906:32d7:: with SMTP id k23mr4178275ejk.294.1604701125447; Fri, 06 Nov 2020 14:18:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604701125; cv=none; d=google.com; s=arc-20160816; b=VZbiWtyfyECmS0icPMFIZbpEzK2HPnbaltfCUj3wjQexNA+20jOOv/Nnky1NqDttPg /xVuDbdSSJfQlQDvNvmCIGQNQzjh5RrCLyhJv1AuU04f1b9TmOy8IKXO+eGU2S6A/3NX HTD4PZMXwoas1jhATbVcyOdDEL1F+WgSv8p4zY2soBmz3f++NV6ENNG8F9weTbGgvWXi nAqbfTgGXMKjsaoOjO+jwi0nwJklM3rz684mruGqIDFH0SZI/wh+nvlXPHtPDxIAcfd1 DttZBRVDCfhZ/hK7L88AQHs/BZW0+yIiqE1AP59nydat5ZiW55KUm1U27jnFLctggT9j 8FWg== 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=npXLWZC2HCpkmXjLMKyqny6jm7DR+Hxl1OR/t8R9gXE=; b=tShyG2g+78FhuKH0sX8LD092Vx3Hlf2xO9tbz3GhTD1KlA+3Mj7a+zaSLcJrrafqV1 v3BkgJx6IrU1JsdHSmaxqlIaYT9FIj2VFzJ/4rAV8ShsauyuH+8lUj0fNlqkVsW0g3J4 05/GZ99NTTkvl/I3/VmNnf2lSilAx8ysUkOiNyN/7MqMUBcjLO/2St5uL8vZ19l/GSOY 6VqmzaQOFG/h7gAt99WEQ39aq5fZPwWWg6Pf7ddpAfq0Czfc6SJM0+9wB28XjzBcQojG VaoEEAURAYuHIAZa7W3mSj63Mqj+ZtGi1lisJeClKF2JgYf41R6BrQrLGKJ68pANTdrg SXVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TbTQSTmH; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci4si1848008ejb.436.2020.11.06.14.18.45; Fri, 06 Nov 2020 14:18:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@kernel.org header.s=default header.b=TbTQSTmH; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729061AbgKFWSo (ORCPT + 2 others); Fri, 6 Nov 2020 17:18:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:42002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729049AbgKFWSi (ORCPT ); Fri, 6 Nov 2020 17:18:38 -0500 Received: from localhost.localdomain (HSI-KBW-46-223-126-90.hsi.kabel-badenwuerttemberg.de [46.223.126.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1DC1421D81; Fri, 6 Nov 2020 22:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604701117; bh=/cpDjwa8dOkb01yFtUHo3+36yqs3G0WmNes6UhKpcxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TbTQSTmHZ0f7QKkEEQGaFRuwKQy1MxygJVIz6jojqveklKc4+zOzk9u3OWxiBvSSq 4Uudn8oPtMe4nsAthvwJKH6FjYr4nluegVUd/PmHn9cNTSzJqu9jX0yIOAAkKX9hQi r2tYL6RbzFOcphYfGdo5Dxv0xP2zBr/GLGZxgr8w= From: Arnd Bergmann To: netdev@vger.kernel.org Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, bridge@lists.linux-foundation.org, linux-hams@vger.kernel.org, Jakub Kicinski , Christoph Hellwig , Alexander Viro , Johannes Berg , Andrew Lunn , Heiner Kallweit Subject: [RFC net-next 15/28] net: usb: use ndo_siocdevprivate Date: Fri, 6 Nov 2020 23:17:30 +0100 Message-Id: <20201106221743.3271965-16-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201106221743.3271965-1-arnd@kernel.org> References: <20201106221743.3271965-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Arnd Bergmann The pegasus and rtl8150 drivers use SIOCDEVPRIVATE ioctls to access their MII registers, in place of the normal commands. This is broken for all compat ioctls today. Change to ndo_siocdevprivate to fix it. Signed-off-by: Arnd Bergmann --- drivers/net/usb/pegasus.c | 4 ++-- drivers/net/usb/rtl8150.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) -- 2.27.0 diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c index 32e1335c94ad..7cc0727eee1a 100644 --- a/drivers/net/usb/pegasus.c +++ b/drivers/net/usb/pegasus.c @@ -988,7 +988,7 @@ static const struct ethtool_ops ops = { .set_link_ksettings = pegasus_set_link_ksettings, }; -static int pegasus_ioctl(struct net_device *net, struct ifreq *rq, int cmd) +static int pegasus_siocdevprivate(struct net_device *net, struct ifreq *rq, void __user *udata, int cmd) { __u16 *data = (__u16 *) &rq->ifr_ifru; pegasus_t *pegasus = netdev_priv(net); @@ -1246,7 +1246,7 @@ static int pegasus_resume(struct usb_interface *intf) static const struct net_device_ops pegasus_netdev_ops = { .ndo_open = pegasus_open, .ndo_stop = pegasus_close, - .ndo_do_ioctl = pegasus_ioctl, + .ndo_siocdevprivate = pegasus_siocdevprivate, .ndo_start_xmit = pegasus_start_xmit, .ndo_set_rx_mode = pegasus_set_multicast, .ndo_tx_timeout = pegasus_tx_timeout, diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index bf8a60533f3e..bb37fb24f7d7 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c @@ -822,7 +822,8 @@ static const struct ethtool_ops ops = { .get_link_ksettings = rtl8150_get_link_ksettings, }; -static int rtl8150_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) +static int rtl8150_siocdevprivate(struct net_device *netdev, struct ifreq *rq, + void __user *udata, int cmd) { rtl8150_t *dev = netdev_priv(netdev); u16 *data = (u16 *) & rq->ifr_ifru; @@ -850,7 +851,7 @@ static int rtl8150_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) static const struct net_device_ops rtl8150_netdev_ops = { .ndo_open = rtl8150_open, .ndo_stop = rtl8150_close, - .ndo_do_ioctl = rtl8150_ioctl, + .ndo_siocdevprivate = rtl8150_siocdevprivate, .ndo_start_xmit = rtl8150_start_xmit, .ndo_tx_timeout = rtl8150_tx_timeout, .ndo_set_rx_mode = rtl8150_set_multicast,