Commit Graph

15 Commits

Author SHA1 Message Date
tls 3afd44cf08 First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>.  This change includes
the following:

	An initial cleanup and minor reorganization of the entropy pool
	code in sys/dev/rnd.c and sys/dev/rndpool.c.  Several bugs are
	fixed.  Some effort is made to accumulate entropy more quickly at
	boot time.

	A generic interface, "rndsink", is added, for stream generators to
	request that they be re-keyed with good quality entropy from the pool
	as soon as it is available.

	The arc4random()/arc4randbytes() implementation in libkern is
	adjusted to use the rndsink interface for rekeying, which helps
	address the problem of low-quality keys at boot time.

	An implementation of the FIPS 140-2 statistical tests for random
	number generator quality is provided (libkern/rngtest.c).  This
	is based on Greg Rose's implementation from Qualcomm.

	A new random stream generator, nist_ctr_drbg, is provided.  It is
	based on an implementation of the NIST SP800-90 CTR_DRBG by
	Henric Jungheim.  This generator users AES in a modified counter
	mode to generate a backtracking-resistant random stream.

	An abstraction layer, "cprng", is provided for in-kernel consumers
	of randomness.  The arc4random/arc4randbytes API is deprecated for
	in-kernel use.  It is replaced by "cprng_strong".  The current
	cprng_fast implementation wraps the existing arc4random
	implementation.  The current cprng_strong implementation wraps the
	new CTR_DRBG implementation.  Both interfaces are rekeyed from
	the entropy pool automatically at intervals justifiable from best
	current cryptographic practice.

	In some quick tests, cprng_fast() is about the same speed as
	the old arc4randbytes(), and cprng_strong() is about 20% faster
	than rnd_extract_data().  Performance is expected to improve.

	The AES code in src/crypto/rijndael is no longer an optional
	kernel component, as it is required by cprng_strong, which is
	not an optional kernel component.

	The entropy pool output is subjected to the rngtest tests at
	startup time; if it fails, the system will reboot.  There is
	approximately a 3/10000 chance of a false positive from these
	tests.  Entropy pool _input_ from hardware random numbers is
	subjected to the rngtest tests at attach time, as well as the
	FIPS continuous-output test, to detect bad or stuck hardware
	RNGs; if any are detected, they are detached, but the system
	continues to run.

	A problem with rndctl(8) is fixed -- datastructures with
	pointers in arrays are no longer passed to userspace (this
	was not a security problem, but rather a major issue for
	compat32).  A new kernel will require a new rndctl.

	The sysctl kern.arandom() and kern.urandom() nodes are hooked
	up to the new generators, but the /dev/*random pseudodevices
	are not, yet.

	Manual pages for the new kernel interfaces are forthcoming.
2011-11-19 22:51:18 +00:00
jakllsch dc0fd6acd4 Add workaround for infrequently encountered DMA engine limitation. 2011-11-19 17:01:38 +00:00
rjs 2f0663d472 Only zero MVGBE_MTU on Orion platforms. 2011-09-06 19:38:23 +00:00
jakllsch 883c2687f6 We occasionally will try to set up the multicast filter in a context that
kmem(9) is unusable (such as transmit timeout). Thus, put the filter table
on the stack instead, all 528 bytes of it.
2011-09-01 14:46:23 +00:00
jakllsch 74623c9c5f Initialize MVGBE_MTU to 0, as suggested by the Orion databook.
If the platform firmware did not initialize this to 0 for us,
we were unable to transmit frames.
2011-09-01 14:39:03 +00:00
rjs b891527cb7 Use new style BPF calls. 2011-07-30 19:06:57 +00:00
matt 02e9f71ae1 Use cfdata_t 2011-07-28 15:36:47 +00:00
christos 97ea5c269b fix typo, and use the parent to determine the offset. From Dave Mills 2011-03-07 13:58:32 +00:00
christos b5c8479490 don't abuse cf_unit, requested by phone. 2011-03-06 17:00:16 +00:00
christos 0b4b684637 From Dave Mills: It would appear that the two PHYs can only be
accessed from the registers of controller0 (mvgbec0) hence why both
PHYs are being detected on controller0. I have made the assumption
that PHY0 => controller0 (mvgbec0), PHY1 => controller1(mvgbec1)
and developed a patch accordingly. Also the irq is 15 for controller1
not 14.
2011-03-05 18:28:13 +00:00
jakllsch e43028272f Various improvements to mvgbe(4). Notable is improved multicast filtering. 2011-02-01 23:40:12 +00:00
jakllsch 12fe79019c Use macros for ring position advances, assuming a power of two ring size.
(Also, spelling correction in comment.)
2011-01-29 01:53:18 +00:00
kiyohara f876f061d1 Support Kirkwood's GbE. 2010-10-02 05:57:42 +00:00
kiyohara 2c444bf727 Add macro MVA_{UNIT,OFFSET,IRQ}_DEFAULT. 2010-07-11 08:43:36 +00:00
kiyohara 3224e25a97 Add Marvell Gigabit Ethernet Controller on SC/SoC.
Will support on ofppc soon.
  Tested on G4+PegasosII (kiyohara@)
	    G3+PegasosII (phx@)
2010-06-02 06:18:11 +00:00