From: Rupert Dance Date: Wed, 22 May 2013 16:21:20 +0000 (+0300) Subject: Added RHEL6.4 support X-Git-Tag: vofed-3.5-x~3 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=85ebc0345fce54b02d8a5c66690da770f96130bc;p=~emulex%2Ffor-vlad%2Fold%2Fcompat.git Added RHEL6.4 support Signed-off-by: Rupert Dance --- diff --git a/compat/compat-2.6.33.c b/compat/compat-2.6.33.c index 04e2fd0..a9172cb 100644 --- a/compat/compat-2.6.33.c +++ b/compat/compat-2.6.33.c @@ -11,6 +11,8 @@ #include #include +#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 */ diff --git a/compat/compat-2.6.35.c b/compat/compat-2.6.35.c index 2455172..242a903 100644 --- a/compat/compat-2.6.35.c +++ b/compat/compat-2.6.35.c @@ -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 */ diff --git a/compat/compat-3.0.c b/compat/compat-3.0.c index 1da45ac..1e7a69b 100644 --- a/compat/compat-3.0.c +++ b/compat/compat-3.0.c @@ -9,6 +9,8 @@ * Compatibility file for Linux wireless for kernels 3.0. */ +#ifndef CONFIG_COMPAT_RHEL_6_4 + #include #include @@ -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 */ diff --git a/compat/compat-3.4.c b/compat/compat-3.4.c index 4721fa2..de46ac9 100644 --- a/compat/compat-3.4.c +++ b/compat/compat-3.4.c @@ -8,6 +8,8 @@ * Compatibility file for Linux wireless for kernels 3.4. */ +#ifndef CONFIG_COMPAT_RHEL_6_4 + #include #include @@ -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 */ diff --git a/compat/compat-3.5.c b/compat/compat-3.5.c index 8e87e18..231df82 100644 --- a/compat/compat-3.5.c +++ b/compat/compat-3.5.c @@ -7,6 +7,7 @@ * * Compatibility file for Linux wireless for kernels 3.4. */ +#ifndef CONFIG_COMPAT_RHEL_6_4 #include #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 */ diff --git a/compat/kstrtox.c b/compat/kstrtox.c index 44859d1..540902d 100644 --- a/compat/kstrtox.c +++ b/compat/kstrtox.c @@ -26,6 +26,8 @@ #include #include +#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 */ diff --git a/include/linux/compat-2.6.34.h b/include/linux/compat-2.6.34.h index 6f1ab5c..2035e35 100644 --- a/include/linux/compat-2.6.34.h +++ b/include/linux/compat-2.6.34.h @@ -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 */ diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h index b78f992..84b110d 100644 --- a/include/linux/compat-2.6.36.h +++ b/include/linux/compat-2.6.36.h @@ -11,8 +11,10 @@ #include #include +#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, ®); } +#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. diff --git a/include/linux/compat-2.6.37.h b/include/linux/compat-2.6.37.h index d0abd1b..6c92b62 100644 --- a/include/linux/compat-2.6.37.h +++ b/include/linux/compat-2.6.37.h @@ -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 @@ -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 diff --git a/include/linux/compat-2.6.38.h b/include/linux/compat-2.6.38.h index c2d5026..afef7b6 100644 --- a/include/linux/compat-2.6.38.h +++ b/include/linux/compat-2.6.38.h @@ -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, ...) \ diff --git a/include/linux/compat-2.6.39.h b/include/linux/compat-2.6.39.h index 92edbd4..24f1536 100644 --- a/include/linux/compat-2.6.39.h +++ b/include/linux/compat-2.6.39.h @@ -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)) */ diff --git a/include/linux/compat-3.0.h b/include/linux/compat-3.0.h index f1df271..85dbace 100644 --- a/include/linux/compat-3.0.h +++ b/include/linux/compat-3.0.h @@ -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)) */ diff --git a/include/linux/compat-3.2.h b/include/linux/compat-3.2.h index d888d81..6970539 100644 --- a/include/linux/compat-3.2.h +++ b/include/linux/compat-3.2.h @@ -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); diff --git a/include/linux/compat-3.3.h b/include/linux/compat-3.3.h index 0c8fd08..5bab8a8 100644 --- a/include/linux/compat-3.3.h +++ b/include/linux/compat-3.3.h @@ -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; diff --git a/include/linux/compat-3.4.h b/include/linux/compat-3.4.h index f343795..fe3fa65 100644 --- a/include/linux/compat-3.4.h +++ b/include/linux/compat-3.4.h @@ -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) diff --git a/include/linux/compat-3.5.h b/include/linux/compat-3.5.h index eb11ba1..0a8e7e2 100644 --- a/include/linux/compat-3.5.h +++ b/include/linux/compat-3.5.h @@ -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 { \