Split kernel compatibility into different files
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 6 Jul 2009 17:40:01 +0000 (10:40 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 6 Jul 2009 17:40:01 +0000 (10:40 -0700)
This should make maintaining and readability easier.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
12 files changed:
compat/compat-2.6.28.c [new file with mode: 0644]
compat/compat-2.6.28.h [new file with mode: 0644]
compat/compat-2.6.29.c [new file with mode: 0644]
compat/compat-2.6.29.h [new file with mode: 0644]
compat/compat-2.6.30.c [new file with mode: 0644]
compat/compat-2.6.30.h [new file with mode: 0644]
compat/compat-2.6.31.c [new file with mode: 0644]
compat/compat-2.6.31.h [new file with mode: 0644]
compat/compat.c
compat/compat.diff
compat/compat.h
scripts/admin-update.sh

diff --git a/compat/compat-2.6.28.c b/compat/compat-2.6.28.c
new file mode 100644 (file)
index 0000000..025b1de
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2007      Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Compatibility file for Linux wireless for kernels 2.6.22 - tip
+ * The headers don't need to be modified as we're simply adding them.
+ */
+
+#include <net/compat.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
+
+/* 2.6.27 compat code goes here */
+
+void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
+{
+       /*
+        * Make sure the BAR is actually a memory resource, not an IO resource
+        */
+       if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) {
+               WARN_ON(1);
+               return NULL;
+       }
+       return ioremap_nocache(pci_resource_start(pdev, bar),
+                                    pci_resource_len(pdev, bar));
+}
+EXPORT_SYMBOL_GPL(pci_ioremap_bar);
+
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) */
diff --git a/compat/compat-2.6.28.h b/compat/compat-2.6.28.h
new file mode 100644 (file)
index 0000000..5d84168
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef LINUX_26_28_COMPAT_H
+#define LINUX_26_28_COMPAT_H
+
+#include <linux/autoconf.h>
+#include <linux/version.h>
+#include <linux/compat_autoconf.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
+
+#include <linux/skbuff.h>
+#include <linux/if_ether.h>
+
+#ifndef ETH_P_PAE
+#define ETH_P_PAE 0x888E      /* Port Access Entity (IEEE 802.1X) */
+#endif
+
+#include <linux/pci.h>
+
+#ifndef WARN_ONCE
+#define WARN_ONCE(condition, format...) ({                      \
+       static int __warned;                                    \
+       int __ret_warn_once = !!(condition);                    \
+                                                               \
+       if (unlikely(__ret_warn_once))                          \
+               if (WARN(!__warned, format))                    \
+                       __warned = 1;                           \
+       unlikely(__ret_warn_once);                              \
+})
+#endif /* From include/asm-generic/bug.h */
+
+void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
+
+
+/**
+ *     __skb_queue_head_init - initialize non-spinlock portions of sk_buff_head
+ *     @list: queue to initialize
+ *
+ *     This initializes only the list and queue length aspects of
+ *     an sk_buff_head object.  This allows to initialize the list
+ *     aspects of an sk_buff_head without reinitializing things like
+ *     the spinlock.  It can also be used for on-stack sk_buff_head
+ *     objects where the spinlock is known to not be used.
+ */
+static inline void __skb_queue_head_init(struct sk_buff_head *list)
+{
+       list->prev = list->next = (struct sk_buff *)list;
+       list->qlen = 0;
+}
+
+static inline void __skb_queue_splice(const struct sk_buff_head *list,
+                                     struct sk_buff *prev,
+                                     struct sk_buff *next)
+{
+       struct sk_buff *first = list->next;
+       struct sk_buff *last = list->prev;
+
+       first->prev = prev;
+       prev->next = first;
+
+       last->next = next;
+       next->prev = last;
+}
+
+/**
+ *     skb_queue_splice_tail - join two skb lists and reinitialise the emptied list
+ *     @list: the new list to add
+ *     @head: the place to add it in the first list
+ *
+ *     Each of the lists is a queue.
+ *     The list at @list is reinitialised
+ */
+static inline void skb_queue_splice_tail_init(struct sk_buff_head *list,
+                                             struct sk_buff_head *head)
+{
+       if (!skb_queue_empty(list)) {
+               __skb_queue_splice(list, head->prev, (struct sk_buff *) head);
+               head->qlen += list->qlen;
+               __skb_queue_head_init(list);
+       }
+} /* From include/linux/skbuff.h */
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)) */
+
+#endif /* LINUX_26_28_COMPAT_H */
diff --git a/compat/compat-2.6.29.c b/compat/compat-2.6.29.c
new file mode 100644 (file)
index 0000000..56ecc26
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2007      Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Compatibility file for Linux wireless for kernels 2.6.22 - tip
+ * The headers don't need to be modified as we're simply adding them.
+ */
+
+#include <net/compat.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
+
+/* 2.6.28 compat code goes here */
+
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) */
+
diff --git a/compat/compat-2.6.29.h b/compat/compat-2.6.29.h
new file mode 100644 (file)
index 0000000..6fa4654
--- /dev/null
@@ -0,0 +1,76 @@
+#ifndef LINUX_26_29_COMPAT_H
+#define LINUX_26_29_COMPAT_H
+
+#include <linux/autoconf.h>
+#include <linux/version.h>
+#include <linux/compat_autoconf.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
+
+#include <linux/skbuff.h>
+
+/**
+ *     skb_queue_is_first - check if skb is the first entry in the queue
+ *     @list: queue head
+ *     @skb: buffer
+ *
+ *     Returns true if @skb is the first buffer on the list.
+ */
+static inline bool skb_queue_is_first(const struct sk_buff_head *list,
+                                     const struct sk_buff *skb)
+{
+       return (skb->prev == (struct sk_buff *) list);
+}
+
+/**
+ *     skb_queue_prev - return the prev packet in the queue
+ *     @list: queue head
+ *     @skb: current buffer
+ *
+ *     Return the prev packet in @list before @skb.  It is only valid to
+ *     call this if skb_queue_is_first() evaluates to false.
+ */
+static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list,
+                                            const struct sk_buff *skb)
+{
+       /* This BUG_ON may seem severe, but if we just return then we
+        * are going to dereference garbage.
+        */
+       BUG_ON(skb_queue_is_first(list, skb));
+       return skb->prev;
+}
+
+/**
+ *     skb_queue_is_last - check if skb is the last entry in the queue
+ *     @list: queue head
+ *     @skb: buffer
+ *
+ *     Returns true if @skb is the last buffer on the list.
+ */
+static inline bool skb_queue_is_last(const struct sk_buff_head *list,
+                                    const struct sk_buff *skb)
+{
+       return (skb->next == (struct sk_buff *) list);
+}
+
+/**
+ *     skb_queue_next - return the next packet in the queue
+ *     @list: queue head
+ *     @skb: current buffer
+ *
+ *     Return the next packet in @list after @skb.  It is only valid to
+ *     call this if skb_queue_is_last() evaluates to false.
+ */
+static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list,
+                                             const struct sk_buff *skb)
+{
+       /* This BUG_ON may seem severe, but if we just return then we
+        * are going to dereference garbage.
+        */
+       BUG_ON(skb_queue_is_last(list, skb));
+       return skb->next;
+}
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
+
+#endif /*  LINUX_26_29_COMPAT_H */
diff --git a/compat/compat-2.6.30.c b/compat/compat-2.6.30.c
new file mode 100644 (file)
index 0000000..5f9ee9f
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2007      Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Compatibility file for Linux wireless for kernels 2.6.22 - tip
+ * The headers don't need to be modified as we're simply adding them.
+ */
+
+#include <net/compat.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
+
+/* 2.6.28 compat code goes here */
+
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */
+
diff --git a/compat/compat-2.6.30.h b/compat/compat-2.6.30.h
new file mode 100644 (file)
index 0000000..112cf19
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef LINUX_26_30_COMPAT_H
+#define LINUX_26_30_COMPAT_H
+
+#include <linux/autoconf.h>
+#include <linux/version.h>
+#include <linux/compat_autoconf.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
+/* Nothing ! */
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)) */
+
+#endif /* LINUX_26_30_COMPAT_H */
diff --git a/compat/compat-2.6.31.c b/compat/compat-2.6.31.c
new file mode 100644 (file)
index 0000000..0d48955
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2007      Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Compatibility file for Linux wireless for kernels 2.6.22 - tip
+ * The headers don't need to be modified as we're simply adding them.
+ */
+
+#include <net/compat.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32))
+
+#include <linux/netdevice.h>
+
+int __dev_addr_add(struct dev_addr_list **list, int *count,
+                  void *addr, int alen, int glbl)
+{
+       struct dev_addr_list *da;
+
+       for (da = *list; da != NULL; da = da->next) {
+               if (memcmp(da->da_addr, addr, da->da_addrlen) == 0 &&
+                   da->da_addrlen == alen) {
+                       if (glbl) {
+                               int old_glbl = da->da_gusers;
+                               da->da_gusers = 1;
+                               if (old_glbl)
+                                       return 0;
+                       }
+                       da->da_users++;
+                       return 0;
+               }
+       }
+
+       da = kzalloc(sizeof(*da), GFP_ATOMIC);
+       if (da == NULL)
+               return -ENOMEM;
+       memcpy(da->da_addr, addr, alen);
+       da->da_addrlen = alen;
+       da->da_users = 1;
+       da->da_gusers = glbl ? 1 : 0;
+       da->next = *list;
+       *list = da;
+       (*count)++;
+       return 0;
+}
+
+int __dev_addr_delete(struct dev_addr_list **list, int *count,
+                     void *addr, int alen, int glbl)
+{
+       struct dev_addr_list *da;
+
+       for (; (da = *list) != NULL; list = &da->next) {
+               if (memcmp(da->da_addr, addr, da->da_addrlen) == 0 &&
+                   alen == da->da_addrlen) {
+                       if (glbl) {
+                               int old_glbl = da->da_gusers;
+                               da->da_gusers = 0;
+                               if (old_glbl == 0)
+                                       break;
+                       }
+                       if (--da->da_users)
+                               return 0;
+
+                       *list = da->next;
+                       kfree(da);
+                       (*count)--;
+                       return 0;
+               }
+       }
+       return -ENOENT;
+}
+
+int __dev_addr_sync(struct dev_addr_list **to, int *to_count,
+                   struct dev_addr_list **from, int *from_count)
+{
+       struct dev_addr_list *da, *next;
+       int err = 0;
+
+       da = *from;
+       while (da != NULL) {
+               next = da->next;
+               if (!da->da_synced) {
+                       err = __dev_addr_add(to, to_count,
+                                            da->da_addr, da->da_addrlen, 0);
+                       if (err < 0)
+                               break;
+                       da->da_synced = 1;
+                       da->da_users++;
+               } else if (da->da_users == 1) {
+                       __dev_addr_delete(to, to_count,
+                                         da->da_addr, da->da_addrlen, 0);
+                       __dev_addr_delete(from, from_count,
+                                         da->da_addr, da->da_addrlen, 0);
+               }
+               da = next;
+       }
+       return err;
+}
+EXPORT_SYMBOL_GPL(__dev_addr_sync);
+
+void __dev_addr_unsync(struct dev_addr_list **to, int *to_count,
+                      struct dev_addr_list **from, int *from_count)
+{
+       struct dev_addr_list *da, *next;
+
+       da = *from;
+       while (da != NULL) {
+               next = da->next;
+               if (da->da_synced) {
+                       __dev_addr_delete(to, to_count,
+                                         da->da_addr, da->da_addrlen, 0);
+                       da->da_synced = 0;
+                       __dev_addr_delete(from, from_count,
+                                         da->da_addr, da->da_addrlen, 0);
+               }
+               da = next;
+       }
+}
+EXPORT_SYMBOL_GPL(__dev_addr_unsync);
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) */
+
diff --git a/compat/compat-2.6.31.h b/compat/compat-2.6.31.h
new file mode 100644 (file)
index 0000000..bdfa18d
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef LINUX_26_31_COMPAT_H
+#define LINUX_26_31_COMPAT_H
+
+#include <linux/autoconf.h>
+#include <linux/version.h>
+#include <linux/compat_autoconf.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31))
+
+#ifndef SDIO_DEVICE_ID_MARVELL_8688WLAN
+#define SDIO_DEVICE_ID_MARVELL_8688WLAN                0x9104
+#endif
+
+#ifndef ERFKILL
+#if !defined(CONFIG_ALPHA) && !defined(CONFIG_MIPS) && !defined(CONFIG_PARISC) && !defined(CONFIG_SPARC)
+#define ERFKILL                132     /* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_ALPHA
+#define ERFKILL                138     /* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_MIPS
+#define ERFKILL                167     /* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_PARISC
+#define ERFKILL                256     /* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_SPARC
+#define ERFKILL                134     /* Operation not possible due to RF-kill */
+#endif
+#endif
+
+#ifndef NETDEV_PRE_UP
+#define NETDEV_PRE_UP          0x000D
+#endif
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */
+
+#endif /* LINUX_26_31_COMPAT_H */
index 5c4ccdc344da6710d26a23d807e00ab822fd8dd8..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,151 +0,0 @@
-/*
- * Copyright 2007      Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Compatibility file for Linux wireless for kernels 2.6.22 - tip
- * The headers don't need to be modified as we're simply adding them.
- */
-
-#include <net/compat.h>
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
-
-/* 2.6.27 compat code goes here */
-
-void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
-{
-       /*
-        * Make sure the BAR is actually a memory resource, not an IO resource
-        */
-       if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) {
-               WARN_ON(1);
-               return NULL;
-       }
-       return ioremap_nocache(pci_resource_start(pdev, bar),
-                                    pci_resource_len(pdev, bar));
-}
-EXPORT_SYMBOL_GPL(pci_ioremap_bar);
-
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
-
-/* 2.6.28 compat code goes here */
-
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32))
-
-#include <linux/netdevice.h>
-
-int __dev_addr_add(struct dev_addr_list **list, int *count,
-                  void *addr, int alen, int glbl)
-{
-       struct dev_addr_list *da;
-
-       for (da = *list; da != NULL; da = da->next) {
-               if (memcmp(da->da_addr, addr, da->da_addrlen) == 0 &&
-                   da->da_addrlen == alen) {
-                       if (glbl) {
-                               int old_glbl = da->da_gusers;
-                               da->da_gusers = 1;
-                               if (old_glbl)
-                                       return 0;
-                       }
-                       da->da_users++;
-                       return 0;
-               }
-       }
-
-       da = kzalloc(sizeof(*da), GFP_ATOMIC);
-       if (da == NULL)
-               return -ENOMEM;
-       memcpy(da->da_addr, addr, alen);
-       da->da_addrlen = alen;
-       da->da_users = 1;
-       da->da_gusers = glbl ? 1 : 0;
-       da->next = *list;
-       *list = da;
-       (*count)++;
-       return 0;
-}
-
-int __dev_addr_delete(struct dev_addr_list **list, int *count,
-                     void *addr, int alen, int glbl)
-{
-       struct dev_addr_list *da;
-
-       for (; (da = *list) != NULL; list = &da->next) {
-               if (memcmp(da->da_addr, addr, da->da_addrlen) == 0 &&
-                   alen == da->da_addrlen) {
-                       if (glbl) {
-                               int old_glbl = da->da_gusers;
-                               da->da_gusers = 0;
-                               if (old_glbl == 0)
-                                       break;
-                       }
-                       if (--da->da_users)
-                               return 0;
-
-                       *list = da->next;
-                       kfree(da);
-                       (*count)--;
-                       return 0;
-               }
-       }
-       return -ENOENT;
-}
-
-int __dev_addr_sync(struct dev_addr_list **to, int *to_count,
-                   struct dev_addr_list **from, int *from_count)
-{
-       struct dev_addr_list *da, *next;
-       int err = 0;
-
-       da = *from;
-       while (da != NULL) {
-               next = da->next;
-               if (!da->da_synced) {
-                       err = __dev_addr_add(to, to_count,
-                                            da->da_addr, da->da_addrlen, 0);
-                       if (err < 0)
-                               break;
-                       da->da_synced = 1;
-                       da->da_users++;
-               } else if (da->da_users == 1) {
-                       __dev_addr_delete(to, to_count,
-                                         da->da_addr, da->da_addrlen, 0);
-                       __dev_addr_delete(from, from_count,
-                                         da->da_addr, da->da_addrlen, 0);
-               }
-               da = next;
-       }
-       return err;
-}
-EXPORT_SYMBOL_GPL(__dev_addr_sync);
-
-void __dev_addr_unsync(struct dev_addr_list **to, int *to_count,
-                      struct dev_addr_list **from, int *from_count)
-{
-       struct dev_addr_list *da, *next;
-
-       da = *from;
-       while (da != NULL) {
-               next = da->next;
-               if (da->da_synced) {
-                       __dev_addr_delete(to, to_count,
-                                         da->da_addr, da->da_addrlen, 0);
-                       da->da_synced = 0;
-                       __dev_addr_delete(from, from_count,
-                                         da->da_addr, da->da_addrlen, 0);
-               }
-               da = next;
-       }
-}
-EXPORT_SYMBOL_GPL(__dev_addr_unsync);
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) */
-
index bffa619cb6a3ecc3bec31973032ab4a5230bc3eb..746f79e1fd953b5b0c3ec80cd37fa3c436af8241 100644 (file)
        net->watchdog_timeo = TX_TIMEOUT_JIFFIES;
        net->ethtool_ops = &usbnet_ethtool_ops;
  
---- a/drivers/net/wireless/Makefile
-+++ b/drivers/net/wireless/Makefile
-@@ -5,43 +5,17 @@
- obj-$(CONFIG_IPW2100) += ipw2x00/
- obj-$(CONFIG_IPW2200) += ipw2x00/
--obj-$(CONFIG_STRIP) += strip.o
--obj-$(CONFIG_ARLAN) += arlan.o 
--
--arlan-objs := arlan-main.o arlan-proc.o
--
--# Obsolete cards
--obj-$(CONFIG_WAVELAN)         += wavelan.o
--obj-$(CONFIG_PCMCIA_NETWAVE)  += netwave_cs.o
--obj-$(CONFIG_PCMCIA_WAVELAN)  += wavelan_cs.o
--
--obj-$(CONFIG_HERMES)          += orinoco/
--
--obj-$(CONFIG_AIRO)            += airo.o
--obj-$(CONFIG_AIRO_CS)         += airo_cs.o airo.o
--
--obj-$(CONFIG_ATMEL)             += atmel.o
--obj-$(CONFIG_PCI_ATMEL)         += atmel_pci.o 
--obj-$(CONFIG_PCMCIA_ATMEL)      += atmel_cs.o
--
- obj-$(CONFIG_AT76C50X_USB)      += at76c50x-usb.o
--obj-$(CONFIG_PRISM54)         += prism54/
--
--obj-$(CONFIG_HOSTAP)          += hostap/
- obj-$(CONFIG_B43)             += b43/
- obj-$(CONFIG_B43LEGACY)               += b43legacy/
- obj-$(CONFIG_ZD1211RW)                += zd1211rw/
- obj-$(CONFIG_RTL8180)         += rtl818x/
- obj-$(CONFIG_RTL8187)         += rtl818x/
--# 16-bit wireless PCMCIA client drivers
--obj-$(CONFIG_PCMCIA_RAYCS)    += ray_cs.o
--obj-$(CONFIG_PCMCIA_WL3501)   += wl3501_cs.o
- obj-$(CONFIG_USB_NET_RNDIS_WLAN)      += rndis_wlan.o
--obj-$(CONFIG_USB_ZD1201)      += zd1201.o
- obj-$(CONFIG_LIBERTAS)                += libertas/
- obj-$(CONFIG_LIBERTAS_THINFIRM)       += libertas_tf/
+--- a/net/wireless/Makefile    2009-07-06 10:20:59.511191302 -0700
++++ b/net/wireless/Makefile    2009-07-06 10:28:11.310193540 -0700
+@@ -1,11 +1,17 @@
+-obj-$(CONFIG_WIRELESS_EXT) += wext.o
+ obj-$(CONFIG_CFG80211) += cfg80211.o
+ obj-$(CONFIG_LIB80211) += lib80211.o
+ obj-$(CONFIG_LIB80211_CRYPT_WEP) += lib80211_crypt_wep.o
+ obj-$(CONFIG_LIB80211_CRYPT_CCMP) += lib80211_crypt_ccmp.o
+ obj-$(CONFIG_LIB80211_CRYPT_TKIP) += lib80211_crypt_tkip.o
+-cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o mlme.o ibss.o
++cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o mlme.o ibss.o compat.o
++
++# Compat-wireless kernel compatibility code
++cfg80211-y += compat-2.6.28.o
++cfg80211-y += compat-2.6.29.o
++cfg80211-y += compat-2.6.30.o
++cfg80211-y += compat-2.6.31.o
++
+ cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o
+ cfg80211-$(CONFIG_WIRELESS_EXT) += wext-compat.o
 --- a/drivers/net/wireless/ath/ath5k/base.h
 +++ b/drivers/net/wireless/ath/ath5k/base.h
 @@ -46,7 +46,11 @@
index f76f0f278e8db01809f1d969d181ac7a6031a351..1bb9ac3225ded569e890ca39d19996bf3ee8baec 100644 (file)
 #include <linux/autoconf.h>
 #include <linux/version.h>
 #include <linux/compat_autoconf.h>
-#include <linux/skbuff.h>
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
-#include <linux/if_ether.h>
-
-#ifndef ETH_P_PAE
-#define ETH_P_PAE 0x888E      /* Port Access Entity (IEEE 802.1X) */
-#endif
-
-#include <linux/pci.h>
-
-#ifndef WARN_ONCE
-#define WARN_ONCE(condition, format...) ({                      \
-       static int __warned;                                    \
-       int __ret_warn_once = !!(condition);                    \
-                                                               \
-       if (unlikely(__ret_warn_once))                          \
-               if (WARN(!__warned, format))                    \
-                       __warned = 1;                           \
-       unlikely(__ret_warn_once);                              \
-})
-#endif /* From include/asm-generic/bug.h */
-
-void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
-
-
-/**
- *     __skb_queue_head_init - initialize non-spinlock portions of sk_buff_head
- *     @list: queue to initialize
- *
- *     This initializes only the list and queue length aspects of
- *     an sk_buff_head object.  This allows to initialize the list
- *     aspects of an sk_buff_head without reinitializing things like
- *     the spinlock.  It can also be used for on-stack sk_buff_head
- *     objects where the spinlock is known to not be used.
- */
-static inline void __skb_queue_head_init(struct sk_buff_head *list)
-{
-       list->prev = list->next = (struct sk_buff *)list;
-       list->qlen = 0;
-}
-
-static inline void __skb_queue_splice(const struct sk_buff_head *list,
-                                     struct sk_buff *prev,
-                                     struct sk_buff *next)
-{
-       struct sk_buff *first = list->next;
-       struct sk_buff *last = list->prev;
-
-       first->prev = prev;
-       prev->next = first;
-
-       last->next = next;
-       next->prev = last;
-}
-
-/**
- *     skb_queue_splice_tail - join two skb lists and reinitialise the emptied list
- *     @list: the new list to add
- *     @head: the place to add it in the first list
- *
- *     Each of the lists is a queue.
- *     The list at @list is reinitialised
- */
-static inline void skb_queue_splice_tail_init(struct sk_buff_head *list,
-                                             struct sk_buff_head *head)
-{
-       if (!skb_queue_empty(list)) {
-               __skb_queue_splice(list, head->prev, (struct sk_buff *) head);
-               head->qlen += list->qlen;
-               __skb_queue_head_init(list);
-       }
-} /* From include/linux/skbuff.h */
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)) */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
-
-/**
- *     skb_queue_is_first - check if skb is the first entry in the queue
- *     @list: queue head
- *     @skb: buffer
- *
- *     Returns true if @skb is the first buffer on the list.
- */
-static inline bool skb_queue_is_first(const struct sk_buff_head *list,
-                                     const struct sk_buff *skb)
-{
-       return (skb->prev == (struct sk_buff *) list);
-}
-
-/**
- *     skb_queue_prev - return the prev packet in the queue
- *     @list: queue head
- *     @skb: current buffer
- *
- *     Return the prev packet in @list before @skb.  It is only valid to
- *     call this if skb_queue_is_first() evaluates to false.
- */
-static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list,
-                                            const struct sk_buff *skb)
-{
-       /* This BUG_ON may seem severe, but if we just return then we
-        * are going to dereference garbage.
-        */
-       BUG_ON(skb_queue_is_first(list, skb));
-       return skb->prev;
-}
-
-/**
- *     skb_queue_is_last - check if skb is the last entry in the queue
- *     @list: queue head
- *     @skb: buffer
- *
- *     Returns true if @skb is the last buffer on the list.
- */
-static inline bool skb_queue_is_last(const struct sk_buff_head *list,
-                                    const struct sk_buff *skb)
-{
-       return (skb->next == (struct sk_buff *) list);
-}
-
-/**
- *     skb_queue_next - return the next packet in the queue
- *     @list: queue head
- *     @skb: current buffer
- *
- *     Return the next packet in @list after @skb.  It is only valid to
- *     call this if skb_queue_is_last() evaluates to false.
+/*
+ * Each compat file represents compatibility code for new kernel
+ * code introduced for *that* kernel revision.
  */
-static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list,
-                                             const struct sk_buff *skb)
-{
-       /* This BUG_ON may seem severe, but if we just return then we
-        * are going to dereference garbage.
-        */
-       BUG_ON(skb_queue_is_last(list, skb));
-       return skb->next;
-}
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
-
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)) */
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31))
-
-#ifndef SDIO_DEVICE_ID_MARVELL_8688WLAN
-#define SDIO_DEVICE_ID_MARVELL_8688WLAN                0x9104
-#endif
-
-#ifndef ERFKILL
-#if !defined(CONFIG_ALPHA) && !defined(CONFIG_MIPS) && !defined(CONFIG_PARISC) && !defined(CONFIG_SPARC)
-#define ERFKILL                132     /* Operation not possible due to RF-kill */
-#endif
-#ifdef CONFIG_ALPHA
-#define ERFKILL                138     /* Operation not possible due to RF-kill */
-#endif
-#ifdef CONFIG_MIPS
-#define ERFKILL                167     /* Operation not possible due to RF-kill */
-#endif
-#ifdef CONFIG_PARISC
-#define ERFKILL                256     /* Operation not possible due to RF-kill */
-#endif
-#ifdef CONFIG_SPARC
-#define ERFKILL                134     /* Operation not possible due to RF-kill */
-#endif
-#endif
-
-#ifndef NETDEV_PRE_UP
-#define NETDEV_PRE_UP          0x000D
-#endif
 
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */
+#include <net/compat-2.6.28.h>
+#include <net/compat-2.6.29.h>
+#include <net/compat-2.6.30.h>
+#include <net/compat-2.6.31.h>
 
 #endif /* LINUX_26_COMPAT_H */
index b3a4cd8e742e9bbd3ff348d0f560b869b952d54c..c5cb9430337cbc8a1a5edfb9de1077148c142209 100755 (executable)
@@ -160,7 +160,8 @@ cp $GIT_TREE/$DIR/* $DIR
 
 
 # Compat stuff
-cp compat/compat.c net/wireless/
+cp compat/compat-2.6.*.c net/wireless/
+cp compat/compat-2.6.*.h include/net/
 cp compat/compat.h include/net/
 cp compat/mq_compat.h net/mac80211/