Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/i82557var.h
RevisionDateAuthorComments
 1.52  13-Apr-2015  riastradh Convert sys/dev to use <sys/rndsource.h>.
 1.51  22-Nov-2014  joerg branches: 1.51.2;
Replace void * cast with proper __UNVOLATILE.
 1.50  02-Feb-2012  tls branches: 1.50.6; 1.50.22;
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.
 1.49  19-Nov-2011  tls branches: 1.49.2;
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.
 1.48  25-Feb-2010  dyoung branches: 1.48.10;
Make fxp at cardbus detach during shutdown.

Stop calling (*cardbus_ctrl) to enable bus mastering, I/O and memory
spaces on the CardBus bridge. cbb(4) always enables that stuff,
anyway. In the process, avoid remembering what BAR we mapped by
writing CARDBUS_{IO,MEM}_ENABLE to sc_cben or sc_cbenable, and
record the BAR in use sc_bar, instead.

Replace more CARDBUS_ constants with PCI_ constants.

Compile-tested, only.
 1.47  12-May-2009  cegger branches: 1.47.2;
struct device * -> device_t, no functional changes intended.
 1.46  15-Mar-2009  tsutsui Adjust comments about sc_flags.
 1.45  11-Mar-2009  tsutsui u_intNN_t -> uintNN_t
 1.44  07-Mar-2009  tsutsui Add TCPv4/UDPv4 RX hardware checksum support for i82559 and later chips
which don't have EXT_RFA and IPCB support. From hme(4) driver and
FreeBSD's fxp(4). Tested on i82559.

XXX: Probably we should have a common function to parse RX packet headers
XXX: to handle a raw checksum value and share it among hme(4) and gem(4) etc.
 1.43  20-Feb-2009  mrg - remove FXPF_IPCB flag. it should always/only be used with the code
conditional on FXPF_EXT_TXCB, so, replace all uses with that
- for the pci frontend, reestablish some flags lost the the prior
changes and simplify one of the cases

this fixes PR 40677 and may fix PR 40431.
 1.42  18-Jan-2009  mrg branches: 1.42.2;
The PCI revision numbers are unique to a PCI vendor/product
ID pair. Misuse of the revision numbers was causing some of the chip
features to be disabled on some integrated Intel chips. So, move the
determination of the features into the bus frontend, where the
vendor/product ID is known. (Note: sc_rev should be removed. The
microcode patch stuff is also busted and needs to be fixed.) Also,
poll the actual flow control status in inphy, rather than making
assumptions.

contributed anonymously.
 1.41  03-Dec-2008  tsutsui Add a workaround for hardware ip4csum-tx bug and enable it.
Confirmed on i82550 rev 12 and UDP fragment packets by ttcp(1).
 1.40  09-Jul-2008  joerg branches: 1.40.2; 1.40.4;
- device/softc split for fxp(4)
 1.39  28-Apr-2008  martin branches: 1.39.2; 1.39.4; 1.39.6;
Remove clause 3 and 4 from TNF licenses
 1.38  13-Dec-2007  degroote branches: 1.38.6; 1.38.8; 1.38.10;
Remove the shutdown hook (pmf takes care about it already), as suggested by joerg@
 1.37  10-Dec-2007  degroote branches: 1.37.2;
Register fxp @ pci to the pmf framework
Kill reference to old powerhook framework.
 1.36  08-Dec-2007  tsutsui branches: 1.36.2;
Pull several fixes from OpenBSD's fxp.c:

Rev 1.41:
> use a nop with I bit set at the end of the tx chain. This avoids a race
> between status update and clearing the suspend bit on machines which can't
> write data smaller than 32bits at a time.
This should fix PR port-alpha/30560.

Rev 1.50:
> Fix nasty bug where driver would not correctly catch and handle an rnr
> condition when it was due to the the recieve buffers being exhausted with
> no packet transmits during that time. Symptom was that the fxp would
> simply stop interrupting for the next 15 seconds until the watchdog kicked
> in and reset the chip due to 15 seconds of inactivity, making the fxp very
> poorly behaved when hammered on hard.

Rev 1.61:
> Defer reinitialisation of the RU until after the interrupt handler has had
> a chance to process all pending packets, otherwise the chip may overwrite
> their mbuf clusters after we have freed them.
>
> Eliminates a race that can cause random pool corruption when reconfiguring
> an interface under heavy network load.

And one more change for RX sanity:
- put RU into suspend when the last RFA is processed.

These RNR/RU changes may fix pool corruption problems on fxp.

Tested on AlphaPC164 and i386 with i82559 and i82550.
 1.35  11-Dec-2005  christos branches: 1.35.24; 1.35.34; 1.35.38; 1.35.44; 1.35.46; 1.35.56; 1.35.58;
merge ktrace-lwp.
 1.34  27-Feb-2005  perry branches: 1.34.4;
nuke trailing whitespace
 1.33  16-May-2004  thorpej branches: 1.33.4; 1.33.6;
Patch from HITOSHI Osada:
* Add PAUSE-related event counters.
* Return flow control bits in fxp_mii_mediastatus().
 1.32  16-May-2004  thorpej Patch from HITOSHI Osada:
* Newer chips do not need the receiver lock-up workaround; detect when it
is required.
 1.31  26-May-2003  yamt branches: 1.31.2;
ip/tcp/udp checksum offloading support for i82550.
largely from FreeBSD.
 1.30  29-Sep-2002  wiz "definitions" has lots of 'i's, but that's not reason to leave one out.
 1.29  20-May-2002  mycroft The FIX_RESUME_BUG hack does not work, so remove it.
Also, attempt to clarify the message slightly when updating the EEPROM.
 1.28  03-May-2002  thorpej branches: 1.28.2;
Bump the number of Tx DMA segments from 8 to 16 (the zero-copy socket
code sometimes sees more than 8).
 1.27  05-Apr-2002  thorpej Add support for the "CPUSaver" receive interrupt mitigating microcode
on the following PRO/100 chips:

* i82558 step A4
* i82558 step B0
* i82559 step A0
* i82559S step A
* i82550
* i82550 step C

The interrupt delay is configurable on all microcodable chips. The
maximum "bundle" size (packet count) is configurable on all but the
i82558.

The microcode is enabled by setting IFF_LINK0 on the interface.

Derived from code in FreeBSD.
 1.26  15-Jun-2001  thorpej branches: 1.26.2;
Split the Tx and Rx interrupt routines into separate functions,
and add some (optional) event counters.
 1.25  12-Jun-2001  wiz receive, not recieve
 1.24  02-Jun-2001  thorpej Define some extra configuration block bits used on the i82550 (a.k.a.
PRO 100/S), including the extended RFA format. Don't hard-code the
RFA size to allow us to use the extended format in the future.
 1.23  22-May-2001  thorpej Some changes from the new FreeBSD `fxp' driver:
- Add some additional config block bits for the i82558/i82559.
- Change the config block template to only fill in the must-be-one
reserved bits, leave fxp_init() to fill in all the important things.
- On the i82558/i82559, we can use "Receive Long Frames" rather than
"Save Bad Frames" to support the VLAN MTU.
- Use 802.3x flow control on the i82558/i82559. This is all handled
transparently by the hardware. When in promiscuous mode, allow
wire-watchers to see the flow control frames.
- Use the Extended TxCB format on the i82558/i82559. This places two
Transmit Buffer Descriptors directly in the TxCB, which should cover
the vast majority of packets transmitted. This saves PCI transactions
that would otherwise be required to fetch the TBD list.

With the tansmit queue length changes from yesterday, this gets us up to
11.5MB/s TCP transmit speed, out of an absolute maximum of 12MB/s possible
on a 100Mb/s link.
 1.22  22-May-2001  thorpej Report 82558, 82559, etc. based on chip revision. Also, remember which
revsion we have for feature enables later.
 1.21  22-May-2001  thorpej A little slight cleanup.
 1.20  21-May-2001  thorpej Re-arrange the transmit control data somewhat so that we can
use the extended TxCB format (that change will happen later).
 1.19  21-May-2001  thorpej Change NTXSEGS from 16 to 8, and the TXQUEUE len from 128 to 256. Also
increase the number of Rx buffers from 64 to 128.

These mirror some performance tweaks made to the sip(4) driver.
 1.18  21-May-2001  thorpej The 82801BA built-in Ethernet has a bug which requires us to
issue a NOP before a CU_RESUME when in 10baseT mode. Handle
this.
 1.17  21-May-2001  thorpej ANSI'ify.
 1.16  29-May-2000  jhawk branches: 1.16.2; 1.16.4;
For all network drivers that call ether_ifattach(), and also
have _detach() functions:
Ensure that softc keeps state about whether the attach succeeded,
and make the detach function return immediately if the attach did
not complete.
 1.15  26-May-2000  tsutsui branches: 1.15.2;
Call bus_dmamap_sync() properly before/after reading fcd_stats
in fxp_control_data.
 1.14  12-May-2000  jhawk sc_ih (interrupt cookie) is not pci-specific data
and needs to remain in fxp_softc rather than fxp_pci_softc;
otherwise we break cardbus.
 1.13  12-May-2000  jhawk Move pci-specific data to fxp_pci_softc from fxp_pci_softc.
Add some more pci-specific data to fxp_pci_softc.
 1.12  23-Mar-2000  thorpej New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
 1.11  12-Feb-2000  enami Add activate routine and check device active flag also in one second
tick handler.
 1.10  09-Feb-2000  joda add detach code
 1.9  12-Dec-1999  thorpej Take a stab at making this work on big-endian systems.
 1.8  30-Oct-1999  sommerfeld Add enable/disable support and EEPROM size selection, prerequisites
for getting the cardbus fxp attachment to work.

Tested on the built-in 82559 in a VAIO Z505S.

From Johan Danielsson / PR8631; changed slightly to KNF.
 1.7  28-Oct-1999  sommerfeld Fix suspend/resume-related problems observed on fxp0 on Sony Z505S:

Symptoms: system would crash with "data modified on free list" pool
panic from the mbuf cluster pool shortly after a resume. The cluster
in question contained a valid 82557 receive descriptor and an IP
packet. Happened sporadically in normal use. Easiest way for me to
reproduce it was to run tcpdump and a flood ping and do a
suspend/resume cycle or two.

Changes:
- in interrupt handler, if the interface isn't in IFF_RUNNING state,
just ack interrupts and return; don't try to receive packets, queue
new descriptors, etc., etc.,
- add power control hook to take interface down on suspend,
and restart it (if it was up) on resume.
- tweaks to fxp_stop and fxp_shutdown to avoid recursive panics due
to the (now fixed) bug.
 1.6  05-Aug-1999  thorpej branches: 1.6.2; 1.6.4; 1.6.6;
Since we have to go through fxp_init() to properly handle IFF_ALLMULTI
anyway, take advantage of this and greatly simplify the programming
of the multicast filter. This solves the last reported "device timeout"
problem with this driver.
 1.5  04-Aug-1999  thorpej Almost completely rewrite the receive logic, making it as close as possible
to the EPIC/100 driver's (adjusting for the fact that Intel Ethernet chips
are from Pluto):
* Don't allocate receive buffers until the interface is actually brought
up, and release all of them if the interface is taken down.
* Add a knob (defaults to off) which will copy an incoming packet to
a single header mbuf if it is small enough to fit in one, rather than
burning an entire cluster on it. Note that this change will be mostly
moot if/when sbcompress() is changed to handle compressing clusters.

Simplify some of the receive list logic:
* Rather than using a homegrown queue and additional software RX descriptors,
use an ifqueue to queue receive buffers, and M_{GET,SET}CTX() to hook DMA
maps and receive buffers together.

Clean up a bit:
* Macroize a bunch of things to make the code a bit easier to follow.
 1.4  04-Aug-1999  thorpej Only tick the MII if we are using it.
 1.3  03-Aug-1999  thorpej G/c a flag.
 1.2  03-Aug-1999  thorpej Completely rewrite the transmit logic, making it look more like the
EPIC/100 driver's. Also, fix the "all multicast" logic. Also do some
general cleanup.
 1.1  20-Jun-1999  thorpej branches: 1.1.2;
Bus-independent back-end driver for Intel i82557 fast Ethernet chips.
 1.1.2.2  01-Jul-1999  thorpej Sync w/ -current.
 1.1.2.1  20-Jun-1999  thorpej file i82557var.h was added on branch chs-ubc2 on 1999-07-01 23:32:29 +0000
 1.6.6.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.4.1  15-Nov-1999  fvdl Sync with -current
 1.6.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.15.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.16.4.4  18-Oct-2002  nathanw Catch up to -current.
 1.16.4.3  20-Jun-2002  nathanw Catch up to -current.
 1.16.4.2  17-Apr-2002  nathanw Catch up to -current.
 1.16.4.1  21-Jun-2001  nathanw Catch up to -current.
 1.16.2.1  06-Jun-2002  he Pull up revisions 1.17-1.26,1.29 (via patch, requested by mycroft):
Work around a bug which can cause some machines to randomly hang.
Drag along performance improvements and improved hardware support.
 1.26.2.2  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.26.2.1  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.28.2.1  30-May-2002  gehenna Catch up with -current.
 1.31.2.4  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.31.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.31.2.1  03-Aug-2004  skrll Sync with HEAD
 1.33.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.33.4.1  29-Apr-2005  kent sync with -current
 1.34.4.1  21-Jan-2008  yamt sync with head
 1.35.58.1  02-Feb-2008  riz Pull up following revision(s) (requested by tsutsui in ticket #1028):
sys/dev/ic/i82557reg.h: revision 1.19
sys/dev/ic/i82557var.h: revision 1.36
sys/dev/ic/i82557.c: revision 1.105
Pull several fixes from OpenBSD's fxp.c:
Rev 1.41:
use a nop with I bit set at the end of the tx chain. This avoids a race
between status update and clearing the suspend bit on machines which can't
write data smaller than 32bits at a time.
This should fix PR port-alpha/30560.
Rev 1.50:
Fix nasty bug where driver would not correctly catch and handle an rnr
condition when it was due to the the recieve buffers being exhausted with
no packet transmits during that time. Symptom was that the fxp would
simply stop interrupting for the next 15 seconds until the watchdog kicked
in and reset the chip due to 15 seconds of inactivity, making the fxp very
poorly behaved when hammered on hard.
Rev 1.61:
Defer reinitialisation of the RU until after the interrupt handler has had
a chance to process all pending packets, otherwise the chip may overwrite
their mbuf clusters after we have freed them.
Eliminates a race that can cause random pool corruption when reconfiguring
an interface under heavy network load.
And one more change for RX sanity:
- put RU into suspend when the last RFA is processed.
These RNR/RU changes may fix pool corruption problems on fxp.
Tested on AlphaPC164 and i386 with i82559 and i82550.
 1.35.56.2  26-Dec-2007  ad Sync with head.
 1.35.56.1  08-Dec-2007  ad Sync with head.
 1.35.46.1  09-Jan-2008  matt sync with HEAD
 1.35.44.1  09-Dec-2007  jmcneill Sync with HEAD.
 1.35.38.1  03-Jun-2008  skrll Sync with netbsd-4.
 1.35.34.1  09-Dec-2007  reinoud Pullup to HEAD
 1.35.24.1  02-Feb-2008  riz Pull up following revision(s) (requested by tsutsui in ticket #1028):
sys/dev/ic/i82557reg.h: revision 1.19
sys/dev/ic/i82557var.h: revision 1.36
sys/dev/ic/i82557.c: revision 1.105
Pull several fixes from OpenBSD's fxp.c:
Rev 1.41:
use a nop with I bit set at the end of the tx chain. This avoids a race
between status update and clearing the suspend bit on machines which can't
write data smaller than 32bits at a time.
This should fix PR port-alpha/30560.
Rev 1.50:
Fix nasty bug where driver would not correctly catch and handle an rnr
condition when it was due to the the recieve buffers being exhausted with
no packet transmits during that time. Symptom was that the fxp would
simply stop interrupting for the next 15 seconds until the watchdog kicked
in and reset the chip due to 15 seconds of inactivity, making the fxp very
poorly behaved when hammered on hard.
Rev 1.61:
Defer reinitialisation of the RU until after the interrupt handler has had
a chance to process all pending packets, otherwise the chip may overwrite
their mbuf clusters after we have freed them.
Eliminates a race that can cause random pool corruption when reconfiguring
an interface under heavy network load.
And one more change for RX sanity:
- put RU into suspend when the last RFA is processed.
These RNR/RU changes may fix pool corruption problems on fxp.
Tested on AlphaPC164 and i386 with i82559 and i82550.
 1.36.2.1  11-Dec-2007  yamt sync with head.
 1.37.2.1  13-Dec-2007  bouyer Sync with HEAD
 1.38.10.4  11-Mar-2010  yamt sync with head
 1.38.10.3  16-May-2009  yamt sync with head
 1.38.10.2  04-May-2009  yamt sync with head.
 1.38.10.1  16-May-2008  yamt sync with head.
 1.38.8.1  18-May-2008  yamt sync with head.
 1.38.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.38.6.2  28-Sep-2008  mjf Sync with HEAD.
 1.38.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.39.6.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.39.6.1  19-Oct-2008  haad Sync with HEAD.
 1.39.4.1  18-Jul-2008  simonb Sync with head.
 1.39.2.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.40.4.1  14-Dec-2008  bouyer Pull up following revision(s) (requested by tsutsui in ticket #181):
sys/dev/ic/i82557.c: revision 1.116-1.120
sys/dev/ic/i82557reg.h: revision 1.21
sys/dev/ic/i82557var.h: revision 1.41
doc/CHANGES: patch
Call BUS_DMASYNC_PREREAD more strictly on polling DMA descriptors.
Add a workaround for hardware ip4csum-tx bug and enable it.
Confirmed on i82550 rev 12 and UDP fragment packets by ttcp(1).
Sort Tx/Rx macro in previous.
Add a missed htole32() on the previous ip4csum-tx bug workaround.
Don't pass uint8_t values to le16toh() in fxp_rx_hwcksum().
fxp(4)'s RX hwcksum results weren't used at all on big endian machines.
Checked by i82550 and vmstat -ev on macppc GENERIC kernel with
options INET_CSUM_COUNTERS,TCP_CSUM_COUNTERS,UDP_CSUM_COUNTERS.
 1.40.2.3  28-Apr-2009  skrll Sync with HEAD.
 1.40.2.2  03-Mar-2009  skrll Sync with HEAD.
 1.40.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.42.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.47.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.48.10.1  17-Apr-2012  yamt sync with head
 1.49.2.1  18-Feb-2012  mrg merge to -current.
 1.50.22.1  15-May-2015  snj Pull up following revision(s) (requested by joerg in ticket #772):
sys/arch/arm/amlogic/amlogic_genfb.c: revision 1.4
sys/arch/arm/arm/disassem.c: revision 1.25
sys/arch/arm/omap/am335x_cm_padconf.c: revision 1.3
sys/arch/arm/omap/sitara_cm.h: revision 1.2
sys/dev/ic/i82557var.h: revision 1.51
sys/dev/ic/rtl8169.c: revision 1.143
sys/dev/ieee1394/fwcrom.c: revision 1.17
sys/external/bsd/dwc2/dwc2.c: revision 1.32
dwc2_hubd appears to be unused so #if 0 it in order to appease clang
--
Preserve const.
--
No reason not to make the string const.
--
Drop unnecessary-but-harmful casts.
--
Replace void * cast with proper __UNVOLATILE.
--
Preserve const.
--
amlogic_genfb_hdmi_write_4 is currently unused, mark it as such.
 1.50.6.1  03-Dec-2017  jdolecek update from HEAD
 1.51.2.1  06-Jun-2015  skrll Sync with HEAD

RSS XML Feed