aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@winlab.rutgers.edu>2008-01-08 18:04:34 -0500
committerLuis R. Rodriguez <mcgrof@winlab.rutgers.edu>2008-01-08 18:04:34 -0500
commitcc48d61514617dbd62039b8d6bac5e51ed831044 (patch)
tree88e53d9f5086b12432d82c984134c0f87fe990c8
parent25f2efd0475be0dbc68d65189eea88eeb85679d9 (diff)
downloadcompat-wireless-2.6-old-cc48d61514617dbd62039b8d6bac5e51ed831044.tar.gz
* struct pci_dev has a new member called is_pcie, we
add backport support for its use by a helper, compat_is_pcie() to reduce the size of the compatibility code. * Update compat.diff to reflect latest changes Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
-rw-r--r--compat/compat.c12
-rw-r--r--compat/compat.diff193
-rw-r--r--compat/compat.h3
3 files changed, 122 insertions, 86 deletions
diff --git a/compat/compat.c b/compat/compat.c
index 6d8be72..b15b519 100644
--- a/compat/compat.c
+++ b/compat/compat.c
@@ -231,6 +231,18 @@ int eth_rebuild_header(struct sk_buff *skb)
}
EXPORT_SYMBOL(eth_rebuild_header);
+/* 2.6.24 will introduce struct pci_dev is_pcie bit. To help
+ * with the compatibility code (compat.diff) being smaller, we provide a helper
+ * so in cases where that will be used we can simply slap ifdefs with this
+ * routine. Use compat_ prefex to not pollute namespace. */
+int compat_is_pcie(struct pci_dev *pdev)
+{
+ int cap;
+ cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
+ return cap ? 1 : 0;
+}
+EXPORT_SYMBOL(compat_is_pcie);
+
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) */
/* All things not in 2.6.22 */
diff --git a/compat/compat.diff b/compat/compat.diff
index 347c97a..f4f1e2b 100644
--- a/compat/compat.diff
+++ b/compat/compat.diff
@@ -249,8 +249,111 @@
#include <linux/rcupdate.h>
#include <net/cfg80211.h>
#include "ieee80211_i.h"
---- a/drivers/net/wireless/adm8211.c 2007-12-20 14:42:54.000000000 -0500
-+++ b/drivers/net/wireless/adm8211.c 2007-12-20 14:42:54.000000000 -0500
+--- a/drivers/net/wireless/Makefile 2007-12-20 14:42:54.000000000 -0500
++++ b/drivers/net/wireless/Makefile 2007-12-20 14:42:54.000000000 -0500
+@@ -6,47 +6,10 @@
+
+ obj-$(CONFIG_IPW2200) += ipw2200.o
+
+-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.o hermes.o
+-obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o
+-obj-$(CONFIG_APPLE_AIRPORT) += airport.o
+-obj-$(CONFIG_PLX_HERMES) += orinoco_plx.o
+-obj-$(CONFIG_PCI_HERMES) += orinoco_pci.o
+-obj-$(CONFIG_TMD_HERMES) += orinoco_tmd.o
+-obj-$(CONFIG_NORTEL_HERMES) += orinoco_nortel.o
+-obj-$(CONFIG_PCMCIA_SPECTRUM) += spectrum_cs.o
+-
+-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_USB_ATMEL) += at76_usb.o
+-
+-obj-$(CONFIG_PRISM54) += prism54/
+-
+-obj-$(CONFIG_HOSTAP) += hostap/
+-obj-$(CONFIG_BCM43XX) += bcm43xx/
+ obj-$(CONFIG_B43) += b43/
+ obj-$(CONFIG_B43LEGACY) += b43legacy/
+ obj-$(CONFIG_ZD1211RW) += zd1211rw/
+
+-# 16-bit wireless PCMCIA client drivers
+-obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o
+-obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o
+-
+-obj-$(CONFIG_USB_ZD1201) += zd1201.o
+ obj-$(CONFIG_LIBERTAS) += libertas/
+
+ rtl8180-objs := rtl8180_dev.o rtl8180_rtl8225.o rtl8180_sa2400.o rtl8180_max2820.o rtl8180_grf5101.o
+--- a/net/mac80211/Makefile 2008-01-08 15:41:04.000000000 -0500
++++ b/net/mac80211/Makefile 2008-01-08 15:42:10.000000000 -0500
+@@ -27,6 +27,7 @@
+ tx.o \
+ key.o \
+ util.o \
++ compat.o \
+ event.o
+
+ mac80211-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o
+--- a/net/mac80211/ieee80211.c 2008-01-08 16:32:22.000000000 -0500
++++ b/net/mac80211/ieee80211.c 2008-01-08 16:32:22.000000000 -0500
+@@ -21,7 +21,9 @@
+ #include <linux/wireless.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/bitmap.h>
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
+ #include <net/net_namespace.h>
++#endif
+ #include <net/cfg80211.h>
+
+ #include "ieee80211_i.h"
+@@ -1093,7 +1095,9 @@
+ mdev->open = ieee80211_master_open;
+ mdev->stop = ieee80211_master_stop;
+ mdev->type = ARPHRD_IEEE80211;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
+ mdev->header_ops = &ieee80211_header_ops;
++#endif
+ mdev->set_multicast_list = ieee80211_master_set_multicast_list;
+
+ sdata->vif.type = IEEE80211_IF_TYPE_AP;
+--- a/drivers/ssb/scan.c 2008-01-08 17:59:08.000000000 -0500
++++ b/drivers/ssb/scan.c 2008-01-08 17:58:58.000000000 -0500
+@@ -392,10 +392,18 @@
+ /* Ignore PCI cores on PCI-E cards.
+ * Ignore PCI-E cores on PCI cards. */
+ if (dev->id.coreid == SSB_DEV_PCI) {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
++ if (compat_is_pcie(bus->host_pci))
++#else
+ if (bus->host_pci->is_pcie)
++#endif
+ continue;
+ } else {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
++ if (!compat_is_pcie(bus->host_pci))
++#else
+ if (!bus->host_pci->is_pcie)
++#endif
+ continue;
+ }
+ }
+--- a/drivers/net/wireless/adm8211.c 2008-01-08 18:01:47.000000000 -0500
++++ b/drivers/net/wireless/adm8211.c 2008-01-08 18:01:47.000000000 -0500
@@ -117,7 +117,11 @@
break;
@@ -473,8 +576,8 @@
+ pci_read_config_byte(pdev, PCI_CLASS_REVISION, &priv->revid);
+#endif
- *(u32 *)perm_addr = le32_to_cpu((__force __le32)ADM8211_CSR_READ(PAR0));
- *(u16 *)&perm_addr[4] =
+ *(__le32 *)perm_addr = cpu_to_le32(ADM8211_CSR_READ(PAR0));
+ *(__le16 *)&perm_addr[4] =
@@ -1902,7 +1981,11 @@
priv->mode = IEEE80211_IF_TYPE_INVALID;
@@ -499,85 +602,3 @@
return 0;
---- a/drivers/net/wireless/Makefile 2007-12-20 14:42:54.000000000 -0500
-+++ b/drivers/net/wireless/Makefile 2007-12-20 14:42:54.000000000 -0500
-@@ -6,47 +6,10 @@
-
- obj-$(CONFIG_IPW2200) += ipw2200.o
-
--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.o hermes.o
--obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o
--obj-$(CONFIG_APPLE_AIRPORT) += airport.o
--obj-$(CONFIG_PLX_HERMES) += orinoco_plx.o
--obj-$(CONFIG_PCI_HERMES) += orinoco_pci.o
--obj-$(CONFIG_TMD_HERMES) += orinoco_tmd.o
--obj-$(CONFIG_NORTEL_HERMES) += orinoco_nortel.o
--obj-$(CONFIG_PCMCIA_SPECTRUM) += spectrum_cs.o
--
--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_USB_ATMEL) += at76_usb.o
--
--obj-$(CONFIG_PRISM54) += prism54/
--
--obj-$(CONFIG_HOSTAP) += hostap/
--obj-$(CONFIG_BCM43XX) += bcm43xx/
- obj-$(CONFIG_B43) += b43/
- obj-$(CONFIG_B43LEGACY) += b43legacy/
- obj-$(CONFIG_ZD1211RW) += zd1211rw/
-
--# 16-bit wireless PCMCIA client drivers
--obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o
--obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o
--
--obj-$(CONFIG_USB_ZD1201) += zd1201.o
- obj-$(CONFIG_LIBERTAS) += libertas/
-
- rtl8180-objs := rtl8180_dev.o rtl8180_rtl8225.o rtl8180_sa2400.o rtl8180_max2820.o rtl8180_grf5101.o
---- a/net/mac80211/Makefile 2008-01-08 15:41:04.000000000 -0500
-+++ b/net/mac80211/Makefile 2008-01-08 15:42:10.000000000 -0500
-@@ -27,6 +27,7 @@
- tx.o \
- key.o \
- util.o \
-+ compat.o \
- event.o
-
- mac80211-$(CONFIG_MAC80211_LEDS) += ieee80211_led.o
---- a/net/mac80211/ieee80211.c 2008-01-08 16:32:22.000000000 -0500
-+++ b/net/mac80211/ieee80211.c 2008-01-08 16:32:22.000000000 -0500
-@@ -21,7 +21,9 @@
- #include <linux/wireless.h>
- #include <linux/rtnetlink.h>
- #include <linux/bitmap.h>
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
- #include <net/net_namespace.h>
-+#endif
- #include <net/cfg80211.h>
-
- #include "ieee80211_i.h"
-@@ -1093,7 +1095,9 @@
- mdev->open = ieee80211_master_open;
- mdev->stop = ieee80211_master_stop;
- mdev->type = ARPHRD_IEEE80211;
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
- mdev->header_ops = &ieee80211_header_ops;
-+#endif
- mdev->set_multicast_list = ieee80211_master_set_multicast_list;
-
- sdata->vif.type = IEEE80211_IF_TYPE_AP;
diff --git a/compat/compat.h b/compat/compat.h
index bf87ac4..f9a1243 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -112,6 +112,9 @@ static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
}
+/* Helper to make struct pci_dev is_pcie compatibility code smaller */
+int compat_is_pcie(struct pci_dev *pdev);
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) */
/* Compat work for 2.6.22 */