Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: ti: icssg-prueth: Add phys_port_name support

Helps identifying the ports in udev rules e.g.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/895ae9c1-b6dd-4a97-be14-6f2b73c7b2b5@siemens.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Jan Kiszka and committed by
Paolo Abeni
f6e12277 169e0a5e

+14
+14
drivers/net/ethernet/ti/icssg/icssg_prueth.c
··· 1659 1659 stats->tx_dropped = ndev->stats.tx_dropped; 1660 1660 } 1661 1661 1662 + static int emac_ndo_get_phys_port_name(struct net_device *ndev, char *name, 1663 + size_t len) 1664 + { 1665 + struct prueth_emac *emac = netdev_priv(ndev); 1666 + int ret; 1667 + 1668 + ret = snprintf(name, len, "p%d", emac->port_id); 1669 + if (ret >= len) 1670 + return -EINVAL; 1671 + 1672 + return 0; 1673 + } 1674 + 1662 1675 static const struct net_device_ops emac_netdev_ops = { 1663 1676 .ndo_open = emac_ndo_open, 1664 1677 .ndo_stop = emac_ndo_stop, ··· 1682 1669 .ndo_set_rx_mode = emac_ndo_set_rx_mode, 1683 1670 .ndo_eth_ioctl = emac_ndo_ioctl, 1684 1671 .ndo_get_stats64 = emac_ndo_get_stats64, 1672 + .ndo_get_phys_port_name = emac_ndo_get_phys_port_name, 1685 1673 }; 1686 1674 1687 1675 /* get emac_port corresponding to eth_node name */