Skip to contentSkip to conversation

rt2x00: Remove input_polldev requirements for rfkill

PATCH Superseded Ivo van Doorn 2 participants 4 messages Jul 4, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

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
index 3a9b1d7..d485a86 100644
@@ -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
index 6842464..1b28dad 100644
@@ -649,7 +649,7 @@ struct rt2x00_dev {
 #define RFKILL_STATE_ALLOCATED		1
 #define RFKILL_STATE_REGISTERED		2
 	struct 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
index ae8ab71..41b3289 100644
@@ -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
index 1d1f074..4b31c69 100644
@@ -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

#1 lore raw
Quoted 4 lines · Ivo van Doorn

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.

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?

#2 lore raw
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 a delayed_work structure 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

#3 lore raw

PATCH v2 1/4 rt2x00: Remove input_polldev requirements for rfkill

In reply to Ivo van Doorn

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 1000ms.

v2: Decrease poll frequency from 100ms to 1000ms

---

drivers/net/wireless/rt2x00/Kconfig +3 -5
index 3a9b1d7..d485a86 100644
@@ -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
index 6842464..1b28dad 100644
@@ -649,7 +649,7 @@ struct rt2x00_dev {
 #define RFKILL_STATE_ALLOCATED		1
 #define RFKILL_STATE_REGISTERED		2
 	struct 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
index ae8ab71..41b3289 100644
@@ -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
index 1d1f074..eae5ce1 100644
@@ -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