From patchwork Tue Jul 27 13:45:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 486712 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp232317jas; Tue, 27 Jul 2021 06:47:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYOG5T/ZulGz2g2LuFLhiGzKnM1yz0zayr0km6KAGqp4+xUkvJO/k8H0CkTSmuYUDn2WFc X-Received: by 2002:a05:6402:280e:: with SMTP id h14mr28812608ede.357.1627393625108; Tue, 27 Jul 2021 06:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627393625; cv=none; d=google.com; s=arc-20160816; b=cpqip5rFoxXZPappvI6RS+UEAGnBPX+wlUqr6MMKf4evV9DOQBeAEhR2JDMsQCvwrM CbOVHEPHZBy2uwPsMmKF5TtoUIFdng6kVHn4KMIijRizio5XZydBnMSHiUy/8Bsmp3K2 N04ZueQRscMkPu5ZRx1Vf9eeqnUZybTC0YYd7BF8KUDloS3VIK/2JIm87STezbxBYCwK RqX4VosjWsvw1kMOu/QQle7iJptkl4+KwzztL4ShUS0QBC+DB9KT2mEItYJQTsWfaYnl fiSGmawGmdZVbc6cPtstEGnzlRtrFfQxL461UdwOxydAdjxfG6PcDUe5+KZIs1N9N/o9 W69A== 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=5abQE6MoLpPafmksf2sAxp2Axu55zz5E/io1B5uaNuI=; b=079D9Vnnf1DXRyP5xqRAFch9ZXT5xn7DrCXXHBZWEEzV0CXy1J6WpGiGXJQqgnDFMD mriIICrcdlbUvVFtwOLACKSoFNoOHCPCclHcwUo/iixGLPopbrmWnspfcKqmWgJF4GyW LptgJiawsIbnxyCL1lnfsEQEzr5PGQc/2NdcSA6zRjuOaf9GSch0U4linXZx/sXe/2cq LCqSItCoxpVP1ezr6+xzHJ4obMQONgYzHEnt2yWUHSQJFdihkJUxvQUbmu3gJ6M28Cu2 7pqhLWQsOx1G72jVVNeOl8ancwmtfvoFIMwGc8kTkqS5DPp05D7fKSBENIEoS6CE0H/p 52DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iZ8jf5tf; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 eb13si155740edb.405.2021.07.27.06.47.04; Tue, 27 Jul 2021 06:47:05 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=k20201202 header.b=iZ8jf5tf; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S237324AbhG0NrC (ORCPT + 8 others); Tue, 27 Jul 2021 09:47:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:46836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236985AbhG0Nqa (ORCPT ); Tue, 27 Jul 2021 09:46:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6381E61ABB; Tue, 27 Jul 2021 13:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627393588; bh=2JsZiWZJESDfLBgY4ct1aeoV1nqlOgPxfgz9I7TduX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iZ8jf5tfE85K8mNNfU2quSTxOujp0k1hxZS4ENX0HvFcYHSuQ5bHHjzgT4CX9tdeH C07rX3CQ6DMD+BPYGOHeQmJZFKk/TZ/qhrrlHp475BoLWzXGWoyZ9gDuUnXEzxxc7Y ointhfXoW+VvTnUPTcarB7GS99UjjvRHUn7BtSo7ZbpWo0dE35eAccB6Mg0jCrIgI4 s97vaxy2yA0uICsdQsrd26R61Kyp3zo6qaMm5i+55dSpTpB7xH+QvHGFuAFniK+UFd ng2Z/+8YNn3GObUgbI5AhwBsYUig6sm/b/eyNMP1tPO0hoj2SCuYqUbdb7wc0xHsyu RyAy4e8mTf/Sg== From: Arnd Bergmann To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Arnd Bergmann , Raju Rangoju Subject: [PATCH net-next v3 17/31] cxgb3: use ndo_siocdevprivate Date: Tue, 27 Jul 2021 15:45:03 +0200 Message-Id: <20210727134517.1384504-18-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210727134517.1384504-1-arnd@kernel.org> References: <20210727134517.1384504-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@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. Cc: Raju Rangoju Signed-off-by: Arnd Bergmann --- drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.29.2 diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c index 57f210c53afc..eae893d7d840 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; } @@ -3182,6 +3185,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,