 Makefile                |    2 +-
 drivers/pci/pci-label.c |    1 +
 drivers/pci/pci-sysfs.c |    4 ++++
 include/linux/pci.h     |    1 +
 net/core/dev.c          |   38 +++++++++++++++++++++++++++++++-------
 5 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 7431c28..d156b38 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 35
-EXTRAVERSION =
+EXTRAVERSION =.dev2.rev2
 NAME = Sheep on Meth
 
 # *DOCUMENTATION*
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
index 90c0a72..8086268 100644
--- a/drivers/pci/pci-label.c
+++ b/drivers/pci/pci-label.c
@@ -55,6 +55,7 @@ find_smbios_instance_string(struct pci_dev *pdev, char *buf,
 							 "%s\n",
 							 dmi->name);
 			}
+			pdev->firmware_index = donboard->instance;
 			return strlen(dmi->name);
 		}
 	}
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index b5a7d9b..8b829ef 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -28,6 +28,7 @@
 #include "pci.h"
 
 static int sysfs_initialized;	/* = 0 */
+int pci_netdevs_with_fwindex = 0;
 
 /* show configuration fields */
 #define pci_config_attr(field, format_string)				\
@@ -1167,6 +1168,9 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
 
 	pci_create_firmware_label_files(pdev);
 
+	if (pdev->firmware_index && pdev->class == 0x020000)
+		pci_netdevs_with_fwindex++; 
+
 	return 0;
 
 err_vga_file:
diff --git a/include/linux/pci.h b/include/linux/pci.h
index b1d1795..dec7d11 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -243,6 +243,7 @@ struct pci_dev {
 	unsigned short	subsystem_vendor;
 	unsigned short	subsystem_device;
 	unsigned int	class;		/* 3 bytes: (base,sub,prog-if) */
+	unsigned int	firmware_index;
 	u8		revision;	/* PCI revision, low byte of class word */
 	u8		hdr_type;	/* PCI header type (`multi' flag masked out) */
 	u8		pcie_cap;	/* PCI-E capability offset */
diff --git a/net/core/dev.c b/net/core/dev.c
index 1ae6543..49fa2b4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -172,6 +172,8 @@
 static DEFINE_SPINLOCK(ptype_lock);
 static struct list_head ptype_base[PTYPE_HASH_SIZE] __read_mostly;
 static struct list_head ptype_all __read_mostly;	/* Taps */
+extern int pci_netdevs_with_fwindex;
+
 
 /*
  * The @dev_base_head list is protected by @dev_base_lock and the rtnl
@@ -868,12 +870,12 @@ EXPORT_SYMBOL(dev_valid_name);
  *	Returns the number of the unit assigned or a negative errno code.
  */
 
-static int __dev_alloc_name(struct net *net, const char *name, char *buf)
+static int __dev_alloc_name(struct net *net, const char *name, char *buf, unsigned long *inuse)
 {
 	int i = 0;
 	const char *p;
 	const int max_netdevices = 8*PAGE_SIZE;
-	unsigned long *inuse;
+/*	unsigned long *inuse;*/
 	struct net_device *d;
 
 	p = strnchr(name, IFNAMSIZ-1, '%');
@@ -886,15 +888,15 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
 		if (p[1] != 'd' || strchr(p + 2, '%'))
 			return -EINVAL;
 
-		/* Use one page as a bit array of possible slots */
+		/* Use one page as a bit array of possible slots 
 		inuse = (unsigned long *) get_zeroed_page(GFP_ATOMIC);
 		if (!inuse)
-			return -ENOMEM;
+			return -ENOMEM;*/
 
 		for_each_netdev(net, d) {
 			if (!sscanf(d->name, name, &i))
 				continue;
-			if (i < 0 || i >= max_netdevices)
+			if (i < pci_netdevs_with_fwindex || i >= max_netdevices)
 				continue;
 
 			/*  avoid cases where sscanf is not exact inverse of printf */
@@ -904,6 +906,8 @@ static int __dev_alloc_name(struct net *net, const char *name, char *buf)
 		}
 
 		i = find_first_zero_bit(inuse, max_netdevices);
+/*		if (i < pci_netdevs_with_fwindex)
+			i += pci_netdevs_with_fwindex; */
 		free_page((unsigned long) inuse);
 	}
 
@@ -937,11 +941,31 @@ int dev_alloc_name(struct net_device *dev, const char *name)
 {
 	char buf[IFNAMSIZ];
 	struct net *net;
-	int ret;
+	int ret, i;
+	struct pci_dev *pdev;
+	unsigned long *inuse;
 
 	BUG_ON(!dev_net(dev));
 	net = dev_net(dev);
-	ret = __dev_alloc_name(net, name, buf);
+	
+	/* Use one page as a bit array of possible slots */
+	inuse = (unsigned long *) get_zeroed_page(GFP_ATOMIC);
+	if (!inuse)
+		return -ENOMEM;
+
+	for (i = 0; i < pci_netdevs_with_fwindex; i++)
+		set_bit(i, inuse);
+
+	pdev = to_pci_dev(dev->dev.parent);
+	if (pdev && pdev->firmware_index) {
+		printk(KERN_ERR "__%s[%d]__:nk-bus:dev.fn=%02x:%02d.%d, index=%d\n", __func__, __LINE__,
+			pdev->bus->number, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn),
+			pdev->firmware_index);
+		snprintf(dev->name, IFNAMSIZ, name, (pdev->firmware_index - 1));
+		return (pdev->firmware_index -1);
+	}
+
+	ret = __dev_alloc_name(net, name, buf, inuse);
 	if (ret >= 0)
 		strlcpy(dev->name, buf, IFNAMSIZ);
 	return ret;
