From: Vladimir Sokolovsky Date: Tue, 10 Jul 2012 12:47:14 +0000 (+0300) Subject: Backport compat to RHEL6.3 X-Git-Tag: vofed-3.5-x~11 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=c07ec61875678398c7a87641d4085e123a4f2de1;p=~emulex%2Ffor-vlad%2Fcompat.git Backport compat to RHEL6.3 Signed-off-by: Vladimir Sokolovsky --- diff --git a/include/linux/compat-2.6.33.h b/include/linux/compat-2.6.33.h index 441a331..ea4e37b 100644 --- a/include/linux/compat-2.6.33.h +++ b/include/linux/compat-2.6.33.h @@ -56,11 +56,15 @@ static inline void compat_release_firmware(const struct firmware *fw) #define KEY_RFKILL 247 /* Key that controls all radios */ #endif +#ifndef IFF_DONT_BRIDGE #define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */ +#endif /* IFF_DONT_BRIDGE */ /* source: include/linux/if.h */ /* this will never happen on older kernels */ +#ifndef NETDEV_POST_INIT #define NETDEV_POST_INIT 0xffff +#endif /* NETDEV_POST_INIT */ /* mask netdev_alloc_skb_ip_align as debian squeeze also backports this */ #define netdev_alloc_skb_ip_align(a, b) compat_netdev_alloc_skb_ip_align(a, b) diff --git a/include/linux/compat-2.6.34.h b/include/linux/compat-2.6.34.h index b5a40e2..6f1ab5c 100644 --- a/include/linux/compat-2.6.34.h +++ b/include/linux/compat-2.6.34.h @@ -244,7 +244,9 @@ do { \ * enabled. Lockdep gives a nice error when your attribute is * added to sysfs if you don't have this. */ +#ifndef sysfs_bin_attr_init #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr) +#endif /* sysfs_bin_attr_init */ #define usb_alloc_coherent(dev, size, mem_flags, dma) usb_buffer_alloc(dev, size, mem_flags, dma) #define usb_free_coherent(dev, size, addr, dma) usb_buffer_free(dev, size, addr, dma) diff --git a/include/linux/compat-2.6.35.h b/include/linux/compat-2.6.35.h index 5798b41..0bcc8f6 100644 --- a/include/linux/compat-2.6.35.h +++ b/include/linux/compat-2.6.35.h @@ -22,6 +22,8 @@ * was modified in the kernel itself to support this. We * treat the system as uni-processor in this case. */ +#define irq_set_affinity_hint(a, b) compat_irq_set_affinity_hint(a, b) + static inline int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m) { @@ -44,6 +46,9 @@ extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); #define pm_qos_request(_qos) pm_qos_requirement(_qos) +/* mask hex_to_bin as RHEL6.3 backports this */ +#define usb_pipe_endpoint(a, b) compat_usb_pipe_endpoint(a, b) + static inline struct usb_host_endpoint * usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe) { diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h index 56d5961..b78f992 100644 --- a/include/linux/compat-2.6.36.h +++ b/include/linux/compat-2.6.36.h @@ -94,12 +94,14 @@ struct pm_qos_request_list { #endif +#ifdef CONFIG_COMPAT_NO_PRINTK_NEEDED /* * Dummy printk for disabled debugging statements to use whilst maintaining * gcc's format and side-effect checking. */ static inline __attribute__ ((format (printf, 1, 2))) int no_printk(const char *s, ...) { return 0; } +#endif /* CONFIG_COMPAT_NO_PRINTK_NEEDED */ #ifndef alloc_workqueue #define alloc_workqueue(name, flags, max_active) __create_workqueue(name, flags, max_active, 0) diff --git a/include/linux/compat-3.1.h b/include/linux/compat-3.1.h index cfe166a..ff80b88 100644 --- a/include/linux/compat-3.1.h +++ b/include/linux/compat-3.1.h @@ -32,6 +32,9 @@ static inline bool ip_is_fragment(const struct iphdr *iph) return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0; } +/* mask __netdev_alloc_skb_ip_align as RHEL6.3 backports it */ +#define __netdev_alloc_skb_ip_align(a, b, c) compat__netdev_alloc_skb_ip_align(a, b, c) + static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, unsigned int length, gfp_t gfp) { diff --git a/include/linux/compat-3.2.h b/include/linux/compat-3.2.h index 789b4b5..c44bec1 100644 --- a/include/linux/compat-3.2.h +++ b/include/linux/compat-3.2.h @@ -18,6 +18,8 @@ extern int __ethtool_get_settings(struct net_device *dev, struct ethtool_cmd *cmd); +#ifdef CONFIG_COMPAT_SKB_FRAG_NEEDED + /** * skb_frag_page - retrieve the page refered to by a paged fragment * @frag: the paged fragment @@ -113,6 +115,8 @@ static inline void skb_frag_size_sub(skb_frag_t *frag, int delta) frag->size -= delta; } +#endif /* CONFIG_COMPAT_SKB_FRAG_NEEDED */ + static inline char *hex_byte_pack(char *buf, u8 byte) { *buf++ = hex_asc_hi(byte); diff --git a/include/linux/compat-3.3.h b/include/linux/compat-3.3.h index 620e661..3342852 100644 --- a/include/linux/compat-3.3.h +++ b/include/linux/compat-3.3.h @@ -11,6 +11,8 @@ #include #if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,9) && LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,23) && LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))) +/* mask qdisc_cb_private_validate as RHEL6.3 backports it */ +#define qdisc_cb_private_validate(a, b) compat_qdisc_cb_private_validate(a, b) #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37)) static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz) {