Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/tulipvar.h
RevisionDateAuthorComments
 1.70  13-Sep-2019  msaitoh if_flags is neither int nor short. It's unsigned short.
 1.69  13-Apr-2015  riastradh branches: 1.69.18;
Convert sys/dev to use <sys/rndsource.h>.
 1.68  22-Jul-2012  matt branches: 1.68.2; 1.68.16;
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.
 1.67  02-Feb-2012  tls 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.66  19-Nov-2011  tls branches: 1.66.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.65  09-Jul-2011  christos branches: 1.65.2;
- add a routine to get the name of the card.
 1.64  17-Apr-2009  cegger change tlp_attach() to return an error code on failure.
 1.63  17-Apr-2009  cegger device_t/softc split. Tested with tlp at pci
 1.62  17-Apr-2009  cegger struct device * -> device_t
u_intNN_t -> uintNN_t
 1.61  28-Apr-2008  martin branches: 1.61.8; 1.61.14;
Remove clause 3 and 4 from TNF licenses
 1.60  23-Mar-2008  tsutsui branches: 1.60.2; 1.60.4;
On preparing a setup packet, use proper byteswap ops and byte shift ops
rather than #ifdef BYTE_ORDER and subtle pointer casts.
 1.59  09-Mar-2008  jmcneill Convert from shutdownhook/powerhook to PMF.
 1.58  25-Mar-2006  rpaulo branches: 1.58.34; 1.58.54; 1.58.58;
Add support for the Conexant RS7112. From Frank Wille <frank@phoenix.owl.de>.
 1.57  11-Dec-2005  christos branches: 1.57.4; 1.57.6; 1.57.8; 1.57.10; 1.57.12;
merge ktrace-lwp.
 1.56  17-Jul-2005  he Make tlp_idle() not be static, so that the newsmips version of the
driver can access that function again.

Approved by thorpej
 1.55  23-Jun-2005  rpaulo branches: 1.55.2;
Add support for ASIX AX88140A/AX88141 chipsets using only
the 10/100 MII with inspiration from FreeBSD dc(4) driver.

Tested on i386 and macppc.

Reviewed by Jason Thorpe and ok'ed by Hubert Feyrer.
 1.54  27-Feb-2005  perry branches: 1.54.2;
nuke trailing whitespace
 1.53  06-Feb-2005  kim If the interface is up and running, only modify the receive filter
when setting promiscuous or debug mode. This avoids resetting the
chip unnecessarily.

Fixes PR kern/29126.
 1.52  04-Feb-2005  perry de-__P
 1.51  24-Oct-2004  christos branches: 1.51.4; 1.51.6;
Change the sc_name buffer size from 16 to 32, since we already oveflow 16
in if_tlp_pci.c... The name code really needs to be fixed so that it does
not have a buffer overflow again:

1. the cardbus and eisa code don't initialize sc_name; it probably should?
2. tlp_attach() seems to print the name and the ethernet address, but
the pci front end seems to do the same.
3. some of the name determination code in the pci front-end does not guarantee
nul terminated strings.

Really, all this name code is just bloat and another place for bugs to hide.
 1.50  18-Dec-2003  thorpej If we're running on a Connectix Virtual PC, we might get a packet longer
than a max size Ethernet frame without getting a frame-too-long error. VPC
seems to be adding 4 zeros at the end of every frame. Detect this condition
and simply truncate the packet to a max size Ethernet frame.

I now have no problems with networking on NetBSD inside Virtual PC 6.
 1.49  02-Nov-2003  wiz Fix some typos. From Tom Cosgrove via jmc@openbsd.
 1.48  18-Sep-2002  thorpej branches: 1.48.6;
For the 21142/21143 internal Nway, only advertise/resolve media for
which we have SROM blocks.
 1.47  09-Apr-2002  chs branches: 1.47.4;
add support for built-in NWay autonegotiation on 2114[23], Macronix
98713A, 98715, 98715A, 98725, and Lite-On 82C115.
 1.46  26-Mar-2002  chs move some prototypes from tulip.c to tulipvar.h so they can
be used by bus-specific code.
 1.45  01-May-2001  lukem branches: 1.45.2;
delint
 1.44  21-Feb-2001  jdolecek branches: 1.44.2;
make some more constant arrays 'const'
 1.43  08-Jan-2001  thorpej The ADMtek AN985 "ghosts" the single built-in PHY at every MII address.
Work around this by having a custom media init routine that limits the
search to MII address 1.
 1.42  23-Oct-2000  onoe Fixed the value of TULIPF_DBO; which was accidentaly shared with the same
value of TULIPF_BLE. Pointed out by Enami-san.
 1.41  11-Oct-2000  onoe Add flags to indicate that tlp_init() should set some more BUSMODE bits.
TULIPF_BLE /* data is big endian */
TULIPF_DBO /* descriptor is big endian */
These setting is required for Big-endian bus front-end (such as APbus for
newsmips) to work with tulip. Also,
sc_maxburst
member is added to the tulip_softc to limit the maximum burst length.
This member defaults to zero which means no restriction for burst length.
 1.40  09-Oct-2000  enami Move inclusion of rnd.h and sys/rnd.h from tulip.c to tulipvar.h.
 1.39  09-Oct-2000  enami Make tulip a random source.
 1.38  03-Oct-2000  thorpej Add support for the ADMtek AN983 and AN985.
 1.37  03-Aug-2000  castor Support some differences in the Macronix 98715AEC-C and E chips from the other
98715* series.

The MX98715AEC-[C,E] use a different location in the serial eerom for
LED control, and programming it with the original location's values
caused unpredictable behavior.

Also, start integrating fixes where media changes on an adapter
under load may fail. There's more work to be done here, but I need
to sort out our internal changes a little more carefully.
 1.36  26-May-2000  thorpej branches: 1.36.4;
Add support for the Davicom DM9102 and DM9102A 10/100 Ethernet chips.

Partially based on diffs submitted by Matthew Orgass <darkstar@pgh.net>
and IWAMOTO Toshihiro <iwamoto@sat.t.u-tokyo.ac.jp>.
 1.35  25-May-2000  thorpej So, while the DEC chips and other clones want no FS|LS in the
setup descriptor, apparently the Xircom X3201-3 requires it.
 1.34  25-May-2000  thorpej Truncate receive buffers to 4-byte boundary. Slightly modified
from kern/10198, from Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>.
 1.33  04-Apr-2000  thorpej - if_tlp_cardbus.c: Use the `pmreg' pointer passed by by
cardbus_get_capability() [mirror change already made to if_tlp_pci.c]
- if_tlp_cardbus.c: If we don't find an ISV SROM, try to grab the
Ethernet address from the CIS.
- if_tlp_cardbus.c: set CardBus cards to store-and-forward mode from
the get-go.
- Put the TxThresh tables in tulipvar.h, and use them in the CardBus
and PCI front-ends to go to store-and-forward mode.
- Document the Xircom X3201-3 clone a little more.
 1.32  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.31  19-Mar-2000  thorpej Add suspend/resume hooks to ensure that the chip doesn't scramble memory
after an APM suspend and is unsnoozed after an APM resume.
 1.30  15-Mar-2000  thorpej Add power management support to the `tlp' driver. The battery on my
laptop lasts a whole lot longer now.
 1.29  07-Mar-2000  mycroft Determine the size of the SROM by probing the chip using the standard Microwire
protocol. Eliminates the need for srom_quirks and some other trash.
 1.28  01-Feb-2000  thorpej First cut at detach support; doens't fully work yet.
 1.27  28-Jan-2000  thorpej When possible, use ring mode for descriptors. Not only is this slightly
more efficient on genuine DEC chips, but some clones apparently Lose Badly
if you use chain mode. To further complicate things, some clones *only*
do chain mode, so make this whole mess conditional.
 1.26  28-Jan-2000  thorpej Just use a regular Tx descriptor for the setup packet; don't bother with
a separate one.
 1.25  25-Jan-2000  thorpej Some changes for the Xircom X3201-3 in 21143 emulation mode:
- The Xircom doesn't bring itself out of reset; we have to do it.
- The Xircom requires transmit buffers to be aligned to 4 bytes, too.

Partially from Rafal Boni (though the Tx buffer alignment issue is
handled much differently in this version).
 1.24  25-Jan-2000  thorpej Add a chip type for the Xircom X3201-3, and centralize the declaration
of the chip names array.
 1.23  12-Dec-1999  thorpej Oops, forgot to byte-swap the receive descriptors.
 1.22  11-Dec-1999  thorpej - Don't try to run the chip in big-endian mode. Not all chips support
this consistently, and it doesn't always work even when the chip
supports it.
- Make sure things DMA'd to the chip that the chip interprets are in
little-endian mode.
 1.21  19-Nov-1999  thorpej - Use the common MII bit-bang module.
- Add support other than 128-byte SROMs.
- Add support for the 21142/21143 MII.
 1.20  04-Nov-1999  thorpej Use Memory Read Line and Memory Read Multiple on the 21140, 21140A,
21142, and 21143, if the PCI bus says its okay.
 1.19  03-Nov-1999  thorpej More or less completely rewrite the way DECchip media is handled, and
add support for the DECchip 21142/21143 SIA/SYM media. Make the Macronix
98713 behave like a 21140A, and the 98713A and later behave like a 21143.
Nuke all of the Macronix-specific Nway code, as it will be identical to
the 21143 Nway code once it is written.
 1.18  30-Sep-1999  thorpej branches: 1.18.2; 1.18.4; 1.18.8;
Changes to get the Lite-On/Macronix 82C115 working:
- 82C115 has a 128-bit multicast hash table, not 512-bit.
- Correct the way the MAC address is read from the SROM, after re-reading
the MX98715A Application Note.

Other semi-related changes:
- Differentiate between MX98715 and MX98715A.
- Improve the Macronix link-up/link-down detection.
 1.17  29-Sep-1999  thorpej Add some optional stats gathering, and fix tx stats counting; use the last
descriptor in the packet, not the first.
 1.16  29-Sep-1999  thorpej - Get a little closer on the Macronix chips. Still some more work to do.
- Add some basic support for the ADMtek AL981 clone (which, unfortunately,
I can't test until my sample boards arrive).
 1.15  28-Sep-1999  enami s/#define /#define<TAB>/.
 1.14  27-Sep-1999  thorpej Add a media name pointer to the tulip_2114x_media structure, and define
a table for converting SROM media block type codes to ifmedia subtypes.
 1.13  26-Sep-1999  thorpej Make tlp_read_srom() work on big-endian systems.

From a patch supplied by Luoqi Chen <luoqi@chekov.watermarkgroup.com>.
 1.12  25-Sep-1999  thorpej Add support for the DECchip 21140[A]. This currently only works with
boards which use MII for media attachment.

ISV SROM format information lifted from Matt Thomas's `de' driver.

Thanks to Dave Sainty for experimenting w/ his 21140A MII boards, and
for supplying a fix to the MII bit-bang code (PR #8382).
 1.11  20-Sep-1999  thorpej Add support for the DECchip 21041. This also adds some preliminary
support for the ISV SROM format used in the 2114{1,1A,2,3}. Note, like
the 21040, auto-sense is not yet supported for the 21041.

Add a "pre-init" hook, which will be used for the 2114x and PNIC (currently)
which allows chip-specific code to set up and write OPMODE before the
chip is reset. This is necessary in order for the chip's internal
pathways to get initialized properly for MII/SYM/PCS/SIA media attachments.

Thanks to Dave Sainty for the hint from the `de' driver that inspired the
pre-init hook.
 1.10  14-Sep-1999  thorpej Move the PCI device number to the base Tulip softc; it will be needed to
decode the SROM on 21041 and 2114x multi-port boards.
 1.9  14-Sep-1999  thorpej First crack at shared ROM/shared interrupts on 21040 multi-port boards,
plus quirk identification for non-multiple-port boards.
 1.8  14-Sep-1999  thorpej Change the semantics of `sc_regshift'; it is now the shift required to
make a CSR index number into a CSR offset. Introduce a couple of macros
to handle CSR name -> offset conversion.
 1.7  14-Sep-1999  thorpej - More PNIC NWAY stuff. Still more work to do, here.
- Fix the SROM checksum routine.
- Add code to parse the old DEC Address ROM SROM format.
- Rearrange the statchg routines a bit, to make them consistent with one
another.
- Add support for the DECchip 21040. XXX No support for media autosense
yet, and no support for any of the multi-port boards yet.
 1.6  09-Sep-1999  thorpej Snapshot of work-in-progress to support the internal NWay block on
the Lite-On PNIC chips. Not finished yet; some other infrastructure
work left to do.
 1.5  08-Sep-1999  thorpej Add chip types for several more Tulip clones (ASIX, ADMtex, PNIC II, Davicom),
and match the Compex RL100-ATX; it uses the Winbond 89C840F (RL100-TX is
a Macronix 98713).
 1.4  02-Sep-1999  thorpej Deal with some more Winbond differences, after a more-thorough-than-before
reading of its manual.
 1.3  01-Sep-1999  thorpej Make Tulip-style filter setup interrupt-driven.
 1.2  01-Sep-1999  thorpej Some of the Tulip clone chips (like the Winbond and ASIX) want the
IC bit set in the *first* descriptor of the outgoing packet. Appease
them.
 1.1  01-Sep-1999  thorpej This is the long-awaited "new Tulip driver", a complete, from-scratch
rewrite of the driver for the DECchip 21x4x Ethernet chips, and a variety
of clones.

Currently, the driver supports the Winbond 89C840F (this works pretty
well), and the Lite-On PNIC (e.g. NetGear PCI boards), however Lite-On
support may be broken [I may simply have a busted test board].

Eventually, support for the Macronix and ASIX chips will filter into
this driver, and then, slowly, support for the genuine DEC chips,
and maybe even the DE-425 EISA model.
 1.18.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.18.4.1  15-Nov-1999  fvdl Sync with -current
 1.18.2.3  12-Mar-2001  bouyer Sync with HEAD.
 1.18.2.2  18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.18.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.36.4.3  23-Apr-2001  he Pull up revisions 1.38,1.43 (requested by hubertf):
Support Accton EN2242 and other AmdTek AN985 compatible cards
with the tlp(4) driver.
 1.36.4.2  17-Oct-2000  tv Pullup 1.39 and 1.40 [enami]:
Make tulip a random source.
 1.36.4.1  09-Aug-2000  castor Pulling up
ic/tulipvar.h diffs between 1.36 and 1.37
ic/tulipreg.h diffs between 1.21 and 1.20
ic/ tulip.c diffs between 1.70 and 1.71
pci/if_tlp_pci.c diffs between 1.43 and 1.46

requested by tls and thorpej, approved by thorpej

> date: 2000/08/03 03:07:31; author: castor; state: Exp;
lines: +5 -1 Support some differences in the Macronix
98715AEC-C and E chips from the other 98715* series.

The MX98715AEC-[C,E] use a different location in the serial eerom for
LED control, and programming it with the original location's values
caused unpredictable behavior.

Also, start integrating fixes where media changes on an adapter
under load may fail. There's more work to be done here, but I need
to sort out our internal changes a little more carefully.
 1.44.2.4  18-Oct-2002  nathanw Catch up to -current.
 1.44.2.3  17-Apr-2002  nathanw Catch up to -current.
 1.44.2.2  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.44.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.45.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.45.2.1  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.47.4.1  28-Jul-2003  he Pull up revision 1.48 (requested by thorpej in ticket #845):
For the 21142/21143 internal Nway, only advertise/resolve media for
which we have SROM blocks. Fixes panic on DEC PWS, which only has
built-in 10BaseT media.
 1.48.6.8  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.48.6.7  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.48.6.6  06-Feb-2005  skrll Sync with HEAD.
 1.48.6.5  04-Feb-2005  skrll Sync with HEAD.
 1.48.6.4  02-Nov-2004  skrll Sync with HEAD.
 1.48.6.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.48.6.2  18-Sep-2004  skrll Sync with HEAD.
 1.48.6.1  03-Aug-2004  skrll Sync with HEAD
 1.51.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.51.6.1  12-Feb-2005  yamt sync with head.
 1.51.4.1  29-Apr-2005  kent sync with -current
 1.54.2.1  01-Jul-2005  tron Pull up revision 1.55 (requested by rpaulo in ticket #493):
Add support for ASIX AX88140A/AX88141 chipsets using only
the 10/100 MII with inspiration from FreeBSD dc(4) driver.
Tested on i386 and macppc.
Reviewed by Jason Thorpe and ok'ed by Hubert Feyrer.
 1.55.2.3  24-Mar-2008  yamt sync with head.
 1.55.2.2  17-Mar-2008  yamt sync with head.
 1.55.2.1  21-Jun-2006  yamt sync with head.
 1.57.12.1  28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.57.10.1  19-Apr-2006  elad sync with head.
 1.57.8.1  01-Apr-2006  yamt sync with head.
 1.57.6.1  22-Apr-2006  simonb Sync with head.
 1.57.4.1  09-Sep-2006  rpaulo sync with head
 1.58.58.2  02-Jun-2008  mjf Sync with HEAD.
 1.58.58.1  03-Apr-2008  mjf Sync with HEAD.
 1.58.54.1  24-Mar-2008  keiichi sync with head.
 1.58.34.1  23-Mar-2008  matt sync with HEAD
 1.60.4.2  04-May-2009  yamt sync with head.
 1.60.4.1  16-May-2008  yamt sync with head.
 1.60.2.1  18-May-2008  yamt sync with head.
 1.61.14.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.61.8.1  28-Apr-2009  skrll Sync with HEAD.
 1.65.2.2  30-Oct-2012  yamt sync with head
 1.65.2.1  17-Apr-2012  yamt sync with head
 1.66.2.1  18-Feb-2012  mrg merge to -current.
 1.68.16.1  06-Jun-2015  skrll Sync with HEAD
 1.68.2.1  03-Dec-2017  jdolecek update from HEAD
 1.69.18.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411

RSS XML Feed