summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-12-11 20:24:42 +0000
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2008-12-11 20:24:42 +0000
commit503050b2a504ee3da8b9f39545ab7f0847328a89 (patch)
tree1a98051059dbb661539f188fe50c67108fe5d888
parente1725069d22f67f074d21e34680e3dfa970e5528 (diff)
Add a separate case for hotplug of kernels <= 2.6.9 .
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5498 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/xpp/xbus-core.h13
-rw-r--r--drivers/dahdi/xpp/xbus-sysfs.c16
-rw-r--r--drivers/dahdi/xpp/xdefs.h3
3 files changed, 30 insertions, 2 deletions
diff --git a/drivers/dahdi/xpp/xbus-core.h b/drivers/dahdi/xpp/xbus-core.h
index 95cbaa8..057e6cd 100644
--- a/drivers/dahdi/xpp/xbus-core.h
+++ b/drivers/dahdi/xpp/xbus-core.h
@@ -319,6 +319,19 @@ void xpp_driver_exit(void);
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 */
diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c
index 81b1cf8..f74c811 100644
--- a/drivers/dahdi/xpp/xbus-sysfs.c
+++ b/drivers/dahdi/xpp/xbus-sysfs.c
@@ -319,8 +319,20 @@ void astribank_uevent_send(xbus_t *xbus, enum kobject_action act)
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
diff --git a/drivers/dahdi/xpp/xdefs.h b/drivers/dahdi/xpp/xdefs.h
index 430f8ef..4bdcf8a 100644
--- a/drivers/dahdi/xpp/xdefs.h
+++ b/drivers/dahdi/xpp/xdefs.h
@@ -120,6 +120,9 @@ typedef unsigned char byte;
#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) \