Commit Graph

24 Commits

Author SHA1 Message Date
msaitoh 3f974a9659 Add Interrupt Coalescing setting by Robert Swindells. 2012-10-14 19:17:08 +00:00
msaitoh cfbd580d96 - The MVGBE_RX_MAX_FRAME_LEN_ERROR bit is used to check whether a packet
is fragmented or not, so define new MVGBE_RX_IP_FRAGMENT with the same
  value and use it.
- Remove the checking whether a packet length is lower than 72 octet.
  This check is not used in Linux and FreeBSD. Tested with me (for Kirkwood)
  and Kiyohara (for DiscoveryII).
2012-10-12 10:38:06 +00:00
msaitoh 05a67a38f2 Fix udpcsum-rx bug on fragmented case this time.
- Fix the usage of a local variable for csum_flags.
  - It seemd that sometimes MVGBE_RX_L4_CHECKSUM_OK bit were set to 0
    even if the checksum is correct and the packet was not fragmented.
    So we don't set M_CSUM_TCP_UDP_BAD even if csum bit is 0.
2012-10-04 14:21:00 +00:00
msaitoh ca34255e60 - Fix a bug that a fragmented packet is marked as bad checksum. It causes
a real bug when HW checksum offload function is used. It was easy to
  reproduce with NFS UDP mount.
- Fix a potential bug that a packet other than TCP and UDP is marked as bad
  checksum.
2012-10-02 15:22:46 +00:00
msaitoh ba5d11d6ea Fix device timeout problem.
- Change the synching order of descriptors. First, sync descriptors except
  first and then sync the first descriptor.
- To recover from an race condition, reduce the if_timer from 5 to 1 and
  when timeout occur write MVGBE_TQC_ENQ bit again.
2012-09-21 00:26:15 +00:00
msaitoh 8d4dcb44cb Add missing bus_dmamap_sync() for the RX buffer. 2012-09-06 03:45:02 +00:00
matt 0bc3200029 Fix mii_statchg to take a 'struct ifnet *' instead of device_t. This fixes
problem with a common MDIO bus used for multiple interfaces.
Some drivers converted to CFATTACL_DECL_NEW.
2012-07-22 14:32:49 +00:00
kiyohara c2250163ce Add 88F6282. tested only OpenBlockS A6.
Also fix irq 11 to 15.  irq of 2nd NIC is 15.
Remove white-space.
2012-07-18 09:21:37 +00:00
tls 7b0b7dedd9 Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code
   to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
   source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
   avoid expensive operations on disabled entropy sources; make the
   rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
   have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
   system events, and skew between clocks, with a sample implementation
   for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files).  Tested with release
builds on amd64 and evbarm and live testing on amd64.
2012-02-02 19:42:57 +00:00
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