Thanks Felix, I think that's why we can't get the ideal entropy.  And  I only 
saw the unstable issue when read the ADC values from MAC_PCU buffer after 
enable BB multiplexes the ADC input from radio to MAC ,  as it will defer the 
regular operation.

- Miaoqing

-----Original Message-----
From: Felix Fietkau [mailto:[email protected]] 
Sent: Tuesday, July 07, 2015 3:09 PM
To: Pan, Miaoqing; [email protected]
Cc: [email protected]; ath9k-devel; Valo, Kalle
Subject: Re: [PATCH v2] ath9k: export HW random number generator

On 2015-07-07 07:07, Pan, Miaoqing wrote:
> AR_PHY_TST_ADC is BB ADC sample register, it doesn't depend on other 
> BB registers. Get non zero data if it has the ADC values.
This is completely wrong!

AR_PHY_TST_ADC is a generic observation register which can be configured to 
observe multiple points in the rx path.
I did my own experiments with sampling raw I/Q values from the ADC, and you can 
find my patch here:

http://git.openwrt.org/?p=openwrt.git;a=blob_plain;f=package/kernel/mac80211/patches/543-ath9k_entropy_from_adc.patch

It right now uses only the lowest bits (they are the hardest to control from 
the outside).

Through extensive testing (not just by me, but also by many people in the 
OpenWrt community), I found that leaving the AR_PHY_TST_ADC register configured 
for raw I/Q samples causes the radio to become unstable on AR5008-AR9002. 
That's why my patch currently only gathers some data at driver init time.
By the way, on AR5008-AR9002 this register is in a different location than 
AR9003, something your patch also needs to take into account.

You should also make sure that the radio is actually configured to a channel 
(and active!) before gathering data.

When you rework your patch, please carefully review the documentation for the 
fields rx_obs_sel and cf_bbb_obs_sel before you change the code again.

- Felix
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to