aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2007-10-06 08:16:09 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:14 -0400
commit5cbf830e137d1b6057cb6b553a8ebbb7d1b9343f (patch)
treedf0daca459a5fa9d472d2fe9bddd5dc2ac9633e4 /drivers/net
parentdd9fa2d21aebbb618318954867c5dfe3751328be (diff)
[PATCH] rt2x00: Pass dev_state to rt2x00lib_toggle_rx
Directly pass a value from the enum dev_state with rt2x00lib_toggle_rx, this will save us a ? : statement, and it is clearer then passing a 1 0 argument. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c13
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c4
3 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 6dc4f63aef0a..e14104869172 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -120,7 +120,7 @@ int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev)
120 /* 120 /*
121 * Enable RX. 121 * Enable RX.
122 */ 122 */
123 rt2x00lib_toggle_rx(rt2x00dev, 1); 123 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
124 124
125 /* 125 /*
126 * Start the TX queues. 126 * Start the TX queues.
@@ -151,7 +151,7 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)
151 /* 151 /*
152 * Disable RX. 152 * Disable RX.
153 */ 153 */
154 rt2x00lib_toggle_rx(rt2x00dev, 0); 154 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
155 155
156 /* 156 /*
157 * Disable radio. 157 * Disable radio.
@@ -159,14 +159,12 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)
159 rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_RADIO_OFF); 159 rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_RADIO_OFF);
160} 160}
161 161
162void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, int enable) 162void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state)
163{ 163{
164 enum dev_state state = enable ? STATE_RADIO_RX_ON : STATE_RADIO_RX_OFF;
165
166 /* 164 /*
167 * When we are disabling the RX, we should also stop the link tuner. 165 * When we are disabling the RX, we should also stop the link tuner.
168 */ 166 */
169 if (!enable) 167 if (state == STATE_RADIO_RX_OFF)
170 rt2x00lib_stop_link_tuner(rt2x00dev); 168 rt2x00lib_stop_link_tuner(rt2x00dev);
171 169
172 rt2x00dev->ops->lib->set_device_state(rt2x00dev, state); 170 rt2x00dev->ops->lib->set_device_state(rt2x00dev, state);
@@ -174,7 +172,8 @@ void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, int enable)
174 /* 172 /*
175 * When we are enabling the RX, we should also start the link tuner. 173 * When we are enabling the RX, we should also start the link tuner.
176 */ 174 */
177 if (enable && is_interface_present(&rt2x00dev->interface)) 175 if (state == STATE_RADIO_RX_ON &&
176 is_interface_present(&rt2x00dev->interface))
178 rt2x00lib_start_link_tuner(rt2x00dev); 177 rt2x00lib_start_link_tuner(rt2x00dev);
179} 178}
180 179
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index 29ca932d77ab..298faa9d3f61 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -38,7 +38,7 @@
38 */ 38 */
39int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev); 39int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev);
40void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev); 40void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev);
41void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, int enable); 41void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state);
42void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev); 42void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev);
43 43
44/* 44/*
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index e98d013a189f..f519d7396848 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -272,7 +272,7 @@ int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
272 if (!conf->radio_enabled) 272 if (!conf->radio_enabled)
273 rt2x00lib_disable_radio(rt2x00dev); 273 rt2x00lib_disable_radio(rt2x00dev);
274 else 274 else
275 rt2x00lib_toggle_rx(rt2x00dev, 0); 275 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
276 } 276 }
277 277
278 rt2x00lib_config(rt2x00dev, conf, 0); 278 rt2x00lib_config(rt2x00dev, conf, 0);
@@ -281,7 +281,7 @@ int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
281 * Reenable RX only if the radio should be on. 281 * Reenable RX only if the radio should be on.
282 */ 282 */
283 if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags)) 283 if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
284 rt2x00lib_toggle_rx(rt2x00dev, 1); 284 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
285 else if (conf->radio_enabled) 285 else if (conf->radio_enabled)
286 return rt2x00lib_enable_radio(rt2x00dev); 286 return rt2x00lib_enable_radio(rt2x00dev);
287 287