diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2009-04-01 11:42:36 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:40 -0400 |
commit | 910cfee363feda81cd5af4939ed9e0d27677b43f (patch) | |
tree | 087842da1c06d12aaed471b38800e329ac9af01a /drivers/net/wireless/b43legacy | |
parent | 66174bbea0b9c5bd4b7d060fed26bf5ec912c422 (diff) |
b43legacy: Do not select HW_RANDOM
Auto-depend on HW_RANDOM, rather than "select"ing it.
This way the user has the choice to enable or disable HWRNG support.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43legacy')
-rw-r--r-- | drivers/net/wireless/b43legacy/Kconfig | 8 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/b43legacy.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 8 |
3 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/wireless/b43legacy/Kconfig b/drivers/net/wireless/b43legacy/Kconfig index aef2298d37ac..d4f628a74bbd 100644 --- a/drivers/net/wireless/b43legacy/Kconfig +++ b/drivers/net/wireless/b43legacy/Kconfig | |||
@@ -3,7 +3,6 @@ config B43LEGACY | |||
3 | depends on SSB_POSSIBLE && MAC80211 && WLAN_80211 && HAS_DMA | 3 | depends on SSB_POSSIBLE && MAC80211 && WLAN_80211 && HAS_DMA |
4 | select SSB | 4 | select SSB |
5 | select FW_LOADER | 5 | select FW_LOADER |
6 | select HW_RANDOM | ||
7 | ---help--- | 6 | ---help--- |
8 | b43legacy is a driver for 802.11b devices from Broadcom (BCM4301 and | 7 | b43legacy is a driver for 802.11b devices from Broadcom (BCM4301 and |
9 | BCM4303) and early model 802.11g chips (BCM4306 Ver. 2) used in the | 8 | BCM4303) and early model 802.11g chips (BCM4306 Ver. 2) used in the |
@@ -51,6 +50,13 @@ config B43LEGACY_RFKILL | |||
51 | depends on B43LEGACY && (RFKILL = y || RFKILL = B43LEGACY) && RFKILL_INPUT && (INPUT_POLLDEV = y || INPUT_POLLDEV = B43LEGACY) | 50 | depends on B43LEGACY && (RFKILL = y || RFKILL = B43LEGACY) && RFKILL_INPUT && (INPUT_POLLDEV = y || INPUT_POLLDEV = B43LEGACY) |
52 | default y | 51 | default y |
53 | 52 | ||
53 | # This config option automatically enables b43 HW-RNG support, | ||
54 | # if the HW-RNG core is enabled. | ||
55 | config B43LEGACY_HWRNG | ||
56 | bool | ||
57 | depends on B43LEGACY && (HW_RANDOM = y || HW_RANDOM = B43LEGACY) | ||
58 | default y | ||
59 | |||
54 | config B43LEGACY_DEBUG | 60 | config B43LEGACY_DEBUG |
55 | bool "Broadcom 43xx-legacy debugging" | 61 | bool "Broadcom 43xx-legacy debugging" |
56 | depends on B43LEGACY | 62 | depends on B43LEGACY |
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h index 97b0e06dfe21..4cdde4ad17c0 100644 --- a/drivers/net/wireless/b43legacy/b43legacy.h +++ b/drivers/net/wireless/b43legacy/b43legacy.h | |||
@@ -596,9 +596,11 @@ struct b43legacy_wl { | |||
596 | /* Stats about the wireless interface */ | 596 | /* Stats about the wireless interface */ |
597 | struct ieee80211_low_level_stats ieee_stats; | 597 | struct ieee80211_low_level_stats ieee_stats; |
598 | 598 | ||
599 | #ifdef CONFIG_B43LEGACY_HWRNG | ||
599 | struct hwrng rng; | 600 | struct hwrng rng; |
600 | u8 rng_initialized; | 601 | u8 rng_initialized; |
601 | char rng_name[30 + 1]; | 602 | char rng_name[30 + 1]; |
603 | #endif | ||
602 | 604 | ||
603 | /* The RF-kill button */ | 605 | /* The RF-kill button */ |
604 | struct b43legacy_rfkill rfkill; | 606 | struct b43legacy_rfkill rfkill; |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 879edc786713..81dbbc1c591a 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -2297,6 +2297,7 @@ static void b43legacy_security_init(struct b43legacy_wldev *dev) | |||
2297 | dev->max_nr_keys - 8); | 2297 | dev->max_nr_keys - 8); |
2298 | } | 2298 | } |
2299 | 2299 | ||
2300 | #ifdef CONFIG_B43LEGACY_HWRNG | ||
2300 | static int b43legacy_rng_read(struct hwrng *rng, u32 *data) | 2301 | static int b43legacy_rng_read(struct hwrng *rng, u32 *data) |
2301 | { | 2302 | { |
2302 | struct b43legacy_wl *wl = (struct b43legacy_wl *)rng->priv; | 2303 | struct b43legacy_wl *wl = (struct b43legacy_wl *)rng->priv; |
@@ -2312,17 +2313,21 @@ static int b43legacy_rng_read(struct hwrng *rng, u32 *data) | |||
2312 | 2313 | ||
2313 | return (sizeof(u16)); | 2314 | return (sizeof(u16)); |
2314 | } | 2315 | } |
2316 | #endif | ||
2315 | 2317 | ||
2316 | static void b43legacy_rng_exit(struct b43legacy_wl *wl) | 2318 | static void b43legacy_rng_exit(struct b43legacy_wl *wl) |
2317 | { | 2319 | { |
2320 | #ifdef CONFIG_B43LEGACY_HWRNG | ||
2318 | if (wl->rng_initialized) | 2321 | if (wl->rng_initialized) |
2319 | hwrng_unregister(&wl->rng); | 2322 | hwrng_unregister(&wl->rng); |
2323 | #endif | ||
2320 | } | 2324 | } |
2321 | 2325 | ||
2322 | static int b43legacy_rng_init(struct b43legacy_wl *wl) | 2326 | static int b43legacy_rng_init(struct b43legacy_wl *wl) |
2323 | { | 2327 | { |
2324 | int err; | 2328 | int err = 0; |
2325 | 2329 | ||
2330 | #ifdef CONFIG_B43LEGACY_HWRNG | ||
2326 | snprintf(wl->rng_name, ARRAY_SIZE(wl->rng_name), | 2331 | snprintf(wl->rng_name, ARRAY_SIZE(wl->rng_name), |
2327 | "%s_%s", KBUILD_MODNAME, wiphy_name(wl->hw->wiphy)); | 2332 | "%s_%s", KBUILD_MODNAME, wiphy_name(wl->hw->wiphy)); |
2328 | wl->rng.name = wl->rng_name; | 2333 | wl->rng.name = wl->rng_name; |
@@ -2336,6 +2341,7 @@ static int b43legacy_rng_init(struct b43legacy_wl *wl) | |||
2336 | "number generator (%d)\n", err); | 2341 | "number generator (%d)\n", err); |
2337 | } | 2342 | } |
2338 | 2343 | ||
2344 | #endif | ||
2339 | return err; | 2345 | return err; |
2340 | } | 2346 | } |
2341 | 2347 | ||