[brcm47xx] use vmalloc instead of kmalloc when reserving space for the lzma initramfs...
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 520-b43-autodepend-on-hwrandom.patch
1 This patch is submitted upstream and can be removed when it hits compat-wireless.
2
3 --mb
4
5
6
7 --- a/drivers/net/wireless/b43/b43.h
8 +++ b/drivers/net/wireless/b43/b43.h
9 @@ -625,9 +625,11 @@ struct b43_wl {
10 /* Stats about the wireless interface */
11 struct ieee80211_low_level_stats ieee_stats;
12
13 +#ifdef CONFIG_B43_HWRNG
14 struct hwrng rng;
15 - u8 rng_initialized;
16 + bool rng_initialized;
17 char rng_name[30 + 1];
18 +#endif /* CONFIG_B43_HWRNG */
19
20 /* The RF-kill button */
21 struct b43_rfkill rfkill;
22 --- a/drivers/net/wireless/b43/main.c
23 +++ b/drivers/net/wireless/b43/main.c
24 @@ -2980,6 +2980,7 @@ static void b43_security_init(struct b43
25 b43_clear_keys(dev);
26 }
27
28 +#ifdef CONFIG_B43_HWRNG
29 static int b43_rng_read(struct hwrng *rng, u32 *data)
30 {
31 struct b43_wl *wl = (struct b43_wl *)rng->priv;
32 @@ -2995,17 +2996,21 @@ static int b43_rng_read(struct hwrng *rn
33
34 return (sizeof(u16));
35 }
36 +#endif /* CONFIG_B43_HWRNG */
37
38 static void b43_rng_exit(struct b43_wl *wl)
39 {
40 +#ifdef CONFIG_B43_HWRNG
41 if (wl->rng_initialized)
42 hwrng_unregister(&wl->rng);
43 +#endif /* CONFIG_B43_HWRNG */
44 }
45
46 static int b43_rng_init(struct b43_wl *wl)
47 {
48 - int err;
49 + int err = 0;
50
51 +#ifdef CONFIG_B43_HWRNG
52 snprintf(wl->rng_name, ARRAY_SIZE(wl->rng_name),
53 "%s_%s", KBUILD_MODNAME, wiphy_name(wl->hw->wiphy));
54 wl->rng.name = wl->rng_name;
55 @@ -3018,6 +3023,7 @@ static int b43_rng_init(struct b43_wl *w
56 b43err(wl, "Failed to register the random "
57 "number generator (%d)\n", err);
58 }
59 +#endif /* CONFIG_B43_HWRNG */
60
61 return err;
62 }
63 --- a/config.mk
64 +++ b/config.mk
65 @@ -148,6 +148,7 @@ CONFIG_ATH9K_DEBUG=y
66 # CONFIG_B43_PIO=y
67 # CONFIG_B43_LEDS=y
68 # CONFIG_B43_RFKILL=y
69 +# CONFIG_B43_HWRNG=y
70 # CONFIG_B43_DEBUG=y
71 # CONFIG_B43_FORCE_PIO=y
72