]> git.openfabrics.org - ~emulex/tmp/compat/.git/commitdiff
compat: support RHEL6 as a build target
authorJohn W. Linville <linville@tuxdriver.com>
Thu, 17 Nov 2011 22:20:42 +0000 (17:20 -0500)
committerLuis R. Rodriguez <mcgrof@qca.qualcomm.com>
Thu, 17 Nov 2011 23:22:51 +0000 (15:22 -0800)
This patch enables compatibility with RHEL6 as a build target, mostly
with simple tricks similar to what was added for compatibility with
Debian Squeeze.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
compat/compat-2.6.35.c
compat/compat-2.6.37.c
include/linux/compat-2.6.33.h
include/linux/compat-2.6.34.h
include/linux/compat-2.6.35.h
include/linux/compat-2.6.36.h
include/linux/compat-2.6.37.h

index 44a15d63cf9d57caf87ac80593b491e591b718f5..7a31a540b63dd51a277b47e11d5c937749b3e339 100644 (file)
@@ -18,7 +18,7 @@
  * hex_to_bin() converts one hex digit to its actual value or -1 in case of bad
  * input.
  */
-int hex_to_bin(char ch)
+int compat_hex_to_bin(char ch)
 {
        if ((ch >= '0') && (ch <= '9'))
                return ch - '0';
@@ -27,7 +27,7 @@ int hex_to_bin(char ch)
                return ch - 'a' + 10;
        return -1;
 }
-EXPORT_SYMBOL(hex_to_bin);
+EXPORT_SYMBOL(compat_hex_to_bin);
 
 /**
  * noop_llseek - No Operation Performed llseek implementation
index 257880ea3055eff4bad0ce8e2e309ed7083b7c2a..d7259bb6e9fef6e8f4389359dcf2d06fe11442c7 100644 (file)
@@ -345,7 +345,7 @@ EXPORT_SYMBOL(compat_led_classdev_unregister);
  *     For tight control over page level allocator and protection flags
  *     use __vmalloc() instead.
  */
-void *vzalloc(unsigned long size)
+void *compat_vzalloc(unsigned long size)
 {
        void *buf;
        buf = vmalloc(size);
@@ -353,6 +353,6 @@ void *vzalloc(unsigned long size)
                memset(buf, 0, size);
        return buf;
 }
-EXPORT_SYMBOL(vzalloc);
+EXPORT_SYMBOL(compat_vzalloc);
 
 #endif
index e9e888a34e9581834b660d948e4b1919ee7b866e..c900a6fceea32ccbfe79a76873f27a51f63ff0a5 100644 (file)
@@ -13,6 +13,7 @@
 #include <pcmcia/ds.h>
 #endif
 #include <linux/firmware.h>
+#include <linux/input.h>
 
 #if defined(CONFIG_COMPAT_FIRMWARE_CLASS)
 #define release_firmware compat_release_firmware
@@ -49,7 +50,10 @@ static inline void compat_release_firmware(const struct firmware *fw)
 }
 #endif
 
+/* mask KEY_RFKILL as RHEL6 backports this */
+#if !defined(KEY_RFKILL)
 #define KEY_RFKILL             247     /* Key that controls all radios */
+#endif
 
 #define IFF_DONT_BRIDGE 0x800          /* disallow bridging this ether dev */
 /* source: include/linux/if.h */
@@ -131,6 +135,9 @@ static inline int pci_pcie_cap(struct pci_dev *dev)
        return pci_find_capability(dev, PCI_CAP_ID_EXP);
 }
 
+/* mask pci_is_pcie as RHEL6 backports this */
+#define pci_is_pcie(a) compat_pci_is_pcie(a)
+
 /**
  * pci_is_pcie - check if the PCI device is PCI Express capable
  * @dev: PCI device
index 562ccf7975cb0709b931541ce23ea8981716032c..a9c9dd11679abe992a508763100146b912f691f2 100644 (file)
@@ -46,6 +46,9 @@
 #define netdev_info(dev, format, args...)                      \
        netdev_printk(KERN_INFO, dev, format, ##args)
 
+/* mask netdev_dbg as RHEL6 backports this */
+#if !defined(netdev_dbg)
+
 #if defined(DEBUG)
 #define netdev_dbg(__dev, format, args...)                     \
        netdev_printk(KERN_DEBUG, __dev, format, ##args)
@@ -64,6 +67,11 @@ do {                                                         \
 })
 #endif
 
+#endif
+
+/* mask netdev_vdbg as RHEL6 backports this */
+#if !defined(netdev_dbg)
+
 #if defined(VERBOSE_DEBUG)
 #define netdev_vdbg    netdev_dbg
 #else
@@ -76,6 +84,8 @@ do {                                                          \
 })
 #endif
 
+#endif
+
 /*
  * netdev_WARN() acts like dev_printk(), but with the key difference
  * of using a WARN/WARN_ON to get the message out, including the
@@ -107,6 +117,9 @@ do {                                                                \
 #define netif_info(priv, type, dev, fmt, args...)              \
        netif_printk(priv, type, KERN_INFO, (dev), fmt, ##args)
 
+/* mask netif_dbg as RHEL6 backports this */
+#if !defined(netif_dbg)
+
 #if defined(DEBUG)
 #define netif_dbg(priv, type, dev, format, args...)            \
        netif_printk(priv, type, KERN_DEBUG, dev, format, ##args)
@@ -127,6 +140,11 @@ do {                                                               \
 })
 #endif
 
+#endif
+
+/* mask netif_vdbg as RHEL6 backports this */
+#if !defined(netif_vdbg)
+
 #if defined(VERBOSE_DEBUG)
 #define netif_vdbg     netdev_dbg
 #else
@@ -137,6 +155,7 @@ do {                                                                \
        0;                                                      \
 })
 #endif
+#endif
 /* source: include/linux/netdevice.h */
 
 
index 857a5217eddfd91881d03ac6d9d81f090b645d5a..5e43002f75bc0ddd516c1e1e9b3150177fbb61d8 100644 (file)
@@ -26,6 +26,9 @@ static inline wait_queue_head_t *sk_sleep(struct sock *sk)
 
 #define sdio_writeb_readb(func, write_byte, addr, err_ret) sdio_readb(func, addr, err_ret)
 
+/* mask hex_to_bin as RHEL6 backports this */
+#define hex_to_bin(a) compat_hex_to_bin(a)
+
 int hex_to_bin(char ch);
 
 extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
index 29ade270a9e9ec5f799b0e4e7cc502ea20894c78..b5d9975fc22230a98117a7fc08936bdb6cf7bb99 100644 (file)
@@ -14,6 +14,9 @@
 #define kparam_block_sysfs_write(a)
 #define kparam_unblock_sysfs_write(a)
 
+/* mask va_format as RHEL6 backports this */
+#define va_format compat_va_format
+
 struct va_format {
        const char *fmt;
        va_list *va;
index d375746f5dd37d0035d824bd41001d37894b29ab..c19e781846b3b015fc628c7f3f157d0c760dc06d 100644 (file)
@@ -12,6 +12,9 @@
 
 extern struct kobj_ns_type_operations net_ns_type_operations;
 
+/* mask skb_checksum_none_assert as RHEL6 backports this */
+#define skb_checksum_none_assert(a) compat_skb_checksum_none_assert(a)
+
 /**
  * skb_checksum_none_assert - make sure skb ip_summed is CHECKSUM_NONE
  * @skb: skb to check
@@ -110,6 +113,9 @@ extern void compat_led_brightness_set(struct led_classdev *led_cdev,
 
 #define netdev_refcnt_read(a) atomic_read(&a->refcnt)
 
+/* mask vzalloc as RHEL6 backports this */
+#define vzalloc(a) compat_vzalloc(a)
+
 extern void *vzalloc(unsigned long size);
 
 #define rtnl_dereference(p)                                     \