2011-12-03 14:49:33

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 1/2] compat: add config var for CORDIC and CRC8

Sometimes the kernel version compat-wireless is build against has
support for cordic and crc8 in its source, but these modules were not
build when the kernel was build, because no one selected them. The modules are
needed for the bcmsmac driver and they should be build every time when
they were not already build while the kernel was build.

Signed-off-by: Hauke Mehrtens <[email protected]>
---
compat/Makefile | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compat/Makefile b/compat/Makefile
index 9e4db44..fa9c6cb 100644
--- a/compat/Makefile
+++ b/compat/Makefile
@@ -34,9 +34,9 @@ compat-$(CONFIG_COMPAT_KERNEL_2_6_39) += \
compat-2.6.39.o \
kstrtox.o
compat-$(CONFIG_COMPAT_KERNEL_3_0) += compat-3.0.o
-compat-$(CONFIG_COMPAT_KERNEL_3_1) += \
- cordic.o \
- crc8.o
+
+compat-$(CONFIG_COMPAT_CORDIC) += cordic.o
+compat-$(CONFIG_COMPAT_CRC8) += crc8.o

ifndef CONFIG_64BIT
ifndef CONFIG_GENERIC_ATOMIC64
--
1.7.5.4



2011-12-05 19:59:26

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 2/2] compat: add module_usb_driver and module_platform_driver

Applied and pushed all of these and the compat ones, thanks sooo much!!!~

Luis

On Sat, Dec 3, 2011 at 9:49 AM, Hauke Mehrtens <[email protected]> wrote:
>
> Signed-off-by: Hauke Mehrtens <[email protected]>
> ---
>  include/linux/compat-3.2.h |    9 +++++++++
>  include/linux/compat-3.3.h |   35 +++++++++++++++++++++++++++++++++++
>  2 files changed, 44 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/compat-3.2.h b/include/linux/compat-3.2.h
> index db0f648..fb9ef68 100644
> --- a/include/linux/compat-3.2.h
> +++ b/include/linux/compat-3.2.h
> @@ -55,6 +55,15 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
>        return buf;
>  }
>
> +/* module_platform_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()
> + */
> +#define module_platform_driver(__platform_driver) \
> +        module_driver(__platform_driver, platform_driver_register, \
> +                        platform_driver_unregister)
> +
>  #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) */
>
>  #endif /* LINUX_3_2_COMPAT_H */
> diff --git a/include/linux/compat-3.3.h b/include/linux/compat-3.3.h
> index 9383a6e..821333c 100644
> --- a/include/linux/compat-3.3.h
> +++ b/include/linux/compat-3.3.h
> @@ -33,6 +33,41 @@ static inline void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)
>
>  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 */
> --
> 1.7.5.4
>

2011-12-03 14:49:34

by Hauke Mehrtens

[permalink] [raw]
Subject: [PATCH 2/2] compat: add module_usb_driver and module_platform_driver


Signed-off-by: Hauke Mehrtens <[email protected]>
---
include/linux/compat-3.2.h | 9 +++++++++
include/linux/compat-3.3.h | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-3.2.h b/include/linux/compat-3.2.h
index db0f648..fb9ef68 100644
--- a/include/linux/compat-3.2.h
+++ b/include/linux/compat-3.2.h
@@ -55,6 +55,15 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
return buf;
}

+/* module_platform_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()
+ */
+#define module_platform_driver(__platform_driver) \
+ module_driver(__platform_driver, platform_driver_register, \
+ platform_driver_unregister)
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) */

#endif /* LINUX_3_2_COMPAT_H */
diff --git a/include/linux/compat-3.3.h b/include/linux/compat-3.3.h
index 9383a6e..821333c 100644
--- a/include/linux/compat-3.3.h
+++ b/include/linux/compat-3.3.h
@@ -33,6 +33,41 @@ static inline void skb_complete_wifi_ack(struct sk_buff *skb, bool acked)

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 */
--
1.7.5.4