Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1343924lqj; Mon, 3 Jun 2024 20:10:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUzE8e9ejVZlqrjQIo74u9xzMqwQCbh7QVDnB3WrMiRLqn/vbqzDDrZyTs4ohqcz2WSD63Bf5M+bwavZfwytBYVSOnVqMJz8lTHD/Hy1Q== X-Google-Smtp-Source: AGHT+IHT6y9CyM82yj1yy2EKAhIlX0DYJvBzGFFOb6tgJaqwXA5wqv75hCdaTcLcApaVUZ7cTkL6 X-Received: by 2002:a17:902:f68e:b0:1f6:8466:e4ab with SMTP id d9443c01a7336-1f68466e86dmr35684495ad.36.1717470641732; Mon, 03 Jun 2024 20:10:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717470641; cv=pass; d=google.com; s=arc-20160816; b=zYXF9eLd0lSW9Zai3mL+bMuq0AfvLom/GoS4Wn2mqc52eI4bWbyaJo7Nns6N9AjLxQ /CjGfJLyg+PmUijHv5pZ4c1Xi/MGLKUWbYspbs7gzwgEtxOmShxSTRzaGYs2eOBNePDa 4fehPwckeV//DHExbs8USX4K4BTqZX/lPwrCkTs6fNiwhfy9nglRmOf9df+8fvAZASpe zXQlqL04qNBY6+IxxdFeokBJgYLBjQnY0wJh/vZi2wJuYW22fymLxoMfIiC76qZgdf5p nCr0vd2DbrnoZDd3W6oS9hlfzbCIK3Ce365Wi+St8+acA5OckSDOkAt/edqlY0pnEC4g CXMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=pnm4VvNxff61Xbs7PCXNlnP5w/sI2C5GXRKzsvs5upk=; fh=ZDJBzWpL0TGOInwnKYjO//c2ZiTI4ZRUzO+iWoL5DmQ=; b=fWEcrqkRU4H9r2BFafFwuMbUnwaIR9Be74HG6F8A1fYfV5j06829lvg6yMYfWxYx2M YrNCit4m6zZtPlMXKNgYjf22Y1jN0aSNVxltIUrWToexCbZeyKTvpoC3TTN08aAbsrK6 tpTriBu5zKOrQJneqTSB5nXSmjjbyTp6u05zqy6r/rO2f4e6pAo28RnG5IJ4KQOEQQVJ 0LnRmpXq8fqvpMBuaKmr9D8o2iq4O0LRqOxmGgkkKIDiC9FKVnUuSuo8PywA9fVLn8ZL ugUpHbL/BglHmAWudz4m/N4Gw9/ZMBWavRaE3yxx4juXsmO/C7llZFnBbsVCwpfIveEw 1IXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=0mQwofby; arc=pass (i=1 spf=pass spfdomain=alliedtelesis.co.nz dkim=pass dkdomain=alliedtelesis.co.nz dmarc=pass fromdomain=alliedtelesis.co.nz); spf=pass (google.com: domain of linux-kernel+bounces-199975-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199975-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6324168d9si73574535ad.563.2024.06.03.20.10.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 20:10:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199975-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=0mQwofby; arc=pass (i=1 spf=pass spfdomain=alliedtelesis.co.nz dkim=pass dkdomain=alliedtelesis.co.nz dmarc=pass fromdomain=alliedtelesis.co.nz); spf=pass (google.com: domain of linux-kernel+bounces-199975-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199975-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=alliedtelesis.co.nz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5906F28A344 for ; Tue, 4 Jun 2024 03:10:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1CDA13D62E; Tue, 4 Jun 2024 03:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="0mQwofby" Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE61322066 for ; Tue, 4 Jun 2024 03:10:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717470628; cv=none; b=UJcZqlHRPnqb9KPvT9w2COWLSAVIlayL6yzrusRlUqsPw6HedHxuvmeUdf1Rkm9KZEqxiicpjBWJ7z13qvx2u3im7F/HGCUTBWduI+gTeMUKE6yWhb8ru4PnVsSG5qJuPrwke/eycV4dU75d+PJwskJ+Z3qhjxxigsmTNoKcjrs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717470628; c=relaxed/simple; bh=r/KulotwnindLZundgEfHdVGhEAYwldtPiohbaSnvcE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nEMsx59eHp8HnfCMT2V5JgFEI81++0bKl70CUWKfDXRjC9yDHlEQk3OgRfxBwIqsscbw/GPHITF5w+XkBFbiB50u+0ALymvP73aCo1U6oln60Qgzo7rMUEWVg8udlYC4GcTXKXCOPD/g1TO5UkX/HCmC3Omke7fT+eTXl6R6RUg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=0mQwofby; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 42A042C0304; Tue, 4 Jun 2024 15:10:22 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1717470622; bh=pnm4VvNxff61Xbs7PCXNlnP5w/sI2C5GXRKzsvs5upk=; h=From:To:Cc:Subject:Date:From; b=0mQwofbyDlXjFvSFo8IKIOVNmtmWIo13N0QwPgW6heK55zxL6uzFRiOVCe7v/dN50 GDfnp5mbUxoapQ/oTcdyr53F7JWnBWMq4ioi5LNDUyB6Vn8jFmV7yB8+elZc/T6iOg rQxtpum0U3HblpWaDAqFUyGW0+EiQmXosyeUyp6hSBsv8rbRoJpnS1d+RvcoLX6o2a cRaAJGf3oG4ECnQIw+ZJ+FkKdpYDr0ZhtWTqRmnqsiY1HFBFjY3W0/VbxooibhMxxt j37b8yr2lP24z/XbUwI8oWrpJ4ZuxvWl0AJMX3Pe+gaEVqkjmo9gQy6n0wJnuNfigI HM0XDx1c7M+tA== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Tue, 04 Jun 2024 15:10:22 +1200 Received: from jackiej-dl.ws.atlnz.lc (jackiej-dl.ws.atlnz.lc [10.33.25.29]) by pat.atlnz.lc (Postfix) with ESMTP id 0FD8713EE2B; Tue, 4 Jun 2024 15:10:22 +1200 (NZST) Received: by jackiej-dl.ws.atlnz.lc (Postfix, from userid 1927) id 08F1A1C0747; Tue, 4 Jun 2024 15:10:22 +1200 (NZST) From: jackie.jone@alliedtelesis.co.nz To: davem@davemloft.net Cc: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, kuba@kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, chris.packham@alliedtelesis.co.nz, jackie.jone@alliedtelesis.co.nz Subject: [PATCH] igb: Add MII write support Date: Tue, 4 Jun 2024 15:10:20 +1200 Message-ID: <20240604031020.2313175-1-jackie.jone@alliedtelesis.co.nz> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SEG-SpamProfiler-Analysis: v=2.4 cv=F9L0dbhN c=1 sm=1 tr=0 ts=665e859e a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=T1WGqf2p2xoA:10 a=YmqHs4GwyjAq34ObVysA:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat From: Jackie Jone To facilitate running PHY parametric tests, add support for the SIOCSMIIR= EG ioctl. This allows a userspace application to write to the PHY registers to enable the test modes. Signed-off-by: Jackie Jone --- drivers/net/ethernet/intel/igb/igb_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethe= rnet/intel/igb/igb_main.c index 03a4da6a1447..7fbfcf01fbf9 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -8977,6 +8977,10 @@ static int igb_mii_ioctl(struct net_device *netdev= , struct ifreq *ifr, int cmd) return -EIO; break; case SIOCSMIIREG: + if (igb_write_phy_reg(&adapter->hw, data->reg_num & 0x1F, + data->val_in)) + return -EIO; + break; default: return -EOPNOTSUPP; }