From patchwork Fri Nov 6 22:17:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 320870 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1674628ilc; Fri, 6 Nov 2020 14:18:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJxR+CdvKngG66D3KHVTfMW2tuKJuvq3WeClRnIdqSINuJ4hAG7sy2re4jansIsh5haSZKFw X-Received: by 2002:a17:906:944f:: with SMTP id z15mr4430911ejx.111.1604701129609; Fri, 06 Nov 2020 14:18:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604701129; cv=none; d=google.com; s=arc-20160816; b=BqY+l6ia2kGTaXJgOmPBekR7YQJXrOxW0UDPelt0WQ8RnrNwhCqgt6fe8+HQfAP/RE qxX+ycYatUR/kAMV6i/go7sTLZmjRWxMvOPOB6z0M/LdP4wDLEm6MHvG/Pnd5Q1nFF0I dqn50JO0V+LCxzcudbw3DA4kNLcooCIjkcoPk+YWJNcI0XbQ1X/mYqaOtseHG7rw9nf6 rqeoCS6EmSGdAO4LdbJSuklze6927Y3aKpFVdK7w1MNWgC/nZFArL/uXvYfipMNryMeO j20OPVdREqoFMXR1j7DPW6uzIhaHQ49cbpfpzmfmu5vC808Y7EZzIDpJuXahtms+dTmE swRQ== 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=gJEUdzfswoDqVUzgtKAWpc6lfFSDBLSdw2zbNRWmxF4=; b=M0nlTpu/qJloj0c3wFAddXzgM0Tnf1J0h64unuNm9aeBeMK6mZDPADum5DAvd6n2DL gNWjnAz/UulVF8iH7RGek+CN2UwRTfh3ObPwtqFZJ4a1wx2A++An2fPgeATSQvh6bkxv CopPCnBHuW2nRTbcsxAYS9lZpALkjwzfmFFXMmfcFp5WKAJl1ULKj1WdR8gDjvmVs7W8 IsL2vBtDQyAaqCNzVPKDA0MUdHi3/85q6O0nv70HiDfHq2tpt4DEEmFd6HuPmmUEGVdR ZE+Fi/btqp+ldlFNm4J1aNPE4NEVj29N8d/TxLsXassTEsTJhGnjCazZbm3HWNupQFe+ GLzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uVkT2rV+; 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 dk1si1624898ejb.556.2020.11.06.14.18.49; Fri, 06 Nov 2020 14:18:49 -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=uVkT2rV+; 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 S1729082AbgKFWSr (ORCPT + 2 others); Fri, 6 Nov 2020 17:18:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:42220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729049AbgKFWSq (ORCPT ); Fri, 6 Nov 2020 17:18:46 -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 84A8320B1F; Fri, 6 Nov 2020 22:18:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604701125; bh=quYL6FmY9NRqROBT7gD89RdIR4mWBVj5mvB8k4ghwsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uVkT2rV+ZZT8ggUQJXoUIn5wGJbOSDXoR0riPdF5VpQNgUs0rm8nAK2xhnjcj2+Jh 89cGeNC9su/aAcdfEYlzDhyIFeeYoAwgYme3lMgV7MGsw2axEx44564aq2qTQDGbv4 tM3+v8w0ekwBHLWs19yiX2m9XdxkpWf7ku35ctsQ= 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 18/28] cxgb3: use ndo_siocdevprivate Date: Fri, 6 Nov 2020 23:17:33 +0100 Message-Id: <20201106221743.3271965-19-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 cxgb3 has a private multiplexor that works correctly in compat mode, split out the siocdevprivate callback from do_ioctl for simplification. Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.27.0 diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c index 84ad7261e243..c79a70d370bd 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c @@ -2135,13 +2135,18 @@ static int in_range(int val, int lo, int hi) return val < 0 || (val <= hi && val >= lo); } -static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) +static int cxgb_siocdevprivate(struct net_device *dev, + struct ifreq *ifreq, + void __user *useraddr, + int cmd) { struct port_info *pi = netdev_priv(dev); struct adapter *adapter = pi->adapter; - u32 cmd; int ret; + if (cmd != SIOCCHIOCTL) + return -EOPNOTSUPP; + if (copy_from_user(&cmd, useraddr, sizeof(cmd))) return -EFAULT; @@ -2546,8 +2551,6 @@ static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd) fallthrough; case SIOCGMIIPHY: return mdio_mii_ioctl(&pi->phy.mdio, data, cmd); - case SIOCCHIOCTL: - return cxgb_extension_ioctl(dev, req->ifr_data); default: return -EOPNOTSUPP; } @@ -3181,6 +3184,7 @@ static const struct net_device_ops cxgb_netdev_ops = { .ndo_validate_addr = eth_validate_addr, .ndo_set_rx_mode = cxgb_set_rxmode, .ndo_do_ioctl = cxgb_ioctl, + .ndo_siocdevprivate = cxgb_siocdevprivate, .ndo_change_mtu = cxgb_change_mtu, .ndo_set_mac_address = cxgb_set_mac_addr, .ndo_fix_features = cxgb_fix_features,