[PATCH v7 28/33] net: dsa - set name assign type

From: Tom Gundersen
Date: Thu Jul 10 2014 - 04:21:49 EST


The name is given by the firmware, so we assume it is predictable.

Signed-off-by: Tom Gundersen <teg@xxxxxxx>
Cc: Fabian Godehardt <fg@xxxxxxxxx>
Cc: Florian Fainelli <f.fainelli@xxxxxxxxx>
---
net/dsa/dsa.c | 3 ++-
net/dsa/dsa_priv.h | 3 ++-
net/dsa/slave.c | 6 +++---
3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 5db37ce..f3cd203 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -185,7 +185,8 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
if (!(ds->phys_port_mask & (1 << i)))
continue;

- slave_dev = dsa_slave_create(ds, parent, i, pd->port_names[i]);
+ slave_dev = dsa_slave_create(ds, parent, i, pd->port_names[i],
+ NET_NAME_PREDICTABLE);
if (slave_dev == NULL) {
printk(KERN_ERR "%s[%d]: can't create dsa "
"slave device for port %d(%s)\n",
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
index d4cf5cc..458881f 100644
--- a/net/dsa/dsa_priv.h
+++ b/net/dsa/dsa_priv.h
@@ -42,7 +42,8 @@ extern char dsa_driver_version[];
void dsa_slave_mii_bus_init(struct dsa_switch *ds);
struct net_device *dsa_slave_create(struct dsa_switch *ds,
struct device *parent,
- int port, char *name);
+ int port, char *name,
+ unsigned char name_assign_type);

/* tag_dsa.c */
netdev_tx_t dsa_xmit(struct sk_buff *skb, struct net_device *dev);
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 45a1e34..d29b0be 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -333,15 +333,15 @@ static const struct net_device_ops trailer_netdev_ops = {
/* slave device setup *******************************************************/
struct net_device *
dsa_slave_create(struct dsa_switch *ds, struct device *parent,
- int port, char *name)
+ int port, char *name, unsigned char name_assign_type)
{
struct net_device *master = ds->dst->master_netdev;
struct net_device *slave_dev;
struct dsa_slave_priv *p;
int ret;

- slave_dev = alloc_netdev(sizeof(struct dsa_slave_priv), name,
- NET_NAME_UNKNOWN, ether_setup);
+ slave_dev = alloc_netdev(sizeof(struct dsa_slave_priv),
+ name, name_assign_type, ether_setup);
if (slave_dev == NULL)
return slave_dev;

--
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/