From patchwork Tue Jul 20 14:46:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 481532 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5235864jao; Tue, 20 Jul 2021 08:25:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbzdi/iMU5ZjvegUNKcBKDv6WcVLBEd7IprytzIQzbKW73HL9UqKgWaLk5XLwywBP/aNml X-Received: by 2002:a05:6638:58e:: with SMTP id a14mr22161675jar.81.1626794723034; Tue, 20 Jul 2021 08:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626794723; cv=none; d=google.com; s=arc-20160816; b=rzbqARuUx6cjoxslT0rk4IBz6jxVecrLebnui3zIrdd/sTfQ86YkHOzgM9I37spQWz 1s0KMx+hwZXTcT7n9CZ4LWi03bPXpiPyY8skTSD2Oes3pWqS3N6JCIunl4qqchRBMmeU /n4JL3ZB1BwOaDCqq/k/6pGe9U1/tpPBcTIXLDjjxkzm958ej2Ee4Sa90zFx74Q/4ZH/ Rj4/UelhqGyoakZr5ybCUPYqTwYyxS6DArLTIU9lJaybwyaPFZ2muSIafW8kN9qCiRdr A7fkNtP490PFiS37No4fpTH0O8UMktDVI6ZCiJxlIoHXnjH9QGdH9MWdKjMY4M+0FupL FDnQ== 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=YU0YMOOnjLNka9qH50/N6bcCdonqc9Jk1TwUaHy4JQI=; b=JR0GJd5v3lG5XJjFuf1BMZe0Xz28PKAmbeZ9PVjFnLRcONOZ6mAdObVzlD7CgU/Z3y MnGch+Dlr1LziqlZgz4SA0PTQDo6JSP7QSVmrUsny8U6Ty7QEsyJil6+4d8hUVqjcgTK qPWlI3wR3USEBsJeDiat0BUF5abDbJKdCqu8+Bd2TbFFCaSenYJJpl/LFrPSbnKzVbzh OIDgmdZcWF7xJ+CP92CYnU35O8E6CpR6Bmcly9CKu6BCFU2bKD8OJoV24GyPr5Mx7UkU QDYj6pP4vv705N9id8MevmgakC/gfalOqJOnaIC5gSS6GnZpwG9gszWIFE6WjxR/a5be LFCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IryJOydO; 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 o7si26753193ilc.64.2021.07.20.08.25.22; Tue, 20 Jul 2021 08:25:23 -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=IryJOydO; 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 S240895AbhGTOjf (ORCPT + 8 others); Tue, 20 Jul 2021 10:39:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:56540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239389AbhGTOSs (ORCPT ); Tue, 20 Jul 2021 10:18:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8BCED61261; Tue, 20 Jul 2021 14:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626792432; bh=MokSFCS5JrXKi1chobZfy7AwPWjSQNG0YkiIkPBUgBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IryJOydOALve6xiLLUickqNEhgXEbZyvsurw6WOclS44DDUb4cFpxROAiELNzXIun HbmSaDmeILo+gswpZKTn/xS9wlz8Z18koT0agxYiEAooG/wvPAaSYgspA11JG9zh2H hN6jriQ/f47z+Wv4zljtRjXSDB22U9dPf2DBZBe6AoWzKSBw9ffIEwaCZ/4dyvIdsW 1Aeb4tCn65ZnA0Z2Ww/+Q7Hk3KKFsP3vGypGX13ikR3vMw6NNOq1WjDAzymy3VrYRm /dKS4hXpu1Fi37CALd9AAVFznJPVeau45Vnnup4BkQC5hN/yUeEnYJBH7VS3xeKk6F e8U49Z+KuHFqQ== From: Arnd Bergmann To: netdev@vger.kernel.org Cc: Christoph Hellwig , Arnd Bergmann Subject: [PATCH net-next v2 17/31] cxgb3: use ndo_siocdevprivate Date: Tue, 20 Jul 2021 16:46:24 +0200 Message-Id: <20210720144638.2859828-18-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210720144638.2859828-1-arnd@kernel.org> References: <20210720144638.2859828-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. 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,