net: set name_assign_type in alloc_netdev()
authorTom Gundersen <teg@jklm.no>
Mon, 14 Jul 2014 14:37:24 +0000 (16:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 15 Jul 2014 23:12:48 +0000 (16:12 -0700)
Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
all users to pass NET_NAME_UNKNOWN.

Coccinelle patch:

@@
expression sizeof_priv, name, setup, txqs, rxqs, count;
@@

(
-alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
+alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
|
-alloc_netdev_mq(sizeof_priv, name, setup, count)
+alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
|
-alloc_netdev(sizeof_priv, name, setup)
+alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
)

v9: move comments here from the wrong commit

Signed-off-by: Tom Gundersen <teg@jklm.no>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
97 files changed:
drivers/firewire/net.c
drivers/hsi/clients/ssi_protocol.c
drivers/infiniband/hw/amso1100/c2_provider.c
drivers/infiniband/ulp/ipoib/ipoib_main.c
drivers/isdn/i4l/isdn_net.c
drivers/media/dvb-core/dvb_net.c
drivers/misc/sgi-xp/xpnet.c
drivers/net/arcnet/arcnet.c
drivers/net/bonding/bond_main.c
drivers/net/caif/caif_serial.c
drivers/net/caif/caif_spi.c
drivers/net/caif/caif_virtio.c
drivers/net/can/dev.c
drivers/net/can/slcan.c
drivers/net/dummy.c
drivers/net/eql.c
drivers/net/ethernet/8390/lib8390.c
drivers/net/ethernet/tile/tilegx.c
drivers/net/ethernet/tile/tilepro.c
drivers/net/hamradio/6pack.c
drivers/net/hamradio/baycom_epp.c
drivers/net/hamradio/bpqether.c
drivers/net/hamradio/dmascc.c
drivers/net/hamradio/hdlcdrv.c
drivers/net/hamradio/mkiss.c
drivers/net/hamradio/scc.c
drivers/net/hamradio/yam.c
drivers/net/ieee802154/fakehard.c
drivers/net/ifb.c
drivers/net/loopback.c
drivers/net/ppp/ppp_generic.c
drivers/net/slip/slip.c
drivers/net/tun.c
drivers/net/usb/cdc-phonet.c
drivers/net/usb/hso.c
drivers/net/wan/dlci.c
drivers/net/wan/hdlc.c
drivers/net/wan/hdlc_fr.c
drivers/net/wan/lapbether.c
drivers/net/wan/sbni.c
drivers/net/wan/sdla.c
drivers/net/wan/x25_asy.c
drivers/net/wimax/i2400m/usb.c
drivers/net/wireless/airo.c
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/ath/wil6210/netdev.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
drivers/net/wireless/libertas/main.c
drivers/net/wireless/libertas/mesh.c
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/mwifiex/cfg80211.c
drivers/net/xen-netback/interface.c
drivers/s390/net/claw.c
drivers/s390/net/ctcm_main.c
drivers/s390/net/netiucv.c
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c
drivers/staging/cxt1e1/linux.c
drivers/staging/gdm724x/gdm_lte.c
drivers/staging/gdm72xx/gdm_wimax.c
drivers/staging/vt6655/wpactl.c
drivers/staging/wlan-ng/p80211netdev.c
drivers/tty/n_gsm.c
drivers/usb/gadget/f_phonet.c
include/linux/netdevice.h
net/802/fc.c
net/802/fddi.c
net/802/hippi.c
net/8021q/vlan.c
net/appletalk/dev.c
net/atm/br2684.c
net/atm/clip.c
net/batman-adv/soft-interface.c
net/bluetooth/6lowpan.c
net/bluetooth/bnep/core.c
net/bridge/br_if.c
net/core/dev.c
net/core/rtnetlink.c
net/dsa/slave.c
net/ethernet/eth.c
net/ipv4/ip_tunnel.c
net/ipv4/ipmr.c
net/ipv6/ip6_gre.c
net/ipv6/ip6_tunnel.c
net/ipv6/ip6_vti.c
net/ipv6/ip6mr.c
net/ipv6/sit.c
net/irda/irda_device.c
net/irda/irlan/irlan_eth.c
net/l2tp/l2tp_eth.c
net/mac80211/iface.c
net/mac802154/ieee802154_dev.c
net/netrom/af_netrom.c
net/openvswitch/vport-internal_dev.c
net/phonet/pep-gprs.c
net/rose/af_rose.c
net/sched/sch_teql.c

index c3986452194dd01ee4fed4b4bff14f9f5813523d..2c68da1ceeeef9ac39c272e0309dbb7ed9c85514 100644 (file)
@@ -1460,7 +1460,8 @@ static int fwnet_probe(struct fw_unit *unit,
                goto have_dev;
        }
 
-       net = alloc_netdev(sizeof(*dev), "firewire%d", fwnet_init_dev);
+       net = alloc_netdev(sizeof(*dev), "firewire%d", NET_NAME_UNKNOWN,
+                          fwnet_init_dev);
        if (net == NULL) {
                mutex_unlock(&fwnet_device_mutex);
                return -ENOMEM;
index ce4be3738d468a58aeff47a54737039cdafe3b0e..737fa2e0e782082c1ed137823c509327e5b2a123 100644 (file)
@@ -1115,7 +1115,7 @@ static int ssi_protocol_probe(struct device *dev)
                goto out;
        }
 
-       ssi->netdev = alloc_netdev(0, ifname, ssip_pn_setup);
+       ssi->netdev = alloc_netdev(0, ifname, NET_NAME_UNKNOWN, ssip_pn_setup);
        if (!ssi->netdev) {
                dev_err(dev, "No memory for netdev\n");
                err = -ENOMEM;
index 8af33cf1fc4e85eb120c4e80578f7bb3088d9f41..2d5cbf4363e4de0758a4d7260341a136b3ba2544 100644 (file)
@@ -734,7 +734,7 @@ static struct net_device *c2_pseudo_netdev_init(struct c2_dev *c2dev)
        /* change ethxxx to iwxxx */
        strcpy(name, "iw");
        strcat(name, &c2dev->netdev->name[3]);
-       netdev = alloc_netdev(0, name, setup);
+       netdev = alloc_netdev(0, name, NET_NAME_UNKNOWN, setup);
        if (!netdev) {
                printk(KERN_ERR PFX "%s -  etherdev alloc failed",
                        __func__);
index 5786a78ff8bc97811612818ab08f1fd8c3a01132..4e675f4fecc974447fde0171e9dfa94403d0f176 100644 (file)
@@ -1394,8 +1394,8 @@ struct ipoib_dev_priv *ipoib_intf_alloc(const char *name)
 {
        struct net_device *dev;
 
-       dev = alloc_netdev((int) sizeof (struct ipoib_dev_priv), name,
-                          ipoib_setup);
+       dev = alloc_netdev((int)sizeof(struct ipoib_dev_priv), name,
+                          NET_NAME_UNKNOWN, ipoib_setup);
        if (!dev)
                return NULL;
 
index d9aebbc510cc77d4116fa17c5349034f329e2362..c2ed6246a389c63719fce2e5a66b1b5fb303f82f 100644 (file)
@@ -2588,7 +2588,8 @@ isdn_net_new(char *name, struct net_device *master)
                printk(KERN_WARNING "isdn_net: Could not allocate net-device\n");
                return NULL;
        }
-       netdev->dev = alloc_netdev(sizeof(isdn_net_local), name, _isdn_setup);
+       netdev->dev = alloc_netdev(sizeof(isdn_net_local), name,
+                                  NET_NAME_UNKNOWN, _isdn_setup);
        if (!netdev->dev) {
                printk(KERN_WARNING "isdn_net: Could not allocate network device\n");
                kfree(netdev);
index 8a86b3025637d69c33a91ed7c697f5ad261fedb1..059e6117f22b5181d59229f0bd0af202466f7817 100644 (file)
@@ -1276,7 +1276,8 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype)
        if ((if_num = get_if(dvbnet)) < 0)
                return -EINVAL;
 
-       net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb", dvb_net_setup);
+       net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb",
+                          NET_NAME_UNKNOWN, dvb_net_setup);
        if (!net)
                return -ENOMEM;
 
index 3fac67a5204cfa768717a00b6628079fd37f939d..557f9782c53c59f4e741204cebcf1a1bf2023109 100644 (file)
@@ -544,7 +544,8 @@ xpnet_init(void)
         * use ether_setup() to init the majority of our device
         * structure and then override the necessary pieces.
         */
-       xpnet_device = alloc_netdev(0, XPNET_DEVICE_NAME, ether_setup);
+       xpnet_device = alloc_netdev(0, XPNET_DEVICE_NAME, NET_NAME_UNKNOWN,
+                                   ether_setup);
        if (xpnet_device == NULL) {
                kfree(xpnet_broadcast_partitions);
                return -ENOMEM;
index a956053608f9f6a9fdb94c877917150e6a25680e..3b790de6c97652791dbfadf0300d4f141c840d6d 100644 (file)
@@ -346,7 +346,8 @@ struct net_device *alloc_arcdev(const char *name)
        struct net_device *dev;
 
        dev = alloc_netdev(sizeof(struct arcnet_local),
-                          name && *name ? name : "arc%d", arcdev_setup);
+                          name && *name ? name : "arc%d", NET_NAME_UNKNOWN,
+                          arcdev_setup);
        if(dev) {
                struct arcnet_local *lp = netdev_priv(dev);
                spin_lock_init(&lp->lock);
index 09dc3ef771a7d5ba85c0f075d873fbea7be4752f..46dcb7b6216ff77b8f146992195e4b8d4dc28d22 100644 (file)
@@ -4420,7 +4420,7 @@ int bond_create(struct net *net, const char *name)
        rtnl_lock();
 
        bond_dev = alloc_netdev_mq(sizeof(struct bonding),
-                                  name ? name : "bond%d",
+                                  name ? name : "bond%d", NET_NAME_UNKNOWN,
                                   bond_setup, tx_queues);
        if (!bond_dev) {
                pr_err("%s: eek! can't alloc netdev!\n", name);
index fc73865bb83a705f9fa1d1f3d70e1c6191952b9b..27bbc56de15fa37497676f8b389cdc17eced09a0 100644 (file)
@@ -349,7 +349,8 @@ static int ldisc_open(struct tty_struct *tty)
        result = snprintf(name, sizeof(name), "cf%s", tty->name);
        if (result >= IFNAMSIZ)
                return -EINVAL;
-       dev = alloc_netdev(sizeof(*ser), name, caifdev_setup);
+       dev = alloc_netdev(sizeof(*ser), name, NET_NAME_UNKNOWN,
+                          caifdev_setup);
        if (!dev)
                return -ENOMEM;
 
index ff54c0eb2052137d8f1561448f3c654f34d354df..72ea9ff9bb9c02ae16133de4b12f83e70ec97c0d 100644 (file)
@@ -730,8 +730,8 @@ int cfspi_spi_probe(struct platform_device *pdev)
        int res;
        dev = (struct cfspi_dev *)pdev->dev.platform_data;
 
-       ndev = alloc_netdev(sizeof(struct cfspi),
-                       "cfspi%d", cfspi_setup);
+       ndev = alloc_netdev(sizeof(struct cfspi), "cfspi%d",
+                           NET_NAME_UNKNOWN, cfspi_setup);
        if (!dev)
                return -ENODEV;
 
index 985608634f8cccf9eefd32328c96fbbcb2ae0079..a5fefb9059c592aa5134302ba79f411a2874d65a 100644 (file)
@@ -661,7 +661,7 @@ static int cfv_probe(struct virtio_device *vdev)
        int err = -EINVAL;
 
        netdev = alloc_netdev(sizeof(struct cfv_info), cfv_netdev_name,
-                             cfv_netdev_setup);
+                             NET_NAME_UNKNOWN, cfv_netdev_setup);
        if (!netdev)
                return -ENOMEM;
 
index e318e87e2bfc00ba9e32aa08858de5f5c1629dcf..9f91fcba43f8718f4d546e39faaef1aa3bd9fabf 100644 (file)
@@ -565,7 +565,7 @@ struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max)
        else
                size = sizeof_priv;
 
-       dev = alloc_netdev(size, "can%d", can_setup);
+       dev = alloc_netdev(size, "can%d", NET_NAME_UNKNOWN, can_setup);
        if (!dev)
                return NULL;
 
index ea4d4f1a6411011f837b9da12b94d731a8a960a5..acb5b92ace92da17f55a5d892e90e7d7530a1952 100644 (file)
@@ -529,7 +529,7 @@ static struct slcan *slc_alloc(dev_t line)
                return NULL;
 
        sprintf(name, "slcan%d", i);
-       dev = alloc_netdev(sizeof(*sl), name, slc_setup);
+       dev = alloc_netdev(sizeof(*sl), name, NET_NAME_UNKNOWN, slc_setup);
        if (!dev)
                return NULL;
 
index 0932ffbf381b5b5c877b9988318912fcea930473..ff435fbd1ad0e8b32a8299211a890b1f5b9deb31 100644 (file)
@@ -164,7 +164,7 @@ static int __init dummy_init_one(void)
        struct net_device *dev_dummy;
        int err;
 
-       dev_dummy = alloc_netdev(0, "dummy%d", dummy_setup);
+       dev_dummy = alloc_netdev(0, "dummy%d", NET_NAME_UNKNOWN, dummy_setup);
        if (!dev_dummy)
                return -ENOMEM;
 
index 7a79b60468796a88795af28e655a94acf17f981f..957e5c0cede337cff8d98c81089e879d83988dcb 100644 (file)
@@ -585,7 +585,8 @@ static int __init eql_init_module(void)
 
        pr_info("%s\n", version);
 
-       dev_eql = alloc_netdev(sizeof(equalizer_t), "eql", eql_setup);
+       dev_eql = alloc_netdev(sizeof(equalizer_t), "eql", NET_NAME_UNKNOWN,
+                              eql_setup);
        if (!dev_eql)
                return -ENOMEM;
 
index 599311f0e05c18eccad98511b3d7d73737dbd1d5..b96e8852b2d195109b92ff6dd41a2b04a02d5389 100644 (file)
@@ -986,7 +986,7 @@ static void ethdev_setup(struct net_device *dev)
 static struct net_device *____alloc_ei_netdev(int size)
 {
        return alloc_netdev(sizeof(struct ei_device) + size, "eth%d",
-                               ethdev_setup);
+                           NET_NAME_UNKNOWN, ethdev_setup);
 }
 
 
index 4c70360967c244abb05a2152696a84bcfb534557..69557a26f7498ae261cc232f91ae0f5aeeb283f1 100644 (file)
@@ -2201,8 +2201,8 @@ static void tile_net_dev_init(const char *name, const uint8_t *mac)
        /* Allocate the device structure.  Normally, "name" is a
         * template, instantiated by register_netdev(), but not for us.
         */
-       dev = alloc_netdev_mqs(sizeof(*priv), name, tile_net_setup,
-                              NR_CPUS, 1);
+       dev = alloc_netdev_mqs(sizeof(*priv), name, NET_NAME_UNKNOWN,
+                              tile_net_setup, NR_CPUS, 1);
        if (!dev) {
                pr_err("alloc_netdev_mqs(%s) failed\n", name);
                return;
index e5a5c5d4ce0c8c8967c7963bf8bff36ee58f113f..88c71212669281efe24ba02a783709b2043f8529 100644 (file)
@@ -2292,7 +2292,8 @@ static struct net_device *tile_net_dev_init(const char *name)
         * tile_net_setup(), and saves "name".  Normally, "name" is a
         * template, instantiated by register_netdev(), but not for us.
         */
-       dev = alloc_netdev(sizeof(*priv), name, tile_net_setup);
+       dev = alloc_netdev(sizeof(*priv), name, NET_NAME_UNKNOWN,
+                          tile_net_setup);
        if (!dev) {
                pr_err("alloc_netdev(%s) failed\n", name);
                return NULL;
index 66e2b19ef709ef9180578a3f300b0d029d06805a..c3c4051a089df817b63d382645bdba0affd7f86f 100644 (file)
@@ -596,7 +596,8 @@ static int sixpack_open(struct tty_struct *tty)
        if (tty->ops->write == NULL)
                return -EOPNOTSUPP;
 
-       dev = alloc_netdev(sizeof(struct sixpack), "sp%d", sp_setup);
+       dev = alloc_netdev(sizeof(struct sixpack), "sp%d", NET_NAME_UNKNOWN,
+                          sp_setup);
        if (!dev) {
                err = -ENOMEM;
                goto out;
index 484f77ec2ce1f439d21caad0656fc6d2924b1577..a98c153f371e761f2c396c7fbcc1bdf787f407f3 100644 (file)
@@ -1206,7 +1206,7 @@ static int __init init_baycomepp(void)
                struct net_device *dev;
                
                dev = alloc_netdev(sizeof(struct baycom_state), "bce%d",
-                                  baycom_epp_dev_setup);
+                                  NET_NAME_UNKNOWN, baycom_epp_dev_setup);
 
                if (!dev) {
                        printk(KERN_WARNING "bce%d : out of memory\n", i);
index d50b23cf9ea922e66495c68db0fd3fb830815ec2..c2894e43840e604e75eac9f40bcfb1470e4c47aa 100644 (file)
@@ -501,8 +501,8 @@ static int bpq_new_device(struct net_device *edev)
        struct net_device *ndev;
        struct bpqdev *bpq;
 
-       ndev = alloc_netdev(sizeof(struct bpqdev), "bpq%d",
-                          bpq_setup);
+       ndev = alloc_netdev(sizeof(struct bpqdev), "bpq%d", NET_NAME_UNKNOWN,
+                           bpq_setup);
        if (!ndev)
                return -ENOMEM;
 
index 6636022a1027d6c4a91199b07e1116c3b9929b30..0fad408f24aa137694156290ae35a1da99343b80 100644 (file)
@@ -466,7 +466,7 @@ static int __init setup_adapter(int card_base, int type, int n)
        if (!info)
                goto out;
 
-       info->dev[0] = alloc_netdev(0, "", dev_setup);
+       info->dev[0] = alloc_netdev(0, "", NET_NAME_UNKNOWN, dev_setup);
        if (!info->dev[0]) {
                printk(KERN_ERR "dmascc: "
                       "could not allocate memory for %s at %#3x\n",
@@ -474,7 +474,7 @@ static int __init setup_adapter(int card_base, int type, int n)
                goto out1;
        }
 
-       info->dev[1] = alloc_netdev(0, "", dev_setup);
+       info->dev[1] = alloc_netdev(0, "", NET_NAME_UNKNOWN, dev_setup);
        if (!info->dev[1]) {
                printk(KERN_ERR "dmascc: "
                       "could not allocate memory for %s at %#3x\n",
index 5d78c1d08abd60fcc6bcee5dea5ab178a2a166da..c67a27245072746c3275a3b27a4fd899ebb6f3a4 100644 (file)
@@ -699,7 +699,7 @@ struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops,
        if (privsize < sizeof(struct hdlcdrv_state))
                privsize = sizeof(struct hdlcdrv_state);
 
-       dev = alloc_netdev(privsize, ifname, hdlcdrv_setup);
+       dev = alloc_netdev(privsize, ifname, NET_NAME_UNKNOWN, hdlcdrv_setup);
        if (!dev)
                return ERR_PTR(-ENOMEM);
 
index 8a6c720a4cc9a86f073cf73bfdc4157820286bfa..f990bb1c3e02ba50c583e6d41d3f8472736a3e37 100644 (file)
@@ -734,7 +734,8 @@ static int mkiss_open(struct tty_struct *tty)
        if (tty->ops->write == NULL)
                return -EOPNOTSUPP;
 
-       dev = alloc_netdev(sizeof(struct mkiss), "ax%d", ax_setup);
+       dev = alloc_netdev(sizeof(struct mkiss), "ax%d", NET_NAME_UNKNOWN,
+                          ax_setup);
        if (!dev) {
                err = -ENOMEM;
                goto out;
index 4bc6ee8e7987796b04a6f1ef5a1a5ffe044ec8af..57be9e0e98a68608fcbafade768bcf397b248e42 100644 (file)
@@ -1515,7 +1515,7 @@ static int scc_net_alloc(const char *name, struct scc_channel *scc)
        int err;
        struct net_device *dev;
 
-       dev = alloc_netdev(0, name, scc_net_setup);
+       dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, scc_net_setup);
        if (!dev) 
                return -ENOMEM;
 
index 81901659cc9ea1126e22f02e427dab1b9a729039..717433cfb81d2c4248539a56516daf6eb09c45ae 100644 (file)
@@ -1147,7 +1147,7 @@ static int __init yam_init_driver(void)
                sprintf(name, "yam%d", i);
                
                dev = alloc_netdev(sizeof(struct yam_port), name,
-                                  yam_setup);
+                                  NET_NAME_UNKNOWN, yam_setup);
                if (!dev) {
                        pr_err("yam: cannot allocate net device\n");
                        err = -ENOMEM;
index 78f18be3bbf2a76b7c245abef4aabd34faf3c72f..9ce854f43917ad723da924e7a99e3629c6a6e9bd 100644 (file)
@@ -343,7 +343,8 @@ static int ieee802154fake_probe(struct platform_device *pdev)
        if (!phy)
                return -ENOMEM;
 
-       dev = alloc_netdev(sizeof(struct fakehard_priv), "hardwpan%d", ieee802154_fake_setup);
+       dev = alloc_netdev(sizeof(struct fakehard_priv), "hardwpan%d",
+                          NET_NAME_UNKNOWN, ieee802154_fake_setup);
        if (!dev) {
                wpan_phy_free(phy);
                return -ENOMEM;
index 46a7790be004a7653d391ce96d51ae48975baa8c..d2d4a3d2237f7c735a326a949ec55561fe0c79f7 100644 (file)
@@ -269,8 +269,8 @@ static int __init ifb_init_one(int index)
        struct ifb_private *dp;
        int err;
 
-       dev_ifb = alloc_netdev(sizeof(struct ifb_private),
-                                "ifb%d", ifb_setup);
+       dev_ifb = alloc_netdev(sizeof(struct ifb_private), "ifb%d",
+                              NET_NAME_UNKNOWN, ifb_setup);
 
        if (!dev_ifb)
                return -ENOMEM;
index bb96409f8c056b85b77255f1c397edb4b28b0511..8f2262540561caf546ea53740a20795b10f51205 100644 (file)
@@ -195,7 +195,7 @@ static __net_init int loopback_net_init(struct net *net)
        int err;
 
        err = -ENOMEM;
-       dev = alloc_netdev(0, "lo", loopback_setup);
+       dev = alloc_netdev(0, "lo", NET_NAME_UNKNOWN, loopback_setup);
        if (!dev)
                goto out;
 
index 91d6c1272fcf0ae4a655fa74ca6b91fb578a6108..5c002b1ef169b95e576eb3b94ab23e366ff7e59e 100644 (file)
@@ -2665,7 +2665,8 @@ ppp_create_interface(struct net *net, int unit, int *retp)
        int ret = -ENOMEM;
        int i;
 
-       dev = alloc_netdev(sizeof(struct ppp), "", ppp_setup);
+       dev = alloc_netdev(sizeof(struct ppp), "", NET_NAME_UNKNOWN,
+                          ppp_setup);
        if (!dev)
                goto out1;
 
index 87526443841f6863c16bc59a01c1361073743cd8..05387b1e2e95e53b1b3abaef034104ea2b26b163 100644 (file)
@@ -749,7 +749,7 @@ static struct slip *sl_alloc(dev_t line)
                return NULL;
 
        sprintf(name, "sl%d", i);
-       dev = alloc_netdev(sizeof(*sl), name, sl_setup);
+       dev = alloc_netdev(sizeof(*sl), name, NET_NAME_UNKNOWN, sl_setup);
        if (!dev)
                return NULL;
 
index 98bad1fb1bfb1ce66ea4219c2e767256f05d6cbb..acaaf6784179b04bf227de6fefb770f3e744a231 100644 (file)
@@ -1633,7 +1633,8 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
                        name = ifr->ifr_name;
 
                dev = alloc_netdev_mqs(sizeof(struct tun_struct), name,
-                                      tun_setup, queues, queues);
+                                      NET_NAME_UNKNOWN, tun_setup, queues,
+                                      queues);
 
                if (!dev)
                        return -ENOMEM;
index 6358d420e185b4d4cb7b64a0c2a459fc5b70ed7f..2ec1500d0077529c0fd32d74c1abeb9d5f373aa8 100644 (file)
@@ -387,7 +387,7 @@ static int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *i
                return -EINVAL;
 
        dev = alloc_netdev(sizeof(*pnd) + sizeof(pnd->urbs[0]) * rxq_size,
-                               ifname, usbpn_setup);
+                          ifname, NET_NAME_UNKNOWN, usbpn_setup);
        if (!dev)
                return -ENOMEM;
 
index a3a05869309df6a1ac34cdb00c6ff4d031dc921b..50b36b299946198488bfebc2307e93ca25765919 100644 (file)
@@ -2520,7 +2520,8 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface,
 
        /* allocate our network device, then we can put in our private data */
        /* call hso_net_init to do the basic initialization */
-       net = alloc_netdev(sizeof(struct hso_net), "hso%d", hso_net_init);
+       net = alloc_netdev(sizeof(struct hso_net), "hso%d", NET_NAME_UNKNOWN,
+                          hso_net_init);
        if (!net) {
                dev_err(&interface->dev, "Unable to create ethernet device\n");
                goto exit;
index 19f7cb2cdef3c133fa2d04b4b2560d0acc6c2c35..a463613a07196636fd38d115398e64d2321382f5 100644 (file)
@@ -327,8 +327,8 @@ static int dlci_add(struct dlci_add *dlci)
                goto err1;
 
        /* create device name */
-       master = alloc_netdev( sizeof(struct dlci_local), "dlci%d",
-                             dlci_setup);
+       master = alloc_netdev(sizeof(struct dlci_local), "dlci%d",
+                             NET_NAME_UNKNOWN, dlci_setup);
        if (!master) {
                err = -ENOMEM;
                goto err1;
index 9c33ca918e19f7c03bc66ee8aff4b5365ec031eb..51f6cee8aab2d805147b9741ea49fad3747d7cfa 100644 (file)
@@ -256,7 +256,8 @@ static void hdlc_setup(struct net_device *dev)
 struct net_device *alloc_hdlcdev(void *priv)
 {
        struct net_device *dev;
-       dev = alloc_netdev(sizeof(struct hdlc_device), "hdlc%d", hdlc_setup);
+       dev = alloc_netdev(sizeof(struct hdlc_device), "hdlc%d",
+                          NET_NAME_UNKNOWN, hdlc_setup);
        if (dev)
                dev_to_hdlc(dev)->priv = priv;
        return dev;
index 7c6cb4f31798881ab24644a33791775e0ae1daf3..7cc64eac0fa3b78b29d5cd667c143f2d9c24b79d 100644 (file)
@@ -1075,10 +1075,11 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
        used = pvc_is_used(pvc);
 
        if (type == ARPHRD_ETHER) {
-               dev = alloc_netdev(0, "pvceth%d", ether_setup);
+               dev = alloc_netdev(0, "pvceth%d", NET_NAME_UNKNOWN,
+                                  ether_setup);
                dev->priv_flags &= ~IFF_TX_SKB_SHARING;
        } else
-               dev = alloc_netdev(0, "pvc%d", pvc_setup);
+               dev = alloc_netdev(0, "pvc%d", NET_NAME_UNKNOWN, pvc_setup);
 
        if (!dev) {
                netdev_warn(frad, "Memory squeeze on fr_pvc()\n");
index a33a46fa88dd0216871502622a0f06b976ac94d5..2f5eda8a7227f922df5c41229df8230fd8e3e404 100644 (file)
@@ -325,8 +325,8 @@ static int lapbeth_new_device(struct net_device *dev)
 
        ASSERT_RTNL();
 
-       ndev = alloc_netdev(sizeof(*lapbeth), "lapb%d", 
-                          lapbeth_setup);
+       ndev = alloc_netdev(sizeof(*lapbeth), "lapb%d", NET_NAME_UNKNOWN,
+                           lapbeth_setup);
        if (!ndev)
                goto out;
 
index 1b89ecf0959e11ae4136e662dba68f344337d455..758c4ba1e97c91389ad6e5d1e6cda37f0dae26fa 100644 (file)
@@ -227,7 +227,8 @@ int __init sbni_probe(int unit)
        struct net_device *dev;
        int err;
 
-       dev = alloc_netdev(sizeof(struct net_local), "sbni", sbni_devsetup);
+       dev = alloc_netdev(sizeof(struct net_local), "sbni",
+                          NET_NAME_UNKNOWN, sbni_devsetup);
        if (!dev)
                return -ENOMEM;
 
@@ -1477,8 +1478,8 @@ int __init init_module( void )
        int err;
 
        while( num < SBNI_MAX_NUM_CARDS ) {
-               dev = alloc_netdev(sizeof(struct net_local), 
-                                  "sbni%d", sbni_devsetup);
+               dev = alloc_netdev(sizeof(struct net_local), "sbni%d",
+                                  NET_NAME_UNKNOWN, sbni_devsetup);
                if( !dev)
                        break;
 
index cdd45fb8a1f6892587abddf2abbf0963bd7a5653..421ac5f856994731fc7a0f3752c32dcebda15bf1 100644 (file)
@@ -1631,7 +1631,8 @@ static int __init init_sdla(void)
 
        printk("%s.\n", version);
 
-       sdla = alloc_netdev(sizeof(struct frad_local), "sdla0", setup_sdla);
+       sdla = alloc_netdev(sizeof(struct frad_local), "sdla0",
+                           NET_NAME_UNKNOWN, setup_sdla);
        if (!sdla) 
                return -ENOMEM;
 
index 5895f19786919f6cfb36b97273a95bc1462d1c10..df6c07357556ae28976b09ff480faa3e8e918cb6 100644 (file)
@@ -81,8 +81,8 @@ static struct x25_asy *x25_asy_alloc(void)
                char name[IFNAMSIZ];
                sprintf(name, "x25asy%d", i);
 
-               dev = alloc_netdev(sizeof(struct x25_asy),
-                                  name, x25_asy_setup);
+               dev = alloc_netdev(sizeof(struct x25_asy), name,
+                                  NET_NAME_UNKNOWN, x25_asy_setup);
                if (!dev)
                        return NULL;
 
index cd15a93d9084377ce4a8ce79d68c9b49b7fb9845..e7f5910a65191f4f013ae53db73d2a77510ae9e8 100644 (file)
@@ -472,7 +472,7 @@ int i2400mu_probe(struct usb_interface *iface,
 
        /* Allocate instance [calls i2400m_netdev_setup() on it]. */
        result = -ENOMEM;
-       net_dev = alloc_netdev(sizeof(*i2400mu), "wmx%d",
+       net_dev = alloc_netdev(sizeof(*i2400mu), "wmx%d", NET_NAME_UNKNOWN,
                               i2400mu_netdev_setup);
        if (net_dev == NULL) {
                dev_err(dev, "no memory for network device instance\n");
index 64747d457bb3a1879f9cb0b478836dea4cb3099e..29d88739454b937a2cfc1425a121ef4d0d7d20a5 100644 (file)
@@ -2685,7 +2685,8 @@ static struct net_device *init_wifidev(struct airo_info *ai,
                                        struct net_device *ethdev)
 {
        int err;
-       struct net_device *dev = alloc_netdev(0, "wifi%d", wifi_setup);
+       struct net_device *dev = alloc_netdev(0, "wifi%d", NET_NAME_UNKNOWN,
+                                             wifi_setup);
        if (!dev)
                return NULL;
        dev->ml_priv = ethdev->ml_priv;
@@ -2785,7 +2786,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
        CapabilityRid cap_rid;
 
        /* Create the network device object. */
-       dev = alloc_netdev(sizeof(*ai), "", ether_setup);
+       dev = alloc_netdev(sizeof(*ai), "", NET_NAME_UNKNOWN, ether_setup);
        if (!dev) {
                airo_print_err("", "Couldn't alloc_etherdev");
                return NULL;
index 0e26f4a34fda329910ecc278de9fe7bea8fa6c57..1c4ce8e3eebee3cd587d938de99e342024f8d7f4 100644 (file)
@@ -3636,7 +3636,7 @@ struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
        struct net_device *ndev;
        struct ath6kl_vif *vif;
 
-       ndev = alloc_netdev(sizeof(*vif), name, ether_setup);
+       ndev = alloc_netdev(sizeof(*vif), name, NET_NAME_UNKNOWN, ether_setup);
        if (!ndev)
                return NULL;
 
index 106b6dcb773a35fe3e57eba85423f4e2135ae24c..7afce6e8c5078fb92257a64f6c1e3fabaa65298c 100644 (file)
@@ -132,7 +132,7 @@ void *wil_if_alloc(struct device *dev, void __iomem *csr)
        ch = wdev->wiphy->bands[IEEE80211_BAND_60GHZ]->channels;
        cfg80211_chandef_create(&wdev->preset_chandef, ch, NL80211_CHAN_NO_HT);
 
-       ndev = alloc_netdev(0, "wlan%d", ether_setup);
+       ndev = alloc_netdev(0, "wlan%d", NET_NAME_UNKNOWN, ether_setup);
        if (!ndev) {
                dev_err(dev, "alloc_netdev_mqs failed\n");
                rc = -ENOMEM;
index 09dd8c13d8448392372299c6eb8954132fca9c72..2699441d4f41220537ea13c268a88276fdcc8dbd 100644 (file)
@@ -808,7 +808,8 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx, s32 ifidx,
        } else {
                brcmf_dbg(INFO, "allocate netdev interface\n");
                /* Allocate netdev, including space for private structure */
-               ndev = alloc_netdev(sizeof(*ifp), name, ether_setup);
+               ndev = alloc_netdev(sizeof(*ifp), name, NET_NAME_UNKNOWN,
+                                   ether_setup);
                if (!ndev)
                        return ERR_PTR(-ENOMEM);
 
index 0c02f0483d1fd65e8b2a61b55ab57cbcc95ad5f2..569b64ecc6075f1fa028091b7b319c20fbda01c9 100644 (file)
@@ -981,7 +981,7 @@ struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
                goto err_wdev;
        }
 
-       dev = alloc_netdev(0, "wlan%d", ether_setup);
+       dev = alloc_netdev(0, "wlan%d", NET_NAME_UNKNOWN, ether_setup);
        if (!dev) {
                dev_err(dmdev, "no memory for network device instance\n");
                goto err_adapter;
index 6fef746345bc5ddd16957ad0d69a42a1f4636903..01a67f62696f74788e6e4b01eb717f1f6d7fb75c 100644 (file)
@@ -1000,7 +1000,7 @@ static int lbs_add_mesh(struct lbs_private *priv)
                goto done;
        }
 
-       mesh_dev = alloc_netdev(0, "msh%d", ether_setup);
+       mesh_dev = alloc_netdev(0, "msh%d", NET_NAME_UNKNOWN, ether_setup);
        if (!mesh_dev) {
                lbs_deb_mesh("init mshX device failed\n");
                ret = -ENOMEM;
index eba51460a5ded4b6456a18b946153c6a310bdb48..5ea65fce0b83224bc3628138da76a8ff518d0d9f 100644 (file)
@@ -2676,7 +2676,8 @@ static int __init init_mac80211_hwsim(void)
                        goto out_free_radios;
        }
 
-       hwsim_mon = alloc_netdev(0, "hwsim%d", hwsim_mon_setup);
+       hwsim_mon = alloc_netdev(0, "hwsim%d", NET_NAME_UNKNOWN,
+                                hwsim_mon_setup);
        if (hwsim_mon == NULL) {
                err = -ENOMEM;
                goto out_free_radios;
index 6af135fa99f7e5e6822868eb3c30079747a5fcb0..ca87f923c61eaa251908add3f2bc81c95cdb9132 100644 (file)
@@ -2232,7 +2232,8 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
        }
 
        dev = alloc_netdev_mqs(sizeof(struct mwifiex_private *), name,
-                              ether_setup, IEEE80211_NUM_ACS, 1);
+                              NET_NAME_UNKNOWN, ether_setup,
+                              IEEE80211_NUM_ACS, 1);
        if (!dev) {
                wiphy_err(wiphy, "no memory available for netdevice\n");
                priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
index ef75b45e508508db008d9491fba0887bf7b2cb60..bd59d9dbf27b1e11e049309745bed20b7d6e97a2 100644 (file)
@@ -418,8 +418,8 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid,
         * When the guest selects the desired number, it will be updated
         * via netif_set_real_num_*_queues().
         */
-       dev = alloc_netdev_mq(sizeof(struct xenvif), name, ether_setup,
-                             xenvif_max_queues);
+       dev = alloc_netdev_mq(sizeof(struct xenvif), name, NET_NAME_UNKNOWN,
+                             ether_setup, xenvif_max_queues);
        if (dev == NULL) {
                pr_warn("Could not allocate netdev for %s\n", name);
                return ERR_PTR(-ENOMEM);
index d837c3c5330fab5c2c77548f31996db3dacad763..fbc6701bef30811c7359861fcf6b81da39f6476d 100644 (file)
@@ -2915,7 +2915,7 @@ claw_new_device(struct ccwgroup_device *cgdev)
                        "failed with error code %d\n", ret);
                goto out;
        }
-       dev = alloc_netdev(0,"claw%d",claw_init_netdevice);
+       dev = alloc_netdev(0, "claw%d", NET_NAME_UNKNOWN, claw_init_netdevice);
        if (!dev) {
                dev_warn(&cgdev->dev,
                        "Activating the CLAW device failed\n");
index 03b6ad035577e28553da16fbf4481d9c249a9e6d..e056dd4fe44d1814d153d215af21fa13f44888a2 100644 (file)
@@ -1137,9 +1137,11 @@ static struct net_device *ctcm_init_netdevice(struct ctcm_priv *priv)
                return NULL;
 
        if (IS_MPC(priv))
-               dev = alloc_netdev(0, MPC_DEVICE_GENE, ctcm_dev_setup);
+               dev = alloc_netdev(0, MPC_DEVICE_GENE, NET_NAME_UNKNOWN,
+                                  ctcm_dev_setup);
        else
-               dev = alloc_netdev(0, CTC_DEVICE_GENE, ctcm_dev_setup);
+               dev = alloc_netdev(0, CTC_DEVICE_GENE, NET_NAME_UNKNOWN,
+                                  ctcm_dev_setup);
 
        if (!dev) {
                CTCM_DBF_TEXT_(ERROR, CTC_DBF_CRIT,
index ce16d1bdb20a2fb24b3cc557a62c7aba25a8ca58..0a87809c8af7380374b496ab3b90f76a8522ba98 100644 (file)
@@ -2015,7 +2015,7 @@ static struct net_device *netiucv_init_netdevice(char *username, char *userdata)
        struct net_device *dev;
 
        dev = alloc_netdev(sizeof(struct netiucv_priv), "iucv%d",
-                          netiucv_setup_netdevice);
+                          NET_NAME_UNKNOWN, netiucv_setup_netdevice);
        if (!dev)
                return NULL;
        rtnl_lock();
index 5ef5b4f45758cd226bb58becde5a3fa81ff33bb2..c2679bfe7f6653ba369b8646eada7e554576768a 100644 (file)
@@ -952,10 +952,12 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
 {
        switch (card->info.type) {
        case QETH_CARD_TYPE_IQD:
-               card->dev = alloc_netdev(0, "hsi%d", ether_setup);
+               card->dev = alloc_netdev(0, "hsi%d", NET_NAME_UNKNOWN,
+                                        ether_setup);
                break;
        case QETH_CARD_TYPE_OSN:
-               card->dev = alloc_netdev(0, "osn%d", ether_setup);
+               card->dev = alloc_netdev(0, "osn%d", NET_NAME_UNKNOWN,
+                                        ether_setup);
                card->dev->flags |= IFF_NOARP;
                break;
        default:
index 14e0b5810e8c1cde11a8835552158bab8b59dd1a..f8427a2c4840b9e2453e7a9129068cb69e438397 100644 (file)
@@ -3287,7 +3287,8 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
                        }
                }
        } else if (card->info.type == QETH_CARD_TYPE_IQD) {
-               card->dev = alloc_netdev(0, "hsi%d", ether_setup);
+               card->dev = alloc_netdev(0, "hsi%d", NET_NAME_UNKNOWN,
+                                        ether_setup);
                if (!card->dev)
                        return -ENODEV;
                card->dev->flags |= IFF_NOARP;
index 09f3d5ca75ac6737b9fc3efbff0243d28cc13bb6..85d776bbfb15896245dc2880d12fd26589b6b8bd 100644 (file)
@@ -917,7 +917,8 @@ c4_add_dev(hdw_info_t *hi, int brdno, unsigned long f0, unsigned long f1,
        struct net_device *ndev;
        ci_t       *ci;
 
-       ndev = alloc_netdev(sizeof(ci_t), SBE_IFACETMPL, c4_setup);
+       ndev = alloc_netdev(sizeof(ci_t), SBE_IFACETMPL, NET_NAME_UNKNOWN,
+                           c4_setup);
        if (!ndev) {
                pr_warning("%s: no memory for struct net_device !\n",
                           hi->devname);
index 64c55b99fda4594725112d0d17b299ffe78bdbfb..c2268527422f417487b8580cf301ace6e44b849c 100644 (file)
@@ -885,7 +885,7 @@ int register_lte_device(struct phy_dev *phy_dev,
 
                /* Allocate netdev */
                net = alloc_netdev(sizeof(struct nic), pdn_dev_name,
-                               ether_setup);
+                                  NET_NAME_UNKNOWN, ether_setup);
                if (net == NULL) {
                        pr_err("alloc_netdev failed\n");
                        ret = -ENOMEM;
index e5e511585122a3a25c5d6ad203d4c5f185755f3f..a9a6fc51024bbabb109812a3d16ea29f23b7cec6 100644 (file)
@@ -886,7 +886,8 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev)
        struct net_device *dev;
        int ret;
 
-       dev = alloc_netdev(sizeof(*nic), "wm%d", ether_setup);
+       dev = alloc_netdev(sizeof(*nic), "wm%d", NET_NAME_UNKNOWN,
+                          ether_setup);
 
        if (dev == NULL) {
                pr_err("alloc_etherdev failed\n");
index 8392d4d1d5ed75e83ff60123bc66f9f17132b016..0814bfd68b2e726067a53588a1bd558f78951afe 100644 (file)
@@ -89,7 +89,8 @@ static int wpa_init_wpadev(PSDevice pDevice)
        struct net_device *dev = pDevice->dev;
        int ret = 0;
 
-       pDevice->wpadev = alloc_netdev(sizeof(PSDevice), "vntwpa", wpadev_setup);
+       pDevice->wpadev = alloc_netdev(sizeof(PSDevice), "vntwpa",
+                                      NET_NAME_UNKNOWN, wpadev_setup);
        if (pDevice->wpadev == NULL)
                return -ENOMEM;
 
index 00b186c59725d2888c0b3b649c94d0397bfc6229..6c78f917e24acd270f17097c1432fa83dcc6e94b 100644 (file)
@@ -769,7 +769,7 @@ int wlan_setup(wlandevice_t *wlandev, struct device *physdev)
 
        /* Allocate and initialize the struct device */
        netdev = alloc_netdev(sizeof(struct wireless_dev), "wlan%d",
-                               ether_setup);
+                             NET_NAME_UNKNOWN, ether_setup);
        if (netdev == NULL) {
                dev_err(physdev, "Failed to alloc netdev.\n");
                wlan_free_wiphy(wiphy);
index 2ebe47b78a3e3ba48093d46164bee6247a32295e..cde3ab97900f6c804b6779ca6d58b2546be5201c 100644 (file)
@@ -2789,9 +2789,8 @@ static int gsm_create_network(struct gsm_dlci *dlci, struct gsm_netconfig *nc)
        netname = "gsm%d";
        if (nc->if_name[0] != '\0')
                netname = nc->if_name;
-       net = alloc_netdev(sizeof(struct gsm_mux_net),
-                       netname,
-                       gsm_mux_net_init);
+       net = alloc_netdev(sizeof(struct gsm_mux_net), netname,
+                          NET_NAME_UNKNOWN, gsm_mux_net_init);
        if (!net) {
                pr_err("alloc_netdev failed");
                return -ENOMEM;
index f2b781773eed39da911bd7a6a4f4f5500e46fbbf..b9cfc1571d71281c0607abf0420fb518796626fe 100644 (file)
@@ -721,7 +721,8 @@ struct net_device *gphonet_setup_default(void)
        struct phonet_port *port;
 
        /* Create net device */
-       dev = alloc_netdev(sizeof(*port), "upnlink%d", pn_net_setup);
+       dev = alloc_netdev(sizeof(*port), "upnlink%d", NET_NAME_UNKNOWN,
+                          pn_net_setup);
        if (!dev)
                return ERR_PTR(-ENOMEM);
 
index 9be34732142ff49fd0292192aadda1d1cb7e81d2..15ed750458ad5995908d77f81241147a01d4a844 100644 (file)
@@ -2991,13 +2991,15 @@ void ether_setup(struct net_device *dev);
 
 /* Support for loadable net-drivers */
 struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
+                                   unsigned char name_assign_type,
                                    void (*setup)(struct net_device *),
                                    unsigned int txqs, unsigned int rxqs);
-#define alloc_netdev(sizeof_priv, name, setup) \
-       alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
+#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
+       alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, 1, 1)
 
-#define alloc_netdev_mq(sizeof_priv, name, setup, count) \
-       alloc_netdev_mqs(sizeof_priv, name, setup, count, count)
+#define alloc_netdev_mq(sizeof_priv, name, name_assign_type, setup, count) \
+       alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, count, \
+                        count)
 
 int register_netdev(struct net_device *dev);
 void unregister_netdev(struct net_device *dev);
index 05eea6b98bb85ec54b4ad86f5f4e9d0650068588..7c174b6750cd654c49d7c1d2f621eb9fc3ed1ef0 100644 (file)
@@ -126,6 +126,6 @@ static void fc_setup(struct net_device *dev)
  */
 struct net_device *alloc_fcdev(int sizeof_priv)
 {
-       return alloc_netdev(sizeof_priv, "fc%d", fc_setup);
+       return alloc_netdev(sizeof_priv, "fc%d", NET_NAME_UNKNOWN, fc_setup);
 }
 EXPORT_SYMBOL(alloc_fcdev);
index 9cda40661e0d300112008fab1c633bb938bac4b6..59e7346f1193a612f9118b4df85426406aea5549 100644 (file)
@@ -207,7 +207,8 @@ static void fddi_setup(struct net_device *dev)
  */
 struct net_device *alloc_fddidev(int sizeof_priv)
 {
-       return alloc_netdev(sizeof_priv, "fddi%d", fddi_setup);
+       return alloc_netdev(sizeof_priv, "fddi%d", NET_NAME_UNKNOWN,
+                           fddi_setup);
 }
 EXPORT_SYMBOL(alloc_fddidev);
 
index 5ff2a718ddcac1624809f563f5dfc12d5cad46f9..2e03f8259dd55a575f1b147987631cdced3a91a9 100644 (file)
@@ -228,7 +228,8 @@ static void hippi_setup(struct net_device *dev)
 
 struct net_device *alloc_hippi_dev(int sizeof_priv)
 {
-       return alloc_netdev(sizeof_priv, "hip%d", hippi_setup);
+       return alloc_netdev(sizeof_priv, "hip%d", NET_NAME_UNKNOWN,
+                           hippi_setup);
 }
 
 EXPORT_SYMBOL(alloc_hippi_dev);
index 44ebd5c2cd4aef0f86bd6475132cc40c501c6fef..cba9c212a730059be075a93eedbd825aea6a696a 100644 (file)
@@ -250,7 +250,8 @@ static int register_vlan_device(struct net_device *real_dev, u16 vlan_id)
                snprintf(name, IFNAMSIZ, "vlan%.4i", vlan_id);
        }
 
-       new_dev = alloc_netdev(sizeof(struct vlan_dev_priv), name, vlan_setup);
+       new_dev = alloc_netdev(sizeof(struct vlan_dev_priv), name,
+                              NET_NAME_UNKNOWN, vlan_setup);
 
        if (new_dev == NULL)
                return -ENOBUFS;
index 6c8016f618661d931467bf2a005ee1933eec1797..e4158b8b926d39c725e6fc1b644360e5fe27f965 100644 (file)
@@ -39,6 +39,7 @@ static void ltalk_setup(struct net_device *dev)
 
 struct net_device *alloc_ltalkdev(int sizeof_priv)
 {
-       return alloc_netdev(sizeof_priv, "lt%d", ltalk_setup);
+       return alloc_netdev(sizeof_priv, "lt%d", NET_NAME_UNKNOWN,
+                           ltalk_setup);
 }
 EXPORT_SYMBOL(alloc_ltalkdev);
index 403e71fa88feb900a7d194f3f3c83f4f6e1cb0d4..cc78538d163bbf05bd6bcf5aa5c8c4954fe8ac66 100644 (file)
@@ -682,8 +682,8 @@ static int br2684_create(void __user *arg)
 
        netdev = alloc_netdev(sizeof(struct br2684_dev),
                              ni.ifname[0] ? ni.ifname : "nas%d",
-                             (payload == p_routed) ?
-                             br2684_setup_routed : br2684_setup);
+                             NET_NAME_UNKNOWN,
+                             (payload == p_routed) ? br2684_setup_routed : br2684_setup);
        if (!netdev)
                return -ENOMEM;
 
index ba291ce4bdff95c59b02a9eeaf9de87dd0a7315b..46339040fef014771e504803eef23356c6a1a9f4 100644 (file)
@@ -520,7 +520,8 @@ static int clip_create(int number)
                        if (PRIV(dev)->number >= number)
                                number = PRIV(dev)->number + 1;
        }
-       dev = alloc_netdev(sizeof(struct clip_priv), "", clip_setup);
+       dev = alloc_netdev(sizeof(struct clip_priv), "", NET_NAME_UNKNOWN,
+                          clip_setup);
        if (!dev)
                return -ENOMEM;
        clip_priv = PRIV(dev);
index e7ee65dc20bf4f25a1a8d0134c66b0bfaef25bd3..d551e6302cf350dd7f56b4f893c5fa24dad28f6f 100644 (file)
@@ -895,7 +895,7 @@ struct net_device *batadv_softif_create(const char *name)
        int ret;
 
        soft_iface = alloc_netdev(sizeof(struct batadv_priv), name,
-                                 batadv_softif_init_early);
+                                 NET_NAME_UNKNOWN, batadv_softif_init_early);
        if (!soft_iface)
                return NULL;
 
index 5a7f81df603c482bda59685f8c8fdce8b962fb38..206b65ccd5b8bd318e554e452966fae1c582112f 100644 (file)
@@ -712,7 +712,7 @@ static int setup_netdev(struct l2cap_chan *chan, struct lowpan_dev **dev)
        unsigned long flags;
 
        netdev = alloc_netdev(sizeof(struct lowpan_dev), IFACE_NAME_TEMPLATE,
-                             netdev_setup);
+                             NET_NAME_UNKNOWN, netdev_setup);
        if (!netdev)
                return -ENOMEM;
 
index a841d3e776c5e091c19efea8423750edd018e946..85bcc21e84d2006c4839b2b7f409f2595cb41858 100644 (file)
@@ -538,8 +538,9 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
 
        /* session struct allocated as private part of net_device */
        dev = alloc_netdev(sizeof(struct bnep_session),
-                               (*req->device) ? req->device : "bnep%d",
-                               bnep_net_setup);
+                          (*req->device) ? req->device : "bnep%d",
+                          NET_NAME_UNKNOWN,
+                          bnep_net_setup);
        if (!dev)
                return -ENOMEM;
 
index 3eca3fdf8fe1c7563150f735991e66380c4312ca..078d336a1f379f80d622e4fffa187630593827cf 100644 (file)
@@ -344,7 +344,7 @@ int br_add_bridge(struct net *net, const char *name)
        struct net_device *dev;
        int res;
 
-       dev = alloc_netdev(sizeof(struct net_bridge), name,
+       dev = alloc_netdev(sizeof(struct net_bridge), name, NET_NAME_UNKNOWN,
                           br_dev_setup);
 
        if (!dev)
index 38793fb84a354c7ffdc5a360ed288f5f707731ed..2c98f10ee62aa842b3cf6d3116342bf85c44c9aa 100644 (file)
@@ -6441,17 +6441,19 @@ void netdev_freemem(struct net_device *dev)
 
 /**
  *     alloc_netdev_mqs - allocate network device
- *     @sizeof_priv:   size of private data to allocate space for
- *     @name:          device name format string
- *     @setup:         callback to initialize device
- *     @txqs:          the number of TX subqueues to allocate
- *     @rxqs:          the number of RX subqueues to allocate
+ *     @sizeof_priv:           size of private data to allocate space for
+ *     @name:                  device name format string
+ *     @name_assign_type:      origin of device name
+ *     @setup:                 callback to initialize device
+ *     @txqs:                  the number of TX subqueues to allocate
+ *     @rxqs:                  the number of RX subqueues to allocate
  *
  *     Allocates a struct net_device with private data area for driver use
  *     and performs basic initialization.  Also allocates subqueue structs
  *     for each queue on the device.
  */
 struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
+               unsigned char name_assign_type,
                void (*setup)(struct net_device *),
                unsigned int txqs, unsigned int rxqs)
 {
@@ -6530,6 +6532,7 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
 #endif
 
        strcpy(dev->name, name);
+       dev->name_assign_type = name_assign_type;
        dev->group = INIT_NETDEV_GROUP;
        if (!dev->ethtool_ops)
                dev->ethtool_ops = &default_ethtool_ops;
index 1f8a59e02c4816fef0087eb14855a16003c0d133..599864322de835fcc7cffc68475644a3de15e5db 100644 (file)
@@ -1828,8 +1828,8 @@ struct net_device *rtnl_create_link(struct net *net,
                num_rx_queues = ops->get_num_rx_queues();
 
        err = -ENOMEM;
-       dev = alloc_netdev_mqs(ops->priv_size, ifname, ops->setup,
-                              num_tx_queues, num_rx_queues);
+       dev = alloc_netdev_mqs(ops->priv_size, ifname, NET_NAME_UNKNOWN,
+                              ops->setup, num_tx_queues, num_rx_queues);
        if (!dev)
                goto err;
 
index 64c5af0a10dd82169ccada3d82baa866a5b82cc8..45a1e34c89e0d975dd9f361a73a5617d69a10301 100644 (file)
@@ -340,8 +340,8 @@ dsa_slave_create(struct dsa_switch *ds, struct device *parent,
        struct dsa_slave_priv *p;
        int ret;
 
-       slave_dev = alloc_netdev(sizeof(struct dsa_slave_priv),
-                                name, ether_setup);
+       slave_dev = alloc_netdev(sizeof(struct dsa_slave_priv), name,
+                                NET_NAME_UNKNOWN, ether_setup);
        if (slave_dev == NULL)
                return slave_dev;
 
index 5dc638cad2e1ff396347f53c74a0a038d3a4b77e..f405e05924078b2d30f45139cd698843a16256da 100644 (file)
@@ -390,7 +390,8 @@ EXPORT_SYMBOL(ether_setup);
 struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
                                      unsigned int rxqs)
 {
-       return alloc_netdev_mqs(sizeof_priv, "eth%d", ether_setup, txqs, rxqs);
+       return alloc_netdev_mqs(sizeof_priv, "eth%d", NET_NAME_UNKNOWN,
+                               ether_setup, txqs, rxqs);
 }
 EXPORT_SYMBOL(alloc_etherdev_mqs);
 
index 54b6731dab559e2c686bfd224436ff9f72d4546c..0157a7af20a841531d10f2d071ffbdc0a7e485f3 100644 (file)
@@ -301,7 +301,7 @@ static struct net_device *__ip_tunnel_create(struct net *net,
        }
 
        ASSERT_RTNL();
-       dev = alloc_netdev(ops->priv_size, name, ops->setup);
+       dev = alloc_netdev(ops->priv_size, name, NET_NAME_UNKNOWN, ops->setup);
        if (!dev) {
                err = -ENOMEM;
                goto failed;
index 65bcaa7890436df5ad2ee16f4465af51e141357b..c8034587859d3ebdda204711a7939abe8f66a22d 100644 (file)
@@ -500,7 +500,7 @@ static struct net_device *ipmr_reg_vif(struct net *net, struct mr_table *mrt)
        else
                sprintf(name, "pimreg%u", mrt->id);
 
-       dev = alloc_netdev(0, name, reg_vif_setup);
+       dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, reg_vif_setup);
 
        if (dev == NULL)
                return NULL;
index 365b2b6f3942cdcdb8794bed6dcfa2e4477466b9..5f19dfbc4c6a4039ae2a22eb065bed6d46565d83 100644 (file)
@@ -322,7 +322,8 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net,
        else
                strcpy(name, "ip6gre%d");
 
-       dev = alloc_netdev(sizeof(*t), name, ip6gre_tunnel_setup);
+       dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN,
+                          ip6gre_tunnel_setup);
        if (!dev)
                return NULL;
 
@@ -1326,7 +1327,8 @@ static int __net_init ip6gre_init_net(struct net *net)
        int err;
 
        ign->fb_tunnel_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6gre0",
-                                          ip6gre_tunnel_setup);
+                                         NET_NAME_UNKNOWN,
+                                         ip6gre_tunnel_setup);
        if (!ign->fb_tunnel_dev) {
                err = -ENOMEM;
                goto err_alloc_dev;
index 51a1eb185ea7b6e255ecdb454eb12ed83875739d..f9de5a69507252a12cbf1efffbf416721d9c871a 100644 (file)
@@ -315,7 +315,8 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct __ip6_tnl_parm *p)
        else
                sprintf(name, "ip6tnl%%d");
 
-       dev = alloc_netdev(sizeof (*t), name, ip6_tnl_dev_setup);
+       dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN,
+                          ip6_tnl_dev_setup);
        if (dev == NULL)
                goto failed;
 
@@ -1773,7 +1774,7 @@ static int __net_init ip6_tnl_init_net(struct net *net)
 
        err = -ENOMEM;
        ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6tnl0",
-                                     ip6_tnl_dev_setup);
+                                       NET_NAME_UNKNOWN, ip6_tnl_dev_setup);
 
        if (!ip6n->fb_tnl_dev)
                goto err_alloc_dev;
index 9aaa6bb229e485fd657a5ca4bd30b6ebb9e90c5f..17ee4fc32dfed1947fc397a805ce72c604d2727b 100644 (file)
@@ -204,7 +204,7 @@ static struct ip6_tnl *vti6_tnl_create(struct net *net, struct __ip6_tnl_parm *p
        else
                sprintf(name, "ip6_vti%%d");
 
-       dev = alloc_netdev(sizeof(*t), name, vti6_dev_setup);
+       dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN, vti6_dev_setup);
        if (dev == NULL)
                goto failed;
 
@@ -1020,7 +1020,7 @@ static int __net_init vti6_init_net(struct net *net)
 
        err = -ENOMEM;
        ip6n->fb_tnl_dev = alloc_netdev(sizeof(struct ip6_tnl), "ip6_vti0",
-                                       vti6_dev_setup);
+                                       NET_NAME_UNKNOWN, vti6_dev_setup);
 
        if (!ip6n->fb_tnl_dev)
                goto err_alloc_dev;
index 8250474ab7dc0e10b3340bca3e68aaf9377a81f2..f9a3fd320d1df23ca1140e3d39e46b4d14a234be 100644 (file)
@@ -744,7 +744,7 @@ static struct net_device *ip6mr_reg_vif(struct net *net, struct mr6_table *mrt)
        else
                sprintf(name, "pim6reg%u", mrt->id);
 
-       dev = alloc_netdev(0, name, reg_vif_setup);
+       dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, reg_vif_setup);
        if (dev == NULL)
                return NULL;
 
index 4f408176dc64eeb306e25e5bde275581080fa523..2e9ba035fb5f51f33e7a1b13416064e57f8cb855 100644 (file)
@@ -250,7 +250,8 @@ static struct ip_tunnel *ipip6_tunnel_locate(struct net *net,
        else
                strcpy(name, "sit%d");
 
-       dev = alloc_netdev(sizeof(*t), name, ipip6_tunnel_setup);
+       dev = alloc_netdev(sizeof(*t), name, NET_NAME_UNKNOWN,
+                          ipip6_tunnel_setup);
        if (dev == NULL)
                return NULL;
 
@@ -1729,6 +1730,7 @@ static int __net_init sit_init_net(struct net *net)
        sitn->tunnels[3] = sitn->tunnels_r_l;
 
        sitn->fb_tunnel_dev = alloc_netdev(sizeof(struct ip_tunnel), "sit0",
+                                          NET_NAME_UNKNOWN,
                                           ipip6_tunnel_setup);
        if (!sitn->fb_tunnel_dev) {
                err = -ENOMEM;
index 365b895da84b5ef3565527675e4103ba05b6dffe..9e0d909390fd0569a50a2e407ee33e2610ae9cae 100644 (file)
@@ -293,7 +293,8 @@ static void irda_device_setup(struct net_device *dev)
  */
 struct net_device *alloc_irdadev(int sizeof_priv)
 {
-       return alloc_netdev(sizeof_priv, "irda%d", irda_device_setup);
+       return alloc_netdev(sizeof_priv, "irda%d", NET_NAME_UNKNOWN,
+                           irda_device_setup);
 }
 EXPORT_SYMBOL(alloc_irdadev);
 
index ffcec225b5d98eb766e2a6396a3e7fe2a65ee729..dc13f1a45f2f7741d98d35d5299e78d4167f2d60 100644 (file)
@@ -96,7 +96,7 @@ static void irlan_eth_setup(struct net_device *dev)
  */
 struct net_device *alloc_irlandev(const char *name)
 {
-       return alloc_netdev(sizeof(struct irlan_cb), name,
+       return alloc_netdev(sizeof(struct irlan_cb), name, NET_NAME_UNKNOWN,
                            irlan_eth_setup);
 }
 
index 76125c57ee6dddd2396a8a0bef4f19e7720e43ed..edb78e69efe47ad3bd2895ceb1a0d5aaf61cfc38 100644 (file)
@@ -246,7 +246,8 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p
                goto out;
        }
 
-       dev = alloc_netdev(sizeof(*priv), name, l2tp_eth_dev_setup);
+       dev = alloc_netdev(sizeof(*priv), name, NET_NAME_UNKNOWN,
+                          l2tp_eth_dev_setup);
        if (!dev) {
                rc = -ENOMEM;
                goto out_del_session;
index bbf51b2f0651cf17e3dfec900fc2ce725b28c75d..4edfc7c1524ff9d162e493122a58a2a98bc0ce32 100644 (file)
@@ -1624,9 +1624,9 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
                if (local->hw.queues >= IEEE80211_NUM_ACS)
                        txqs = IEEE80211_NUM_ACS;
 
-               ndev = alloc_netdev_mqs(sizeof(*sdata) +
-                                       local->hw.vif_data_size,
-                                       name, ieee80211_if_setup, txqs, 1);
+               ndev = alloc_netdev_mqs(sizeof(*sdata) + local->hw.vif_data_size,
+                                       name, NET_NAME_UNKNOWN,
+                                       ieee80211_if_setup, txqs, 1);
                if (!ndev)
                        return -ENOMEM;
                dev_net_set(ndev, wiphy_net(local->hw.wiphy));
index 9b54370f5e8715fc7fa64fb68f888d4200e35f3b..b36b2b99657870196437b616bb71c5a12f71ebb0 100644 (file)
@@ -167,11 +167,13 @@ mac802154_add_iface(struct wpan_phy *phy, const char *name, int type)
        switch (type) {
        case IEEE802154_DEV_MONITOR:
                dev = alloc_netdev(sizeof(struct mac802154_sub_if_data),
-                                  name, mac802154_monitor_setup);
+                                  name, NET_NAME_UNKNOWN,
+                                  mac802154_monitor_setup);
                break;
        case IEEE802154_DEV_WPAN:
                dev = alloc_netdev(sizeof(struct mac802154_sub_if_data),
-                                  name, mac802154_wpan_setup);
+                                  name, NET_NAME_UNKNOWN,
+                                  mac802154_wpan_setup);
                break;
        default:
                dev = NULL;
index ede50d197e10dfaf3ec73670f40a82ae94c51111..71cf1bffea060a23ca2452e34a02109bd9186a6b 100644 (file)
@@ -1418,7 +1418,7 @@ static int __init nr_proto_init(void)
                struct net_device *dev;
 
                sprintf(name, "nr%d", i);
-               dev = alloc_netdev(0, name, nr_setup);
+               dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, nr_setup);
                if (!dev) {
                        printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n");
                        goto fail;
index 295471a66c788fe2e0c3604e5edad94283c96468..bd658555afdfcd2a05a22d61c3a46b524c7d3ebd 100644 (file)
@@ -165,7 +165,8 @@ static struct vport *internal_dev_create(const struct vport_parms *parms)
        netdev_vport = netdev_vport_priv(vport);
 
        netdev_vport->dev = alloc_netdev(sizeof(struct internal_dev),
-                                        parms->name, do_setup);
+                                        parms->name, NET_NAME_UNKNOWN,
+                                        do_setup);
        if (!netdev_vport->dev) {
                err = -ENOMEM;
                goto error_free_vport;
index 66dc65e7c6a1079d09f63c6caa3de115cc22bc54..e9a83a637185aa227c6b0b1a2dc6ebc50aab7385 100644 (file)
@@ -267,7 +267,7 @@ int gprs_attach(struct sock *sk)
                return -EINVAL; /* need packet boundaries */
 
        /* Create net device */
-       dev = alloc_netdev(sizeof(*gp), ifname, gprs_setup);
+       dev = alloc_netdev(sizeof(*gp), ifname, NET_NAME_UNKNOWN, gprs_setup);
        if (!dev)
                return -ENOMEM;
        gp = netdev_priv(dev);
index 8451c8cdc9deb534ed335a065c64a47e570170cd..a85c1a086ae44f71b48be0112e08ae5164ac2c9e 100644 (file)
@@ -1538,7 +1538,7 @@ static int __init rose_proto_init(void)
                char name[IFNAMSIZ];
 
                sprintf(name, "rose%d", i);
-               dev = alloc_netdev(0, name, rose_setup);
+               dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, rose_setup);
                if (!dev) {
                        printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n");
                        rc = -ENOMEM;
index 474167162947acb83220c539a490c6bd62dc9e8b..bd33793b527e176b07f7bacb77143ed38e32d31c 100644 (file)
@@ -485,8 +485,8 @@ static int __init teql_init(void)
                struct net_device *dev;
                struct teql_master *master;
 
-               dev = alloc_netdev(sizeof(struct teql_master),
-                                 "teql%d", teql_master_setup);
+               dev = alloc_netdev(sizeof(struct teql_master), "teql%d",
+                                  NET_NAME_UNKNOWN, teql_master_setup);
                if (!dev) {
                        err = -ENOMEM;
                        break;