diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-02 13:31:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-02 13:31:04 -0500 |
commit | 80618fa83a34a26199fa99cfd06476a81ddf57df (patch) | |
tree | 30a486902351f57c8f072dee268d2abeb3ddfe7e /drivers/uwb/reset.c | |
parent | 92cde4d5396c3b6cbf3192286b687f97a889dffe (diff) | |
parent | b21a207141d83a06abc5f492b80204602e02ca44 (diff) |
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb
* 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/dvrabel/uwb: (31 commits)
uwb: remove beacon cache entry after calling uwb_notify()
uwb: remove unused include/linux/uwb/debug.h
uwb: use print_hex_dump()
uwb: use dev_dbg() for debug messages
uwb: fix memory leak in uwb_rc_notif()
wusb: fix oops when terminating a non-existant reservation
uwb: fix oops when terminating an already terminated reservation
uwb: improved MAS allocator and reservation conflict handling
wusb: add debug files for ASL, PZL and DI to the whci-hcd driver
uwb: fix oops in debug PAL's reservation callback
uwb: clean up whci_wait_for() timeout error message
wusb: whci-hcd shouldn't do ASL/PZL updates while channel is inactive
uwb: remove unused beacon group join/leave events
wlp: start/stop radio on network interface up/down
uwb: add basic radio manager
uwb: add pal parameter to new reservation callback
uwb: fix races between events and neh timers
uwb: don't unbind the radio controller driver when resetting
uwb: per-radio controller event thread and beacon cache
uwb: add commands to add/remove IEs to the debug interface
...
Diffstat (limited to 'drivers/uwb/reset.c')
-rw-r--r-- | drivers/uwb/reset.c | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/drivers/uwb/reset.c b/drivers/uwb/reset.c index 8de856fa7958..70f8050221ff 100644 --- a/drivers/uwb/reset.c +++ b/drivers/uwb/reset.c | |||
@@ -32,8 +32,6 @@ | |||
32 | #include <linux/err.h> | 32 | #include <linux/err.h> |
33 | 33 | ||
34 | #include "uwb-internal.h" | 34 | #include "uwb-internal.h" |
35 | #define D_LOCAL 0 | ||
36 | #include <linux/uwb/debug.h> | ||
37 | 35 | ||
38 | /** | 36 | /** |
39 | * Command result codes (WUSB1.0[T8-69]) | 37 | * Command result codes (WUSB1.0[T8-69]) |
@@ -323,17 +321,16 @@ int uwbd_msg_handle_reset(struct uwb_event *evt) | |||
323 | struct uwb_rc *rc = evt->rc; | 321 | struct uwb_rc *rc = evt->rc; |
324 | int ret; | 322 | int ret; |
325 | 323 | ||
326 | /* Need to prevent the RC hardware module going away while in | ||
327 | the rc->reset() call. */ | ||
328 | if (!try_module_get(rc->owner)) | ||
329 | return 0; | ||
330 | |||
331 | dev_info(&rc->uwb_dev.dev, "resetting radio controller\n"); | 324 | dev_info(&rc->uwb_dev.dev, "resetting radio controller\n"); |
332 | ret = rc->reset(rc); | 325 | ret = rc->reset(rc); |
333 | if (ret) | 326 | if (ret) { |
334 | dev_err(&rc->uwb_dev.dev, "failed to reset hardware: %d\n", ret); | 327 | dev_err(&rc->uwb_dev.dev, "failed to reset hardware: %d\n", ret); |
335 | 328 | goto error; | |
336 | module_put(rc->owner); | 329 | } |
330 | return 0; | ||
331 | error: | ||
332 | /* Nothing can be done except try the reset again. */ | ||
333 | uwb_rc_reset_all(rc); | ||
337 | return ret; | 334 | return ret; |
338 | } | 335 | } |
339 | 336 | ||
@@ -360,3 +357,33 @@ void uwb_rc_reset_all(struct uwb_rc *rc) | |||
360 | uwbd_event_queue(evt); | 357 | uwbd_event_queue(evt); |
361 | } | 358 | } |
362 | EXPORT_SYMBOL_GPL(uwb_rc_reset_all); | 359 | EXPORT_SYMBOL_GPL(uwb_rc_reset_all); |
360 | |||
361 | void uwb_rc_pre_reset(struct uwb_rc *rc) | ||
362 | { | ||
363 | rc->stop(rc); | ||
364 | uwbd_flush(rc); | ||
365 | |||
366 | uwb_radio_reset_state(rc); | ||
367 | uwb_rsv_remove_all(rc); | ||
368 | } | ||
369 | EXPORT_SYMBOL_GPL(uwb_rc_pre_reset); | ||
370 | |||
371 | void uwb_rc_post_reset(struct uwb_rc *rc) | ||
372 | { | ||
373 | int ret; | ||
374 | |||
375 | ret = rc->start(rc); | ||
376 | if (ret) | ||
377 | goto error; | ||
378 | ret = uwb_rc_mac_addr_set(rc, &rc->uwb_dev.mac_addr); | ||
379 | if (ret) | ||
380 | goto error; | ||
381 | ret = uwb_rc_dev_addr_set(rc, &rc->uwb_dev.dev_addr); | ||
382 | if (ret) | ||
383 | goto error; | ||
384 | return; | ||
385 | error: | ||
386 | /* Nothing can be done except try the reset again. */ | ||
387 | uwb_rc_reset_all(rc); | ||
388 | } | ||
389 | EXPORT_SYMBOL_GPL(uwb_rc_post_reset); | ||