[svn-commits] tzafrir: linux/trunk r5498 - /linux/trunk/drivers/dahdi/xpp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Dec 11 14:24:43 CST 2008


Author: tzafrir
Date: Thu Dec 11 14:24:42 2008
New Revision: 5498

URL: http://svn.digium.com/view/dahdi?view=rev&rev=5498
Log:
Add a separate case for hotplug of kernels <= 2.6.9 .

Modified:
    linux/trunk/drivers/dahdi/xpp/xbus-core.h
    linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c
    linux/trunk/drivers/dahdi/xpp/xdefs.h

Modified: linux/trunk/drivers/dahdi/xpp/xbus-core.h
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-core.h?view=diff&rev=5498&r1=5497&r2=5498
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-core.h (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-core.h Thu Dec 11 14:24:42 2008
@@ -319,6 +319,19 @@
 int	xbus_sysfs_create(xbus_t *xbus);
 void	xbus_sysfs_remove(xbus_t *xbus);
 
+#ifdef	OLD_HOTPLUG_SUPPORT_269
+/* Copy from new kernels lib/kobject_uevent.c */
+enum kobject_action {
+	KOBJ_ADD,
+	KOBJ_REMOVE,
+	KOBJ_CHANGE,
+	KOBJ_MOUNT,
+	KOBJ_UMOUNT,
+	KOBJ_OFFLINE,
+	KOBJ_ONLINE,
+};
+#endif
+
 void	astribank_uevent_send(xbus_t *xbus, enum kobject_action act);
 
 #endif	/* XBUS_CORE_H */

Modified: linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c?view=diff&rev=5498&r1=5497&r2=5498
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c Thu Dec 11 14:24:42 2008
@@ -319,8 +319,20 @@
 	XBUS_DBG(DEVICES, xbus, "SYFS bus_id=%s action=%d\n",
 		xbus->astribank.bus_id, act);
 
-#ifdef	OLD_HOTPLUG_SUPPORT
-	kobject_hotplug(kobj, act);
+#ifdef	OLD_HOTPLUG_SUPPORT_269
+ 	{
+ 		/* Copy from new kernels lib/kobject_uevent.c */
+ 		static const char	*str[] = {
+ 			[KOBJ_ADD]	"add",
+ 			[KOBJ_REMOVE]	"remove",
+ 			[KOBJ_CHANGE]	"change",
+ 			[KOBJ_MOUNT]	"mount",
+ 			[KOBJ_UMOUNT]	"umount",
+ 			[KOBJ_OFFLINE]	"offline",
+ 			[KOBJ_ONLINE]	"online"
+ 		};
+ 		kobject_hotplug(str[act], kobj);
+ 	}
 #else
 	kobject_uevent(kobj, act);
 #endif

Modified: linux/trunk/drivers/dahdi/xpp/xdefs.h
URL: http://svn.digium.com/view/dahdi/linux/trunk/drivers/dahdi/xpp/xdefs.h?view=diff&rev=5498&r1=5497&r2=5498
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xdefs.h (original)
+++ linux/trunk/drivers/dahdi/xpp/xdefs.h Thu Dec 11 14:24:42 2008
@@ -120,6 +120,9 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
 #define	OLD_HOTPLUG_SUPPORT	// for older kernels
 #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
+#define	OLD_HOTPLUG_SUPPORT_269// for way older kernels
+#endif
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
 #define	DEVICE_ATTR_READER(name,dev,buf)	\




More information about the svn-commits mailing list