[kernel] r15621 - dists/trunk/linux-2.6/debian/patches/features/all

Ben Hutchings benh at alioth.debian.org
Tue May 4 23:23:15 UTC 2010


Author: benh
Date: Tue May  4 23:23:13 2010
New Revision: 15621

Log:
Fix incomplete patch

Modified:
   dists/trunk/linux-2.6/debian/patches/features/all/phylib-Support-phy-module-autoloading.patch

Modified: dists/trunk/linux-2.6/debian/patches/features/all/phylib-Support-phy-module-autoloading.patch
==============================================================================
--- dists/trunk/linux-2.6/debian/patches/features/all/phylib-Support-phy-module-autoloading.patch	Tue May  4 02:55:51 2010	(r15620)
+++ dists/trunk/linux-2.6/debian/patches/features/all/phylib-Support-phy-module-autoloading.patch	Tue May  4 23:23:13 2010	(r15621)
@@ -15,8 +15,11 @@
 Acked-by: Andy Fleming <afleming at freescale.com>
 Signed-off-by: David S. Miller <davem at davemloft.net>
 ---
- drivers/net/phy/phy_device.c |   12 ++++++++++++
- 1 files changed, 12 insertions(+), 0 deletions(-)
+ drivers/net/phy/phy_device.c    |   12 ++++++++++++
+ include/linux/mod_devicetable.h |   26 ++++++++++++++++++++++++++
+ include/linux/phy.h             |    1 +
+ scripts/mod/file2alias.c        |   26 ++++++++++++++++++++++++++
+ 4 files changed, 65 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
 index db17945..1a99bb2 100644
@@ -48,6 +51,97 @@
  	return dev;
  }
  EXPORT_SYMBOL(phy_device_create);
+diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
+index f58e9d8..55f1f9c 100644
+--- a/include/linux/mod_devicetable.h
++++ b/include/linux/mod_devicetable.h
+@@ -474,4 +474,30 @@ struct platform_device_id {
+ 			__attribute__((aligned(sizeof(kernel_ulong_t))));
+ };
+ 
++#define MDIO_MODULE_PREFIX	"mdio:"
++
++#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"
++#define MDIO_ID_ARGS(_id) \
++	(_id)>>31, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1,	\
++	((_id)>>27) & 1, ((_id)>>26) & 1, ((_id)>>25) & 1, ((_id)>>24) & 1, \
++	((_id)>>23) & 1, ((_id)>>22) & 1, ((_id)>>21) & 1, ((_id)>>20) & 1, \
++	((_id)>>19) & 1, ((_id)>>18) & 1, ((_id)>>17) & 1, ((_id)>>16) & 1, \
++	((_id)>>15) & 1, ((_id)>>14) & 1, ((_id)>>13) & 1, ((_id)>>12) & 1, \
++	((_id)>>11) & 1, ((_id)>>10) & 1, ((_id)>>9) & 1, ((_id)>>8) & 1, \
++	((_id)>>7) & 1, ((_id)>>6) & 1, ((_id)>>5) & 1, ((_id)>>4) & 1, \
++	((_id)>>3) & 1, ((_id)>>2) & 1, ((_id)>>1) & 1, (_id) & 1
++
++/**
++ * struct mdio_device_id - identifies PHY devices on an MDIO/MII bus
++ * @phy_id: The result of
++ *     (mdio_read(&MII_PHYSID1) << 16 | mdio_read(&PHYSID2)) & @phy_id_mask
++ *     for this PHY type
++ * @phy_id_mask: Defines the significant bits of @phy_id.  A value of 0
++ *     is used to terminate an array of struct mdio_device_id.
++ */
++struct mdio_device_id {
++	__u32 phy_id;
++	__u32 phy_id_mask;
++};
++
+ #endif /* LINUX_MOD_DEVICETABLE_H */
+diff --git a/include/linux/phy.h b/include/linux/phy.h
+index d9bce4b..987e111 100644
+--- a/include/linux/phy.h
++++ b/include/linux/phy.h
+@@ -24,6 +24,7 @@
+ #include <linux/mii.h>
+ #include <linux/timer.h>
+ #include <linux/workqueue.h>
++#include <linux/mod_devicetable.h>
+ 
+ #include <asm/atomic.h>
+ 
+diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
+index 220213e..36a60a8 100644
+--- a/scripts/mod/file2alias.c
++++ b/scripts/mod/file2alias.c
+@@ -796,6 +796,28 @@ static int do_platform_entry(const char *filename,
+ 	return 1;
+ }
+ 
++static int do_mdio_entry(const char *filename,
++			 struct mdio_device_id *id, char *alias)
++{
++	int i;
++
++	alias += sprintf(alias, MDIO_MODULE_PREFIX);
++
++	for (i = 0; i < 32; i++) {
++		if (!((id->phy_id_mask >> (31-i)) & 1))
++			*(alias++) = '?';
++		else if ((id->phy_id >> (31-i)) & 1)
++			*(alias++) = '1';
++		else
++			*(alias++) = '0';
++	}
++
++	/* Terminate the string */
++	*alias = 0;
++
++	return 1;
++}
++
+ /* Ignore any prefix, eg. some architectures prepend _ */
+ static inline int sym_is(const char *symbol, const char *name)
+ {
+@@ -943,6 +965,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
+ 		do_table(symval, sym->st_size,
+ 			 sizeof(struct platform_device_id), "platform",
+ 			 do_platform_entry, mod);
++	else if (sym_is(symname, "__mod_mdio_device_table"))
++		do_table(symval, sym->st_size,
++			 sizeof(struct mdio_device_id), "mdio",
++			 do_mdio_entry, mod);
+ 	free(zeros);
+ }
+ 
 -- 
 1.7.0.3
 



More information about the Kernel-svn-changes mailing list