Commit 5ad71958 authored by Ioana Ciornei's avatar Ioana Ciornei Committed by Greg Kroah-Hartman

staging: dpaa2-switch: add a dpaa2_switch_ prefix to all functions in ethsw-ethtool.c

Some static functions in the dpaa2-switch driver don't have a distinct
prefix and this is becoming an inconvenience when looking at, for
example, a perf top output and trying to determine easily which entries
are dpaa2 switch related. Ammend this by adding the prefix to all the
functions.
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20201009153000.14550-2-ioana.ciornei@nxp.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 41f0666f
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
static struct { static struct {
enum dpsw_counter id; enum dpsw_counter id;
char name[ETH_GSTRING_LEN]; char name[ETH_GSTRING_LEN];
} ethsw_ethtool_counters[] = { } dpaa2_switch_ethtool_counters[] = {
{DPSW_CNT_ING_FRAME, "rx frames"}, {DPSW_CNT_ING_FRAME, "rx frames"},
{DPSW_CNT_ING_BYTE, "rx bytes"}, {DPSW_CNT_ING_BYTE, "rx bytes"},
{DPSW_CNT_ING_FLTR_FRAME, "rx filtered frames"}, {DPSW_CNT_ING_FLTR_FRAME, "rx filtered frames"},
...@@ -27,10 +27,10 @@ static struct { ...@@ -27,10 +27,10 @@ static struct {
}; };
#define ETHSW_NUM_COUNTERS ARRAY_SIZE(ethsw_ethtool_counters) #define DPAA2_SWITCH_NUM_COUNTERS ARRAY_SIZE(dpaa2_switch_ethtool_counters)
static void ethsw_get_drvinfo(struct net_device *netdev, static void dpaa2_switch_get_drvinfo(struct net_device *netdev,
struct ethtool_drvinfo *drvinfo) struct ethtool_drvinfo *drvinfo)
{ {
struct ethsw_port_priv *port_priv = netdev_priv(netdev); struct ethsw_port_priv *port_priv = netdev_priv(netdev);
u16 version_major, version_minor; u16 version_major, version_minor;
...@@ -53,8 +53,8 @@ static void ethsw_get_drvinfo(struct net_device *netdev, ...@@ -53,8 +53,8 @@ static void ethsw_get_drvinfo(struct net_device *netdev,
} }
static int static int
ethsw_get_link_ksettings(struct net_device *netdev, dpaa2_switch_get_link_ksettings(struct net_device *netdev,
struct ethtool_link_ksettings *link_ksettings) struct ethtool_link_ksettings *link_ksettings)
{ {
struct ethsw_port_priv *port_priv = netdev_priv(netdev); struct ethsw_port_priv *port_priv = netdev_priv(netdev);
struct dpsw_link_state state = {0}; struct dpsw_link_state state = {0};
...@@ -84,8 +84,8 @@ ethsw_get_link_ksettings(struct net_device *netdev, ...@@ -84,8 +84,8 @@ ethsw_get_link_ksettings(struct net_device *netdev,
} }
static int static int
ethsw_set_link_ksettings(struct net_device *netdev, dpaa2_switch_set_link_ksettings(struct net_device *netdev,
const struct ethtool_link_ksettings *link_ksettings) const struct ethtool_link_ksettings *link_ksettings)
{ {
struct ethsw_port_priv *port_priv = netdev_priv(netdev); struct ethsw_port_priv *port_priv = netdev_priv(netdev);
struct ethsw_core *ethsw = port_priv->ethsw_data; struct ethsw_core *ethsw = port_priv->ethsw_data;
...@@ -132,55 +132,56 @@ ethsw_set_link_ksettings(struct net_device *netdev, ...@@ -132,55 +132,56 @@ ethsw_set_link_ksettings(struct net_device *netdev,
return err; return err;
} }
static int ethsw_ethtool_get_sset_count(struct net_device *dev, int sset) static int dpaa2_switch_ethtool_get_sset_count(struct net_device *dev, int sset)
{ {
switch (sset) { switch (sset) {
case ETH_SS_STATS: case ETH_SS_STATS:
return ETHSW_NUM_COUNTERS; return DPAA2_SWITCH_NUM_COUNTERS;
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
} }
static void ethsw_ethtool_get_strings(struct net_device *netdev, static void dpaa2_switch_ethtool_get_strings(struct net_device *netdev,
u32 stringset, u8 *data) u32 stringset, u8 *data)
{ {
int i; int i;
switch (stringset) { switch (stringset) {
case ETH_SS_STATS: case ETH_SS_STATS:
for (i = 0; i < ETHSW_NUM_COUNTERS; i++) for (i = 0; i < DPAA2_SWITCH_NUM_COUNTERS; i++)
memcpy(data + i * ETH_GSTRING_LEN, memcpy(data + i * ETH_GSTRING_LEN,
ethsw_ethtool_counters[i].name, ETH_GSTRING_LEN); dpaa2_switch_ethtool_counters[i].name,
ETH_GSTRING_LEN);
break; break;
} }
} }
static void ethsw_ethtool_get_stats(struct net_device *netdev, static void dpaa2_switch_ethtool_get_stats(struct net_device *netdev,
struct ethtool_stats *stats, struct ethtool_stats *stats,
u64 *data) u64 *data)
{ {
struct ethsw_port_priv *port_priv = netdev_priv(netdev); struct ethsw_port_priv *port_priv = netdev_priv(netdev);
int i, err; int i, err;
for (i = 0; i < ETHSW_NUM_COUNTERS; i++) { for (i = 0; i < DPAA2_SWITCH_NUM_COUNTERS; i++) {
err = dpsw_if_get_counter(port_priv->ethsw_data->mc_io, 0, err = dpsw_if_get_counter(port_priv->ethsw_data->mc_io, 0,
port_priv->ethsw_data->dpsw_handle, port_priv->ethsw_data->dpsw_handle,
port_priv->idx, port_priv->idx,
ethsw_ethtool_counters[i].id, dpaa2_switch_ethtool_counters[i].id,
&data[i]); &data[i]);
if (err) if (err)
netdev_err(netdev, "dpsw_if_get_counter[%s] err %d\n", netdev_err(netdev, "dpsw_if_get_counter[%s] err %d\n",
ethsw_ethtool_counters[i].name, err); dpaa2_switch_ethtool_counters[i].name, err);
} }
} }
const struct ethtool_ops ethsw_port_ethtool_ops = { const struct ethtool_ops dpaa2_switch_port_ethtool_ops = {
.get_drvinfo = ethsw_get_drvinfo, .get_drvinfo = dpaa2_switch_get_drvinfo,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_link_ksettings = ethsw_get_link_ksettings, .get_link_ksettings = dpaa2_switch_get_link_ksettings,
.set_link_ksettings = ethsw_set_link_ksettings, .set_link_ksettings = dpaa2_switch_set_link_ksettings,
.get_strings = ethsw_ethtool_get_strings, .get_strings = dpaa2_switch_ethtool_get_strings,
.get_ethtool_stats = ethsw_ethtool_get_stats, .get_ethtool_stats = dpaa2_switch_ethtool_get_stats,
.get_sset_count = ethsw_ethtool_get_sset_count, .get_sset_count = dpaa2_switch_ethtool_get_sset_count,
}; };
...@@ -1711,7 +1711,7 @@ static int ethsw_probe_port(struct ethsw_core *ethsw, u16 port_idx) ...@@ -1711,7 +1711,7 @@ static int ethsw_probe_port(struct ethsw_core *ethsw, u16 port_idx)
SET_NETDEV_DEV(port_netdev, dev); SET_NETDEV_DEV(port_netdev, dev);
port_netdev->netdev_ops = &ethsw_port_ops; port_netdev->netdev_ops = &ethsw_port_ops;
port_netdev->ethtool_ops = &ethsw_port_ethtool_ops; port_netdev->ethtool_ops = &dpaa2_switch_port_ethtool_ops;
/* Set MTU limits */ /* Set MTU limits */
port_netdev->min_mtu = ETH_MIN_MTU; port_netdev->min_mtu = ETH_MIN_MTU;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#define ETHSW_FEATURE_MAC_ADDR BIT(0) #define ETHSW_FEATURE_MAC_ADDR BIT(0)
extern const struct ethtool_ops ethsw_port_ethtool_ops; extern const struct ethtool_ops dpaa2_switch_port_ethtool_ops;
struct ethsw_core; struct ethsw_core;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment