summaryrefslogtreecommitdiffstats
path: root/package/mac80211/patches/520-b43-autodepend-on-hwrandom.patch
blob: 6cc8ea92124af2b4906d8ff443353a2c4e049727 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
This patch is submitted upstream and can be removed when it hits compat-wireless.

--mb



Index: compat-wireless-2009-03-31/drivers/net/wireless/b43/b43.h
===================================================================
--- compat-wireless-2009-03-31.orig/drivers/net/wireless/b43/b43.h	2009-04-06 18:52:21.000000000 +0200
+++ compat-wireless-2009-03-31/drivers/net/wireless/b43/b43.h	2009-04-06 18:53:19.000000000 +0200
@@ -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;
Index: compat-wireless-2009-03-31/drivers/net/wireless/b43/main.c
===================================================================
--- compat-wireless-2009-03-31.orig/drivers/net/wireless/b43/main.c	2009-04-06 18:52:28.000000000 +0200
+++ compat-wireless-2009-03-31/drivers/net/wireless/b43/main.c	2009-04-06 18:53:19.000000000 +0200
@@ -2982,6 +2982,7 @@ static void b43_security_init(struct b43
 	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;
@@ -2997,17 +2998,21 @@ static int b43_rng_read(struct hwrng *rn
 
 	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;
@@ -3020,6 +3025,7 @@ static int b43_rng_init(struct b43_wl *w
 		b43err(wl, "Failed to register the random "
 		       "number generator (%d)\n", err);
 	}
+#endif /* CONFIG_B43_HWRNG */
 
 	return err;
 }
Index: compat-wireless-2009-03-31/config.mk
===================================================================
--- compat-wireless-2009-03-31.orig/config.mk	2009-04-06 18:52:21.000000000 +0200
+++ compat-wireless-2009-03-31/config.mk	2009-04-06 18:53:19.000000000 +0200
@@ -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