aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2008-06-27 10:27:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-27 10:27:47 -0400
commitff28bd94e307c67abb1bccda5d3a9018bd798e08 (patch)
tree20788c3b91820fa7763a479aee27d27276ce4e9c /drivers
parentd195a2ca46ec50e3b5c045a36d1defb6e04cc6b7 (diff)
wireless: remove RFKILL_STATE_HARD_BLOCKED warnings
CC [M] drivers/net/wireless/b43/rfkill.o drivers/net/wireless/b43/rfkill.c: In function ‘b43_rfkill_soft_toggle’: drivers/net/wireless/b43/rfkill.c:90: warning: enumeration value ‘RFKILL_STATE_HARD_BLOCKED’ not handled in switch CC [M] drivers/net/wireless/b43legacy/rfkill.o drivers/net/wireless/b43legacy/rfkill.c: In function ‘b43legacy_rfkill_soft_toggle’: drivers/net/wireless/b43legacy/rfkill.c:92: warning: enumeration value ‘RFKILL_STATE_HARD_BLOCKED’ not handled in switch CC [M] drivers/net/wireless/iwlwifi/iwl-rfkill.o drivers/net/wireless/iwlwifi/iwl-rfkill.c: In function ‘iwl_rfkill_soft_rf_kill’: drivers/net/wireless/iwlwifi/iwl-rfkill.c:56: warning: enumeration value ‘RFKILL_STATE_HARD_BLOCKED’ not handled in switch Also handle RFKILL_STATE_{ON,OFF} -> RFKILL_STATE_{UNBLOCKED,SOFT_BLOCKED} conversion since I'm already here... Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/rfkill.c7
-rw-r--r--drivers/net/wireless/b43legacy/rfkill.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rfkill.c7
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00rfkill.c7
4 files changed, 21 insertions, 8 deletions
diff --git a/drivers/net/wireless/b43/rfkill.c b/drivers/net/wireless/b43/rfkill.c
index 11f53cb1139e..4cca203992e8 100644
--- a/drivers/net/wireless/b43/rfkill.c
+++ b/drivers/net/wireless/b43/rfkill.c
@@ -88,7 +88,7 @@ static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state)
88 goto out_unlock; 88 goto out_unlock;
89 err = 0; 89 err = 0;
90 switch (state) { 90 switch (state) {
91 case RFKILL_STATE_ON: 91 case RFKILL_STATE_UNBLOCKED:
92 if (!dev->radio_hw_enable) { 92 if (!dev->radio_hw_enable) {
93 /* No luck. We can't toggle the hardware RF-kill 93 /* No luck. We can't toggle the hardware RF-kill
94 * button from software. */ 94 * button from software. */
@@ -98,10 +98,13 @@ static int b43_rfkill_soft_toggle(void *data, enum rfkill_state state)
98 if (!dev->phy.radio_on) 98 if (!dev->phy.radio_on)
99 b43_radio_turn_on(dev); 99 b43_radio_turn_on(dev);
100 break; 100 break;
101 case RFKILL_STATE_OFF: 101 case RFKILL_STATE_SOFT_BLOCKED:
102 if (dev->phy.radio_on) 102 if (dev->phy.radio_on)
103 b43_radio_turn_off(dev, 0); 103 b43_radio_turn_off(dev, 0);
104 break; 104 break;
105 default:
106 b43warn(wl, "Received unexpected rfkill state %d.\n", state);
107 break;
105 } 108 }
106out_unlock: 109out_unlock:
107 mutex_unlock(&wl->mutex); 110 mutex_unlock(&wl->mutex);
diff --git a/drivers/net/wireless/b43legacy/rfkill.c b/drivers/net/wireless/b43legacy/rfkill.c
index d178dfbb1c9f..8935a302b220 100644
--- a/drivers/net/wireless/b43legacy/rfkill.c
+++ b/drivers/net/wireless/b43legacy/rfkill.c
@@ -90,7 +90,7 @@ static int b43legacy_rfkill_soft_toggle(void *data, enum rfkill_state state)
90 goto out_unlock; 90 goto out_unlock;
91 err = 0; 91 err = 0;
92 switch (state) { 92 switch (state) {
93 case RFKILL_STATE_ON: 93 case RFKILL_STATE_UNBLOCKED:
94 if (!dev->radio_hw_enable) { 94 if (!dev->radio_hw_enable) {
95 /* No luck. We can't toggle the hardware RF-kill 95 /* No luck. We can't toggle the hardware RF-kill
96 * button from software. */ 96 * button from software. */
@@ -100,10 +100,14 @@ static int b43legacy_rfkill_soft_toggle(void *data, enum rfkill_state state)
100 if (!dev->phy.radio_on) 100 if (!dev->phy.radio_on)
101 b43legacy_radio_turn_on(dev); 101 b43legacy_radio_turn_on(dev);
102 break; 102 break;
103 case RFKILL_STATE_OFF: 103 case RFKILL_STATE_SOFT_BLOCKED:
104 if (dev->phy.radio_on) 104 if (dev->phy.radio_on)
105 b43legacy_radio_turn_off(dev, 0); 105 b43legacy_radio_turn_off(dev, 0);
106 break; 106 break;
107 default:
108 b43legacywarn(wl, "Received unexpected rfkill state %d.\n",
109 state);
110 break;
107 } 111 }
108 112
109out_unlock: 113out_unlock:
diff --git a/drivers/net/wireless/iwlwifi/iwl-rfkill.c b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
index 4624ac7b4980..ffefbb487e12 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rfkill.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rfkill.c
@@ -54,17 +54,20 @@ static int iwl_rfkill_soft_rf_kill(void *data, enum rfkill_state state)
54 mutex_lock(&priv->mutex); 54 mutex_lock(&priv->mutex);
55 55
56 switch (state) { 56 switch (state) {
57 case RFKILL_STATE_ON: 57 case RFKILL_STATE_UNBLOCKED:
58 iwl_radio_kill_sw_enable_radio(priv); 58 iwl_radio_kill_sw_enable_radio(priv);
59 /* if HW rf-kill is set dont allow ON state */ 59 /* if HW rf-kill is set dont allow ON state */
60 if (iwl_is_rfkill(priv)) 60 if (iwl_is_rfkill(priv))
61 err = -EBUSY; 61 err = -EBUSY;
62 break; 62 break;
63 case RFKILL_STATE_OFF: 63 case RFKILL_STATE_SOFT_BLOCKED:
64 iwl_radio_kill_sw_disable_radio(priv); 64 iwl_radio_kill_sw_disable_radio(priv);
65 if (!iwl_is_rfkill(priv)) 65 if (!iwl_is_rfkill(priv))
66 err = -EBUSY; 66 err = -EBUSY;
67 break; 67 break;
68 default:
69 IWL_WARNING("we recieved unexpected RFKILL state %d\n", state);
70 break;
68 } 71 }
69 mutex_unlock(&priv->mutex); 72 mutex_unlock(&priv->mutex);
70 73
diff --git a/drivers/net/wireless/rt2x00/rt2x00rfkill.c b/drivers/net/wireless/rt2x00/rt2x00rfkill.c
index fcef9885ab5e..207281cfa8b7 100644
--- a/drivers/net/wireless/rt2x00/rt2x00rfkill.c
+++ b/drivers/net/wireless/rt2x00/rt2x00rfkill.c
@@ -45,14 +45,17 @@ static int rt2x00rfkill_toggle_radio(void *data, enum rfkill_state state)
45 if (!test_bit(DEVICE_STARTED, &rt2x00dev->flags)) 45 if (!test_bit(DEVICE_STARTED, &rt2x00dev->flags))
46 return 0; 46 return 0;
47 47
48 if (state == RFKILL_STATE_ON) { 48 if (state == RFKILL_STATE_UNBLOCKED) {
49 INFO(rt2x00dev, "Hardware button pressed, enabling radio.\n"); 49 INFO(rt2x00dev, "Hardware button pressed, enabling radio.\n");
50 __clear_bit(DEVICE_DISABLED_RADIO_HW, &rt2x00dev->flags); 50 __clear_bit(DEVICE_DISABLED_RADIO_HW, &rt2x00dev->flags);
51 retval = rt2x00lib_enable_radio(rt2x00dev); 51 retval = rt2x00lib_enable_radio(rt2x00dev);
52 } else if (state == RFKILL_STATE_OFF) { 52 } else if (state == RFKILL_STATE_SOFT_BLOCKED) {
53 INFO(rt2x00dev, "Hardware button pressed, disabling radio.\n"); 53 INFO(rt2x00dev, "Hardware button pressed, disabling radio.\n");
54 __set_bit(DEVICE_DISABLED_RADIO_HW, &rt2x00dev->flags); 54 __set_bit(DEVICE_DISABLED_RADIO_HW, &rt2x00dev->flags);
55 rt2x00lib_disable_radio(rt2x00dev); 55 rt2x00lib_disable_radio(rt2x00dev);
56 } else {
57 WARNING(rt2x00dev, "Received unexpected rfkill state %d.\n",
58 state);
56 } 59 }
57 60
58 return retval; 61 return retval;