summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSportsstar89 <sjpirri@gmail.com>2013-12-19 10:23:30 -0800
committerSportsstar89 <sjpirri@gmail.com>2014-03-15 19:25:02 -0400
commitb6fbbfe3dcaa8e9c9f7934402fdc17db35cf6946 (patch)
treec16afe913bce731b070f2b59282a7533bcbaceb8
parenta2df1cff23eac0e18ca1763ceff38407412251e7 (diff)
downloadandroid_hardware_ti_wlan-b6fbbfe3dcaa8e9c9f7934402fdc17db35cf6946.tar.gz
android_hardware_ti_wlan-b6fbbfe3dcaa8e9c9f7934402fdc17db35cf6946.tar.bz2
android_hardware_ti_wlan-b6fbbfe3dcaa8e9c9f7934402fdc17db35cf6946.zip
* This fixes compilation and function on newer version kernels Change-Id: I5b2155c44f426f16d314dce330e0b789f808d18e
-rw-r--r--mac80211/compat_wl12xx/include/linux/compat-2.6.h3
-rw-r--r--mac80211/compat_wl12xx/include/linux/compat-3.2.h12
-rw-r--r--mac80211/compat_wl12xx/include/linux/compat-3.3.h18
-rw-r--r--mac80211/compat_wl12xx/include/linux/compat-3.4.h82
-rw-r--r--mac80211/compat_wl12xx/include/linux/compat-3.5.h146
-rw-r--r--mac80211/compat_wl12xx/include/linux/export.h2
6 files changed, 263 insertions, 0 deletions
diff --git a/mac80211/compat_wl12xx/include/linux/compat-2.6.h b/mac80211/compat_wl12xx/include/linux/compat-2.6.h
index 3ccd0516..2bb0c1d4 100644
--- a/mac80211/compat_wl12xx/include/linux/compat-2.6.h
+++ b/mac80211/compat_wl12xx/include/linux/compat-2.6.h
@@ -38,5 +38,8 @@
#include <linux/compat-3.1.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>
+
#endif /* LINUX_26_COMPAT_H */
diff --git a/mac80211/compat_wl12xx/include/linux/compat-3.2.h b/mac80211/compat_wl12xx/include/linux/compat-3.2.h
index fb9ef68b..cb14f0b1 100644
--- a/mac80211/compat_wl12xx/include/linux/compat-3.2.h
+++ b/mac80211/compat_wl12xx/include/linux/compat-3.2.h
@@ -64,6 +64,18 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
module_driver(__platform_driver, platform_driver_register, \
platform_driver_unregister)
+static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
+ dma_addr_t *dma_handle, gfp_t flag)
+{
+ void *ret = dma_alloc_coherent(dev, size, dma_handle, flag);
+ if (ret)
+ memset(ret, 0, size);
+ return ret;
+}
+
+extern int __netdev_printk(const char *level, const struct net_device *dev,
+ struct va_format *vaf);
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) */
#endif /* LINUX_3_2_COMPAT_H */
diff --git a/mac80211/compat_wl12xx/include/linux/compat-3.3.h b/mac80211/compat_wl12xx/include/linux/compat-3.3.h
index 81384aa9..620e661c 100644
--- a/mac80211/compat_wl12xx/include/linux/compat-3.3.h
+++ b/mac80211/compat_wl12xx/include/linux/compat-3.3.h
@@ -7,7 +7,25 @@
/* include to override NL80211_FEATURE_SK_TX_STATUS */
#include <linux/nl80211.h>
+#include <linux/skbuff.h>
+#include <net/sch_generic.h>
+#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)))
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37))
+static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
+{
+ BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct qdisc_skb_cb) + sz);
+}
+#else
+static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
+{
+ /* XXX ? */
+}
+#endif
+#endif
+
+extern struct sk_buff *__pskb_copy(struct sk_buff *skb,
+ int headroom, gfp_t gfp_mask);
static inline void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
{
diff --git a/mac80211/compat_wl12xx/include/linux/compat-3.4.h b/mac80211/compat_wl12xx/include/linux/compat-3.4.h
new file mode 100644
index 00000000..f3437959
--- /dev/null
+++ b/mac80211/compat_wl12xx/include/linux/compat-3.4.h
@@ -0,0 +1,82 @@
+#ifndef LINUX_3_4_COMPAT_H
+#define LINUX_3_4_COMPAT_H
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+
+extern int simple_open(struct inode *inode, struct file *file);
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
+#define skb_add_rx_frag(skb, i, page, off, size, truesize) \
+ v2_6_28_skb_add_rx_frag(skb, i, page, off, size)
+#else
+#define skb_add_rx_frag(skb, i, page, off, size, truesize) \
+ skb_add_rx_frag(skb, i, page, off, size)
+#endif
+
+#ifdef CONFIG_X86_X32_ABI
+#define COMPAT_USE_64BIT_TIME \
+ (!!(task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT))
+#else
+#define COMPAT_USE_64BIT_TIME 0
+#endif
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12))
+static inline void eth_hw_addr_random(struct net_device *dev)
+{
+#error eth_hw_addr_random() needs to be implemented for < 2.6.12
+}
+#else /* kernels >= 2.6.12 */
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31))
+static inline void eth_hw_addr_random(struct net_device *dev)
+{
+ get_random_bytes(dev->dev_addr, ETH_ALEN);
+ dev->dev_addr[0] &= 0xfe; /* clear multicast bit */
+ dev->dev_addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
+}
+#else /* kernels >= 2.6.31 */
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
+/* So this is 2.6.31..2.6.35 */
+
+/* Just have the flags present, they won't really mean anything though */
+#define NET_ADDR_PERM 0 /* address is permanent (default) */
+#define NET_ADDR_RANDOM 1 /* address is generated randomly */
+#define NET_ADDR_STOLEN 2 /* address is stolen from other device */
+
+static inline void eth_hw_addr_random(struct net_device *dev)
+{
+ random_ether_addr(dev->dev_addr);
+}
+
+#else /* 2.6.36 and on */
+static inline void eth_hw_addr_random(struct net_device *dev)
+{
+ dev_hw_addr_random(dev, dev->dev_addr);
+}
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)) */
+
+/* source include/linux/pci.h */
+/**
+ * module_pci_driver() - Helper macro for registering a PCI driver
+ * @__pci_driver: pci_driver struct
+ *
+ * Helper macro for PCI drivers which do not do anything special in module
+ * init/exit. This eliminates a lot of boilerplate. Each module may only
+ * use this macro once, and calling it replaces module_init() and module_exit()
+ */
+#define module_pci_driver(__pci_driver) \
+ module_driver(__pci_driver, pci_register_driver, \
+ pci_unregister_driver)
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
+
+#endif /* LINUX_5_4_COMPAT_H */
diff --git a/mac80211/compat_wl12xx/include/linux/compat-3.5.h b/mac80211/compat_wl12xx/include/linux/compat-3.5.h
new file mode 100644
index 00000000..c9ba6af8
--- /dev/null
+++ b/mac80211/compat_wl12xx/include/linux/compat-3.5.h
@@ -0,0 +1,146 @@
+#ifndef LINUX_3_5_COMPAT_H
+#define LINUX_3_5_COMPAT_H
+
+#include <linux/version.h>
+#include <linux/fs.h>
+#include <linux/etherdevice.h>
+#include <linux/net.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
+
+#include <linux/pkt_sched.h>
+
+/*
+ * This backports:
+ *
+ * From 76e3cc126bb223013a6b9a0e2a51238d1ef2e409 Mon Sep 17 00:00:00 2001
+ * From: Eric Dumazet <edumazet@google.com>
+ * Date: Thu, 10 May 2012 07:51:25 +0000
+ * Subject: [PATCH] codel: Controlled Delay AQM
+ */
+
+/* CODEL */
+
+enum {
+ TCA_CODEL_UNSPEC,
+ TCA_CODEL_TARGET,
+ TCA_CODEL_LIMIT,
+ TCA_CODEL_INTERVAL,
+ TCA_CODEL_ECN,
+ __TCA_CODEL_MAX
+};
+
+#define TCA_CODEL_MAX (__TCA_CODEL_MAX - 1)
+
+struct tc_codel_xstats {
+ __u32 maxpacket; /* largest packet we've seen so far */
+ __u32 count; /* how many drops we've done since the last time we
+ * entered dropping state
+ */
+ __u32 lastcount; /* count at entry to dropping state */
+ __u32 ldelay; /* in-queue delay seen by most recently dequeued packet */
+ __s32 drop_next; /* time to drop next packet */
+ __u32 drop_overlimit; /* number of time max qdisc packet limit was hit */
+ __u32 ecn_mark; /* number of packets we ECN marked instead of dropped */
+ __u32 dropping; /* are we in dropping state ? */
+};
+
+/* This backports:
+ *
+ * commit 4b549a2ef4bef9965d97cbd992ba67930cd3e0fe
+ * Author: Eric Dumazet <edumazet@google.com>
+ * Date: Fri May 11 09:30:50 2012 +0000
+ * fq_codel: Fair Queue Codel AQM
+ */
+
+/* FQ_CODEL */
+
+enum {
+ TCA_FQ_CODEL_UNSPEC,
+ TCA_FQ_CODEL_TARGET,
+ TCA_FQ_CODEL_LIMIT,
+ TCA_FQ_CODEL_INTERVAL,
+ TCA_FQ_CODEL_ECN,
+ TCA_FQ_CODEL_FLOWS,
+ TCA_FQ_CODEL_QUANTUM,
+ __TCA_FQ_CODEL_MAX
+};
+
+#define TCA_FQ_CODEL_MAX (__TCA_FQ_CODEL_MAX - 1)
+
+enum {
+ TCA_FQ_CODEL_XSTATS_QDISC,
+ TCA_FQ_CODEL_XSTATS_CLASS,
+};
+
+struct tc_fq_codel_qd_stats {
+ __u32 maxpacket; /* largest packet we've seen so far */
+ __u32 drop_overlimit; /* number of time max qdisc
+ * packet limit was hit
+ */
+ __u32 ecn_mark; /* number of packets we ECN marked
+ * instead of being dropped
+ */
+ __u32 new_flow_count; /* number of time packets
+ * created a 'new flow'
+ */
+ __u32 new_flows_len; /* count of flows in new list */
+ __u32 old_flows_len; /* count of flows in old list */
+};
+
+struct tc_fq_codel_cl_stats {
+ __s32 deficit;
+ __u32 ldelay; /* in-queue delay seen by most recently
+ * dequeued packet
+ */
+ __u32 count;
+ __u32 lastcount;
+ __u32 dropping;
+ __s32 drop_next;
+};
+
+struct tc_fq_codel_xstats {
+ __u32 type;
+ union {
+ struct tc_fq_codel_qd_stats qdisc_stats;
+ struct tc_fq_codel_cl_stats class_stats;
+ };
+};
+
+
+/* Backports tty_lock: Localise the lock */
+#define tty_lock(__tty) tty_lock()
+#define tty_unlock(__tty) tty_unlock()
+
+/* Backport ether_addr_equal */
+static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
+{
+ return !compare_ether_addr(addr1, addr2);
+}
+
+#define net_ratelimited_function(function, ...) \
+do { \
+ if (net_ratelimit()) \
+ function(__VA_ARGS__); \
+} while (0)
+
+#define net_emerg_ratelimited(fmt, ...) \
+ net_ratelimited_function(pr_emerg, fmt, ##__VA_ARGS__)
+#define net_alert_ratelimited(fmt, ...) \
+ net_ratelimited_function(pr_alert, fmt, ##__VA_ARGS__)
+#define net_crit_ratelimited(fmt, ...) \
+ net_ratelimited_function(pr_crit, fmt, ##__VA_ARGS__)
+#define net_err_ratelimited(fmt, ...) \
+ net_ratelimited_function(pr_err, fmt, ##__VA_ARGS__)
+#define net_notice_ratelimited(fmt, ...) \
+ net_ratelimited_function(pr_notice, fmt, ##__VA_ARGS__)
+#define net_warn_ratelimited(fmt, ...) \
+ net_ratelimited_function(pr_warn, fmt, ##__VA_ARGS__)
+#define net_info_ratelimited(fmt, ...) \
+ net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__)
+#define net_dbg_ratelimited(fmt, ...) \
+ net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */
+
+#endif /* LINUX_3_5_COMPAT_H */
diff --git a/mac80211/compat_wl12xx/include/linux/export.h b/mac80211/compat_wl12xx/include/linux/export.h
index f7842b7a..0ff85a1c 100644
--- a/mac80211/compat_wl12xx/include/linux/export.h
+++ b/mac80211/compat_wl12xx/include/linux/export.h
@@ -3,10 +3,12 @@
#include <linux/version.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
#include_next <linux/export.h>
#else
#include <linux/module.h>
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */
#endif /* _COMPAT_LINUX_EXPORT_H */