2009-03-29 16:49:23 +00:00
|
|
|
This patch is submitted upstream and can be removed when it hits compat-wireless.
|
|
|
|
|
|
|
|
--mb
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-24 14:59:27 +00:00
|
|
|
--- a/drivers/net/wireless/b43/b43.h
|
|
|
|
+++ b/drivers/net/wireless/b43/b43.h
|
2009-04-06 17:15:19 +00:00
|
|
|
@@ -625,9 +625,11 @@ struct b43_wl {
|
2009-03-29 16:49:23 +00:00
|
|
|
/* 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;
|
2009-04-24 14:59:27 +00:00
|
|
|
--- a/drivers/net/wireless/b43/main.c
|
|
|
|
+++ b/drivers/net/wireless/b43/main.c
|
|
|
|
@@ -2980,6 +2980,7 @@ static void b43_security_init(struct b43
|
2009-03-29 16:49:23 +00:00
|
|
|
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;
|
2009-04-24 14:59:27 +00:00
|
|
|
@@ -2995,17 +2996,21 @@ static int b43_rng_read(struct hwrng *rn
|
2009-03-29 16:49:23 +00:00
|
|
|
|
|
|
|
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;
|
2009-04-24 14:59:27 +00:00
|
|
|
@@ -3018,6 +3023,7 @@ static int b43_rng_init(struct b43_wl *w
|
2009-03-29 16:49:23 +00:00
|
|
|
b43err(wl, "Failed to register the random "
|
|
|
|
"number generator (%d)\n", err);
|
|
|
|
}
|
|
|
|
+#endif /* CONFIG_B43_HWRNG */
|
|
|
|
|
|
|
|
return err;
|
|
|
|
}
|
2009-04-24 14:59:27 +00:00
|
|
|
--- a/config.mk
|
|
|
|
+++ b/config.mk
|
2009-03-29 16:49:23 +00:00
|
|
|
@@ -148,6 +148,7 @@ CONFIG_ATH9K_DEBUG=y
|
|
|
|
# CONFIG_B43_PIO=y
|
|
|
|
# CONFIG_B43_LEDS=y
|
|
|
|
# CONFIG_B43_RFKILL=y
|
|
|
|
+# CONFIG_B43_HWRNG=y
|
|
|
|
# CONFIG_B43_DEBUG=y
|
|
|
|
# CONFIG_B43_FORCE_PIO=y
|
|
|
|
|