Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83139
b: refs/heads/master
c: 3506e0c
h: refs/heads/master
i:
  83137: c9d39fb
  83135: 546cc6d
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Feb 5, 2008
1 parent d28c267 commit 26db10a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa23f5cce8cda2095013afc837ccf74b352f9f7b
refs/heads/master: 3506e0c49a5ceba72c0405d1a470184c2d6705f7
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/b43/b43.h
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ struct b43_wldev {
bool short_preamble; /* TRUE, if short preamble is enabled. */
bool short_slot; /* TRUE, if short slot timing is enabled. */
bool radio_hw_enable; /* saved state of radio hardware enabled state */
bool suspend_in_progress; /* TRUE, if we are in a suspend/resume cycle */

/* PHY/Radio device. */
struct b43_phy phy;
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/net/wireless/b43/leds.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ static void b43_unregister_led(struct b43_led *led)
{
if (!led->dev)
return;
led_classdev_unregister(&led->led_dev);
if (led->dev->suspend_in_progress)
led_classdev_unregister_suspended(&led->led_dev);
else
led_classdev_unregister(&led->led_dev);
b43_led_turn_off(led->dev, led->index, led->activelow);
led->dev = NULL;
}
Expand Down
25 changes: 16 additions & 9 deletions trunk/drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2555,10 +2555,10 @@ static int b43_rng_read(struct hwrng *rng, u32 * data)
return (sizeof(u16));
}

static void b43_rng_exit(struct b43_wl *wl)
static void b43_rng_exit(struct b43_wl *wl, bool suspended)
{
if (wl->rng_initialized)
hwrng_unregister(&wl->rng);
__hwrng_unregister(&wl->rng, suspended);
}

static int b43_rng_init(struct b43_wl *wl)
Expand Down Expand Up @@ -3418,8 +3418,10 @@ static void b43_wireless_core_exit(struct b43_wldev *dev)
macctl |= B43_MACCTL_PSM_JMP0;
b43_write32(dev, B43_MMIO_MACCTL, macctl);

b43_leds_exit(dev);
b43_rng_exit(dev->wl);
if (!dev->suspend_in_progress) {
b43_leds_exit(dev);
b43_rng_exit(dev->wl, false);
}
b43_dma_free(dev);
b43_chip_exit(dev);
b43_radio_turn_off(dev, 1);
Expand Down Expand Up @@ -3535,11 +3537,13 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
ssb_bus_powerup(bus, 1); /* Enable dynamic PCTL */
b43_upload_card_macaddress(dev);
b43_security_init(dev);
b43_rng_init(wl);
if (!dev->suspend_in_progress)
b43_rng_init(wl);

b43_set_status(dev, B43_STAT_INITIALIZED);

b43_leds_init(dev);
if (!dev->suspend_in_progress)
b43_leds_init(dev);
out:
return err;

Expand Down Expand Up @@ -4136,6 +4140,7 @@ static int b43_suspend(struct ssb_device *dev, pm_message_t state)
b43dbg(wl, "Suspending...\n");

mutex_lock(&wl->mutex);
wldev->suspend_in_progress = true;
wldev->suspend_init_status = b43_status(wldev);
if (wldev->suspend_init_status >= B43_STAT_STARTED)
b43_wireless_core_stop(wldev);
Expand Down Expand Up @@ -4167,15 +4172,17 @@ static int b43_resume(struct ssb_device *dev)
if (wldev->suspend_init_status >= B43_STAT_STARTED) {
err = b43_wireless_core_start(wldev);
if (err) {
b43_leds_exit(wldev);
b43_rng_exit(wldev->wl, true);
b43_wireless_core_exit(wldev);
b43err(wl, "Resume failed at core start\n");
goto out;
}
}
mutex_unlock(&wl->mutex);

b43dbg(wl, "Device resumed.\n");
out:
out:
wldev->suspend_in_progress = false;
mutex_unlock(&wl->mutex);
return err;
}

Expand Down

0 comments on commit 26db10a

Please sign in to comment.