diff mbox series

net: ti: icssg-prueth: Add phys_port_name support

Message ID 895ae9c1-b6dd-4a97-be14-6f2b73c7b2b5@siemens.com (mailing list archive)
State Accepted
Commit f6e12277011d39a42e2c01fabb4222c09cb099fc
Delegated to: Netdev Maintainers
Headers show
Series net: ti: icssg-prueth: Add phys_port_name support | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers warning 4 maintainers not CCed: dan.carpenter@linaro.org robh@kernel.org rogerq@ti.com andrew@lunn.ch
netdev/build_clang success Errors and warnings before: 9 this patch: 9
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 26 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jan Kiszka Oct. 22, 2023, 8:56 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

Helps identifying the ports in udev rules e.g.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Seems such logic was lost during the upstream rewrite of the SDK 
version.

 drivers/net/ethernet/ti/icssg/icssg_prueth.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Jacob Keller Oct. 24, 2023, 12:11 a.m. UTC | #1
On 10/22/2023 1:56 AM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Helps identifying the ports in udev rules e.g.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> Seems such logic was lost during the upstream rewrite of the SDK 
> version.
> 

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
patchwork-bot+netdevbpf@kernel.org Oct. 24, 2023, 8:40 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Sun, 22 Oct 2023 10:56:22 +0200 you wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Helps identifying the ports in udev rules e.g.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> [...]

Here is the summary with links:
  - net: ti: icssg-prueth: Add phys_port_name support
    https://git.kernel.org/netdev/net-next/c/f6e12277011d

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
index 4914d0ef58e9..ffae89a6ccc5 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
@@ -1653,6 +1653,19 @@  static void emac_ndo_get_stats64(struct net_device *ndev,
 	stats->tx_dropped = ndev->stats.tx_dropped;
 }
 
+static int emac_ndo_get_phys_port_name(struct net_device *ndev, char *name,
+				       size_t len)
+{
+	struct prueth_emac *emac = netdev_priv(ndev);
+	int ret;
+
+	ret = snprintf(name, len, "p%d", emac->port_id);
+	if (ret >= len)
+		return -EINVAL;
+
+	return 0;
+}
+
 static const struct net_device_ops emac_netdev_ops = {
 	.ndo_open = emac_ndo_open,
 	.ndo_stop = emac_ndo_stop,
@@ -1663,6 +1676,7 @@  static const struct net_device_ops emac_netdev_ops = {
 	.ndo_set_rx_mode = emac_ndo_set_rx_mode,
 	.ndo_eth_ioctl = emac_ndo_ioctl,
 	.ndo_get_stats64 = emac_ndo_get_stats64,
+	.ndo_get_phys_port_name = emac_ndo_get_phys_port_name,
 };
 
 /* get emac_port corresponding to eth_node name */