From: Luis R. Rodriguez Date: Mon, 6 Jul 2009 17:40:01 +0000 (-0700) Subject: Split kernel compatibility into different files X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=28ff8cac8b293c1d5dfa34d7e280e4bab8b8c15c;p=openwrt%2Fstaging%2Fblogic.git Split kernel compatibility into different files This should make maintaining and readability easier. Signed-off-by: Luis R. Rodriguez --- diff --git a/compat/compat-2.6.28.c b/compat/compat-2.6.28.c new file mode 100644 index 000000000000..025b1de17f92 --- /dev/null +++ b/compat/compat-2.6.28.c @@ -0,0 +1,32 @@ +/* + * Copyright 2007 Luis R. Rodriguez + * + * 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 + +#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 index 000000000000..5d84168a9d63 --- /dev/null +++ b/compat/compat-2.6.28.h @@ -0,0 +1,84 @@ +#ifndef LINUX_26_28_COMPAT_H +#define LINUX_26_28_COMPAT_H + +#include +#include +#include + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)) + +#include +#include + +#ifndef ETH_P_PAE +#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ +#endif + +#include + +#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 index 000000000000..56ecc26b901c --- /dev/null +++ b/compat/compat-2.6.29.c @@ -0,0 +1,19 @@ +/* + * Copyright 2007 Luis R. Rodriguez + * + * 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 + +#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 index 000000000000..6fa4654d5c29 --- /dev/null +++ b/compat/compat-2.6.29.h @@ -0,0 +1,76 @@ +#ifndef LINUX_26_29_COMPAT_H +#define LINUX_26_29_COMPAT_H + +#include +#include +#include + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) + +#include + +/** + * 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 index 000000000000..5f9ee9f2aeb6 --- /dev/null +++ b/compat/compat-2.6.30.c @@ -0,0 +1,19 @@ +/* + * Copyright 2007 Luis R. Rodriguez + * + * 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 + +#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 index 000000000000..112cf19ba9c1 --- /dev/null +++ b/compat/compat-2.6.30.h @@ -0,0 +1,12 @@ +#ifndef LINUX_26_30_COMPAT_H +#define LINUX_26_30_COMPAT_H + +#include +#include +#include + +#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 index 000000000000..0d48955d842b --- /dev/null +++ b/compat/compat-2.6.31.c @@ -0,0 +1,125 @@ +/* + * Copyright 2007 Luis R. Rodriguez + * + * 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 + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) + +#include + +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 index 000000000000..bdfa18d2b2b2 --- /dev/null +++ b/compat/compat-2.6.31.h @@ -0,0 +1,38 @@ +#ifndef LINUX_26_31_COMPAT_H +#define LINUX_26_31_COMPAT_H + +#include +#include +#include + +#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 */ diff --git a/compat/compat.c b/compat/compat.c index 5c4ccdc344da..e69de29bb2d1 100644 --- a/compat/compat.c +++ b/compat/compat.c @@ -1,151 +0,0 @@ -/* - * Copyright 2007 Luis R. Rodriguez - * - * 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 - -#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 - -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.diff b/compat/compat.diff index bffa619cb6a3..746f79e1fd95 100644 --- a/compat/compat.diff +++ b/compat/compat.diff @@ -141,52 +141,28 @@ 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 @@ diff --git a/compat/compat.h b/compat/compat.h index f76f0f278e8d..1bb9ac3225de 100644 --- a/compat/compat.h +++ b/compat/compat.h @@ -4,180 +4,15 @@ #include #include #include -#include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)) -#include - -#ifndef ETH_P_PAE -#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ -#endif - -#include - -#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 +#include +#include +#include #endif /* LINUX_26_COMPAT_H */ diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh index b3a4cd8e742e..c5cb9430337c 100755 --- a/scripts/admin-update.sh +++ b/scripts/admin-update.sh @@ -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/