rt2x00: Remove input_polldev requirements for rfkill
PATCH 1/4 rt2x00: Remove input_polldev requirements for rfkill
With the new rfkill interface there is no longer a need for the input_polldev. Create a delayed_work structure which we can put on the mac80211 workqueue and poll the hardware every 100ms.
---
drivers/net/wireless/rt2x00/Kconfig +3 -5
@@ -36,9 +36,7 @@ config RT2X00_LIB_FIRMWARE config RT2X00_LIB_RFKILL boolean depends on RT2X00_LIB - depends on INPUT select RFKILL - select INPUT_POLLDEV config RT2X00_LIB_LEDS boolean
@@ -57,7 +55,7 @@ config RT2400PCI config RT2400PCI_RFKILL bool "Ralink rt2400 rfkill support" - depends on RT2400PCI && INPUT + depends on RT2400PCI select RT2X00_LIB_RFKILL ---help--- This adds support for integrated rt2400 hardware that features a
@@ -85,7 +83,7 @@ config RT2500PCI config RT2500PCI_RFKILL bool "Ralink rt2500 rfkill support" - depends on RT2500PCI && INPUT + depends on RT2500PCI select RT2X00_LIB_RFKILL ---help--- This adds support for integrated rt2500 hardware that features a
@@ -115,7 +113,7 @@ config RT61PCI config RT61PCI_RFKILL bool "Ralink rt2501/rt61 rfkill support" - depends on RT61PCI && INPUT + depends on RT61PCI select RT2X00_LIB_RFKILL ---help--- This adds support for integrated rt61 hardware that features a
drivers/net/wireless/rt2x00/rt2x00.h +1 -1
@@ -649,7 +649,7 @@ struct rt2x00_dev {#define RFKILL_STATE_ALLOCATED 1#define RFKILL_STATE_REGISTERED 2struct rfkill *rfkill; -struct input_polled_dev *poll_dev; +struct delayed_work rfkill_work;#endif /* CONFIG_RT2X00_LIB_RFKILL */ /*
drivers/net/wireless/rt2x00/rt2x00dev.c +0 -2
@@ -1179,7 +1179,6 @@ int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state)* Suspend/disable extra components. */ rt2x00leds_suspend (rt2x00dev); -rt2x00rfkill_suspend (rt2x00dev);rt2x00debug_deregister (rt2x00dev); exit:
@@ -1235,7 +1234,6 @@ int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev)* Restore/enable extra components. */ rt2x00debug_register (rt2x00dev); -rt2x00rfkill_resume (rt2x00dev);rt2x00leds_resume (rt2x00dev);/*
drivers/net/wireless/rt2x00/rt2x00lib.h +3 -12
@@ -30,10 +30,11 @@/* * Interval defines -* Both the link tuner as the rfkill will be called once per second. +* The link tuner will be called once per second, while the rfkill poller +* will be called every 100ms. */ #define LINK_TUNE_INTERVAL ( round_jiffies_relative(HZ) ) -#define RFKILL_POLL_INTERVAL ( 1000 ) +#define RFKILL_POLL_INTERVAL ( round_jiffies_relative(HZ / 10) )/* * rt2x00_rate: Per rate device information
@@ -204,8 +205,6 @@ void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev);void rt2x00rfkill_unregister (struct rt2x00_dev *rt2x00dev);void rt2x00rfkill_allocate (struct rt2x00_dev *rt2x00dev);void rt2x00rfkill_free (struct rt2x00_dev *rt2x00dev); -void rt2x00rfkill_suspend (struct rt2x00_dev *rt2x00dev); -void rt2x00rfkill_resume (struct rt2x00_dev *rt2x00dev);#else static inline void rt2x00rfkill_register (struct rt2x00_dev *rt2x00dev) {
@@ -222,14 +221,6 @@ static inline void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)static inline void rt2x00rfkill_free (struct rt2x00_dev *rt2x00dev) { } - -static inline void rt2x00rfkill_suspend (struct rt2x00_dev *rt2x00dev) -{ -} - -static inline void rt2x00rfkill_resume (struct rt2x00_dev *rt2x00dev) -{ -}#endif /* CONFIG_RT2X00_LIB_RFKILL */ /*
drivers/net/wireless/rt2x00/rt2x00rfkill.c +33 -74
158 lines not on this page · raw message
Quoted 4 lines · Ivo van Doorn
With the new rfkill interface there is no longer a need for the
input_polldev. Create adelayed_workstructure which we can put on the mac80211 workqueue and poll the hardware every 100ms.
Isn't 100ms not a bit "to often" ... this would add 10 wakeups/sec .. Shouldn't 500 or 1000ms be enough for user space to deal with the event?
Quoted 8 lines · On Friday 04 July 2008, drago01 wrote:
Quoted 4 lines · Ivo van Doorn
With the new rfkill interface there is no longer a need for the
input_polldev. Create adelayed_workstructure which we can put on the mac80211 workqueue and poll the hardware every 100ms.Isn't 100ms not a bit "to often" ... this would add 10 wakeups/sec .. Shouldn't 500 or 1000ms be enough for user space to deal with the event?
Ok, I'll update the patch to restore the once-per-second check.
Ivo
PATCH v2 1/4 rt2x00: Remove input_polldev requirements for rfkill
In reply to Ivo van Doornrt2x00: Remove input_polldev requirements for rfkill
With the new rfkill interface there is no longer a need for the input_polldev. Create a delayed_work structure which we can put on the mac80211 workqueue and poll the hardware every 1000ms.
v2: Decrease poll frequency from 100ms to 1000ms
---
drivers/net/wireless/rt2x00/Kconfig +3 -5
@@ -36,9 +36,7 @@ config RT2X00_LIB_FIRMWARE config RT2X00_LIB_RFKILL boolean depends on RT2X00_LIB - depends on INPUT select RFKILL - select INPUT_POLLDEV config RT2X00_LIB_LEDS boolean
@@ -57,7 +55,7 @@ config RT2400PCI config RT2400PCI_RFKILL bool "Ralink rt2400 rfkill support" - depends on RT2400PCI && INPUT + depends on RT2400PCI select RT2X00_LIB_RFKILL ---help--- This adds support for integrated rt2400 hardware that features a
@@ -85,7 +83,7 @@ config RT2500PCI config RT2500PCI_RFKILL bool "Ralink rt2500 rfkill support" - depends on RT2500PCI && INPUT + depends on RT2500PCI select RT2X00_LIB_RFKILL ---help--- This adds support for integrated rt2500 hardware that features a
@@ -115,7 +113,7 @@ config RT61PCI config RT61PCI_RFKILL bool "Ralink rt2501/rt61 rfkill support" - depends on RT61PCI && INPUT + depends on RT61PCI select RT2X00_LIB_RFKILL ---help--- This adds support for integrated rt61 hardware that features a
drivers/net/wireless/rt2x00/rt2x00.h +1 -1
@@ -649,7 +649,7 @@ struct rt2x00_dev {#define RFKILL_STATE_ALLOCATED 1#define RFKILL_STATE_REGISTERED 2struct rfkill *rfkill; -struct input_polled_dev *poll_dev; +struct delayed_work rfkill_work;#endif /* CONFIG_RT2X00_LIB_RFKILL */ /*
drivers/net/wireless/rt2x00/rt2x00dev.c +0 -2
@@ -1179,7 +1179,6 @@ int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev, pm_message_t state)* Suspend/disable extra components. */ rt2x00leds_suspend (rt2x00dev); -rt2x00rfkill_suspend (rt2x00dev);rt2x00debug_deregister (rt2x00dev); exit:
@@ -1235,7 +1234,6 @@ int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev)* Restore/enable extra components. */ rt2x00debug_register (rt2x00dev); -rt2x00rfkill_resume (rt2x00dev);rt2x00leds_resume (rt2x00dev);/*
drivers/net/wireless/rt2x00/rt2x00lib.h +1 -11
@@ -33,7 +33,7 @@* Both the link tuner as the rfkill will be called once per second. */ #define LINK_TUNE_INTERVAL ( round_jiffies_relative(HZ) ) -#define RFKILL_POLL_INTERVAL ( 1000 ) +#define RFKILL_POLL_INTERVAL ( round_jiffies_relative(HZ) )/* * rt2x00_rate: Per rate device information
@@ -204,8 +204,6 @@ void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev);void rt2x00rfkill_unregister (struct rt2x00_dev *rt2x00dev);void rt2x00rfkill_allocate (struct rt2x00_dev *rt2x00dev);void rt2x00rfkill_free (struct rt2x00_dev *rt2x00dev); -void rt2x00rfkill_suspend (struct rt2x00_dev *rt2x00dev); -void rt2x00rfkill_resume (struct rt2x00_dev *rt2x00dev);#else static inline void rt2x00rfkill_register (struct rt2x00_dev *rt2x00dev) {
@@ -222,14 +220,6 @@ static inline void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)static inline void rt2x00rfkill_free (struct rt2x00_dev *rt2x00dev) { } - -static inline void rt2x00rfkill_suspend (struct rt2x00_dev *rt2x00dev) -{ -} - -static inline void rt2x00rfkill_resume (struct rt2x00_dev *rt2x00dev) -{ -}#endif /* CONFIG_RT2X00_LIB_RFKILL */ /*
drivers/net/wireless/rt2x00/rt2x00rfkill.c +33 -74
158 lines not on this page · raw message