Jesse Keating 2f82dda
From c413dfa59bf979475a9647cc165f547021efeb27 Mon Sep 17 00:00:00 2001
Jesse Keating 2f82dda
From: David Woodhouse <dwmw2@infradead.org>
Jesse Keating 2f82dda
Date: Wed, 31 Mar 2010 02:10:20 +0100
Jesse Keating 2f82dda
Subject: [PATCH 1/2] phylib: Support phy module autoloading
Jesse Keating 2f82dda
Jesse Keating 2f82dda
We don't use the normal hotplug mechanism because it doesn't work. It will
Jesse Keating 2f82dda
load the module some time after the device appears, but that's not good
Jesse Keating 2f82dda
enough for us -- we need the driver loaded _immediately_ because otherwise
Jesse Keating 2f82dda
the NIC driver may just abort and then the phy 'device' goes away.
Jesse Keating 2f82dda
Jesse Keating 2f82dda
[bwh: s/phy/mdio/ in module alias, kerneldoc for struct mdio_device_id]
Jesse Keating 2f82dda
Jesse Keating 2f82dda
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Jesse Keating 2f82dda
---
Jesse Keating 2f82dda
 drivers/net/phy/phy_device.c    |   12 ++++++++++++
Jesse Keating 2f82dda
 include/linux/mod_devicetable.h |   26 ++++++++++++++++++++++++++
Jesse Keating 2f82dda
 include/linux/phy.h             |    1 +
Jesse Keating 2f82dda
 scripts/mod/file2alias.c        |   26 ++++++++++++++++++++++++++
Jesse Keating 2f82dda
 4 files changed, 65 insertions(+), 0 deletions(-)
Jesse Keating 2f82dda
Jesse Keating 2f82dda
From 9ddd9886cc89827a4713e9a96614148272fdaa8e Mon Sep 17 00:00:00 2001
Jesse Keating 2f82dda
From: David Woodhouse <dwmw2@infradead.org>
Jesse Keating 2f82dda
Date: Wed, 31 Mar 2010 02:12:06 +0100
Jesse Keating 2f82dda
Subject: [PATCH 2/2] phylib: Add module table to all existing phy drivers
Jesse Keating 2f82dda
Jesse Keating 2f82dda
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Jesse Keating 2f82dda
---
Jesse Keating 2f82dda
 drivers/net/phy/bcm63xx.c  |    8 ++++++++
Jesse Keating 2f82dda
 drivers/net/phy/broadcom.c |   16 ++++++++++++++++
Jesse Keating 2f82dda
 drivers/net/phy/cicada.c   |    8 ++++++++
Jesse Keating 2f82dda
 drivers/net/phy/davicom.c  |    9 +++++++++
Jesse Keating 2f82dda
 drivers/net/phy/et1011c.c  |    7 +++++++
Jesse Keating 2f82dda
 drivers/net/phy/icplus.c   |    7 +++++++
Jesse Keating 2f82dda
 drivers/net/phy/lxt.c      |    8 ++++++++
Jesse Keating 2f82dda
 drivers/net/phy/marvell.c  |   13 +++++++++++++
Jesse Keating 2f82dda
 drivers/net/phy/national.c |    7 +++++++
Jesse Keating 2f82dda
 drivers/net/phy/qsemi.c    |    7 +++++++
Jesse Keating 2f82dda
 drivers/net/phy/realtek.c  |    7 +++++++
Jesse Keating 2f82dda
 drivers/net/phy/smsc.c     |   11 +++++++++++
Jesse Keating 2f82dda
 drivers/net/phy/ste10Xp.c  |    8 ++++++++
Jesse Keating 2f82dda
 drivers/net/phy/vitesse.c  |    8 ++++++++
Jesse Keating 2f82dda
 14 files changed, 124 insertions(+), 0 deletions(-)
Jesse Keating 2f82dda
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
Jesse Keating 2f82dda
index b10fedd..0db6781 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/phy_device.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/phy_device.c
Jesse Keating 2f82dda
@@ -149,6 +149,7 @@ EXPORT_SYMBOL(phy_scan_fixups);
Jesse Keating 2f82dda
 struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
Jesse Keating 2f82dda
 {
Jesse Keating 2f82dda
 	struct phy_device *dev;
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
 	/* We allocate the device, and initialize the
Jesse Keating 2f82dda
 	 * default values */
Jesse Keating 2f82dda
 	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
Jesse Keating 2f82dda
@@ -178,6 +179,17 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 	mutex_init(&dev->lock);
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
+	/* Request the appropriate module unconditionally; don't
Jesse Keating 2f82dda
+	   bother trying to do so only if it isn't already loaded,
Jesse Keating 2f82dda
+	   because that gets complicated. A hotplug event would have
Jesse Keating 2f82dda
+	   done an unconditional modprobe anyway.
Jesse Keating 2f82dda
+	   We don't do normal hotplug because it won't work for MDIO
Jesse Keating 2f82dda
+	   -- because it relies on the device staying around for long
Jesse Keating 2f82dda
+	   enough for the driver to get loaded. With MDIO, the NIC
Jesse Keating 2f82dda
+	   driver will get bored and give up as soon as it finds that
Jesse Keating 2f82dda
+	   there's no driver _already_ loaded. */
Jesse Keating 2f82dda
+	request_module(MDIO_MODULE_PREFIX MDIO_ID_FMT, MDIO_ID_ARGS(phy_id));
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
 	return dev;
Jesse Keating 2f82dda
 }
Jesse Keating 2f82dda
 EXPORT_SYMBOL(phy_device_create);
Jesse Keating 2f82dda
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
Jesse Keating 2f82dda
index f58e9d8..55f1f9c 100644
Jesse Keating 2f82dda
--- a/include/linux/mod_devicetable.h
Jesse Keating 2f82dda
+++ b/include/linux/mod_devicetable.h
Jesse Keating 2f82dda
@@ -474,4 +474,30 @@ struct platform_device_id {
Jesse Keating 2f82dda
 			__attribute__((aligned(sizeof(kernel_ulong_t))));
Jesse Keating 2f82dda
 };
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
+#define MDIO_MODULE_PREFIX	"mdio:"
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+#define MDIO_ID_FMT "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d"
Jesse Keating 2f82dda
+#define MDIO_ID_ARGS(_id) \
Jesse Keating 2f82dda
+	(_id)>>31, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1,	\
Jesse Keating 2f82dda
+	((_id)>>27) & 1, ((_id)>>26) & 1, ((_id)>>25) & 1, ((_id)>>24) & 1, \
Jesse Keating 2f82dda
+	((_id)>>23) & 1, ((_id)>>22) & 1, ((_id)>>21) & 1, ((_id)>>20) & 1, \
Jesse Keating 2f82dda
+	((_id)>>19) & 1, ((_id)>>18) & 1, ((_id)>>17) & 1, ((_id)>>16) & 1, \
Jesse Keating 2f82dda
+	((_id)>>15) & 1, ((_id)>>14) & 1, ((_id)>>13) & 1, ((_id)>>12) & 1, \
Jesse Keating 2f82dda
+	((_id)>>11) & 1, ((_id)>>10) & 1, ((_id)>>9) & 1, ((_id)>>8) & 1, \
Jesse Keating 2f82dda
+	((_id)>>7) & 1, ((_id)>>6) & 1, ((_id)>>5) & 1, ((_id)>>4) & 1, \
Jesse Keating 2f82dda
+	((_id)>>3) & 1, ((_id)>>2) & 1, ((_id)>>1) & 1, (_id) & 1
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+/**
Jesse Keating 2f82dda
+ * struct mdio_device_id - identifies PHY devices on an MDIO/MII bus
Jesse Keating 2f82dda
+ * @phy_id: The result of
Jesse Keating 2f82dda
+ *     (mdio_read(&MII_PHYSID1) << 16 | mdio_read(&PHYSID2)) & @phy_id_mask
Jesse Keating 2f82dda
+ *     for this PHY type
Jesse Keating 2f82dda
+ * @phy_id_mask: Defines the significant bits of @phy_id.  A value of 0
Jesse Keating 2f82dda
+ *     is used to terminate an array of struct mdio_device_id.
Jesse Keating 2f82dda
+ */
Jesse Keating 2f82dda
+struct mdio_device_id {
Jesse Keating 2f82dda
+	__u32 phy_id;
Jesse Keating 2f82dda
+	__u32 phy_id_mask;
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
 #endif /* LINUX_MOD_DEVICETABLE_H */
Jesse Keating 2f82dda
diff --git a/include/linux/phy.h b/include/linux/phy.h
Jesse Keating 2f82dda
index b1368b8..b85de0d 100644
Jesse Keating 2f82dda
--- a/include/linux/phy.h
Jesse Keating 2f82dda
+++ b/include/linux/phy.h
Jesse Keating 2f82dda
@@ -24,6 +24,7 @@
Jesse Keating 2f82dda
 #include <linux/mii.h>
Jesse Keating 2f82dda
 #include <linux/timer.h>
Jesse Keating 2f82dda
 #include <linux/workqueue.h>
Jesse Keating 2f82dda
+#include <linux/mod_devicetable.h>
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 #include <asm/atomic.h>
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
Jesse Keating 2f82dda
index 62a9025..05f0c06 100644
Jesse Keating 2f82dda
--- a/scripts/mod/file2alias.c
Jesse Keating 2f82dda
+++ b/scripts/mod/file2alias.c
Jesse Keating 2f82dda
@@ -727,6 +727,28 @@ static int do_platform_entry(const char *filename,
Jesse Keating 2f82dda
 	return 1;
Jesse Keating 2f82dda
 }
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
+static int do_mdio_entry(const char *filename,
Jesse Keating 2f82dda
+			 struct mdio_device_id *id, char *alias)
Jesse Keating 2f82dda
+{
Jesse Keating 2f82dda
+	int i;
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+	alias += sprintf(alias, MDIO_MODULE_PREFIX);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+	for (i = 0; i < 32; i++) {
Jesse Keating 2f82dda
+		if (!((id->phy_id_mask >> (31-i)) & 1))
Jesse Keating 2f82dda
+			*(alias++) = '?';
Jesse Keating 2f82dda
+		else if ((id->phy_id >> (31-i)) & 1)
Jesse Keating 2f82dda
+			*(alias++) = '1';
Jesse Keating 2f82dda
+		else
Jesse Keating 2f82dda
+			*(alias++) = '0';
Jesse Keating 2f82dda
+	}
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+	/* Terminate the string */
Jesse Keating 2f82dda
+	*alias = 0;
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+	return 1;
Jesse Keating 2f82dda
+}
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
 /* Ignore any prefix, eg. some architectures prepend _ */
Jesse Keating 2f82dda
 static inline int sym_is(const char *symbol, const char *name)
Jesse Keating 2f82dda
 {
Jesse Keating 2f82dda
@@ -874,6 +896,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
Jesse Keating 2f82dda
 		do_table(symval, sym->st_size,
Jesse Keating 2f82dda
 			 sizeof(struct platform_device_id), "platform",
Jesse Keating 2f82dda
 			 do_platform_entry, mod);
Jesse Keating 2f82dda
+	else if (sym_is(symname, "__mod_mdio_device_table"))
Jesse Keating 2f82dda
+		do_table(symval, sym->st_size,
Jesse Keating 2f82dda
+			 sizeof(struct mdio_device_id), "mdio",
Jesse Keating 2f82dda
+			 do_mdio_entry, mod);
Jesse Keating 2f82dda
 	free(zeros);
Jesse Keating 2f82dda
 }
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/bcm63xx.c b/drivers/net/phy/bcm63xx.c
Jesse Keating 2f82dda
index 4fed95e..ac5e498 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/bcm63xx.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/bcm63xx.c
Jesse Keating 2f82dda
@@ -130,3 +130,11 @@ static void __exit bcm63xx_phy_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(bcm63xx_phy_init);
Jesse Keating 2f82dda
 module_exit(bcm63xx_phy_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id bcm63xx_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x00406000, 0xfffffc00 },
Jesse Keating 2f82dda
+	{ 0x002bdc00, 0xfffffc00 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, bcm64xx_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
Jesse Keating 2f82dda
index f81e532..f46815d 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/broadcom.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/broadcom.c
Jesse Keating 2f82dda
@@ -830,3 +830,19 @@ static void __exit broadcom_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(broadcom_init);
Jesse Keating 2f82dda
 module_exit(broadcom_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id broadcom_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x00206070, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x002060e0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x002060c0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x002060b0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x0143bca0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x0143bcb0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ PHY_ID_BCM50610, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ PHY_ID_BCM50610M, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ PHY_ID_BCM57780, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x0143bc70, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, broadcom_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/cicada.c b/drivers/net/phy/cicada.c
Jesse Keating 2f82dda
index a1bd599..efc608f 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/cicada.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/cicada.c
Jesse Keating 2f82dda
@@ -159,3 +159,11 @@ static void __exit cicada_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(cicada_init);
Jesse Keating 2f82dda
 module_exit(cicada_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id cicada_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x000fc410, 0x000ffff0 },
Jesse Keating 2f82dda
+	{ 0x000fc440, 0x000fffc0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, cicada_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c
Jesse Keating 2f82dda
index d926168..e02b18c 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/davicom.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/davicom.c
Jesse Keating 2f82dda
@@ -219,3 +219,12 @@ static void __exit davicom_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(davicom_init);
Jesse Keating 2f82dda
 module_exit(davicom_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id davicom_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x0181b880, 0x0ffffff0 },
Jesse Keating 2f82dda
+	{ 0x0181b8a0, 0x0ffffff0 },
Jesse Keating 2f82dda
+	{ 0x00181b80, 0x0ffffff0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, davicom_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/et1011c.c b/drivers/net/phy/et1011c.c
Jesse Keating 2f82dda
index b031fa2..500f0fd 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/et1011c.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/et1011c.c
Jesse Keating 2f82dda
@@ -111,3 +111,10 @@ static void __exit et1011c_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(et1011c_init);
Jesse Keating 2f82dda
 module_exit(et1011c_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id et1011c_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x0282f014, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, et1011c_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c
Jesse Keating 2f82dda
index af3f1f2..e661e90 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/icplus.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/icplus.c
Jesse Keating 2f82dda
@@ -132,3 +132,10 @@ static void __exit ip175c_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(ip175c_init);
Jesse Keating 2f82dda
 module_exit(ip175c_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id icplus_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x02430d80, 0x0ffffff0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, icplus_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
Jesse Keating 2f82dda
index 4cf3324..1d94f1d 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/lxt.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/lxt.c
Jesse Keating 2f82dda
@@ -174,3 +174,11 @@ static void __exit lxt_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(lxt_init);
Jesse Keating 2f82dda
 module_exit(lxt_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id lxt_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x78100000, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x001378e0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, lxt_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
Jesse Keating 2f82dda
index 6f69b9b..4e58b2c 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/marvell.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/marvell.c
Jesse Keating 2f82dda
@@ -611,3 +611,16 @@ static void __exit marvell_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(marvell_init);
Jesse Keating 2f82dda
 module_exit(marvell_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id marvell_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x01410c60, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x01410c90, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x01410cc0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x01410e10, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x01410cb0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x01410cd0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x01410e30, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, marvell_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/national.c b/drivers/net/phy/national.c
Jesse Keating 2f82dda
index 6c636eb..729ab29 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/national.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/national.c
Jesse Keating 2f82dda
@@ -153,3 +153,10 @@ MODULE_LICENSE("GPL");
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(ns_init);
Jesse Keating 2f82dda
 module_exit(ns_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id ns_tbl[] = {
Jesse Keating 2f82dda
+	{ DP83865_PHY_ID, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, ns_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/qsemi.c b/drivers/net/phy/qsemi.c
Jesse Keating 2f82dda
index 23062d0..3ec9610 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/qsemi.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/qsemi.c
Jesse Keating 2f82dda
@@ -138,3 +138,10 @@ static void __exit qs6612_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(qs6612_init);
Jesse Keating 2f82dda
 module_exit(qs6612_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id qs6612_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x00181440, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, qs6612_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
Jesse Keating 2f82dda
index a052a67..f567c0e 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/realtek.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/realtek.c
Jesse Keating 2f82dda
@@ -78,3 +78,10 @@ static void __exit realtek_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(realtek_init);
Jesse Keating 2f82dda
 module_exit(realtek_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id realtek_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x001cc912, 0x001fffff },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, realtek_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
Jesse Keating 2f82dda
index 5123bb9..9fb14b4 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/smsc.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/smsc.c
Jesse Keating 2f82dda
@@ -236,3 +236,14 @@ MODULE_LICENSE("GPL");
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(smsc_init);
Jesse Keating 2f82dda
 module_exit(smsc_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id smsc_tbl[] = {
Jesse Keating 2f82dda
+	{ 0x0007c0a0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x0007c0b0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x0007c0c0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x0007c0d0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ 0x0007c0f0, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, smsc_tbl);
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/ste10Xp.c b/drivers/net/phy/ste10Xp.c
Jesse Keating 2f82dda
index 6bdb0d5..7229009 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/ste10Xp.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/ste10Xp.c
Jesse Keating 2f82dda
@@ -132,6 +132,14 @@ static void __exit ste10Xp_exit(void)
Jesse Keating 2f82dda
 module_init(ste10Xp_init);
Jesse Keating 2f82dda
 module_exit(ste10Xp_exit);
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
+static struct mdio_device_id ste10Xp_tbl[] = {
Jesse Keating 2f82dda
+	{ STE101P_PHY_ID, 0xfffffff0 },
Jesse Keating 2f82dda
+	{ STE100P_PHY_ID, 0xffffffff },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, ste10Xp_tbl);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
 MODULE_DESCRIPTION("STMicroelectronics STe10Xp PHY driver");
Jesse Keating 2f82dda
 MODULE_AUTHOR("Giuseppe Cavallaro <peppe.cavallaro@st.com>");
Jesse Keating 2f82dda
 MODULE_LICENSE("GPL");
Jesse Keating 2f82dda
diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c
Jesse Keating 2f82dda
index dd3b244..45cce50 100644
Jesse Keating 2f82dda
--- a/drivers/net/phy/vitesse.c
Jesse Keating 2f82dda
+++ b/drivers/net/phy/vitesse.c
Jesse Keating 2f82dda
@@ -191,3 +191,11 @@ static void __exit vsc82xx_exit(void)
Jesse Keating 2f82dda
 
Jesse Keating 2f82dda
 module_init(vsc82xx_init);
Jesse Keating 2f82dda
 module_exit(vsc82xx_exit);
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+static struct mdio_device_id vitesse_tbl[] = {
Jesse Keating 2f82dda
+	{ PHY_ID_VSC8244, 0x000fffc0 },
Jesse Keating 2f82dda
+	{ PHY_ID_VSC8221, 0x000ffff0 },
Jesse Keating 2f82dda
+	{ }
Jesse Keating 2f82dda
+};
Jesse Keating 2f82dda
+
Jesse Keating 2f82dda
+MODULE_DEVICE_TABLE(mdio, vitesse_tbl);
Jesse Keating 2f82dda
-- 
Jesse Keating 2f82dda
1.6.6.1
Jesse Keating 2f82dda