[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1549453888-24593-5-git-send-email-ioana.ciornei@nxp.com>
Date: Wed, 6 Feb 2019 11:52:01 +0000
From: Ioana Ciornei <ioana.ciornei@....com>
To: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC: Ioana Ciocoi Radulescu <ruxandra.radulescu@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Ioana Ciornei <ioana.ciornei@....com>
Subject: [PATCH 4/7] staging: fsl-dpaa2/ethsw: Add ndo_get_phys_port_name
From: Razvan Stefanescu <razvan.stefanescu@....com>
Add the ndo_get_phys_port_name callback to the ethsw driver.
Signed-off-by: Razvan Stefanescu <razvan.stefanescu@....com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@....com>
---
drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index fa3af4a..f179fd0 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -505,6 +505,19 @@ static netdev_tx_t port_dropframe(struct sk_buff *skb,
return NETDEV_TX_OK;
}
+static int port_get_phys_name(struct net_device *netdev, char *name,
+ size_t len)
+{
+ struct ethsw_port_priv *port_priv = netdev_priv(netdev);
+ int err;
+
+ err = snprintf(name, len, "p%d", port_priv->idx);
+ if (err >= len)
+ return -EINVAL;
+
+ return 0;
+}
+
static const struct net_device_ops ethsw_port_ops = {
.ndo_open = port_open,
.ndo_stop = port_stop,
@@ -516,6 +529,7 @@ static netdev_tx_t port_dropframe(struct sk_buff *skb,
.ndo_get_offload_stats = port_get_offload_stats,
.ndo_start_xmit = port_dropframe,
+ .ndo_get_phys_port_name = port_get_phys_name,
};
static void ethsw_links_state_update(struct ethsw_core *ethsw)
--
1.9.1
Powered by blists - more mailing lists