From: Luis R. Rodriguez Date: Tue, 7 Jul 2009 23:12:20 +0000 (-0700) Subject: Further changes to minimize rfkill backport X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b77496fc94f7e96333843f0059d29bb5959f698c;p=openwrt%2Fstaging%2Fblogic.git Further changes to minimize rfkill backport Include net/compat.h on rfkill_backport.h, then remove the compat.diff changes. Signed-off-by: Luis R. Rodriguez --- diff --git a/compat/compat-2.6.31.h b/compat/compat-2.6.31.h index 885c8392cc00..d8605f68496b 100644 --- a/compat/compat-2.6.31.h +++ b/compat/compat-2.6.31.h @@ -12,11 +12,11 @@ #include /* - * This is our backported header, we map actual rfkill calls - * to backported calls. + * These macros allow us to backport rfkill without any + * changes on cfg80211 through compat.diff. Note that this + * file will be included by rfkill_backport.h so we must + * not conflict with things there. */ -#include - #define rfkill_blocked backport_rfkill_blocked #define rfkill_alloc backport_rfkill_alloc #define rfkill_register backport_rfkill_register diff --git a/compat/compat.diff b/compat/compat.diff index f16ac406b5ca..e0b6c4e185d3 100644 --- a/compat/compat.diff +++ b/compat/compat.diff @@ -495,9 +495,17 @@ #include #include "wl1251.h" ---- a/include/linux/rfkill_backport.h 2009-07-07 13:21:54.798712205 -0700 -+++ b/include/linux/rfkill_backport.h 2009-07-07 13:27:29.939682510 -0700 -@@ -148,7 +148,7 @@ +--- a/include/linux/rfkill_backport.h 2009-07-07 16:08:27.594679015 -0700 ++++ b/include/linux/rfkill_backport.h 2009-07-07 15:54:00.518713012 -0700 +@@ -23,6 +23,7 @@ + */ + + #include ++#include + + /* define userspace visible states */ + #define RFKILL_STATE_SOFT_BLOCKED 0 +@@ -148,7 +149,7 @@ int (*set_block)(void *data, bool blocked); }; @@ -506,203 +514,6 @@ /** * rfkill_alloc - allocate rfkill structure * @name: name of the struct -- the string is not copied internally -@@ -160,7 +160,7 @@ - * This function should be called by the transmitter driver to allocate an - * rfkill structure. Returns %NULL on failure. - */ --struct rfkill * __must_check rfkill_alloc(const char *name, -+struct rfkill * __must_check backport_rfkill_alloc(const char *name, - struct device *parent, - const enum rfkill_type type, - const struct rfkill_ops *ops, -@@ -181,7 +181,7 @@ - * If the hardware blocked state is not set before registration, - * it is assumed to be unblocked. - */ --int __must_check rfkill_register(struct rfkill *rfkill); -+int __must_check backport_rfkill_register(struct rfkill *rfkill); - - /** - * rfkill_pause_polling(struct rfkill *rfkill) -@@ -190,7 +190,7 @@ - * NOTE: not necessary for suspend/resume -- in that case the - * core stops polling anyway - */ --void rfkill_pause_polling(struct rfkill *rfkill); -+void backport_rfkill_pause_polling(struct rfkill *rfkill); - - /** - * rfkill_resume_polling(struct rfkill *rfkill) -@@ -199,7 +199,7 @@ - * NOTE: not necessary for suspend/resume -- in that case the - * core stops polling anyway - */ --void rfkill_resume_polling(struct rfkill *rfkill); -+void backport_rfkill_resume_polling(struct rfkill *rfkill); - - - /** -@@ -210,7 +210,7 @@ - * teardown to destroy rfkill structure. Until it returns, the driver - * needs to be able to service method calls. - */ --void rfkill_unregister(struct rfkill *rfkill); -+void backport_rfkill_unregister(struct rfkill *rfkill); - - /** - * rfkill_destroy - free rfkill structure -@@ -218,7 +218,7 @@ - * - * Destroys the rfkill structure. - */ --void rfkill_destroy(struct rfkill *rfkill); -+void backport_rfkill_destroy(struct rfkill *rfkill); - - /** - * rfkill_set_hw_state - Set the internal rfkill hardware block state -@@ -239,7 +239,7 @@ - * should be blocked) so that drivers need not keep track of the soft - * block state -- which they might not be able to. - */ --bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); -+bool __must_check backport_rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); - - /** - * rfkill_set_sw_state - Set the internal rfkill software block state -@@ -261,7 +261,7 @@ - * The function returns the combined block state (true if transmitter - * should be blocked). - */ --bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked); -+bool backport_rfkill_set_sw_state(struct rfkill *rfkill, bool blocked); - - /** - * rfkill_init_sw_state - Initialize persistent software block state -@@ -277,7 +277,7 @@ - * can be read by userspace. Persistent devices are expected to preserve - * their own state when suspended. - */ --void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked); -+void backport_rfkill_init_sw_state(struct rfkill *rfkill, bool blocked); - - /** - * rfkill_set_states - Set the internal rfkill block states -@@ -288,17 +288,17 @@ - * This function can be called in any context, even from within rfkill - * callbacks. - */ --void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw); -+void backport_rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw); - - /** - * rfkill_blocked - query rfkill block - * - * @rfkill: rfkill struct to query - */ --bool rfkill_blocked(struct rfkill *rfkill); --#else /* !RFKILL */ -+bool backport_rfkill_blocked(struct rfkill *rfkill); -+#else /* !RFKILL_BACKPORT */ - static inline struct rfkill * __must_check --rfkill_alloc(const char *name, -+backport_rfkill_alloc(const char *name, - struct device *parent, - const enum rfkill_type type, - const struct rfkill_ops *ops, -@@ -307,61 +307,61 @@ - return ERR_PTR(-ENODEV); - } - --static inline int __must_check rfkill_register(struct rfkill *rfkill) -+static inline int __must_check backport_rfkill_register(struct rfkill *rfkill) - { - if (rfkill == ERR_PTR(-ENODEV)) - return 0; - return -EINVAL; - } - --static inline void rfkill_pause_polling(struct rfkill *rfkill) -+static inline void backport_rfkill_pause_polling(struct rfkill *rfkill) - { - } - --static inline void rfkill_resume_polling(struct rfkill *rfkill) -+static inline void backport_rfkill_resume_polling(struct rfkill *rfkill) - { - } - --static inline void rfkill_unregister(struct rfkill *rfkill) -+static inline void backport_rfkill_unregister(struct rfkill *rfkill) - { - } - --static inline void rfkill_destroy(struct rfkill *rfkill) -+static inline void backport_rfkill_destroy(struct rfkill *rfkill) - { - } - --static inline bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked) -+static inline bool backport_rfkill_set_hw_state(struct rfkill *rfkill, bool blocked) - { - return blocked; - } - --static inline bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked) -+static inline bool backport_rfkill_set_sw_state(struct rfkill *rfkill, bool blocked) - { - return blocked; - } - --static inline void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked) -+static inline void backport_rfkill_init_sw_state(struct rfkill *rfkill, bool blocked) - { - } - --static inline void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw) -+static inline void backport_rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw) - { - } - --static inline bool rfkill_blocked(struct rfkill *rfkill) -+static inline bool backport_rfkill_blocked(struct rfkill *rfkill) - { - return false; - } --#endif /* RFKILL || RFKILL_MODULE */ -+#endif /* RFKILL_BACKPORT || RFKILL_BACKPORT_MODULE */ - - --#ifdef CONFIG_RFKILL_LEDS -+#ifdef CONFIG_RFKILL_BACKPORT_LEDS - /** - * rfkill_get_led_trigger_name - Get the LED trigger name for the button's LED. - * This function might return a NULL pointer if registering of the - * LED trigger failed. Use this as "default_trigger" for the LED. - */ --const char *rfkill_get_led_trigger_name(struct rfkill *rfkill); -+const char *backport_rfkill_get_led_trigger_name(struct rfkill *rfkill); - - /** - * rfkill_set_led_trigger_name -- set the LED trigger name -@@ -372,15 +372,15 @@ - * trigger that rfkill creates. It is optional, but if called - * must be called before rfkill_register() to be effective. - */ --void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name); -+void backport_rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name); - #else --static inline const char *rfkill_get_led_trigger_name(struct rfkill *rfkill) -+static inline const char *backport_rfkill_get_led_trigger_name(struct rfkill *rfkill) - { - return NULL; - } - - static inline void --rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name) -+backport_rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name) - { - } - #endif --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -23,6 +23,7 @@