linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/9] compat-wireless: restructure header files in compat
@ 2012-04-26 18:07 Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c 1/9] compat: move compat_system_workqueue_{create,destroy} and compat_pm_qos_power_{init,deinit} Hauke Mehrtens
                   ` (13 more replies)
  0 siblings, 14 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens

The patch series moves the compat code from include/linux/compat-*.h 
into new files with the same name as the file where this code is placed 
in the mainline kernel. With this approach we do not have to include 
all include/linux/compat-*.h files in the build process any more, but 
we extend the existing header files by the code needed.

This compiles without any warnings for me with kernel 3.2 to 3.4 and 
fixes the problems with pr_fmt() without the need of any patch.
Sometimes I had problems compiling compat-wireless, because some header 
file I would not like to include was included because of compat-2.6.h 
included mostly every header file available in the kernel.

This patch series is only done to support kernel >= 3.2, supporting the 
other versions is just more work, but I want to have some responses on 
this first. There are probably some other problems and some more 
cleanup is possible.
In the end we will remove the include/linux/compat-*.h files.

I have a problem where compat does changes to header files provided by 
compat-wireless like #define NL80211_FEATURE_SK_TX_STATUS 0 in compat-
2.6.33.h. To make this work we should add an other include directory in 
compat-wireless.
The hierarchy of include directories should be this: 1. include dir 
from compat, 2. include dir from compat-wireless, 3. the kernel include 
dir, now the 1. and the 2. are but into one directory.

This patch series or a more recent version can also be found on github:
https://github.com/hauke/compat/commits/header-new
https://github.com/hauke/compat-wireless/commits/header-new

Hauke Mehrtens (9):
  compat: move compat_system_workqueue_{create,destroy} and
    compat_pm_qos_power_{init,deinit}
  compat: include compat_autoconf.h
  compat: move br_port_exists
  compat: move netdev_attach_ops
  compat: move compat_pci_{suspend,resume}
  compat: move simple_open()
  compat: move code from compat-3.4.h
  compat: move code from compat-3.3.h
  compat: do not include compat-2.6.h

 Makefile                        |    1 -
 compat/compat-2.6.36.c          |    1 +
 compat/compat.h                 |   66 ++++++++++++
 compat/main.c                   |    1 +
 compat/pm_qos_params.c          |    1 +
 include/generated/autoconf.h    |    2 +
 include/linux/compat-2.6.25.h   |   39 -------
 include/linux/compat-2.6.28.h   |    3 -
 include/linux/compat-2.6.29.h   |  219 ---------------------------------------
 include/linux/compat-2.6.36.h   |   28 -----
 include/linux/compat-3.3.h      |   44 --------
 include/linux/compat-3.4.h      |   67 ------------
 include/linux/compat-3.5.h      |    2 -
 include/linux/compat.h          |   21 ++++
 include/linux/device.h          |   38 +++++++
 include/linux/etherdevice.h     |   51 +++++++++
 include/linux/fs.h              |   14 +++
 include/linux/if.h              |   28 +++++
 include/linux/netdev_features.h |   22 ++++
 include/linux/netdevice.h       |  205 ++++++++++++++++++++++++++++++++++++
 include/linux/pci.h             |   63 +++++++++++
 include/linux/rfkill.h          |    2 -
 include/linux/skbuff.h          |   34 ++++++
 include/linux/usb.h             |   24 +++++
 24 files changed, 571 insertions(+), 405 deletions(-)
 create mode 100644 compat/compat.h
 create mode 100644 include/generated/autoconf.h
 create mode 100644 include/linux/compat.h
 create mode 100644 include/linux/device.h
 create mode 100644 include/linux/etherdevice.h
 create mode 100644 include/linux/fs.h
 create mode 100644 include/linux/if.h
 create mode 100644 include/linux/netdev_features.h
 create mode 100644 include/linux/netdevice.h
 create mode 100644 include/linux/pci.h
 create mode 100644 include/linux/skbuff.h
 create mode 100644 include/linux/usb.h


Hauke Mehrtens (4):
  compat-wireless: fix header of compat-autoconf.h
  compat-wireless: also copy include/generated/ from compat
  compat-wireless: do not include linux/compat-2.6.h any more
  compat-wireless: copy *.h files from compat/compat

 Makefile                       |    1 -
 patches/53-pr_fmt.patch        |  823 ----------------------------------------
 scripts/admin-update.sh        |    3 +
 scripts/gen-compat-autoconf.sh |    4 +-
 4 files changed, 4 insertions(+), 827 deletions(-)
 delete mode 100644 patches/53-pr_fmt.patch
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [RFC c 1/9] compat: move compat_system_workqueue_{create,destroy} and compat_pm_qos_power_{init,deinit}
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c-w 1/4] compat-wireless: fix header of compat-autoconf.h Hauke Mehrtens
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 compat/compat-2.6.36.c        |    1 +
 compat/compat.h               |   66 +++++++++++++++++++++++++++++++++++++++++
 compat/main.c                 |    1 +
 compat/pm_qos_params.c        |    1 +
 include/linux/compat-2.6.25.h |   39 ------------------------
 include/linux/compat-2.6.36.h |   11 -------
 6 files changed, 69 insertions(+), 50 deletions(-)
 create mode 100644 compat/compat.h

diff --git a/compat/compat-2.6.36.c b/compat/compat-2.6.36.c
index 9190ecd..0ba57f0 100644
--- a/compat/compat-2.6.36.c
+++ b/compat/compat-2.6.36.c
@@ -10,6 +10,7 @@
 
 #include <linux/compat.h>
 #include <linux/usb.h>
+#include "compat.h"
 
 #ifdef CONFIG_COMPAT_USB_URB_THREAD_FIX
 /* Callers must hold anchor->lock */
diff --git a/compat/compat.h b/compat/compat.h
new file mode 100644
index 0000000..031ad83
--- /dev/null
+++ b/compat/compat.h
@@ -0,0 +1,66 @@
+#ifndef _COMPAT_COMPAT_H
+#define _COMPAT_COMPAT_H
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))
+/*
+ * Backport work for QoS dependencies (kernel/pm_qos_params.c)
+ * pm-qos stuff written by mark gross mgross@linux.intel.com.
+ *
+ * ipw2100 now makes use of:
+ *
+ * pm_qos_add_requirement(),
+ * pm_qos_update_requirement() and
+ * pm_qos_remove_requirement() from it
+ *
+ * mac80211 uses the network latency to determine if to enable or not
+ * dynamic PS. mac80211 also and registers a notifier for when
+ * the latency changes. Since older kernels do no thave pm-qos stuff
+ * we just implement it completley here and register it upon cfg80211
+ * init. I haven't tested ipw2100 on 2.6.24 though.
+ *
+ * This pm-qos implementation is copied verbatim from the kernel
+ * written by mark gross mgross@linux.intel.com. You don't have
+ * to do anythinig to use pm-qos except use the same exported
+ * routines as used in newer kernels. The compat_pm_qos_power_init()
+ * defned below is used by the compat module to initialize pm-qos.
+ */
+int compat_pm_qos_power_init(void);
+int compat_pm_qos_power_deinit(void);
+
+#else
+/*
+ * Kernels >= 2.6.25 have pm-qos and its initialized as part of
+ * the bootup process
+ */
+static inline int compat_pm_qos_power_init(void)
+{
+	return 0;
+}
+
+static inline int compat_pm_qos_power_deinit(void)
+{
+	return 0;
+}
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) */
+
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
+
+void compat_system_workqueue_create(void);
+void compat_system_workqueue_destroy(void);
+
+#else
+
+static inline void compat_system_workqueue_create(void)
+{
+}
+
+static inline void compat_system_workqueue_destroy(void)
+{
+}
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
+
+#endif	/* _COMPAT_COMPAT_H */
diff --git a/compat/main.c b/compat/main.c
index 30a4a1e..7e245ff 100644
--- a/compat/main.c
+++ b/compat/main.c
@@ -1,4 +1,5 @@
 #include <linux/module.h>
+#include "compat.h"
 
 MODULE_AUTHOR("Luis R. Rodriguez");
 MODULE_DESCRIPTION("Kernel compatibility module");
diff --git a/compat/pm_qos_params.c b/compat/pm_qos_params.c
index 833d98c..bdf4887 100644
--- a/compat/pm_qos_params.c
+++ b/compat/pm_qos_params.c
@@ -1,4 +1,5 @@
 #include <net/compat.h>
+#include "compat.h"
 
 /* This is the backport of pm-qos params for kernels <= 2.6.25 */
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))
diff --git a/include/linux/compat-2.6.25.h b/include/linux/compat-2.6.25.h
index 356186d..63b0533 100644
--- a/include/linux/compat-2.6.25.h
+++ b/include/linux/compat-2.6.25.h
@@ -129,31 +129,6 @@ typedef u32 phys_addr_t;
 	const struct pci_device_id _table[] __devinitdata
 
 /*
- * Backport work for QoS dependencies (kernel/pm_qos_params.c)
- * pm-qos stuff written by mark gross mgross@linux.intel.com.
- *
- * ipw2100 now makes use of:
- *
- * pm_qos_add_requirement(),
- * pm_qos_update_requirement() and
- * pm_qos_remove_requirement() from it
- *
- * mac80211 uses the network latency to determine if to enable or not
- * dynamic PS. mac80211 also and registers a notifier for when
- * the latency changes. Since older kernels do no thave pm-qos stuff
- * we just implement it completley here and register it upon cfg80211
- * init. I haven't tested ipw2100 on 2.6.24 though.
- *
- * This pm-qos implementation is copied verbatim from the kernel
- * written by mark gross mgross@linux.intel.com. You don't have
- * to do anythinig to use pm-qos except use the same exported
- * routines as used in newer kernels. The compat_pm_qos_power_init()
- * defned below is used by the compat module to initialize pm-qos.
- */
-int compat_pm_qos_power_init(void);
-int compat_pm_qos_power_deinit(void);
-
-/*
  * 2.6.25 adds PM_EVENT_HIBERNATE as well here but
  * we don't have this on <= 2.6.23)
  */
@@ -259,20 +234,6 @@ static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
 extern int strict_strtoul(const char *, unsigned int, unsigned long *);
 extern int strict_strtol(const char *, unsigned int, long *);
 
-#else
-/*
- * Kernels >= 2.6.25 have pm-qos and its initialized as part of
- * the bootup process
- */
-static inline int compat_pm_qos_power_init(void)
-{
-	return 0;
-}
-
-static inline int compat_pm_qos_power_deinit(void)
-{
-	return 0;
-}
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) */
 
 #endif /* LINUX_26_25_COMPAT_H */
diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
index 56d5961..8f6ecc4 100644
--- a/include/linux/compat-2.6.36.h
+++ b/include/linux/compat-2.6.36.h
@@ -156,9 +156,6 @@ extern struct workqueue_struct *system_wq;
 extern struct workqueue_struct *system_long_wq;
 extern struct workqueue_struct *system_nrt_wq;
 
-void compat_system_workqueue_create(void);
-void compat_system_workqueue_destroy(void);
-
 int compat_schedule_work(struct work_struct *work);
 int compat_schedule_work_on(int cpu, struct work_struct *work);
 int compat_schedule_delayed_work(struct delayed_work *dwork,
@@ -186,14 +183,6 @@ extern unsigned int work_busy(struct work_struct *work);
 
 #else
 
-static inline void compat_system_workqueue_create(void)
-{
-}
-
-static inline void compat_system_workqueue_destroy(void)
-{
-}
-
 /*
  * This is not part of The 2.6.37 kernel yet but we
  * we use it to optimize the backport code we
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c-w 1/4] compat-wireless: fix header of compat-autoconf.h
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c 1/9] compat: move compat_system_workqueue_{create,destroy} and compat_pm_qos_power_{init,deinit} Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c 2/9] compat: include compat_autoconf.h Hauke Mehrtens
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 scripts/gen-compat-autoconf.sh |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/scripts/gen-compat-autoconf.sh b/scripts/gen-compat-autoconf.sh
index c7bdd38..3b49565 100755
--- a/scripts/gen-compat-autoconf.sh
+++ b/scripts/gen-compat-autoconf.sh
@@ -130,14 +130,13 @@ function kernel_version_req {
 }
 
 cat <<EOF
-#ifndef COMPAT_AUTOCONF_INCLUDED
-#define COMPAT_AUTOCONF_INCLUDED
 /*
  * Automatically generated C config: don't edit
  * $DATE 
  * compat-wireless-2.6: $CREL
  * linux-2.6: $KREL
  */
+#include <linux/version.h>
 #define COMPAT_RELEASE "$CREL"
 #define COMPAT_KERNEL_RELEASE "$KREL"
 EOF
@@ -201,4 +200,3 @@ if [ -f $KLIB_BUILD/Makefile ]; then
 		rm -f $MULT_DEP_FILE
 	fi
 fi
-echo "#endif /* COMPAT_AUTOCONF_INCLUDED */"
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c 2/9] compat: include compat_autoconf.h
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c 1/9] compat: move compat_system_workqueue_{create,destroy} and compat_pm_qos_power_{init,deinit} Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c-w 1/4] compat-wireless: fix header of compat-autoconf.h Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c-w 2/4] compat-wireless: also copy include/generated/ from compat Hauke Mehrtens
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/generated/autoconf.h |    2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 include/generated/autoconf.h

diff --git a/include/generated/autoconf.h b/include/generated/autoconf.h
new file mode 100644
index 0000000..a4064e3
--- /dev/null
+++ b/include/generated/autoconf.h
@@ -0,0 +1,2 @@
+#include_next <generated/autoconf.h>
+#include <linux/compat_autoconf.h>
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c-w 2/4] compat-wireless: also copy include/generated/ from compat
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (2 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c 2/9] compat: include compat_autoconf.h Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-05-03 18:57   ` Johannes Berg
  2012-04-26 18:07 ` [RFC c 3/9] compat: move br_port_exists Hauke Mehrtens
                   ` (9 subsequent siblings)
  13 siblings, 1 reply; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 scripts/admin-update.sh |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index fd1fa87..7147ff1 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -283,6 +283,7 @@ mkdir -p include/linux/ include/net/ include/linux/usb \
 	include/trace \
 	include/pcmcia \
 	include/crypto \
+	include/generated \
 	net/mac80211/ net/wireless/ \
 	net/rfkill/ \
 	drivers/ssb/ \
@@ -436,6 +437,7 @@ cp -a $GIT_COMPAT_TREE/include/net/* include/net/
 cp -a $GIT_COMPAT_TREE/include/trace/* include/trace/
 cp -a $GIT_COMPAT_TREE/include/pcmcia/* include/pcmcia/
 cp -a $GIT_COMPAT_TREE/include/crypto/* include/crypto/
+cp -a $GIT_COMPAT_TREE/include/generated/* include/generated/
 rm -f $COMPAT/*.mod.c
 
 # files we suck in for compat-wireless
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c 3/9] compat: move br_port_exists
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (3 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c-w 2/4] compat-wireless: also copy include/generated/ from compat Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c-w 3/4] compat-wireless: do not include linux/compat-2.6.h any more Hauke Mehrtens
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-2.6.36.h |   17 -----------------
 include/linux/if.h            |   28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 17 deletions(-)
 create mode 100644 include/linux/if.h

diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
index 8f6ecc4..833143e 100644
--- a/include/linux/compat-2.6.36.h
+++ b/include/linux/compat-2.6.36.h
@@ -179,23 +179,6 @@ extern unsigned int work_busy(struct work_struct *work);
 #define schedule_delayed_work_on(cpu, dwork, delay) compat_schedule_delayed_work_on(cpu, dwork, delay)
 #define flush_scheduled_work(a) compat_flush_scheduled_work(a)
 
-#define br_port_exists(dev)	(dev->br_port)
-
-#else
-
-/*
- * This is not part of The 2.6.37 kernel yet but we
- * we use it to optimize the backport code we
- * need to implement. Instead of using ifdefs
- * to check what version of the check we use
- * we just replace all checks on current code
- * with this. I'll submit this upstream too, that
- * way all we'd have to do is to implement this
- * for older kernels, then we would not have to
- * edit the upstrema code for backport efforts.
- */
-#define br_port_exists(dev)	(dev->priv_flags & IFF_BRIDGE_PORT)
-
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
 
 #endif /* LINUX_26_36_COMPAT_H */
diff --git a/include/linux/if.h b/include/linux/if.h
new file mode 100644
index 0000000..64cd9e7
--- /dev/null
+++ b/include/linux/if.h
@@ -0,0 +1,28 @@
+#ifndef _COMPAT_LINUX_IF_H
+#define _COMPAT_LINUX_IF_H
+
+#include_next <linux/if.h>
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36))
+
+#define br_port_exists(dev)	(dev->br_port)
+
+#else
+
+/*
+ * This is not part of The 2.6.37 kernel yet but we
+ * we use it to optimize the backport code we
+ * need to implement. Instead of using ifdefs
+ * to check what version of the check we use
+ * we just replace all checks on current code
+ * with this. I'll submit this upstream too, that
+ * way all we'd have to do is to implement this
+ * for older kernels, then we would not have to
+ * edit the upstrema code for backport efforts.
+ */
+#define br_port_exists(dev)	(dev->priv_flags & IFF_BRIDGE_PORT)
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) */
+#endif	/* _COMPAT_LINUX_IF_H */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c-w 3/4] compat-wireless: do not include linux/compat-2.6.h any more
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (4 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c 3/9] compat: move br_port_exists Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c 4/9] compat: move netdev_attach_ops Hauke Mehrtens
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 Makefile                |    1 -
 patches/53-pr_fmt.patch |  823 -----------------------------------------------
 2 files changed, 824 deletions(-)
 delete mode 100644 patches/53-pr_fmt.patch

diff --git a/Makefile b/Makefile
index f2adff2..e28e220 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,6 @@ ifneq ($(KERNELRELEASE),)
 include $(COMPAT_CONFIG_CW)
 
 NOSTDINC_FLAGS := -I$(M)/include/ \
-	-include $(M)/include/linux/compat-2.6.h \
 	$(CFLAGS)
 
 obj-y := compat/
diff --git a/patches/53-pr_fmt.patch b/patches/53-pr_fmt.patch
deleted file mode 100644
index b759bea..0000000
--- a/patches/53-pr_fmt.patch
+++ /dev/null
@@ -1,823 +0,0 @@
-This is the correct way to use pr_fmt. This helps avoid
-compiler warnings. This is going to be sent upstream.
-
---- a/drivers/bcma/bcma_private.h
-+++ b/drivers/bcma/bcma_private.h
-@@ -1,10 +1,10 @@
- #ifndef LINUX_BCMA_PRIVATE_H_
- #define LINUX_BCMA_PRIVATE_H_
- 
--#ifndef pr_fmt
-+#undef pr_fmt
- #define pr_fmt(fmt)		KBUILD_MODNAME ": " fmt
--#endif
- 
-+#include <linux/printk.h>
- #include <linux/bcma/bcma.h>
- #include <linux/delay.h>
- 
---- a/drivers/net/ethernet/broadcom/b44.c
-+++ b/drivers/net/ethernet/broadcom/b44.c
-@@ -10,9 +10,11 @@
-  * Distribute under GPL.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/moduleparam.h>
- #include <linux/types.h>
---- a/drivers/net/wireless/iwlegacy/3945-mac.c
-+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
-@@ -27,9 +27,11 @@
-  *
-  *****************************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/pci.h>
---- a/drivers/net/wireless/iwlegacy/4965-mac.c
-+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
-@@ -27,9 +27,11 @@
-  *
-  *****************************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/pci.h>
---- a/drivers/net/wireless/libertas/cfg.c
-+++ b/drivers/net/wireless/libertas/cfg.c
-@@ -6,8 +6,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/hardirq.h>
- #include <linux/sched.h>
- #include <linux/wait.h>
---- a/drivers/net/wireless/libertas/if_usb.c
-+++ b/drivers/net/wireless/libertas/if_usb.c
-@@ -2,8 +2,10 @@
-  * This file contains functions used in USB interface module.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/module.h>
- #include <linux/firmware.h>
---- a/drivers/net/wireless/libertas/if_sdio.c
-+++ b/drivers/net/wireless/libertas/if_sdio.c
-@@ -26,9 +26,11 @@
-  * if_sdio_card_to_host() to pad the data.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/slab.h>
- #include <linux/firmware.h>
---- a/drivers/net/wireless/libertas/if_spi.c
-+++ b/drivers/net/wireless/libertas/if_spi.c
-@@ -17,8 +17,10 @@
-  * (at your option) any later version.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/hardirq.h>
- #include <linux/interrupt.h>
- #include <linux/module.h>
---- a/drivers/net/wireless/libertas/rx.c
-+++ b/drivers/net/wireless/libertas/rx.c
-@@ -2,8 +2,10 @@
-  * This file contains the handling of RX in wlan driver.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/etherdevice.h>
- #include <linux/hardirq.h>
- #include <linux/slab.h>
---- a/drivers/net/wireless/libertas/if_cs.c
-+++ b/drivers/net/wireless/libertas/if_cs.c
-@@ -21,8 +21,10 @@
- 
- */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/slab.h>
- #include <linux/delay.h>
---- a/drivers/net/wireless/libertas/mesh.c
-+++ b/drivers/net/wireless/libertas/mesh.c
-@@ -1,5 +1,7 @@
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/etherdevice.h>
- #include <linux/hardirq.h>
---- a/drivers/net/wireless/libertas/main.c
-+++ b/drivers/net/wireless/libertas/main.c
-@@ -4,8 +4,10 @@
-  * thread etc..
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/delay.h>
- #include <linux/etherdevice.h>
---- a/drivers/net/wireless/libertas_tf/cmd.c
-+++ b/drivers/net/wireless/libertas_tf/cmd.c
-@@ -7,8 +7,10 @@
-  *  the Free Software Foundation; either version 2 of the License, or (at
-  *  your option) any later version.
-  */
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/hardirq.h>
- #include <linux/slab.h>
- #include <linux/export.h>
---- a/drivers/net/wireless/libertas_tf/if_usb.c
-+++ b/drivers/net/wireless/libertas_tf/if_usb.c
-@@ -9,11 +9,13 @@
-  */
- #define DRV_NAME "lbtf_usb"
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include "libertas_tf.h"
- #include "if_usb.h"
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/module.h>
- #include <linux/firmware.h>
---- a/drivers/net/wireless/libertas_tf/main.c
-+++ b/drivers/net/wireless/libertas_tf/main.c
-@@ -7,8 +7,10 @@
-  *  the Free Software Foundation; either version 2 of the License, or (at
-  *  your option) any later version.
-  */
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/hardirq.h>
- #include <linux/slab.h>
- 
---- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
-+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
-@@ -14,9 +14,11 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/cordic.h>
- 
---- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
-+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
-@@ -15,8 +15,10 @@
-  */
- 
- #define __UNDEF_NO_VERSION__
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/etherdevice.h>
- #include <linux/sched.h>
- #include <linux/firmware.h>
---- a/drivers/net/wireless/brcm80211/brcmsmac/dma.c
-+++ b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
-@@ -13,9 +13,10 @@
-  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
--
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/slab.h>
- #include <linux/delay.h>
- #include <linux/pci.h>
---- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
-+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
-@@ -14,8 +14,10 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/pci_ids.h>
- #include <linux/if_ether.h>
- #include <net/mac80211.h>
---- a/drivers/net/wireless/brcm80211/brcmutil/utils.c
-+++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c
-@@ -14,8 +14,10 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/netdevice.h>
- #include <linux/module.h>
- 
---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
-@@ -14,8 +14,10 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/types.h>
- #include <linux/netdevice.h>
- #include <linux/mmc/sdio.h>
---- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c
-+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c
-@@ -19,8 +19,10 @@
-  * For certain dcmd codes, the dongle interprets string data from the host.
-  ******************************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/types.h>
- #include <linux/netdevice.h>
- #include <linux/sched.h>
---- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
-+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
-@@ -15,8 +15,10 @@
-  */
- /* ****************** SDIO CARD Interface Functions **************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/types.h>
- #include <linux/netdevice.h>
- #include <linux/export.h>
---- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
-+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
-@@ -14,10 +14,12 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/init.h>
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/kthread.h>
- #include <linux/slab.h>
- #include <linux/skbuff.h>
---- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
-+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
-@@ -14,9 +14,11 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/string.h>
- #include <linux/sched.h>
- #include <linux/netdevice.h>
---- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c
-+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c
-@@ -15,8 +15,10 @@
-  */
- /* ***** SDIO interface chip backplane handle functions ***** */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/types.h>
- #include <linux/netdevice.h>
- #include <linux/mmc/card.h>
---- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
-+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
-@@ -16,9 +16,11 @@
- 
- /* Toplevel file. Relies on dhd_linux.c to send commands to the dongle. */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/if_arp.h>
- #include <linux/sched.h>
- #include <linux/kthread.h>
---- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
-+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
-@@ -14,6 +14,7 @@
-  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/types.h>
---- a/net/wireless/lib80211.c
-+++ b/net/wireless/lib80211.c
-@@ -13,8 +13,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/ctype.h>
- #include <linux/ieee80211.h>
---- a/net/wireless/reg.c
-+++ b/net/wireless/reg.c
-@@ -42,9 +42,11 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/export.h>
- #include <linux/slab.h>
- #include <linux/list.h>
---- a/net/wireless/core.c
-+++ b/net/wireless/core.c
-@@ -4,8 +4,10 @@
-  * Copyright 2006-2010		Johannes Berg <johannes@sipsolutions.net>
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/if.h>
- #include <linux/module.h>
- #include <linux/err.h>
---- a/net/bluetooth/lib.c
-+++ b/net/bluetooth/lib.c
-@@ -24,11 +24,13 @@
- 
- /* Bluetooth kernel library. */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) "Bluetooth: " fmt
- 
- #include <linux/module.h>
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/stddef.h>
- #include <linux/string.h>
- #include <asm/errno.h>
---- a/net/wireless/lib80211_crypt_tkip.c
-+++ b/net/wireless/lib80211_crypt_tkip.c
-@@ -10,8 +10,10 @@
-  * more details.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/err.h>
- #include <linux/module.h>
- #include <linux/init.h>
---- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
-+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
-@@ -16,8 +16,10 @@
-  * File contents: support functions for PCI/PCIe
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/pci.h>
- 
---- a/drivers/net/wireless/rtlwifi/wifi.h
-+++ b/drivers/net/wireless/rtlwifi/wifi.h
-@@ -30,8 +30,10 @@
- #ifndef __RTL_WIFI_H__
- #define __RTL_WIFI_H__
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/sched.h>
- #include <linux/firmware.h>
- #include <linux/etherdevice.h>
---- a/drivers/net/wireless/ath/main.c
-+++ b/drivers/net/wireless/ath/main.c
-@@ -14,9 +14,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/module.h>
- 
- #include "ath.h"
---- a/drivers/net/wireless/ath/regd.c
-+++ b/drivers/net/wireless/ath/regd.c
-@@ -14,9 +14,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <linux/kernel.h>
-+#include <linux/printk.h>
- #include <linux/export.h>
- #include <net/cfg80211.h>
- #include <net/mac80211.h>
---- a/drivers/net/wireless/ath/ath5k/initvals.c
-+++ b/drivers/net/wireless/ath/ath5k/initvals.c
-@@ -19,8 +19,11 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "reg.h"
- #include "debug.h"
---- a/drivers/net/wireless/ath/ath5k/desc.c
-+++ b/drivers/net/wireless/ath/ath5k/desc.c
-@@ -21,8 +21,11 @@
-  Hardware Descriptor Functions
- \******************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "reg.h"
- #include "debug.h"
---- a/drivers/net/wireless/ath/ath5k/dma.c
-+++ b/drivers/net/wireless/ath/ath5k/dma.c
-@@ -29,8 +29,11 @@
-  * status registers (ISR).
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "reg.h"
- #include "debug.h"
---- a/drivers/net/wireless/ath/ath5k/qcu.c
-+++ b/drivers/net/wireless/ath/ath5k/qcu.c
-@@ -20,8 +20,11 @@
- Queue Control Unit, DCF Control Unit Functions
- \********************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "reg.h"
- #include "debug.h"
---- a/drivers/net/wireless/ath/ath5k/phy.c
-+++ b/drivers/net/wireless/ath/ath5k/phy.c
-@@ -22,8 +22,10 @@
- * PHY related functions *
- \***********************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/delay.h>
- #include <linux/slab.h>
- #include <asm/unaligned.h>
---- a/drivers/net/wireless/ath/ath5k/reset.c
-+++ b/drivers/net/wireless/ath/ath5k/reset.c
-@@ -23,10 +23,12 @@
-   Reset function and helpers
- \****************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <asm/unaligned.h>
- 
-+#include <linux/printk.h>
- #include <linux/pci.h>		/* To determine if a card is pci-e */
- #include <linux/log2.h>
- #include <linux/platform_device.h>
---- a/drivers/net/wireless/ath/ath5k/attach.c
-+++ b/drivers/net/wireless/ath/ath5k/attach.c
-@@ -20,8 +20,10 @@
- * Attach/Detach Functions and helpers *
- \*************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/pci.h>
- #include <linux/slab.h>
- #include "ath5k.h"
---- a/drivers/net/wireless/ath/ath5k/base.c
-+++ b/drivers/net/wireless/ath/ath5k/base.c
-@@ -40,8 +40,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/delay.h>
- #include <linux/dma-mapping.h>
---- a/drivers/net/wireless/ath/ath5k/led.c
-+++ b/drivers/net/wireless/ath/ath5k/led.c
-@@ -39,8 +39,10 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/pci.h>
- #include "ath5k.h"
- 
---- a/drivers/net/wireless/ath/ath5k/ani.c
-+++ b/drivers/net/wireless/ath/ath5k/ani.c
-@@ -14,8 +14,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "reg.h"
- #include "debug.h"
---- a/drivers/net/wireless/ath/ath5k/sysfs.c
-+++ b/drivers/net/wireless/ath/ath5k/sysfs.c
-@@ -1,5 +1,7 @@
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/device.h>
- #include <linux/pci.h>
- 
---- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
-+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
-@@ -41,11 +41,14 @@
-  *
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
- #include <net/mac80211.h>
- #include <asm/unaligned.h>
- 
-+#include <linux/printk.h>
-+
- #include "ath5k.h"
- #include "base.h"
- #include "reg.h"
---- a/drivers/net/wireless/ath/ath5k/pci.c
-+++ b/drivers/net/wireless/ath/ath5k/pci.c
-@@ -14,8 +14,10 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/nl80211.h>
- #include <linux/pci.h>
- #include <linux/pci-aspm.h>
---- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
-+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
-@@ -15,8 +15,10 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/moduleparam.h>
- #include <linux/inetdevice.h>
- #include <linux/export.h>
---- a/drivers/net/wireless/ath/ath6kl/init.c
-+++ b/drivers/net/wireless/ath/ath6kl/init.c
-@@ -16,8 +16,10 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/moduleparam.h>
- #include <linux/errno.h>
- #include <linux/export.h>
---- a/drivers/net/wireless/ath/ath6kl/main.c
-+++ b/drivers/net/wireless/ath/ath6kl/main.c
-@@ -15,8 +15,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "core.h"
- #include "hif-ops.h"
- #include "cfg80211.h"
---- a/drivers/net/wireless/ath/ath6kl/txrx.c
-+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
-@@ -15,8 +15,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "core.h"
- #include "debug.h"
- #include "htc-ops.h"
---- a/drivers/net/wireless/ath/ath9k/init.c
-+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -14,8 +14,10 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/dma-mapping.h>
- #include <linux/slab.h>
- #include <linux/ath9k_platform.h>
---- a/drivers/net/wireless/ath/ath9k/pci.c
-+++ b/drivers/net/wireless/ath/ath9k/pci.c
-@@ -14,8 +14,10 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/nl80211.h>
- #include <linux/pci.h>
- #include <linux/pci-aspm.h>
---- a/drivers/net/wireless/ath/ath9k/htc_hst.c
-+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
-@@ -14,8 +14,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "htc.h"
- 
- static int htc_issue_send(struct htc_target *target, struct sk_buff* skb,
---- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
-+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
-@@ -14,8 +14,11 @@
-  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-  */
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
-+
- #include "htc.h"
- 
- MODULE_AUTHOR("Atheros Communications");
---- a/drivers/net/wireless/iwlwifi/iwl-agn.c
-+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
-@@ -27,8 +27,10 @@
-  *
-  *****************************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/init.h>
---- a/drivers/net/wireless/iwlwifi/iwl-pci.c
-+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
-@@ -61,8 +61,10 @@
-  *
-  *****************************************************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/module.h>
- #include <linux/pci.h>
- #include <linux/pci-aspm.h>
---- a/drivers/net/wireless/ath/ath5k/eeprom.c
-+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
-@@ -21,8 +21,10 @@
- * EEPROM access functions and helpers *
- \*************************************/
- 
-+#undef pr_fmt
- #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
- 
-+#include <linux/printk.h>
- #include <linux/slab.h>
- 
- #include "ath5k.h"
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c 4/9] compat: move netdev_attach_ops
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (5 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c-w 3/4] compat-wireless: do not include linux/compat-2.6.h any more Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c-w 4/4] compat-wireless: copy *.h files from compat/compat Hauke Mehrtens
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-2.6.29.h |  186 --------------------------------------
 include/linux/netdevice.h     |  199 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 199 insertions(+), 186 deletions(-)
 create mode 100644 include/linux/netdevice.h

diff --git a/include/linux/compat-2.6.29.h b/include/linux/compat-2.6.29.h
index 48b62e8..c830c7a 100644
--- a/include/linux/compat-2.6.29.h
+++ b/include/linux/compat-2.6.29.h
@@ -51,181 +51,6 @@ typedef struct {
 
 #define  PCI_EXP_LNKCTL_ES     0x0080  /* Extended Synch */
 
-/*
- * Older kernels do not have struct net_device_ops but what we can
- * do is just define the data structure and use a caller to let us
- * set the data structure's routines onto the old netdev, essentially
- * doing it the old way. This avoids huge deltas on our backports.
- */
-
-/*
- * This structure defines the management hooks for network devices.
- * The following hooks can be defined; unless noted otherwise, they are
- * optional and can be filled with a null pointer.
- *
- * int (*ndo_init)(struct net_device *dev);
- *     This function is called once when network device is registered.
- *     The network device can use this to any late stage initializaton
- *     or semantic validattion. It can fail with an error code which will
- *     be propogated back to register_netdev
- *
- * void (*ndo_uninit)(struct net_device *dev);
- *     This function is called when device is unregistered or when registration
- *     fails. It is not called if init fails.
- *
- * int (*ndo_open)(struct net_device *dev);
- *     This function is called when network device transistions to the up
- *     state.
- *
- * int (*ndo_stop)(struct net_device *dev);
- *     This function is called when network device transistions to the down
- *     state.
- *
- * netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb,
- *                               struct net_device *dev);
- *	Called when a packet needs to be transmitted.
- *	Must return NETDEV_TX_OK , NETDEV_TX_BUSY.
- *        (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX)
- *	Required can not be NULL.
- *
- * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb);
- *	Called to decide which queue to when device supports multiple
- *	transmit queues.
- *
- * void (*ndo_change_rx_flags)(struct net_device *dev, int flags);
- *	This function is called to allow device receiver to make
- *	changes to configuration when multicast or promiscious is enabled.
- *
- * void (*ndo_set_rx_mode)(struct net_device *dev);
- *	This function is called device changes address list filtering.
- *
- * void (*ndo_set_multicast_list)(struct net_device *dev);
- *	This function is called when the multicast address list changes.
- *
- * int (*ndo_set_mac_address)(struct net_device *dev, void *addr);
- *	This function  is called when the Media Access Control address
- *	needs to be changed. If this interface is not defined, the
- *	mac address can not be changed.
- *
- * int (*ndo_validate_addr)(struct net_device *dev);
- *	Test if Media Access Control address is valid for the device.
- *
- * int (*ndo_do_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);
- *	Called when a user request an ioctl which can't be handled by
- *	the generic interface code. If not defined ioctl's return
- *	not supported error code.
- *
- * int (*ndo_set_config)(struct net_device *dev, struct ifmap *map);
- *	Used to set network devices bus interface parameters. This interface
- *	is retained for legacy reason, new devices should use the bus
- *	interface (PCI) for low level management.
- *
- * int (*ndo_change_mtu)(struct net_device *dev, int new_mtu);
- *	Called when a user wants to change the Maximum Transfer Unit
- *	of a device. If not defined, any request to change MTU will
- *	will return an error.
- *
- * void (*ndo_tx_timeout)(struct net_device *dev);
- *	Callback uses when the transmitter has not made any progress
- *	for dev->watchdog ticks.
- *
- * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
- *	Called when a user wants to get the network device usage
- *	statistics. If not defined, the counters in dev->stats will
- *	be used.
- *
- * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp);
- *	If device support VLAN receive accleration
- *	(ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called
- *	when vlan groups for the device changes.  Note: grp is NULL
- *	if no vlan's groups are being used.
- *
- * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid);
- *	If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER)
- *	this function is called when a VLAN id is registered.
- *
- * void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, unsigned short vid);
- *	If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER)
- *	this function is called when a VLAN id is unregistered.
- *
- * void (*ndo_poll_controller)(struct net_device *dev);
- *
- *	SR-IOV management functions.
- * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac);
- * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos);
- * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate);
- * int (*ndo_get_vf_config)(struct net_device *dev,
- *			    int vf, struct ifla_vf_info *ivf);
- */
-#define HAVE_NET_DEVICE_OPS
-struct net_device_ops {
-	int			(*ndo_init)(struct net_device *dev);
-	void			(*ndo_uninit)(struct net_device *dev);
-	int			(*ndo_open)(struct net_device *dev);
-	int			(*ndo_stop)(struct net_device *dev);
-	netdev_tx_t		(*ndo_start_xmit) (struct sk_buff *skb,
-						   struct net_device *dev);
-	u16			(*ndo_select_queue)(struct net_device *dev,
-						    struct sk_buff *skb);
-	void			(*ndo_change_rx_flags)(struct net_device *dev,
-						       int flags);
-	void			(*ndo_set_rx_mode)(struct net_device *dev);
-	void			(*ndo_set_multicast_list)(struct net_device *dev);
-	int			(*ndo_set_mac_address)(struct net_device *dev,
-						       void *addr);
-	int			(*ndo_validate_addr)(struct net_device *dev);
-	int			(*ndo_do_ioctl)(struct net_device *dev,
-					        struct ifreq *ifr, int cmd);
-	int			(*ndo_set_config)(struct net_device *dev,
-					          struct ifmap *map);
-	int			(*ndo_change_mtu)(struct net_device *dev,
-						  int new_mtu);
-	int			(*ndo_neigh_setup)(struct net_device *dev,
-						   struct neigh_parms *);
-	void			(*ndo_tx_timeout) (struct net_device *dev);
-
-	struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
-
-	void			(*ndo_vlan_rx_register)(struct net_device *dev,
-						        struct vlan_group *grp);
-	void			(*ndo_vlan_rx_add_vid)(struct net_device *dev,
-						       unsigned short vid);
-	void			(*ndo_vlan_rx_kill_vid)(struct net_device *dev,
-						        unsigned short vid);
-#ifdef CONFIG_NET_POLL_CONTROLLER
-	void                    (*ndo_poll_controller)(struct net_device *dev);
-#endif
-	int			(*ndo_set_vf_mac)(struct net_device *dev,
-						  int queue, u8 *mac);
-	int			(*ndo_set_vf_vlan)(struct net_device *dev,
-						   int queue, u16 vlan, u8 qos);
-	int			(*ndo_set_vf_tx_rate)(struct net_device *dev,
-						      int vf, int rate);
-/*
- * The struct ifla_vf_info was added via b280da8d54b8d82b52f368a8703b7ada6c1744d5
- * on the v2.6.34-rc1~233^2~338 release
- */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
-	int			(*ndo_get_vf_config)(struct net_device *dev,
-						     int vf,
-						     struct ifla_vf_info *ivf);
-#endif
-#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
-	int			(*ndo_fcoe_enable)(struct net_device *dev);
-	int			(*ndo_fcoe_disable)(struct net_device *dev);
-	int			(*ndo_fcoe_ddp_setup)(struct net_device *dev,
-						      u16 xid,
-						      struct scatterlist *sgl,
-						      unsigned int sgc);
-	int			(*ndo_fcoe_ddp_done)(struct net_device *dev,
-						     u16 xid);
-#define NETDEV_FCOE_WWNN 0
-#define NETDEV_FCOE_WWPN 1
-	int			(*ndo_fcoe_get_wwn)(struct net_device *dev,
-						    u64 *wwn, int type);
-#endif
-};
-
 static inline int ndo_do_ioctl(struct net_device *dev,
 			       struct ifreq *ifr,
 			       int cmd)
@@ -235,10 +60,6 @@ static inline int ndo_do_ioctl(struct net_device *dev,
 	return -EOPNOTSUPP;
 }
 
-
-void netdev_attach_ops(struct net_device *dev,
-		       const struct net_device_ops *ops);
-
 /**
  *	skb_queue_is_first - check if skb is the first entry in the queue
  *	@list: queue head
@@ -354,13 +175,6 @@ extern int		init_dummy_netdev(struct net_device *dev);
 
 /* Kernels >= 2.6.29 follows */
 
-/* XXX: this can probably just go upstream ! */
-static inline void netdev_attach_ops(struct net_device *dev,
-		       const struct net_device_ops *ops)
-{
-	dev->netdev_ops = ops;
-}
-
 /* XXX: this can probably just go upstream! */
 static inline int ndo_do_ioctl(struct net_device *dev,
 			       struct ifreq *ifr,
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
new file mode 100644
index 0000000..6c0582d
--- /dev/null
+++ b/include/linux/netdevice.h
@@ -0,0 +1,199 @@
+#ifndef _COMPAT_LINUX_NETDEVICE_H
+#define _COMPAT_LINUX_NETDEVICE_H
+
+#include_next <linux/netdevice.h>
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
+
+/*
+ * Older kernels do not have struct net_device_ops but what we can
+ * do is just define the data structure and use a caller to let us
+ * set the data structure's routines onto the old netdev, essentially
+ * doing it the old way. This avoids huge deltas on our backports.
+ */
+
+/*
+ * This structure defines the management hooks for network devices.
+ * The following hooks can be defined; unless noted otherwise, they are
+ * optional and can be filled with a null pointer.
+ *
+ * int (*ndo_init)(struct net_device *dev);
+ *     This function is called once when network device is registered.
+ *     The network device can use this to any late stage initializaton
+ *     or semantic validattion. It can fail with an error code which will
+ *     be propogated back to register_netdev
+ *
+ * void (*ndo_uninit)(struct net_device *dev);
+ *     This function is called when device is unregistered or when registration
+ *     fails. It is not called if init fails.
+ *
+ * int (*ndo_open)(struct net_device *dev);
+ *     This function is called when network device transistions to the up
+ *     state.
+ *
+ * int (*ndo_stop)(struct net_device *dev);
+ *     This function is called when network device transistions to the down
+ *     state.
+ *
+ * netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb,
+ *                               struct net_device *dev);
+ *	Called when a packet needs to be transmitted.
+ *	Must return NETDEV_TX_OK , NETDEV_TX_BUSY.
+ *        (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX)
+ *	Required can not be NULL.
+ *
+ * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb);
+ *	Called to decide which queue to when device supports multiple
+ *	transmit queues.
+ *
+ * void (*ndo_change_rx_flags)(struct net_device *dev, int flags);
+ *	This function is called to allow device receiver to make
+ *	changes to configuration when multicast or promiscious is enabled.
+ *
+ * void (*ndo_set_rx_mode)(struct net_device *dev);
+ *	This function is called device changes address list filtering.
+ *
+ * void (*ndo_set_multicast_list)(struct net_device *dev);
+ *	This function is called when the multicast address list changes.
+ *
+ * int (*ndo_set_mac_address)(struct net_device *dev, void *addr);
+ *	This function  is called when the Media Access Control address
+ *	needs to be changed. If this interface is not defined, the
+ *	mac address can not be changed.
+ *
+ * int (*ndo_validate_addr)(struct net_device *dev);
+ *	Test if Media Access Control address is valid for the device.
+ *
+ * int (*ndo_do_ioctl)(struct net_device *dev, struct ifreq *ifr, int cmd);
+ *	Called when a user request an ioctl which can't be handled by
+ *	the generic interface code. If not defined ioctl's return
+ *	not supported error code.
+ *
+ * int (*ndo_set_config)(struct net_device *dev, struct ifmap *map);
+ *	Used to set network devices bus interface parameters. This interface
+ *	is retained for legacy reason, new devices should use the bus
+ *	interface (PCI) for low level management.
+ *
+ * int (*ndo_change_mtu)(struct net_device *dev, int new_mtu);
+ *	Called when a user wants to change the Maximum Transfer Unit
+ *	of a device. If not defined, any request to change MTU will
+ *	will return an error.
+ *
+ * void (*ndo_tx_timeout)(struct net_device *dev);
+ *	Callback uses when the transmitter has not made any progress
+ *	for dev->watchdog ticks.
+ *
+ * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
+ *	Called when a user wants to get the network device usage
+ *	statistics. If not defined, the counters in dev->stats will
+ *	be used.
+ *
+ * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp);
+ *	If device support VLAN receive accleration
+ *	(ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called
+ *	when vlan groups for the device changes.  Note: grp is NULL
+ *	if no vlan's groups are being used.
+ *
+ * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid);
+ *	If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER)
+ *	this function is called when a VLAN id is registered.
+ *
+ * void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, unsigned short vid);
+ *	If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER)
+ *	this function is called when a VLAN id is unregistered.
+ *
+ * void (*ndo_poll_controller)(struct net_device *dev);
+ *
+ *	SR-IOV management functions.
+ * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac);
+ * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos);
+ * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate);
+ * int (*ndo_get_vf_config)(struct net_device *dev,
+ *			    int vf, struct ifla_vf_info *ivf);
+ */
+#define HAVE_NET_DEVICE_OPS
+struct net_device_ops {
+	int			(*ndo_init)(struct net_device *dev);
+	void			(*ndo_uninit)(struct net_device *dev);
+	int			(*ndo_open)(struct net_device *dev);
+	int			(*ndo_stop)(struct net_device *dev);
+	netdev_tx_t		(*ndo_start_xmit) (struct sk_buff *skb,
+						   struct net_device *dev);
+	u16			(*ndo_select_queue)(struct net_device *dev,
+						    struct sk_buff *skb);
+	void			(*ndo_change_rx_flags)(struct net_device *dev,
+						       int flags);
+	void			(*ndo_set_rx_mode)(struct net_device *dev);
+	void			(*ndo_set_multicast_list)(struct net_device *dev);
+	int			(*ndo_set_mac_address)(struct net_device *dev,
+						       void *addr);
+	int			(*ndo_validate_addr)(struct net_device *dev);
+	int			(*ndo_do_ioctl)(struct net_device *dev,
+					        struct ifreq *ifr, int cmd);
+	int			(*ndo_set_config)(struct net_device *dev,
+					          struct ifmap *map);
+	int			(*ndo_change_mtu)(struct net_device *dev,
+						  int new_mtu);
+	int			(*ndo_neigh_setup)(struct net_device *dev,
+						   struct neigh_parms *);
+	void			(*ndo_tx_timeout) (struct net_device *dev);
+
+	struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
+
+	void			(*ndo_vlan_rx_register)(struct net_device *dev,
+						        struct vlan_group *grp);
+	void			(*ndo_vlan_rx_add_vid)(struct net_device *dev,
+						       unsigned short vid);
+	void			(*ndo_vlan_rx_kill_vid)(struct net_device *dev,
+						        unsigned short vid);
+#ifdef CONFIG_NET_POLL_CONTROLLER
+	void                    (*ndo_poll_controller)(struct net_device *dev);
+#endif
+	int			(*ndo_set_vf_mac)(struct net_device *dev,
+						  int queue, u8 *mac);
+	int			(*ndo_set_vf_vlan)(struct net_device *dev,
+						   int queue, u16 vlan, u8 qos);
+	int			(*ndo_set_vf_tx_rate)(struct net_device *dev,
+						      int vf, int rate);
+/*
+ * The struct ifla_vf_info was added via b280da8d54b8d82b52f368a8703b7ada6c1744d5
+ * on the v2.6.34-rc1~233^2~338 release
+ */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+	int			(*ndo_get_vf_config)(struct net_device *dev,
+						     int vf,
+						     struct ifla_vf_info *ivf);
+#endif
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+	int			(*ndo_fcoe_enable)(struct net_device *dev);
+	int			(*ndo_fcoe_disable)(struct net_device *dev);
+	int			(*ndo_fcoe_ddp_setup)(struct net_device *dev,
+						      u16 xid,
+						      struct scatterlist *sgl,
+						      unsigned int sgc);
+	int			(*ndo_fcoe_ddp_done)(struct net_device *dev,
+						     u16 xid);
+#define NETDEV_FCOE_WWNN 0
+#define NETDEV_FCOE_WWPN 1
+	int			(*ndo_fcoe_get_wwn)(struct net_device *dev,
+						    u64 *wwn, int type);
+#endif
+};
+
+void netdev_attach_ops(struct net_device *dev,
+		       const struct net_device_ops *ops);
+
+#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
+
+/* XXX: this can probably just go upstream ! */
+static inline void netdev_attach_ops(struct net_device *dev,
+		       const struct net_device_ops *ops)
+{
+	dev->netdev_ops = ops;
+}
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
+
+#endif	/* _COMPAT_LINUX_NETDEVICE_H */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c-w 4/4] compat-wireless: copy *.h files from compat/compat
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (6 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c 4/9] compat: move netdev_attach_ops Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c 5/9] compat: move compat_pci_{suspend,resume} Hauke Mehrtens
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 scripts/admin-update.sh |    1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 7147ff1..6dd0c01 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -429,6 +429,7 @@ COMPAT="compat"
 mkdir -p $COMPAT
 echo "Copying $GIT_COMPAT_TREE/ files..."
 cp $GIT_COMPAT_TREE/compat/*.c $COMPAT/
+cp $GIT_COMPAT_TREE/compat/*.h $COMPAT/
 cp $GIT_COMPAT_TREE/compat/Makefile $COMPAT/
 cp -a $GIT_COMPAT_TREE/udev .
 cp -a $GIT_COMPAT_TREE/scripts $COMPAT/
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c 5/9] compat: move compat_pci_{suspend,resume}
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (7 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c-w 4/4] compat-wireless: copy *.h files from compat/compat Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c 6/9] compat: move simple_open() Hauke Mehrtens
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-2.6.29.h |   33 -----------------------------
 include/linux/pci.h           |   47 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 33 deletions(-)
 create mode 100644 include/linux/pci.h

diff --git a/include/linux/compat-2.6.29.h b/include/linux/compat-2.6.29.h
index c830c7a..c70af3a 100644
--- a/include/linux/compat-2.6.29.h
+++ b/include/linux/compat-2.6.29.h
@@ -141,36 +141,6 @@ static inline struct net *read_pnet(struct net * const *pnet)
 
 extern int		init_dummy_netdev(struct net_device *dev);
 
-#define compat_pci_suspend(fn)						\
-	int fn##_compat(struct pci_dev *pdev, pm_message_t state) 	\
-	{								\
-		int r;							\
-									\
-		r = fn(&pdev->dev);					\
-		if (r)							\
-			return r;					\
-									\
-		pci_save_state(pdev);					\
-		pci_disable_device(pdev);				\
-		pci_set_power_state(pdev, PCI_D3hot);			\
-									\
-		return 0;						\
-	}
-
-#define compat_pci_resume(fn)						\
-	int fn##_compat(struct pci_dev *pdev)				\
-	{								\
-		int r;							\
-									\
-		pci_set_power_state(pdev, PCI_D0);			\
-		r = pci_enable_device(pdev);				\
-		if (r)							\
-			return r;					\
-		pci_restore_state(pdev);				\
-									\
-		return fn(&pdev->dev);					\
-	}
-
 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
 
 /* Kernels >= 2.6.29 follows */
@@ -185,9 +155,6 @@ static inline int ndo_do_ioctl(struct net_device *dev,
 	return -EOPNOTSUPP;
 }
 
-#define compat_pci_suspend(fn)
-#define compat_pci_resume(fn)
-
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
 
 #endif /*  LINUX_26_29_COMPAT_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
new file mode 100644
index 0000000..fe1a761
--- /dev/null
+++ b/include/linux/pci.h
@@ -0,0 +1,47 @@
+#ifndef _COMPAT_LINUX_PCI_H
+#define _COMPAT_LINUX_PCI_H
+
+#include_next <linux/pci.h>
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
+
+#define compat_pci_suspend(fn)						\
+	int fn##_compat(struct pci_dev *pdev, pm_message_t state) 	\
+	{								\
+		int r;							\
+									\
+		r = fn(&pdev->dev);					\
+		if (r)							\
+			return r;					\
+									\
+		pci_save_state(pdev);					\
+		pci_disable_device(pdev);				\
+		pci_set_power_state(pdev, PCI_D3hot);			\
+									\
+		return 0;						\
+	}
+
+#define compat_pci_resume(fn)						\
+	int fn##_compat(struct pci_dev *pdev)				\
+	{								\
+		int r;							\
+									\
+		pci_set_power_state(pdev, PCI_D0);			\
+		r = pci_enable_device(pdev);				\
+		if (r)							\
+			return r;					\
+		pci_restore_state(pdev);				\
+									\
+		return fn(&pdev->dev);					\
+	}
+
+#else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
+
+#define compat_pci_suspend(fn)
+#define compat_pci_resume(fn)
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
+
+#endif	/* _COMPAT_LINUX_PCI_H */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c 6/9] compat: move simple_open()
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (8 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c 5/9] compat: move compat_pci_{suspend,resume} Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c 7/9] compat: move code from compat-3.4.h Hauke Mehrtens
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-3.5.h |    2 --
 include/linux/fs.h         |   14 ++++++++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 include/linux/fs.h

diff --git a/include/linux/compat-3.5.h b/include/linux/compat-3.5.h
index 9c10a42..07a79a6 100644
--- a/include/linux/compat-3.5.h
+++ b/include/linux/compat-3.5.h
@@ -6,8 +6,6 @@
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
 
-extern int simple_open(struct inode *inode, struct file *file);
-
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */
 
 #endif /* LINUX_3_5_COMPAT_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
new file mode 100644
index 0000000..f0412ba
--- /dev/null
+++ b/include/linux/fs.h
@@ -0,0 +1,14 @@
+#ifndef _COMPAT_LINUX_FS_H
+#define _COMPAT_LINUX_FS_H
+
+#include_next <linux/fs.h>
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0))
+
+extern int simple_open(struct inode *inode, struct file *file);
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */
+
+#endif	/* _COMPAT_LINUX_FS_H */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c 7/9] compat: move code from compat-3.4.h
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (9 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c 6/9] compat: move simple_open() Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c 8/9] compat: move code from compat-3.3.h Hauke Mehrtens
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens

compat: move module_pci_driver()

compat: move skb_add_rx_frag()

compat: move COMPAT_USE_64BIT_TIME

compat: move eth_hw_addr_random

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-2.6.28.h |    3 --
 include/linux/compat-3.4.h    |   67 -----------------------------------------
 include/linux/compat.h        |   21 +++++++++++++
 include/linux/etherdevice.h   |   51 +++++++++++++++++++++++++++++++
 include/linux/pci.h           |   16 ++++++++++
 include/linux/skbuff.h        |   23 ++++++++++++++
 6 files changed, 111 insertions(+), 70 deletions(-)
 create mode 100644 include/linux/compat.h
 create mode 100644 include/linux/etherdevice.h
 create mode 100644 include/linux/skbuff.h

diff --git a/include/linux/compat-2.6.28.h b/include/linux/compat-2.6.28.h
index 3980989..662c1b6 100644
--- a/include/linux/compat-2.6.28.h
+++ b/include/linux/compat-2.6.28.h
@@ -246,9 +246,6 @@ static inline void skb_queue_splice_tail(const struct sk_buff_head *list,
 
 unsigned long round_jiffies_up(unsigned long j);
 
-extern void v2_6_28_skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,
-			    int off, int size);
-
 #define wake_up_interruptible_poll(x, m)			\
 	__wake_up(x, TASK_INTERRUPTIBLE, 1, (void *) (m))
 
diff --git a/include/linux/compat-3.4.h b/include/linux/compat-3.4.h
index 1b72374..8e72f2f 100644
--- a/include/linux/compat-3.4.h
+++ b/include/linux/compat-3.4.h
@@ -8,73 +8,6 @@
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 
-#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/include/linux/compat.h b/include/linux/compat.h
new file mode 100644
index 0000000..852dccd
--- /dev/null
+++ b/include/linux/compat.h
@@ -0,0 +1,21 @@
+#ifndef _COMPAT_LINUX_COMPAT_H
+#define _COMPAT_LINUX_COMPAT_H
+
+#include_next <linux/compat.h>
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+
+#ifdef CONFIG_X86_X32_ABI
+#define COMPAT_USE_64BIT_TIME \
+	(!!(task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT))
+#else
+#ifndef COMPAT_USE_64BIT_TIME
+#define COMPAT_USE_64BIT_TIME 0
+#endif
+#endif
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
+
+#endif	/* _COMPAT_LINUX_COMPAT_H */
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
new file mode 100644
index 0000000..5c22a6b
--- /dev/null
+++ b/include/linux/etherdevice.h
@@ -0,0 +1,51 @@
+#ifndef _COMPAT_LINUX_ETHERDEVICE_H
+#define _COMPAT_LINUX_ETHERDEVICE_H
+
+#include_next <linux/etherdevice.h>
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+
+#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)) */
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
+
+#endif	/* _COMPAT_LINUX_ETHERDEVICE_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index fe1a761..6231e5e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -44,4 +44,20 @@
 
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)) */
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+
+/**
+ * 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	/* _COMPAT_LINUX_PCI_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
new file mode 100644
index 0000000..e505f6a
--- /dev/null
+++ b/include/linux/skbuff.h
@@ -0,0 +1,23 @@
+#ifndef _COMPAT_LINUX_SKBUFF_H
+#define _COMPAT_LINUX_SKBUFF_H
+
+#include_next <linux/skbuff.h>
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+
+#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)
+
+extern void v2_6_28_skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,
+			    int off, int size);
+#else
+#define skb_add_rx_frag(skb, i, page, off, size, truesize) \
+	skb_add_rx_frag(skb, i, page, off, size)
+#endif
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)) */
+
+#endif	/* _COMPAT_LINUX_SKBUFF_H */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c 8/9] compat: move code from compat-3.3.h
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (10 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c 7/9] compat: move code from compat-3.4.h Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-04-26 18:07 ` [RFC c 9/9] compat: do not include compat-2.6.h Hauke Mehrtens
  2012-05-03 18:58 ` [RFC 0/9] compat-wireless: restructure header files in compat Johannes Berg
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens

compat: move __pskb_copy() and skb_complete_wifi_ack()

compat: move netdev_features_t

compat: move module_driver()

compat: move module_usb_driver()

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-3.3.h      |   44 ---------------------------------------
 include/linux/device.h          |   38 +++++++++++++++++++++++++++++++++
 include/linux/netdev_features.h |   22 ++++++++++++++++++++
 include/linux/netdevice.h       |   10 +++++++--
 include/linux/skbuff.h          |   11 ++++++++++
 include/linux/usb.h             |   24 +++++++++++++++++++++
 6 files changed, 103 insertions(+), 46 deletions(-)
 create mode 100644 include/linux/device.h
 create mode 100644 include/linux/netdev_features.h
 create mode 100644 include/linux/usb.h

diff --git a/include/linux/compat-3.3.h b/include/linux/compat-3.3.h
index 69bdcd0..ea331f5 100644
--- a/include/linux/compat-3.3.h
+++ b/include/linux/compat-3.3.h
@@ -9,52 +9,8 @@
 #include <linux/nl80211.h>
 #include <linux/skbuff.h>
 
-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)
-{
-	WARN_ON(1);
-}
 #define NL80211_FEATURE_SK_TX_STATUS 0
 
-typedef u32 netdev_features_t;
-
-/* source include/linux/device.h */
-/**
- * module_driver() - Helper macro for drivers that don't 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().
- *
- * Use this macro to construct bus specific macros for registering
- * drivers, and do not use it on its own.
- */
-#define module_driver(__driver, __register, __unregister) \
-static int __init __driver##_init(void) \
-{ \
-	return __register(&(__driver)); \
-} \
-module_init(__driver##_init); \
-static void __exit __driver##_exit(void) \
-{ \
-	__unregister(&(__driver)); \
-} \
-module_exit(__driver##_exit);
-
-/* source include/linux/usb.h */
-/**
- * module_usb_driver() - Helper macro for registering a USB driver
- * @__usb_driver: usb_driver struct
- *
- * Helper macro for USB 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_usb_driver(__usb_driver) \
-	module_driver(__usb_driver, usb_register, \
-		       usb_deregister)
-
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
 
 #endif /* LINUX_3_3_COMPAT_H */
diff --git a/include/linux/device.h b/include/linux/device.h
new file mode 100644
index 0000000..e4efd9a
--- /dev/null
+++ b/include/linux/device.h
@@ -0,0 +1,38 @@
+#ifndef _COMPAT_LINUX_DEVICE_H
+#define _COMPAT_LINUX_DEVICE_H
+
+#include_next <linux/device.h>
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
+
+/**
+ * module_driver() - Helper macro for drivers that don't 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().
+ *
+ * @__driver: driver name
+ * @__register: register function for this driver type
+ * @__unregister: unregister function for this driver type
+ * @...: Additional arguments to be passed to __register and __unregister.
+ *
+ * Use this macro to construct bus specific macros for registering
+ * drivers, and do not use it on its own.
+ */
+#define module_driver(__driver, __register, __unregister, ...) \
+static int __init __driver##_init(void) \
+{ \
+	return __register(&(__driver) , ##__VA_ARGS__); \
+} \
+module_init(__driver##_init); \
+static void __exit __driver##_exit(void) \
+{ \
+	__unregister(&(__driver) , ##__VA_ARGS__); \
+} \
+module_exit(__driver##_exit);
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
+
+#endif	/* _COMPAT_LINUX_DEVICE_H */
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
new file mode 100644
index 0000000..2b702e9
--- /dev/null
+++ b/include/linux/netdev_features.h
@@ -0,0 +1,22 @@
+#ifndef _COMPAT_LINUX_NETDEV_FEATURES_H
+#define _COMPAT_LINUX_NETDEV_FEATURES_H
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
+#include <linux/netdevice.h>
+#else
+#include_next <linux/netdev_features.h>
+#endif
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
+
+#include <linux/types.h>
+
+typedef u32 netdev_features_t;
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
+
+#endif	/* _COMPAT_LINUX_NETDEV_FEATURES_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 6c0582d..97153ba 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1,10 +1,16 @@
 #ifndef _COMPAT_LINUX_NETDEVICE_H
 #define _COMPAT_LINUX_NETDEVICE_H
 
-#include_next <linux/netdevice.h>
-
 #include <linux/version.h>
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
+
+#include <linux/netdev_features.h>
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
+
+#include_next <linux/netdevice.h>
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
 
 /*
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e505f6a..8b5188c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -5,6 +5,17 @@
 
 #include <linux/version.h>
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
+
+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)
+{
+	WARN_ON(1);
+}
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28))
diff --git a/include/linux/usb.h b/include/linux/usb.h
new file mode 100644
index 0000000..43e0683
--- /dev/null
+++ b/include/linux/usb.h
@@ -0,0 +1,24 @@
+#ifndef _COMPAT_LINUX_USB_H
+#define _COMPAT_LINUX_USB_H
+
+#include_next <linux/usb.h>
+
+#include <linux/version.h>
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0))
+
+/**
+ * module_usb_driver() - Helper macro for registering a USB driver
+ * @__usb_driver: usb_driver struct
+ *
+ * Helper macro for USB 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_usb_driver(__usb_driver) \
+	module_driver(__usb_driver, usb_register, \
+		       usb_deregister)
+
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) */
+
+#endif	/* _COMPAT_LINUX_USB_H */
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [RFC c 9/9] compat: do not include compat-2.6.h
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (11 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c 8/9] compat: move code from compat-3.3.h Hauke Mehrtens
@ 2012-04-26 18:07 ` Hauke Mehrtens
  2012-05-03 18:58 ` [RFC 0/9] compat-wireless: restructure header files in compat Johannes Berg
  13 siblings, 0 replies; 18+ messages in thread
From: Hauke Mehrtens @ 2012-04-26 18:07 UTC (permalink / raw)
  To: mcgrof; +Cc: lf_driver_backport, linux-wireless, Hauke Mehrtens


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 Makefile               |    1 -
 include/linux/rfkill.h |    2 --
 2 files changed, 3 deletions(-)

diff --git a/Makefile b/Makefile
index 8775294..d67356a 100644
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,6 @@ else
 # when building our compat modules. Your own makefile would look
 # the same.
 NOSTDINC_FLAGS := -I$(M)/include/ \
-	-include $(M)/include/linux/compat-2.6.h \
 	$(CFLAGS) \
 	-DCOMPAT_BASE_TREE="\"$(COMPAT_BASE_TREE)\"" \
 	-DCOMPAT_BASE_TREE_VERSION="\"$(COMPAT_BASE_TREE_VERSION)\"" \
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index d615ac9..d31b22c 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -7,8 +7,6 @@
 
 #else
 
-#include <linux/compat-2.6.h>
-
 #undef CONFIG_RFKILL
 #undef CONFIG_RFKILL_INPUT
 #undef CONFIG_RFKILL_LEDS
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [RFC c-w 2/4] compat-wireless: also copy include/generated/ from compat
  2012-04-26 18:07 ` [RFC c-w 2/4] compat-wireless: also copy include/generated/ from compat Hauke Mehrtens
@ 2012-05-03 18:57   ` Johannes Berg
  2012-05-03 19:05     ` Hauke Mehrtens
  0 siblings, 1 reply; 18+ messages in thread
From: Johannes Berg @ 2012-05-03 18:57 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: mcgrof, lf_driver_backport, linux-wireless

On Thu, 2012-04-26 at 20:07 +0200, Hauke Mehrtens wrote:
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  scripts/admin-update.sh |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
> index fd1fa87..7147ff1 100755
> --- a/scripts/admin-update.sh
> +++ b/scripts/admin-update.sh
> @@ -283,6 +283,7 @@ mkdir -p include/linux/ include/net/ include/linux/usb \
>  	include/trace \
>  	include/pcmcia \
>  	include/crypto \
> +	include/generated \

Are you sure we want this? It seems to me that most generated things
like asm-offsets etc. need to be taken from the *target* kernel.

johannes


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [RFC 0/9] compat-wireless: restructure header files in compat
  2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
                   ` (12 preceding siblings ...)
  2012-04-26 18:07 ` [RFC c 9/9] compat: do not include compat-2.6.h Hauke Mehrtens
@ 2012-05-03 18:58 ` Johannes Berg
  13 siblings, 0 replies; 18+ messages in thread
From: Johannes Berg @ 2012-05-03 18:58 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: mcgrof, lf_driver_backport, linux-wireless

On Thu, 2012-04-26 at 20:07 +0200, Hauke Mehrtens wrote:
> The patch series moves the compat code from include/linux/compat-*.h 
> into new files with the same name as the file where this code is placed 
> in the mainline kernel. With this approach we do not have to include 
> all include/linux/compat-*.h files in the build process any more, but 
> we extend the existing header files by the code needed.
> 
> This compiles without any warnings for me with kernel 3.2 to 3.4 and 
> fixes the problems with pr_fmt() without the need of any patch.
> Sometimes I had problems compiling compat-wireless, because some header 
> file I would not like to include was included because of compat-2.6.h 
> included mostly every header file available in the kernel.
> 
> This patch series is only done to support kernel >= 3.2, supporting the 
> other versions is just more work, but I want to have some responses on 
> this first. There are probably some other problems and some more 
> cleanup is possible.
> In the end we will remove the include/linux/compat-*.h files.
> 
> I have a problem where compat does changes to header files provided by 
> compat-wireless like #define NL80211_FEATURE_SK_TX_STATUS 0 in compat-
> 2.6.33.h. To make this work we should add an other include directory in 
> compat-wireless.
> The hierarchy of include directories should be this: 1. include dir 
> from compat, 2. include dir from compat-wireless, 3. the kernel include 
> dir, now the 1. and the 2. are but into one directory.


I think this is worthwhile. There may be some issues with it,
particularly when header files are renamed, but I think those can be
solved relatively easily, like we already did with tracing.

johannes


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [RFC c-w 2/4] compat-wireless: also copy include/generated/ from compat
  2012-05-03 18:57   ` Johannes Berg
@ 2012-05-03 19:05     ` Hauke Mehrtens
  2012-05-03 19:20       ` Johannes Berg
  0 siblings, 1 reply; 18+ messages in thread
From: Hauke Mehrtens @ 2012-05-03 19:05 UTC (permalink / raw)
  To: Johannes Berg; +Cc: mcgrof, lf_driver_backport, linux-wireless

On 05/03/2012 08:57 PM, Johannes Berg wrote:
> On Thu, 2012-04-26 at 20:07 +0200, Hauke Mehrtens wrote:
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>  scripts/admin-update.sh |    2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
>> index fd1fa87..7147ff1 100755
>> --- a/scripts/admin-update.sh
>> +++ b/scripts/admin-update.sh
>> @@ -283,6 +283,7 @@ mkdir -p include/linux/ include/net/ include/linux/usb \
>>  	include/trace \
>>  	include/pcmcia \
>>  	include/crypto \
>> +	include/generated \
> 
> Are you sure we want this? It seems to me that most generated things
> like asm-offsets etc. need to be taken from the *target* kernel.

The directory include/generated/ in compat, just contains
include/generated/autoconf.h, which will include linux/compat_autoconf.h
and the original file from the kernel. This way the compat_autoconf.h
will always be included when autoconf.h gets included.
See "[RFC c 2/9] compat: include compat_autoconf.h"

I do not think there will be any other header in include/generated/ we
want to extend or overwrite in compat.

Hauke

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [RFC c-w 2/4] compat-wireless: also copy include/generated/ from compat
  2012-05-03 19:05     ` Hauke Mehrtens
@ 2012-05-03 19:20       ` Johannes Berg
  0 siblings, 0 replies; 18+ messages in thread
From: Johannes Berg @ 2012-05-03 19:20 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: mcgrof, lf_driver_backport, linux-wireless

On Thu, 2012-05-03 at 21:05 +0200, Hauke Mehrtens wrote:
> On 05/03/2012 08:57 PM, Johannes Berg wrote:
> > On Thu, 2012-04-26 at 20:07 +0200, Hauke Mehrtens wrote:
> >> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> >> ---
> >>  scripts/admin-update.sh |    2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
> >> index fd1fa87..7147ff1 100755
> >> --- a/scripts/admin-update.sh
> >> +++ b/scripts/admin-update.sh
> >> @@ -283,6 +283,7 @@ mkdir -p include/linux/ include/net/ include/linux/usb \
> >>  	include/trace \
> >>  	include/pcmcia \
> >>  	include/crypto \
> >> +	include/generated \
> > 
> > Are you sure we want this? It seems to me that most generated things
> > like asm-offsets etc. need to be taken from the *target* kernel.
> 
> The directory include/generated/ in compat, just contains
> include/generated/autoconf.h, which will include linux/compat_autoconf.h
> and the original file from the kernel. This way the compat_autoconf.h
> will always be included when autoconf.h gets included.
> See "[RFC c 2/9] compat: include compat_autoconf.h"
> 
> I do not think there will be any other header in include/generated/ we
> want to extend or overwrite in compat.

Oh, this is copying from compat, not the base kernel, I got that
confused. Sorry!

johannes


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-05-03 19:20 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-26 18:07 [RFC 0/9] compat-wireless: restructure header files in compat Hauke Mehrtens
2012-04-26 18:07 ` [RFC c 1/9] compat: move compat_system_workqueue_{create,destroy} and compat_pm_qos_power_{init,deinit} Hauke Mehrtens
2012-04-26 18:07 ` [RFC c-w 1/4] compat-wireless: fix header of compat-autoconf.h Hauke Mehrtens
2012-04-26 18:07 ` [RFC c 2/9] compat: include compat_autoconf.h Hauke Mehrtens
2012-04-26 18:07 ` [RFC c-w 2/4] compat-wireless: also copy include/generated/ from compat Hauke Mehrtens
2012-05-03 18:57   ` Johannes Berg
2012-05-03 19:05     ` Hauke Mehrtens
2012-05-03 19:20       ` Johannes Berg
2012-04-26 18:07 ` [RFC c 3/9] compat: move br_port_exists Hauke Mehrtens
2012-04-26 18:07 ` [RFC c-w 3/4] compat-wireless: do not include linux/compat-2.6.h any more Hauke Mehrtens
2012-04-26 18:07 ` [RFC c 4/9] compat: move netdev_attach_ops Hauke Mehrtens
2012-04-26 18:07 ` [RFC c-w 4/4] compat-wireless: copy *.h files from compat/compat Hauke Mehrtens
2012-04-26 18:07 ` [RFC c 5/9] compat: move compat_pci_{suspend,resume} Hauke Mehrtens
2012-04-26 18:07 ` [RFC c 6/9] compat: move simple_open() Hauke Mehrtens
2012-04-26 18:07 ` [RFC c 7/9] compat: move code from compat-3.4.h Hauke Mehrtens
2012-04-26 18:07 ` [RFC c 8/9] compat: move code from compat-3.3.h Hauke Mehrtens
2012-04-26 18:07 ` [RFC c 9/9] compat: do not include compat-2.6.h Hauke Mehrtens
2012-05-03 18:58 ` [RFC 0/9] compat-wireless: restructure header files in compat Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).