From nobody Sun Apr 5 21:29:49 2026 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34A1A29A326 for ; Tue, 24 Feb 2026 04:32:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771907537; cv=none; b=byDqp11p8FetP774jNqwsh5rGXfm00Fri/8V1U/ahwBgM69n5hT8AEbMUuMqF061HhXS8eLaC+il2743vAiZcnJa5ZqCHD0j8sNSYPoJ31cnYezTRx1W075C60hFvfCJCyKJWJGyfc2pdpiqZIOcbIrWsYFzIuwcQw/auk97UnM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771907537; c=relaxed/simple; bh=b1xLgounYgAgwix7HTIz89qnAwlJn9qu3/e7SYKIiwU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W2BwKredB4N4SDPHDIhb/FwPu94/ayi3sjWAuErI0DOtRW3iX0Gutl+okApxAJEkupnB6hDgS9UhNbVTCywi/M1QsZKjpA9B4YNRxptoEOpK/FTNhQUwZcrClGoSLES8wEUb/572qPUs6wHKyy9/sLIPGBuJiBpTzKCjzb+dHpY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TdGPyQGd; arc=none smtp.client-ip=209.85.208.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TdGPyQGd" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-65c5a778923so7727065a12.2 for ; Mon, 23 Feb 2026 20:32:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771907534; x=1772512334; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=siyGLrMfYzfWpKFoliNweeMXGBRAFWTpZWYm7LAc1oE=; b=TdGPyQGdK3oSwAxxSiYzeVbtxiTigeB7wXXSHcKB/tzEtFkT33s8Hz3Cvupio/4+fr klYvKDU21KGDIAdLOCNqIxt4rHBw/yYG9r7OiXJObMaVQlUf2QKynR0yaHlGaAoXGrkV yW0Kz3GbEWjdrkhM2kE3gBnJEYsmR1GBNi8I1P1DCasNmF+lG7qWkJEMu5r4wdwfxY6l g+hsLmT3nyiEtJ9U/agFw/e/6Bv1NTOArq3MEKjZ2n5JFC6v0QrCgBRHNYnpnmZubgS7 p8+xgrVFMyUxMcQ9jF99lnJM8BN90nQeBTbBCtpBtiAJpV9iOGt6gcAcrZgisRW0gH4u pKpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771907534; x=1772512334; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=siyGLrMfYzfWpKFoliNweeMXGBRAFWTpZWYm7LAc1oE=; b=TC1cxt88s4PLyzL2UvpdxF5kNoJm4af5sRMN9ybxy6KFVp8voh7DNuVzl0BDI4cB2X 95F+UaUo0yl4WMpFlJp5ilJoA9jCA2XNkiua+1AgcYl80T6yrEph1ig79De3RigQVa9O LV/Xv56p6+gjHXsmHe9uYRwlqBVQCDcFeknYL+o2EHL3BF/Ym+Fdc6EchLcHV3xts6Gf IxZ0xhGOUdlsu7eNrmT02VRnQhOCzvkV/qK4GNx/TCqObTuPf3cnhdu8Nu3ipE7SrOuP MY004871Q3lEC95TCDDc4Zy2IldaRCbbJnt5yEUCaoWE74pKHfD9BqeqKfg2UHT9bXbR w/eQ== X-Forwarded-Encrypted: i=1; AJvYcCXTQ8p9y7AZp3pXqJtppzc2fJrgCtVu5n2OGIwENXkOj1WvY+lu8Y/KspdKG/X44UDUGdnA0EHVHf1U62o=@vger.kernel.org X-Gm-Message-State: AOJu0YwiqfVMM72rqcM9ylb/rKy6YnYDDGz9ggt/UbUURtgX4nHP1mFM nhivQMIAfC1ayqa8fIrokh0i1v4tD+KxpAqoH4zczwYo15Av/I3dEqDt X-Gm-Gg: AZuq6aIKeQRpUqwRU1CFaFRkuGYyi/CdTqvJIllOWFrSLZsSyoq0WPaW4bzfR9YhcMo GXilOhVziHJMRE30MKin3CSVhYDOLOfJvdstUTyL5pliikn4EGgv8xwIJLTfkxFqlJeimspoTpR LhTnX5l9I5PSBamvUZrTrInNH29aPXPJlL8oORVOUY1/7Ix7C2X/TLONqK+Qiz4JWhC+dSq7ncb WSywd5mWtCj4vhwQCa1Rn7BcafcaGI9Hw5LcaEPsyizFmRCtZh0Tq7CLyTKyjCCkaCn/mXFUOEx EAhgDEoAR5a74VfqQcNmUqF6maYuwG1dQ8W1hLGjpxX+ah6rwfAw5nQwG3Ss7Y71CrkTgtsDejg Bi8AbIxhfKQyEbQa1P8TKlkaRYmPzUDAp8+ub7rSlRiEAs/DjkaBgjFi3YawNxYkIxU6Dyiqrqe caKNWXtHFJO8kLhlxuXv9ELJd4Ud4cTI5nkEIjhtmT05CSQfSNi3dQtShFxIgz9GZOPCxhaluRq OkS0PbORL0+xaYIYvXnVHIy5iwYV52gcLXusQ0hp2yN8cJeGDdxUkMhOIVLrZL4Hl3MwjUSqA== X-Received: by 2002:a17:906:9f85:b0:b8e:d4ed:5eeb with SMTP id a640c23a62f3a-b9081a45252mr723264366b.26.1771907534454; Mon, 23 Feb 2026 20:32:14 -0800 (PST) Received: from cs-874966990260-default.europe-west4-b.c.i2f7e30109524dc12-tp.internal (206.242.32.34.bc.googleusercontent.com. [34.32.242.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b9088c8fc30sm371284466b.63.2026.02.23.20.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 20:32:13 -0800 (PST) From: Artem Lytkin To: FUJITA Tomonori , Andrew Lunn , Heiner Kallweit Cc: Trevor Gross , Russell King , Miguel Ojeda , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Artem Lytkin Subject: [PATCH net-next v2 2/3] rust: net: phy: expose genphy_config_aneg() Date: Tue, 24 Feb 2026 04:32:10 +0000 Message-ID: <20260224043211.1747-3-iprintercanon@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260224043211.1747-1-iprintercanon@gmail.com> References: <20260223220504.2102-1-iprintercanon@gmail.com> <20260224043211.1747-1-iprintercanon@gmail.com> 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 Content-Type: text/plain; charset="utf-8" Add genphy_config_aneg() method to phy::Device, wrapping the C function __genphy_config_aneg(). This is needed by PHY drivers that perform custom BMCR configuration before calling the generic auto-negotiation setup. The wrapper calls __genphy_config_aneg(phydev, false) directly since genphy_config_aneg() is a static inline function not visible to bindgen. Signed-off-by: Artem Lytkin --- rust/kernel/net/phy.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rust/kernel/net/phy.rs b/rust/kernel/net/phy.rs index b86939b163e3..01597f2616fd 100644 --- a/rust/kernel/net/phy.rs +++ b/rust/kernel/net/phy.rs @@ -284,6 +284,15 @@ pub fn genphy_read_abilities(&mut self) -> Result { // So it's just an FFI call. to_result(unsafe { bindings::genphy_read_abilities(phydev) }) } + + /// Configures the advertisement and resets auto-negotiation + /// if auto-negotiation is enabled. + pub fn genphy_config_aneg(&mut self) -> Result { + let phydev =3D self.0.get(); + // SAFETY: `phydev` is pointing to a valid object by the type inva= riant of `Self`. + // So it's just an FFI call. + to_result(unsafe { bindings::__genphy_config_aneg(phydev, false) }) + } } =20 impl AsRef for Device { --=20 2.43.0