summaryrefslogtreecommitdiff
path: root/kernel/xpp/xdefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/xpp/xdefs.h')
-rw-r--r--kernel/xpp/xdefs.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/xpp/xdefs.h b/kernel/xpp/xdefs.h
index 9e6b783..ca6e964 100644
--- a/kernel/xpp/xdefs.h
+++ b/kernel/xpp/xdefs.h
@@ -101,6 +101,7 @@ typedef char *charp;
typedef unsigned char byte;
#ifdef __KERNEL__
+/* Kernel versions... */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
#define KMEM_CACHE_T kmem_cache_t
#else
@@ -113,6 +114,28 @@ typedef unsigned char byte;
kfree(p); \
} while(0);
+/*
+ * Hotplug replaced with uevent in 2.6.16
+ */
+#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) \
+ ssize_t name(struct device *dev, struct device_attribute *attr, char *buf)
+#define DEVICE_ATTR_WRITER(name,dev,buf, count) \
+ ssize_t name(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+#else
+#define DEVICE_ATTR_READER(name,dev,buf) \
+ ssize_t name(struct device *dev, char *buf)
+#define DEVICE_ATTR_WRITER(name,dev,buf, count) \
+ ssize_t name(struct device *dev, const char *buf, size_t count)
+#endif
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
/* Also don't define this for later RHEL >= 5.2 . hex_asc is from the
* same linux-2.6-net-infrastructure-updates-to-mac80211-iwl4965.patch