* [PATCH 1/2] compat: fix firmware class compile on linux 2.6.32
@ 2010-01-18 14:29 Felix Fietkau
2010-01-18 14:30 ` [PATCH 2/2] compat: fix compile errors with CONFIG_FW_LOADER unset Felix Fietkau
2010-01-19 19:22 ` [PATCH 1/2] compat: fix firmware class compile on linux 2.6.32 Luis R. Rodriguez
0 siblings, 2 replies; 6+ messages in thread
From: Felix Fietkau @ 2010-01-18 14:29 UTC (permalink / raw)
To: linux-wireless; +Cc: Luis R. Rodriguez
The firmware class API change happened after 2.6.32, so move the compat
code to the 2.6.33 header file.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
--- a/include/linux/compat-2.6.32.h
+++ b/include/linux/compat-2.6.32.h
@@ -9,40 +9,6 @@
#include <linux/compat.h>
#include <net/iw_handler.h>
#include <linux/workqueue.h>
-#include <linux/firmware.h>
-
-#define release_firmware compat_release_firmware
-#define request_firmware compat_request_firmware
-#define request_firmware_nowait compat_request_firmware_nowait
-
-#if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE))
-int compat_request_firmware(const struct firmware **fw, const char *name,
- struct device *device);
-int compat_request_firmware_nowait(
- struct module *module, int uevent,
- const char *name, struct device *device, gfp_t gfp, void *context,
- void (*cont)(const struct firmware *fw, void *context));
-
-void compat_release_firmware(const struct firmware *fw);
-#else
-static inline int compat_request_firmware(const struct firmware **fw,
- const char *name,
- struct device *device)
-{
- return -EINVAL;
-}
-static inline int request_firmware_nowait(
- struct module *module, int uevent,
- const char *name, struct device *device, gfp_t gfp, void *context,
- void (*cont)(const struct firmware *fw, void *context))
-{
- return -EINVAL;
-}
-
-static inline void compat_release_firmware(const struct firmware *fw)
-{
-}
-#endif
#define SDIO_VENDOR_ID_INTEL 0x0089
#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402
--- a/include/linux/compat-2.6.33.h
+++ b/include/linux/compat-2.6.33.h
@@ -10,6 +10,40 @@
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include <linux/kfifo.h>
+#include <linux/firmware.h>
+
+#define release_firmware compat_release_firmware
+#define request_firmware compat_request_firmware
+#define request_firmware_nowait compat_request_firmware_nowait
+
+#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
+int compat_request_firmware(const struct firmware **fw, const char *name,
+ struct device *device);
+int compat_request_firmware_nowait(
+ struct module *module, int uevent,
+ const char *name, struct device *device, gfp_t gfp, void *context,
+ void (*cont)(const struct firmware *fw, void *context));
+
+void compat_release_firmware(const struct firmware *fw);
+#else
+static inline int compat_request_firmware(const struct firmware **fw,
+ const char *name,
+ struct device *device)
+{
+ return -EINVAL;
+}
+static inline int request_firmware_nowait(
+ struct module *module, int uevent,
+ const char *name, struct device *device, gfp_t gfp, void *context,
+ void (*cont)(const struct firmware *fw, void *context))
+{
+ return -EINVAL;
+}
+
+static inline void compat_release_firmware(const struct firmware *fw)
+{
+}
+#endif
#define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */
/* source: include/linux/if.h */
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] compat: fix compile errors with CONFIG_FW_LOADER unset
2010-01-18 14:29 [PATCH 1/2] compat: fix firmware class compile on linux 2.6.32 Felix Fietkau
@ 2010-01-18 14:30 ` Felix Fietkau
2010-01-19 19:35 ` Luis R. Rodriguez
2010-01-19 19:22 ` [PATCH 1/2] compat: fix firmware class compile on linux 2.6.32 Luis R. Rodriguez
1 sibling, 1 reply; 6+ messages in thread
From: Felix Fietkau @ 2010-01-18 14:30 UTC (permalink / raw)
To: linux-wireless; +Cc: Luis R. Rodriguez
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
--- a/compat/compat_firmware_class.c
+++ b/compat/compat_firmware_class.c
@@ -20,6 +20,8 @@
#include <linux/highmem.h>
#include <linux/firmware.h>
+#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
+
#define to_dev(obj) container_of(obj, struct device, kobj)
MODULE_AUTHOR("Manuel Estrada Sainz");
@@ -724,3 +726,5 @@ module_exit(firmware_class_exit);
EXPORT_SYMBOL(release_firmware);
EXPORT_SYMBOL(request_firmware);
EXPORT_SYMBOL(request_firmware_nowait);
+
+#endif
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] compat: fix firmware class compile on linux 2.6.32
2010-01-18 14:29 [PATCH 1/2] compat: fix firmware class compile on linux 2.6.32 Felix Fietkau
2010-01-18 14:30 ` [PATCH 2/2] compat: fix compile errors with CONFIG_FW_LOADER unset Felix Fietkau
@ 2010-01-19 19:22 ` Luis R. Rodriguez
1 sibling, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-01-19 19:22 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless
On Mon, Jan 18, 2010 at 6:29 AM, Felix Fietkau <nbd@openwrt.org> wrote:
> The firmware class API change happened after 2.6.32, so move the compat
> code to the 2.6.33 header file.
>
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Applied thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] compat: fix compile errors with CONFIG_FW_LOADER unset
2010-01-18 14:30 ` [PATCH 2/2] compat: fix compile errors with CONFIG_FW_LOADER unset Felix Fietkau
@ 2010-01-19 19:35 ` Luis R. Rodriguez
2010-01-19 19:40 ` Felix Fietkau
0 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-01-19 19:35 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, Luis R. Rodriguez
On Mon, Jan 18, 2010 at 03:30:14PM +0100, Felix Fietkau wrote:
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> ---
> --- a/compat/compat_firmware_class.c
> +++ b/compat/compat_firmware_class.c
> @@ -20,6 +20,8 @@
> #include <linux/highmem.h>
> #include <linux/firmware.h>
>
> +#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
> +
> #define to_dev(obj) container_of(obj, struct device, kobj)
>
> MODULE_AUTHOR("Manuel Estrada Sainz");
> @@ -724,3 +726,5 @@ module_exit(firmware_class_exit);
> EXPORT_SYMBOL(release_firmware);
> EXPORT_SYMBOL(request_firmware);
> EXPORT_SYMBOL(request_firmware_nowait);
> +
> +#endif
Hm, that would end up still building the compat_firmware module though,
what about something like this? This is not tested on a system without
FW_LOADER yet, not sure if it works:
diff --git a/Makefile b/Makefile
index 4843869..ad8a602 100644
--- a/Makefile
+++ b/Makefile
@@ -19,8 +19,13 @@ $(foreach ver,$(COMPAT_VERSIONS),$(eval export CONFIG_COMPAT_KERNEL_$(ver)=y))
endif
ifeq ($(CONFIG_COMPAT_KERNEL_33),y)
+ifeq ($(CONFIG_FW_LOADER),y)
export CONFIG_COMPAT_FIRMWARE_CLASS=m
endif
+ifeq ($(CONFIG_FW_LOADER_MODULE),y)
+ export CONFIG_COMPAT_FIRMWARE_CLASS=m
+endif
+endif
obj-y += compat/
Oh well this is just for compat.git but we'd do something similar on config.mk
Testing to build compat.git should suffice though I think.
Luis
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] compat: fix compile errors with CONFIG_FW_LOADER unset
2010-01-19 19:35 ` Luis R. Rodriguez
@ 2010-01-19 19:40 ` Felix Fietkau
2010-01-19 23:53 ` Luis R. Rodriguez
0 siblings, 1 reply; 6+ messages in thread
From: Felix Fietkau @ 2010-01-19 19:40 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linux-wireless, Luis R. Rodriguez
On 2010-01-19 8:35 PM, Luis R. Rodriguez wrote:
> what about something like this? This is not tested on a system without
> FW_LOADER yet, not sure if it works:
>
> diff --git a/Makefile b/Makefile
> index 4843869..ad8a602 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -19,8 +19,13 @@ $(foreach ver,$(COMPAT_VERSIONS),$(eval export CONFIG_COMPAT_KERNEL_$(ver)=y))
> endif
>
> ifeq ($(CONFIG_COMPAT_KERNEL_33),y)
> +ifeq ($(CONFIG_FW_LOADER),y)
> export CONFIG_COMPAT_FIRMWARE_CLASS=m
> endif
> +ifeq ($(CONFIG_FW_LOADER_MODULE),y)
> + export CONFIG_COMPAT_FIRMWARE_CLASS=m
> +endif
> +endif
>
> obj-y += compat/
>
>
> Oh well this is just for compat.git but we'd do something similar on config.mk
> Testing to build compat.git should suffice though I think.
Sounds good.
- Felix
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] compat: fix compile errors with CONFIG_FW_LOADER unset
2010-01-19 19:40 ` Felix Fietkau
@ 2010-01-19 23:53 ` Luis R. Rodriguez
0 siblings, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2010-01-19 23:53 UTC (permalink / raw)
To: Felix Fietkau; +Cc: Luis R. Rodriguez, linux-wireless
On Tue, Jan 19, 2010 at 11:40 AM, Felix Fietkau <nbd@openwrt.org> wrote:
> On 2010-01-19 8:35 PM, Luis R. Rodriguez wrote:
>> what about something like this? This is not tested on a system without
>> FW_LOADER yet, not sure if it works:
>>
>> diff --git a/Makefile b/Makefile
>> index 4843869..ad8a602 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -19,8 +19,13 @@ $(foreach ver,$(COMPAT_VERSIONS),$(eval export CONFIG_COMPAT_KERNEL_$(ver)=y))
>> endif
>>
>> ifeq ($(CONFIG_COMPAT_KERNEL_33),y)
>> +ifeq ($(CONFIG_FW_LOADER),y)
>> export CONFIG_COMPAT_FIRMWARE_CLASS=m
>> endif
>> +ifeq ($(CONFIG_FW_LOADER_MODULE),y)
>> + export CONFIG_COMPAT_FIRMWARE_CLASS=m
>> +endif
>> +endif
>>
>> obj-y += compat/
>>
>>
>> Oh well this is just for compat.git but we'd do something similar on config.mk
>> Testing to build compat.git should suffice though I think.
> Sounds good.
OK tested against a kernel without CONFIG_FW_LOADER and it works. Only
thing is CONFIG_FW_LOADER can actually be m too so will handle that as
well and push a new release of stuff. Thanks for the patches.
Luis
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-01-19 23:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-18 14:29 [PATCH 1/2] compat: fix firmware class compile on linux 2.6.32 Felix Fietkau
2010-01-18 14:30 ` [PATCH 2/2] compat: fix compile errors with CONFIG_FW_LOADER unset Felix Fietkau
2010-01-19 19:35 ` Luis R. Rodriguez
2010-01-19 19:40 ` Felix Fietkau
2010-01-19 23:53 ` Luis R. Rodriguez
2010-01-19 19:22 ` [PATCH 1/2] compat: fix firmware class compile on linux 2.6.32 Luis R. Rodriguez
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.