aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/rng.c
diff options
context:
space:
mode:
authorKalle Valo <kvalo@codeaurora.org>2015-07-31 10:17:35 +0300
committerKalle Valo <kvalo@codeaurora.org>2015-07-31 10:25:16 +0300
commit360d9bb5ee2db4d409448667de606c05b3914d53 (patch)
treedc07756274f5ac3d9b58179b9820ffd097e97d3c /drivers/net/wireless/ath/ath9k/rng.c
parentbcma: fix build error when build as module (diff)
downloadlinux-dev-360d9bb5ee2db4d409448667de606c05b3914d53.tar.xz
linux-dev-360d9bb5ee2db4d409448667de606c05b3914d53.zip
Revert "ath9k: export HW random number generator"
This reverts commit 6301566e0b2dafa7d6779598621bca867962a0a2. Oleksij Rempel noticed that the randomness doesn't look to be good enough and Stephan Mueller commented: "I would say that the discussed RNG does not seem fit for hooking it up with the hwrandom framework." http://lkml.kernel.org/g/3945775.m5HblJPgiO@tauon.atsec.com So let's the revert the patch until we are sure that we can trust this random generator. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to '')
-rw-r--r--drivers/net/wireless/ath/ath9k/rng.c75
1 files changed, 0 insertions, 75 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rng.c b/drivers/net/wireless/ath/ath9k/rng.c
deleted file mode 100644
index d8fa7a535ab8..000000000000
--- a/drivers/net/wireless/ath/ath9k/rng.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2015 Qualcomm Atheros, Inc.
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "ath9k.h"
-#include "hw.h"
-#include "ar9003_phy.h"
-
-static int ath9k_rng_data_read(struct hwrng *rng, u32 *data)
-{
- u32 v1, v2;
- struct ath_softc *sc = (struct ath_softc *)rng->priv;
- struct ath_hw *ah = sc->sc_ah;
-
- ath9k_ps_wakeup(sc);
-
- REG_RMW_FIELD(ah, AR_PHY_TEST, AR_PHY_TEST_BBB_OBS_SEL, 5);
- REG_CLR_BIT(ah, AR_PHY_TEST, AR_PHY_TEST_RX_OBS_SEL_BIT5);
- REG_RMW_FIELD(ah, AR_PHY_TEST_CTL_STATUS, AR_PHY_TEST_CTL_RX_OBS_SEL, 0);
-
- v1 = REG_READ(ah, AR_PHY_TST_ADC);
- v2 = REG_READ(ah, AR_PHY_TST_ADC);
-
- ath9k_ps_restore(sc);
-
- /* wait for data ready */
- if (v1 && v2 && sc->rng_last != v1 && v1 != v2) {
- *data = (v1 & 0xffff) | (v2 << 16);
- sc->rng_last = v2;
-
- return sizeof(u32);
- }
-
- sc->rng_last = v2;
-
- return 0;
-}
-
-void ath9k_rng_register(struct ath_softc *sc)
-{
- struct ath_hw *ah = sc->sc_ah;
-
- if (WARN_ON(sc->rng_initialized))
- return;
-
- if (!AR_SREV_9300_20_OR_LATER(ah))
- return;
-
- sc->rng.name = "ath9k";
- sc->rng.data_read = ath9k_rng_data_read;
- sc->rng.priv = (unsigned long)sc;
-
- if (!hwrng_register(&sc->rng))
- sc->rng_initialized = true;
-}
-
-void ath9k_rng_unregister(struct ath_softc *sc)
-{
- if (sc->rng_initialized) {
- hwrng_unregister(&sc->rng);
- sc->rng_initialized = false;
- }
-}