Update to 3.4-final.
[linux-flexiantxendom0-3.2.10.git] / Documentation / hw_random.txt
index 20be482..690f525 100644 (file)
@@ -1,33 +1,26 @@
-       Hardware driver for Intel/AMD/VIA Random Number Generators (RNG)
-       Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
-       Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com>
-
 Introduction:
 
-       The hw_random device driver is software that makes use of a
+       The hw_random framework is software that makes use of a
        special hardware feature on your CPU or motherboard,
-       a Random Number Generator (RNG).
+       a Random Number Generator (RNG).  The software has two parts:
+       a core providing the /dev/hw_random character device and its
+       sysfs support, plus a hardware-specific driver that plugs
+       into that core.
 
-       In order to make effective use of this device driver, you
+       To make the most effective use of these mechanisms, you
        should download the support software as well.  Download the
        latest version of the "rng-tools" package from the
        hw_random driver's official Web site:
 
                http://sourceforge.net/projects/gkernel/
 
-About the Intel RNG hardware, from the firmware hub datasheet:
-
-       The Firmware Hub integrates a Random Number Generator (RNG)
-       using thermal noise generated from inherently random quantum
-       mechanical properties of silicon. When not generating new random
-       bits the RNG circuitry will enter a low power state. Intel will
-       provide a binary software driver to give third party software
-       access to our RNG for use as a security feature. At this time,
-       the RNG is only to be used with a system in an OS-present state.
+       Those tools use /dev/hw_random to fill the kernel entropy pool,
+       which is used internally and exported by the /dev/urandom and
+       /dev/random special files.
 
 Theory of operation:
 
-       Character driver.  Using the standard open()
+       CHARACTER DEVICE.  Using the standard open()
        and read() system calls, you can read random data from
        the hardware RNG device.  This data is NOT CHECKED by any
        fitness tests, and could potentially be bogus (if the
@@ -36,9 +29,37 @@ Theory of operation:
        a security-conscious person would run fitness tests on the
        data before assuming it is truly random.
 
-       /dev/hwrandom is char device major 10, minor 183.
+       The rng-tools package uses such tests in "rngd", and lets you
+       run them by hand with a "rngtest" utility.
+
+       /dev/hw_random is char device major 10, minor 183.
+
+       CLASS DEVICE.  There is a /sys/class/misc/hw_random node with
+       two unique attributes, "rng_available" and "rng_current".  The
+       "rng_available" attribute lists the hardware-specific drivers
+       available, while "rng_current" lists the one which is currently
+       connected to /dev/hw_random.  If your system has more than one
+       RNG available, you may change the one used by writing a name from
+       the list in "rng_available" into "rng_current".
+
+==========================================================================
 
-Driver notes:
+       Hardware driver for Intel/AMD/VIA Random Number Generators (RNG)
+       Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com>
+       Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com>
+
+
+About the Intel RNG hardware, from the firmware hub datasheet:
+
+       The Firmware Hub integrates a Random Number Generator (RNG)
+       using thermal noise generated from inherently random quantum
+       mechanical properties of silicon. When not generating new random
+       bits the RNG circuitry will enter a low power state. Intel will
+       provide a binary software driver to give third party software
+       access to our RNG for use as a security feature. At this time,
+       the RNG is only to be used with a system in an OS-present state.
+
+Intel RNG Driver notes:
 
        * FIXME: support poll(2)
 
@@ -67,72 +88,3 @@ Driver details:
 
        Special thanks to Matt Sottek.  I did the "guts", he
        did the "brains" and all the testing.
-
-Change history:
-
-       Version 1.0.0:
-       * Merge Intel, AMD, VIA RNG drivers into one.
-         Further changelog in BitKeeper.
-
-       Version 0.9.8:
-       * Support other i8xx chipsets by adding 82801E detection
-       * 82801DB detection is the same as for 82801CA.
-
-       Version 0.9.7:
-       * Support other i8xx chipsets too (by adding 82801BA(M) and
-         82801CA(M) detection)
-
-       Version 0.9.6:
-       * Internal driver cleanups, prep for 1.0.0 release.
-
-       Version 0.9.5:
-       * Rip out entropy injection via timer.  It never ever worked,
-         and a better solution (rngd) is now available.
-
-       Version 0.9.4:
-       * Fix: Remove request_mem_region
-       * Fix: Horrible bugs in FIPS calculation and test execution
-
-       Version 0.9.3:
-       * Clean up rng_read a bit.
-       * Update i810_rng driver Web site URL.
-       * Increase default timer interval to 4 samples per second.
-       * Abort if mem region is not available.
-       * BSS zero-initialization cleanup.
-       * Call misc_register() from rng_init_one.
-       * Fix O_NONBLOCK to occur before we schedule.
-
-       Version 0.9.2:
-       * Simplify open blocking logic
-
-       Version 0.9.1:
-       * Support i815 chipsets too (Matt Sottek)
-       * Fix reference counting when statically compiled (prumpf)
-       * Rewrite rng_dev_read (prumpf)
-       * Make module races less likely (prumpf)
-       * Small miscellaneous bug fixes (prumpf)
-       * Use pci table for PCI id list
-
-       Version 0.9.0:
-       * Don't register a pci_driver, because we are really
-         using PCI bridge vendor/device ids, and someone
-         may want to register a driver for the bridge. (bug fix)
-       * Don't let the usage count go negative (bug fix)
-       * Clean up spinlocks (bug fix)
-       * Enable PCI device, if necessary (bug fix)
-       * iounmap on module unload (bug fix)
-       * If RNG chrdev is already in use when open(2) is called,
-         sleep until it is available.
-       * Remove redundant globals rng_allocated, rng_use_count
-       * Convert numeric globals to unsigned
-       * Module unload cleanup
-
-       Version 0.6.2:
-       * Clean up spinlocks.  Since we don't have any interrupts
-         to worry about, but we do have a timer to worry about,
-         we use spin_lock_bh everywhere except the timer function
-         itself.
-       * Fix module load/unload.
-       * Fix timer function and h/w enable/disable logic
-       * New timer interval sysctl
-       * Clean up sysctl names