diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2008-01-06 17:40:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:24 -0500 |
commit | e37ea2135be080dd25f1a2644c9132c109fa77d1 (patch) | |
tree | 9e4960846d844f6ae03de2e05b958c156f164976 /drivers/net/wireless/rt2x00/rt2x00mac.c | |
parent | 042671040db95a896c5ca960b9b656692a787892 (diff) |
rt2x00: Move start() and stop() handlers into rt2x00lib.c
suspend & resume was broken since it called rt2x00mac_start()
and rt2x00mac_stop() which would fail to execute because the
DEVICE_PRESENT flag was not set.
Move the start and stop handlers into rt2x00lib.c which are called
from rt2x00mac_start() and rt2x00mac_stop() after they have checked
the DEVICE_PRESENT flag, while suspend and resume handlers can
directly call those functions.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00mac.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 1ab2fb6c38da..e99d167d7df6 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -139,41 +139,11 @@ EXPORT_SYMBOL_GPL(rt2x00mac_tx); | |||
139 | int rt2x00mac_start(struct ieee80211_hw *hw) | 139 | int rt2x00mac_start(struct ieee80211_hw *hw) |
140 | { | 140 | { |
141 | struct rt2x00_dev *rt2x00dev = hw->priv; | 141 | struct rt2x00_dev *rt2x00dev = hw->priv; |
142 | int status; | ||
143 | 142 | ||
144 | if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags) || | 143 | if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) |
145 | test_bit(DEVICE_STARTED, &rt2x00dev->flags)) | ||
146 | return 0; | 144 | return 0; |
147 | 145 | ||
148 | /* | 146 | return rt2x00lib_start(rt2x00dev); |
149 | * If this is the first interface which is added, | ||
150 | * we should load the firmware now. | ||
151 | */ | ||
152 | if (test_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags)) { | ||
153 | status = rt2x00lib_load_firmware(rt2x00dev); | ||
154 | if (status) | ||
155 | return status; | ||
156 | } | ||
157 | |||
158 | /* | ||
159 | * Initialize the device. | ||
160 | */ | ||
161 | status = rt2x00lib_initialize(rt2x00dev); | ||
162 | if (status) | ||
163 | return status; | ||
164 | |||
165 | /* | ||
166 | * Enable radio. | ||
167 | */ | ||
168 | status = rt2x00lib_enable_radio(rt2x00dev); | ||
169 | if (status) { | ||
170 | rt2x00lib_uninitialize(rt2x00dev); | ||
171 | return status; | ||
172 | } | ||
173 | |||
174 | __set_bit(DEVICE_STARTED, &rt2x00dev->flags); | ||
175 | |||
176 | return 0; | ||
177 | } | 147 | } |
178 | EXPORT_SYMBOL_GPL(rt2x00mac_start); | 148 | EXPORT_SYMBOL_GPL(rt2x00mac_start); |
179 | 149 | ||
@@ -184,13 +154,7 @@ void rt2x00mac_stop(struct ieee80211_hw *hw) | |||
184 | if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) | 154 | if (!test_bit(DEVICE_PRESENT, &rt2x00dev->flags)) |
185 | return; | 155 | return; |
186 | 156 | ||
187 | /* | 157 | rt2x00lib_stop(rt2x00dev); |
188 | * Perhaps we can add something smarter here, | ||
189 | * but for now just disabling the radio should do. | ||
190 | */ | ||
191 | rt2x00lib_disable_radio(rt2x00dev); | ||
192 | |||
193 | __clear_bit(DEVICE_STARTED, &rt2x00dev->flags); | ||
194 | } | 158 | } |
195 | EXPORT_SYMBOL_GPL(rt2x00mac_stop); | 159 | EXPORT_SYMBOL_GPL(rt2x00mac_stop); |
196 | 160 | ||