]> git.openfabrics.org - ~emulex/for-vlad/old/compat.git/commitdiff
Added RHEL6.4 support
authorRupert Dance <rsdance@soft-forge.com>
Wed, 22 May 2013 16:21:20 +0000 (19:21 +0300)
committerVladimir Sokolovsky <vlad@mellanox.com>
Wed, 22 May 2013 16:21:20 +0000 (19:21 +0300)
Signed-off-by: Rupert Dance <rsdance@soft-forge.com>
16 files changed:
compat/compat-2.6.33.c
compat/compat-2.6.35.c
compat/compat-3.0.c
compat/compat-3.4.c
compat/compat-3.5.c
compat/kstrtox.c
include/linux/compat-2.6.34.h
include/linux/compat-2.6.36.h
include/linux/compat-2.6.37.h
include/linux/compat-2.6.38.h
include/linux/compat-2.6.39.h
include/linux/compat-3.0.h
include/linux/compat-3.2.h
include/linux/compat-3.3.h
include/linux/compat-3.4.h
include/linux/compat-3.5.h

index 04e2fd09f7149096d108493180f338b7c7e4dbba..a9172cbcb15b8407e66e0a9588761ebdf1d8a29c 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/compat.h>
 #include <linux/autoconf.h>
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
+
 #if defined(CONFIG_PCCARD) || defined(CONFIG_PCCARD_MODULE)
 
 /**
@@ -128,5 +130,7 @@ EXPORT_SYMBOL_GPL(pcmcia_loop_tuple);
 
 #endif /* CONFIG_PCMCIA */
 
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
+
 #endif /* CONFIG_PCCARD */
 
index 24551722274dbb2ac5e37d173305ab2acf89cbce..242a903b850f112c05f0f0ef299ffa751eab372c 100644 (file)
@@ -29,6 +29,7 @@ int compat_hex_to_bin(char ch)
 }
 EXPORT_SYMBOL_GPL(compat_hex_to_bin);
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 /**
  * noop_llseek - No Operation Performed llseek implementation
  * @file:      file structure to seek on
@@ -45,4 +46,5 @@ loff_t noop_llseek(struct file *file, loff_t offset, int origin)
        return file->f_pos;
 }
 EXPORT_SYMBOL_GPL(noop_llseek);
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
index 1da45ac12b9ab652e203ab4640aa032fa730a453..1e7a69ba65675f48b4a65305c3e1ac169fa70042 100644 (file)
@@ -9,6 +9,8 @@
  * Compatibility file for Linux wireless for kernels 3.0.
  */
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
+
 #include <linux/compat.h>
 #include <linux/if_ether.h>
 
@@ -60,3 +62,5 @@ kstrto_from_user(kstrtou16_from_user, kstrtou16,      u16);
 kstrto_from_user(kstrtos16_from_user,  kstrtos16,      s16);
 kstrto_from_user(kstrtou8_from_user,   kstrtou8,       u8);
 kstrto_from_user(kstrtos8_from_user,   kstrtos8,       s8);
+
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
index 4721fa2d1f46ac7cba5efa688f247e170c1725f8..de46ac9ae2046c4011f8872c73b6c62a6584ed92 100644 (file)
@@ -8,6 +8,8 @@
  * Compatibility file for Linux wireless for kernels 3.4.
  */
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
+
 #include <linux/fs.h>
 #include <linux/module.h>
 
@@ -18,3 +20,5 @@ int simple_open(struct inode *inode, struct file *file)
        return 0;
 }
 EXPORT_SYMBOL_GPL(simple_open);
+
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
index 8e87e18d23c476b5d48f7399bf7e902ae02bb7a5..231df8270b81adae42bf50e7cc397c16fc6b1794 100644 (file)
@@ -7,6 +7,7 @@
  *
  * Compatibility file for Linux wireless for kernels 3.4.
  */
+#ifndef  CONFIG_COMPAT_RHEL_6_4
 #include <linux/pkt_sched.h>
 #define ECN_OR_COST(class)     TC_PRIO_##class
 
@@ -29,3 +30,4 @@ const __u8 ip_tos2prio[16] = {
        ECN_OR_COST(INTERACTIVE_BULK)
 };
 EXPORT_SYMBOL(ip_tos2prio);
+#endif  /* CONFIG_COMPAT_RHEL_6_4 */
index 44859d19a5b34ecc55d388e526a1c4c8d396b328..540902d83f0a6f95252acbfc41e7566a375e18fd 100644 (file)
@@ -26,6 +26,8 @@
 #include <linux/module.h>
 #include <linux/types.h>
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
+
 static inline char _tolower(const char c)
 {
        return c | 0x20;
@@ -233,4 +235,6 @@ int kstrtos8(const char *s, unsigned int base, s8 *res)
        return 0;
 }
 EXPORT_SYMBOL_GPL(kstrtos8);
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
+
 #endif /* #ifndef strict_strtol */
index 6f1ab5c16ce1881540b26a719f0c6b8a4f0a9630..2035e35dbbf04dde017c1887680662847b81506e 100644 (file)
@@ -287,10 +287,11 @@ static inline int usb_enable_autosuspend(struct usb_device *udev)
 static inline int usb_disable_autosuspend(struct usb_device *udev)
 { return 0; }
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 #define rcu_dereference_protected(p, c) (p)
 #define rcu_access_pointer(p)   ACCESS_ONCE(p)
-
 #define rcu_dereference_raw(p) rcu_dereference(p)
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 #define KEY_WPS_BUTTON         0x211   /* WiFi Protected Setup key */
 
index b78f992b7f14daa4d6c6ad3bb5cd0ec6631bcc58..84b110d7b613fb579e22d35e738e79b31ff56131 100644 (file)
 #include <linux/pm_qos_params.h>
 #include <linux/smp_lock.h>
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 #define kparam_block_sysfs_write(a)
 #define kparam_unblock_sysfs_write(a)
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 /* mask va_format as RHEL6 backports this */
 #define va_format compat_va_format
@@ -34,6 +36,7 @@ extern struct urb *compat_usb_get_from_anchor(struct usb_anchor *anchor);
 extern void compat_usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
 #endif
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 /**
  * pcmcia_read_config_byte() - read a byte from a card configuration register
  *
@@ -60,6 +63,7 @@ static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t wh
        conf_reg_t reg = { 0, CS_WRITE, where, val };
        return pcmcia_access_configuration_register(p_dev, &reg);
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 struct pm_qos_request_list {
        u32 qos;
@@ -135,9 +139,11 @@ static inline bool skb_defer_rx_timestamp(struct sk_buff *skb)
        return false;
 }
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 static inline void skb_tx_timestamp(struct sk_buff *skb)
 {
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 /*
  * System-wide workqueues which are always present.
index d0abd1b34c1c44d71bcaf1b9c81413ef5534c966..6c92b626ae7b24850a118389621fcad638d84a8b 100644 (file)
@@ -31,6 +31,7 @@ static inline int proto_ports_offset(int proto)
 
 #define VLAN_N_VID              4096
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 /*
  *     netif_set_real_num_rx_queues - set actual number of RX queues used
  *     @dev: Network device
@@ -47,6 +48,7 @@ static inline int netif_set_real_num_rx_queues(struct net_device *dev,
 {
     return 0;
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 extern struct kobj_ns_type_operations net_ns_type_operations;
 
@@ -68,7 +70,9 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb)
 #endif
 }
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 #define pcmcia_enable_device(link)     pcmcia_request_configuration(link, &link->conf)
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 #include <net/genetlink.h>
 
@@ -156,8 +160,10 @@ extern void compat_led_brightness_set(struct led_classdev *led_cdev,
 
 extern void *vzalloc(unsigned long size);
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 #define rtnl_dereference(p)                                     \
         rcu_dereference_protected(p, lockdep_rtnl_is_held())
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 /**
  * RCU_INIT_POINTER() - initialize an RCU protected pointer
index c2d50265c33d7bea12645a46c9bbc2fb3bda1d54..afef7b6fa42bb7064f40d52ce4c82c1ff3919290 100644 (file)
@@ -72,12 +72,15 @@ static inline unsigned long ewma_read(const struct ewma *avg)
 }
 
 #define pr_warn pr_warning
+
+#ifndef CONFIG_COMPAT_RHEL_6_4
 #define create_freezable_workqueue create_freezeable_workqueue
 
 static inline int skb_checksum_start_offset(const struct sk_buff *skb)
 {
        return skb->csum_start - skb_headroom(skb);
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 /* from include/linux/printk.h */ 
 #define pr_emerg_once(fmt, ...)                                        \
index 92edbd4e7451ad9d414fdb72b5bfc99020e8fe58..24f15363f23dd38c03ddb37525112d7b6d6f0d7b 100644 (file)
@@ -21,6 +21,8 @@ static inline int netif_is_bond_slave(struct net_device *dev)
 {
        return dev->flags & IFF_SLAVE && dev->priv_flags & IFF_BONDING;
 }
+
+#ifndef CONFIG_COMPAT_RHEL_6_4
 static inline int irq_set_irq_wake(unsigned int irq, unsigned int on)
 {
        return set_irq_wake(irq, on);
@@ -41,6 +43,8 @@ static inline int irq_set_irq_type(unsigned int irq, unsigned int type)
 {
        return set_irq_type(irq, type);
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
+
 static inline int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry)
 {
        return set_irq_msi(irq, entry);
@@ -102,6 +106,7 @@ static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
 }
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) */
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 /* 
  * kstrto* was included in kernel 2.6.38.4 and causes conflicts with the
  * version included in compat-wireless. We use strict_strtol to check if
@@ -183,6 +188,7 @@ static inline void __clear_bit_le(int nr, void *addr)
 {
        __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */
 
index f1df271c29f0fad4a113e62b1f2a0f5a7bb7f736..85dbacee24fa175d22a808fa1407cdde2030aa78 100644 (file)
@@ -50,6 +50,7 @@ struct bcma_device_id {
 
 int mac_pton(const char *s, u8 *mac);
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 int __must_check kstrtoull_from_user(const char __user *s, size_t count, unsigned int base, unsigned long long *res);
 int __must_check kstrtoll_from_user(const char __user *s, size_t count, unsigned int base, long long *res);
 int __must_check kstrtoul_from_user(const char __user *s, size_t count, unsigned int base, unsigned long *res);
@@ -96,6 +97,7 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t
                }                                                       \
                call_rcu(&(data)->rcuhead, __kfree_rcu_fn);             \
        } while (0)
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 #ifdef MODULE
 
@@ -125,6 +127,7 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t
 
 #endif
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 /*
  * enum ethtool_phys_id_state - indicator state for physical identification
  * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
@@ -140,6 +143,7 @@ enum ethtool_phys_id_state {
     ETHTOOL_ID_ON,
     ETHTOOL_ID_OFF
 };
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)) */
 
index d888d81d6a025f01af70b54fbd3a563d014575f8..69705397a618a42fade8ad701a018d57f9d3bb4a 100644 (file)
@@ -144,6 +144,7 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
         module_driver(__platform_driver, platform_driver_register, \
                         platform_driver_unregister)
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
                                        dma_addr_t *dma_handle, gfp_t flag)
 {
@@ -152,6 +153,7 @@ static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
                memset(ret, 0, size);
        return ret;
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 extern int __netdev_printk(const char *level, const struct net_device *dev,
                           struct va_format *vaf);
index 0c8fd087a8162fd8887e928900354e58a3ac5315..5bab8a8d0d70fd1154ca213c2effe722893d449f 100644 (file)
@@ -29,10 +29,13 @@ static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
 extern struct sk_buff *__pskb_copy(struct sk_buff *skb,
                                   int headroom, gfp_t gfp_mask);
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 static inline void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
 {
        WARN_ON(1);
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
+
 #define NL80211_FEATURE_SK_TX_STATUS 0
 
 typedef u32 netdev_features_t;
index f34379593145fb3c38645089eec0da9a276c20ac..fe3fa65c16b719ba70c87ab2cebd747f6c52a5bc 100644 (file)
@@ -49,10 +49,12 @@ static inline void eth_hw_addr_random(struct net_device *dev)
 #define NET_ADDR_RANDOM                1       /* address is generated randomly */
 #define NET_ADDR_STOLEN                2       /* address is stolen from other device */
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 static inline void eth_hw_addr_random(struct net_device *dev)
 {
        random_ether_addr(dev->dev_addr);
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 #else /* 2.6.36 and on */
 static inline void eth_hw_addr_random(struct net_device *dev)
index eb11ba153e041d0be5978c6a4af6de55be4ab121..0a8e7e288bef52860c9f9ad0a04daf33e4f5dc57 100644 (file)
@@ -21,6 +21,7 @@
  *
  */
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 static inline int fault_in_multipages_writeable(char __user *uaddr, int size)
 {
         int ret = 0;
@@ -74,6 +75,7 @@ static inline int fault_in_multipages_readable(const char __user *uaddr,
 
         return ret;
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 /* switcheroo is available on >= 2.6.34 */
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
@@ -211,11 +213,13 @@ struct tc_fq_codel_xstats {
 #define tty_lock(__tty) tty_lock()
 #define tty_unlock(__tty) tty_unlock()
 
+#ifndef CONFIG_COMPAT_RHEL_6_4
 /* Backport ether_addr_equal */
 static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
 {
     return !compare_ether_addr(addr1, addr2);
 }
+#endif /* CONFIG_COMPAT_RHEL_6_4 */
 
 #define net_ratelimited_function(function, ...)                        \
 do {                                                           \