Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149847
b: refs/heads/master
c: 616de35
h: refs/heads/master
i:
  149845: 7718f23
  149843: 8b798bb
  149839: ded59d6
v: v3
  • Loading branch information
Michael Buesch authored and John W. Linville committed Apr 22, 2009
1 parent ce1c646 commit 30c3be1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 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: a57e2e84b65d1b89c4b1effeceb27b181226b950
refs/heads/master: 616de35da94df8748771a014ef898360d5f4d0c8
8 changes: 7 additions & 1 deletion trunk/drivers/net/wireless/b43/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ config B43
depends on SSB_POSSIBLE && MAC80211 && WLAN_80211 && HAS_DMA
select SSB
select FW_LOADER
select HW_RANDOM
---help---
b43 is a driver for the Broadcom 43xx series wireless devices.

Expand Down Expand Up @@ -106,6 +105,13 @@ config B43_RFKILL
depends on B43 && (RFKILL = y || RFKILL = B43) && RFKILL_INPUT && (INPUT_POLLDEV = y || INPUT_POLLDEV = B43)
default y

# This config option automatically enables b43 HW-RNG support,
# if the HW-RNG core is enabled.
config B43_HWRNG
bool
depends on B43 && (HW_RANDOM = y || HW_RANDOM = B43)
default y

config B43_DEBUG
bool "Broadcom 43xx debugging"
depends on B43
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/b43/b43.h
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,11 @@ struct b43_wl {
/* Stats about the wireless interface */
struct ieee80211_low_level_stats ieee_stats;

#ifdef CONFIG_B43_HWRNG
struct hwrng rng;
u8 rng_initialized;
bool rng_initialized;
char rng_name[30 + 1];
#endif /* CONFIG_B43_HWRNG */

/* The RF-kill button */
struct b43_rfkill rfkill;
Expand Down
8 changes: 7 additions & 1 deletion trunk/drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2980,6 +2980,7 @@ static void b43_security_init(struct b43_wldev *dev)
b43_clear_keys(dev);
}

#ifdef CONFIG_B43_HWRNG
static int b43_rng_read(struct hwrng *rng, u32 *data)
{
struct b43_wl *wl = (struct b43_wl *)rng->priv;
Expand All @@ -2995,17 +2996,21 @@ static int b43_rng_read(struct hwrng *rng, u32 *data)

return (sizeof(u16));
}
#endif /* CONFIG_B43_HWRNG */

static void b43_rng_exit(struct b43_wl *wl)
{
#ifdef CONFIG_B43_HWRNG
if (wl->rng_initialized)
hwrng_unregister(&wl->rng);
#endif /* CONFIG_B43_HWRNG */
}

static int b43_rng_init(struct b43_wl *wl)
{
int err;
int err = 0;

#ifdef CONFIG_B43_HWRNG
snprintf(wl->rng_name, ARRAY_SIZE(wl->rng_name),
"%s_%s", KBUILD_MODNAME, wiphy_name(wl->hw->wiphy));
wl->rng.name = wl->rng_name;
Expand All @@ -3018,6 +3023,7 @@ static int b43_rng_init(struct b43_wl *wl)
b43err(wl, "Failed to register the random "
"number generator (%d)\n", err);
}
#endif /* CONFIG_B43_HWRNG */

return err;
}
Expand Down

0 comments on commit 30c3be1

Please sign in to comment.