From: Luis R. Rodriguez Date: Tue, 12 Jan 2010 01:52:30 +0000 (-0800) Subject: Add initial 2.6.22 support X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=91a46cccd8df3e08eeeaeefae15f27ef212685a1;p=openwrt%2Fstaging%2Fblogic.git Add initial 2.6.22 support Signed-off-by: Luis R. Rodriguez --- diff --git a/compat/compat-2.6.28.c b/compat/compat-2.6.28.c index 959a42946082..87ad2d58f2f4 100644 --- a/compat/compat-2.6.28.c +++ b/compat/compat-2.6.28.c @@ -16,6 +16,7 @@ /* 2.6.28 compat code goes here */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)) /* * Compat-wireless notes for USB backport stuff: * @@ -281,6 +282,7 @@ int usb_anchor_empty(struct usb_anchor *anchor) } EXPORT_SYMBOL_GPL(usb_anchor_empty); +#endif void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) diff --git a/compat/compat-2.6.29.c b/compat/compat-2.6.29.c index ea2a99194130..50100d9a9cf8 100644 --- a/compat/compat-2.6.29.c +++ b/compat/compat-2.6.29.c @@ -15,6 +15,7 @@ #include #include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)) /** * usb_unpoison_anchored_urbs - let an anchor be used successfully again * @anchor: anchor the requests are bound to @@ -35,6 +36,7 @@ void usb_unpoison_anchored_urbs(struct usb_anchor *anchor) spin_unlock_irqrestore(&anchor->lock, flags); } EXPORT_SYMBOL_GPL(usb_unpoison_anchored_urbs); +#endif /** * eth_mac_addr - set new Ethernet hardware address diff --git a/include/linux/compat-2.6.23.h b/include/linux/compat-2.6.23.h index c36f90d4b6bf..57b0642e8e0b 100644 --- a/include/linux/compat-2.6.23.h +++ b/include/linux/compat-2.6.23.h @@ -11,6 +11,7 @@ #include #include #include +#include /* * Tell gcc if a function is cold. The compiler will assume any path diff --git a/include/linux/compat-2.6.24.h b/include/linux/compat-2.6.24.h index 246156c26921..7b16130048d8 100644 --- a/include/linux/compat-2.6.24.h +++ b/include/linux/compat-2.6.24.h @@ -13,6 +13,7 @@ #include #include #include +#include #define KEY_BLUETOOTH 237 #define KEY_WLAN 238 @@ -211,6 +212,16 @@ struct header_ops { **/ static inline void sg_mark_end(struct scatterlist *sg) { +#ifdef CONFIG_DEBUG_SG + BUG_ON(sg->sg_magic != SG_MAGIC); +#endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)) + /* + * Set termination bit, clear potential chain bit + */ + sg->page_link |= 0x02; + sg->page_link &= ~0x01; +#endif } /** diff --git a/include/linux/compat-2.6.28.h b/include/linux/compat-2.6.28.h index 8f90edc6d9bf..02297578ac6e 100644 --- a/include/linux/compat-2.6.28.h +++ b/include/linux/compat-2.6.28.h @@ -46,6 +46,8 @@ int pcmcia_loop_config(struct pcmcia_device *p_dev, void *priv_data), void *priv_data); +/* USB anchors were added as of 2.6.23 */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)) #if 0 extern void usb_poison_urb(struct urb *urb); #endif @@ -58,6 +60,7 @@ extern void usb_poison_anchored_urbs(struct usb_anchor *anchor); extern struct urb *usb_get_from_anchor(struct usb_anchor *anchor); extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor); extern int usb_anchor_empty(struct usb_anchor *anchor); +#endif void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); diff --git a/include/linux/compat-2.6.29.h b/include/linux/compat-2.6.29.h index b31a58c95484..a1a956a38b1a 100644 --- a/include/linux/compat-2.6.29.h +++ b/include/linux/compat-2.6.29.h @@ -47,7 +47,9 @@ static inline struct net_device_stats *dev_get_stats(struct net_device *dev) return dev->get_stats(dev); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)) extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor); +#endif #define DIV_ROUND_CLOSEST(x, divisor)( \ { \