lkml.org 
[lkml]   [2014]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v7 28/33] net: dsa - set name assign type
Date
The name is given by the firmware, so we assume it is predictable.

Signed-off-by: Tom Gundersen <teg@jklm.no>
Cc: Fabian Godehardt <fg@emlix.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
---
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


\
 
 \ /
  Last update: 2014-07-10 11:01    [W:0.413 / U:37.304 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site