Home | History | Annotate | only in /src/sys/dev/pcmcia
History log of /src/sys/dev/pcmcia
RevisionDateAuthorComments
 1.7 06-May-2001  ichiro divided into PCMCIA attachment and common code of wi.
since if_wi_ieee.h does not depend for pcmcia,
sys/dev/pcmcia/if_wi_ieee.h was moved to sys/dev/ic/wi_ieee.h .
 1.6 11-Apr-2001  jdolecek Put back all header files defining ioctls
 1.5 11-Apr-2001  jdolecek Only install headers which are actually used by our userland. This
saves about 2.2MB under /usr/include/dev/. Discussed on tech-kern@
recently.

I HOPE to get the list right. The headers I left in are ones
used for MI tools and those whose usage I discovered by grep over tree sources.
Feel free to put needed includes back in if you encounter anything which
should not be removed from lists.
 1.4 29-Nov-1999  itojun branches: 1.4.6;
improve cnw driver, looking at bsdi/freebsd-pao cnw driver by wide+prb@bsdi.
- implement ioctls compatible with bsdi/freebsd-pao. stat type is
changed from u_int to u_quad_t to avoid overflows. now it is possible
to switch domain/encryption key from the userland, using cnwctl(8).
- implement multicast/promiscuous mode. tested with IPv6.
 1.3 14-Jul-1999  sommerfeld branches: 1.3.2; 1.3.8;
Install a header needed by userspace wiconfig program
 1.2 19-Jul-1998  christos branches: 1.2.8; 1.2.10; 1.2.12;
Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.1 12-Jun-1998  cgd Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install. (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.) The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change. Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
 1.2.12.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.2.10.1 02-Aug-1999  thorpej Update from trunk.
 1.2.8.1 12-May-2000  he Pull up revision 1.3 (requested by he):
Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.
Here: install header required by wiconfig program.
 1.3.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.2.2 21-Apr-2001  bouyer Sync with HEAD
 1.3.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.4.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.2 19-Oct-2008  apb Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
 1.1 19-Jul-1998  christos branches: 1.1.146; 1.1.150; 1.1.156;
Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.1.156.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.1.150.1 04-May-2009  yamt sync with head.
 1.1.146.1 17-Jan-2009  mjf Sync with HEAD.
 1.44 01-Aug-2017  christos From bjoern johannesson, in netbsd-general... Reset the mask to 0, used to
be 0xa. Is it wrong in the cfe? Should this better be done via a quirk?
 1.43 12-Nov-2009  dyoung branches: 1.43.22; 1.43.40; 1.43.56;
Don't use the superfluous activation hook.

Cosmetic: while I'm here, join two lines.
 1.42 22-Sep-2009  tsutsui - make local functions/variables static
- use __arraycount()
 1.41 22-Sep-2009  tsutsui Split device_t/softc. Tested on AHA-1520B at ISA and ISAPnP.

XXX: ISA attachment shouldn't match cards in ISAPnP mode.
 1.40 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.39 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.38 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.37 05-Apr-2008  cegger branches: 1.37.4; 1.37.12; 1.37.14; 1.37.18;
use aprint_*_dev and device_xname
 1.36 19-Oct-2007  ad branches: 1.36.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.35 16-Nov-2006  christos branches: 1.35.2; 1.35.8; 1.35.16; 1.35.22; 1.35.24; 1.35.28;
__unused removal on arguments; approved by core.
 1.34 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.33 11-Dec-2005  christos branches: 1.33.20; 1.33.22;
merge ktrace-lwp.
 1.32 04-Feb-2005  perry branches: 1.32.4; 1.32.6; 1.32.14;
de-__P
 1.31 10-Aug-2004  mycroft branches: 1.31.4; 1.31.6;
Rather than the silly state machine, set whatever higher-level reference
count there is (for SCSI, adapt_refcnt) to 1 and call the appropriate
"delref" function afterwards to disable the controller. This is a bit
simpler.

In a couple of cases, just remove the state machine, because it wasn't
really necessary.
 1.30 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.29 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.28 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.27 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.26 10-Aug-2004  mycroft Fix a printf().
 1.25 10-Aug-2004  mycroft Update to the new world order.
 1.24 09-Aug-2004  mycroft Pass a valid alignment to pcmcia_io_alloc().
 1.23 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.22 02-Oct-2002  thorpej branches: 1.22.6;
Add trailing ; to CFATTACH_DECL.
 1.21 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.20 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.19 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.18 13-Nov-2001  lukem branches: 1.18.8;
add RCSIDs
 1.17 25-Apr-2001  bouyer branches: 1.17.2;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.16 04-Feb-2000  enami branches: 1.16.6;
Free resources on attach failure.
 1.15 04-Feb-2000  cgd replace the *_lookup table entry match/lookup functions in all of
these drivers with a single common function (which supports tables
of variable-sized structures). Things are mostly as they were before:
tables are terminated by entry with NULL name, etc. There's also
the ability to call a driver-specific match function which can be used
to augment the table lookup.
 1.14 18-Nov-1999  enami Add some comments and reformat comment which doesn't confirm KNF.
 1.13 20-Oct-1999  enami Cancel active transfers on aic/wdc detach.
Also makes LS-120 drive works for me again.
 1.12 26-Sep-1999  enami branches: 1.12.2; 1.12.4; 1.12.6;
Allow to detach aic, but turned off by default. The patchable variable
aic_dodetach controlls this.
 1.11 07-Sep-1999  soren Match 1460 names with Adaptec.
 1.10 19-Jun-1999  mjl Added NewMedia BusToaster, an Adaptec 152x compatible.
 1.9 27-Apr-1999  thorpej Disable power management until the bug that caused it to hang the
machine can be found.

Addresses kern/6488, from Thorsten Frueauf.
 1.8 20-Nov-1998  thorpej branches: 1.8.4;
Add support for power management and lazy interrupt establishment to the
PCMCIA aic6360 attachment.
 1.7 11-Oct-1998  thorpej Make the product lookup table-driven.
 1.6 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.5 09-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.4 05-Jun-1998  enami Use SIMPLEQ_FIRST/NEXT macros.
 1.3 30-Nov-1997  drochner fix argument declaration inconsistency in the
non-"__BROKEN_INDIRECT_CONFIG" case
 1.2 16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1 30-Jul-1997  marc branches: 1.1.2;
file aic_pcmcia.c was initially added on branch marc-pcmcia.
 1.1.2.13 16-Oct-1997  thorpej Copyright/license update.
 1.1.2.12 16-Oct-1997  thorpej Deal with newer APA-1460s that have a different product ID.
 1.1.2.11 16-Oct-1997  enami - Hold interrupt cookie in aic_pcmcia_softc.
- Don't put a whitespace after cast.
- Capitalize sentense in comment.
 1.1.2.10 16-Oct-1997  enami KNF.
 1.1.2.9 16-Oct-1997  enami Add RCSid.
 1.1.2.8 16-Oct-1997  enami Real aic driver for pcmcia attachment.
 1.1.2.7 15-Oct-1997  enami No need to cast a generic pointer.
 1.1.2.6 28-Aug-1997  marc Compilation fixes. This is only a stub, now, so when I flesh it out,
some more changes will certainly be needed.
 1.1.2.5 23-Aug-1997  thorpej Update for changes to pcmcia function manipulation.
 1.1.2.4 10-Aug-1997  thorpej Create a structure to encapsulate information about allocated i/o and
mem space on the pcmcia bus. Use this in chip-level window enable
functions rather than making assumptions about the bus space handles.

Also, clean up lots of debugging prints. Use patchables to enable them.
 1.1.2.3 31-Jul-1997  thorpej Remove some gratuitous debugging printfs; this information is already
displayed elsewhere.
 1.1.2.2 30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.8.4.1 27-Apr-1999  perry branches: 1.8.4.1.2;
pullup 1.8->1.9 (thorpej)
 1.8.4.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.12.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.4.1 15-Nov-1999  fvdl Sync with -current
 1.12.2.3 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.12.2.2 20-Oct-1999  thorpej Sync w/ trunk.
 1.12.2.1 19-Oct-1999  thorpej Adapt to scsipi API changes.
 1.16.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.16.6.3 20-Jun-2002  nathanw Catch up to -current.
 1.16.6.2 14-Nov-2001  nathanw Catch up to -current.
 1.16.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.17.2.3 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.17.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.17.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.18.8.1 20-Jun-2002  gehenna catch up with -current.
 1.22.6.4 04-Feb-2005  skrll Sync with HEAD.
 1.22.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.22.6.1 12-Aug-2004  skrll Sync with HEAD.
 1.31.6.1 12-Feb-2005  yamt sync with head.
 1.31.4.1 29-Apr-2005  kent sync with -current
 1.32.14.1 03-Feb-2006  riz Apply patch (requested by jnemeth in ticket #1153):
aic(4): work around rbus resource allocation problem so cards work
again. [jnemeth 20060131]
 1.32.6.2 27-Oct-2007  yamt sync with head.
 1.32.6.1 30-Dec-2006  yamt sync with head.
 1.32.4.1 03-Feb-2006  riz Apply patch (requested by jnemeth in ticket #1153):
aic(4): work around rbus resource allocation problem so cards work
again. [jnemeth 20060131]
 1.33.22.2 10-Dec-2006  yamt sync with head.
 1.33.22.1 22-Oct-2006  yamt sync with head
 1.33.20.1 18-Nov-2006  ad Sync with head.
 1.35.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.35.24.1 06-Nov-2007  matt sync with HEAD
 1.35.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.35.16.1 03-Jun-2007  wrstuden Catch up with now-somewhat-dated netbsd-4. These changes took longer
than expected for me to actually get around to merging.
 1.35.8.1 23-Oct-2007  ad Sync with head.
 1.35.2.1 16-May-2007  jdc Work around rbus resource allocation problem so cards work again using a
patch specifically for netbsd-4 (requested by jnemeth in ticket #638).
 1.36.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.37.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.37.14.1 20-Nov-2008  snj Apply patch (requested by jnemeth in ticket #80):
Work around rbus resource allocation problem so aic PCMCIA cards work.
 1.37.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.37.4.3 11-Mar-2010  yamt sync with head
 1.37.4.2 16-May-2009  yamt sync with head
 1.37.4.1 04-May-2009  yamt sync with head.
 1.43.56.1 05-Aug-2017  snj Pull up following revision(s) (requested by christos in ticket #177):
sys/dev/pcmcia/aic_pcmcia.c: revision 1.44
From bjoern johannesson, in netbsd-general... Reset the mask to 0, used to
be 0xa. Is it wrong in the cfe? Should this better be done via a quirk?
 1.43.40.1 28-Aug-2017  skrll Sync with HEAD
 1.43.22.1 03-Dec-2017  jdolecek update from HEAD
 1.1 20-Nov-2000  bouyer branches: 1.1.2;
file aic_pcmcia.c.orig was initially added on branch thorpej_scsipi.
 1.1.2.2 20-Nov-2000  bouyer Remove files that should not have been added
 1.1.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.1 20-Aug-2007  kiyohara branches: 1.1.2; 1.1.6; 1.1.8; 1.1.10;
Add support for AnyCom BlueCard.
 1.1.10.2 03-Sep-2007  jmcneill Sync with HEAD.
 1.1.10.1 20-Aug-2007  jmcneill file bluecardreg.h was added on branch jmcneill-pm on 2007-09-03 16:48:33 +0000
 1.1.8.2 03-Sep-2007  yamt sync with head.
 1.1.8.1 20-Aug-2007  yamt file bluecardreg.h was added on branch yamt-lazymbuf on 2007-09-03 14:38:02 +0000
 1.1.6.2 03-Sep-2007  skrll Sync with HEAD.
 1.1.6.1 20-Aug-2007  skrll file bluecardreg.h was added on branch nick-csl-alignment on 2007-09-03 10:21:54 +0000
 1.1.2.2 20-Aug-2007  ad Sync with head.
 1.1.2.1 20-Aug-2007  ad file bluecardreg.h was added on branch vmlocking on 2007-08-20 22:44:21 +0000
 1.24 05-Jul-2024  rin sys: Drop redundant NULL check before m_freem(9)

m_freem(9) safely has accepted NULL argument at least since 4.2BSD:
https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/sys/uipc_mbuf.c

Compile-tested on amd64/ALL.

Suggested by knakahara@
 1.23 20-May-2014  rmind branches: 1.23.66;
netbt: rename some attach/detach functions to have _pcb suffix, so
we could use standard attach/detach naming for pr_usrreq functions.
No functional change.
 1.22 14-Jan-2012  plunky branches: 1.22.6; 1.22.20;
don't behave differently when DIAGNOSTIC is defined
 1.21 24-Feb-2010  dyoung branches: 1.21.10; 1.21.14;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
 1.20 08-Jan-2010  dyoung branches: 1.20.2;
Expand PMF_FN_* macros.
 1.19 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.18 06-Apr-2008  plunky branches: 1.18.4; 1.18.18;
convert to use pmf(9) functions
 1.17 31-Mar-2008  plunky use aprint_error_dev(), for clarity
 1.16 28-Nov-2007  plunky branches: 1.16.14;
Clean up the way that bluetooth drivers attach to the bluetooth stack,
to remove the frobbing that drivers must do in the hci_unit structure.

- driver provides a static const interface descriptor
- hci_unit is allocated by hci_attach() rather than part of softc
- statistics are compiled by driver and provided on request
- driver provides output methods and is responsible for output queue
- stack provides input methods and is responsible for input queue
- mutex is used to arbitrate device queue access
 1.15 11-Nov-2007  plunky convert device printf() usages to aprint_xxxx()
 1.14 10-Nov-2007  plunky use more device_t and device_xxx() accessors

make bluetooth stack keep device_t instead of softc pointer as
device is not necessarily part of softc, and pass device_t to
driver callbacks. hci_devname is no longer required.
 1.13 03-Nov-2007  plunky branches: 1.13.2;
switch devices to using CFATTACH_DECL_NEW()
softc no longer contains 'struct device' by default
use 'device_t' instead of 'struct device *'
use device_xxx() accessor functions
remove casting of 'xxx_softc *' & 'struct device *'
use aprint_xxx_dev() routines
 1.12 19-Oct-2007  ad machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.11 02-Oct-2007  plunky branches: 1.11.2;
remove unused activate function
 1.10 23-Jul-2007  plunky branches: 1.10.4; 1.10.6; 1.10.8; 1.10.10;
add detail (in comments) about S-Record format for firmware file
 1.9 27-Dec-2006  dogcow branches: 1.9.6; 1.9.14;
fix a (valid) "buf may be used uninitialized" warning/error in DIAGNOSTIC.
 1.8 27-Dec-2006  alc CID-3821: don't leak `fh' and close the firmware properly

ok christos@
 1.7 21-Dec-2006  yamt merge yamt-splraiseipl branch.

- finish implementing splraiseipl (and makeiplcookie).
http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
- complete workqueue(9) and fix its ipl problem, which is reported
to cause audio skipping.
- fix netbt (at least compilation problems) for some ports.
- fix PR/33218.
 1.6 16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.5 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.4 24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.3 28-Aug-2006  plunky branches: 1.3.2; 1.3.4; 1.3.6;
Make suspend/resume work properly for bt3c device.

Since state is kept inside the device that will be lost, we need to
flush all information relating to this controller from the protocol
stack.
 1.2 28-Aug-2006  christos remove impossible conditional
 1.1 19-Jun-2006  gdamore branches: 1.1.2; 1.1.4; 1.1.6; 1.1.8; 1.1.10;
Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
 1.1.10.1 01-Sep-2006  tron Pull up following revision(s) (requested by plunky in ticket #80):
sys/dev/pcmcia/bt3c.c: revision 1.3
Make suspend/resume work properly for bt3c device.
Since state is kept inside the device that will be lost, we need to
flush all information relating to this controller from the protocol
stack.
 1.1.8.2 13-Jul-2006  gdamore Merge from HEAD.
 1.1.8.1 19-Jun-2006  gdamore file bt3c.c was added on branch gdamore-uart on 2006-07-13 17:49:43 +0000
 1.1.6.3 03-Sep-2006  yamt sync with head.
 1.1.6.2 26-Jun-2006  yamt sync with head.
 1.1.6.1 19-Jun-2006  yamt file bt3c.c was added on branch yamt-pdpolicy on 2006-06-26 12:52:26 +0000
 1.1.4.2 22-Jun-2006  chap Complete a sync sys/ with head.
 1.1.4.1 19-Jun-2006  chap file bt3c.c was added on branch chap-midi on 2006-06-22 03:39:49 +0000
 1.1.2.7 07-Dec-2007  yamt sync with head
 1.1.2.6 15-Nov-2007  yamt sync with head.
 1.1.2.5 27-Oct-2007  yamt sync with head.
 1.1.2.4 03-Sep-2007  yamt sync with head.
 1.1.2.3 30-Dec-2006  yamt sync with head.
 1.1.2.2 21-Jun-2006  yamt sync with head.
 1.1.2.1 19-Jun-2006  yamt file bt3c.c was added on branch yamt-lazymbuf on 2006-06-21 15:06:14 +0000
 1.3.6.3 10-Dec-2006  yamt sync with head.
 1.3.6.2 22-Oct-2006  yamt sync with head
 1.3.6.1 18-Sep-2006  yamt adapt to new api.
 1.3.4.2 09-Sep-2006  rpaulo sync with head
 1.3.4.1 28-Aug-2006  rpaulo file bt3c.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:53:55 +0000
 1.3.2.2 12-Jan-2007  ad Sync with head.
 1.3.2.1 18-Nov-2006  ad Sync with head.
 1.9.14.1 15-Aug-2007  skrll Sync with HEAD.
 1.9.6.3 23-Oct-2007  ad Sync with head.
 1.9.6.2 09-Oct-2007  ad Sync with head.
 1.9.6.1 20-Aug-2007  ad Sync with HEAD.
 1.10.10.2 23-Jul-2007  plunky add detail (in comments) about S-Record format for firmware file
 1.10.10.1 23-Jul-2007  plunky file bt3c.c was added on branch matt-mips64 on 2007-07-23 18:08:21 +0000
 1.10.8.1 06-Oct-2007  yamt sync with head.
 1.10.6.2 09-Jan-2008  matt sync with HEAD
 1.10.6.1 06-Nov-2007  matt sync with HEAD
 1.10.4.5 03-Dec-2007  joerg Sync with HEAD.
 1.10.4.4 11-Nov-2007  joerg Sync with HEAD.
 1.10.4.3 04-Nov-2007  jmcneill Sync with HEAD.
 1.10.4.2 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.10.4.1 02-Oct-2007  joerg Sync with HEAD.
 1.11.2.2 13-Nov-2007  bouyer Sync with HEAD
 1.11.2.1 25-Oct-2007  bouyer Sync with HEAD.
 1.13.2.2 08-Dec-2007  mjf Sync with HEAD.
 1.13.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.16.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.16.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.18.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.4.2 11-Mar-2010  yamt sync with head
 1.18.4.1 16-May-2009  yamt sync with head
 1.20.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.21.14.1 18-Feb-2012  mrg merge to -current.
 1.21.10.1 17-Apr-2012  yamt sync with head
 1.22.20.1 10-Aug-2014  tls Rebase.
 1.22.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.66.1 02-Aug-2025  perseant Sync with HEAD
 1.18 05-Jul-2024  rin sys: Drop redundant NULL check before m_freem(9)

m_freem(9) safely has accepted NULL argument at least since 4.2BSD:
https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/sys/uipc_mbuf.c

Compile-tested on amd64/ALL.

Suggested by knakahara@
 1.17 16-Nov-2014  ozaki-r branches: 1.17.58;
Replace callout_stop with callout_halt

In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.

Discussed with martin@ and riastradh@.
 1.16 20-May-2014  rmind branches: 1.16.2;
netbt: rename some attach/detach functions to have _pcb suffix, so
we could use standard attach/detach naming for pr_usrreq functions.
No functional change.
 1.15 24-Feb-2010  dyoung branches: 1.15.16; 1.15.20; 1.15.34;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
 1.14 08-Jan-2010  dyoung branches: 1.14.2;
Expand PMF_FN_* macros.
 1.13 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.12 06-Apr-2008  plunky branches: 1.12.4; 1.12.18;
convert to use pmf(9) functions
 1.11 28-Nov-2007  plunky branches: 1.11.14;
Clean up the way that bluetooth drivers attach to the bluetooth stack,
to remove the frobbing that drivers must do in the hci_unit structure.

- driver provides a static const interface descriptor
- hci_unit is allocated by hci_attach() rather than part of softc
- statistics are compiled by driver and provided on request
- driver provides output methods and is responsible for output queue
- stack provides input methods and is responsible for input queue
- mutex is used to arbitrate device queue access
 1.10 25-Nov-2007  kiyohara #ifndef-ed macro BTBC_DEFAULT_BAUDRATE.
 1.9 11-Nov-2007  plunky convert device printf() usages to aprint_xxxx()
 1.8 10-Nov-2007  plunky use more device_t and device_xxx() accessors

make bluetooth stack keep device_t instead of softc pointer as
device is not necessarily part of softc, and pass device_t to
driver callbacks. hci_devname is no longer required.
 1.7 03-Nov-2007  plunky branches: 1.7.2;
'struct callout' => callout_t
don't use callout_reset()
do use callout_destroy()
 1.6 03-Nov-2007  plunky switch devices to using CFATTACH_DECL_NEW()
softc no longer contains 'struct device' by default
use 'device_t' instead of 'struct device *'
use device_xxx() accessor functions
remove casting of 'xxx_softc *' & 'struct device *'
use aprint_xxx_dev() routines
 1.5 19-Oct-2007  ad machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.4 16-Oct-2007  kiyohara branches: 1.4.2;
Whenever writing once, m_adj() is called.
Do not call m_adj() by 0 when it is "rlen==m_len" and is not empty in the
buffer.
Must call m_adj().
 1.3 02-Oct-2007  plunky remove unused activate function
 1.2 03-Sep-2007  kiyohara branches: 1.2.2; 1.2.4; 1.2.6;
No need to check the NULL, m_gethdr() was called always with M_WAIT.
 1.1 20-Aug-2007  kiyohara branches: 1.1.2; 1.1.4; 1.1.6;
Add support for AnyCom BlueCard.
 1.1.6.3 10-Sep-2007  skrll Sync with HEAD.
 1.1.6.2 03-Sep-2007  skrll Sync with HEAD.
 1.1.6.1 20-Aug-2007  skrll file btbc.c was added on branch nick-csl-alignment on 2007-09-03 10:21:55 +0000
 1.1.4.2 09-Jan-2008  matt sync with HEAD
 1.1.4.1 06-Nov-2007  matt sync with HEAD
 1.1.2.4 23-Oct-2007  ad Sync with head.
 1.1.2.3 09-Oct-2007  ad Sync with head.
 1.1.2.2 20-Aug-2007  ad Sync with head.
 1.1.2.1 20-Aug-2007  ad file btbc.c was added on branch vmlocking on 2007-08-20 22:42:51 +0000
 1.2.6.2 18-Oct-2007  yamt sync with head.
 1.2.6.1 06-Oct-2007  yamt sync with head.
 1.2.4.8 03-Dec-2007  joerg Sync with HEAD.
 1.2.4.7 27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.2.4.6 11-Nov-2007  joerg Sync with HEAD.
 1.2.4.5 04-Nov-2007  jmcneill Sync with HEAD.
 1.2.4.4 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.2.4.3 02-Oct-2007  joerg Sync with HEAD.
 1.2.4.2 03-Sep-2007  jmcneill Sync with HEAD.
 1.2.4.1 03-Sep-2007  jmcneill file btbc.c was added on branch jmcneill-pm on 2007-09-03 16:48:34 +0000
 1.2.2.5 07-Dec-2007  yamt sync with head
 1.2.2.4 15-Nov-2007  yamt sync with head.
 1.2.2.3 27-Oct-2007  yamt sync with head.
 1.2.2.2 03-Sep-2007  yamt sync with head.
 1.2.2.1 03-Sep-2007  yamt file btbc.c was added on branch yamt-lazymbuf on 2007-09-03 14:38:03 +0000
 1.4.2.2 13-Nov-2007  bouyer Sync with HEAD
 1.4.2.1 25-Oct-2007  bouyer Sync with HEAD.
 1.7.2.2 08-Dec-2007  mjf Sync with HEAD.
 1.7.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.11.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.12.4.2 11-Mar-2010  yamt sync with head
 1.12.4.1 16-May-2009  yamt sync with head
 1.14.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.15.34.1 10-Aug-2014  tls Rebase.
 1.15.20.2 03-Dec-2017  jdolecek update from HEAD
 1.15.20.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.15.16.1 07-Dec-2014  martin Pull up following revision(s) (requested by ozaki-r in ticket #1201):
sys/kern/kern_ktrace.c: revision 1.166
sys/dev/isa/aps.c: revision 1.16
sys/dev/sysmon/sysmonvar.h: revision 1.45
sys/dev/ir/irframe_tty.c: revision 1.60
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.111-1.112 (patch)
sys/dev/pci/pccbb.c: revision 1.207
sys/dev/wscons/wskbd.c: revision 1.135
sys/dev/usb/ohci.c: revision 1.254
sys/net/if_ecosubr.c: revision 1.41
sys/dev/pcmcia/btbc.c: revision 1.17
sys/arch/x86/x86/via_padlock.c: revision 1.23
sys/dev/sdmmc/sdmmc.c: revision 1.23 (patch)
sys/dev/bluetooth/btkbd.c: revision 1.17
sys/dev/bluetooth/bcsp.c: revision 1.25
sys/arch/x86/pci/fwhrng.c: revision 1.8
sys/dev/ic/nslm7x.c: revision 1.61
share/man/man9/callout.9: revision 1.28 (patch)

Replace callout_stop with callout_halt and ensure the callout
is not running before destroying it.
 1.16.2.1 01-Dec-2014  martin Pull up following revision(s) (requested by ozaki-r in ticket #279):
sys/kern/kern_ktrace.c: revision 1.166
sys/dev/isa/aps.c: revision 1.16
sys/dev/sysmon/sysmonvar.h: revision 1.45
sys/dev/ir/irframe_tty.c: revision 1.60
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.111
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.112
sys/dev/pci/pccbb.c: revision 1.207
sys/dev/wscons/wskbd.c: revision 1.135
sys/dev/usb/ohci.c: revision 1.254
sys/net/if_ecosubr.c: revision 1.41
sys/dev/pcmcia/btbc.c: revision 1.17
sys/arch/x86/x86/via_padlock.c: revision 1.23
sys/dev/sdmmc/sdmmc.c: revision 1.23
sys/dev/bluetooth/btkbd.c: revision 1.17
sys/dev/bluetooth/bcsp.c: revision 1.25
sys/arch/x86/pci/fwhrng.c: revision 1.8
sys/dev/ic/nslm7x.c: revision 1.61
share/man/man9/callout.9: revision 1.28
Replace callout_stop with callout_halt
In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.
Discussed with martin@ and riastradh@.
Make it clear that we should use not callout_stop but callout_halt
before callout_destroy
Replace callout_stop with callout_halt
In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.
In this case, we need to pass an interlock to callout_halt to wait for
the callout complete.
Reviewed by riastradh@.
Kill sme_callout_mtx and use sme_mtx instead
We can use sme_mtx for the callout as well. Actually we should do so
because sme_events_list and some other data that are touched in the
callout should be protected by sme_mtx, not sme_callout_mtx.
Discussed with riastradh@ in
http://mail-index.netbsd.org/tech-kern/2014/11/11/msg017956.html
Replace callout_stop with callout_halt
In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.
In this case, we need to pass an interlock to callout_halt to wait for
the callout complete. And also we make sure that SME_CALLOUT_INITIALIZED
is unset before calling callout_halt to prevent the callout from calling
callout_schedule. This is the same as what we did in sys/netinet6/mld6.c@1.61.
Reviewed by riastradh@.
 1.17.58.1 02-Aug-2025  perseant Sync with HEAD
 1.62 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.61 23-Nov-2009  rmind branches: 1.61.62; 1.61.64;
Remove some unecessary includes sys/user.h header.
 1.60 12-Nov-2009  dyoung Call com_detach() before doing any bus-specific detachment.

Don't use com_activate(), it's going away.
 1.59 27-Aug-2008  christos pmf_register.
 1.58 28-Apr-2008  martin branches: 1.58.2; 1.58.6;
Remove clause 3 and 4 from TNF licenses
 1.57 14-Mar-2008  cube branches: 1.57.2; 1.57.4;
Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 1.56 19-Oct-2007  ad branches: 1.56.12; 1.56.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.55 22-Sep-2007  kiyohara branches: 1.55.4;
Add TDK Bluetooth PC Card.
and reorder.
 1.54 16-Nov-2006  christos branches: 1.54.8; 1.54.22; 1.54.24;
__unused removal on arguments; approved by core.
 1.53 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.52 13-Jul-2006  gdamore branches: 1.52.4; 1.52.6;
Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.51 11-Dec-2005  christos branches: 1.51.4; 1.51.8; 1.51.16;
merge ktrace-lwp.
 1.50 04-Feb-2005  perry branches: 1.50.6;
de-__P
 1.49 11-Aug-2004  mycroft branches: 1.49.4; 1.49.6;
Always use PCMCIA_WIDTH_AUTO rather than PCMCIA_WIDTH_IO16. This spec is
pretty clear on how this works.
 1.48 10-Aug-2004  mycroft Remove an extra printf().
 1.47 10-Aug-2004  mycroft Replace another home-grown matching function.
 1.46 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.45 10-Aug-2004  mycroft Copyright maintenance.
 1.44 10-Aug-2004  mycroft Use pcmcia_function_{configure,unconfigure}().
 1.43 09-Aug-2004  mycroft Make pcmcia_function_disable() primarily responsible for disabling the CCR
bits. pcmcia_intr_disestablish() continues to do this as a stopgap.
 1.42 09-Aug-2004  mycroft Do io_map() and intr_establish() before enabling the function, always. This
prevents "stray interrupts" during attach.
 1.41 09-Aug-2004  mycroft Use PCMCIA_WIDTH_AUTO, not PCMCIA_WIDTH_IO16, since we (sometimes) do 8-bit
access.
 1.40 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.39 07-Aug-2004  mycroft Clean up attach messages.
 1.38 07-Aug-2004  mycroft Clean up attach messages.
 1.37 07-Jul-2004  mycroft More cleanup:
* Print "devinfo" in a canonial place (like we do in the SCSI code).
* Use aprint_{error,normal}() during attach.
* More PCMCIA_STR_* removal.
 1.36 07-Jul-2004  mycroft More PCMCIA_STR_* elimination.
 1.35 06-Jul-2004  mycroft Fix alignment argument to pcmcia_io_alloc() to prevent a gratuitous panic,
per PR 6069.
 1.34 23-Oct-2003  uwe Add missing newline at the end of an error message.
 1.33 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.32 02-Oct-2002  thorpej branches: 1.32.6;
Add trailing ; to CFATTACH_DECL.
 1.31 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.30 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.29 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.28 13-Apr-2002  christos branches: 1.28.2;
PR/16058: Tero Kivinen: Don't attempt to free resources that we failed to
get in the attach phase.
 1.27 03-Apr-2002  christos make sure that we don't die if attach fails and we pull the card.
 1.26 10-Mar-2002  cyber _io_alloc and _io_map work in pairs, dont try to do anything with the data
until afterward the _io_map.
In some pcmcia chipsets the _io_alloc is a noop.
 1.25 24-Dec-2001  christos enable the card before trying to establish an interrupt because we need the
ccr mapped on multi-function cards.
 1.24 24-Dec-2001  christos when we disable, we first disestablish the interrupt and then the card.
when we enable, we first configure the card and then establish the interrupt.
This is so that the ccr is mapped on multifunction cards.
 1.23 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.22 13-Nov-2001  lukem add RCSIDs
 1.21 14-Aug-1999  tron branches: 1.21.14; 1.21.16;
Add support for 3Com 3CXEM556B-INT as suggested by Noriyuki KOIZUMI in
PR kern/8188.
 1.20 23-May-1999  christos KNF!
 1.19 24-Dec-1998  marc branches: 1.19.4;
The PCMCIA_PRODUCT_3COM_3CXEM556 requires the same CCR hack as the
3c562.
 1.18 20-Dec-1998  nathanw Avoid using "generic" configuration table entries during first
resource allocation attempt - would crash system if a generic entry
preceded a workable specific entry.
Rearrange a little for clarity.
 1.17 19-Nov-1998  thorpej Make the attachment messages a little prettier:

com3 at pcmcia1 function 0 port 0x2e8-0x2ef: serial device
com3: ns16550a, working fifo

I.e. don't wrap the line.
 1.16 19-Nov-1998  thorpej Add support for hot-swapping PCMCIA serial devices.
 1.15 22-Aug-1998  msaitoh Allocate an I/O according to the config table entries.
Auto assign is done only when all cfe->iospace[0].start fails.
 1.14 17-Aug-1998  nathanw Reduce com_devs[] to those devices (one!) that we need to match by CIS
string comparison. Change com_dev_match() somewhat to reflect that.
 1.13 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.12 15-Aug-1998  thorpej Don't bother with the num_memspace check. It makes some otherwise-working
cards (e.g. Xircom CM33) fail needlessly.

From Jan van Doorn <jdoorn@nc.com>, PR #5580.
 1.11 13-Aug-1998  nathanw Rototill match algorithim. New scheme:

1. Does the function claim to be a serial port?
2. Does the function's configuration table present all four
standard ISA com port ranges?
3. Is the device in our table?

New serial devices do not need to be added to the table unless they
fail both (1) and (2).
 1.10 30-Jul-1998  thorpej Add the Simple Technology Communicator 28.8.
 1.9 19-Jul-1998  christos branches: 1.9.2;
Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.8 13-Jul-1998  nathanw Add three more cards:
- USRobotics WorldPort 14.4 modem
- Mototola Personal Messenger 100c CDPD modem
- Socket Communications PageCard

Note: Most of this should be replaced with a com-port-detecting
heuristic better than the previous two.
 1.7 30-Jun-1998  augustss Add another modem card.
 1.6 23-Jun-1998  briggs Correct the order of arguments to pmatch().
 1.5 21-Jun-1998  christos Fix a variety of bogocities:
- Don't enable interrupts on attach time; we don't have to
- Don't assume that because a card has a cfe entry that matches one
of the standard com ports, is a modem; my floppy was recognized as
a modem! Require a match of the cis strings against *[Mm][Oo][Dd][Ee][Mm]*
- Print things in order so that we don't mess up the output with un-needed
newlines
- Using an array of cis identifiers to find e modem should not use the
function number; it is not reliable. For example 3c562[A-D] are different
Maybe this can go away altogether and print parts of the cis strings
 1.4 09-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.3 01-Feb-1998  marc use an array of serial devices, not a cascaded if
add power management support
 1.2 16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1 30-Jul-1997  marc branches: 1.1.2;
file com_pcmcia.c was initially added on branch marc-pcmcia.
 1.1.2.14 16-Oct-1997  thorpej Adjust for new "com" driver home.
 1.1.2.13 15-Oct-1997  thorpej Move a few bus-specific things into bus-specific softc structures and
nesting a com_softc within them.
 1.1.2.12 15-Oct-1997  enami No need to cast a generic pointer.
 1.1.2.11 14-Oct-1997  thorpej Explicitly align the allocated i/o space region to the size of the allocation.
This was previously implied, but we must explicitly specify it since some
cards may have more strict alignment requirements.
 1.1.2.10 06-Oct-1997  enami Include dev/isa/comreg.h to import the constant COM_FREQ. Initialize
sc->sc_frequency with COM_FREQ.
 1.1.2.9 13-Sep-1997  mycroft Recognize the modem portion of the IBM Home and Away card.
 1.1.2.8 23-Aug-1997  thorpej Update for changes to pcmcia function manipulation.
 1.1.2.7 10-Aug-1997  thorpej Create a structure to encapsulate information about allocated i/o and
mem space on the pcmcia bus. Use this in chip-level window enable
functions rather than making assumptions about the bus space handles.

Also, clean up lots of debugging prints. Use patchables to enable them.
 1.1.2.6 05-Aug-1997  matt Suppress spurious printf.
 1.1.2.5 02-Aug-1997  matt If the device function matches COM[1-4] then it's a good bet
that's it's a com device. This hueristic works well for my
Multitech modem.

pcmcia1: CIS version 2.0 or 2.01
pcmcia1: CIS info: Multi-Tech, MT2834LT, FAX MODEM
pcmcia1: Manufacturer code ffffffff, product ffff
pcmcia1: function 0: multi-function, ccr addr 100 mask 3
pcmcia1: function 0, config table entry 32: I/O card; irq mask 86bc; iomask b, iospace 3f8-3ff; audio
pcmcia1: function 0, config table entry 33: I/O card; irq mask 86bc; iomask b, iospace 2f8-2ff; io8 audio
pcmcia1: function 0, config table entry 34: I/O card; irq mask 86bc; iomask b, iospace 3e8-3ef; io8 audio
pcmcia1: function 0, config table entry 35: I/O card; irq mask 86bc; iomask b, iospace 2e8-2ef; io8 audio
com1 at pcmcia1 function 0: ns16550a, working fifo
 1.1.2.4 31-Jul-1997  thorpej Remove some gratuitous debugging printfs; this information is already
displayed elsewhere.
 1.1.2.3 30-Jul-1997  thorpej This file wasn't updated for the #ifndef __CGD_INDIRECT_CONFIG ->
#ifdef __BROKEN_INDIRECT_CONFIG change.
 1.1.2.2 30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.9.2.1 08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.19.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.21.16.4 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.21.16.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.21.16.2 16-Mar-2002  jdolecek Catch up with -current.
 1.21.16.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.21.14.6 18-Oct-2002  nathanw Catch up to -current.
 1.21.14.5 20-Jun-2002  nathanw Catch up to -current.
 1.21.14.4 17-Apr-2002  nathanw Catch up to -current.
 1.21.14.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.21.14.2 08-Jan-2002  nathanw Catch up to -current.
 1.21.14.1 14-Nov-2001  nathanw Catch up to -current.
 1.28.2.1 20-Jun-2002  gehenna catch up with -current.
 1.32.6.5 04-Feb-2005  skrll Sync with HEAD.
 1.32.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.32.6.2 12-Aug-2004  skrll Sync with HEAD.
 1.32.6.1 03-Aug-2004  skrll Sync with HEAD
 1.49.6.1 12-Feb-2005  yamt sync with head.
 1.49.4.1 29-Apr-2005  kent sync with -current
 1.50.6.3 17-Mar-2008  yamt sync with head.
 1.50.6.2 27-Oct-2007  yamt sync with head.
 1.50.6.1 30-Dec-2006  yamt sync with head.
 1.51.16.4 17-Jun-2006  gdamore Undo the undo. Restore COM_INIT_REGS.
 1.51.16.3 17-Jun-2006  gdamore Revert COM_INIT_REGS.
 1.51.16.2 16-Jun-2006  gdamore Remove useless prototype for undefined com_pcmcia_cleanup.
 1.51.16.1 15-Jun-2006  gdamore Adapt to new com framework.
 1.51.8.1 11-Aug-2006  yamt sync with head
 1.51.4.1 09-Sep-2006  rpaulo sync with head
 1.52.6.2 10-Dec-2006  yamt sync with head.
 1.52.6.1 22-Oct-2006  yamt sync with head
 1.52.4.1 18-Nov-2006  ad Sync with head.
 1.54.24.2 23-Mar-2008  matt sync with HEAD
 1.54.24.1 06-Nov-2007  matt sync with HEAD
 1.54.22.2 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.54.22.1 02-Oct-2007  joerg Sync with HEAD.
 1.54.8.2 23-Oct-2007  ad Sync with head.
 1.54.8.1 09-Oct-2007  ad Sync with head.
 1.55.4.1 25-Oct-2007  bouyer Sync with HEAD.
 1.56.16.3 28-Sep-2008  mjf Sync with HEAD.
 1.56.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.56.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.56.12.1 24-Mar-2008  keiichi sync with head.
 1.57.4.3 11-Mar-2010  yamt sync with head
 1.57.4.2 04-May-2009  yamt sync with head.
 1.57.4.1 16-May-2008  yamt sync with head.
 1.57.2.1 18-May-2008  yamt sync with head.
 1.58.6.1 19-Oct-2008  haad Sync with HEAD.
 1.58.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.61.64.1 10-Jun-2019  christos Sync with HEAD
 1.61.62.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.13 03-Jun-2017  christos remove my copyright.
 1.12 02-May-2008  martin branches: 1.12.44; 1.12.64;
Move TNF licenses to 2 clause form
 1.11 11-Dec-2005  christos branches: 1.11.70; 1.11.72; 1.11.74;
merge ktrace-lwp.
 1.10 27-Feb-2005  perry don't leave spaces at the end of stripped RCS Ids
 1.9 27-Feb-2005  perry nuke trailing whitespace
 1.8 10-Aug-2004  mycroft branches: 1.8.4; 1.8.6;
Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.7 15-Dec-2003  jmc Fixes from PR#23177. Various lint/logic fixes:
Fix some non-initialized variables
close the output files when done
Redo the printing for RCS strings so they don't expand in the awk script too
Do proper tests for variables existance before accessing

Verified output from all scripts is identical to original versions
 1.6 22-Oct-2003  christos Remove backslash for new gawk
 1.5 22-Oct-2003  christos support for NE2000_TYPE_AX88790 from
Yong-Jhen Hong yongjhen at alqualonde dot org
 1.4 08-Nov-2001  haya branches: 1.4.16;
Bugfix; to create compilable pcmciadevs_data.h. kern/11659
 1.3 05-Sep-1998  christos branches: 1.3.24; 1.3.26; 1.3.30;
Assign copyright to TNF.
 1.2 22-Jul-1998  christos Don't print bogus info about vendors in pcmciadevs_data.h
(Reported by John Kohl)
 1.1 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.3.30.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.3.26.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.24.1 14-Nov-2001  nathanw Catch up to -current.
 1.4.16.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.16.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.16.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.16.2 12-Aug-2004  skrll Sync with HEAD.
 1.4.16.1 03-Aug-2004  skrll Sync with HEAD
 1.8.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.4.1 29-Apr-2005  kent sync with -current
 1.11.74.1 16-May-2008  yamt sync with head.
 1.11.72.1 18-May-2008  yamt sync with head.
 1.11.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.64.1 28-Aug-2017  skrll Sync with HEAD
 1.12.44.1 03-Dec-2017  jdolecek update from HEAD
 1.25 30-Sep-2008  jmcneill Remove esl(4)
 1.24 05-May-2008  jmcneill branches: 1.24.2; 1.24.6;
Use 2-clause license.
 1.23 05-Apr-2008  cegger branches: 1.23.2; 1.23.4;
use aprint_*_dev and device_xname
 1.22 19-Oct-2007  ad branches: 1.22.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.21 16-Nov-2006  christos branches: 1.21.6; 1.21.8; 1.21.22; 1.21.24; 1.21.28;
__unused removal on arguments; approved by core.
 1.20 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.19 30-Aug-2006  christos branches: 1.19.2; 1.19.4;
fix incomplete initializer
 1.18 11-Dec-2005  christos branches: 1.18.4; 1.18.8;
merge ktrace-lwp.
 1.17 31-May-2005  drochner branches: 1.17.2;
cast-qual fallout
 1.16 24-Mar-2005  jmcneill Update my email address (the one listed hasn't been active in years).
 1.15 15-Jan-2005  kent branches: 1.15.2; 1.15.4;
ansify and KNF
 1.14 10-Jan-2005  kent merge kent-audio1 branch, which introduces audio filter pipeline to the MI
audio framework


Summary of changes:

* struct audio_params
- remove sw_code, factor, factor_denom, hw_sample_rate,
hw_encoding ,hw_precision, and hw_channels. Conversion information
is conveyed by stream_filter_list_t.
- change the type of sample_rate: u_long -> u_int
- add `validbits,' which represents the valid data size in
precision bits. It is required in order to distinguish 24/32bit
from 24/24bit or 32/32bit.

* audio_hw_if
- add two parameters to set_params()
stream_filter_list_t *pfil, stream_filter_list *rfil
A HW driver should set filter recipes for requested formats
- constify audio_params parameters of trigger_output() and
trigger_input(). They represent audio formats for the hardware.
- make open() and close() optional
- add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()

* sw_code is replaced with stream_filter_t.
stream_filer_t converts audio data in an input buffer and writes
into another output buffer unlike sw_code, which converts data in
single buffer.
converters in dev/auconv.c, dev/mulaw.c, dev/aurateconv.c,
dev/tc/bba.c, dev/ic/msm6258.c, and arch/arm/iomd/vidcaudio.c are
reimplemented as stream_filter_t

* MI audio
- audiosetinfo() builds filter pipelines from stream_filter_list_t
filled by audio_hw_if::set_params()
- audiosetinfo() returns with EINVAL if mmapped and set_params()
requests filters
- audio_write(), audio_pint(), and audio_rint() invoke a filter
pipeline.
- ioctl() for FIONREAD, AUDIO_WSEEK, AUDIO_GETIOFFS,
AUDIO_GETOOFFS, and audio_prinfo::{seek,samples} for
AUDIO_GETINFO handle values for a buffer nearest to userland.

* add `struct device *' parameter to ac97_attach()

* all of audio HW drivers follow audio_hw_if and ac97 changes
 1.13 29-Oct-2004  yamt branches: 1.13.2;
constify audio_hw_if, midi_hw_if, and radio_hw_if.
 1.12 10-Aug-2004  mycroft Whoops. This goes with the esl_pcmcia.c commit.
 1.11 17-Jul-2004  mycroft Remove sc_open; the audio layer does this.
 1.10 16-May-2003  kristerw branches: 1.10.2;
ISO C requires a statement after a label.
 1.9 25-Dec-2001  jmcneill branches: 1.9.2;
Fix block position calculation in esl_intr.
 1.8 25-Dec-2001  jmcneill The check for AUMODE_PLAY in esl_set_params was breaking some applications.
Remove it.
 1.7 25-Dec-2001  jmcneill Fixes output at 44kHz, 16-bit, stereo. Thanks to Charles Hannum and
Lennart Augustsson for providing proper fixes.
 1.6 13-Nov-2001  lukem add RCSIDs
 1.5 04-Oct-2001  hubertf branches: 1.5.2;
Add missing comma
 1.4 03-Oct-2001  augustss Add a new optional method, dev_ioctl, to the audio hardware driver interface.
It is called when an unrecognized ioctl() is performed on a device,
thus allowing ioctl()s that frob the hardware driver (like loading
microcode).
 1.3 29-Sep-2001  augustss branches: 1.3.2;
Get rid of eslreh.h and use ../isa/essreg.h.
Minor whitespace fixes.
 1.2 29-Sep-2001  augustss ANSIfy.
 1.1 29-Sep-2001  augustss Add esl driver for Eiger Labs sound card. From Jared D. McNeill
<jmcneill@invisible.yi.org>.
 1.3.2.3 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.3.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.3.2.1 29-Sep-2001  fvdl file esl.c was added on branch thorpej-devvp on 2001-10-01 12:46:07 +0000
 1.5.2.5 08-Jan-2002  nathanw Catch up to -current.
 1.5.2.4 14-Nov-2001  nathanw Catch up to -current.
 1.5.2.3 22-Oct-2001  nathanw Catch up to -current.
 1.5.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.5.2.1 04-Oct-2001  nathanw file esl.c was added on branch nathanw_sa on 2001-10-08 20:11:20 +0000
 1.9.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.9.2.1 25-Dec-2001  thorpej file esl.c was added on branch kqueue on 2002-01-10 19:57:15 +0000
 1.10.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.2.7 01-Apr-2005  skrll Sync with HEAD.
 1.10.2.6 17-Jan-2005  skrll Sync with HEAD.
 1.10.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.10.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.10.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.10.2.1 03-Aug-2004  skrll Sync with HEAD
 1.13.2.2 09-Jan-2005  kent audio_hw_if change
* make open() and close() optional
* add int (AUMODE_PLAY or AUMODE_RECORD) and audio_params_t parameters
to round_blocksize()
 1.13.2.1 03-Jan-2005  kent adopt the filter pipeline framework
 1.15.4.1 26-Mar-2005  yamt sync with head.
 1.15.2.1 29-Apr-2005  kent sync with -current
 1.17.2.2 27-Oct-2007  yamt sync with head.
 1.17.2.1 30-Dec-2006  yamt sync with head.
 1.18.8.1 03-Sep-2006  yamt sync with head.
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.19.4.2 10-Dec-2006  yamt sync with head.
 1.19.4.1 22-Oct-2006  yamt sync with head
 1.19.2.1 18-Nov-2006  ad Sync with head.
 1.21.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.21.24.1 06-Nov-2007  matt sync with HEAD
 1.21.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.21.8.1 23-Oct-2007  ad Sync with head.
 1.21.6.1 27-Feb-2007  ad Add MP locking for audio drivers.
 1.22.16.2 05-Oct-2008  mjf Sync with HEAD.
 1.22.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.23.4.2 04-May-2009  yamt sync with head.
 1.23.4.1 16-May-2008  yamt sync with head.
 1.23.2.1 18-May-2008  yamt sync with head.
 1.24.6.1 19-Oct-2008  haad Sync with HEAD.
 1.24.2.1 10-Oct-2008  skrll Sync with HEAD.
 1.21 30-Sep-2008  jmcneill Remove esl(4)
 1.20 05-May-2008  jmcneill branches: 1.20.2; 1.20.6;
Use 2-clause license.
 1.19 05-Apr-2008  cegger branches: 1.19.2; 1.19.4;
use aprint_*_dev and device_xname
 1.18 19-Oct-2007  ad branches: 1.18.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.17 16-Nov-2006  christos branches: 1.17.6; 1.17.8; 1.17.22; 1.17.24; 1.17.28;
__unused removal on arguments; approved by core.
 1.16 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.15 11-Dec-2005  christos branches: 1.15.20; 1.15.22;
merge ktrace-lwp.
 1.14 24-Mar-2005  jmcneill branches: 1.14.2;
Update my email address (the one listed hasn't been active in years).
 1.13 15-Jan-2005  kent branches: 1.13.2; 1.13.4;
ansify and KNF
 1.12 10-Aug-2004  mycroft Update to the new world order.
XXX This driver's backend should really be merged with ess.
 1.11 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.10 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.9 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.8 02-Oct-2002  thorpej branches: 1.8.6;
Add trailing ; to CFATTACH_DECL.
 1.7 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.6 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.5 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.4 13-Nov-2001  lukem branches: 1.4.2; 1.4.10;
add RCSIDs
 1.3 29-Sep-2001  augustss branches: 1.3.2; 1.3.4;
Get rid of eslreh.h and use ../isa/essreg.h.
Minor whitespace fixes.
 1.2 29-Sep-2001  augustss ANSIfy.
 1.1 29-Sep-2001  augustss Add esl driver for Eiger Labs sound card. From Jared D. McNeill
<jmcneill@invisible.yi.org>.
 1.3.4.5 18-Oct-2002  nathanw Catch up to -current.
 1.3.4.4 20-Jun-2002  nathanw Catch up to -current.
 1.3.4.3 14-Nov-2001  nathanw Catch up to -current.
 1.3.4.2 08-Oct-2001  nathanw Catch up to -current.
 1.3.4.1 29-Sep-2001  nathanw file esl_pcmcia.c was added on branch nathanw_sa on 2001-10-08 20:11:20 +0000
 1.3.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.3.2.1 29-Sep-2001  fvdl file esl_pcmcia.c was added on branch thorpej-devvp on 2001-10-01 12:46:07 +0000
 1.4.10.1 20-Jun-2002  gehenna catch up with -current.
 1.4.2.4 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.4.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 13-Nov-2001  thorpej file esl_pcmcia.c was added on branch kqueue on 2002-01-10 19:57:16 +0000
 1.8.6.5 01-Apr-2005  skrll Sync with HEAD.
 1.8.6.4 17-Jan-2005  skrll Sync with HEAD.
 1.8.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.8.6.1 12-Aug-2004  skrll Sync with HEAD.
 1.13.4.1 26-Mar-2005  yamt sync with head.
 1.13.2.1 29-Apr-2005  kent sync with -current
 1.14.2.2 27-Oct-2007  yamt sync with head.
 1.14.2.1 30-Dec-2006  yamt sync with head.
 1.15.22.2 10-Dec-2006  yamt sync with head.
 1.15.22.1 22-Oct-2006  yamt sync with head
 1.15.20.1 18-Nov-2006  ad Sync with head.
 1.17.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.17.24.1 06-Nov-2007  matt sync with HEAD
 1.17.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.17.8.1 23-Oct-2007  ad Sync with head.
 1.17.6.1 27-Feb-2007  ad Add MP locking for audio drivers.
 1.18.16.2 05-Oct-2008  mjf Sync with HEAD.
 1.18.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.19.4.2 04-May-2009  yamt sync with head.
 1.19.4.1 16-May-2008  yamt sync with head.
 1.19.2.1 18-May-2008  yamt sync with head.
 1.20.6.1 19-Oct-2008  haad Sync with HEAD.
 1.20.2.1 10-Oct-2008  skrll Sync with HEAD.
 1.2 29-Sep-2001  augustss Get rid of eslreh.h and use ../isa/essreg.h.
Minor whitespace fixes.
 1.1 29-Sep-2001  augustss Add esl driver for Eiger Labs sound card. From Jared D. McNeill
<jmcneill@invisible.yi.org>.
 1.10 30-Sep-2008  jmcneill Remove esl(4)
 1.9 05-May-2008  jmcneill branches: 1.9.2; 1.9.6;
Use 2-clause license.
 1.8 11-Dec-2005  christos branches: 1.8.28; 1.8.70; 1.8.72; 1.8.74;
merge ktrace-lwp.
 1.7 24-Mar-2005  jmcneill Update my email address (the one listed hasn't been active in years).
 1.6 15-Jan-2005  kent branches: 1.6.2; 1.6.4;
ansify and KNF
 1.5 10-Aug-2004  mycroft Whoops. This goes with the esl_pcmcia.c commit.
 1.4 17-Jul-2004  mycroft Remove sc_open; the audio layer does this.
 1.3 25-Dec-2001  jmcneill branches: 1.3.2; 1.3.18;
'nintr' from esl_softc was never used -- remove it
 1.2 29-Sep-2001  augustss branches: 1.2.2; 1.2.4;
Get rid of eslreh.h and use ../isa/essreg.h.
Minor whitespace fixes.
 1.1 29-Sep-2001  augustss Add esl driver for Eiger Labs sound card. From Jared D. McNeill
<jmcneill@invisible.yi.org>.
 1.2.4.3 08-Jan-2002  nathanw Catch up to -current.
 1.2.4.2 08-Oct-2001  nathanw Catch up to -current.
 1.2.4.1 29-Sep-2001  nathanw file eslvar.h was added on branch nathanw_sa on 2001-10-08 20:11:20 +0000
 1.2.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.2.2.1 29-Sep-2001  fvdl file eslvar.h was added on branch thorpej-devvp on 2001-10-01 12:46:08 +0000
 1.3.18.6 01-Apr-2005  skrll Sync with HEAD.
 1.3.18.5 17-Jan-2005  skrll Sync with HEAD.
 1.3.18.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.18.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.18.2 12-Aug-2004  skrll Sync with HEAD.
 1.3.18.1 03-Aug-2004  skrll Sync with HEAD
 1.3.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.3.2.1 25-Dec-2001  thorpej file eslvar.h was added on branch kqueue on 2002-01-10 19:57:16 +0000
 1.6.4.1 26-Mar-2005  yamt sync with head.
 1.6.2.1 29-Apr-2005  kent sync with -current
 1.8.74.2 04-May-2009  yamt sync with head.
 1.8.74.1 16-May-2008  yamt sync with head.
 1.8.72.1 18-May-2008  yamt sync with head.
 1.8.70.2 05-Oct-2008  mjf Sync with HEAD.
 1.8.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.8.28.1 27-Feb-2007  ad Add MP locking for audio drivers.
 1.9.6.1 19-Oct-2008  haad Sync with HEAD.
 1.9.2.1 10-Oct-2008  skrll Sync with HEAD.
 1.39 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.38 12-May-2009  cegger branches: 1.38.22; 1.38.40;
struct device * -> device_t, no functional changes intended.
 1.37 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.36 28-Apr-2008  martin branches: 1.36.8; 1.36.14;
Remove clause 3 and 4 from TNF licenses
 1.35 13-Apr-2008  tsutsui branches: 1.35.2; 1.35.4;
Split device_t/softc for MI ncr53c9x and some related devices,
with various cleanup.
 1.34 05-Apr-2008  cegger use aprint_*_dev and device_xname
 1.33 19-Oct-2007  ad branches: 1.33.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.32 09-Jul-2007  ad branches: 1.32.6; 1.32.8; 1.32.12;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.31 04-Mar-2007  christos branches: 1.31.2; 1.31.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.30 28-Dec-2006  itohy branches: 1.30.2;
Don't use esp_pcmcia_enable() before attaching chip driver (ncr53c9x),
since it touches storage allocated by the chip attach function.
The chip driver properly calls scsipi_adapter_addref() /
scsipi_adapter_delref(), and just deleting the esp_pcmcia_enable() call
and the relevant code should be OK.

Fix panic descibed in PR kern/26909.
 1.29 16-Nov-2006  christos branches: 1.29.2; 1.29.4;
__unused removal on arguments; approved by core.
 1.28 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.27 11-Dec-2005  christos branches: 1.27.20; 1.27.22;
merge ktrace-lwp.
 1.26 27-Feb-2005  perry branches: 1.26.4;
nuke trailing whitespace
 1.25 04-Feb-2005  perry de-__P
 1.24 10-Aug-2004  mycroft branches: 1.24.4; 1.24.6;
Rather than the silly state machine, set whatever higher-level reference
count there is (for SCSI, adapt_refcnt) to 1 and call the appropriate
"delref" function afterwards to disable the controller. This is a bit
simpler.

In a couple of cases, just remove the state machine, because it wasn't
really necessary.
 1.23 10-Aug-2004  mycroft Constify.
 1.22 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.21 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.20 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.19 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.18 10-Aug-2004  mycroft Update to the new world order.

XXX Note: This eliminates some register writes that were done in the "init"
routine during attach. If these are necessary, they need to do done somewhere
else, quite possibly the enable routine.
 1.17 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.16 28-Dec-2003  itohy Add support for RATOC REX-9530.
Not fully tested, though.
 1.15 12-Jan-2003  jdolecek branches: 1.15.2;
fix mistake in the attachment, which caused the device interrupt handler
to not be properly setup
fix provided in PR kern/13621 by ITOH Hideki
 1.14 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.13 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.12 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.11 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.10 13-Nov-2001  lukem branches: 1.10.8;
add RCSIDs
 1.9 25-Apr-2001  bouyer branches: 1.9.2;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.8 05-Jun-2000  tsutsui branches: 1.8.4; 1.8.6;
Well, this is esp_pcmcia, not esp_pci.
 1.7 05-Jun-2000  tsutsui Oops, struct scsipi_adapter was changed recently.
 1.6 05-Jun-2000  tsutsui Adapt MI ncr53c9x changes.
 1.5 23-Mar-2000  thorpej branches: 1.5.2;
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.4 20-Mar-2000  mycroft Oops; fix a slight biff in the PIO input routine.
 1.3 20-Mar-2000  tsutsui Cosmetics. ( 0x80 -> NCRSTAT_INT )
 1.2 20-Mar-2000  mycroft Interrupts work now. Woohoo.
 1.1 19-Mar-2000  mycroft Add esp_pcmcia. For the moment it's polled, since interrupts don't seem to be
working.
 1.5.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.8.6.5 15-Jan-2003  thorpej Sync with HEAD.
 1.8.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.8.6.3 20-Jun-2002  nathanw Catch up to -current.
 1.8.6.2 14-Nov-2001  nathanw Catch up to -current.
 1.8.6.1 21-Jun-2001  nathanw Catch up to -current.
 1.8.4.3 22-Jan-2001  bouyer fill in adapt_minphys and adapt_request
 1.8.4.2 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.8.4.1 05-Jun-2000  bouyer file esp_pcmcia.c was added on branch thorpej_scsipi on 2000-11-20 11:42:42 +0000
 1.9.2.3 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.9.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.9.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.10.8.1 20-Jun-2002  gehenna catch up with -current.
 1.15.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.15.2.5 04-Feb-2005  skrll Sync with HEAD.
 1.15.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.24.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.24.6.1 12-Feb-2005  yamt sync with head.
 1.24.4.1 29-Apr-2005  kent sync with -current
 1.26.4.3 27-Oct-2007  yamt sync with head.
 1.26.4.2 03-Sep-2007  yamt sync with head.
 1.26.4.1 30-Dec-2006  yamt sync with head.
 1.27.22.2 10-Dec-2006  yamt sync with head.
 1.27.22.1 22-Oct-2006  yamt sync with head
 1.27.20.2 12-Jan-2007  ad Sync with head.
 1.27.20.1 18-Nov-2006  ad Sync with head.
 1.29.4.1 03-Jun-2008  skrll Sync with netbsd-4.
 1.29.2.1 19-Apr-2008  bouyer Pull up following revision(s) (requested by itohy in ticket #1130):
sys/dev/pcmcia/esp_pcmcia.c: revision 1.30
Fix kernel panics on attach. Fix kern/34537 (and part of kern/26909).
 1.30.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.31.4.1 11-Jul-2007  mjf Sync with head.
 1.31.2.2 23-Oct-2007  ad Sync with head.
 1.31.2.1 01-Jul-2007  ad Adapt to callout API change.
 1.32.12.1 25-Oct-2007  bouyer Sync with HEAD.
 1.32.8.1 06-Nov-2007  matt sync with HEAD
 1.32.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.33.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.35.4.3 16-May-2009  yamt sync with head
 1.35.4.2 04-May-2009  yamt sync with head.
 1.35.4.1 16-May-2008  yamt sync with head.
 1.35.2.1 18-May-2008  yamt sync with head.
 1.36.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.36.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.38.40.1 09-Jul-2016  skrll Sync with HEAD
 1.38.22.1 03-Dec-2017  jdolecek update from HEAD
 1.23 08-Dec-2021  andvar fix various typos in comments and log messages.
 1.22 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.21 24-Apr-2021  thorpej branches: 1.21.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.20 28-Apr-2008  martin branches: 1.20.104;
Remove clause 3 and 4 from TNF licenses
 1.19 16-Mar-2008  cube branches: 1.19.2; 1.19.4;
Split device_t and softc for the ... wait for it ... [air quotes] MI
variant of fdc(4)/fd(4). Other cosmetic changes as appropriate.
 1.18 19-Oct-2007  ad branches: 1.18.12; 1.18.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.17 11-Dec-2005  christos branches: 1.17.30; 1.17.44; 1.17.46; 1.17.50;
merge ktrace-lwp.
 1.16 27-Feb-2005  perry branches: 1.16.4;
nuke trailing whitespace
 1.15 04-Feb-2005  perry de-__P
 1.14 10-Aug-2004  mycroft branches: 1.14.4; 1.14.6;
This code was pretty far from even compiling before. It also doesn't implement
detach support. However, update other parts of it.
 1.13 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.12 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.11 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.10 02-Oct-2002  thorpej branches: 1.10.6;
Add trailing ; to CFATTACH_DECL.
 1.9 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.8 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.7 06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.6 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.5 13-Nov-2001  lukem branches: 1.5.8;
add RCSIDs
 1.4 19-Mar-1999  christos branches: 1.4.20; 1.4.22;
Add FDC_HEADSETTLE to wait for the heads to settle timeout
 1.3 05-Sep-1998  christos Assign copyright to TNF.
 1.2 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.1 21-Jun-1998  christos Add pcmcia floppy front end.
XXX: We need to make an isa machine independent floppy driver...
 1.4.22.3 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.4.22.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.22.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.20.4 18-Oct-2002  nathanw Catch up to -current.
 1.4.20.3 17-Sep-2002  nathanw Catch up to -current.
 1.4.20.2 20-Jun-2002  nathanw Catch up to -current.
 1.4.20.1 14-Nov-2001  nathanw Catch up to -current.
 1.5.8.2 20-Jun-2002  gehenna catch up with -current.
 1.5.8.1 16-May-2002  gehenna Remove unnecessary header.
 1.10.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.10.6.4 04-Feb-2005  skrll Sync with HEAD.
 1.10.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.10.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.10.6.1 12-Aug-2004  skrll Sync with HEAD.
 1.14.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.14.6.1 12-Feb-2005  yamt sync with head.
 1.14.4.1 29-Apr-2005  kent sync with -current
 1.16.4.2 17-Mar-2008  yamt sync with head.
 1.16.4.1 27-Oct-2007  yamt sync with head.
 1.17.50.1 25-Oct-2007  bouyer Sync with HEAD.
 1.17.46.2 23-Mar-2008  matt sync with HEAD
 1.17.46.1 06-Nov-2007  matt sync with HEAD
 1.17.44.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.17.30.1 23-Oct-2007  ad Sync with head.
 1.18.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.18.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.18.12.1 24-Mar-2008  keiichi sync with head.
 1.19.4.1 16-May-2008  yamt sync with head.
 1.19.2.1 18-May-2008  yamt sync with head.
 1.20.104.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.21.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.60 19-Jan-2020  thorpej Remove Token Ring support.
 1.59 22-Sep-2018  maxv branches: 1.59.6;
Remove isic(4). It is part of ISDN, which we are now retiring.
 1.58 25-Aug-2012  kiyohara branches: 1.58.38; 1.58.40; 1.58.42;
Add malo@pcmcia.
 1.57 30-Sep-2008  jmcneill branches: 1.57.28;
Remove esl(4)
 1.56 20-Aug-2007  kiyohara branches: 1.56.22; 1.56.26; 1.56.28; 1.56.32;
Add support for AnyCom BlueCard.
 1.55 15-Aug-2007  kiyohara Replace to Matthew Orgass's slhci(4).
http://mail-index.netbsd.org/tech-kern/2007/06/26/0001.html
 1.54 09-Jan-2007  cube branches: 1.54.6; 1.54.14; 1.54.16; 1.54.20;
Remove stale config(5) entries for unexistent wl(4).

Ok'd by matt@.
 1.53 25-Nov-2006  dsl Make the inclusion of the spectrum24t firmware a config option, default
to enabled.
 1.52 24-Oct-2006  drochner kill the "irq" llocator for pcmcia - this doesn't make sense because
irq mapping is done by the controller, and it is not used anywhere afaict
 1.51 10-Sep-2006  plunky branches: 1.51.2;
update to bluetooth device attachment:

remove pseudo-device btdev(4) and inherent limitations

add bthub(4) which autoconfigures at bluetooth controllers as they
are enabled. bluetooth devices now attach here.

btdevctl(8) and its cache is updated to handle new semantics

etc/rc.d/btdevctl is updated to configure devices from a list
in /etc/bluetooth/btdevctl.conf
 1.50 21-Jun-2006  drochner branches: 1.50.2; 1.50.4;
make some bluetooth devices just devices, not interface attributes
 1.49 19-Jun-2006  gdamore Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
 1.48 26-Apr-2006  rpaulo branches: 1.48.2; 1.48.4;
Comment out wl.
 1.47 11-Dec-2005  christos branches: 1.47.4; 1.47.6; 1.47.8; 1.47.10; 1.47.12;
merge ktrace-lwp.
 1.46 08-Aug-2004  mycroft branches: 1.46.12;
Split "xi" into a "xirc" frontend (similar to mhzc; it attaches two child
devices) and a "xi" backend.

My CE2 and CEM2 cards are now probed correctly. However, there are still
some problems with one model of the CE2, and the CEM2 doesn't seem to get
any modem interrupts.

While I'm at it, fix several bugs:

* The tuple scan for the MAC address was broken in multiple ways.
* xi_intr() did not deal well with a shared interrupt.
* We were setting the wrong page number to look at the receive status. (How
did this work???)
* Remove the xi_full_reset() from xi_reset(). Move the parts of
xi_full_reset() needed to undo the effect of xi_stop() into xi_init(). This
allows a stop/init pair to DTRT, and much quicker, as used by various
ioctl()s.
* Set the TRS register before reading the TSO register, as the Linux driver
does. While I'm at it, fix the name.
* Fix numerous problems with xi_set_address(). "Where do I begin?" There's a
chance that multicast works now, but I haven't tested it.
* Explicitly clear the MSR register, and also force SELECT_MII to 0 if we
didn't find any PHYs.
* Clean up some cruft that appears to be bogus.

Probably needs more work, but it's a start.
 1.45 07-Jul-2004  mycroft Add a quick-and-dirty attachment for my MB87030-based PCMCIA SCSI controller.
XXX Don't even think about detaching it yet.
 1.44 22-Apr-2002  augustss branches: 1.44.10;
Rename the audio "bus" attribute audiobus to avoid confusion with audio
device.
 1.43 28-Nov-2001  lukem - convert usage of "defopt" to "defflag" where the relevant option does
not support a value (e.g., it's to be used as "options FOO" instead of
"options FOO=xxx"). options that take a value were converted to
defparam recently.
- minor whitespace & formatting cleanups
 1.42 26-Nov-2001  yamt remove "stg", that I accidentally commited.
thanks, Tsutsui-san.
 1.41 26-Nov-2001  yamt add pcmcia frontend for cs driver.
 1.40 29-Sep-2001  augustss Add the esl driver.
 1.39 04-Aug-2001  enami branches: 1.39.2;
MII access routines for ASIX AX88190.
 1.38 06-May-2001  ichiro branches: 1.38.2;
divided into PCMCIA attachment and common code of wi.
since if_wi_ieee.h does not depend for pcmcia,
sys/dev/pcmcia/if_wi_ieee.h was moved to sys/dev/ic/wi_ieee.h .
 1.37 24-Feb-2001  lukem branches: 1.37.2;
whitespace police
 1.36 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.35 17-Feb-2001  martin Rename pcmcia_isic.[ch] to i4b_isic_pcmcia.[ch] to better fit in the
grand sheme of names.
 1.34 13-Feb-2001  thorpej Oops, `mii' attribute has to go onto the device decl.
 1.33 13-Feb-2001  thorpej ne at pcmcia needs dl10019, mii, mii_bitbang
 1.32 18-Jan-2001  martin Add support for another PCMCIA ISDN card: Sedlbauer speed star II.
While there fix two outdated comments.
 1.31 05-Jan-2001  martin Enable the imported ISDN4BSD based ISDN subsystem.

This is the kernel part (userland to follow soon) of the latest (and
very probably last) release (version 0.96) of ISDN4BSD. ISDN4BSD has a
homepage at http://www.freebsd-support.de/i4b/.

It gives the user various ways to use the isdn connection: raw data (via
the i4brbch "raw b-channel" device), ppp (via the isp "isdn PPP" device),
voice/answering machine (the i4btel "telephone" device) and ip over isdn
(the ipr device, "IP over raw ISDN").

Supported are a bunch of common and older cards, more to be added soon
after some cleanup. Currently only the european E-DSS1 variant of the
ISDN D channel protocol is supported.
 1.30 11-Dec-2000  onoe Port 'an' driver for Aironet PC4500/PC4800 IEEE802.11 card from FreeBSD.
This is very adhoc work for IETF meeting.
- Since it seems that 'an' and 'wi' have similar hardware, low level
functions should be shared.
- There are PCI/ISA cards of Aironet but not supported yet.
- The wiconfig interface is changed so that wiconfig cannot be used.
- 'ancontrol' of FreeBSD is not ported.
- Only infrastructure mode is tested.
- WEP is not supported.

Though I only have an Aironet card, Cisco card should be expected to work.
 1.29 04-Jul-2000  onoe Support WEP functions for awi driver.
arc4 implementation by Kalle Kaukonen has been added.
define "wlan" in files.
XXX: only awi depends on wlan for now.
Allow authentication for adhoc (IBSS) mode.
Disable adhoc mode without bssid (mediaopt adhoc,flag0) for FH radio.
FH cannot work without synchronization by beacons.
Align IP header for ethernet encapsulation (IFF_FLAG0) mode.
Print available access points for IFF_DEBUG.
 1.28 09-Jun-2000  onoe branches: 1.28.2;
cleanup haeders.
add opt_awi.h to define AWI_DEBUG, AWI_WEP_ARC4.
show the firmware version at attach.
create a framework to support WEP (encryption code is not included for now).
a new wiconfig compatible ioctl interface replaced the awictl interface.
fix memory leak in selecting AP
fix bugs in ESSID selection
changes from FreeBSD-current by Warner Losh:
revision 1.2
date: 2000/04/17 22:58:15; author: imp; state: Exp; lines: +16 -1
Provide mem* for compat with NetBSD to fix LINT
fixes from FreeBSD-current by Guido van Rooij:
revision 1.4
date: 2000/05/29 19:58:10; author: guido; state: Exp; lines: +5 -2
Fix a panic resulting from an obvious null pointer deref.
Apparently some other panics still exist in this driver, but with
this fix, it was at least possible to run the Nokia card at SANE 2000.
 1.27 06-Jun-2000  soren One comment too much..
 1.26 06-Jun-2000  soren Add comments for a few drivers and the lines for the Tropic attachment.
 1.25 05-Jun-2000  gmcgarry New driver for Xircom CreditCard PCMCIA Ethernet. Replaces xe driver which
didn't work. Renamed to avoid clash with next68k network driver.
 1.24 19-Mar-2000  mycroft branches: 1.24.2;
Add esp_pcmcia. For the moment it's polled, since interrupts don't seem to be
working.
 1.23 18-Mar-2000  mycroft Preliminary support for 53c40x-based cards. Needs some more work.
 1.22 23-Jan-2000  chopps add driver for raylink/aviator wireless 802.11 FH 2Mbps cards, currently only
tested with aviator 2.4
 1.21 18-Jan-2000  jtk add mii attribute to xe. (Needed to make PHY attachment work.)
 1.20 09-Jan-2000  joda xe@pcmcia
 1.19 04-Nov-1999  sommerfeld Driver front-end for BayStack 650 PCMCIA 802.11 card.
Committed using the driver.
 1.18 29-Oct-1999  matt Add a placeholder for the ISA WaveLAN card
 1.17 28-Sep-1999  thorpej branches: 1.17.2; 1.17.4; 1.17.6;
Add a driver for the Megahertz Ethernet/Modem combo cards, e.g. XJEM3336.
This supplies an attachment of the `sm' and `com' drivers.

Thanks to Chuck Cranor for sifting through the Linux smc91c92_cs.c driver
to find the magic sequence that brings the Ethernet portion of the card
on-line!
 1.16 21-Sep-1999  enami fold long line and kill empty line at the end of file.
 1.15 14-Jul-1999  sommerfeld Blitz port of the FreeBSD wi* driver for the Lucent WaveLan IEEE
PCMCIA wireless LAN.
Original driver written by Bill Paul <wpaul@ctr.columbia.edu>
 1.14 01-Jan-1999  christos branches: 1.14.2; 1.14.4; 1.14.6;
Add Xircom Netwave driver from Michael Eriksson
 1.13 24-Dec-1998  marc add quirk support for cards which lie extensively about their CIS
 1.12 26-Nov-1998  pk Use `pcmciabus' as the PCMCIA attachment
 1.11 31-Oct-1998  thorpej Add code to detect a RealTek 8019 chip, and use the media selection
support if present.
 1.10 10-Oct-1998  thorpej Device driver for PCMCIA multi-port serial cards. Currently supports
the Socket Communications, Inc. dual-rs232 device.
 1.9 21-Jun-1998  christos Add pcmcia floppy front end.
XXX: We need to make an isa machine independent floppy driver...
 1.8 22-Mar-1998  enami Attach device `mbe' at bus `pcmcia'.
 1.7 16-Feb-1998  thorpej Remove "class" declarations, and add "devclass" declarations where
appropriate. Fix several inconsistencies between device class and
attributes. Mostly from Chris Demetriou.
 1.6 23-Jan-1998  mycroft Uncomment wdc.
 1.5 12-Jan-1998  thorpej Update for changes to config.
 1.4 18-Oct-1997  mikel RCSid police
 1.3 17-Oct-1997  sommerfe conditionalize so core pcmcia bus support is omitted if no pcmcia devices configured
 1.2 16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1 30-Jul-1997  marc branches: 1.1.2;
file files.pcmcia was initially added on branch marc-pcmcia.
 1.1.2.10 16-Oct-1997  enami Attach aic at pcmcia.
 1.1.2.9 15-Oct-1997  enami defopt PCMCIAVERBOSE.
 1.1.2.8 14-Oct-1997  thorpej Split off NE2000 support from the ISA "ed" driver, and create a new "ne"
driver that deals with NE2000s and compatibles on ISA, PCI, and PCMCIA
busses.

This driver uses the generic DP8390 core chipset back-end.

NOTE: There are several changes between this driver and the old "ed"
front-end for PCMCIA. Notably, the i/o space allocation strategy has
been changed somewhat to allow this to work with odd host pcmcia bridges.
 1.1.2.7 28-Aug-1997  marc move "attach pcmcia at pcic" here.
 1.1.2.6 11-Aug-1997  thorpej Add a PCMCIA attachment for the smc91cxx ethernet driver ("sm"), written
from scratch by me. Currently supports the Megahertz X-JACK PCMCIA Ethernet
Adapter.
 1.1.2.5 11-Aug-1997  thorpej Comment out an entry for the Megahertz X-JACK Ethernet interface that I
accidentally in last commit.
 1.1.2.4 10-Aug-1997  thorpej Create a structure to encapsulate information about allocated i/o and
mem space on the pcmcia bus. Use this in chip-level window enable
functions rather than making assumptions about the bus space handles.

Also, clean up lots of debugging prints. Use patchables to enable them.
 1.1.2.3 02-Aug-1997  matt Add entry (but not driver, yet) for Digital RoamAbout card. Add commented
out entry for wdc device (which will enable the Digital Mobile Media CDROM.
 1.1.2.2 30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.14.6.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.14.4.1 02-Aug-1999  thorpej Update from trunk.
 1.14.2.1 11-May-2000  he Pull up revision 1.15 (requested by jhawk):
Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.
 1.17.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.17.4.1 15-Nov-1999  fvdl Sync with -current
 1.17.2.5 12-Mar-2001  bouyer Sync with HEAD.
 1.17.2.4 11-Feb-2001  bouyer Sync with HEAD.
 1.17.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.17.2.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.17.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.24.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.28.2.2 12-Dec-2000  he Pull up revision 1.30 (requested by he):
Add a driver for an(4), Aironet and Cisco wireless pcmcia cards.
 1.28.2.1 14-Jul-2000  onoe Pull up revision 1.29 (approved by thorpej)
Add WEP support for awi driver.
 1.37.2.5 20-Jun-2002  nathanw Catch up to -current.
 1.37.2.4 08-Jan-2002  nathanw Catch up to -current.
 1.37.2.3 08-Oct-2001  nathanw Catch up to -current.
 1.37.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.37.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.38.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.38.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.38.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.39.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.44.10.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.44.10.3 18-Sep-2004  skrll Sync with HEAD.
 1.44.10.2 12-Aug-2004  skrll Sync with HEAD.
 1.44.10.1 03-Aug-2004  skrll Sync with HEAD
 1.46.12.4 03-Sep-2007  yamt sync with head.
 1.46.12.3 26-Feb-2007  yamt sync with head.
 1.46.12.2 30-Dec-2006  yamt sync with head.
 1.46.12.1 21-Jun-2006  yamt sync with head.
 1.47.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.47.10.1 11-May-2006  elad sync with head
 1.47.8.3 14-Sep-2006  yamt sync with head.
 1.47.8.2 26-Jun-2006  yamt sync with head.
 1.47.8.1 24-May-2006  yamt sync with head.
 1.47.6.1 01-Jun-2006  kardel Sync with head.
 1.47.4.1 09-Sep-2006  rpaulo sync with head
 1.48.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.48.2.1 22-Jun-2006  chap Complete a sync sys/ with head.
 1.50.4.2 12-Jan-2007  ad Sync with head.
 1.50.4.1 18-Nov-2006  ad Sync with head.
 1.50.2.1 14-Sep-2006  riz Pull up following revision(s) (requested by plunky in ticket #161):
sys/dev/bluetooth/btdev.h: revision 1.4
distrib/sets/lists/comp/mi: revision 1.922
usr.sbin/postinstall/postinstall: revision 1.25
sys/netbt/hci_unit.c: revision 1.3
sys/netbt/hci_ioctl.c: revision 1.4
usr.sbin/sdpd/profile.c: revision 1.2
usr.sbin/btdevctl/btdevctl.c: revision 1.2
share/man/man4/Makefile: revision 1.405
distrib/sets/lists/man/mi: revision 1.930
distrib/sets/lists/etc/mi: revision 1.176
usr.sbin/sdpd/profile.c: revision 1.3
usr.sbin/btdevctl/btdevctl.c: revision 1.3
etc/MAKEDEV.tmpl: revision 1.62
distrib/sets/lists/base/mi: revision 1.650
usr.sbin/btdevctl/btdevctl.h: revision 1.2
usr.bin/sdpquery/sdpquery.1: revision 1.4
sys/netbt/rfcomm_session.c: revision 1.2
usr.sbin/btdevctl/btdevctl.8: revision 1.3
usr.bin/sdpquery/search.c: revision 1.2
usr.sbin/sdpd/Makefile: revision 1.2
sys/dev/bluetooth/Makefile: revision 1.3
usr.sbin/btdevctl/cfg.c: file removal
sys/netbt/files.netbt: revision 1.4
usr.sbin/btdevctl/sdp.c: revision 1.1
sys/dev/bluetooth/bthidev.c: revision 1.3
etc/bluetooth/Makefile: revision 1.3
sys/dev/pcmcia/files.pcmcia: revision 1.51
sys/dev/bluetooth/bthidev.c: revision 1.4
sys/dev/bluetooth/bthidev.h: revision 1.3
usr.sbin/btdevctl/dev.c: file removal
sys/dev/bluetooth/files.bluetooth: revision 1.10
sys/arch/i386/conf/GENERIC: revision 1.777
share/man/man4/ubt.4: revision 1.6
share/man/man4/bthub.4: revision 1.3
sys/netbt/hci.h: revision 1.5
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.202
lib/libsdp/sdp.h: revision 1.2
usr.sbin/btdevctl/print.c: revision 1.1
share/man/man4/bthidev.4: revision 1.5
share/man/man4/btdev.4: file removal
usr.sbin/btdevctl/print.c: revision 1.2
sys/arch/i386/conf/GENERIC_LAPTOP: revision 1.205
usr.sbin/btdevctl/Makefile: revision 1.2
sys/dev/usb/files.usb: revision 1.70
sys/netbt/l2cap_signal.c: revision 1.2
sys/netbt/hci_link.c: revision 1.4
sys/dev/bluetooth/bthub.c: revision 1.3
share/man/man4/btsco.4: revision 1.5
sys/netbt/hci_link.c: revision 1.5
share/man/man4/btdev.4: revision 1.4
sys/dev/bluetooth/btkbd.c: revision 1.3
sys/dev/bluetooth/btdev.c: file removal
sys/netbt/hci_event.c: revision 1.2
sys/dev/bluetooth/btsco.h: revision 1.2
etc/mtree/special: revision 1.101
sys/dev/bluetooth/btsco.c: revision 1.3
sys/conf/majors: revision 1.27
usr.sbin/sdpd/hf.c: revision 1.1
sys/dev/bluetooth/btsco.c: revision 1.4
share/man/man5/rc.conf.5: revision 1.107
sys/dev/bluetooth/btdev.c: revision 1.2
etc/rc.d/btdevctl: revision 1.2
usr.sbin/btdevctl/db.c: revision 1.1
etc/rc.d/btdevctl: revision 1.3
etc/bluetooth/btdevctl.conf: revision 1.1
usr.sbin/btdevctl/hid.c: file removal
sys/arch/i386/conf/GENERIC: revision 1.781
sys/dev/bluetooth/btdev.h: revision 1.3
Make btdev default count explicit
Fix typo in variable name
update to bluetooth device attachment:
remove pseudo-device btdev(4) and inherent limitations
add bthub(4) which autoconfigures at bluetooth controllers as they
are enabled. bluetooth devices now attach here.
btdevctl(8) and its cache is updated to handle new semantics
etc/rc.d/btdevctl is updated to configure devices from a list
in /etc/bluetooth/btdevctl.conf
also include service name in dictionary being sent to kernel.
(this is not used just yet, but it might be in the future and it will
be easier if we dont have to provide code to handle its absence)
clarify the CAVEAT section somewhat
Add service discovery support for the Handsfree profile
Replace static 'FreeBSD' string with operating system name gleaned
from uname(3)
Halt the callout on detach
btsco.c:
- sco_getopt(..., SO_SCO_MTU, ...) expects the address of a uint16_t,
not an int. So change sc_mtu's type to uint16_t.
- Try a little harder to ensure btsco_round_blocksize() does not
return zero. Prevents a subsequent panic in audio_init_ringbuffer().
from scw@
Endian issues:
hci_event.c:
- Convert memo->response.clock_offset to host-endian.
hci_ioctl.c:
- printf format tweak (size_t)
hci_link.c:
- Convert memo->response.clock_offset from host-endian.
- Tweak a DIAGNOSTIC message.
l2cap_signal.c:
- In l2cap_recv_config_req(), rp->scid is little-endian so make sure
we convert from host-endian.
from scw@
hci_link.c:
- In hci_link_free(), do not unlink items from a LIST queue within
a LIST_FOREACH() iterator.
rfcomm_session.c:
- In rfcomm_session_recv_mcc_nsc(), do not unlink items from a LIST
queue within a LIST_FOREACH() iterator.
from scw@
guard against a possible situation where the list of l2cap channels is changed
when the bluetooth code is not expecting it to be. During a disconnect, we can
detach the channel that is being disconnected, but its not really safe to detach
any others.
Print explicit 64-bit types using the format macros from int_fmtio.h.
Unbreaks the build for our LP64 ports, where "long long" typically is
not 64 bits.
 1.51.2.1 10-Dec-2006  yamt sync with head.
 1.54.20.2 03-Sep-2007  jmcneill Sync with HEAD.
 1.54.20.1 16-Aug-2007  jmcneill Sync with HEAD.
 1.54.16.2 03-Sep-2007  skrll Sync with HEAD.
 1.54.16.1 15-Aug-2007  skrll Sync with HEAD.
 1.54.14.1 22-May-2007  itohy Overhaul of USB stack, mostly DMA related

This applies to NetBSD 4.99.13 (March 1, 2007)

usbdi(9) interface is based on FreeBSD version, excluding
- removal of portability code

Patch most NetBSD changes, excluding
- DMA memory "reserve", since we don't need contiguous buffers any longer
- volatiles in DMA structure, since it should not be needed
with proper bus_dmamap_sync(9)s

DMA/non-DMA memory management overhaul
- Move all DMA related code to usb_mem.[ch]
(add usb_alloc_buffer_dma(), usb_free_buffer_dma(), etc.).
XXX Should usb_mem.[ch] be renamed as usb_mem_dma.[ch] ?
- Add corresponding non-DMA code to usb_mem_nodma.[ch] .
Currently just use malloc(9).
- Above files are conditionally used by config framework (added
attributes to conf/files and dev/usb/files.usb).
- Add diagnostic panics when resource allocation is requested
on interrupt context.
- Change memory allocations (that require context) from NOWAIT to WAITOK.

Allocate DMA/non-DMA buffer per host interface, not globally.
advantage: Buffers can be freed on detaching host interface.
Activity of a host interface does not affect others.
disadvantages: It possibly consumes more memory.

API changes
- usbd_alloc_xfer() is changed:
old: usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev);
new: usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev,
usbd_pipe_handle pipe);
- pipe argument of usbd_setup_*xfer() are now unused
XXX the pipe argument should be removed?
- add mapping APIs
- async request will be processed as a task (kernel thread context),
and delayed to some extent
- usbdivar.h: struct usbd_xfer: renamed a member "allocbuf" to "hcbuffer"
(mapped/allocated/refered buffer for HCI driver)
- usb_port.h: change usb_proc_ptr from struct ptoc * to struct lwp *
- usb_port.h: add usb_sigproc_ptr for psignal(9) (struct proc *)
- usb.h: add UE_MAXPKTSZ(ep) and UE_MAXPKTSZ_MASK macros for USB 2.0

changes to USB device drivers
- atu, aue, axe, cdce, cue, kue, rum, udav, upl, ural, url,
uaudio, ubt, ucom, ugen, uhidev, uirda, ulpt, umidi, urio,
uscanner, ustir, utoppy:
* catch up API change of usbd_alloc_xfer()
- umass, usscanner:
* catch up API change of usbd_alloc_xfer()
* eliminate memory copy for large transfer

ohci
- free resources on detach
- add lots of bus_dmamap_sync() operations
- simplify the code of loading std chain
- rewrite code of looking up TD/ITD from DMA addr by using allocation chunk
- add workaround for CMD Tech 670 and 673 chipsets
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf

slhci
- allocate xfer and slhci_xfer at once, and simplify relevant code
- add slhci_detach()
- remove second arg of slhci_attach() since it is the same as the first arg.
- add support for "mapping" (no, it doesn't map since it doesn't do DMA)
buffer and mbuf
- add pcmcia frontend
- NOT TESTED, missing hardware

ehci
- add lots of bus_dmamap_sync() operations, possibly too many
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf
- done only simple test

uhci
- add lots of bus_dmamap_sync() operations, possibly too many
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf

To do
- review, test, debug
- rewrite network drivers to utilize usbd_map_buffer_mbuf()
- rewrite uaudio(4) to eliminate memcpy
- "pipe" argument of usbd_setup_*xfer() should eventually be removed
 1.54.6.1 20-Aug-2007  ad Sync with HEAD.
 1.56.32.1 19-Oct-2008  haad Sync with HEAD.
 1.56.28.1 10-Oct-2008  skrll Sync with HEAD.
 1.56.26.1 04-May-2009  yamt sync with head.
 1.56.22.1 05-Oct-2008  mjf Sync with HEAD.
 1.57.28.1 30-Oct-2012  yamt sync with head
 1.58.42.1 24-Sep-2018  jdolecek partial HEAD sync - ISDN device removal
 1.58.40.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.58.40.1 10-Jun-2019  christos Sync with HEAD
 1.58.38.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.59.6.1 25-Jan-2020  ad Sync with head.
 1.4 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.3 17-Feb-2001  martin Rename pcmcia_isic.[ch] to i4b_isic_pcmcia.[ch] to better fit in the
grand sheme of names.
 1.2 17-Feb-2001  martin Abort attach when failing to allocate io range.
Don't allocate one large io range, this fails about every time on real
pcmcia buses (not attached to pci/cardbus bridges) because of other
devices interfering in that range. Use the bogusly small region for
now, which works purely by chance (map granularity) on cardbus bridges
too (more or less).
XXX - make this map three different, small regions after layer1 <-> layer2
XXX interface has been brought in shape.
 1.1 05-Jan-2001  martin branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jan-2001  martin branches: 1.1.1.1.2;
Initial import of ISDN4BSD release 0.96
 1.1.1.1.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.1.1.1.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.1.1.1.2.1 05-Jan-2001  bouyer file i4b_avm_fritz_pcmcia.c was added on branch thorpej_scsipi on 2001-01-05 17:36:21 +0000
 1.4 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.3 17-Feb-2001  martin Rename pcmcia_isic.[ch] to i4b_isic_pcmcia.[ch] to better fit in the
grand sheme of names.
 1.2 18-Jan-2001  martin Add support for another PCMCIA ISDN card: Sedlbauer speed star II.
While there fix two outdated comments.
 1.1 05-Jan-2001  martin branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jan-2001  martin branches: 1.1.1.1.2;
Initial import of ISDN4BSD release 0.96
 1.1.1.1.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.1.1.1.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.1.1.1.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.1.1.1.2.1 05-Jan-2001  bouyer file i4b_elsa_isdnmc.c was added on branch thorpej_scsipi on 2001-01-05 17:36:21 +0000
 1.4 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.3 17-Feb-2001  martin Rename pcmcia_isic.[ch] to i4b_isic_pcmcia.[ch] to better fit in the
grand sheme of names.
 1.2 18-Jan-2001  martin Add support for another PCMCIA ISDN card: Sedlbauer speed star II.
While there fix two outdated comments.
 1.1 05-Jan-2001  martin branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jan-2001  martin branches: 1.1.1.1.2;
Initial import of ISDN4BSD release 0.96
 1.1.1.1.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.1.1.1.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.1.1.1.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.1.1.1.2.1 05-Jan-2001  bouyer file i4b_elsa_mcall.c was added on branch thorpej_scsipi on 2001-01-05 17:36:21 +0000
 1.2 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.1 17-Feb-2001  martin Rename pcmcia_isic.[ch] to i4b_isic_pcmcia.[ch] to better fit in the
grand sheme of names.
 1.2 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.1 17-Feb-2001  martin Rename pcmcia_isic.[ch] to i4b_isic_pcmcia.[ch] to better fit in the
grand sheme of names.
 1.3 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.2 17-Feb-2001  martin Rename pcmcia_isic.[ch] to i4b_isic_pcmcia.[ch] to better fit in the
grand sheme of names.
 1.1 18-Jan-2001  martin branches: 1.1.2;
Add support for another PCMCIA ISDN card: Sedlbauer speed star II.
While there fix two outdated comments.
 1.1.2.3 12-Mar-2001  bouyer Sync with HEAD.
 1.1.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.1.2.1 18-Jan-2001  bouyer file i4b_sbspeedstar2.c was added on branch thorpej_scsipi on 2001-02-11 19:16:10 +0000
 1.41 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.40 05-Sep-2009  tsutsui branches: 1.40.12; 1.40.22;
Invert logic around nested pmf(9) registrations for readability.
 1.39 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.38 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.37 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.36 03-Jul-2008  drochner branches: 1.36.4; 1.36.10;
split device/softc (tested with an@pcmcia)
 1.35 28-Apr-2008  martin branches: 1.35.2; 1.35.4;
Remove clause 3 and 4 from TNF licenses
 1.34 05-Apr-2008  cegger branches: 1.34.2; 1.34.4;
use aprint_*_dev and device_xname
 1.33 09-Dec-2007  jmcneill branches: 1.33.10;
Merge jmcneill-pm branch.
 1.32 19-Oct-2007  ad branches: 1.32.4; 1.32.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.31 16-Nov-2006  christos branches: 1.31.8; 1.31.22; 1.31.24; 1.31.28;
__unused removal on arguments; approved by core.
 1.30 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.29 24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.28 11-Dec-2005  christos branches: 1.28.20; 1.28.22;
merge ktrace-lwp.
 1.27 22-Jun-2005  dyoung branches: 1.27.2;
Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD. Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]). Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.
 1.26 04-Feb-2005  perry de-__P
 1.25 10-Aug-2004  mycroft branches: 1.25.4; 1.25.6;
Update to the new world order.
 1.24 10-Aug-2004  mycroft Constify.
 1.23 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.22 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.21 09-Aug-2004  mycroft Fix the intr_establish/disestablish order here too.
 1.20 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.19 07-Jul-2004  mycroft More cleanup:
* Print "devinfo" in a canonial place (like we do in the SCSI code).
* Use aprint_{error,normal}() during attach.
* More PCMCIA_STR_* removal.
 1.18 07-Jul-2004  mycroft More PCMCIA_STR_* elimination.
 1.17 28-Jan-2004  onoe Adopt to new 802.11 framework.
Add support of version 5.30.17 firmware of PCMCIA 350 series.
MPI350 mini-PCI is NOT YET supported.
MONITOR mode is still not yet working.
 1.16 13-Oct-2003  dyoung Switch an(4) to using the header files in the new 802.11 layer.
 1.15 20-Jan-2003  simonb branches: 1.15.2;
The Double-Semi-Colon Police.
 1.14 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.13 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.12 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.11 13-Nov-2001  lukem add RCSIDs
 1.10 01-Jul-2001  thorpej branches: 1.10.2;
Remove unneeded include files. From Onno van der Linden.
 1.9 06-Apr-2001  onoe Add Cisco Aironet 350 Series.
XXX: work as same as 340 series.
do not use any 802.11e security enhancements yet..
 1.8 21-Dec-2000  onoe branches: 1.8.2;
use pcmcia_devinfo() to print product info.
 1.7 19-Dec-2000  onoe cleanup attach procedure, use tsleep() instead of long delay (and ignore
timeouts).
stop driver after suspend.
XXX: should use command interrupt but no document...
XXX: status update sometimes failed perhaps due to collision.
(RID 0xff50 or 0xff68 access failed)
 1.6 19-Dec-2000  onoe I've inverted the logic of an_probe() in my previous commit to dev/ic/an.c
 1.5 14-Dec-2000  onoe Add PCI version of Aironet, not tested at all.
ISA/ISApnp version won't come since I don't know about isa...
 1.4 12-Dec-2000  onoe branches: 1.4.2; 1.4.4;
add support(?) for PC4500 which is a 2Mbps product.
Though ifconfig -m no longer show 5Mbps/11Mbps for PC4500 by this fix,
I cannot find how to set fixed transmit speed to the firmware.
FreeBSD version of driver apparently ignore the value set by ancontrol(8).
 1.3 12-Dec-2000  onoe cleanup headers: remove duplicate definition, split reg.h/var.h.
 1.2 11-Dec-2000  onoe To fix panic at "ifconfig an0 down",
define ANCACHE in if_an_pcmcia.c (XXX)
try not to access registers after interface down.
 1.1 11-Dec-2000  onoe Port 'an' driver for Aironet PC4500/PC4800 IEEE802.11 card from FreeBSD.
This is very adhoc work for IETF meeting.
- Since it seems that 'an' and 'wi' have similar hardware, low level
functions should be shared.
- There are PCI/ISA cards of Aironet but not supported yet.
- The wiconfig interface is changed so that wiconfig cannot be used.
- 'ancontrol' of FreeBSD is not ported.
- Only infrastructure mode is tested.
- WEP is not supported.

Though I only have an Aironet card, Cisco card should be expected to work.
 1.4.4.4 21-Apr-2001  bouyer Sync with HEAD
 1.4.4.3 05-Jan-2001  bouyer Sync with HEAD
 1.4.4.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.4.4.1 12-Dec-2000  bouyer file if_an_pcmcia.c was added on branch thorpej_scsipi on 2000-12-13 15:50:10 +0000
 1.4.2.2 12-Dec-2000  he Pull up revisions 1.1-1.2 (new, requested by he):
Add a driver for an(4), Aironet and Cisco wireless pcmcia cards.
 1.4.2.1 12-Dec-2000  he file if_an_pcmcia.c was added on branch netbsd-1-5 on 2000-12-12 21:26:35 +0000
 1.8.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.8.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.8.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.8.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.10.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.10.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.15.2.5 04-Feb-2005  skrll Sync with HEAD.
 1.15.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.15.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.15.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.15.2.1 03-Aug-2004  skrll Sync with HEAD
 1.25.6.1 12-Feb-2005  yamt sync with head.
 1.25.4.1 29-Apr-2005  kent sync with -current
 1.27.2.3 21-Jan-2008  yamt sync with head
 1.27.2.2 27-Oct-2007  yamt sync with head.
 1.27.2.1 30-Dec-2006  yamt sync with head.
 1.28.22.2 10-Dec-2006  yamt sync with head.
 1.28.22.1 22-Oct-2006  yamt sync with head
 1.28.20.1 18-Nov-2006  ad Sync with head.
 1.31.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.31.24.2 09-Jan-2008  matt sync with HEAD
 1.31.24.1 06-Nov-2007  matt sync with HEAD
 1.31.22.4 08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.31.22.3 06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.31.22.2 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.31.22.1 04-Sep-2007  joerg Convert an(4) to new style power management.
 1.31.8.1 23-Oct-2007  ad Sync with head.
 1.32.6.1 11-Dec-2007  yamt sync with head.
 1.32.4.1 26-Dec-2007  ad Sync with head.
 1.33.10.2 28-Sep-2008  mjf Sync with HEAD.
 1.33.10.1 02-Jun-2008  mjf Sync with HEAD.
 1.34.4.4 16-Sep-2009  yamt sync with head
 1.34.4.3 16-May-2009  yamt sync with head
 1.34.4.2 04-May-2009  yamt sync with head.
 1.34.4.1 16-May-2008  yamt sync with head.
 1.34.2.1 18-May-2008  yamt sync with head.
 1.35.4.1 18-Jul-2008  simonb Sync with head.
 1.35.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.36.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.36.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.40.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.40.12.1 30-Oct-2012  yamt sync with head
 1.47 08-Jan-2019  msaitoh Whitespace fix.
 1.46 14-Jul-2016  msaitoh branches: 1.46.16; 1.46.18;
KNF. No functional change.
 1.45 27-Oct-2012  chs branches: 1.45.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.44 15-Sep-2009  dyoung branches: 1.44.12; 1.44.22;
To ease a future device_t/softc split, se device_private() instead
of casting device_t to softc.
 1.43 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.42 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.41 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.40 28-Apr-2008  martin branches: 1.40.8; 1.40.14;
Remove clause 3 and 4 from TNF licenses
 1.39 05-Apr-2008  cegger branches: 1.39.2; 1.39.4;
use aprint_*_dev and device_xname
 1.38 19-Oct-2007  ad branches: 1.38.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.37 16-Nov-2006  christos branches: 1.37.8; 1.37.22; 1.37.24; 1.37.28;
__unused removal on arguments; approved by core.
 1.36 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.35 11-Dec-2005  christos branches: 1.35.20; 1.35.22;
merge ktrace-lwp.
 1.34 22-Jun-2005  dyoung branches: 1.34.2;
Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD. Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]). Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.
 1.33 10-Aug-2004  mycroft Rather than the silly state machine, set whatever higher-level reference
count there is (for SCSI, adapt_refcnt) to 1 and call the appropriate
"delref" function afterwards to disable the controller. This is a bit
simpler.

In a couple of cases, just remove the state machine, because it wasn't
really necessary.
 1.32 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.31 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.30 10-Aug-2004  mycroft Take a shot at updating this to the new world order. Hopefully someone will
test it for me...
 1.29 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.28 22-Oct-2003  mjl Typo in comment. From OpenBSD.
 1.27 13-Oct-2003  dyoung Adapt awi(4) to the new 802.11 layer.
 1.26 02-Oct-2002  thorpej branches: 1.26.6;
Add trailing ; to CFATTACH_DECL.
 1.25 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.24 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.23 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.22 15-Dec-2001  soren branches: 1.22.8;
To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.21 13-Nov-2001  lukem add RCSIDs
 1.20 18-Sep-2001  onoe Move IEEE 802.11 MAC management functions from awi driver to
if_ieee80211subr.c, which can be shared between any IEEE 802.11
drivers.
However, most of current working IEEE 802.11b wireless LAN cards
have rich firmware and we cannot have a control to management frames
for such cards.

IBSS creation is now supported for the awi driver.
 1.19 01-Jul-2001  thorpej branches: 1.19.2; 1.19.4;
Remove unneeded include files. From Onno van der Linden.
 1.18 18-Jan-2001  jdolecek branches: 1.18.2;
constify
 1.17 05-Jul-2000  onoe branches: 1.17.2;
remove unneeded include "opt_awi.h"
 1.16 09-Jun-2000  onoe branches: 1.16.2;
Add Farallon SkyLINE Wireless LAN Card for awi(4) driver.
Tested on FreeBSD 3.4-RELEASE by Dirk-Willem van Gulik <dirkx@webweaving.org>.
 1.15 09-Jun-2000  onoe cleanup haeders.
add opt_awi.h to define AWI_DEBUG, AWI_WEP_ARC4.
show the firmware version at attach.
create a framework to support WEP (encryption code is not included for now).
a new wiconfig compatible ioctl interface replaced the awictl interface.
fix memory leak in selecting AP
fix bugs in ESSID selection
changes from FreeBSD-current by Warner Losh:
revision 1.2
date: 2000/04/17 22:58:15; author: imp; state: Exp; lines: +16 -1
Provide mem* for compat with NetBSD to fix LINT
fixes from FreeBSD-current by Guido van Rooij:
revision 1.4
date: 2000/05/29 19:58:10; author: guido; state: Exp; lines: +5 -2
Fix a panic resulting from an obvious null pointer deref.
Apparently some other panics still exist in this driver, but with
this fix, it was at least possible to run the Nokia card at SANE 2000.
 1.14 22-Mar-2000  mycroft branches: 1.14.2;
Add the Nokia C020 WLAN card.
 1.13 22-Mar-2000  onoe Update awi driver, which now supports AMD 79c930 based 802.11 DS cards
as well as 802.11 FH cards. Also, it can operate in infrastructure mode,
adhoc mode, and wi(4) (aka WaveLAN/IEEE) compatible adhoc mode.
 1.12 17-Feb-2000  sommerfeld Add detach support.
Light cleanup.
 1.11 12-Feb-2000  chopps awi is an 8-bit only card, so set the 8bit flag.
 1.10 03-Feb-2000  enami Make the product lookup table driven.
 1.9 01-Feb-2000  enami Pass an appropriate value as alignment (0 is not such a value).
 1.8 01-Feb-2000  enami Rearrenge code a bit for the sake of another device.
 1.7 01-Feb-2000  enami Cosmetic changes.
 1.6 01-Feb-2000  enami Sync awi_pcmcia_get_enaddr with mbe_pcmcia_get_enaddr.
 1.5 06-Nov-1999  sommerfeld branches: 1.5.2; 1.5.4; 1.5.6;
Extract MAC address from CIS data in pcmcia front end.
Fix multicast address manipulation.
ipv6 now works through this driver.
 1.4 05-Nov-1999  sommerfeld Add rcsid's
 1.3 04-Nov-1999  sommerfeld Allow this to build on 1.4.x, too
 1.2 04-Nov-1999  sommerfeld Attempt to be smart about whether to use I/O space or memory space to
access the card's shared memory: if we can't allocate the 32k we need,
fall back and just use I/O space access.
 1.1 04-Nov-1999  sommerfeld Driver front-end for BayStack 650 PCMCIA 802.11 card.
Committed using the driver.
 1.5.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.4.2 15-Nov-1999  fvdl Sync with -current
 1.5.4.1 06-Nov-1999  fvdl file if_awi_pcmcia.c was added on branch fvdl-softdep on 1999-11-15 00:41:13 +0000
 1.5.2.2 06-Nov-1999  sommerfeld Extract MAC address from CIS data in pcmcia front end.
Fix multicast address manipulation.
ipv6 now works through this driver.
 1.5.2.1 06-Nov-1999  sommerfeld file if_awi_pcmcia.c was added on branch comdex-fall-1999 on 1999-11-06 16:43:55 +0000
 1.14.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.16.2.1 14-Jul-2000  onoe Pull up revision 1.17 (approved by thorpej)
Add WEP support for awi driver.
 1.17.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.17.2.2 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.17.2.1 05-Jul-2000  bouyer file if_awi_pcmcia.c was added on branch thorpej_scsipi on 2000-11-20 11:42:42 +0000
 1.18.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.18.2.5 20-Jun-2002  nathanw Catch up to -current.
 1.18.2.4 08-Jan-2002  nathanw Catch up to -current.
 1.18.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.18.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.18.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.19.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.19.2.3 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.19.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.22.8.1 20-Jun-2002  gehenna catch up with -current.
 1.26.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.26.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.26.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.26.6.2 12-Aug-2004  skrll Sync with HEAD.
 1.26.6.1 03-Aug-2004  skrll Sync with HEAD
 1.34.2.2 27-Oct-2007  yamt sync with head.
 1.34.2.1 30-Dec-2006  yamt sync with head.
 1.35.22.2 10-Dec-2006  yamt sync with head.
 1.35.22.1 22-Oct-2006  yamt sync with head
 1.35.20.1 18-Nov-2006  ad Sync with head.
 1.37.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.37.24.1 06-Nov-2007  matt sync with HEAD
 1.37.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.37.8.1 23-Oct-2007  ad Sync with head.
 1.38.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.39.4.4 16-Sep-2009  yamt sync with head
 1.39.4.3 16-May-2009  yamt sync with head
 1.39.4.2 04-May-2009  yamt sync with head.
 1.39.4.1 16-May-2008  yamt sync with head.
 1.39.2.1 18-May-2008  yamt sync with head.
 1.40.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.40.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.44.22.2 03-Dec-2017  jdolecek update from HEAD
 1.44.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.44.12.1 30-Oct-2012  yamt sync with head
 1.45.14.1 05-Oct-2016  skrll Sync with HEAD
 1.46.18.1 10-Jun-2019  christos Sync with HEAD
 1.46.16.1 18-Jan-2019  pgoyette Synch with HEAD
 1.68 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.67 06-Dec-2019  maxv branches: 1.67.2;
localify
 1.66 21-Oct-2019  msaitoh if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.65 05-Feb-2019  msaitoh branches: 1.65.4;
Remove very old IFF_NOTRAILERS flag.
 1.64 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.63 26-Jun-2018  msaitoh branches: 1.63.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.62 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.61 15-Dec-2016  ozaki-r branches: 1.61.8; 1.61.14;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.60 08-Dec-2016  ozaki-r Apply deferred if_start framework

if_schedule_deferred_start checks if the if_snd queue contains packets,
so drivers don't need to check it by themselves.
 1.59 02-Oct-2016  christos MFREE -> m_free
 1.58 10-Jun-2016  ozaki-r branches: 1.58.2;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.57 09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.56 27-Oct-2012  chs branches: 1.56.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.55 05-Apr-2010  joerg branches: 1.55.8; 1.55.18;
Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.54 19-Jan-2010  pooka branches: 1.54.2; 1.54.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.53 06-Dec-2009  dyoung Simplify device-activation hooks.
 1.52 22-Nov-2009  dsl Remove "splurious interrupt" message. The IRQ might be shared.
Fixes PR/11410
 1.51 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.50 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.49 15-Apr-2009  elad Remove a few KAUTH_GENERIC_ISSUSER in favor of more descriptive
alternatives.

Discussed on tech-kern:

http://mail-index.netbsd.org/tech-kern/2009/04/11/msg004798.html

Input from ad@, christos@, dyoung@, tsutsui@.

Okay ad@.
 1.48 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.47 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.46 13-Feb-2009  bouyer More printf format fixes.
 1.45 07-Nov-2008  dyoung branches: 1.45.4;
*** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability. KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:

switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
 1.44 28-Apr-2008  martin branches: 1.44.6; 1.44.8; 1.44.10; 1.44.12;
Remove clause 3 and 4 from TNF licenses
 1.43 05-Apr-2008  cegger branches: 1.43.2; 1.43.4;
use aprint_*_dev and device_xname
 1.42 01-Sep-2007  dyoung branches: 1.42.20;
Change a bazillion occurrences of code resembling this,

error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ec) :
ether_delmulti(ifr, &sc->sc_ec);

if (error == ENETRESET) {

to this,

if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number. This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
 1.41 04-Mar-2007  christos branches: 1.41.2; 1.41.10; 1.41.14; 1.41.16;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.40 05-Jan-2007  elad branches: 1.40.2;
Use a single kauth(9) call.
 1.39 04-Jan-2007  elad Consistent usage of KAUTH_GENERIC_ISSUSER.
 1.38 16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.37 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.36 17-Aug-2006  christos branches: 1.36.2; 1.36.4;
Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!
 1.35 21-Jul-2006  ad - Use the LWP cached credentials where sane.
- Minor cosmetic changes.
 1.34 14-May-2006  elad integrate kauth.
 1.33 20-Feb-2006  thorpej branches: 1.33.2; 1.33.4; 1.33.6;
Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
 1.32 11-Dec-2005  christos branches: 1.32.2; 1.32.4; 1.32.6;
merge ktrace-lwp.
 1.31 27-Feb-2005  perry branches: 1.31.4;
nuke trailing whitespace
 1.30 04-Feb-2005  perry de-__P
 1.29 30-Oct-2004  thorpej branches: 1.29.4; 1.29.6;
When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.28 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.27 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.26 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.25 10-Nov-2003  wiz branches: 1.25.4;
Update URL; s/Linix/Linux/. From Jared Yanovich, forwarded by jmc@openbsd.
 1.24 02-Oct-2002  thorpej branches: 1.24.6;
Add trailing ; to CFATTACH_DECL.
 1.23 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.22 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.21 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.20 15-Dec-2001  soren branches: 1.20.8;
To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.19 13-Nov-2001  lukem add RCSIDs
 1.18 07-Jul-2001  thorpej branches: 1.18.2;
bcopy -> memcpy, strcpy
 1.17 14-Dec-2000  thorpej branches: 1.17.2;
ALTQ'ify.
 1.16 15-Nov-2000  thorpej Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.15 16-Oct-2000  itojun correct memory size to be mapped. PR 11242.
 1.14 01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.13 05-Jul-2000  itojun typo. From: jdolecek
 1.12 05-Jul-2000  itojun use memory mapped address, instead of i/o memory access, for control
registers. rationale:
- Netwave cards choke if we map i/o memory to >= 0x400
- even though, CIS tuple talks nothing about it
- it is not possible to specify range in pcmcia_io_map
- it would be very bad to do a try-and-error bus_space allocation for
i/o memory regions < 0x400
- we can have exactly the same functionality with memory mapped access
this should correct PR 10139.

the memory mapped access idea was from WIDE wildboar/bsdi cnw code.
 1.11 05-Jun-2000  gmcgarry branches: 1.11.2;
Clean up usage of XIRCOM/TDK identifiers.
 1.10 30-Mar-2000  augustss branches: 1.10.2;
Remove register declarations.
 1.9 06-Mar-2000  thorpej Set ifp->if_baudrate as appropriate.
 1.8 26-Feb-2000  itojun cnw is 8bit-only card. map memory region as 8bit only.
(there are so many 8bit-only card fixes. don't we have some hint on cis tuple?)
From: feico
 1.7 07-Feb-2000  augustss Correct John Markus Bj�rndalen's horribly mangled name in a comment.
 1.6 02-Feb-2000  itojun handle attach failure in more detail. make sure to
pcmcia_function_disable() on failure.
 1.5 02-Feb-2000  itojun implement cnw_detach.
XXX it looks that whenever there's error-return in xx_attach,
we need to have some check in xx_detach(). otherwise, routines such as
ether_ifdetach() will be called without call to ether_ifattach().
 1.4 25-Jan-2000  itojun bring in stabilization codes in freebsd PAO/bsdi cnw driver.
- link integrity bit check.
- don't send too many packets, add some delay between them (this one is
not enabled by default - try it if you see performance problem on
heavy traffic)
 1.3 29-Nov-1999  itojun improve cnw driver, looking at bsdi/freebsd-pao cnw driver by wide+prb@bsdi.
- implement ioctls compatible with bsdi/freebsd-pao. stat type is
changed from u_int to u_quad_t to avoid overflows. now it is possible
to switch domain/encryption key from the userland, using cnwctl(8).
- implement multicast/promiscuous mode. tested with IPv6.
 1.2 18-May-1999  thorpej branches: 1.2.2; 1.2.8;
Rework layer 2 protocol input routines. Instead of calling e.g. ether_input()
directly, call the function pointer (*if_input)(ifp, m). The input routine
expects the packet header to be at the head of the packet, and will adjust
as necessary. Privatize the layer 2 input and output routines, allowing
*_ifattach() to set them up as appropriate.
 1.1 01-Jan-1999  christos branches: 1.1.4; 1.1.6;
Add Xircom Netwave driver from Michael Eriksson
 1.1.6.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.1.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.2.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.2.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.2.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.10.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.11.2.2 17-Oct-2000  tv Pullup 1.15 [itojun]:
correct memory size to be mapped. PR 11242.
 1.11.2.1 07-Jul-2000  itojun sync with netbsd-current, approved by releng-1-5.
sys/dev/pcmcia/if_cnw.c 1.11 -> 1.13
sys/dev/pcmcia/if_cnwreg.h 1.2 -> 1.3

use memory mapped address, instead of i/o memory access, for control
registers. rationale:
- Netwave cards choke if we map i/o memory to >= 0x400
- even though, CIS tuple talks nothing about it
- it is not possible to specify range in pcmcia_io_map
- it would be very bad to do a try-and-error bus_space allocation for
i/o memory regions < 0x400
- we can have exactly the same functionality with memory mapped access
this should correct PR 10139.

the memory mapped access idea was from WIDE wildboar/bsdi cnw code.
 1.17.2.8 18-Oct-2002  nathanw Catch up to -current.
 1.17.2.7 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.17.2.6 24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.17.2.5 20-Jun-2002  nathanw Catch up to -current.
 1.17.2.4 08-Jan-2002  nathanw Catch up to -current.
 1.17.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.17.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.17.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.18.2.3 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.18.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.18.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.20.8.1 20-Jun-2002  gehenna catch up with -current.
 1.24.6.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.24.6.6 04-Feb-2005  skrll Sync with HEAD.
 1.24.6.5 02-Nov-2004  skrll Sync with HEAD.
 1.24.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.24.6.2 12-Aug-2004  skrll Sync with HEAD.
 1.24.6.1 03-Aug-2004  skrll Sync with HEAD
 1.25.4.1 24-Jan-2005  he Pull up revision 1.29 (requested by thorpej in ticket #939):
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#27678.
 1.29.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.29.6.1 12-Feb-2005  yamt sync with head.
 1.29.4.1 29-Apr-2005  kent sync with -current
 1.31.4.4 03-Sep-2007  yamt sync with head.
 1.31.4.3 26-Feb-2007  yamt sync with head.
 1.31.4.2 30-Dec-2006  yamt sync with head.
 1.31.4.1 21-Jun-2006  yamt sync with head.
 1.32.6.2 01-Jun-2006  kardel Sync with head.
 1.32.6.1 22-Apr-2006  simonb Sync with head.
 1.32.4.1 09-Sep-2006  rpaulo sync with head
 1.32.2.1 01-Mar-2006  yamt sync with head.
 1.33.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.33.4.3 06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.33.4.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.33.4.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.33.2.3 03-Sep-2006  yamt sync with head.
 1.33.2.2 11-Aug-2006  yamt sync with head
 1.33.2.1 24-May-2006  yamt sync with head.
 1.36.4.2 10-Dec-2006  yamt sync with head.
 1.36.4.1 22-Oct-2006  yamt sync with head
 1.36.2.2 12-Jan-2007  ad Sync with head.
 1.36.2.1 18-Nov-2006  ad Sync with head.
 1.40.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.41.16.1 06-Nov-2007  matt sync with HEAD
 1.41.14.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.41.10.1 03-Sep-2007  skrll Sync with HEAD.
 1.41.2.1 09-Oct-2007  ad Sync with head.
 1.42.20.2 17-Jan-2009  mjf Sync with HEAD.
 1.42.20.1 02-Jun-2008  mjf Sync with HEAD.
 1.43.4.5 11-Aug-2010  yamt sync with head.
 1.43.4.4 11-Mar-2010  yamt sync with head
 1.43.4.3 16-May-2009  yamt sync with head
 1.43.4.2 04-May-2009  yamt sync with head.
 1.43.4.1 16-May-2008  yamt sync with head.
 1.43.2.1 18-May-2008  yamt sync with head.
 1.44.12.1 26-Jul-2009  snj branches: 1.44.12.1.2;
Pull up following revision(s) (requested by dholland in ticket #874):
sys/dev/ic/ciss.c: revision 1.15
sys/dev/isa/isadma.c: revision 1.59
sys/dev/usb/ulpt.c: revision 1.82
sys/dev/ic/tcic2.c: revision 1.31
sys/dev/isa/if_ntwoc_isa.c: revision 1.18
sys/dev/pci/if_sk.c: revision 1.57
sys/dev/pcmcia/if_cnw.c: revision 1.46
More printf format fixes.
 1.44.12.1.2.1 21-Apr-2010  matt sync to netbsd-5
 1.44.10.1 26-Jul-2009  snj Pull up following revision(s) (requested by dholland in ticket #874):
sys/dev/ic/ciss.c: revision 1.15
sys/dev/isa/isadma.c: revision 1.59
sys/dev/usb/ulpt.c: revision 1.82
sys/dev/ic/tcic2.c: revision 1.31
sys/dev/isa/if_ntwoc_isa.c: revision 1.18
sys/dev/pci/if_sk.c: revision 1.57
sys/dev/pcmcia/if_cnw.c: revision 1.46
More printf format fixes.
 1.44.8.3 28-Apr-2009  skrll Sync with HEAD.
 1.44.8.2 03-Mar-2009  skrll Sync with HEAD.
 1.44.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.44.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.45.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.54.4.1 30-May-2010  rmind sync with head
 1.54.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.55.18.2 03-Dec-2017  jdolecek update from HEAD
 1.55.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.55.8.1 30-Oct-2012  yamt sync with head
 1.56.14.4 05-Feb-2017  skrll Sync with HEAD
 1.56.14.3 05-Oct-2016  skrll Sync with HEAD
 1.56.14.2 09-Jul-2016  skrll Sync with HEAD
 1.56.14.1 19-Mar-2016  skrll Sync with HEAD
 1.58.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.58.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.61.14.3 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.61.14.2 28-Jul-2018  pgoyette Sync with HEAD
 1.61.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.61.8.2 24-Oct-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1416):

sys/dev/ic/i82586.c: revision 1.86
sys/arch/arm/ep93xx/epe.c: revision 1.45
sys/dev/pcmcia/if_cnw.c: revision 1.66
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.31
sys/dev/qbus/if_il.c: revision 1.36
sys/dev/pcmcia/if_ray.c: revision 1.95
sys/dev/qbus/if_qt.c: revision 1.24

if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.61.8.1 26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.63.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.63.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.63.2.1 10-Jun-2019  christos Sync with HEAD
 1.65.4.1 23-Oct-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #371):

sys/dev/ic/i82586.c: revision 1.86
sys/arch/arm/ep93xx/epe.c: revision 1.45
sys/dev/pcmcia/if_cnw.c: revision 1.66
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.31
sys/arch/arm/sunxi/sunxi_can.c: revision 1.2
sys/dev/qbus/if_il.c: revision 1.36
sys/dev/pcmcia/if_ray.c: revision 1.95
sys/dev/qbus/if_qt.c: revision 1.24

if_ipackets is incremented in can_input(), so don't increment it in
sunxi_can_rx_intr to prevent double count. OK'd by bouyer@.

if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.67.2.1 29-Feb-2020  ad Sync with head.
 1.5 06-Sep-2015  dholland More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
 1.4 11-Dec-2005  christos branches: 1.4.120; 1.4.140;
merge ktrace-lwp.
 1.3 27-Feb-2005  perry nuke trailing whitespace
 1.2 29-Nov-1999  itojun branches: 1.2.2; 1.2.8; 1.2.32; 1.2.40; 1.2.42;
improve cnw driver, looking at bsdi/freebsd-pao cnw driver by wide+prb@bsdi.
- implement ioctls compatible with bsdi/freebsd-pao. stat type is
changed from u_int to u_quad_t to avoid overflows. now it is possible
to switch domain/encryption key from the userland, using cnwctl(8).
- implement multicast/promiscuous mode. tested with IPv6.
 1.1 29-Nov-1999  itojun branches: 1.1.1;
Initial revision
 1.1.1.1 29-Nov-1999  itojun cnw driver ioctls, from FreeBSD/PAO2 repository
 1.2.42.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.40.1 29-Apr-2005  kent sync with -current
 1.2.32.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.8.2 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.2.8.1 29-Nov-1999  bouyer file if_cnwioctl.h was added on branch thorpej_scsipi on 2000-11-20 11:42:43 +0000
 1.2.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.140.1 22-Sep-2015  skrll Sync with HEAD
 1.4.120.1 03-Dec-2017  jdolecek update from HEAD
 1.6 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.5 11-Dec-2005  christos branches: 1.5.70; 1.5.72; 1.5.74;
merge ktrace-lwp.
 1.4 27-Feb-2005  perry nuke trailing whitespace
 1.3 05-Jul-2000  itojun branches: 1.3.24; 1.3.32; 1.3.34;
use memory mapped address, instead of i/o memory access, for control
registers. rationale:
- Netwave cards choke if we map i/o memory to >= 0x400
- even though, CIS tuple talks nothing about it
- it is not possible to specify range in pcmcia_io_map
- it would be very bad to do a try-and-error bus_space allocation for
i/o memory regions < 0x400
- we can have exactly the same functionality with memory mapped access
this should correct PR 10139.

the memory mapped access idea was from WIDE wildboar/bsdi cnw code.
 1.2 29-Nov-1999  itojun branches: 1.2.4;
improve cnw driver, looking at bsdi/freebsd-pao cnw driver by wide+prb@bsdi.
- implement ioctls compatible with bsdi/freebsd-pao. stat type is
changed from u_int to u_quad_t to avoid overflows. now it is possible
to switch domain/encryption key from the userland, using cnwctl(8).
- implement multicast/promiscuous mode. tested with IPv6.
 1.1 01-Jan-1999  christos branches: 1.1.6; 1.1.8; 1.1.14;
Add Xircom Netwave driver from Michael Eriksson
 1.1.14.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.1.8.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.1.6.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.2.4.1 07-Jul-2000  itojun sync with netbsd-current, approved by releng-1-5.
sys/dev/pcmcia/if_cnw.c 1.11 -> 1.13
sys/dev/pcmcia/if_cnwreg.h 1.2 -> 1.3

use memory mapped address, instead of i/o memory access, for control
registers. rationale:
- Netwave cards choke if we map i/o memory to >= 0x400
- even though, CIS tuple talks nothing about it
- it is not possible to specify range in pcmcia_io_map
- it would be very bad to do a try-and-error bus_space allocation for
i/o memory regions < 0x400
- we can have exactly the same functionality with memory mapped access
this should correct PR 10139.

the memory mapped access idea was from WIDE wildboar/bsdi cnw code.
 1.3.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.32.1 29-Apr-2005  kent sync with -current
 1.3.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.74.1 16-May-2008  yamt sync with head.
 1.5.72.1 18-May-2008  yamt sync with head.
 1.5.70.1 02-Jun-2008  mjf Sync with HEAD.
 1.22 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.21 13-Apr-2015  riastradh Convert sys/dev to use <sys/rndsource.h>.
 1.20 27-Oct-2012  chs branches: 1.20.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.19 02-Feb-2012  tls branches: 1.19.6;
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.18 12-May-2009  cegger branches: 1.18.12; 1.18.16;
struct device * -> device_t, no functional changes intended.
 1.17 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.16 05-Apr-2008  cegger branches: 1.16.4; 1.16.18;
use aprint_*_dev and device_xname
 1.15 19-Oct-2007  ad branches: 1.15.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.14 16-Nov-2006  christos branches: 1.14.8; 1.14.22; 1.14.24; 1.14.28;
__unused removal on arguments; approved by core.
 1.13 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.12 11-Dec-2005  christos branches: 1.12.20; 1.12.22;
merge ktrace-lwp.
 1.11 27-Feb-2005  perry branches: 1.11.4;
nuke trailing whitespace
 1.10 10-Aug-2004  mycroft branches: 1.10.4; 1.10.6;
Update to the new world order.
 1.9 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.8 09-Aug-2004  mycroft Fix the intr_establish/disestablish order here too.
 1.7 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.6 07-Jul-2004  mycroft More cleanup:
* Print "devinfo" in a canonial place (like we do in the SCSI code).
* Use aprint_{error,normal}() during attach.
* More PCMCIA_STR_* removal.
 1.5 02-Oct-2002  thorpej branches: 1.5.6;
Add trailing ; to CFATTACH_DECL.
 1.4 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.3 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.2 26-Nov-2001  yamt branches: 1.2.2; 1.2.4;
move dev/isa/cs89x0{.c,{var,reg}.h} into dev/ic
and split isadma parts into /dev/isa/cs89x0isa*.
 1.1 26-Nov-2001  yamt add pcmcia frontend for cs driver.
 1.2.4.3 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.2.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1 26-Nov-2001  thorpej file if_cs_pcmcia.c was added on branch kqueue on 2002-01-10 19:57:18 +0000
 1.2.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.2 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.1 26-Nov-2001  nathanw file if_cs_pcmcia.c was added on branch nathanw_sa on 2002-01-08 00:31:23 +0000
 1.5.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.5.6.2 12-Aug-2004  skrll Sync with HEAD.
 1.5.6.1 03-Aug-2004  skrll Sync with HEAD
 1.10.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.10.4.1 29-Apr-2005  kent sync with -current
 1.11.4.2 27-Oct-2007  yamt sync with head.
 1.11.4.1 30-Dec-2006  yamt sync with head.
 1.12.22.2 10-Dec-2006  yamt sync with head.
 1.12.22.1 22-Oct-2006  yamt sync with head
 1.12.20.1 18-Nov-2006  ad Sync with head.
 1.14.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.14.24.1 06-Nov-2007  matt sync with HEAD
 1.14.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.14.8.1 23-Oct-2007  ad Sync with head.
 1.15.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.16.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.16.4.1 16-May-2009  yamt sync with head
 1.18.16.1 18-Feb-2012  mrg merge to -current.
 1.18.12.2 30-Oct-2012  yamt sync with head
 1.18.12.1 17-Apr-2012  yamt sync with head
 1.19.6.2 03-Dec-2017  jdolecek update from HEAD
 1.19.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.20.14.2 09-Jul-2016  skrll Sync with HEAD
 1.20.14.1 06-Jun-2015  skrll Sync with HEAD
 1.1 30-Jul-1997  marc branches: 1.1.2;
file if_ed_pcmcia.c was initially added on branch marc-pcmcia.
 1.1.2.10 14-Oct-1997  thorpej Split off NE2000 support from the ISA "ed" driver, and create a new "ne"
driver that deals with NE2000s and compatibles on ISA, PCI, and PCMCIA
busses.

This driver uses the generic DP8390 core chipset back-end.

NOTE: There are several changes between this driver and the old "ed"
front-end for PCMCIA. Notably, the i/o space allocation strategy has
been changed somewhat to allow this to work with odd host pcmcia bridges.
 1.1.2.9 13-Sep-1997  enami Add entry for the card Planet SmartCOM 2000.
 1.1.2.8 23-Aug-1997  thorpej Update for changes to pcmcia function manipulation.
 1.1.2.7 14-Aug-1997  jtk add comment on Linksys card (potential hardware oddity) and fill out name
to "Linksys EthernetCard"
 1.1.2.6 10-Aug-1997  thorpej Create a structure to encapsulate information about allocated i/o and
mem space on the pcmcia bus. Use this in chip-level window enable
functions rather than making assumptions about the bus space handles.

Also, clean up lots of debugging prints. Use patchables to enable them.
 1.1.2.5 06-Aug-1997  jtk add support for Linksys card, using new test to believe the NE2000 probe enet addr
 1.1.2.4 01-Aug-1997  matt Add an entry for the Digital (DEC) DEPCM-BA (which is really a rebadged
Accton EN2216).
 1.1.2.3 31-Jul-1997  thorpej Remove some gratuitous debugging printfs; this information is already
displayed elsewhere.
 1.1.2.2 30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.64 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.63 05-Sep-2009  tsutsui branches: 1.63.22; 1.63.40;
Replace shutdownhook_establish(9) with pmf_device_register1(9) in
MI epconfig() and ep_detach(), and remove pmf(9) calls in pcmcia attachment.
Tested on ep0 at pci, but pcmcia attachment is untested.
 1.62 27-Aug-2008  christos device_t changes, pmf, minor knf.
 1.61 28-Apr-2008  martin branches: 1.61.2; 1.61.6;
Remove clause 3 and 4 from TNF licenses
 1.60 05-Apr-2008  cegger branches: 1.60.2; 1.60.4;
use aprint_*_dev and device_xname
 1.59 19-Oct-2007  ad branches: 1.59.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.58 16-Nov-2006  christos branches: 1.58.8; 1.58.22; 1.58.24; 1.58.28;
__unused removal on arguments; approved by core.
 1.57 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.56 24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.55 11-Jul-2006  peter branches: 1.55.4; 1.55.6;
Add power hooks for "ep* at pcmcia?".

ok christos@
 1.54 11-Dec-2005  christos branches: 1.54.4; 1.54.8; 1.54.16;
merge ktrace-lwp.
 1.53 04-Feb-2005  perry branches: 1.53.6;
de-__P
 1.52 10-Aug-2004  mycroft branches: 1.52.4; 1.52.6;
Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.51 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.50 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.49 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.48 10-Aug-2004  mycroft Copyright maintenance.
 1.47 09-Aug-2004  mycroft Minor code reduction.
 1.46 09-Aug-2004  mycroft Make pcmcia_function_disable() primarily responsible for disabling the CCR
bits. pcmcia_intr_disestablish() continues to do this as a stopgap.
 1.45 09-Aug-2004  mycroft Do our io_map()s and intr_establish()es earlier.
 1.44 09-Aug-2004  mycroft Use PCMCIA_WIDTH_AUTO, not PCMCIA_WIDTH_IO16, since we (sometimes) do 8-bit
access.
 1.43 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.42 07-Jul-2004  mycroft Clean up attach messages.
 1.41 02-Oct-2002  thorpej branches: 1.41.6;
Add trailing ; to CFATTACH_DECL.
 1.40 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.39 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.38 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.37 10-Mar-2002  christos branches: 1.37.4;
Search for space to attach a 3c562d correctly. From Hayakawa Koichi
<haya@netbsd.org>, thanks.
 1.36 24-Dec-2001  christos when we disable, we first disestablish the interrupt and then the card.
when we enable, we first configure the card and then establish the interrupt.
This is so that the ccr is mapped on multifunction cards.
 1.35 13-Nov-2001  lukem add RCSIDs
 1.34 01-Jul-2001  thorpej branches: 1.34.2;
Remove unneeded include files. From Onno van der Linden.
 1.33 08-May-2000  augustss branches: 1.33.4; 1.33.6;
Swap the order of disabling the function and disestablishing the interrupt
on detach. This avoid accessing unmapped registers on multi-function cards.
 1.32 13-Mar-2000  cgd tabbing consistency on the 3c1 entry
 1.31 13-Mar-2000  cgd add an entry to the product table for the 3C1. This seems to work,
at least as necessary to pull out the MAC address, etc. Not actually
tested xmit & rcv yet.
 1.30 08-Feb-2000  enami - Bail out from attach stage if failed to enable card, number of iospace
or memspace is unexpected, failed to map iospace or failed to configure
the controller properly.
- Disestablish an interrupt handler if failed to enable card.
 1.29 04-Feb-2000  cgd replace the *_lookup table entry match/lookup functions in all of
these drivers with a single common function (which supports tables
of variable-sized structures). Things are mostly as they were before:
tables are terminated by entry with NULL name, etc. There's also
the ability to call a driver-specific match function which can be used
to augment the table lookup.
 1.28 02-Feb-2000  augustss Move detach operations around a little to simplify (and perhaps get it
right?). Prompted by Jason, itojun and myself.
 1.27 02-Feb-2000  augustss Make sure to get rid of shutdown hook and ttach media on detach.
 1.26 02-Feb-2000  itojun wrap bpfdetach() with NBPFILTER > 0.
 1.25 02-Feb-2000  augustss Make ep driver detachable.
 1.24 11-Oct-1999  thorpej branches: 1.24.2;
Add support for the 3Com/Megahertz 3CCFEM556BI 10/100 Ethernet/Modem combo.
 1.23 14-Aug-1999  tron branches: 1.23.2;
Add support for 3Com 3CXEM556B-INT as suggested by Noriyuki KOIZUMI in
PR kern/8188.
 1.22 09-May-1999  thorpej Fix a couple of problems w/ 3c574 support. Doesn't quite work yet, but
it's a little closer.
 1.21 24-Dec-1998  marc branches: 1.21.2; 1.21.4;
add an entry to the products array for the
PCMCIA_PRODUCT_3COM_3CXEM556.

This device requires the same CCR hack as the 3c562.
 1.20 18-Nov-1998  thorpej branches: 1.20.2;
Now that the *_activate() functions don't do things which are attachment
specific, move them into the chipset drivers.
 1.19 18-Nov-1998  thorpej Move the i/o window unmap and i/o space free into *_detach().
 1.18 17-Nov-1998  thorpej Add detach and activate entry points. Mostly functional except for
#ifdef notyet'd if_delref() and if_detach(), which will be fixed up
when that code is committed.
 1.17 04-Nov-1998  fvdl Add the 'ex' driver, a DMA driver for 3Com 90x and 90xB cards. Rename
constants from EP_ to ELINK_ since they're now used in the ex driver as well.
 1.16 17-Aug-1998  thorpej First-crack at RoadRunner (3c574-TX 10/100Mbps PCMCIA). Doens't yet use
any of the RoadRunner speed hacks.
 1.15 15-Aug-1998  thorpej Fix a brain'o that caused the 3c589 to not match.
 1.14 15-Aug-1998  thorpej Look up the PCMCIA 3Com products in a table-driven fashion, like the
PCI products.
 1.13 12-Aug-1998  thorpej Completely rewrite media selection. Add support for the MII/PHY on
the 3Com 3c905-TX and 3c905-T4. Fix handling of the MII on the
3c595-MII and 3c597-MII (can't talk to the PHYs on these cards; just
use "manual" for the external MII port).

Fixes kern/4782 (Chris Demetriou).
 1.12 20-Jul-1998  mellon Fix typo.
 1.11 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.10 05-Jul-1998  jonathan defopt NS, NSIP.
 1.9 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.8 09-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.7 31-Mar-1998  thorpej Don't establish the interrupt handler just to read the MAC address.
 1.6 09-Mar-1998  christos - more 3c562 magic; document that the 0x88 tuple only works in 3c562a-c
and not in d where it goes back to use the eeprom method. So we detect
when the tuple method fails and fall back to the original method.
- even more 3c562 magic; the updated linux driver mentions that addresses
0x??00-0x??7f only work instead of the previous...
 1.5 01-Feb-1998  marc fix up the power management code to dtrt with the 3c562A mfc card (and
hopefully the other variants)
 1.4 11-Jan-1998  marc change the initial loop condition not to round up if the iobase starts
<= 0x70
 1.3 30-Nov-1997  drochner fix argument declaration inconsistency in the
non-"__BROKEN_INDIRECT_CONFIG" case
 1.2 16-Oct-1997  thorpej branches: 1.2.2;
Pull marc-pcmcia branch down from trunk.
 1.1 30-Jul-1997  marc branches: 1.1.2;
file if_ep_pcmcia.c was initially added on branch marc-pcmcia.
 1.1.2.15 16-Oct-1997  thorpej Copyright/license update.
 1.1.2.14 16-Oct-1997  thorpej Don't try to run off the end of the allowable i/o allocation range.
 1.1.2.13 16-Oct-1997  thorpej In the 3c562 case, pay attention to the "i/o allocation range start" when
doing the Very Special i/o allocation this card apparently needs.
 1.1.2.12 16-Oct-1997  thorpej Simplify the match function a bit.
 1.1.2.11 16-Oct-1997  thorpej Don't establish our interrupt hander at attach time. Instead, establish
it in the enable hook, and disestablish it in the disable hook. This gives
us two wins:

- Allows us to more fairly allocate an interrupt after other
devices which can't do dynamic allocation have hooked up
theirs.

- In the event the default interrupt allocation scheme is bad,
this allows us to bring an interface down, patch a kernel
variable (eventually, run a program that does the right
thing for us) to set up an interrupt allocation scheme suitable
for our laptop model, bring the interface back up, and have
the Right Thing happen.
 1.1.2.10 15-Oct-1997  enami No need to cast a generic pointer.
 1.1.2.9 14-Oct-1997  thorpej KNF, RCS IDs.
 1.1.2.8 14-Oct-1997  thorpej Explicitly align the allocated i/o space region to the size of the allocation.
This was previously implied, but we must explicitly specify it since some
cards may have more strict alignment requirements.
 1.1.2.7 29-Sep-1997  thorpej Make the "enable" and "disable" hooks take pointers to the softc, rather
than void * and a separately specified argument.
 1.1.2.6 27-Sep-1997  marc added enable/disable hooks for elink3 layer to do power management.
 1.1.2.5 23-Aug-1997  thorpej Update for changes to pcmcia function manipulation.
 1.1.2.4 10-Aug-1997  thorpej Create a structure to encapsulate information about allocated i/o and
mem space on the pcmcia bus. Use this in chip-level window enable
functions rather than making assumptions about the bus space handles.

Also, clean up lots of debugging prints. Use patchables to enable them.
 1.1.2.3 31-Jul-1997  thorpej Remove some gratuitous debugging printfs; this information is already
displayed elsewhere.
 1.1.2.2 30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.2.2.1 07-Feb-1998  mellon Pull up 1.3 and 1.4 (marc)
 1.20.2.1 11-Dec-1998  kenh The beginnings of interface detach support. Still some bugs, but mostly
works for me.

This work was originally by Bill Studenmund, and cleaned up by me.
 1.21.4.1 21-Jun-1999  thorpej Sync w/ -current.
 1.21.2.2 08-Feb-2000  he Pull up revisions 1.23-1.24 (requested by enami):
Add support for 3Com/Megaherz 10/100 Ethernet Modem combined
card (3CCFEM556BI and 3CXEM556B-INT). Should fix PR#8331 and
PR#8188.
 1.21.2.1 06-Feb-2000  he Pull up revision 1.22 (requested by enami):
Add support for the 3Com 3c574. Partially based on PR#8331.
 1.23.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.24.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.33.6.6 18-Oct-2002  nathanw Catch up to -current.
 1.33.6.5 20-Jun-2002  nathanw Catch up to -current.
 1.33.6.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.33.6.3 08-Jan-2002  nathanw Catch up to -current.
 1.33.6.2 14-Nov-2001  nathanw Catch up to -current.
 1.33.6.1 24-Aug-2001  nathanw Catch up with -current.
 1.33.4.1 28-Mar-2002  he Pull up revision 1.37 (requested by haya):
Search for space to attach 3c562 correctly.
 1.34.2.4 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.34.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.34.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.34.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.37.4.1 20-Jun-2002  gehenna catch up with -current.
 1.41.6.5 04-Feb-2005  skrll Sync with HEAD.
 1.41.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.41.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.41.6.2 12-Aug-2004  skrll Sync with HEAD.
 1.41.6.1 03-Aug-2004  skrll Sync with HEAD
 1.52.6.1 12-Feb-2005  yamt sync with head.
 1.52.4.1 29-Apr-2005  kent sync with -current
 1.53.6.2 27-Oct-2007  yamt sync with head.
 1.53.6.1 30-Dec-2006  yamt sync with head.
 1.54.16.1 13-Jul-2006  gdamore Merge from HEAD.
 1.54.8.1 11-Aug-2006  yamt sync with head
 1.54.4.1 09-Sep-2006  rpaulo sync with head
 1.55.6.2 10-Dec-2006  yamt sync with head.
 1.55.6.1 22-Oct-2006  yamt sync with head
 1.55.4.1 18-Nov-2006  ad Sync with head.
 1.58.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.58.24.1 06-Nov-2007  matt sync with HEAD
 1.58.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.58.8.1 23-Oct-2007  ad Sync with head.
 1.59.16.2 28-Sep-2008  mjf Sync with HEAD.
 1.59.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.60.4.3 16-Sep-2009  yamt 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.6.1 19-Oct-2008  haad Sync with HEAD.
 1.61.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.63.40.1 09-Jul-2016  skrll Sync with HEAD
 1.63.22.1 03-Dec-2017  jdolecek update from HEAD
 1.28 09-Feb-2024  andvar fix spelling mistakes, mainly in comments and log messages.
 1.27 10-Nov-2021  msaitoh s/endianess/endianness/
 1.26 16-Jun-2021  riastradh if_attach and if_initialize cannot fail, don't test return value

These were originally made failable back in 2017 when if_initialize
allocated a softint in every interface for link state changes, so
that it could fail gracefully instead of panicking:

https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html

However, this spawned many seldom- or never-tested error branches,
which are risky to have around. And that softint in every interface
has since been replaced by a single global workqueue, because link
state changes require thread context but not low latency or high
throughput:

https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html

So there is no longer any reason for if_initialize to fail. (The
subroutine if_stats_init can't fail because percpu_alloc can't fail
either.)

There is a snag: the softint_establish in if_percpuq_create could
fail, potentially leading to bad consequences later on trying to use
the softint. This change doesn't introduce any new bugs because of
the snag -- if_percpuq_attach was already broken. However, the snag
can be better addressed without spawning error branches, either by
using a single softint or making softints less scarce.

(Separate commit will change the signatures of if_attach and
if_initialize to return void, scheduled to ride whatever is the next
convenient kernel bump.)

Patch and testing on amd64 and evbmips64-eb by maya@; commit message
soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.
 1.25 29-Jan-2020  thorpej branches: 1.25.10;
Adopt <net/if_stats.h>.
 1.24 10-Nov-2019  chs branches: 1.24.2;
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.23 11-Oct-2019  kre Delete unused var (made redundant in previous commit). Unbreak build.
 1.22 10-Oct-2019  bad if we can memcpy to body->macaddr, we can memcpy from it.
 1.21 05-Mar-2019  msaitoh Centralize ETHER_ALIGN into net/if_ether.h. Note that this commit also changes
if_upgt.c's ETHER_ALIGN from 0 to 2.
 1.20 08-Jan-2019  msaitoh Whitespace fix.
 1.19 15-Nov-2018  maxv Remove the 'copy' argument from m_devget(), unused. While here rename
off0->off.
 1.18 26-Jun-2018  msaitoh branches: 1.18.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.17 25-Jun-2018  msaitoh Simplify bpf_mtap() call. No functional change.
 1.16 22-Jan-2018  maxv branches: 1.16.2;
Fix memory leak, looks like there is still something wrong here.
 1.15 23-Oct-2017  msaitoh If error occured in the attach function, free resources and return.
 1.14 25-Jun-2017  maxv two spl leaks, found by Mootja
 1.13 02-Feb-2017  nonaka branches: 1.13.6;
wlan interfaces make interrupt routine running on softint context.

see http://mail-index.netbsd.org/tech-kern/2016/12/06/msg021281.html

tested device:
* ath at pci: AR5212, AR5424
* athn at pci: AR9287
* ipw at pci: 2100BG
* iwi at pci: 2915ABG
* iwm at pci: 3165, 7260, 8260
* iwn at pci: 4945, 6235
* ral at pci: RT2560
* rtwn at pci: RTL8192CE
 1.12 15-Dec-2016  ozaki-r branches: 1.12.2;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.11 08-Dec-2016  ozaki-r Apply deferred if_start framework

if_schedule_deferred_start checks if the if_snd queue contains packets,
so drivers don't need to check it by themselves.
 1.10 11-Mar-2016  macallan branches: 1.10.2;
fix tpyo
 1.9 11-Mar-2016  christos PR/50949: David Binderman: Fix misplaced parens.
 1.8 09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.7 12-May-2014  christos branches: 1.7.4;
kill unused array split
 1.6 21-Apr-2014  pgoyette Revert previous and fix correctly. Thanks, joerg
 1.5 21-Apr-2014  pgoyette Insert { ... } to keep gcc happy when DPRINTF() macro is empty.
 1.4 21-Feb-2014  christos branches: 1.4.2;
PR/48606: Lloyd Parkes: Drivers not using ifp->if_input but using ether_input
directly.
 1.3 28-Jan-2014  martin Remove an unused variable
 1.2 17-Dec-2013  joerg Fix memset arguments.
 1.1 25-Aug-2012  kiyohara branches: 1.1.2; 1.1.4; 1.1.6;
Add malo@pcmcia.
 1.1.6.1 18-May-2014  rmind sync with head
 1.1.4.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.4.2 30-Oct-2012  yamt sync with head
 1.1.4.1 25-Aug-2012  yamt file if_malo_pcmcia.c was added on branch yamt-pagecache on 2012-10-30 17:21:57 +0000
 1.1.2.2 03-Dec-2017  jdolecek update from HEAD
 1.1.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.2.1 10-Aug-2014  tls Rebase.
 1.7.4.3 28-Aug-2017  skrll Sync with HEAD
 1.7.4.2 05-Feb-2017  skrll Sync with HEAD
 1.7.4.1 19-Mar-2016  skrll Sync with HEAD
 1.10.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.10.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.12.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.13.6.3 26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.13.6.2 10-Dec-2017  snj Pull up following revision(s) (requested by msaitoh in ticket #427):
sys/arch/amiga/dev/if_bah_zbus.c: 1.17
sys/arch/arm/broadcom/bcm53xx_eth.c: 1.30
sys/arch/powerpc/booke/dev/pq3etsec.c: 1.32
sys/arch/usermode/dev/if_veth.c: 1.9
sys/dev/ic/an.c: 1.66
sys/dev/ic/athn.c: 1.17
sys/dev/ic/atw.c: 1.162
sys/dev/ic/bwi.c: 1.33
sys/dev/ic/dwc_gmac.c: 1.41-1.42
sys/dev/ic/malo.c: 1.10
sys/dev/ic/rt2560.c: 1.31
sys/dev/ic/rt2661.c: 1.36
sys/dev/ic/rt2860.c: 1.29
sys/dev/ic/rtw.c: 1.127
sys/dev/ic/rtwvar.h: 1.46
sys/dev/ic/smc90cx6.c: 1.71
sys/dev/ic/smc90cx6var.h: 1.12
sys/dev/ic/wi.c: 1.244
sys/dev/pci/if_ipw.c: 1.66
sys/dev/pci/if_iwi.c: 1.104
sys/dev/pci/if_iwm.c: 1.76
sys/dev/pci/if_iwn.c: 1.86
sys/dev/pci/if_rtwn.c: 1.13
sys/dev/pci/if_wm.c: 1.541
sys/dev/pci/if_wpi.c: 1.79
sys/dev/pci/ixgbe/ixgbe.c: 1.106
sys/dev/pci/ixgbe/ixv.c: 1.73 via patch
sys/dev/pcmcia/if_malo_pcmcia.c: 1.15
sys/dev/scsipi/if_se.c: 1.95
sys/dev/usb/if_upl.c: 1.60
sys/net/if.c: 1.396
sys/net/if.h: 1.241
sys/net/if_arc.h: 1.23
sys/net/if_arcsubr.c: 1.78
sys/net/if_bridge.c: 1.136-1.137
sys/net/if_etherip.c: 1.39
sys/net/if_faith.c: 1.56
sys/net/if_gif.c: 1.131
sys/net/if_loop.c: 1.96
sys/net/if_mpls.c: 1.30
sys/net/if_pppoe.c: 1.129
sys/net/if_srt.c: 1.27
sys/net/if_stf.c: 1.102
sys/net/if_tap.c: 1.100
sys/net/if_vlan.c: 1.105
sys/netinet/ip_carp.c: 1.91
sys/rump/net/lib/libshmif/if_shmem.c: 1.73-1.74
sys/rump/net/lib/libvirtif/if_virt.c: 1.55-1.56
if_initalize() and if_attach() failed when resource allocation failed
(e.g. allocating softint). Without this change, it panics. It's bad because
resource shortage really occured when a lot of pseudo interface is created.
To avoid this problem, don't panic and change return value of if_initialize()
and if_attach() to int. Caller fanction will be recover from error cleanly by
checking the return value.
Return if bah_attach_subr() failed.
If if_attach() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add some missing frees in bridge_clone_destroy().
- KNF
If error occured in bcmeth_ccb_attach(), free resources and return.
If error occured in pq3etsec_attach(), free resources and return.
If error occured in the attach function, free resources and return.
- If if_initialize() failed in athn_attach(), free resources and return.
- Add missing pmf_event_deregister() in athn_detach().
- Free resources correctly on some errors in atw_attach().
- Use apint*() insread of printf() in the attach function.
If if_initialize() failed in the attach function, return.
- If if_initialize() failed in the attach function, free resources and return.
- Add missing dwc_gmac_free_dma_rings() and mutex_destroy() when attach
failed.
- If if_initialize() failed in the attach function, free resources and return.
- ifp is always not NULL in iwi_detach(). Check correctly with ifp->if_softc.
- If if_initialize() failed in the attach function, free resources and return.
- Fix error path in the attach function correctly.
If if_initialize() failed in the attach function, free resources and return.
If if_attach() failed in the attach function, free resources and return.
- If if_initialize() failed in the attach function, free resources and return.
- KNF
- If if_attach() failed in the attach function, free resources and return.
- KNF
Fix compile error.
Fix compile error.
We don't need '&mii', but just 'mii' for mii_detach().
Don't free sc_rthash twice
 1.13.6.1 10-Dec-2017  snj Pull up following revision(s) (requested by msaitoh in ticket #426):
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.14
two spl leaks, found by Mootja
 1.16.2.3 18-Jan-2019  pgoyette Synch with HEAD
 1.16.2.2 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.16.2.1 28-Jul-2018  pgoyette Sync with HEAD
 1.18.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.18.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.18.2.1 10-Jun-2019  christos Sync with HEAD
 1.24.2.1 29-Feb-2020  ad Sync with head.
 1.25.10.1 17-Jun-2021  thorpej Sync w/ HEAD.
 1.1 25-Aug-2012  kiyohara branches: 1.1.4;
Add malo@pcmcia.
 1.1.4.2 30-Oct-2012  yamt sync with head
 1.1.4.1 25-Aug-2012  yamt file if_malo_pcmciareg.h was added on branch yamt-pagecache on 2012-10-30 17:21:57 +0000
 1.4 31-Mar-2025  gutteridge if_malo_pcmciavar.h: function ref. and grammar fixes (NFC)
 1.3 02-Feb-2017  nonaka branches: 1.3.52;
wlan interfaces make interrupt routine running on softint context.

see http://mail-index.netbsd.org/tech-kern/2016/12/06/msg021281.html

tested device:
* ath at pci: AR5212, AR5424
* athn at pci: AR9287
* ipw at pci: 2100BG
* iwi at pci: 2915ABG
* iwm at pci: 3165, 7260, 8260
* iwn at pci: 4945, 6235
* ral at pci: RT2560
* rtwn at pci: RTL8192CE
 1.2 12-May-2014  christos branches: 1.2.4; 1.2.8; 1.2.12;
kill unused array split
 1.1 25-Aug-2012  kiyohara branches: 1.1.2; 1.1.4; 1.1.6; 1.1.14;
Add malo@pcmcia.
 1.1.14.1 10-Aug-2014  tls Rebase.
 1.1.6.1 18-May-2014  rmind sync with head
 1.1.4.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.4.2 30-Oct-2012  yamt sync with head
 1.1.4.1 25-Aug-2012  yamt file if_malo_pcmciavar.h was added on branch yamt-pagecache on 2012-10-30 17:21:57 +0000
 1.1.2.2 03-Dec-2017  jdolecek update from HEAD
 1.1.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.12.1 21-Apr-2017  bouyer Sync with HEAD
 1.2.8.1 20-Mar-2017  pgoyette Sync with HEAD
 1.2.4.1 05-Feb-2017  skrll Sync with HEAD
 1.3.52.1 02-Aug-2025  perseant Sync with HEAD
 1.47 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.46 12-May-2009  cegger branches: 1.46.22; 1.46.40;
struct device * -> device_t, no functional changes intended.
 1.45 28-Apr-2008  martin branches: 1.45.14;
Remove clause 3 and 4 from TNF licenses
 1.44 12-Apr-2008  tsutsui branches: 1.44.2; 1.44.4;
Split device_t/softc for MI mb86960, with misc cosmetics.
 1.43 05-Apr-2008  cegger use aprint_*_dev and device_xname
 1.42 19-Oct-2007  ad branches: 1.42.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.41 16-Nov-2006  christos branches: 1.41.8; 1.41.22; 1.41.24; 1.41.28;
__unused removal on arguments; approved by core.
 1.40 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.39 30-Aug-2006  christos branches: 1.39.2; 1.39.4;
add missing initializers
 1.38 11-Dec-2005  christos branches: 1.38.4; 1.38.8;
merge ktrace-lwp.
 1.37 27-Feb-2005  perry branches: 1.37.4;
nuke trailing whitespace
 1.36 04-Feb-2005  perry de-__P
 1.35 11-Aug-2004  mycroft branches: 1.35.4; 1.35.6;
Do the read of the MAC address before enabling the function the first time,
so we're still in memory mode.
 1.34 10-Aug-2004  mycroft Update to the new world order.
 1.33 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.32 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.31 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.30 30-Nov-2002  tsutsui branches: 1.30.6;
More cleanup of MI mb86960 driver:
- Add support for byte system bus mode. Based on patch in kern/17193 by
Christian Groessler, with some improvements by me.
- Rename sc_flags in mb86960_softc to sc_stat, rename "type" to sc_flags
to specify controller quirks and remove enum mb86960_type.
- Pass controller type via new sc_flags in mb86960_softc rather than
via an mb86960_attach() arg.
- Handle unaligned mbufs properly in mb86960_write_mbufs(). (from ne2000.c)
- Fix a signed/unsigned comparision warning.
- Add definitions of status bits in the RX packed header.
- Change types of some members in mb86960_softc.
 1.29 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.28 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.27 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.26 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.25 23-Dec-2001  ichiro branches: 1.25.8;
support FUJITSU MB86960/5 based ethernet cards
FMV-J181,182,182A
 1.24 18-Dec-2001  ichiro change routine of device search.
mbe_pcmcia_lookup() is introduced
 1.23 16-Dec-2001  ichiro support FUJITSU CF EthernetCard
ITCFJ181A

mbe0 at pcmcia1 function 0: Fujitsu J182A Compact Flash Ethernet
mbe0: Ethernet address 00:00:0e:c5:01:ea
 1.22 15-Dec-2001  soren To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.21 13-Nov-2001  lukem add RCSIDs
 1.20 15-May-2000  enami branches: 1.20.6; 1.20.8;
Free memory when failed to map it.
 1.19 15-May-2000  enami Cosmetic changes.
 1.18 11-May-2000  is RATOC REX-R280 (another if_mbe_pcmcia card) support by UCHIYAMA Yasushi.
Originally part of pr 6789, reworked by the submitter to fit into -current.
 1.17 04-Feb-2000  enami Actually, no need to keep track of sc_ih.
 1.16 04-Feb-2000  enami Disestablish an interrupt if failed to enable the card.
 1.15 04-Feb-2000  enami Remove no longer necessary old code.
 1.14 04-Feb-2000  enami Release the resource on attach failure.
 1.13 04-Feb-2000  cgd replace the *_lookup table entry match/lookup functions in all of
these drivers with a single common function (which supports tables
of variable-sized structures). Things are mostly as they were before:
tables are terminated by entry with NULL name, etc. There's also
the ability to call a driver-specific match function which can be used
to augment the table lookup.
 1.12 02-Feb-2000  enami Add detach support.
 1.11 29-Nov-1999  jun Support for TDK LAC-CF010
by Ichiro Fukuhara (ichiro@ichiro.org) on kern/8900
ichiro test TDK CF Card on Opensource matsuri,tokyo and send patch to us.
thanx.
 1.10 18-Nov-1999  enami Cope with new return value of pcmcia_scan_cis(). (Actually, it's not
so new but at least newer when I wrote these code).
 1.9 27-Oct-1999  is Yet another Fujitsu Ethernet card.
Contributed by HEO SeonMeyong in PR 8658.
 1.8 24-Aug-1999  tron branches: 1.8.2; 1.8.4; 1.8.6;
Add Allied Telesis LA-PCM (NE2000 compatible) and Contec C-NET(PC)C
(MB8696x based) pcmcia ethernet cards. Patches supplied by
Kawamoto Yosihisa in PR kern/8260 and kern/8261.
 1.7 27-Apr-1999  thorpej Add support for the Fujitsu Towa LA501 Ethernet card. PR #6524, Stephen Ma.
 1.6 18-Nov-1998  thorpej branches: 1.6.4;
Now that the *_activate() functions don't do things which are attachment
specific, move them into the chipset drivers.
 1.5 18-Nov-1998  thorpej Move the i/o window unmap and i/o space free into *_detach().
 1.4 17-Nov-1998  thorpej Add detach and activate entry points. Mostly functional except for
#ifdef notyet'd if_delref() and if_detach(), which will be fixed up
when that code is committed.
 1.3 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.2 09-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.1 22-Mar-1998  enami PCMCIA bus attachment for MB8696x based Ethernet card.
 1.6.4.1 27-Apr-1999  perry branches: 1.6.4.1.2;
pullup 1.6->1.7 (thorpej): Add Fujitsu LA501 (PR6524, Stephen Ma)
 1.6.4.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.8.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.4.1 15-Nov-1999  fvdl Sync with -current
 1.8.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.20.8.3 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.20.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.20.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.20.6.5 11-Dec-2002  thorpej Sync with HEAD.
 1.20.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.20.6.3 20-Jun-2002  nathanw Catch up to -current.
 1.20.6.2 08-Jan-2002  nathanw Catch up to -current.
 1.20.6.1 14-Nov-2001  nathanw Catch up to -current.
 1.25.8.1 20-Jun-2002  gehenna catch up with -current.
 1.30.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.30.6.4 04-Feb-2005  skrll Sync with HEAD.
 1.30.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.30.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.30.6.1 12-Aug-2004  skrll Sync with HEAD.
 1.35.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.35.6.1 12-Feb-2005  yamt sync with head.
 1.35.4.1 29-Apr-2005  kent sync with -current
 1.37.4.2 27-Oct-2007  yamt sync with head.
 1.37.4.1 30-Dec-2006  yamt sync with head.
 1.38.8.1 03-Sep-2006  yamt sync with head.
 1.38.4.1 09-Sep-2006  rpaulo sync with head
 1.39.4.2 10-Dec-2006  yamt sync with head.
 1.39.4.1 22-Oct-2006  yamt sync with head
 1.39.2.1 18-Nov-2006  ad Sync with head.
 1.41.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.41.24.1 06-Nov-2007  matt sync with HEAD
 1.41.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.41.8.1 23-Oct-2007  ad Sync with head.
 1.42.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.44.4.2 16-May-2009  yamt sync with head
 1.44.4.1 16-May-2008  yamt sync with head.
 1.44.2.1 18-May-2008  yamt sync with head.
 1.45.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.46.40.1 09-Jul-2016  skrll Sync with HEAD
 1.46.22.1 03-Dec-2017  jdolecek update from HEAD
 1.161 27-Dec-2019  msaitoh s/enty/entry/ in comment.
 1.160 17-Oct-2013  christos branches: 1.160.30;
remove unused variable
 1.159 26-Nov-2011  nonaka branches: 1.159.8; 1.159.12;
Add Corega Ether CF-TD LAN Card.
 1.158 02-Jan-2010  christos branches: 1.158.12;
convert to pmf
 1.157 05-Sep-2009  tsutsui Invert logic around nested pmf(9) registrations for readability.
 1.156 05-Apr-2009  uwe Provide pmf(9) hooks that do what dopowerhooks(9) hook does.

XXX: Do NOT call pmf_class_network_register() yet, b/c db8320.c
doesn't provide if_stop method!
 1.155 16-May-2008  jnemeth branches: 1.155.6; 1.155.12;
added Corega LAPCCTXT FastEthernet
 1.154 05-Apr-2008  cegger branches: 1.154.2; 1.154.4; 1.154.6;
use aprint_*_dev and device_xname
 1.153 28-Mar-2008  uwe aprint_naive("\n");
 1.152 12-Mar-2008  cube Split device_t and softc for the NE2000 Ethernet chip and all its variants
and attachments. Use device_t accessors, correct types, and ANSIfy when
appropriate.
 1.151 09-Mar-2008  dholland Use NE2000_TYPE_UNKNOWN instead of just 0 in a couple places.
 1.150 19-Oct-2007  ad branches: 1.150.12; 1.150.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.149 16-Nov-2006  christos branches: 1.149.2; 1.149.8; 1.149.22; 1.149.24; 1.149.28;
__unused removal on arguments; approved by core.
 1.148 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.147 24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.146 23-Sep-2006  jmcneill PR# 15666: EDIMAX EP-4101 PCMCIA card support (patch included)
 1.145 23-Sep-2006  jmcneill PR# 27840: patch for IO DATA PCET/TX-R PCMCIA Ethernet card support
 1.144 30-Aug-2006  christos branches: 1.144.2; 1.144.4;
fix initializers.
 1.143 11-Jul-2006  peter Add power hooks for "ne* at pcmcia?".

ok christos@
 1.142 23-Mar-2006  christos branches: 1.142.4;
PR/33133: Dave J. Barnes: Belkin F5D5020 Ethernet PCMCIA card not recognised
 1.141 11-Dec-2005  christos branches: 1.141.4; 1.141.6; 1.141.8; 1.141.10; 1.141.12;
merge ktrace-lwp.
 1.140 30-May-2005  christos branches: 1.140.2;
- add const
- avoid variable shadow
- do proper UNCONST with XXXUNCONST
 1.139 27-Feb-2005  perry nuke trailing whitespace
 1.138 04-Feb-2005  perry de-__P
 1.137 15-Oct-2004  enami branches: 1.137.4; 1.137.6;
Don't change the logic when simplifing code; a OR was changed to AND
and a test was removed but they shouldn't be changed.
 1.136 14-Oct-2004  christos PR/27255: Nikos Ntarmos: PCMCIA NIC with blank CIS tuples crashes the kernel
Simplify the code for readability.
 1.135 12-Aug-2004  mycroft Now that we write the IOBASE in generic code, don't do it here. Instead,
implement the hackish/stupid test for the AX88190 by just checking whether
the IOBASE is available in the CCR.

This is unspeakably wrong, but it leaves the code doing ~the same thing it
did before.
 1.134 12-Aug-2004  mycroft The AX88790 hack never made any sense. It's setting the PWRDWN bit in the CCR!
So, I'm removing it.
 1.133 11-Aug-2004  mycroft Always use PCMCIA_WIDTH_AUTO rather than PCMCIA_WIDTH_IO16. This spec is
pretty clear on how this works.
 1.132 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.131 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.130 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.129 10-Aug-2004  mycroft Update to the new world order.

"While I'm here..."
All that grotesque code allegedly for the 88190 and 88790 is actually just
mapping the CCR and writing to it. So, enable the device normally and use
pcmcia_ccr_{read,write}() rather than doing this crap ourselves.
 1.128 09-Aug-2004  mycroft Adapt to the new world order.
 1.127 09-Aug-2004  mycroft Create two windows iff the config table asks for it. Try to make them
contiguous. Map windows with mode AUTO since we have mixed size access.
 1.126 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.125 07-Aug-2004  mycroft Clean up attach messages.
 1.124 06-Aug-2004  mycroft A few things:
* The DEPCM-XX cards don't need to be recognized by OUI or string -- they
work just fine with the IO-DATA PC-LAT/E attachment, and are probable OEM.
So, remove the DEPCM case.
* PCMCIA_STR_* elimination.
* The Megahertz EM3336 is not always an X-Jack device, so take the "XJ" out
of the product number.
 1.123 17-Jul-2004  mycroft A bit of cleanup:
* Change PCMCIA_CIS_* values that are empty to PCMCIA_CIS_INVALID.
* Use wildcard OUIs in a few more places.
* Steal a method for differentiating the AX88[17]90 from the Linux driver.
* Remove the ZoNet card entry; it's now a duplicate of the Compex entry.
 1.122 09-Jul-2004  enami This comment describes about the entry for FNW-3700T so please don't put
other entry between them.
 1.121 09-Jul-2004  enami Add BUFFALO LPC-CF-CLT Ethernet Adapter entry.
 1.120 07-Jul-2004  mycroft More cleanup:
* Print "devinfo" in a canonial place (like we do in the SCSI code).
* Use aprint_{error,normal}() during attach.
* More PCMCIA_STR_* removal.
 1.119 07-Jul-2004  mycroft Add new devices. Use pcmcia_devinfo().
 1.118 07-Jul-2004  mycroft Add a couple more entries.
 1.117 07-Jul-2004  mycroft This table is dumb.
1) Remove all the PCMCIA_STR_* values, and instead print the actual CIS
info. This is infinitely more helpful.
2) For some of the OEM cards, collapse multiple table entries into one
entry that doesn't compare the OUI.
It's a start.
 1.116 07-Jul-2004  mycroft Add another OUI for a Melco card.

XXX
The way this table is done is kind of dumb. There's really every little point
in matching anything beyond vendor/product IDs in most cases, unless we
specifically need to do some hackery to find the MAC address. In many cases 4
or 5 manufacturers well have the same vendor/product IDs, but different OUIs
and possibly different strings. In these cases, we rarely need to look at the
OUI or the strings to DTRT.
 1.115 04-Jul-2004  mycroft Add an entry for the Netgear FA410TX -- though not quite the way it was
suggested in PR 20227.
 1.114 19-Jun-2004  itohy Add corega FEtherII PCC-TXD.
From website of Sano Yukihiko.
 1.113 25-May-2004  is My incarnation of the RPTI 400 card tells 0:0:0:0:0:0 when using the ASIC
to read the Ethernet address. However, as other OS's drivers suggest,
something which looks right is at offset 0x110.
 1.112 25-Apr-2004  itojun make it compile (printf # of arg mismatch)
 1.111 25-Apr-2004  cube Add a third possible vendor code for the D-Link DFE670-TXD. While there,
make the `unmatched vendor code' error message slightly more verbose to
make things easier next time this kind of issue arises.

Reported and tested by Pierre-Philipp Braun.
 1.110 13-Mar-2004  cube branches: 1.110.2;
The D-Link DFE-670TXD can appear with two different vendor IDs for the MAC
address. The two IDs belong to D-Link. Therefore, add a duplicate entry
with a matching vendor ID.

Reported and tested by syn at sceen dot net.
 1.109 13-Feb-2004  wiz RealTek -> Realtek.
 1.108 01-Feb-2004  uwe Recognize TAMARACK Ethernet Card.
From PR: 12273 and Mathias Menzel-Nielsen (matze matzsoft de).
 1.107 07-Nov-2003  hamajima support Corega Ether PCC-TL -- from Yasushi Oshima
 1.106 28-Oct-2003  mycroft Eliminate bogus initializer.
 1.105 25-Oct-2003  christos Fix uninitialized variable warnings
 1.104 22-Oct-2003  christos support for NE2000_TYPE_AX88790 from
Yong-Jhen Hong yongjhen at alqualonde dot org
 1.103 02-Sep-2003  ichiro add support IO-DATA PCET/TX-R EthernetCard
 1.102 26-Jul-2003  martin Add support for socket communications 10/100 CF ethernet card.
From Scott Renfro in PR 22260.
 1.101 09-Apr-2003  christos branches: 1.101.2;
A cardflash NE2000 from Michael Francini francini at mindspring dot com.
 1.100 16-Jan-2003  kanaoka Add support for SMC 8041TX 10/100 Ether PC Card.
 1.99 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.98 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.97 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.96 15-Sep-2002  bouyer Add ACCTON EN2216-PCMCIA-ETHERNET (there seems to be different variants of
the ACCTON EN2216) to pcmciadevs, and support this adapter by if_ne_pcmcia.
Tested by R�mi Zara <remi_zara@mac.com>.
 1.95 13-Sep-2002  simonb Fix indent botch.
 1.94 23-Jul-2002  christos PR/17686: Cliff Albert: Dynalink L10C pcmcia card is not supported
 1.93 03-Jun-2002  jonathan Add stanza to match and configure D-Link DFE-670 cards (a DL10022 variant).

Also print a little more info (including CIS tuples) when cards don't match,
making it a little easier to patch in entries.
 1.92 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.91 01-Jun-2002  itojun new ne0 pcmcia pccard: corega EtherII PCC-TD
PR 17134, From: <fujiwara@f.pyon.org>, Kazunori@netbsd.org, Fujiwara@netbsd.org
 1.90 08-May-2002  chris branches: 1.90.2; 1.90.4;
Add detection for the NetGear FA411. It just seems to work as an ne device.
 1.89 30-Apr-2002  uch add BUFFALO LPC3-CLT Ethernet Adapter.
 1.88 28-Mar-2002  christos PR/16108: Emmanuel Lochin: One more card identifier.
 1.87 31-Jan-2002  haya Add an entry for NEC 9801N_J12, which is an OEM of IBM infomover.
PR #14084.
 1.86 30-Jan-2002  is Add Lantech Fastnet/TX (really generic ASIX AX88190) card
 1.85 13-Jan-2002  aymeric add Edimax Technology Inc. EP4000A
add another Linksys Etherfast clone (Level One)
 1.84 15-Dec-2001  soren To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.83 13-Nov-2001  lukem add RCSIDs
 1.82 21-Oct-2001  mjl Add Corega PCC-TD, as per PR/14161
 1.81 07-Aug-2001  christos Add zonet zen (Henrik Berglund)
 1.80 04-Aug-2001  enami MII access routines for ASIX AX88190.
 1.79 31-Jul-2001  christos recognize dlink-660+, from jandberg@netbsd.org (Jukka Andberg)
 1.78 05-Jul-2001  kanaoka branches: 1.78.2;
Add support for "Laneed LD-10/100CDA".
 1.77 29-Jun-2001  christos PR/13337: de SAINT LEGER Rodolphe: Add support for the cn40bc ne clone.
 1.76 13-Jun-2001  toddpw Enable attachment for Kingston KNE-PC2 Ethernet.
 1.75 05-Jun-2001  thorpej Use the DL10019 media routines on the DL10019 and DL10022 (a change
I forgot to commit long ago).
 1.74 03-Jun-2001  thorpej Differentiate between a DL10019 and a DL10022 (they have slight
MII differences).
 1.73 21-May-2001  ichiro add product COREGA FEther-PCC-TXF
kern/11357 and report from goro@venus.dti.ne.jp
 1.72 18-May-2001  jhawk Support the Socket EA pcmcia ethernet (ne). It's ooooold.
 1.71 14-May-2001  ichiro Corega FEther PCC-TXD works fine.
 1.70 20-Feb-2001  aymeric branches: 1.70.2;
Put the correct ethernet address prefix for the Synergy 21 card.
This reflects reality, although the value is ignored anyway.
 1.69 19-Feb-2001  aymeric Add an entry for the Synergy 21 S21810+
From Stefan Blomen <Stefan.Blomen@gmx.de>
 1.68 12-Feb-2001  thorpej Adjust the way that media is initialized on DP8390-compatible
chips. The dp8390_softc now has media_init and media_fini
function pointers that do the work.
 1.67 18-Jan-2001  jdolecek constify
 1.66 03-Nov-2000  toddpw Add support for Socket Comm. PC Card Ethernet, and tidy up naming.
 1.65 02-Nov-2000  msaitoh add support:
MELCO LPC2-TX
Telecom Device TCD-HPC100
MACNICA ME1-JEIDA
 1.64 02-Nov-2000  msaitoh Fix two bugs.

- Doesn't fail ne_pcmcia_attach() if ne_pcmcia_ax88190_set_iobase() failed.

- Check whether LIOBASE register is writable or not (dirty hack!).
Fix PR. 11285
 1.63 17-Oct-2000  shin cosmetic change.
 1.62 25-May-2000  mycroft branches: 1.62.4;
Recognize the DE-650 with another vendor/product pair and OUI.
 1.61 23-May-2000  mycroft Recognize more models of the IBM card. From PR 10137.
 1.60 12-Apr-2000  scw Add support for the SOHOware PCMCIA Ethernet card, model ND5100-E.
This seems to be a re-badged NDC (National Datacomms. Corp) card.
It needs a quirk entry due to lack of manufacturer tuple in the CIS.
For some reason, the 'Tx/Rx' LED on the connector module is inverted
such that it is off during network activity...
 1.59 20-Mar-2000  tron Add support for RPTI-EP400 PCMCIA network adapter. Patches supplied by
Tim Walls in PR kern/9644.
 1.58 27-Feb-2000  uch Billionton Systems Inc. LNT-10TN card.
 1.57 20-Feb-2000  enami Try other config entry on i/o space alloc failure.
 1.56 14-Feb-2000  enami Put the entry of FNW-3700T after the entry of SVEC-PN650TX
so that SVEC-PN650TX errornously recognized as FNW-3700T.
Pointed out by Takahiro Kambe <taca@sky.yamashina.kyoto.jp>.
 1.55 09-Feb-2000  enami ASIX AX88190 support (Planex FNW-3700-T and Melco LPC3-TX) from FreeBSD/PAO3.
 1.54 09-Feb-2000  enami Support Xircom CompactCard Ethernet CFE-10.
 1.53 09-Feb-2000  enami - Since all resources are mandatory, no need to manage individually.
- KNF some code.
- Factor out some code into function.
- Disestablish an interrupt handler when failed to enable card power.
 1.52 02-Feb-2000  itojun handle attach failure in ne/pcmcia more carefully. (otherwise we'll
have trouble on detach)
 1.51 02-Feb-2000  itojun use a bit more standard (sys/device.h) prototype for {dp8390,ne2000}_detach().
 1.50 02-Feb-2000  itojun enami's fix to dp8390 did the trick, it does not hang up any more.
enable detach routine by default.
 1.49 02-Feb-2000  itojun implement if_detach code for ne/pcmcia.
XXX still incomplete, ne_pcmcia_detach() commented out for safery - please test
 1.48 26-Jan-2000  thorpej Add the Linksys Etherfast 10/100. These are currently being rebadged
as the NetGear FA410TX 16-bit PC Card.
 1.47 25-Jan-2000  mycroft Oops; fix a bug in the previous:
If one entry has the DL10019 bit set and another does not, don't fail
immediately if the checksum doesn't work.
 1.46 25-Jan-2000  mycroft Use the Ethernet vendor ID to differentiate multiple cards with the same
vendor,product pair. (Yuck.)
 1.45 05-Dec-1999  danw add Epson EEN10B ethernet
 1.44 06-Nov-1999  enami branches: 1.44.2;
Support an earlier version of IO-DATA PCLA/T.
 1.43 28-Oct-1999  jun add
SOCKET LOW POWER ETHERNET Compact Flash Card.
 1.42 28-Oct-1999  jun add entry Corega PCC-TX PCMCIA card.
 1.41 28-Oct-1999  jun Sorry backout Patch about COREGA FAST_ETHER_PCC_TX.
 1.40 28-Oct-1999  jun add Corega PCC-TX PCMCIA Card (not CardBus but 100Base-TX) Entry.
 1.39 27-Sep-1999  enami branches: 1.39.2; 1.39.4; 1.39.6;
Support Planex Communications Inc, FNW-3600-T.
 1.38 25-Sep-1999  enami Add support for Corega EthernetII PCC T. This diff is submitted
as PR#8485 by HEO SeonMeyong.
 1.37 09-Sep-1999  is Ambicom support by Vincent Aymeric
 1.36 24-Aug-1999  tron Add Allied Telesis LA-PCM (NE2000 compatible) and Contec C-NET(PC)C
(MB8696x based) pcmcia ethernet cards. Patches supplied by
Kawamoto Yosihisa in PR kern/8260 and kern/8261.
 1.35 24-May-1999  christos Fix PR/7634 properly, by adding the card to pcmciadevs
 1.34 24-May-1999  augustss SMC 8022 PCMCIA ethercard entry for if_ne_pcmcia.c
From Zdenek Salvet <salvet@ics.muni.cz> in PR 7634.
 1.33 16-Apr-1999  abs Fix enet_vendor entries for Compex Linkport Enet B (PR 7238)
 1.32 09-Apr-1999  abs Fix ethernet address location for Compex Linkport ENET-B. From PR 7238.
 1.31 29-Dec-1998  marc branches: 1.31.2;
added SVEC_LANCARD
 1.30 18-Dec-1998  thorpej Add the Compex Linkport ENET-B Ethernet card, PR #6349, Ingolf Koch.
 1.29 18-Dec-1998  thorpej Add the SVEC/Hawking Tech. Combo card. PR #6461, Rafal Boni.
 1.28 18-Dec-1998  thorpej Add support for the Corega PCC-T Ethernet, PR #6603, Takahiro Kambe.
 1.27 18-Nov-1998  thorpej Now that the *_activate() functions don't do things which are attachment
specific, move them into the chipset drivers.
 1.26 18-Nov-1998  thorpej Move the i/o window unmap and i/o space free into *_detach().
 1.25 17-Nov-1998  thorpej Add detach and activate entry points. Mostly functional except for
#ifdef notyet'd if_delref() and if_detach(), which will be fixed up
when that code is committed.
 1.24 16-Nov-1998  itohy Oops, I should have been more careful about the last modification....
Since D-Link DE-650 is not the only exception, restore Linksys EC1 entry to the
previous position and move D-Link entry below that to make the source cleaner.
 1.23 04-Nov-1998  itohy Allow newer versions of D-Link DE650 cards (the manufacturer and
the product are valid and the same as Linksys EthernetCard's) work
with the current ne driver.
Somewhat kludgy.
 1.22 31-Oct-1998  thorpej Add code to detect a RealTek 8019 chip, and use the media selection
support if present.
 1.21 28-Oct-1998  thorpej Add media list, media list count, and default media arguments to
ne2000_attach().
 1.20 07-Oct-1998  jtk update for a broken variant of the Linksys E-CARD
 1.19 23-Sep-1998  veego Reorder the ne2000devs entries. So all PCMCIA_VENDOR_INVALID and/or
PCMCIA_PRODUCT_INVALID entries comes first.
 1.18 20-Sep-1998  dbj Added support for a Dayna Communicard E that probes with a
different product id (0x2f) than the one we had (0x2d)
 1.17 15-Aug-1998  thorpej Add the Trust Combo EthernetCard, from Dante Profeta.
 1.16 15-Aug-1998  thorpej Add support for the D-Link DE-660. From Tero Kivinen <kivinen@ssh.fi>,
PR #5691.
 1.15 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.14 28-Jun-1998  christos PR/5671: Brett Lymn: Add CIS strings for en2212
 1.13 27-Jun-1998  christos PR/5662: Thilo Manske: Add signature of RPTI EP401 card.
 1.12 09-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.11 06-Mar-1998  thorpej Add Dayna CommuniCard E, from Havard Eidnes, PR #5120. Also, remove a
few unnecessary/no-longer-completely-accurate comments.
 1.10 13-Feb-1998  enami Move entry for IO-DATA PCLA/T out from comment. Since there may be
two different location for MAC address, just make bus-independent
layer to ask it.
 1.9 31-Dec-1997  enami Don't print newline at beginning of line.
 1.8 18-Dec-1997  perry fix the Linksys Combo EthernetCard (for carrel)
 1.7 30-Nov-1997  drochner fix argument declaration inconsistency in the
non-"__BROKEN_INDIRECT_CONFIG" case
 1.6 20-Nov-1997  thorpej Add support for the D-Link DE-650, from Eric S. Hvozda <hvozda@helios.ack.org>,
PR #4455.
 1.5 02-Nov-1997  thorpej Adjust for ifmedia-related changes to dp8390 driver.
 1.4 19-Oct-1997  enami branches: 1.4.2;
Make `manufacturer' and `product' 32bit wide so that they can contain
both 16bit id values found in card CIS and special value to indicate
that no value found in CIS. Use that special value for the card that
doesn't have id values. Test that value in ne2000_match().
 1.3 18-Oct-1997  enami Pull down changes from branch which is commited to by mistake...

> revision 1.1.2.6
> date: 1997/10/18 10:50:21; author: enami; state: Exp; lines: +2 -2
> In the macro ne2000_match(), use its argument `fct' instead of
> using pa->pf->number directly.
 1.2 16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1 14-Oct-1997  thorpej branches: 1.1.2;
file if_ne_pcmcia.c was initially added on branch marc-pcmcia.
 1.1.2.6 18-Oct-1997  enami In the macro ne2000_match(), use its argument `fct' instead of
using pa->pf->number directly.
 1.1.2.5 16-Oct-1997  thorpej Copyright/license update.
 1.1.2.4 16-Oct-1997  thorpej Don't establish our interrupt hander at attach time. Instead, establish
it in the enable hook, and disestablish it in the disable hook. This gives
us two wins:

- Allows us to more fairly allocate an interrupt after other
devices which can't do dynamic allocation have hooked up
theirs.

- In the event the default interrupt allocation scheme is bad,
this allows us to bring an interface down, patch a kernel
variable (eventually, run a program that does the right
thing for us) to set up an interrupt allocation scheme suitable
for our laptop model, bring the interface back up, and have
the Right Thing happen.
 1.1.2.3 15-Oct-1997  enami No need to cast a generic pointer.
 1.1.2.2 14-Oct-1997  thorpej Add power management hooks.
 1.1.2.1 14-Oct-1997  thorpej Split off NE2000 support from the ISA "ed" driver, and create a new "ne"
driver that deals with NE2000s and compatibles on ISA, PCI, and PCMCIA
busses.

This driver uses the generic DP8390 core chipset back-end.

NOTE: There are several changes between this driver and the old "ed"
front-end for PCMCIA. Notably, the i/o space allocation strategy has
been changed somewhat to allow this to work with odd host pcmcia bridges.
 1.4.2.3 18-Dec-1997  perry pullup from trunk: fix the Linksys Combo EthernetCard (for carrel)
 1.4.2.2 20-Nov-1997  thorpej Pull up from trunk: Support D-Link DE-650.
 1.4.2.1 05-Nov-1997  thorpej Pullup from trunk: update for ifmedia changes to dp8390.c
 1.31.2.2 19-Apr-1999  perry branches: 1.31.2.2.2;
pullup 1.32->1.33, as requested by David Brownlee to fix pr 7238.
 1.31.2.1 14-Apr-1999  abs Pullup revision 1.32:
Fix ethernet address location for Compex Linkport ENET-B. From PR 7238
 1.31.2.2.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.39.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.39.4.1 15-Nov-1999  fvdl Sync with -current
 1.39.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.39.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.39.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.39.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.44.2.2 06-Nov-1999  enami Support an earlier version of IO-DATA PCLA/T.
 1.44.2.1 06-Nov-1999  enami file if_ne_pcmcia.c was added on branch comdex-fall-1999 on 1999-11-06 00:58:33 +0000
 1.62.4.7 14-Feb-2002  he Pull up revisions 1.81,1.85 (via patch, requested by aymeric):
Add support for the following cards:
o Edimax Technology Inc. EP4000A
o Linksys Etherfast clone (Level One)
o Zonet Zen
 1.62.4.6 09-Feb-2002  he Pull up revision 1.87 (requested by haya):
Add support for NEC 9801N-J12 pcmcia card.
 1.62.4.5 16-Jun-2001  he Pull up revision 1.76 (requested by toddpw):
Add support for ``Kingston KNE-PC2 Ethernet'' pcmcia cards.
 1.62.4.4 26-May-2001  he Pull up revision 1.72 (requested by jhawk):
Support the Socket EA pcmcia ethernet cards.
 1.62.4.3 04-Apr-2001  he Pull up revision 1.66 (via patch, requested by toddpw):
Add support for the Socket Communications LP-E Type II PCMCIA
NE2000 clone card.
 1.62.4.2 16-Mar-2001  he Pull up revisions 1.69-1.70 (requested by aymeric):
Add an entry and support for the Synergy 21 S21810+.
 1.62.4.1 05-Nov-2000  tv Pullup 1.64 [msaitoh]:
Fix two bugs.

- Doesn't fail ne_pcmcia_attach() if ne_pcmcia_ax88190_set_iobase() failed.

- Check whether LIOBASE register is writable or not (dirty hack!).
Fix PR. 11285
 1.70.2.12 17-Jan-2003  thorpej Sync with HEAD.
 1.70.2.11 18-Oct-2002  nathanw Catch up to -current.
 1.70.2.10 17-Sep-2002  nathanw Catch up to -current.
 1.70.2.9 01-Aug-2002  nathanw Catch up to -current.
 1.70.2.8 20-Jun-2002  nathanw Catch up to -current.
 1.70.2.7 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.70.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.70.2.5 08-Jan-2002  nathanw Catch up to -current.
 1.70.2.4 14-Nov-2001  nathanw Catch up to -current.
 1.70.2.3 22-Oct-2001  nathanw Catch up to -current.
 1.70.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.70.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.78.2.7 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.78.2.6 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.78.2.5 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.78.2.4 11-Feb-2002  jdolecek Sync w/ -current.
 1.78.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.78.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.78.2.1 03-Aug-2001  lukem update to -current
 1.90.4.3 29-May-2004  tron Pull up revision 1.113 (requested by is in ticket #1703):
My incarnation of the RPTI 400 card tells 0:0:0:0:0:0 when using the ASIC
to read the Ethernet address. However, as other OS's drivers suggest,
something which looks right is at offset 0x110.
 1.90.4.2 18-Sep-2002  thorpej pullup-1-6 ticket #829, bouyer@antioche.eu.org.

1.95 -> 1.96 syssrc/sys/dev/pcmcia/if_ne_pcmcia.c
1.176 -> 1.177 syssrc/sys/dev/pcmcia/pcmciadevs

Original log message:

Add ACCTON EN2216-PCMCIA-ETHERNET (there seems to be different variants of
the ACCTON EN2216) to pcmciadevs, and support this adapter by if_ne_pcmcia.
Tested by R�mi Zara <remi_zara@mac.com>.
 1.90.4.1 11-Jun-2002  lukem Pull up revision 1.93 (requested by jonathan in ticket #146):
Add support for the D-Link DFE-670TXD pcmcia card.
 1.90.2.2 29-Aug-2002  gehenna catch up with -current.
 1.90.2.1 20-Jun-2002  gehenna catch up with -current.
 1.101.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.101.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.101.2.7 04-Feb-2005  skrll Sync with HEAD.
 1.101.2.6 19-Oct-2004  skrll Sync with HEAD
 1.101.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.101.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.101.2.3 25-Aug-2004  skrll Sync with HEAD.
 1.101.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.101.2.1 03-Aug-2004  skrll Sync with HEAD
 1.110.2.4 05-Jul-2004  he Pull up revision 1.115 (requested by mycroft in ticket #602):
Add an entry for the Netgear FA410TX. Fixes PR#20227.
 1.110.2.3 29-May-2004  tron Pull up revision 1.113 (requested by is in ticket #413):
My incarnation of the RPTI 400 card tells 0:0:0:0:0:0 when using the ASIC
to read the Ethernet address. However, as other OS's drivers suggest,
something which looks right is at offset 0x110.
 1.110.2.2 12-May-2004  tron Pull up revision 1.112 (requested by cube in ticket #315):
make it compile (printf # of arg mismatch)
 1.110.2.1 12-May-2004  tron Pull up revision 1.111 (requested by cube in ticket #315):
Add a third possible vendor code for the D-Link DFE670-TXD. While
there, make the `unmatched vendor code' error message slightly more
verbose to make things easier next time this kind of issue arises.
Reported and tested by Pierre-Philipp Braun.
 1.137.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.137.6.1 12-Feb-2005  yamt sync with head.
 1.137.4.1 29-Apr-2005  kent sync with -current
 1.140.2.4 17-Mar-2008  yamt sync with head.
 1.140.2.3 27-Oct-2007  yamt sync with head.
 1.140.2.2 30-Dec-2006  yamt sync with head.
 1.140.2.1 21-Jun-2006  yamt sync with head.
 1.141.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.141.10.1 19-Apr-2006  elad sync with head.
 1.141.8.3 03-Sep-2006  yamt sync with head.
 1.141.8.2 11-Aug-2006  yamt sync with head
 1.141.8.1 01-Apr-2006  yamt sync with head.
 1.141.6.1 22-Apr-2006  simonb Sync with head.
 1.141.4.1 09-Sep-2006  rpaulo sync with head
 1.142.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.144.4.2 10-Dec-2006  yamt sync with head.
 1.144.4.1 22-Oct-2006  yamt sync with head
 1.144.2.1 18-Nov-2006  ad Sync with head.
 1.149.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.149.24.2 23-Mar-2008  matt sync with HEAD
 1.149.24.1 06-Nov-2007  matt sync with HEAD
 1.149.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.149.8.1 23-Oct-2007  ad Sync with head.
 1.149.2.1 14-Nov-2012  riz Pull up following revision(s) (requested by jnemeth in ticket #1467):
sys/dev/pcmcia/pcmciadevs: revision 1.225
sys/dev/pcmcia/if_ne_pcmcia.c: revision 1.155
add Corega LAPCCTXD FastEthernet
added Corega LAPCCTXT FastEthernet
 1.150.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.150.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.150.12.1 24-Mar-2008  keiichi sync with head.
 1.154.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.154.4.3 11-Mar-2010  yamt sync with head
 1.154.4.2 16-Sep-2009  yamt sync with head
 1.154.4.1 04-May-2009  yamt sync with head.
 1.154.2.1 18-May-2008  yamt sync with head.
 1.155.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.155.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.158.12.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.158.12.1 17-Apr-2012  yamt sync with head
 1.159.12.1 18-May-2014  rmind sync with head
 1.159.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.160.30.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.100 11-Feb-2024  andvar Fix few more typos in comments and log message:
s/butoon/button/
s/BUTTOM/BOTTOM/
s/communicaiton/communication/
s/recevice/receive/
s/regiion/region/
 1.99 22-May-2022  andvar fix various small typos, mainly in comments.
 1.98 04-Feb-2020  thorpej Use ifmedia_fini().
 1.97 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.96 06-Jan-2020  msaitoh branches: 1.96.2;
Protect ec_multicnt.
 1.95 21-Oct-2019  msaitoh if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.94 28-May-2019  msaitoh branches: 1.94.2;
Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.93 23-May-2019  msaitoh -No functional change:
- KNF
- u_int*_t -> uint*_t.
 1.92 03-Feb-2019  mrg - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
 1.91 08-Jan-2019  msaitoh Whitespace fix.
 1.90 26-Jun-2018  msaitoh branches: 1.90.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.89 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.88 09-Dec-2017  christos branches: 1.88.2;
adjust for printf signature.
 1.87 08-Dec-2017  christos coalesce the two copies of hexdump into libkern
 1.86 13-Jan-2017  maya branches: 1.86.8;
Remove more dead code

RAY_DEF_NWID is a constant string and so is the length, it's
pointless the length is larger than zero.
 1.85 12-Jan-2017  maya Remove dead code. RAY_DEF_NWID is a constant string, its length will never
be above 32.
 1.84 07-Jul-2016  msaitoh branches: 1.84.2;
KNF. Remove extra spaces. No functional change.
 1.83 10-Jun-2016  ozaki-r Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.82 09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.81 07-Dec-2012  msaitoh branches: 1.81.14;
Apply OpenBSD rev. 1.40:
> Use the actual SSID length rather than a (wrong) sizeof. Makes gcc4
> -Wbounded happy.
>
> ok kettenis
 1.80 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.79 05-Apr-2010  joerg branches: 1.79.8; 1.79.14; 1.79.18;
Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.78 19-Jan-2010  pooka branches: 1.78.2; 1.78.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.77 06-Dec-2009  dyoung Simplify device-activation hooks.
 1.76 05-Sep-2009  tsutsui Invert logic around nested pmf(9) registrations for readability.
 1.75 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.74 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.73 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.72 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.71 07-Nov-2008  dyoung branches: 1.71.4;
*** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability. KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:

switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
 1.70 05-Apr-2008  cegger branches: 1.70.4; 1.70.10; 1.70.12;
use aprint_*_dev and device_xname
 1.69 10-Mar-2008  dholland Adjust a debug message. Fixes the last bit of PR 29668. (The rest seems
to have already been dealt with.)
 1.68 09-Dec-2007  jmcneill branches: 1.68.6; 1.68.10;
Merge jmcneill-pm branch.
 1.67 19-Oct-2007  ad branches: 1.67.4; 1.67.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.66 01-Sep-2007  dyoung branches: 1.66.4;
Change a bazillion occurrences of code resembling this,

error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ec) :
ether_delmulti(ifr, &sc->sc_ec);

if (error == ENETRESET) {

to this,

if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number. This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
 1.65 09-Jul-2007  ad branches: 1.65.2; 1.65.6; 1.65.8;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.64 04-Mar-2007  christos branches: 1.64.2; 1.64.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.63 16-Nov-2006  christos branches: 1.63.4;
__unused removal on arguments; approved by core.
 1.62 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.61 24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.60 14-Apr-2006  christos branches: 1.60.8; 1.60.10;
Coverity CID 1111: Fix cut'n'paste bug!
 1.59 11-Dec-2005  christos branches: 1.59.4; 1.59.6; 1.59.8; 1.59.10; 1.59.12;
merge ktrace-lwp.
 1.58 08-Sep-2005  christos fix compilation with debugging on.
 1.57 30-May-2005  christos branches: 1.57.2;
- add const
- avoid variable shadow
- do proper UNCONST with XXXUNCONST
 1.56 27-Feb-2005  perry branches: 1.56.2;
nuke trailing whitespace
 1.55 04-Feb-2005  perry de-__P
 1.54 30-Oct-2004  thorpej branches: 1.54.4; 1.54.6;
When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.53 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.52 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.51 10-Aug-2004  mycroft Better fix for the previous.
 1.50 10-Aug-2004  mycroft Fix a reference count problem I introduced here.
 1.49 10-Aug-2004  mycroft Use pcmcia_function_{configure,unconfigure}().
 1.48 09-Aug-2004  mycroft Adapt to the new world order.
 1.47 09-Aug-2004  mycroft Correct the intr_establish order here.
 1.46 07-Aug-2004  mycroft Clean up attach messages.
 1.45 07-Jul-2004  mycroft More cleanup:
* Print "devinfo" in a canonial place (like we do in the SCSI code).
* Use aprint_{error,normal}() during attach.
* More PCMCIA_STR_* removal.
 1.44 02-Nov-2003  wiz branches: 1.44.4;
Fix some typos. From Tom Cosgrove via jmc@openbsd.
 1.43 28-Oct-2003  mycroft Eliminate bogus initializer.
 1.42 27-Oct-2003  chs uninitialized variables
 1.41 25-Oct-2003  christos Initialize variables sooner, and remove variable that was only used
uninitialized in a debugging printf.
 1.40 25-Oct-2003  christos Fix uninitialized variable warnings
 1.39 22-Oct-2003  mjl Typo in comment. From OpenBSD.
 1.38 13-Oct-2003  dyoung Switch to the new 802.11 layer.
 1.37 23-Feb-2003  simonb branches: 1.37.2;
Remove assigned-to but not used variable.
 1.36 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.35 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.34 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.33 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.32 10-Mar-2002  martin branches: 1.32.4;
Remove RAY_USE_AMEM. This option claimed to use attribute memory access
for the registers, which was true, but actually the same as the driver
did without this option.

What it realy did is work around a stupid bug in the driver that did not
use the "offset" result from the pcmcia_mem_map call mapping the CIS memory.

We got away with this for a long time since on i386 and typical pcmcia
bridged the offset returned will be 0. It always failed (without
RAY_USE_AMEM=1) if the check for a different function CCR aliases in pcmcia.c
failed and mapped the CCR base new - this time at the CCR base of this
function (0xf00), so all register acceses (that had 0xf00 added) happened
way off in neverland.

Now we do not hardcode the CCR base to the register definitions, but
instead use the offset returned by pcmcia_mem_map. This makes the driver
work with and without CCR base aliases being found.
 1.31 15-Dec-2001  soren To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.30 15-Dec-2001  soren Fix typo in comment.
 1.29 13-Nov-2001  lukem add RCSIDs
 1.28 26-Jul-2001  wiz aquired -> acquired, issueing -> issuing
 1.27 14-Dec-2000  thorpej branches: 1.27.2; 1.27.4;
ALTQ'ify.
 1.26 13-Dec-2000  mycroft Make this compile again. *sigh*
 1.25 12-Dec-2000  thorpej Add a missing return after freeing an mbuf. From Dave Huang <khym@bga.com>.
 1.24 11-Dec-2000  thorpej Add support for 802.11 authentication frames, required to interoperate
with Aviator Pro cards on Windows. Written by Steve Weiss for OpenBSD,
ported to NetBSD by me.
 1.23 15-Nov-2000  thorpej branches: 1.23.2;
Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.22 01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.21 05-Jul-2000  onoe change the argument of SIOCS80211NWID and SIOCG80211NWID ioctls from
u_int8_t array to struct ieee80211_nwid to prepend length field.
The length field is necessary because IEEE 802.11 spec doesn't prohibit
even '\0' for SSID.
Though the name and the value of SIOC... macro is unchanged, this change
breaks binary compatibility. The only affected userland program on the
tree is ifconfig(8).
As Jason suggested on tech-net, it is better than live with problems
since there are no releases for this ioctls yet.
 1.20 29-May-2000  jhawk branches: 1.20.2;
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.19 22-Apr-2000  thorpej branches: 1.19.2;
Make sure the payload is aligned when using E2-over-802.11 encapsulation,
as enabled by the LINK0 flag. Fixes PR kern/9700.
 1.18 26-Mar-2000  kleink Cast timeval members to types we know the printf conversions of.
 1.17 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.16 10-Mar-2000  onoe Adopt the macro name change of if_ieee80211.h.
also fixed the value for receiving packets in infrastructure mode,
while no one has been tested with.
 1.15 28-Feb-2000  mycroft Add missing break that hosed multicast.
 1.14 27-Feb-2000  augustss Add code (off by default) to keep track of the signal strength of the last
few packets received from different MAC addresses.
 1.13 22-Feb-2000  thorpej Fix printf formats on the Alpha.
 1.12 07-Feb-2000  augustss Use pcmcia_devinfo().
 1.11 04-Feb-2000  chopps enable the card before establishing the interrupt to avoid being called
with stray interrupts before we are ready.
clear the card interrupt after enabling the card
 1.10 03-Feb-2000  chopps wrap optimized copy routines in an ifdef
 1.9 02-Feb-2000  chopps manipulate packet counters, support detach, and add commented out code to
DTRT on suspend
 1.8 02-Feb-2000  augustss Get rid of shutdown hook and attached media on detach.
 1.7 02-Feb-2000  augustss Make ray driver detachable.
 1.6 26-Jan-2000  augustss Make it easy to switch between using attribute memory and not.
 1.5 26-Jan-2000  augustss Print out what kind of card it is earlier and more accurately.
 1.4 25-Jan-2000  chopps set havenet to 0 when we are switching between operating modes and only
after association in ifrastructure mode. Also, deal with roam start
and rejoin net commands.
 1.3 24-Jan-2000  chopps support switching to/from adhoc/infrastructure mode with media opt.
fill in 802.11 correctly for 802.11 infrastructure.
code not verified with base station yet.
 1.2 24-Jan-2000  augustss Add missing \n in attach message, and add a little more information.
 1.1 23-Jan-2000  chopps add driver for raylink/aviator wireless 802.11 FH 2Mbps cards, currently only
tested with aviator 2.4
 1.19.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.20.2.3 26-Jan-2001  jhawk Pull up revision 1.26 (requested by mjacob):
Cast pktlen to u_long and print with %ld. Now it compiles on the alpha.
 1.20.2.2 15-Dec-2000  he Pull up revisions 1.24-1.25 (requested by thorpej):
Add a missing return after freeing an mbuf.
Add support for 802.11 authentication frames, required to
interoperate with Aviator Pro cards on Windows.
 1.20.2.1 21-Jul-2000  onoe Pullups 802.11 stuff (approved by jhawk)
- allow non-string nwid settings
basesrc/sbin/ifconfig/ifconfig.c 1.82-1.86
basesrc/sbin/ifconfig/ifconfig.8 1.37
syssrc/sys/dev/ic/awi.c 1.21
syssrc/sys/dev/pcmcia/if_ray.c 1.21
syssrc/sys/dev/pcmcia/if_wi.c 1.23
syssrc/sys/dev/pcmcia/if_wivar.h 1.10
syssrc/sys/net/if_ieee80211.h 1.4
 1.23.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.23.2.4 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.23.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.23.2.2 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.23.2.1 15-Nov-2000  bouyer file if_ray.c was added on branch thorpej_scsipi on 2000-11-20 11:42:43 +0000
 1.27.4.5 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.27.4.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.27.4.3 16-Mar-2002  jdolecek Catch up with -current.
 1.27.4.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.27.4.1 03-Aug-2001  lukem update to -current
 1.27.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.27.2.5 20-Jun-2002  nathanw Catch up to -current.
 1.27.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.27.2.3 08-Jan-2002  nathanw Catch up to -current.
 1.27.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.27.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.32.4.1 20-Jun-2002  gehenna catch up with -current.
 1.37.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.37.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.37.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.37.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.37.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.37.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.37.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.37.2.1 03-Aug-2004  skrll Sync with HEAD
 1.44.4.1 24-Jan-2005  he Pull up revision 1.54 (requested by thorpej in ticket #939):
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#27678.
 1.54.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.54.6.1 12-Feb-2005  yamt sync with head.
 1.54.4.1 29-Apr-2005  kent sync with -current
 1.56.2.1 13-Sep-2005  tron Pull up following revision(s) (requested by kiyohara in ticket #767):
sys/dev/pcmcia/if_ray.c: revision 1.58
fix compilation with debugging on.
 1.57.2.6 17-Mar-2008  yamt sync with head.
 1.57.2.5 21-Jan-2008  yamt sync with head
 1.57.2.4 27-Oct-2007  yamt sync with head.
 1.57.2.3 03-Sep-2007  yamt sync with head.
 1.57.2.2 30-Dec-2006  yamt sync with head.
 1.57.2.1 21-Jun-2006  yamt sync with head.
 1.59.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.59.10.1 19-Apr-2006  elad sync with head.
 1.59.8.1 24-May-2006  yamt sync with head.
 1.59.6.1 22-Apr-2006  simonb Sync with head.
 1.59.4.1 09-Sep-2006  rpaulo sync with head
 1.60.10.2 10-Dec-2006  yamt sync with head.
 1.60.10.1 22-Oct-2006  yamt sync with head
 1.60.8.1 18-Nov-2006  ad Sync with head.
 1.63.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.64.4.1 11-Jul-2007  mjf Sync with head.
 1.64.2.3 23-Oct-2007  ad Sync with head.
 1.64.2.2 09-Oct-2007  ad Sync with head.
 1.64.2.1 01-Jul-2007  ad Adapt to callout API change.
 1.65.8.3 23-Mar-2008  matt sync with HEAD
 1.65.8.2 09-Jan-2008  matt sync with HEAD
 1.65.8.1 06-Nov-2007  matt sync with HEAD
 1.65.6.5 08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.65.6.4 06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.65.6.3 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.65.6.2 04-Sep-2007  joerg Convert ray(4) to new power management API.
 1.65.6.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.65.2.1 03-Sep-2007  skrll Sync with HEAD.
 1.66.4.1 25-Oct-2007  bouyer Sync with HEAD.
 1.67.6.1 11-Dec-2007  yamt sync with head.
 1.67.4.1 26-Dec-2007  ad Sync with head.
 1.68.10.3 17-Jan-2009  mjf Sync with HEAD.
 1.68.10.2 02-Jun-2008  mjf Sync with HEAD.
 1.68.10.1 03-Apr-2008  mjf Sync with HEAD.
 1.68.6.1 24-Mar-2008  keiichi sync with head.
 1.70.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.70.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.70.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.70.4.5 11-Aug-2010  yamt sync with head.
 1.70.4.4 11-Mar-2010  yamt sync with head
 1.70.4.3 16-Sep-2009  yamt sync with head
 1.70.4.2 16-May-2009  yamt sync with head
 1.70.4.1 04-May-2009  yamt sync with head.
 1.71.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.78.4.1 30-May-2010  rmind sync with head
 1.78.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.79.18.3 03-Dec-2017  jdolecek update from HEAD
 1.79.18.2 25-Feb-2013  tls resync with head
 1.79.18.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.79.14.1 16-Dec-2012  riz Pull up following revision(s) (requested by msaitoh in ticket #747):
sys/dev/pcmcia/if_ray.c: revision 1.81
Apply OpenBSD rev. 1.40:
> Use the actual SSID length rather than a (wrong) sizeof. Makes gcc4
> -Wbounded happy.
>
> ok kettenis
 1.79.8.2 16-Jan-2013  yamt sync with (a bit old) head
 1.79.8.1 30-Oct-2012  yamt sync with head
 1.81.14.3 05-Feb-2017  skrll Sync with HEAD
 1.81.14.2 09-Jul-2016  skrll Sync with HEAD
 1.81.14.1 19-Mar-2016  skrll Sync with HEAD
 1.84.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.86.8.2 24-Oct-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1416):

sys/dev/ic/i82586.c: revision 1.86
sys/arch/arm/ep93xx/epe.c: revision 1.45
sys/dev/pcmcia/if_cnw.c: revision 1.66
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.31
sys/dev/qbus/if_il.c: revision 1.36
sys/dev/pcmcia/if_ray.c: revision 1.95
sys/dev/qbus/if_qt.c: revision 1.24

if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.86.8.1 26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.88.2.3 18-Jan-2019  pgoyette Synch with HEAD
 1.88.2.2 28-Jul-2018  pgoyette Sync with HEAD
 1.88.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.90.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.90.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.90.2.1 10-Jun-2019  christos Sync with HEAD
 1.94.2.2 28-Jan-2020  martin Pull up following revision(s) (requested by msaitoh in ticket #662):

sys/dev/pcmcia/if_xi.c: revision 1.93
sys/arch/x86/pci/if_vmx.c: revision 1.54
sys/dev/pci/if_de.c: revision 1.165
sys/arch/arm/ti/if_cpsw.c: revision 1.10
sys/arch/arm/omap/if_cpsw.c: revision 1.26
sys/dev/isa/if_iy.c: revision 1.112
sys/dev/pcmcia/if_ray.c: revision 1.96

Add ETHER_LOCK() and ETHER_UNLOCK() to protect ec_multiaddrs.

XXX These drivers don't check whether enm_addrlo and enm_addrhi are the same
or not, so it won't work correctly if an multicast address entry has a range.

Protect ec_multicnt.
 1.94.2.1 23-Oct-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #371):

sys/dev/ic/i82586.c: revision 1.86
sys/arch/arm/ep93xx/epe.c: revision 1.45
sys/dev/pcmcia/if_cnw.c: revision 1.66
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.31
sys/arch/arm/sunxi/sunxi_can.c: revision 1.2
sys/dev/qbus/if_il.c: revision 1.36
sys/dev/pcmcia/if_ray.c: revision 1.95
sys/dev/qbus/if_qt.c: revision 1.24

if_ipackets is incremented in can_input(), so don't increment it in
sunxi_can_rx_intr to prevent double count. OK'd by bouyer@.

if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.96.2.1 29-Feb-2020  ad Sync with head.
 1.13 17-Feb-2025  andvar Fix typo in unused struct name: s/ray_cmd_udpate_apm/ray_cmd_update_apm/.
 1.12 22-May-2022  andvar branches: 1.12.10;
fix various small typos, mainly in comments.
 1.11 06-Sep-2015  dholland More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
 1.10 25-Dec-2007  perry branches: 1.10.54; 1.10.74;
Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
 1.9 11-Dec-2005  christos branches: 1.9.46; 1.9.52; 1.9.56; 1.9.60;
merge ktrace-lwp.
 1.8 27-Feb-2005  perry branches: 1.8.4;
nuke trailing whitespace
 1.7 02-Nov-2003  wiz branches: 1.7.8; 1.7.10;
Fix some typos. From Tom Cosgrove via jmc@openbsd.
 1.6 22-Oct-2003  mjl Typo in comment. From OpenBSD.
 1.5 10-Mar-2002  martin branches: 1.5.12;
Adjust some unused register offsets to the new world order and fix a
comment.
 1.4 10-Mar-2002  martin Remove RAY_USE_AMEM. This option claimed to use attribute memory access
for the registers, which was true, but actually the same as the driver
did without this option.

What it realy did is work around a stupid bug in the driver that did not
use the "offset" result from the pcmcia_mem_map call mapping the CIS memory.

We got away with this for a long time since on i386 and typical pcmcia
bridged the offset returned will be 0. It always failed (without
RAY_USE_AMEM=1) if the check for a different function CCR aliases in pcmcia.c
failed and mapped the CCR base new - this time at the CCR base of this
function (0xf00), so all register acceses (that had 0xf00 added) happened
way off in neverland.

Now we do not hardcode the CCR base to the register definitions, but
instead use the offset returned by pcmcia_mem_map. This makes the driver
work with and without CCR base aliases being found.
 1.3 10-Aug-2000  ad branches: 1.3.2; 1.3.4; 1.3.6;
Define SIOC[SG]IFGENERIC in <sys/sockio.h>, as FreeBSD and OpenBSD do.
 1.2 27-Feb-2000  augustss Add code (off by default) to keep track of the signal strength of the last
few packets received from different MAC addresses.
 1.1 23-Jan-2000  chopps add driver for raylink/aviator wireless 802.11 FH 2Mbps cards, currently only
tested with aviator 2.4
 1.3.6.1 16-Mar-2002  jdolecek Catch up with -current.
 1.3.4.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.2.2 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.3.2.1 10-Aug-2000  bouyer file if_rayreg.h was added on branch thorpej_scsipi on 2000-11-20 11:42:44 +0000
 1.5.12.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.12.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.12.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.12.1 03-Aug-2004  skrll Sync with HEAD
 1.7.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.8.4.1 21-Jan-2008  yamt sync with head
 1.9.60.1 02-Jan-2008  bouyer Sync with HEAD
 1.9.56.1 26-Dec-2007  ad Sync with head.
 1.9.52.1 18-Feb-2008  mjf Sync with HEAD.
 1.9.46.1 09-Jan-2008  matt sync with HEAD
 1.10.74.1 22-Sep-2015  skrll Sync with HEAD
 1.10.54.1 03-Dec-2017  jdolecek update from HEAD
 1.12.10.1 02-Aug-2025  perseant Sync with HEAD
 1.57 08-Feb-2018  dholland Typos.
 1.56 07-Jul-2016  msaitoh KNF. Remove extra spaces. No functional change.
 1.55 27-Oct-2012  chs branches: 1.55.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.54 12-May-2009  cegger branches: 1.54.12; 1.54.22;
struct device * -> device_t, no functional changes intended.
 1.53 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.52 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.51 28-Apr-2008  martin branches: 1.51.8; 1.51.14;
Remove clause 3 and 4 from TNF licenses
 1.50 05-Apr-2008  cegger branches: 1.50.2; 1.50.4;
use aprint_*_dev and device_xname
 1.49 19-Oct-2007  ad branches: 1.49.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.48 16-Nov-2006  christos branches: 1.48.8; 1.48.22; 1.48.24; 1.48.28;
__unused removal on arguments; approved by core.
 1.47 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.46 11-Dec-2005  christos branches: 1.46.20; 1.46.22;
merge ktrace-lwp.
 1.45 04-Feb-2005  perry branches: 1.45.6;
de-__P
 1.44 10-Aug-2004  mycroft branches: 1.44.4; 1.44.6;
Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.43 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.42 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.41 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.40 10-Aug-2004  mycroft Copyright maintenance.
 1.39 10-Aug-2004  mycroft Update to the new world order.
 1.38 09-Aug-2004  mycroft Adapt to the new world order. Now all my sm cards work.
 1.37 09-Aug-2004  mycroft Make pcmcia_function_disable() primarily responsible for disabling the CCR
bits. pcmcia_intr_disestablish() continues to do this as a stopgap.
 1.36 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.35 08-Aug-2004  mycroft Search all the configuration entries.
 1.34 08-Aug-2004  mycroft AFAICT, there's no reason not to use PCMCIA_WIDTH_AUTO here.
 1.33 07-Aug-2004  mycroft Clean up attach messages.
 1.32 07-Aug-2004  mycroft The generic code already looked for a LAN ID tuple, so look at what it found
rather than reparsing.
 1.31 06-Aug-2004  mycroft Make a couple of Megahertz cards (one straight Ethernet, one multifunction)
work by:
* adding another product to the table,
* checking the function type (to reject the serial port),
* trying harder to find the MAC address in the CIS strings (it may occur in
one of two different places).
Also, PCMCIA_STR_* elimination.
 1.30 02-Oct-2002  thorpej branches: 1.30.6;
Add trailing ; to CFATTACH_DECL.
 1.29 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.28 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.27 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.26 13-Nov-2001  lukem branches: 1.26.8;
add RCSIDs
 1.25 05-Sep-2001  pooka * make this match the Psion Goldcard
* teach it to read the MAC addr from the correct place (from OpenBSD)
* change order of intr_dis/establish() and function_en/disable() to
avoid panics on this multifunction card due to the CCR window
not being mapped in intr_dis/establish()
 1.24 01-Jul-2001  thorpej branches: 1.24.2;
Remove unneeded include files. From Onno van der Linden.
 1.23 30-Jul-2000  briggs branches: 1.23.2;
Add MII support to smc91cxx driver. This is supported for the 91c100
and 91c100FD (FEAST) controllers. Existing controllers should continue
to work as they have. Added the card's memory to the probe message.
 1.22 20-Feb-2000  enami branches: 1.22.4;
Fix thinko in previous commit.
 1.21 09-Feb-2000  enami - No need to keep track enable/disable state here. The smc91cxx.c also
manages it.
- Disestablish an interrupt when failed to enable card.
- Don't say I'm enabled if failed to enable card.
 1.20 04-Feb-2000  cgd replace the *_lookup table entry match/lookup functions in all of
these drivers with a single common function (which supports tables
of variable-sized structures). Things are mostly as they were before:
tables are terminated by entry with NULL name, etc. There's also
the ability to call a driver-specific match function which can be used
to augment the table lookup.
 1.19 02-Feb-2000  itojun if_detach for sm/pcmcia.
with addition of resource allocation flags in softc (to DTRT on detach).
 1.18 28-Sep-1999  thorpej branches: 1.18.2;
Sync the ASCII Ethernet address decoder with mhzc.c. New version by
Chuck Cranor is more efficient and fixes a bug which would have caused
data corruption in some cases.
 1.17 28-Sep-1999  thorpej Don't handle the Megaherz XJEM3336 here.
 1.16 19-Feb-1999  abs Add ID for IBM 'PCMCIA Portable CD-ROM Drive'. We only have one of these and it
may be broken (it choked under Windows), but it at least now probes.
 1.15 18-Nov-1998  thorpej Now that the *_activate() functions don't do things which are attachment
specific, move them into the chipset drivers.
 1.14 18-Nov-1998  thorpej Move the i/o window unmap and i/o space free into *_detach().
 1.13 17-Nov-1998  thorpej Add detach and activate entry points. Mostly functional except for
#ifdef notyet'd if_delref() and if_detach(), which will be fixed up
when that code is committed.
 1.12 08-Oct-1998  thorpej Fix some whitespace lossage.
 1.11 15-Aug-1998  thorpej Sigh, #if 0 the SMC 8020BT EtherEZ entry until we know what the product
ID really is.
 1.10 15-Aug-1998  thorpej Take a stab at supporting the SMC 8020BT EtherEZ. (Similar to the
Megahertz; Ethernet address is stored in third CIS info string, but
may also be in the FUNCE/LANNID tuple.)
 1.9 15-Aug-1998  thorpej In the NewMedia callback, make sure we have a LAN Node ID tuple.
 1.8 15-Aug-1998  thorpej Use the symbolic name for the tuple code used to find the Ethernet
address.
 1.7 14-Aug-1998  thorpej Add support for the NewMedia BASICS Ethernet. Device info provided by
Stefan Grefen in PR #5902.
 1.6 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.5 05-Jul-1998  jonathan defopt NS, NSIP.
 1.4 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.3 09-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.2 16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1 11-Aug-1997  thorpej branches: 1.1.2;
file if_sm_pcmcia.c was initially added on branch marc-pcmcia.
 1.1.2.5 16-Oct-1997  thorpej Don't establish our interrupt hander at attach time. Instead, establish
it in the enable hook, and disestablish it in the disable hook. This gives
us two wins:

- Allows us to more fairly allocate an interrupt after other
devices which can't do dynamic allocation have hooked up
theirs.

- In the event the default interrupt allocation scheme is bad,
this allows us to bring an interface down, patch a kernel
variable (eventually, run a program that does the right
thing for us) to set up an interrupt allocation scheme suitable
for our laptop model, bring the interface back up, and have
the Right Thing happen.
 1.1.2.4 14-Oct-1997  thorpej Explicitly align the allocated i/o space region to the size of the allocation.
This was previously implied, but we must explicitly specify it since some
cards may have more strict alignment requirements.
 1.1.2.3 29-Sep-1997  thorpej Add power management hooks.
 1.1.2.2 23-Aug-1997  thorpej Update for changes to pcmcia function manipulation.
 1.1.2.1 11-Aug-1997  thorpej Add a PCMCIA attachment for the smc91cxx ethernet driver ("sm"), written
from scratch by me. Currently supports the Megahertz X-JACK PCMCIA Ethernet
Adapter.
 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.22.4.1 06-Aug-2000  briggs Pullups approved by thorpej --
Add MII support to smc91cxx driver. This is supported for the 91c100
and 91c100FD (FEAST) controllers. Existing controllers should continue
to work as they have. Added the card's memory to the probe message.

Make sure that we do not call bus_space_*_multi_* with zero count.
Use bus_space_read/write_multi_stream_2 for FIFO instead of bsr/w_multi_2.
 1.23.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.23.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.23.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.23.2.2 21-Sep-2001  nathanw Catch up to -current.
 1.23.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.24.2.4 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.24.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.24.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.24.2.1 13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.26.8.1 20-Jun-2002  gehenna catch up with -current.
 1.30.6.4 04-Feb-2005  skrll Sync with HEAD.
 1.30.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.30.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.30.6.1 12-Aug-2004  skrll Sync with HEAD.
 1.44.6.1 12-Feb-2005  yamt sync with head.
 1.44.4.1 29-Apr-2005  kent sync with -current
 1.45.6.2 27-Oct-2007  yamt sync with head.
 1.45.6.1 30-Dec-2006  yamt sync with head.
 1.46.22.2 10-Dec-2006  yamt sync with head.
 1.46.22.1 22-Oct-2006  yamt sync with head
 1.46.20.1 18-Nov-2006  ad Sync with head.
 1.48.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.48.24.1 06-Nov-2007  matt sync with HEAD
 1.48.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.48.8.1 23-Oct-2007  ad Sync with head.
 1.49.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.50.4.3 16-May-2009  yamt sync with head
 1.50.4.2 04-May-2009  yamt sync with head.
 1.50.4.1 16-May-2008  yamt sync with head.
 1.50.2.1 18-May-2008  yamt sync with head.
 1.51.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.51.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.54.22.2 03-Dec-2017  jdolecek update from HEAD
 1.54.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.54.12.1 30-Oct-2012  yamt sync with head
 1.55.14.1 09-Jul-2016  skrll Sync with HEAD
 1.30 19-Jan-2020  thorpej Remove Token Ring support.
 1.29 12-Nov-2019  msaitoh branches: 1.29.2;
Add missing initialization of sc_dev.
 1.28 08-Jan-2019  msaitoh branches: 1.28.4;
Whitespace fix.
 1.27 27-Nov-2016  maya branches: 1.27.8; 1.27.14; 1.27.16;
spaces to tabs
 1.26 11-Jul-2016  msaitoh branches: 1.26.2;
KNF. No functional change.
 1.25 27-Oct-2012  chs branches: 1.25.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.24 22-Oct-2009  snj branches: 1.24.12; 1.24.22;
Drop 3rd and 4th clauses. Approved by soren@ and Onno van der Linden
(copyright holders).
 1.23 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.22 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.21 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.20 05-Apr-2008  cegger branches: 1.20.4; 1.20.12; 1.20.18;
use aprint_*_dev and device_xname
 1.19 19-Oct-2007  ad branches: 1.19.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.18 16-Nov-2006  christos branches: 1.18.8; 1.18.22; 1.18.24; 1.18.28;
__unused removal on arguments; approved by core.
 1.17 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.16 11-Dec-2005  christos branches: 1.16.20; 1.16.22;
merge ktrace-lwp.
 1.15 27-Feb-2005  perry branches: 1.15.4;
nuke trailing whitespace
 1.14 10-Aug-2004  mycroft branches: 1.14.4; 1.14.6;
Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.13 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.12 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.11 02-Oct-2002  thorpej branches: 1.11.6;
Add trailing ; to CFATTACH_DECL.
 1.10 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.9 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.8 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.7 15-Dec-2001  soren branches: 1.7.8;
To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.6 15-Dec-2001  soren Correct copyright header.
 1.5 13-Nov-2001  lukem add RCSIDs
 1.4 01-Jul-2001  thorpej branches: 1.4.2;
Remove unneeded include files. From Onno van der Linden.
 1.3 21-Nov-2000  soren branches: 1.3.2;
Note 3Com card support.
 1.2 14-Jun-2000  soren branches: 1.2.4; 1.2.6;
Update from Onno: add media selection.
 1.1 13-Jun-2000  soren IBM Tropic Token Ring PCMCIA attachment. XXX Needs work.
Many thanks to Onno van der Linden for his help in getting this working.
 1.2.6.3 22-Nov-2000  bouyer Sync with HEAD.
 1.2.6.2 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.2.6.1 14-Jun-2000  bouyer file if_tr_pcmcia.c was added on branch thorpej_scsipi on 2000-11-20 11:42:44 +0000
 1.2.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 14-Jun-2000  minoura file if_tr_pcmcia.c was added on branch minoura-xpg4dl on 2000-06-22 17:07:45 +0000
 1.3.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.3.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.3.2.3 08-Jan-2002  nathanw Catch up to -current.
 1.3.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.3.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.4.2.3 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.4.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.7.8.1 20-Jun-2002  gehenna catch up with -current.
 1.11.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.11.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.6.1 12-Aug-2004  skrll Sync with HEAD.
 1.14.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.14.4.1 29-Apr-2005  kent sync with -current
 1.15.4.2 27-Oct-2007  yamt sync with head.
 1.15.4.1 30-Dec-2006  yamt sync with head.
 1.16.22.2 10-Dec-2006  yamt sync with head.
 1.16.22.1 22-Oct-2006  yamt sync with head
 1.16.20.1 18-Nov-2006  ad Sync with head.
 1.18.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.18.24.1 06-Nov-2007  matt sync with HEAD
 1.18.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.18.8.1 23-Oct-2007  ad Sync with head.
 1.19.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.20.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.20.4.3 11-Mar-2010  yamt sync with head
 1.20.4.2 16-May-2009  yamt sync with head
 1.20.4.1 04-May-2009  yamt sync with head.
 1.24.22.2 03-Dec-2017  jdolecek update from HEAD
 1.24.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.24.12.1 30-Oct-2012  yamt sync with head
 1.25.14.2 05-Dec-2016  skrll Sync with HEAD
 1.25.14.1 05-Oct-2016  skrll Sync with HEAD
 1.26.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.27.16.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.27.16.1 10-Jun-2019  christos Sync with HEAD
 1.27.14.1 18-Jan-2019  pgoyette Synch with HEAD
 1.27.8.1 14-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1439):

sys/dev/sbus/sio16.c: revision 1.25
sys/dev/gpib/mt.c: revision 1.33
sys/arch/mvme68k/dev/wdsc.c: revision 1.33
sys/dev/gpib/ct.c: revision 1.31
sys/dev/isa/mcd.c: revision 1.119
sys/dev/pci/if_stge.c: revision 1.73
sys/dev/gpib/ppi.c: revision 1.25
sys/dev/pcmcia/if_tr_pcmcia.c: revision 1.29
sys/arch/amiga/dev/zssc.c: revision 1.46
sys/arch/mac68k/obio/iwm_fd.c: revision 1.57
sys/arch/amiga/dev/if_qn.c: revision 1.48
sys/dev/isa/tcic2_isa.c: revision 1.28
sys/dev/isa/uha_isa.c: revision 1.42
sys/dev/pci/neo.c: revision 1.55
sys/arch/next68k/dev/nextdisplay.c: revision 1.22
sys/dev/isa/if_iy.c: revision 1.111

Add missing initialization of sc_dev.


Initialize sc_dev correctly to avoid null pointer dereference when
bus_space_map() failed.


Add missing initialization of sc_dev.
 1.28.4.1 14-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #425):

sys/dev/sbus/sio16.c: revision 1.25
sys/dev/gpib/mt.c: revision 1.33
sys/arch/mvme68k/dev/wdsc.c: revision 1.33
sys/dev/gpib/ct.c: revision 1.31
sys/dev/isa/mcd.c: revision 1.119
sys/dev/pci/if_stge.c: revision 1.73
sys/dev/gpib/ppi.c: revision 1.25
sys/dev/pcmcia/if_tr_pcmcia.c: revision 1.29
sys/arch/amiga/dev/zssc.c: revision 1.46
sys/arch/mac68k/obio/iwm_fd.c: revision 1.57
sys/arch/amiga/dev/if_qn.c: revision 1.48
sys/dev/isa/tcic2_isa.c: revision 1.28
sys/dev/isa/uha_isa.c: revision 1.42
sys/dev/pci/neo.c: revision 1.55
sys/arch/next68k/dev/nextdisplay.c: revision 1.22
sys/dev/isa/if_iy.c: revision 1.111

Add missing initialization of sc_dev.

Initialize sc_dev correctly to avoid null pointer dereference when
bus_space_map() failed.

Add missing initialization of sc_dev.
 1.29.2.1 25-Jan-2020  ad Sync with head.
 1.61 06-May-2001  ichiro divided into PCMCIA attachment and common code of wi.
since if_wi_ieee.h does not depend for pcmcia,
sys/dev/pcmcia/if_wi_ieee.h was moved to sys/dev/ic/wi_ieee.h .
 1.60 29-Apr-2001  christos Correct formatting. Put the port and the ethernet address in their own
line.
XXX: it is stupid that pcmcia_io_map() prints " port 0xNNN[-0xMMM]". This
makes the printing code confusing.
 1.59 18-Mar-2001  ichiro enable I-O DATA WN-B11/PCM wlan card with WEP
reported by Shingo WATANABE <nabe@nabechan.org>
 1.58 08-Mar-2001  ichiro it wait until busy flag disappears.
it was able to prevent some cards with late initializing faling in wi_reset().
 1.57 04-Mar-2001  onoe branches: 1.57.2;
Extra wait at WI_CMD_INI is needed for some PRISM-II based cards.
(ex. ELECOM, AIr@Hawk/LD-WL11/PCC)
 1.56 11-Feb-2001  ichiro add wavelan card
corega PCCA-11
NEC CMZ-RT-WP
NTT-ME SS-LAN
 1.55 10-Feb-2001  ichiro add corega pcca-11 wavelan card
 1.54 29-Jan-2001  ichiro Contec FLEXLAN/FX-DS110-PCC work
reported by Shingo WATANABE(nabe@nabechan.org)
 1.53 28-Jan-2001  ichiro COMPAQ Agency NC5004 Wireless Card(Prism2) work.
 1.52 18-Jan-2001  jdolecek constify
 1.51 14-Jan-2001  ichiro ELSA XI-300 WaveLanCard (PRISM2) work.
OEM. ADLINK 330C
http://www.adtec.co.jp/CGI/parts/parts_detail.cgi?product_id=ADLINK330C
 1.50 11-Jan-2001  jhawk Change wi(4)'s default from ad-hoc mode to BSS mode. Also
some minor manpage fixes.
 1.49 11-Jan-2001  ichiro NANOSPEED ROOT-RZ2000 WLAN Card work.
(PRISM II)
 1.48 30-Dec-2000  castor Fix PR port-hpcmips/11477 "only hpcmips panics with wireless network cards"

Adjust the payload of receive mbufs so the data following the
ethernet header is aligned.
 1.47 20-Dec-2000  jhawk Backout most of 1.46, because Jason checked in a load of crap from
his local tree that doesn't build with -current...
 1.46 19-Dec-2000  thorpej Identify the SMC 2632W as a Prism II. From Rafal Boni, kern/11776.
 1.45 14-Dec-2000  thorpej ALTQ'ify.
 1.44 12-Dec-2000  thorpej Support SIOC{G,S}80211POWER.
 1.43 15-Nov-2000  thorpej Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.42 02-Nov-2000  thorpej Print out product info on attach.
 1.41 13-Oct-2000  jonathan Fix wi_intr() to avoid touching card registers during insert/remove events,
when sharing an interrupt with other devices:
check sc->sc_enabled, and drop the interrupt if its' off.

Also check for IFF_RUNNING, on advice of Enami Tsugotomo.
 1.40 12-Oct-2000  enami Use splnet instead of splimp in wi_ioctl.
 1.39 12-Oct-2000  enami Bail out initailzation on buffer allocation failure.
 1.38 12-Oct-2000  enami Use ether_ioctl.
 1.37 01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.36 28-Sep-2000  enami Replace misused DIAGNOSTIC with WI_DEBUG.
 1.35 28-Sep-2000  enami Remove unnecessary and commented out code.
 1.34 28-Aug-2000  joda provide some randomness
 1.33 26-Aug-2000  jhawk Revert last, softc is now updated.
I neglected to checkin the if_wivar.h update earlier, sorry.
 1.32 25-Aug-2000  sommerfeld partial backout of last commit: #if 0 references to sc->wi_mor_enabled
since it doesn't exist in the softc.
 1.31 23-Aug-2000  jhawk Add support for "microwave oven robustness" with wiconfig -M.
 1.30 18-Aug-2000  jhawk Copy wi_{dst,src}_addr from struct wi_frame into faked-up ether_header
instead of addr1 and addr2. THis means that tcpdump -e will show the
correct MAC address for communications with access points instead of showing
the BSSID.

In the future there should be 802.11 support for bpf/libpcap/tcpdump,
but that is aways down the road.

Also fix a typo in a comment.
 1.29 31-Jul-2000  enami Sync internal state and ifmedia state. Addresses PR#10424.
 1.28 26-Jul-2000  onoe I've confirmed that Samsung MagicLAN SWL-2000N (PRISM-II) works
with WEP enabled.
 1.27 25-Jul-2000  onoe Map txrate for prism2, where each bit is apparently assigned to the
corresponding rate; 1Mbps, 2Mbps, 5.5Mbps, 11Mbps.
 1.26 21-Jul-2000  onoe add support for SIOCS80211NWKEY and SIOCG80211NWKEY.
 1.25 18-Jul-2000  onoe add WEP support also for PRISM2 cards.
Corega works fine with WEP, but farallon doesn't work well with WEP for now..
 1.24 18-Jul-2000  onoe Add support for Corega Wireless LAN PCC-11, and Farallon SkyLINE 11Mb.
Note that Corega card works at 3.3V only, then it requires cardbus code
for now.
 1.23 05-Jul-2000  onoe change the argument of SIOCS80211NWID and SIOCG80211NWID ioctls from
u_int8_t array to struct ieee80211_nwid to prepend length field.
The length field is necessary because IEEE 802.11 spec doesn't prohibit
even '\0' for SSID.
Though the name and the value of SIOC... macro is unchanged, this change
breaks binary compatibility. The only affected userland program on the
tree is ifconfig(8).
As Jason suggested on tech-net, it is better than live with problems
since there are no releases for this ioctls yet.
 1.22 30-Jun-2000  joda match 3Com 3CRWE737A (AirConnect)
 1.21 06-Jun-2000  pooka branches: 1.21.2;
fix typo
 1.20 23-May-2000  enami branches: 1.20.2;
Remove $Id.
 1.19 23-May-2000  enami Allow userland to retrieve whether the card support WEP while the
card power is off. This allows wiconfig to set WEP key etc while power off.
 1.18 14-May-2000  drochner My (Cabletron) card supplies two more statistics counters.
Instead of dropping them all, read out min(expected, supplied).
 1.17 27-Mar-2000  enami branches: 1.17.2;
Maintain IFF_ALLMULTI flag by ourself.
 1.16 27-Mar-2000  enami When we fall into allmulti case due to too may multicast address,
properly set the type and length in struct wi_ltv_mcast.
 1.15 27-Mar-2000  enami No need to call wi_setmulti() if ether_{add,del}multi returns 0.
 1.14 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.13 06-Mar-2000  thorpej Set ifp->if_baudrate as appropriate.
 1.12 06-Mar-2000  enami - Remove redundant assignment.
- Don't disestablish shutdown hook if we can't establish it.
- Noneed to manage resouces individually.
 1.11 02-Mar-2000  enami Minor cleanups.
 1.10 02-Mar-2000  enami Fix typo and thinko in previous commit.
 1.9 02-Mar-2000  enami Add ifmedia support so that dhcp happy. Also, add nwid support.
 1.8 27-Feb-2000  enami - Disestablish an interrupt if failed to enable the card.
- If card isn't enabled, just set given information into softc. Addresses
PR#9457.
- Some cleanups and cosmetic changes.
 1.7 13-Feb-2000  itojun on attach, check if we've got meaningful mac address or not,
to detect io mapping problem.

on detach, handle resource deallocations more carefully.
 1.6 12-Feb-2000  enami Check if device is active in wi_intr and wi_inquire.
 1.5 12-Feb-2000  itojun add wi_detach and friends so that we can hot-swap wi card.
 1.4 04-Feb-2000  explorer bring over WEP mode from FreeBSD/OpenBSD
 1.3 10-Sep-1999  itojun branches: 1.3.2;
IPv6 support.
ETHERTYPE_IPV6 packets are encapsulated by RFC1042 encap.
Tested with Japanese card, with WaveLan bridge (wiconfig -p 1).
NOTE: I dunno if encapsulating IPv6 packets by RFC1042 is the correct way,
as RFC1042 only defines behavior for ETHERTYPE_{IP,ARP,REVARP} packets.
Since WaveLan bridge encapsulates IPv6 packets with RFC1042, we have no
choice.

Gather joined multicast addresses via SIOCADDMULTI, and configure multicast
filter properly. This is also required for IPv6 support
(which heavily depends on multicast).

Fix IFF_RUNNING management
- to prevent IFF_RUNNING from raised on "wiconfig", before "ifconfig up"
- to prevent the driver from occupying extra interrupts on "ifconfig up",
then "down", then "up".
 1.2 14-Jul-1999  sommerfeld branches: 1.2.2;
Add shutdown hook to turn off card.
Fix BPF tap code.
 1.1 14-Jul-1999  sommerfeld Blitz port of the FreeBSD wi* driver for the Lucent WaveLan IEEE
PCMCIA wireless LAN.
Original driver written by Bill Paul <wpaul@ctr.columbia.edu>
 1.2.2.2 02-Aug-1999  thorpej Update from trunk.
 1.2.2.1 14-Jul-1999  thorpej file if_wi.c was added on branch chs-ubc2 on 1999-08-02 22:04:48 +0000
 1.3.2.8 27-Mar-2001  bouyer Sync with HEAD.
 1.3.2.7 12-Mar-2001  bouyer Sync with HEAD.
 1.3.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.3.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.3.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.3.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.3.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.3.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.17.2.2 11-May-2000  he Pull up revisions 1.1-1.13,1.15-1.17 (via patch, requested by jhawk):
Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.
 1.17.2.1 27-Mar-2000  he file if_wi.c was added on branch netbsd-1-4 on 2000-05-11 09:12:40 +0000
 1.20.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.21.2.10 23-Feb-2002  he Apply patch (requested by martin):
Protect calls to wi_cmd() by proper spl* pairs, to avoid periodic
busy loops. Fixes PR#14559.
Diff is actually revision 1.40 of sys/dev/ic/wi.c (not on branch)
 1.21.2.9 26-May-2001  he Pull up revision 1.50 (requested by jhawk):
Change wi(4)'s default from ad-hoc mode to BSS mode. Also
some minor manual page fixes.
 1.21.2.8 25-Jan-2001  jhawk Pull up revision 1.48 (requested by castor):
Ensure the ethernet payload is properly aligned. Fixes PR port-hpcmips/11477.
 1.21.2.7 17-Oct-2000  tv Pullup 1.41 [jonathan]:
Fix wi_intr() to avoid touching card registers during insert/remove events,
when sharing an interrupt with other devices:
check sc->sc_enabled, and drop the interrupt if its' off.

Also check for IFF_RUNNING, on advice of Enami Tsugotomo.
 1.21.2.6 22-Aug-2000  enami Pullup rev. 1.29 (approved by jhawk):
Sync internal state and ifmedia state. Addresses PR#10424.
 1.21.2.5 21-Jul-2000  onoe Pullup 802.11 stuff (approved by jhawk)
- add support for nwkey to ifconfig
basesrc/sbin/ifconfig/ifconfig.c 1.88
basesrc/sbin/ifconfig/ifconfig.8 1.39
syssrc/sys/dev/ic/awi.c 1.26
syssrc/sys/dev/ic/awi_wep.c 1.3
syssrc/sys/dev/ic/awivar.h 1.12
syssrc/sys/dev/pcmcia/if_wi.c 1.26
syssrc/sys/net/if.c 1.69
syssrc/sys/net/if_ieee80211.h 1.5
 1.21.2.4 21-Jul-2000  onoe Pullup 802.11 stuff (approved by jhawk)
- add WEP support for PRISM2 cards
syssrc/sys/dev/pcmcia/if_wi.c 1.25
syssrc/sys/dev/pcmcia/if_wi_ieee.h 1.5
 1.21.2.3 21-Jul-2000  onoe Pullup 802.11 stuff (approved by jhawk)
- add support for Corega Wireless LAN PCC-11, and Faralon SkyLINE 11Mb
to wi driver.
syssrc/sys/dev/pcmcia/pcmciadevs 1.95
syssrc/sys/dev/pcmcia/pcmciadevs.h 1.94
syssrc/sys/dev/pcmcia/pcmciadevs_data.h 1.94
syssrc/sys/dev/pcmcia/if_wi.c 1.24
syssrc/sys/dev/pcmcia/if_wivar.h 1.11
 1.21.2.2 21-Jul-2000  onoe Pullups 802.11 stuff (approved by jhawk)
- allow non-string nwid settings
basesrc/sbin/ifconfig/ifconfig.c 1.82-1.86
basesrc/sbin/ifconfig/ifconfig.8 1.37
syssrc/sys/dev/ic/awi.c 1.21
syssrc/sys/dev/pcmcia/if_ray.c 1.21
syssrc/sys/dev/pcmcia/if_wi.c 1.23
syssrc/sys/dev/pcmcia/if_wivar.h 1.10
syssrc/sys/net/if_ieee80211.h 1.4
 1.21.2.1 03-Jul-2000  thorpej Pull up rev. 1.22:
match 3Com 3CRWE737A (AirConnect)
 1.57.2.3 21-Jun-2001  nathanw Catch up to -current.
 1.57.2.2 09-Apr-2001  nathanw Catch up with -current.
 1.57.2.1 05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.9 06-May-2001  ichiro divided into PCMCIA attachment and common code of wi.
since if_wi_ieee.h does not depend for pcmcia,
sys/dev/pcmcia/if_wi_ieee.h was moved to sys/dev/ic/wi_ieee.h .
 1.8 23-Aug-2000  jhawk branches: 1.8.2;
Add support for "microwave oven robustness" with wiconfig -M.
 1.7 14-Aug-2000  jhawk Fix typo in comment for WI_RID_AUTH_TYPE
 1.6 10-Aug-2000  ad Define SIOC[SG]IFGENERIC in <sys/sockio.h>, as FreeBSD and OpenBSD do.
 1.5 18-Jul-2000  onoe add WEP support also for PRISM2 cards.
Corega works fine with WEP, but farallon doesn't work well with WEP for now..
 1.4 04-Feb-2000  explorer branches: 1.4.2; 1.4.6;
bring over WEP mode from FreeBSD/OpenBSD
 1.3 01-Feb-2000  enami RCS Id police.
 1.2 01-Feb-2000  enami Sync wi/ if_wavelan_ieee.h version 1.4 of FreeBSD.
 1.1 14-Jul-1999  sommerfeld branches: 1.1.2; 1.1.4;
Blitz port of the FreeBSD wi* driver for the Lucent WaveLan IEEE
PCMCIA wireless LAN.
Original driver written by Bill Paul <wpaul@ctr.columbia.edu>
 1.1.4.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.1.2.2 02-Aug-1999  thorpej Update from trunk.
 1.1.2.1 14-Jul-1999  thorpej file if_wi_ieee.h was added on branch chs-ubc2 on 1999-08-02 22:04:48 +0000
 1.4.6.1 21-Jul-2000  onoe Pullup 802.11 stuff (approved by jhawk)
- add WEP support for PRISM2 cards
syssrc/sys/dev/pcmcia/if_wi.c 1.25
syssrc/sys/dev/pcmcia/if_wi_ieee.h 1.5
 1.4.2.2 10-May-2000  he Pull up revisions 1.1-1.4 (requested by jhawk):
Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.
 1.4.2.1 04-Feb-2000  he file if_wi_ieee.h was added on branch netbsd-1-4 on 2000-05-10 23:09:30 +0000
 1.8.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.93 08-Jan-2019  msaitoh Whitespace fix.
 1.92 07-Jul-2016  msaitoh branches: 1.92.16; 1.92.18;
KNF. Remove extra spaces. No functional change.
 1.91 01-Jun-2016  pgoyette Add 3Com 3CRWE777A to supported devices. From PR kern/39590
 1.90 30-Mar-2013  christos branches: 1.90.12;
remove trailing whitespace
 1.89 15-Aug-2011  dyoung branches: 1.89.2; 1.89.12;
Don't test truth of a pointer or assign 0 to it but compare / assign
NULL.
 1.88 15-Aug-2011  dyoung Remove superfluous parentheses in return statements. No change in the
generated assembly.
 1.87 15-Aug-2011  dyoung Only try to disestablish the interrupt handler if the handler was
previously established.
 1.86 23-Nov-2010  christos split if_wi
 1.85 05-Sep-2009  tsutsui branches: 1.85.4;
Invert logic around nested pmf(9) registrations for readability.
 1.84 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.83 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.82 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.81 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.80 12-Nov-2008  ad branches: 1.80.4;
Remove LKMs and switch to the module framework, pass 1.

Proposed on tech-kern@.
 1.79 28-Apr-2008  martin branches: 1.79.6; 1.79.8;
Remove clause 3 and 4 from TNF licenses
 1.78 05-Apr-2008  cegger branches: 1.78.2; 1.78.4;
use aprint_*_dev and device_xname
 1.77 09-Dec-2007  jmcneill branches: 1.77.10;
Merge jmcneill-pm branch.
 1.76 19-Oct-2007  ad branches: 1.76.4; 1.76.6;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.75 10-Dec-2006  uwe branches: 1.75.6; 1.75.18; 1.75.20; 1.75.24;
Provide aprint_naive("\n"); in attach.
 1.74 25-Nov-2006  dsl Include the spectrum24y firmware when built as a LKM
 1.73 25-Nov-2006  dsl Make the inclusion of the spectrum24t firmware a config option, default
to enabled.
 1.72 16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.71 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.70 24-Sep-2006  jmcneill Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@
 1.69 28-Jul-2006  scottr branches: 1.69.4; 1.69.6;
Add Siemens SS1021 WLAN.
 1.68 11-Dec-2005  christos branches: 1.68.4; 1.68.8;
merge ktrace-lwp.
 1.67 06-Jul-2005  dyoung branches: 1.67.2;
Identify Alvarion Ltd. BreezeNET PC-DS.11b. Addresses kern/30231.
 1.66 22-Jun-2005  dyoung Resolve conflicts in importation of 18-May-2005 ath(4) / net80211(9)
from FreeBSD. Introduce compatibility shims (sys/dev/ic/ath_netbsd.[ch],
sys/net80211/ieee80211_netbsd.[ch]). Update drivers (an, atu, atw,
awi, ipw, iwi, rtw, wi) for the new net80211(9) API.
 1.65 10-Jun-2005  itohy cc1: warnings being treated as errors
../../../../dev/pcmcia/if_wi_pcmcia.c: In function `wi_pcmcia_write_firm':
../../../../dev/pcmcia/if_wi_pcmcia.c:511: warning: cast discards qualifiers from pointer target type
../../../../dev/pcmcia/if_wi_pcmcia.c:512: warning: cast discards qualifiers from pointer target type
 1.64 07-May-2005  martin Add SMC2531W-B EliteConnect Wireless Adapter.
From Matthias Petermann in PR kern/30001.
 1.63 23-Mar-2005  martin Add support for Proxim RangeLAN-DS 8430;
from Gabriel Fort�, via Julien Rampon on tech-net
 1.62 19-Mar-2005  christos PR/29482: Kirk Strauser: Add support for Microsoft MN-520 PCMCIA WLAN card
 1.61 27-Feb-2005  perry branches: 1.61.2;
nuke trailing whitespace
 1.60 04-Feb-2005  perry de-__P
 1.59 21-Jan-2005  imp branches: 1.59.2;
Update to using new INTERSIL names, plus a couple generic entries from FreeBSD
 1.58 10-Aug-2004  mycroft branches: 1.58.4;
Rather than the silly state machine, set whatever higher-level reference
count there is (for SCSI, adapt_refcnt) to 1 and call the appropriate
"delref" function afterwards to disable the controller. This is a bit
simpler.

In a couple of cases, just remove the state machine, because it wasn't
really necessary.
 1.57 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.56 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.55 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.54 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.53 10-Aug-2004  mycroft Copyright maintenance.
 1.52 10-Aug-2004  mycroft Update to the new world order.
 1.51 09-Aug-2004  mycroft Make pcmcia_function_disable() primarily responsible for disabling the CCR
bits. pcmcia_intr_disestablish() continues to do this as a stopgap.
 1.50 09-Aug-2004  mycroft Do our io_map()s and intr_establish()es earlier.
 1.49 09-Aug-2004  mycroft Access to this device is strictly 16-bit, so use PCMCIA_WIDTH_IO16.
 1.48 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.47 07-Aug-2004  mycroft Clean up the Lucent (and clone) entries a bit.
Add the Hermes II (doesn't work yet, but it's harmless).
 1.46 07-Aug-2004  mycroft Clean up attach messages.
 1.45 05-Aug-2004  mycroft Match Spectrum24 by product ID, not string.
 1.44 05-Aug-2004  mycroft Add Asustek WL-100, per PR 26559.
 1.43 07-Jul-2004  mycroft More cleanup:
* Print "devinfo" in a canonial place (like we do in the SCSI code).
* Use aprint_{error,normal}() during attach.
* More PCMCIA_STR_* removal.
 1.42 07-Jul-2004  mycroft The PCMCIA_STR_* values in this driver weren't even used! Remove them.
Also, add a new device, and printf()->aprint_normal().
 1.41 25-Jan-2004  sekiya Add definition for IO-DATA WCF12 wireless CF card and allow the wi driver to
match it. Definition originally from FreeBSD by way of Steve Rumble.
 1.40 27-Dec-2003  christos Don't print an empty "wi0:\n" line. Join a couple of lines.
 1.39 25-Dec-2003  nonaka Added corega WLCFL-11 entry.
 1.38 07-Dec-2003  dyoung Enable RSSI-based rate-adaptation for wi(4). This enables wi(4)-based
APs to run at "full speed" where before they ran at just 1 or 2Mb/s.
The AP will adapt the data rate for each client based on packet
losses and the received signal strength.

I have also enabled rate adaptation for STA mode and for IBSS mode,
but the hardware gives us less control over the data rate in those
modes.
 1.37 16-Nov-2003  dyoung Add data-link type DLT_IEEE802_11_RADIO to wi and atw. DLT_IEEE802_11_RADIO
lets you monitor radio stats like received signal strength, which
diversity antenna was used, channel/frequency, modulation, and data
rate.
 1.36 02-Nov-2003  dyoung Fix PCMCIA attach messages for wi(4). Tested by Greg Troxel.
 1.35 13-Oct-2003  dyoung Switch wi(4) to the new 802.11 layer.
 1.34 16-Sep-2003  onoe Add Sony PEGA-WL110 CF WLAN
 1.33 29-Mar-2003  perry branches: 1.33.2;
support Corega PCCL-11 -- from Christopher SEKIYA in PR 20932
 1.32 29-Dec-2002  jdc Match the D-Link DWL650H.
Tested on i386 and hpcarm.
 1.31 25-Nov-2002  thorpej Avoid strict-alias warnings.
 1.30 06-Nov-2002  onoe Add support of Sony PEGA-WL100 CF Wireless LAN Card.
 1.29 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.28 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.27 30-Sep-2002  onoe Nuke unneeded member sc_ifp and use #define sc_if instead,
to prepare jumbo commit for wi.c
 1.26 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.25 04-Sep-2002  mason Support this device, which is evidently a rebadged GEMTEK WLAN which we
already support under another name:

wi0 at pcmcia0 function 0: NETGEAR MA401RA Wireless PC, Card, ISL37300PEval-RevA
wi0: 802.11 address <whatever>
wi0: using RF:PRISM2.5 MAC:ISL3873B(PCMCIA)
wi0: Intersil Firmware: Primary (1.0.7), Station (1.3.6)
 1.24 17-Jun-2002  martin Add support for Zcomax/ELSA XI325. From Jasper Wallace in PR 17252.
 1.23 08-Jun-2002  martin Add support for ACTIONTEC wireless lan card, from jasper@pointless.net
in PR kern/17194.
 1.22 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.21 31-May-2002  mycroft Add a Nortel e-Mobility card.
 1.20 26-May-2002  tshiozak add PLANEX GW-NS11H Wireless LAN PC Card.
 1.19 20-May-2002  thorpej branches: 1.19.2;
Add another Linksys card.
 1.18 07-May-2002  onoe branches: 1.18.2;
Add support for LINKSYS Instant Wireless Network CF Card
 1.17 15-Apr-2002  onoe Add support to Symbol Wireless Networker CF card.
The card is Type 1 CF card and it doesn't have firmware in.
So we need to download the firmware image into the card before
touching it.
XXX downloading code should be written in generic (bus independent),
but I don't have enough information for now.
 1.16 17-Jan-2002  joda add support for Ericsson PRISM2 card (kern/15130)
 1.15 04-Dec-2001  christos PR/13711: Peter Seebach: Symbol's Spectrum24 pcmcia/prism2 card isn't probed.
 1.14 26-Nov-2001  ichiro support BUFFALO CFtype WLAN card

wi0 at pcmcia1 function 0: BUFFALO, WLI-CF-S11G,
wi0: 802.11 address 00:07:40:0f:03:ea
wi0: using RF:PRISM2.5 MAC:ISL3873, Firmware: 1.3 variant 4
 1.13 18-Nov-2001  mrg match the linksys prism2 card.
 1.12 13-Nov-2001  lukem add RCSIDs
 1.11 01-Nov-2001  imp Add Intel PRO WLAN 2011.
 1.10 27-Oct-2001  ichiro add entry ELSA XI-800 CF wavelan card
 1.9 20-Oct-2001  mjl branches: 1.9.2;
Add Corega PCCB-11, as per PR/14298
 1.8 13-Oct-2001  ichiro Add Intersil Prism2.5 Mini-PCI wavelan.
 1.7 17-Sep-2001  ichiro add entry "GEMTEK CF WaveLAN Card"
 1.6 13-Jul-2001  onoe branches: 1.6.2;
disable the function if attach fails.
 1.5 01-Jul-2001  thorpej branches: 1.5.2;
Remove unneeded include files. From Onno van der Linden.
 1.4 27-Jun-2001  ichiro enabling EMTAC A2424i Wavelan Card
It work fine.
 1.3 16-May-2001  ichiro branches: 1.3.2;
support BUFFALO AirStation WLI-PCM-S11
this card are PRISM2.5 card.
 1.2 15-May-2001  ichiro It enabled it to control roaming mode and authentication mode.
Roaming mode can change value into 'firm mode' and disable.
Authentication mode can change into 'Open System authentication'
and 'Shared Key Authentication' with Prism2 chip.

wi_get_id() was introduced in order that chip might judge automatically
whether it is Prism2 chip. Therefore, a pp_prism2 entry in
"struct wi_pcmcia_product" became unnecessary.
 1.1 06-May-2001  ichiro divided into PCMCIA attachment and common code of wi.
since if_wi_ieee.h does not depend for pcmcia,
sys/dev/pcmcia/if_wi_ieee.h was moved to sys/dev/ic/wi_ieee.h .
 1.3.2.15 29-Dec-2002  thorpej Sync with HEAD.
 1.3.2.14 11-Dec-2002  thorpej Sync with HEAD.
 1.3.2.13 11-Nov-2002  nathanw Catch up to -current
 1.3.2.12 18-Oct-2002  nathanw Catch up to -current.
 1.3.2.11 17-Sep-2002  nathanw Catch up to -current.
 1.3.2.10 20-Jun-2002  nathanw Catch up to -current.
 1.3.2.9 17-Apr-2002  nathanw Catch up to -current.
 1.3.2.8 28-Feb-2002  nathanw Catch up to -current.
 1.3.2.7 08-Jan-2002  nathanw Catch up to -current.
 1.3.2.6 14-Nov-2001  nathanw Catch up to -current.
 1.3.2.5 22-Oct-2001  nathanw Catch up to -current.
 1.3.2.4 21-Sep-2001  nathanw Catch up to -current.
 1.3.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.3.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.3.2.1 16-May-2001  nathanw file if_wi_pcmcia.c was added on branch nathanw_sa on 2001-06-21 20:05:18 +0000
 1.5.2.6 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.5.2.5 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.5.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.5.2.3 11-Feb-2002  jdolecek Sync w/ -current.
 1.5.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.2.1 03-Aug-2001  lukem update to -current
 1.6.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.9.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.18.2.2 20-Jun-2002  gehenna catch up with -current.
 1.18.2.1 30-May-2002  gehenna Catch up with -current.
 1.19.2.4 19-Nov-2002  tron Pull up revision 1.25 (requested by abs in ticket #971):
Support this device, which is evidently a rebadged GEMTEK WLAN which we
already support under another name:
wi0 at pcmcia0 function 0: NETGEAR MA401RA Wireless PC, Card, ISL37300PEval-RevA
wi0: 802.11 address <whatever>
wi0: using RF:PRISM2.5 MAC:ISL3873B(PCMCIA)
wi0: Intersil Firmware: Primary (1.0.7), Station (1.3.6)
 1.19.2.3 18-Jun-2002  lukem Pull up revision 1.24 (requested by martin in ticket #295):
Add support for Zcomax/ELSA XI325. From Jasper Wallace in PR 17252.
 1.19.2.2 10-Jun-2002  tv Pull up revision 1.23 (requested by martin in ticket #215):
Add support for ACTIONTEC wireless lan card, from jasper@pointless.net
in PR kern/17194.
 1.19.2.1 31-May-2002  tv Pull up revision 1.21 (requested by mycroft in ticket #108):
Support Nortel e-Mobility cards.
 1.33.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.33.2.8 01-Apr-2005  skrll Sync with HEAD.
 1.33.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.33.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.33.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.33.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.33.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.33.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.33.2.1 03-Aug-2004  skrll Sync with HEAD
 1.58.4.1 29-Apr-2005  kent sync with -current
 1.59.2.3 26-Mar-2005  yamt sync with head.
 1.59.2.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.59.2.1 12-Feb-2005  yamt sync with head.
 1.61.2.4 31-Jul-2006  tron Pull up following revision(s) (requested by scottr in ticket #1436):
sys/dev/pcmcia/pcmciadevs: revision 1.217 via patch
sys/dev/pcmcia/if_wi_pcmcia.c: revision 1.69 via patch
Add Siemens SS1021 WLAN.
 1.61.2.3 28-Jul-2006  tron Backout commit which went into the wrong branch accidentally.
 1.61.2.2 28-Jul-2006  scottr Regenerate headers, this time with correct rcsid
 1.61.2.1 07-May-2005  tron Pull up revision 1.64 (requested by martin in ticket #262):
Add SMC2531W-B EliteConnect Wireless Adapter.
From Matthias Petermann in PR kern/30001.
 1.67.2.3 21-Jan-2008  yamt sync with head
 1.67.2.2 27-Oct-2007  yamt sync with head.
 1.67.2.1 30-Dec-2006  yamt sync with head.
 1.68.8.1 11-Aug-2006  yamt sync with head
 1.68.4.1 09-Sep-2006  rpaulo sync with head
 1.69.6.2 10-Dec-2006  yamt sync with head.
 1.69.6.1 22-Oct-2006  yamt sync with head
 1.69.4.2 12-Jan-2007  ad Sync with head.
 1.69.4.1 18-Nov-2006  ad Sync with head.
 1.75.24.1 25-Oct-2007  bouyer Sync with HEAD.
 1.75.20.2 09-Jan-2008  matt sync with HEAD
 1.75.20.1 06-Nov-2007  matt sync with HEAD
 1.75.18.4 08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.75.18.3 06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.75.18.2 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.75.18.1 04-Sep-2007  joerg Convert wi(4) to jmcneill-pm style power management.
 1.75.6.1 23-Oct-2007  ad Sync with head.
 1.76.6.1 11-Dec-2007  yamt sync with head.
 1.76.4.1 26-Dec-2007  ad Sync with head.
 1.77.10.2 17-Jan-2009  mjf Sync with HEAD.
 1.77.10.1 02-Jun-2008  mjf Sync with HEAD.
 1.78.4.4 16-Sep-2009  yamt sync with head
 1.78.4.3 16-May-2009  yamt sync with head
 1.78.4.2 04-May-2009  yamt sync with head.
 1.78.4.1 16-May-2008  yamt sync with head.
 1.78.2.1 18-May-2008  yamt sync with head.
 1.79.8.2 28-Apr-2009  skrll Sync with HEAD.
 1.79.8.1 19-Jan-2009  skrll Sync with HEAD.
 1.79.6.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.80.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.85.4.1 05-Mar-2011  rmind sync with head
 1.89.12.2 03-Dec-2017  jdolecek update from HEAD
 1.89.12.1 23-Jun-2013  tls resync from head
 1.89.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.90.12.1 09-Jul-2016  skrll Sync with HEAD
 1.92.18.1 10-Jun-2019  christos Sync with HEAD
 1.92.16.1 18-Jan-2019  pgoyette Synch with HEAD
 1.8 06-May-2001  ichiro divided into PCMCIA attachment and common code of wi.
since if_wi_ieee.h does not depend for pcmcia,
sys/dev/pcmcia/if_wi_ieee.h was moved to sys/dev/ic/wi_ieee.h .
 1.7 11-Jan-2001  ichiro branches: 1.7.2;
about WI_TIMEOUT:
It is not enough to initialize NANOSPEED ROOT-RZ2000 WLAN Card.
In fact, this card needs about 66900 counts.
 1.6 23-May-2000  enami Remove $Id.
 1.5 04-Feb-2000  explorer branches: 1.5.2;
bring over WEP mode from FreeBSD/OpenBSD
 1.4 04-Feb-2000  explorer undo part of the previous commit. I'll just steal the code from freebsd,
to minimize differences between the drivers.
 1.3 04-Feb-2000  explorer Add encryption structure definitions -- it's interesting tht the gold card
has 128 bit encryption, but the key space is 14 * 8 bits, or 112 bits...
I wonder where the other 16 bits comes from?
 1.2 15-Jul-1999  sommerfeld branches: 1.2.2; 1.2.4;
Clarify that the empty string, not the string ANY, as the network name means
pick any access point
 1.1 14-Jul-1999  sommerfeld Blitz port of the FreeBSD wi* driver for the Lucent WaveLan IEEE
PCMCIA wireless LAN.
Original driver written by Bill Paul <wpaul@ctr.columbia.edu>
 1.2.4.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.2.4.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.2.2.2 02-Aug-1999  thorpej Update from trunk.
 1.2.2.1 15-Jul-1999  thorpej file if_wireg.h was added on branch chs-ubc2 on 1999-08-02 22:04:48 +0000
 1.5.2.2 11-May-2000  he Pull up revisions 1.1-1.5 (requested by jhawk):
Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.
 1.5.2.1 04-Feb-2000  he file if_wireg.h was added on branch netbsd-1-4 on 2000-05-11 08:45:20 +0000
 1.7.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.16 06-May-2001  ichiro divided into PCMCIA attachment and common code of wi.
since if_wi_ieee.h does not depend for pcmcia,
sys/dev/pcmcia/if_wi_ieee.h was moved to sys/dev/ic/wi_ieee.h .
 1.15 09-Dec-2000  castor branches: 1.15.2;
Make sc->wi_txbuf an array of u_int16_t instead u_int8_t so alignment
is handled correctly. Thanks to Martin Husemann for nagging me to
do the right thing.
 1.14 12-Oct-2000  enami Use ether_ioctl.
 1.13 28-Aug-2000  joda provide some randomness
 1.12 26-Aug-2000  jhawk oops, missed this file earlier (Doh!):
Add support for "microwave oven robustness" with wiconfig -M.
 1.11 18-Jul-2000  onoe Add support for Corega Wireless LAN PCC-11, and Farallon SkyLINE 11Mb.
Note that Corega card works at 3.3V only, then it requires cardbus code
for now.
 1.10 05-Jul-2000  onoe change the argument of SIOCS80211NWID and SIOCG80211NWID ioctls from
u_int8_t array to struct ieee80211_nwid to prepend length field.
The length field is necessary because IEEE 802.11 spec doesn't prohibit
even '\0' for SSID.
Though the name and the value of SIOC... macro is unchanged, this change
breaks binary compatibility. The only affected userland program on the
tree is ifconfig(8).
As Jason suggested on tech-net, it is better than live with problems
since there are no releases for this ioctls yet.
 1.9 23-May-2000  enami branches: 1.9.4;
Remove $Id.
 1.8 23-Mar-2000  thorpej branches: 1.8.2;
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.7 06-Mar-2000  enami - Remove redundant assignment.
- Don't disestablish shutdown hook if we can't establish it.
- Noneed to manage resouces individually.
 1.6 02-Mar-2000  enami Add ifmedia support so that dhcp happy. Also, add nwid support.
 1.5 27-Feb-2000  enami - Disestablish an interrupt if failed to enable the card.
- If card isn't enabled, just set given information into softc. Addresses
PR#9457.
- Some cleanups and cosmetic changes.
 1.4 13-Feb-2000  itojun on attach, check if we've got meaningful mac address or not,
to detect io mapping problem.

on detach, handle resource deallocations more carefully.
 1.3 04-Feb-2000  explorer bring over WEP mode from FreeBSD/OpenBSD
 1.2 14-Jul-1999  sommerfeld branches: 1.2.2; 1.2.4;
Add shutdown hook to turn off card.
Fix BPF tap code.
 1.1 14-Jul-1999  sommerfeld Blitz port of the FreeBSD wi* driver for the Lucent WaveLan IEEE
PCMCIA wireless LAN.
Original driver written by Bill Paul <wpaul@ctr.columbia.edu>
 1.2.4.2 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.2.4.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.2.2.2 02-Aug-1999  thorpej Update from trunk.
 1.2.2.1 14-Jul-1999  thorpej file if_wivar.h was added on branch chs-ubc2 on 1999-08-02 22:04:48 +0000
 1.8.2.2 11-May-2000  he Pull up revisions 1.1-1.7 (requested by jhawk):
Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.
 1.8.2.1 23-Mar-2000  he file if_wivar.h was added on branch netbsd-1-4 on 2000-05-11 09:10:40 +0000
 1.9.4.3 25-Jan-2001  jhawk Pull up revision 1.15 (requested by castor):
Ensure the ethernet payload is properly aligned. Fixes PR port-hpcmips/11477.
 1.9.4.2 21-Jul-2000  onoe Pullup 802.11 stuff (approved by jhawk)
- add support for Corega Wireless LAN PCC-11, and Faralon SkyLINE 11Mb
to wi driver.
syssrc/sys/dev/pcmcia/pcmciadevs 1.95
syssrc/sys/dev/pcmcia/pcmciadevs.h 1.94
syssrc/sys/dev/pcmcia/pcmciadevs_data.h 1.94
syssrc/sys/dev/pcmcia/if_wi.c 1.24
syssrc/sys/dev/pcmcia/if_wivar.h 1.11
 1.9.4.1 21-Jul-2000  onoe Pullups 802.11 stuff (approved by jhawk)
- allow non-string nwid settings
basesrc/sbin/ifconfig/ifconfig.c 1.82-1.86
basesrc/sbin/ifconfig/ifconfig.8 1.37
syssrc/sys/dev/ic/awi.c 1.21
syssrc/sys/dev/pcmcia/if_ray.c 1.21
syssrc/sys/dev/pcmcia/if_wi.c 1.23
syssrc/sys/dev/pcmcia/if_wivar.h 1.10
syssrc/sys/net/if_ieee80211.h 1.4
 1.15.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.7 05-Jun-2000  gmcgarry Replaced by xi(4).
 1.6 30-Mar-2000  augustss branches: 1.6.2;
Remove register declarations.
 1.5 06-Mar-2000  thorpej No longer necessary to futz with ifp->if_baudrate here.
 1.4 02-Feb-2000  thorpej Don't dry to diving MIIF_NOISOLATE in the PHY drivers. Instead, pass
flags down from the parent to child vi mii_attach().
 1.3 02-Feb-2000  thorpej Bring some order to the chaos which was the MII code function naming
"conventions".
 1.2 09-Jan-2000  joda now compiles on NetBSD
 1.1 09-Jan-2000  joda add Xircom 16-bit PCMCIA driver (from OpenBSD)
 1.6.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.3 05-Jun-2000  gmcgarry Replaced by xi(4).
 1.2 09-Jan-2000  joda branches: 1.2.2;
add NetBSD tag
 1.1 09-Jan-2000  joda add Xircom 16-bit PCMCIA driver (from OpenBSD)
 1.2.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.96 25-Sep-2022  thorpej Remove unnecessary include of <sys/malloc.h>.
 1.95 08-Apr-2022  andvar fix various typos, mainly in comments, but also log messages, docs, game text.
 1.94 02-Feb-2020  thorpej - Adopt <net/if_stats.h>.
- Use ifmedia_fini().
 1.93 06-Jan-2020  msaitoh branches: 1.93.2;
Protect ec_multicnt.
 1.92 28-Nov-2019  maxv localify
 1.91 30-Oct-2019  msaitoh ether_input() automatically add input bytes to if_ibytes, so it's not
required to do in the driver who use ether_input().
 1.90 28-May-2019  msaitoh branches: 1.90.2;
Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.89 23-May-2019  msaitoh Whitespace fix (mainly tabify).
 1.88 23-May-2019  msaitoh No functional change:
- Simplify MII structure initialization and reference.
- u_int*_t -> uint*_t.
- KNF
 1.87 22-Apr-2019  msaitoh These drivers do ether_ioctl() on SIOC{ADD,DEL}MULTI, SIOC{G,S}IFMEDIA and
default case in the switch statement. Only the default case didn't check the
return value with ENETRESET. Integrate them to one ether_ioctl() with
ENETRESET test. This change might improve some other ioctl()s which return
ENETRESET by calling if_init().
 1.86 05-Feb-2019  msaitoh Remove very old IFF_NOTRAILERS flag.
 1.85 22-Jan-2019  msaitoh Change MII PHY read/write API from:

int (*mii_readreg_t)(device_t, int, int);
void (*mii_writereg_t)(device_t, int, int, int);
to:

int (*mii_readreg_t)(device_t, int, int, uint16_t *);
int (*mii_writereg_t)(device_t, int, int, uint16_t);

Now we can test if a read/write operation failed or not by the return value.

In 802.3 spec says that the PHY shall not respond to read/write transaction
to the unimplemented register(22.2.4.3). Detecting timeout can be used to
check whether a register is implemented or not (if the register conforms to
the spec). ukphy(4) can be used this for MII_MMDACR and MII_MMDAADR.

Note that I noticed that the following code do infinite loop in the
read/wirte function. If it accesses unimplemented PHY register, it will hang.
It should be fixed:

arm/at91/at91emac.c
arm/ep93xx/epe.c
arm/omap/omapl1x_emac.c
mips/ralink/ralink_eth.c
arch/powerpc/booke/dev/pq3etsec.c(read)
dev/cadence/if_cemac.c <- hkenken
dev/ic/lan9118.c


Tested with the following device:

axe+ukphy
axe+rgephy
axen+rgephy (tested by Andrius V)
wm+atphy
wm+ukphy
wm+igphy
wm+ihphy
wm+makphy
sk+makphy
sk+brgphy
sk+gentbi
msk+makphy
sip+icsphy
sip+ukphy
re+rgephy
bge+brgphy
bnx+brgphy
gsip+gphyter
rtk+rlphy
fxp+inphy (tested by Andrius V)
tlp+acphy
ex+exphy
epic+qsphy
vge+ciphy (tested by Andrius V)
vr+ukphy (tested by Andrius V)
vte+ukphy (tested by Andrius V)

Not tested (MAC):
arm:at91emac
arm:cemac
arm:epe
arm:geminigmac
arm:enet
arm:cpsw
arm:emac(omac)
arm:emac(sunxi)
arm:npe
evbppc:temac
macppc:bm
macppc:gm
mips:aumac
mips:ae
mips:cnmac
mips:reth
mips:sbmac
playstation2:smap
powerpc:tsec
powerpc:emac(ibm4xx)
sgimips:mec
sparc:be
sf
ne(ax88190, dl10019)
awge
ep
gem
hme
smsh
mtd
sm
age
alc
ale
bce
cas
et
jme
lii
nfe
pcn
ste
stge
tl
xi
aue
mue
smsc
udav
url

Not tested (PHY):
amhphy
bmtphy
dmphy
etphy
glxtphy
ikphy
iophy
lxtphy
nsphyter
pnaphy
rdcphy
sqphy
tlphy
tqphy
urlphy
 1.84 08-Jan-2019  msaitoh u_int{8,16,32}_t -> uint{8,16,32}_t. No functional change.
 1.83 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.82 26-Jun-2018  msaitoh branches: 1.82.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.81 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.80 15-Dec-2016  ozaki-r branches: 1.80.8; 1.80.14;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.79 08-Dec-2016  ozaki-r Apply deferred if_start framework

if_schedule_deferred_start checks if the if_snd queue contains packets,
so drivers don't need to check it by themselves.
 1.78 02-Oct-2016  christos MFREE -> m_free
 1.77 10-Jun-2016  ozaki-r branches: 1.77.2;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.76 09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.75 25-May-2015  ozaki-r Remove leftover IPX-related stuffs

No objection on tech-kern and tech-net.
 1.74 10-Aug-2014  tls branches: 1.74.4;
Merge tls-earlyentropy branch into HEAD.
 1.73 22-Jul-2012  matt branches: 1.73.2; 1.73.12;
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.72 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.71 05-Apr-2010  joerg branches: 1.71.8; 1.71.12;
Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.70 19-Jan-2010  pooka branches: 1.70.2; 1.70.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.69 06-Dec-2009  dyoung device_t/softc split.
 1.68 13-Nov-2009  dyoung Don't use com_activate(), it's gone away. Thanks to Andreas Wrede
for pointing out that these drivers still used com_activate().

Use device_private(). Join some lines.

Remove superfluous activation hooks.

Add child-detachment hooks (not used, yet).

TBD: device_t/softc split.
 1.67 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.66 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.65 07-Nov-2008  dyoung branches: 1.65.4;
*** Summary ***

When a link-layer address changes (e.g., ifconfig ex0 link
02:de:ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address. (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior. Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability. KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR. In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr. That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR. In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR. For example, pull ..._init() out of any switch
statement that looks like this:

switch (...->sa_family) {
case ...:
..._init();
...
break;
...
default:
..._init();
...
break;
}

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

switch (x & (IFF_UP|IFF_RUNNING)) {
case 0:
...
break;
case IFF_RUNNING:
...
break;
case IFF_UP:
...
break;
case IFF_UP|IFF_RUNNING:
...
break;
}

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure. Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls. In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source. In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively. Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset. Delete unnecessary casts to void *. Use
sockaddr_in_init() and sockaddr_in6_init(). Compare pointers with
NULL instead of "testing truth". Replace some instances of (type
*)0 with NULL. Change some K&R prototypes to ANSI C, and join
lines.
 1.64 05-Apr-2008  cegger branches: 1.64.4; 1.64.10; 1.64.12;
use aprint_*_dev and device_xname
 1.63 19-Jan-2008  dyoung branches: 1.63.6;
Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange(). Check for
a non-ENXIO error return from mii_mediachg(). (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines. There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run. I have compiled macppc, sparc64, i386. I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
 1.62 01-Sep-2007  dyoung branches: 1.62.6; 1.62.12;
Change a bazillion occurrences of code resembling this,

error = (cmd == SIOCADDMULTI) ?
ether_addmulti(ifr, &sc->sc_ec) :
ether_delmulti(ifr, &sc->sc_ec);

if (error == ENETRESET) {

to this,

if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {

which does the same thing.

(A bazillion is a very large number. This seems to make the i386
ALL kernel smaller by 3kB to 4kB.)

Use ifreq_getaddr() twice in es(4).

Whitespace nits.
 1.61 29-Aug-2007  dyoung Constify: LLADDR() -> CLLADDR().
 1.60 04-Mar-2007  christos branches: 1.60.2; 1.60.10; 1.60.14; 1.60.16;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.59 16-Nov-2006  christos branches: 1.59.4;
__unused removal on arguments; approved by core.
 1.58 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.57 07-Sep-2006  dogcow branches: 1.57.2; 1.57.4;
remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.
 1.56 14-Apr-2006  christos Coverity CID 1112: If we did not get a packet, bail out early.
 1.55 20-Feb-2006  thorpej branches: 1.55.2; 1.55.4; 1.55.6;
Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
 1.54 24-Dec-2005  perry branches: 1.54.2; 1.54.4; 1.54.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.53 11-Dec-2005  christos merge ktrace-lwp.
 1.52 27-Feb-2005  perry branches: 1.52.4;
nuke trailing whitespace
 1.51 04-Feb-2005  perry de-__P
 1.50 30-Jan-2005  thorpej Eliminate the use of M_HASFCS.
 1.49 30-Oct-2004  thorpej branches: 1.49.4; 1.49.6;
When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.48 12-Aug-2004  mycroft Remove sc_offset. It's always 0, and if we did want to use it, "that's what
bus_space_subregion() is for".
 1.47 12-Aug-2004  mycroft Remove the "known bugs" section. I've fixed both of them.

Use tsleep() rather than delay(). XXX Most of these are probably unnecessary
anyway. In particular, I believe that what xi_full_reset() does is totally
gratuitous after power-cycling the socket; it should only be necessary if we
want to use power-saving mode.
 1.46 09-Aug-2004  mycroft Add a hack that makes the address register programming more reliable on my
CE2 cards.
 1.45 09-Aug-2004  mycroft The "savedpage" stuff is nonsense. Every place we touch the device is
protected by splnet(), so there's no reason to even try.
 1.44 09-Aug-2004  mycroft Go online in xi_init(), not xi_full_reset(). Enable/disable receive in
xi_init()/xi_stop().
 1.43 08-Aug-2004  mycroft Don't try to use the MII media status if we're not using MII.
 1.42 08-Aug-2004  mycroft * Some rearrangement of where the power control hooks are called.
* Don't splnet() in xi_init() -- the callers do that.
* Don't do the enable call in xi_init() -- it should be done only in a process
context so it can sleep.
* Call xi_start() at the end of xi_init() to restart output.
* If the interface is already up, we only need to call xi_set_address() to
change state on SIOCSIFFLAGS.
 1.41 08-Aug-2004  mycroft Hey, my LEDs work now.
 1.40 08-Aug-2004  mycroft Set xidebug to 0 by default.
 1.39 08-Aug-2004  mycroft Split "xi" into a "xirc" frontend (similar to mhzc; it attaches two child
devices) and a "xi" backend.

My CE2 and CEM2 cards are now probed correctly. However, there are still
some problems with one model of the CE2, and the CEM2 doesn't seem to get
any modem interrupts.

While I'm at it, fix several bugs:

* The tuple scan for the MAC address was broken in multiple ways.
* xi_intr() did not deal well with a shared interrupt.
* We were setting the wrong page number to look at the receive status. (How
did this work???)
* Remove the xi_full_reset() from xi_reset(). Move the parts of
xi_full_reset() needed to undo the effect of xi_stop() into xi_init(). This
allows a stop/init pair to DTRT, and much quicker, as used by various
ioctl()s.
* Set the TRS register before reading the TSO register, as the Linux driver
does. While I'm at it, fix the name.
* Fix numerous problems with xi_set_address(). "Where do I begin?" There's a
chance that multicast works now, but I haven't tested it.
* Explicitly clear the MSR register, and also force SELECT_MII to 0 if we
didn't find any PHYs.
* Clean up some cruft that appears to be bogus.

Probably needs more work, but it's a start.
 1.38 07-Aug-2004  mycroft Simplify the revision matching code. This is more like what the current
Linux driver does.
 1.37 07-Aug-2004  mycroft Oops; forgot a return.
 1.36 07-Aug-2004  mycroft Tighten up the CIS parsing code a little.
Fix a double-free in a failure case.
Turn off the card if it doesn't fully attach.
 1.35 06-Aug-2004  mycroft Don't call rnd_detach_source() if we never called rnd_attach_source().
Very minor other cleanup.
 1.34 07-Jul-2004  mycroft More cleanup:
* Print "devinfo" in a canonial place (like we do in the SCSI code).
* Use aprint_{error,normal}() during attach.
* More PCMCIA_STR_* removal.
 1.33 28-Oct-2003  mycroft Eliminate bogus initializer.
We shouldn't be adding the time stamp to the entropy pool if the interrupt
wasn't for us.
 1.32 25-Oct-2003  christos Fix uninitialized variable warnings
 1.31 23-Jun-2003  martin branches: 1.31.2;
Make sure to include opt_foo.h if a defflag option FOO is used.
 1.30 27-Feb-2003  martin bus_size_t != bus_addr_t, so use bus_size_t where appropriate.
Fixes PR kern/20482 by John Ruschmeyer.
 1.29 22-Feb-2003  tsutsui hz -> Hz
 1.28 10-Dec-2002  bouyer Commit patch I sent to tech-net on 29/09/2002:
The driver puts the adapter in promisc mode to receive multicast addresses.
At last set the IFF_PROMISC flag so that the upper layer filters frames
that are not for us.
Sure, the real fix would be to get multicast filters working ...
 1.27 23-Oct-2002  perry remove redundant defines caught by lint
 1.26 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.25 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.24 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.23 22-Sep-2002  martin Apply a patch from Murray Armfield in PR kern/18372: bring in some changes
from FreeBSD to improve receive performance.
 1.22 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.21 05-May-2002  takemura branches: 1.21.2; 1.21.4;
Added cast '(u_int16_t *)'.
4th arg of bus_space_read_multi_2 and bus_space_write_multi2 shuld be
u_int16_t *.
 1.20 12-Jan-2002  tsutsui Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.19 15-Dec-2001  soren Use bus_size_t's for bus space read/write offsets.
 1.18 13-Nov-2001  lukem add RCSIDs
 1.17 08-Nov-2001  christos PR/14503: Cesar Crusius: Add Xircom XE2000.
 1.16 25-Oct-2001  bouyer Commit changes I posted to tech-kern on Oct 14, which makes the ethernet part
of my Xircom RealPort Ethernet 10/100 + Modem (REM56G) work.
The modem part is still not usable (this would need some PCMCIA magic that
I don't know how to do; see my message to tech-kern on Oct 07).
Change to pcmcia_cis.c from OpenBSD.
I checked that this doesn't break a 3com 3C562D (ethernet+modem) which I
also have.
 1.15 26-Sep-2001  chris branches: 1.15.2;
Move the call to the xi_pcmcia_identify to before the first use of sc->sc_flags.
Doesn't fix my problem with auto negotiate, but it might help others.
 1.14 07-Jul-2001  thorpej branches: 1.14.2; 1.14.4;
bzero -> memset
 1.13 07-Jul-2001  thorpej bcmp -> memcmp
 1.12 07-Jul-2001  thorpej bcopy -> memcpy
 1.11 01-Jul-2001  gmcgarry Jumbo patch:

- data alignment fix
- kludge around broken multicast by using promisc mode
(IPv6 router solicitation now works)
- add support as random source
- support device power-up and power-down
- vlan support
- misc. comment and style fixes
 1.10 10-Jun-2001  gmcgarry Packet includes CRC, so mark it in the mbuf header. Fixes the
"discarding oversize frame (len=1518)" problem.
 1.9 21-Feb-2001  jdolecek branches: 1.9.2;
make some more constant arrays 'const'
 1.8 14-Jan-2001  thorpej Use splnet() to block network interrupts, not splimp().
 1.7 14-Dec-2000  thorpej ALTQ'ify.
 1.6 15-Nov-2000  thorpej branches: 1.6.2;
Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.5 01-Oct-2000  thorpej Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
 1.4 31-Jul-2000  gmcgarry XIDEBUG_CONFIG -> XID_CONFIG. From R.Massar@Fh-Worms.DE
 1.3 24-Jul-2000  gmcgarry Improve the model identification and match. Addresses PR-10485.
 1.2 09-Jun-2000  gmcgarry branches: 1.2.2; 1.2.4;
Rename remaining references from xe to xi. Clean up debug messages.
 1.1 05-Jun-2000  gmcgarry New driver for Xircom CreditCard PCMCIA Ethernet. Replaces xe driver which
didn't work. Renamed to avoid clash with next68k network driver.
 1.2.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.4.1 09-Jun-2000  minoura file if_xi.c was added on branch minoura-xpg4dl on 2000-06-22 17:07:46 +0000
 1.2.2.2 11-Jun-2001  he Pull up revision 1.10 (requested by gmcgarry):
Packet includes CRC, so mark it in the mbuf header. Fixes the
``discarding oversize frame (len=1518)'' problem.
 1.2.2.1 09-Aug-2000  gmcgarry Pull up rev 1.3-1.4: (approved by thorpej)

revision 1.3:
Improve the model identification and match. Addresses PR-10485.

revision 1.4:
XIDEBUG_CONFIG -> XID_CONFIG. From R.Massar@Fh-Worms.DE
 1.6.2.6 12-Mar-2001  bouyer Sync with HEAD.
 1.6.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.6.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.6.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.6.2.2 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.6.2.1 15-Nov-2000  bouyer file if_xi.c was added on branch thorpej_scsipi on 2000-11-20 11:42:45 +0000
 1.9.2.10 19-Dec-2002  thorpej Sync with HEAD.
 1.9.2.9 11-Nov-2002  nathanw Catch up to -current
 1.9.2.8 18-Oct-2002  nathanw Catch up to -current.
 1.9.2.7 20-Jun-2002  nathanw Catch up to -current.
 1.9.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.9.2.5 08-Jan-2002  nathanw Catch up to -current.
 1.9.2.4 14-Nov-2001  nathanw Catch up to -current.
 1.9.2.3 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.9.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.9.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.14.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.14.2.4 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.14.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.14.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.21.4.2 30-Jun-2003  grant Pull up revision 1.28 (requested by bouyer in ticket #1351):

The driver puts the adapter in promisc mode to receive multicast addresses.
At last set the IFF_PROMISC flag so that the upper layer filters frames
that are not for us.
 1.21.4.1 02-Oct-2002  lukem Pull up revision 1.23 (requested by martin in ticket #891):
Apply a patch from Murray Armfield in PR kern/18372: bring in some changes
from FreeBSD to improve receive performance.
 1.21.2.1 20-Jun-2002  gehenna catch up with -current.
 1.31.2.8 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.31.2.7 04-Feb-2005  skrll Sync with HEAD.
 1.31.2.6 02-Nov-2004  skrll Sync with HEAD.
 1.31.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.31.2.3 25-Aug-2004  skrll Sync with HEAD.
 1.31.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.31.2.1 03-Aug-2004  skrll Sync with HEAD
 1.49.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.49.6.1 12-Feb-2005  yamt sync with head.
 1.49.4.1 29-Apr-2005  kent sync with -current
 1.52.4.4 21-Jan-2008  yamt sync with head
 1.52.4.3 03-Sep-2007  yamt sync with head.
 1.52.4.2 30-Dec-2006  yamt sync with head.
 1.52.4.1 21-Jun-2006  yamt sync with head.
 1.54.6.1 22-Apr-2006  simonb Sync with head.
 1.54.4.1 09-Sep-2006  rpaulo sync with head
 1.54.2.1 01-Mar-2006  yamt sync with head.
 1.55.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.55.4.1 19-Apr-2006  elad sync with head.
 1.55.2.2 14-Sep-2006  yamt sync with head.
 1.55.2.1 24-May-2006  yamt sync with head.
 1.57.4.2 10-Dec-2006  yamt sync with head.
 1.57.4.1 22-Oct-2006  yamt sync with head
 1.57.2.1 18-Nov-2006  ad Sync with head.
 1.59.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.60.16.2 23-Mar-2008  matt sync with HEAD
 1.60.16.1 06-Nov-2007  matt sync with HEAD
 1.60.14.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.60.10.1 03-Sep-2007  skrll Sync with HEAD.
 1.60.2.1 09-Oct-2007  ad Sync with head.
 1.62.12.1 20-Jan-2008  bouyer Sync with HEAD
 1.62.6.1 18-Feb-2008  mjf Sync with HEAD.
 1.63.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.63.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.64.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.64.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.64.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.64.4.4 11-Aug-2010  yamt sync with head.
 1.64.4.3 11-Mar-2010  yamt sync with head
 1.64.4.2 16-May-2009  yamt sync with head
 1.64.4.1 04-May-2009  yamt sync with head.
 1.65.4.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.70.4.1 30-May-2010  rmind sync with head
 1.70.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.71.12.1 18-Feb-2012  mrg merge to -current.
 1.71.8.2 30-Oct-2012  yamt sync with head
 1.71.8.1 17-Apr-2012  yamt sync with head
 1.73.12.1 07-Apr-2014  tls Be a little more clear and consistent about harvesting entropy from devices:

1) deprecate RND_FLAG_NO_ESTIMATE

2) define RND_FLAG_COLLECT_TIME, RND_FLAG_COLLECT_VALUE

3) define RND_FLAG_ESTIMATE_TIME, RND_FLAG_ESTIMATE_VALUE

4) define RND_FLAG_DEFAULT: RND_FLAG_COLLECT_TIME|
RND_FLAG_COLLECT_VALUE|RND_FLAG_ESTIMATE_TIME

5) Make entropy harvesting from environmental sensors a little more generic
and remove it from individual sensor drivers.

6) Remove individual open-coded delta-estimators for values from a few
places in the tree (uvm, environmental drivers).

7) 0 -> RND_FLAG_DEFAULT, actually gather entropy from various drivers
that had stubbed out code, other minor cleanups.
 1.73.2.2 03-Dec-2017  jdolecek update from HEAD
 1.73.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.74.4.5 05-Feb-2017  skrll Sync with HEAD
 1.74.4.4 05-Oct-2016  skrll Sync with HEAD
 1.74.4.3 09-Jul-2016  skrll Sync with HEAD
 1.74.4.2 19-Mar-2016  skrll Sync with HEAD
 1.74.4.1 06-Jun-2015  skrll Sync with HEAD
 1.77.2.2 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.77.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.80.14.5 26-Jan-2019  pgoyette Sync with HEAD
 1.80.14.4 18-Jan-2019  pgoyette Synch with HEAD
 1.80.14.3 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.80.14.2 28-Jul-2018  pgoyette Sync with HEAD
 1.80.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.80.8.2 06-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #1427):

sys/arch/arm/broadcom/bcm53xx_eth.c: revision 1.39
sys/dev/pcmcia/if_xi.c: revision 1.91
sys/dev/ic/aic6915.c: revision 1.40
sys/dev/pci/if_tl.c: revision 1.117
sys/arch/arm/gemini/gemini_gmac.c: revision 1.18
sys/dev/ic/elinkxl.c: revision 1.133
sys/dev/pci/if_ste.c: revision 1.57
sys/dev/pci/if_alc.c: revision 1.43
sys/dev/pci/if_stge.c: revision 1.72
sys/dev/pci/if_ale.c: revision 1.34
sys/dev/pci/if_age.c: revision 1.62
sys/dev/pci/if_txp.c: revision 1.60
sys/dev/ic/i82557.c: revision 1.156
sys/dev/pci/if_vte.c: revision 1.27
sys/arch/powerpc/booke/dev/pq3etsec.c: revision 1.47
sys/arch/arm/gemini/if_gpn.c: revision 1.13

if_percpuq(9) and ether_input() automatically increment if_ipackets, so don't add number of
RX frames from device's statistics counter to if_ipackets to avoid double
count.
 1.80.8.1 26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.82.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.82.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.82.2.1 10-Jun-2019  christos Sync with HEAD
 1.90.2.2 28-Jan-2020  martin Pull up following revision(s) (requested by msaitoh in ticket #662):

sys/dev/pcmcia/if_xi.c: revision 1.93
sys/arch/x86/pci/if_vmx.c: revision 1.54
sys/dev/pci/if_de.c: revision 1.165
sys/arch/arm/ti/if_cpsw.c: revision 1.10
sys/arch/arm/omap/if_cpsw.c: revision 1.26
sys/dev/isa/if_iy.c: revision 1.112
sys/dev/pcmcia/if_ray.c: revision 1.96

Add ETHER_LOCK() and ETHER_UNLOCK() to protect ec_multiaddrs.

XXX These drivers don't check whether enm_addrlo and enm_addrhi are the same
or not, so it won't work correctly if an multicast address entry has a range.

Protect ec_multicnt.
 1.90.2.1 06-Nov-2019  martin Pull up following revision(s) (requested by msaitoh in ticket #403):

sys/arch/arm/broadcom/bcm53xx_eth.c: revision 1.39
sys/dev/pcmcia/if_xi.c: revision 1.91
sys/dev/ic/aic6915.c: revision 1.40
sys/dev/pci/if_tl.c: revision 1.117
sys/arch/arm/gemini/gemini_gmac.c: revision 1.18
sys/dev/ic/elinkxl.c: revision 1.133
sys/dev/pci/if_ste.c: revision 1.57
sys/dev/pci/if_alc.c: revision 1.43
sys/dev/pci/if_stge.c: revision 1.72
sys/dev/pci/if_ale.c: revision 1.34
sys/dev/pci/if_age.c: revision 1.62
sys/dev/pci/if_txp.c: revision 1.60
sys/dev/ic/i82557.c: revision 1.156
sys/dev/pci/if_vte.c: revision 1.27
sys/arch/powerpc/booke/dev/pq3etsec.c: revision 1.47
sys/arch/arm/gemini/if_gpn.c: revision 1.13

if_percpuq(9) and ether_input() automatically increment if_ipackets, so don't add number of
RX frames from device's statistics counter to if_ipackets to avoid double
count.
 1.93.2.1 29-Feb-2020  ad Sync with head.
 1.9 28-May-2019  msaitoh s/recieve/receive/
 1.8 11-Dec-2005  christos branches: 1.8.164;
merge ktrace-lwp.
 1.7 12-Aug-2004  mycroft Remove sc_offset. It's always 0, and if we did want to use it, "that's what
bus_space_subregion() is for".
 1.6 08-Aug-2004  mycroft Use the correct data port, for compatibility with old cards. Without this,
some of my CE2 cards are unable to transfer data successfully; they send
bogus packets and every received packet is all 0s.
"Special."
 1.5 08-Aug-2004  mycroft Split "xi" into a "xirc" frontend (similar to mhzc; it attaches two child
devices) and a "xi" backend.

My CE2 and CEM2 cards are now probed correctly. However, there are still
some problems with one model of the CE2, and the CEM2 doesn't seem to get
any modem interrupts.

While I'm at it, fix several bugs:

* The tuple scan for the MAC address was broken in multiple ways.
* xi_intr() did not deal well with a shared interrupt.
* We were setting the wrong page number to look at the receive status. (How
did this work???)
* Remove the xi_full_reset() from xi_reset(). Move the parts of
xi_full_reset() needed to undo the effect of xi_stop() into xi_init(). This
allows a stop/init pair to DTRT, and much quicker, as used by various
ioctl()s.
* Set the TRS register before reading the TSO register, as the Linux driver
does. While I'm at it, fix the name.
* Fix numerous problems with xi_set_address(). "Where do I begin?" There's a
chance that multicast works now, but I haven't tested it.
* Explicitly clear the MSR register, and also force SELECT_MII to 0 if we
didn't find any PHYs.
* Clean up some cruft that appears to be bogus.

Probably needs more work, but it's a start.
 1.4 02-Nov-2003  wiz Fix some typos. From Tom Cosgrove via jmc@openbsd.
 1.3 01-Jul-2001  gmcgarry branches: 1.3.22;
Jumbo patch:

- data alignment fix
- kludge around broken multicast by using promisc mode
(IPv6 router solicitation now works)
- add support as random source
- support device power-up and power-down
- vlan support
- misc. comment and style fixes
 1.2 12-Jun-2001  wiz receive, not recieve
 1.1 05-Jun-2000  gmcgarry branches: 1.1.4; 1.1.6; 1.1.8;
New driver for Xircom CreditCard PCMCIA Ethernet. Replaces xe driver which
didn't work. Renamed to avoid clash with next68k network driver.
 1.1.8.2 24-Aug-2001  nathanw Catch up with -current.
 1.1.8.1 21-Jun-2001  nathanw Catch up to -current.
 1.1.6.2 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.1.6.1 05-Jun-2000  bouyer file if_xireg.h was added on branch thorpej_scsipi on 2000-11-20 11:42:45 +0000
 1.1.4.2 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.1.4.1 05-Jun-2000  minoura file if_xireg.h was added on branch minoura-xpg4dl on 2000-06-22 17:07:47 +0000
 1.3.22.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.22.4 18-Sep-2004  skrll Sync with HEAD.
 1.3.22.3 25-Aug-2004  skrll Sync with HEAD.
 1.3.22.2 12-Aug-2004  skrll Sync with HEAD.
 1.3.22.1 03-Aug-2004  skrll Sync with HEAD
 1.8.164.1 10-Jun-2019  christos Sync with HEAD
 1.9 13-Apr-2015  riastradh Convert sys/dev to use <sys/rndsource.h>.
 1.8 02-Feb-2012  tls branches: 1.8.6; 1.8.24;
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.7 19-Nov-2011  tls branches: 1.7.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.6 06-Dec-2009  dyoung branches: 1.6.12;
device_t/softc split.
 1.5 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.4 11-Dec-2005  christos branches: 1.4.74; 1.4.90;
merge ktrace-lwp.
 1.3 04-Feb-2005  perry de-__P
 1.2 12-Aug-2004  mycroft branches: 1.2.4; 1.2.6;
Remove sc_offset. It's always 0, and if we did want to use it, "that's what
bus_space_subregion() is for".
 1.1 08-Aug-2004  mycroft branches: 1.1.2;
Split "xi" into a "xirc" frontend (similar to mhzc; it attaches two child
devices) and a "xi" backend.

My CE2 and CEM2 cards are now probed correctly. However, there are still
some problems with one model of the CE2, and the CEM2 doesn't seem to get
any modem interrupts.

While I'm at it, fix several bugs:

* The tuple scan for the MAC address was broken in multiple ways.
* xi_intr() did not deal well with a shared interrupt.
* We were setting the wrong page number to look at the receive status. (How
did this work???)
* Remove the xi_full_reset() from xi_reset(). Move the parts of
xi_full_reset() needed to undo the effect of xi_stop() into xi_init(). This
allows a stop/init pair to DTRT, and much quicker, as used by various
ioctl()s.
* Set the TRS register before reading the TSO register, as the Linux driver
does. While I'm at it, fix the name.
* Fix numerous problems with xi_set_address(). "Where do I begin?" There's a
chance that multicast works now, but I haven't tested it.
* Explicitly clear the MSR register, and also force SELECT_MII to 0 if we
didn't find any PHYs.
* Clean up some cruft that appears to be bogus.

Probably needs more work, but it's a start.
 1.1.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.1.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.3 25-Aug-2004  skrll Sync with HEAD.
 1.1.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.1.2.1 08-Aug-2004  skrll file if_xivar.h was added on branch ktrace-lwp on 2004-08-12 11:42:01 +0000
 1.2.6.1 12-Feb-2005  yamt sync with head.
 1.2.4.1 29-Apr-2005  kent sync with -current
 1.4.90.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.74.2 11-Mar-2010  yamt sync with head
 1.4.74.1 16-May-2009  yamt sync with head
 1.6.12.1 17-Apr-2012  yamt sync with head
 1.7.2.1 18-Feb-2012  mrg merge to -current.
 1.8.24.1 06-Jun-2015  skrll Sync with HEAD
 1.8.6.1 03-Dec-2017  jdolecek update from HEAD
 1.44 22-Sep-2018  maxv Remove isic(4). It is part of ISDN, which we are now retiring.
 1.43 14-Jul-2016  msaitoh branches: 1.43.16; 1.43.18;
- Use aprint() more in isic_pcmcia_attach().
- Add missing aprint_naive("\n").
- swap device_xname() and cde->name in the output of a printf().
 1.42 11-Jul-2016  msaitoh KNF. No functional change.
 1.41 27-Oct-2012  chs branches: 1.41.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.40 06-Dec-2009  dyoung branches: 1.40.12; 1.40.22;
Simplify device-activation hooks.
 1.39 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.38 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.37 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.36 01-Jun-2008  martin branches: 1.36.6; 1.36.12;
off-by-one-key
: ----------------------------------------------------------------------
 1.35 28-Apr-2008  martin branches: 1.35.2;
Remove clause 3 and 4 from TNF licenses
 1.34 05-Apr-2008  cegger branches: 1.34.2; 1.34.4;
use aprint_*_dev and device_xname
 1.33 19-Oct-2007  ad branches: 1.33.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.32 09-Jul-2007  ad branches: 1.32.6; 1.32.8; 1.32.12;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.31 16-Nov-2006  christos branches: 1.31.8; 1.31.10;
__unused removal on arguments; approved by core.
 1.30 16-Oct-2006  pooka * __unused games + other relevant fixes
* give me ANSI C or give me death (at least where it could be easily spotted)
 1.29 11-Dec-2005  christos branches: 1.29.20; 1.29.22;
merge ktrace-lwp.
 1.28 01-Jul-2005  martin branches: 1.28.2;
constify
 1.27 27-Feb-2005  perry nuke trailing whitespace
 1.26 04-Feb-2005  perry de-__P
 1.25 10-Aug-2004  mycroft branches: 1.25.4; 1.25.6;
Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.24 09-Aug-2004  mycroft Correct the intr_establish order here.
 1.23 04-Jan-2004  martin Attach message formating nit, adapt to recent pcic (et al) changes.
 1.22 04-Dec-2003  keihan netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.21 28-Oct-2003  pooka Avoid splx() with uninitialized priority level by duplicating some code
to get rid of gotos.

While doing that, add more verbosity on what failed if attach is not succesful.
 1.20 03-Oct-2003  pooka Ready the kernel side of i4b for primary rate interface support by
removing assumptions that there are only two B channels and by
adding support for a varying number of channels.

Due to this, rename previously used isdn identified "bri" to "isdnif",
which better describes the current situation.
 1.19 02-Oct-2002  thorpej branches: 1.19.6;
Add trailing ; to CFATTACH_DECL.
 1.18 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.17 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.16 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.15 14-Apr-2002  martin branches: 1.15.2;
Fix copyright notice.
 1.14 13-Apr-2002  martin Defer initialization of the ISAC chip until we enable interrupts - it gets
into a strange failure mode if we do it with disabled interrupt. When
(re-)enabling interrupts reset transmitter and receiver and clear any
pending state.
 1.13 10-Apr-2002  martin Remove some redundant tries to disable interupts. We already avoided enabling
them.
Fix a stupid typo when enabling/disabling interrupts: we clear pending
interrupts when enabling, not disbling isac interrupts.
 1.12 08-Apr-2002  martin Combine sc_enabled and sc_dying into one field sc_intr_valid, they are used
for the same purpose (ignoring invalid interrupts).

For cards that are not able to stop all interrupts (or we don't know a way
to do that in software, at least) run the clearirq callback even when
ignoring an interrupt because we are not enabled. Otherwise the card would
stop interrupting.

Reserve a driver specific callout handle and an int value in the generic
isic_softc to allow card drivers to implement fancy blinkenlights.
 1.11 30-Mar-2002  martin Be a nice citizen, enable interrupts only when we are ready to talk
to the ISDN (i.e. when userland has /dev/isdn open).
 1.10 29-Mar-2002  martin Split BRI attaching into two phases, so lower layer drivers can get their
BRI identifier and L3 driver state early on, then finish initializing and
announce the controller to userland when it's ready.
 1.9 29-Mar-2002  martin Rearange things to avoid panics on detaching cards that failed to
attach.
 1.8 27-Mar-2002  martin After Jason Thorpe explained to me how it is supposed to work, implement
(de)activate for pcmcia cards.
Implement detach/(de)activate for PCI cards.
Clean up internal state (free call-descriptors) if a controller is
detached while it has open connections.
 1.7 25-Mar-2002  martin Make pcmcia cards detach properly.
Notify userland of attaching/detaching cards.
This partly fixes PR 15951.
 1.6 24-Mar-2002  martin Now that we have all the pieces of the puzzle available start to unriddle
and move them in their proper places.

Move the BRI registry from layer 2 (duh!) to layer 4, so active cards
(which don't have layer 3 or layer 2 in their driver). Remove all remaining
hard coded controller and driver types. Remove any arbitrary hard coded
limits, at least those that show up in the internal API.

This fixes PR 15950.
 1.5 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.4 13-Nov-2001  lukem add RCSIDs
 1.3 24-Mar-2001  martin branches: 1.3.2;
First step to cleanup the hardware driver <-> upper layers interface.
This now provides slightly more functionality than the FreeBSD layer1-newbus
interface. It was meant to be a simple change to one header and a few
c files, but the change rippled all through various stuff.

To prevent a change to the kernel<->userland interface right now the kernel
is now lying about card types to userland (but who cares). This will be fixed
when the userland interface changes, after layer 3 <-> layer 4 has been
fixed.

Functional changes:

Provide a clean interface for hardware drivers to attach to the upper
layers. This will need another small change in the B-channel handling
when a similar change to the layer 3 <-> layer 4 interface happens.

Avoid passing indices into global arrays of pointers around, instead pass
the pointers itself. Don't code hardware driver types by predefined magic
numbers (think LKM). Prepare for detachable drivers (think pcmcia).

While there remove some sets of function pointers always pointing to the
same function (meant to be the configurable set of D channel protocol
handlers). It is unlikely another supported D-channel protocol will fit into
that (maximal layer interface) abstraction. When we get support for another
protocol, we will need to come up with a workable interface. Besides, the
old implementation was, uhm, strange.
 1.2 20-Feb-2001  martin branches: 1.2.2; 1.2.4;
Filename cleanup: remove i4b_ prefixes outside sys/netisdn, last round.

Renamed in sys/dev/ic:
i4b_hscx.c -> hscx.c
i4b_hscx.h -> hscx.h
i4b_ipac.h -> ipac.h
i4b_isac.c -> isac.c
i4b_isac.h -> isac.h
i4b_isic.c -> isic.c
i4b_isicbchan.c -> isic_bchan.c
i4b_isicl1.c -> isic_l1.c
i4b_isicl1.h -> isic_l1.h
i4b_isicl1fsm.c -> isic_l1fsm.c
 1.1 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.2.4.3 27-Mar-2001  bouyer Sync with HEAD.
 1.2.4.2 12-Mar-2001  bouyer Sync with HEAD.
 1.2.4.1 20-Feb-2001  bouyer file isic_pcmcia.c was added on branch thorpej_scsipi on 2001-03-12 13:31:20 +0000
 1.2.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.6 20-Jun-2002  nathanw Catch up to -current.
 1.2.2.5 17-Apr-2002  nathanw Catch up to -current.
 1.2.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.3 08-Jan-2002  nathanw Catch up to -current.
 1.2.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.2.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.3.2.3 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.3.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.3.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.1 20-Jun-2002  gehenna catch up with -current.
 1.19.6.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.19.6.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.19.6.5 04-Feb-2005  skrll Sync with HEAD.
 1.19.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.19.6.2 12-Aug-2004  skrll Sync with HEAD.
 1.19.6.1 03-Aug-2004  skrll Sync with HEAD
 1.25.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.25.6.1 12-Feb-2005  yamt sync with head.
 1.25.4.1 29-Apr-2005  kent sync with -current
 1.28.2.3 27-Oct-2007  yamt sync with head.
 1.28.2.2 03-Sep-2007  yamt sync with head.
 1.28.2.1 30-Dec-2006  yamt sync with head.
 1.29.22.2 10-Dec-2006  yamt sync with head.
 1.29.22.1 22-Oct-2006  yamt sync with head
 1.29.20.1 18-Nov-2006  ad Sync with head.
 1.31.10.1 11-Jul-2007  mjf Sync with head.
 1.31.8.2 23-Oct-2007  ad Sync with head.
 1.31.8.1 01-Jul-2007  ad Adapt to callout API change.
 1.32.12.1 25-Oct-2007  bouyer Sync with HEAD.
 1.32.8.1 06-Nov-2007  matt sync with HEAD
 1.32.6.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.33.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.34.4.4 11-Mar-2010  yamt sync with head
 1.34.4.3 16-May-2009  yamt sync with head
 1.34.4.2 04-May-2009  yamt sync with head.
 1.34.4.1 16-May-2008  yamt sync with head.
 1.34.2.2 04-Jun-2008  yamt sync with head
 1.34.2.1 18-May-2008  yamt sync with head.
 1.35.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.36.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.36.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.40.22.2 03-Dec-2017  jdolecek update from HEAD
 1.40.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.40.12.1 30-Oct-2012  yamt sync with head
 1.41.14.1 05-Oct-2016  skrll Sync with HEAD
 1.43.18.1 10-Jun-2019  christos Sync with HEAD
 1.43.16.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.7 22-Sep-2018  maxv Remove isic(4). It is part of ISDN, which we are now retiring.
 1.6 28-Apr-2008  martin branches: 1.6.86; 1.6.88;
Remove clause 3 and 4 from TNF licenses
 1.5 04-Dec-2003  keihan branches: 1.5.98; 1.5.100; 1.5.102;
netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.4 08-Jul-2003  itojun function prototype must not have variable name
 1.3 14-Apr-2002  martin branches: 1.3.10;
Fix copyright notice.
 1.2 24-Mar-2002  martin Now that we have all the pieces of the puzzle available start to unriddle
and move them in their proper places.

Move the BRI registry from layer 2 (duh!) to layer 4, so active cards
(which don't have layer 3 or layer 2 in their driver). Remove all remaining
hard coded controller and driver types. Remove any arbitrary hard coded
limits, at least those that show up in the internal API.

This fixes PR 15950.
 1.1 18-Feb-2001  martin branches: 1.1.2; 1.1.4; 1.1.6;
Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.1.6.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.2 12-Mar-2001  bouyer Sync with HEAD.
 1.1.4.1 18-Feb-2001  bouyer file isic_pcmcia.h was added on branch thorpej_scsipi on 2001-03-12 13:31:20 +0000
 1.1.2.2 17-Apr-2002  nathanw Catch up to -current.
 1.1.2.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.3.10.1 03-Aug-2004  skrll Sync with HEAD
 1.5.102.1 16-May-2008  yamt sync with head.
 1.5.100.1 18-May-2008  yamt sync with head.
 1.5.98.1 02-Jun-2008  mjf Sync with HEAD.
 1.6.88.1 10-Jun-2019  christos Sync with HEAD
 1.6.86.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.13 22-Sep-2018  maxv Remove isic(4). It is part of ISDN, which we are now retiring.
 1.12 19-Oct-2007  ad branches: 1.12.106; 1.12.108;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.11 04-Mar-2007  christos branches: 1.11.2; 1.11.14; 1.11.16; 1.11.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.10 11-Dec-2005  christos branches: 1.10.26;
merge ktrace-lwp.
 1.9 01-Jul-2005  martin branches: 1.9.2;
constify
 1.8 27-Feb-2005  perry nuke trailing whitespace
 1.7 04-Feb-2005  perry de-__P
 1.6 08-Aug-2004  mycroft branches: 1.6.4; 1.6.6;
Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.5 29-Mar-2002  martin branches: 1.5.10;
Remove a XXX comment that is no longer true.
 1.4 24-Mar-2002  martin Now that we have all the pieces of the puzzle available start to unriddle
and move them in their proper places.

Move the BRI registry from layer 2 (duh!) to layer 4, so active cards
(which don't have layer 3 or layer 2 in their driver). Remove all remaining
hard coded controller and driver types. Remove any arbitrary hard coded
limits, at least those that show up in the internal API.

This fixes PR 15950.
 1.3 13-Nov-2001  lukem add RCSIDs
 1.2 20-Feb-2001  martin branches: 1.2.2; 1.2.4; 1.2.6;
Filename cleanup: remove i4b_ prefixes outside sys/netisdn, last round.

Renamed in sys/dev/ic:
i4b_hscx.c -> hscx.c
i4b_hscx.h -> hscx.h
i4b_ipac.h -> ipac.h
i4b_isac.c -> isac.c
i4b_isac.h -> isac.h
i4b_isic.c -> isic.c
i4b_isicbchan.c -> isic_bchan.c
i4b_isicl1.c -> isic_l1.c
i4b_isicl1.h -> isic_l1.h
i4b_isicl1fsm.c -> isic_l1fsm.c
 1.1 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.2.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.2 12-Mar-2001  bouyer Sync with HEAD.
 1.2.4.1 20-Feb-2001  bouyer file isic_pcmcia_avm_fritz.c was added on branch thorpej_scsipi on 2001-03-12 13:31:20 +0000
 1.2.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.2.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.5.10.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.10.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.10.4 04-Feb-2005  skrll Sync with HEAD.
 1.5.10.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.10.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.10.1 12-Aug-2004  skrll Sync with HEAD.
 1.6.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.6.1 12-Feb-2005  yamt sync with head.
 1.6.4.1 29-Apr-2005  kent sync with -current
 1.9.2.2 27-Oct-2007  yamt sync with head.
 1.9.2.1 03-Sep-2007  yamt sync with head.
 1.10.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.11.16.1 06-Nov-2007  matt sync with HEAD
 1.11.14.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.11.2.1 23-Oct-2007  ad Sync with head.
 1.12.108.1 10-Jun-2019  christos Sync with HEAD
 1.12.106.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.15 22-Sep-2018  maxv Remove isic(4). It is part of ISDN, which we are now retiring.
 1.14 23-Mar-2014  christos branches: 1.14.28; 1.14.30;
remove unused
 1.13 28-Apr-2008  martin branches: 1.13.34; 1.13.44; 1.13.50;
Remove clause 3 and 4 from TNF licenses
 1.12 19-Oct-2007  ad branches: 1.12.16; 1.12.18; 1.12.20;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.11 11-Dec-2005  christos branches: 1.11.30; 1.11.44; 1.11.46; 1.11.50;
merge ktrace-lwp.
 1.10 01-Jul-2005  martin branches: 1.10.2;
constify
 1.9 27-Feb-2005  perry nuke trailing whitespace
 1.8 04-Feb-2005  perry de-__P
 1.7 08-Aug-2004  mycroft branches: 1.7.4; 1.7.6;
Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.6 04-Dec-2003  keihan netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.5 14-Apr-2002  martin branches: 1.5.10;
Fix copyright notice.
 1.4 24-Mar-2002  martin Now that we have all the pieces of the puzzle available start to unriddle
and move them in their proper places.

Move the BRI registry from layer 2 (duh!) to layer 4, so active cards
(which don't have layer 3 or layer 2 in their driver). Remove all remaining
hard coded controller and driver types. Remove any arbitrary hard coded
limits, at least those that show up in the internal API.

This fixes PR 15950.
 1.3 13-Nov-2001  lukem add RCSIDs
 1.2 20-Feb-2001  martin branches: 1.2.2; 1.2.4; 1.2.6;
Filename cleanup: remove i4b_ prefixes outside sys/netisdn, last round.

Renamed in sys/dev/ic:
i4b_hscx.c -> hscx.c
i4b_hscx.h -> hscx.h
i4b_ipac.h -> ipac.h
i4b_isac.c -> isac.c
i4b_isac.h -> isac.h
i4b_isic.c -> isic.c
i4b_isicbchan.c -> isic_bchan.c
i4b_isicl1.c -> isic_l1.c
i4b_isicl1.h -> isic_l1.h
i4b_isicl1fsm.c -> isic_l1fsm.c
 1.1 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.2.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.2 12-Mar-2001  bouyer Sync with HEAD.
 1.2.4.1 20-Feb-2001  bouyer file isic_pcmcia_elsa_isdnmc.c was added on branch thorpej_scsipi on 2001-03-12 13:31:20 +0000
 1.2.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.2.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.5.10.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.10.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.10.5 04-Feb-2005  skrll Sync with HEAD.
 1.5.10.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.10.3 18-Sep-2004  skrll Sync with HEAD.
 1.5.10.2 12-Aug-2004  skrll Sync with HEAD.
 1.5.10.1 03-Aug-2004  skrll Sync with HEAD
 1.7.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.6.1 12-Feb-2005  yamt sync with head.
 1.7.4.1 29-Apr-2005  kent sync with -current
 1.10.2.1 27-Oct-2007  yamt sync with head.
 1.11.50.1 25-Oct-2007  bouyer Sync with HEAD.
 1.11.46.1 06-Nov-2007  matt sync with HEAD
 1.11.44.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.11.30.1 23-Oct-2007  ad Sync with head.
 1.12.20.1 16-May-2008  yamt sync with head.
 1.12.18.1 18-May-2008  yamt sync with head.
 1.12.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.50.1 18-May-2014  rmind sync with head
 1.13.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.30.1 10-Jun-2019  christos Sync with HEAD
 1.14.28.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.16 22-Sep-2018  maxv Remove isic(4). It is part of ISDN, which we are now retiring.
 1.15 23-Mar-2014  christos branches: 1.15.28; 1.15.30;
remove unused
 1.14 28-Apr-2008  martin branches: 1.14.34; 1.14.44; 1.14.50;
Remove clause 3 and 4 from TNF licenses
 1.13 19-Oct-2007  ad branches: 1.13.16; 1.13.18; 1.13.20;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.12 16-Nov-2006  christos branches: 1.12.8; 1.12.22; 1.12.24; 1.12.28;
__unused removal on arguments; approved by core.
 1.11 16-Oct-2006  pooka * __unused games + other relevant fixes
* give me ANSI C or give me death (at least where it could be easily spotted)
 1.10 11-Dec-2005  christos branches: 1.10.20; 1.10.22;
merge ktrace-lwp.
 1.9 27-Feb-2005  perry branches: 1.9.4;
nuke trailing whitespace
 1.8 04-Feb-2005  perry de-__P
 1.7 08-Aug-2004  mycroft branches: 1.7.4; 1.7.6;
Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.6 04-Dec-2003  keihan netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.5 14-Apr-2002  martin branches: 1.5.10;
Fix copyright notice.
 1.4 24-Mar-2002  martin Now that we have all the pieces of the puzzle available start to unriddle
and move them in their proper places.

Move the BRI registry from layer 2 (duh!) to layer 4, so active cards
(which don't have layer 3 or layer 2 in their driver). Remove all remaining
hard coded controller and driver types. Remove any arbitrary hard coded
limits, at least those that show up in the internal API.

This fixes PR 15950.
 1.3 13-Nov-2001  lukem add RCSIDs
 1.2 20-Feb-2001  martin branches: 1.2.2; 1.2.4; 1.2.6;
Filename cleanup: remove i4b_ prefixes outside sys/netisdn, last round.

Renamed in sys/dev/ic:
i4b_hscx.c -> hscx.c
i4b_hscx.h -> hscx.h
i4b_ipac.h -> ipac.h
i4b_isac.c -> isac.c
i4b_isac.h -> isac.h
i4b_isic.c -> isic.c
i4b_isicbchan.c -> isic_bchan.c
i4b_isicl1.c -> isic_l1.c
i4b_isicl1.h -> isic_l1.h
i4b_isicl1fsm.c -> isic_l1fsm.c
 1.1 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.2.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.2 12-Mar-2001  bouyer Sync with HEAD.
 1.2.4.1 20-Feb-2001  bouyer file isic_pcmcia_elsa_mcall.c was added on branch thorpej_scsipi on 2001-03-12 13:31:21 +0000
 1.2.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.2.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.5.10.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.10.5 04-Feb-2005  skrll Sync with HEAD.
 1.5.10.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.10.3 18-Sep-2004  skrll Sync with HEAD.
 1.5.10.2 12-Aug-2004  skrll Sync with HEAD.
 1.5.10.1 03-Aug-2004  skrll Sync with HEAD
 1.7.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.6.1 12-Feb-2005  yamt sync with head.
 1.7.4.1 29-Apr-2005  kent sync with -current
 1.9.4.2 27-Oct-2007  yamt sync with head.
 1.9.4.1 30-Dec-2006  yamt sync with head.
 1.10.22.2 10-Dec-2006  yamt sync with head.
 1.10.22.1 22-Oct-2006  yamt sync with head
 1.10.20.1 18-Nov-2006  ad Sync with head.
 1.12.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.12.24.1 06-Nov-2007  matt sync with HEAD
 1.12.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.12.8.1 23-Oct-2007  ad Sync with head.
 1.13.20.1 16-May-2008  yamt sync with head.
 1.13.18.1 18-May-2008  yamt sync with head.
 1.13.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.14.50.1 18-May-2014  rmind sync with head
 1.14.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.30.1 10-Jun-2019  christos Sync with HEAD
 1.15.28.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.14 22-Sep-2018  maxv Remove isic(4). It is part of ISDN, which we are now retiring.
 1.13 23-Mar-2014  christos branches: 1.13.28; 1.13.30;
remove unused
 1.12 28-Apr-2008  martin branches: 1.12.34; 1.12.44; 1.12.50;
Remove clause 3 and 4 from TNF licenses
 1.11 19-Oct-2007  ad branches: 1.11.16; 1.11.18; 1.11.20;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.10 11-Dec-2005  christos branches: 1.10.30; 1.10.44; 1.10.46; 1.10.50;
merge ktrace-lwp.
 1.9 09-Jul-2005  christos make the isdn drivers compile again with -Wconst, -Wshadow
 1.8 27-Feb-2005  perry branches: 1.8.4;
nuke trailing whitespace
 1.7 08-Aug-2004  mycroft branches: 1.7.4; 1.7.6;
Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.6 04-Dec-2003  keihan netbsd.org -> NetBSD.org

This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean". Thanks for the patiance, and sorry for all the commits.
 1.5 14-Apr-2002  martin branches: 1.5.10;
Fix copyright notice.
 1.4 24-Mar-2002  martin Now that we have all the pieces of the puzzle available start to unriddle
and move them in their proper places.

Move the BRI registry from layer 2 (duh!) to layer 4, so active cards
(which don't have layer 3 or layer 2 in their driver). Remove all remaining
hard coded controller and driver types. Remove any arbitrary hard coded
limits, at least those that show up in the internal API.

This fixes PR 15950.
 1.3 13-Nov-2001  lukem add RCSIDs
 1.2 20-Feb-2001  martin branches: 1.2.2; 1.2.4; 1.2.6;
Filename cleanup: remove i4b_ prefixes outside sys/netisdn, last round.

Renamed in sys/dev/ic:
i4b_hscx.c -> hscx.c
i4b_hscx.h -> hscx.h
i4b_ipac.h -> ipac.h
i4b_isac.c -> isac.c
i4b_isac.h -> isac.h
i4b_isic.c -> isic.c
i4b_isicbchan.c -> isic_bchan.c
i4b_isicl1.c -> isic_l1.c
i4b_isicl1.h -> isic_l1.h
i4b_isicl1fsm.c -> isic_l1fsm.c
 1.1 18-Feb-2001  martin Filename cleanup police (per discussion with Soren S. Jorvang):
remove all (legacy) "i4b_" prefixes outside of sys/netisdn.
Prefix all card specific driver support files with the basename
of the driver bus attachement file.

Renamed here:
i4b_isic_pcmcia.c -> isic_pcmcia.c
i4b_isic_pcmcia.h -> isic_pcmcia.h
i4b_avm_fritz_pcmcia.c -> isic_pcmcia_avm_fritz.c
i4b_elsa_isdnmc.c -> isic_pcmcia_elsa_isdnmc.c
i4b_elsa_mcall.c -> isic_pcmcia_elsa_mcall.c
i4b_sbspeedstar2.c -> isic_pcmcia_sbspeedstar2.c
 1.2.6.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.2 12-Mar-2001  bouyer Sync with HEAD.
 1.2.4.1 20-Feb-2001  bouyer file isic_pcmcia_sbspeedstar2.c was added on branch thorpej_scsipi on 2001-03-12 13:31:21 +0000
 1.2.2.3 17-Apr-2002  nathanw Catch up to -current.
 1.2.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.1 14-Nov-2001  nathanw Catch up to -current.
 1.5.10.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.5.10.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.10.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.10.3 18-Sep-2004  skrll Sync with HEAD.
 1.5.10.2 12-Aug-2004  skrll Sync with HEAD.
 1.5.10.1 03-Aug-2004  skrll Sync with HEAD
 1.7.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.7.4.1 29-Apr-2005  kent sync with -current
 1.8.4.2 27-Oct-2007  yamt sync with head.
 1.8.4.1 21-Jun-2006  yamt sync with head.
 1.10.50.1 25-Oct-2007  bouyer Sync with HEAD.
 1.10.46.1 06-Nov-2007  matt sync with HEAD
 1.10.44.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.10.30.1 23-Oct-2007  ad Sync with head.
 1.11.20.1 16-May-2008  yamt sync with head.
 1.11.18.1 18-May-2008  yamt sync with head.
 1.11.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.50.1 18-May-2014  rmind sync with head
 1.12.44.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12.34.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.13.30.1 10-Jun-2019  christos Sync with HEAD
 1.13.28.1 30-Sep-2018  pgoyette Ssync with HEAD
 1.56 10-May-2023  riastradh mhzc(4): Use config_detach_children.
 1.55 20-Jan-2023  msaitoh s/attemping/attempting/ in comment.
 1.54 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.53 24-Apr-2021  thorpej branches: 1.53.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.52 08-Dec-2018  thorpej branches: 1.52.14;
Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.51 22-Jun-2018  msaitoh branches: 1.51.2;
It's not required to include net/bpfdesc.h. Remove it.
 1.50 27-Oct-2012  chs branches: 1.50.30; 1.50.36;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.49 19-Jan-2010  pooka branches: 1.49.12; 1.49.22;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.48 06-Dec-2009  dyoung device_t/softc split.
 1.47 13-Nov-2009  dyoung Don't use com_activate(), it's gone away. Thanks to Andreas Wrede
for pointing out that these drivers still used com_activate().

Use device_private(). Join some lines.

Remove superfluous activation hooks.

Add child-detachment hooks (not used, yet).

TBD: device_t/softc split.
 1.46 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.45 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.44 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.43 28-Apr-2008  martin branches: 1.43.8; 1.43.14;
Remove clause 3 and 4 from TNF licenses
 1.42 05-Apr-2008  cegger branches: 1.42.2; 1.42.4;
use aprint_*_dev and device_xname
 1.41 14-Mar-2008  cube Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 1.40 19-Oct-2007  ad branches: 1.40.12; 1.40.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.39 16-Nov-2006  christos branches: 1.39.8; 1.39.22; 1.39.24; 1.39.28;
__unused removal on arguments; approved by core.
 1.38 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.37 07-Sep-2006  dogcow branches: 1.37.2; 1.37.4;
remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.
 1.36 13-Jul-2006  gdamore Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.35 25-Mar-2006  thorpej branches: 1.35.4;
Use device_parent().
 1.34 11-Dec-2005  christos branches: 1.34.4; 1.34.6; 1.34.8; 1.34.10; 1.34.12;
merge ktrace-lwp.
 1.33 06-Oct-2005  jdc Change memoff to bus_size_t (like all other PCMCIA devices).
Now compiles on sparc too.
 1.32 30-May-2005  christos branches: 1.32.2;
- add const
- avoid variable shadow
- do proper UNCONST with XXXUNCONST
 1.31 27-Feb-2005  perry nuke trailing whitespace
 1.30 04-Feb-2005  perry de-__P
 1.29 12-Aug-2004  mycroft branches: 1.29.4; 1.29.6;
delay() -> tsleep()
 1.28 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.27 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.26 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.25 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.24 10-Aug-2004  mycroft Copyright maintenance.
 1.23 09-Aug-2004  mycroft Do the I/O mapping in the main attach routine.
Also, we don't need to bother cleaning up on a failed attach -- we keep enough
state for the detach routine to do it.
 1.22 09-Aug-2004  mycroft Make pcmcia_function_disable() primarily responsible for disabling the CCR
bits. pcmcia_intr_disestablish() continues to do this as a stopgap.
 1.21 09-Aug-2004  mycroft Do our io_map()s and intr_establish()es earlier.
 1.20 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.19 08-Aug-2004  mycroft AFAICT, there's no reason not to use PCMCIA_WIDTH_AUTO here.
 1.18 08-Aug-2004  mycroft Nuke an extra printf().
 1.17 07-Aug-2004  mycroft Remove extra space.
 1.16 07-Aug-2004  mycroft Clean up attach messages.
 1.15 06-Aug-2004  mycroft A few things:
* The DEPCM-XX cards don't need to be recognized by OUI or string -- they
work just fine with the IO-DATA PC-LAT/E attachment, and are probable OEM.
So, remove the DEPCM case.
* PCMCIA_STR_* elimination.
* The Megahertz EM3336 is not always an X-Jack device, so take the "XJ" out
of the product number.
 1.14 01-Jan-2003  thorpej branches: 1.14.2;
Use aprint_normal() in cfprint routines.
 1.13 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.12 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.11 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.10 09-Jul-2002  uwe Print correct io addresses in sm attachment message (pasto).
 1.9 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.8 13-Nov-2001  lukem branches: 1.8.8;
add RCSIDs
 1.7 01-Jul-2001  uwe branches: 1.7.2;
Make mhzc_alloc_ethernet search the right address range.
Fixes: kern/11451.
Reviewed by: thorpej
 1.6 30-Jul-2000  briggs branches: 1.6.2;
Add MII support to smc91cxx driver. This is supported for the 91c100
and 91c100FD (FEAST) controllers. Existing controllers should continue
to work as they have. Added the card's memory to the probe message.
 1.5 05-Feb-2000  enami branches: 1.5.4;
Add detach support for ethernet portion.
 1.4 04-Feb-2000  cgd replace the *_lookup table entry match/lookup functions in all of
these drivers with a single common function (which supports tables
of variable-sized structures). Things are mostly as they were before:
tables are terminated by entry with NULL name, etc. There's also
the ability to call a driver-specific match function which can be used
to augment the table lookup.
 1.3 20-Oct-1999  enami Don't restrict the ethernet portion after modem portion. It prevents
us from using some config entries (com at 0x3xxx).
 1.2 28-Sep-1999  thorpej branches: 1.2.2; 1.2.4; 1.2.6;
Fix a slight buglet in `enable' magic odering, point out by
Chuck Cranor.
 1.1 28-Sep-1999  thorpej Add a driver for the Megahertz Ethernet/Modem combo cards, e.g. XJEM3336.
This supplies an attachment of the `sm' and `com' drivers.

Thanks to Chuck Cranor for sifting through the Linux smc91c92_cs.c driver
to find the magic sequence that brings the Ethernet portion of the card
on-line!
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.4.1 15-Nov-1999  fvdl Sync with -current
 1.2.2.2 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.2.2.1 20-Oct-1999  thorpej Sync w/ trunk.
 1.5.4.1 06-Aug-2000  briggs Pullups approved by thorpej --
Add MII support to smc91cxx driver. This is supported for the 91c100
and 91c100FD (FEAST) controllers. Existing controllers should continue
to work as they have. Added the card's memory to the probe message.

Make sure that we do not call bus_space_*_multi_* with zero count.
Use bus_space_read/write_multi_stream_2 for FIFO instead of bsr/w_multi_2.
 1.6.2.6 03-Jan-2003  thorpej Sync with HEAD.
 1.6.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.6.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.6.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.6.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.6.2.1 24-Aug-2001  nathanw Catch up with -current.
 1.7.2.4 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.7.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.7.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.7.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.8.8.2 15-Jul-2002  gehenna catch up with -current.
 1.8.8.1 20-Jun-2002  gehenna catch up with -current.
 1.14.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.2.5 04-Feb-2005  skrll Sync with HEAD.
 1.14.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.2 25-Aug-2004  skrll Sync with HEAD.
 1.14.2.1 12-Aug-2004  skrll Sync with HEAD.
 1.29.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.29.6.1 12-Feb-2005  yamt sync with head.
 1.29.4.1 29-Apr-2005  kent sync with -current
 1.32.2.4 17-Mar-2008  yamt sync with head.
 1.32.2.3 27-Oct-2007  yamt sync with head.
 1.32.2.2 30-Dec-2006  yamt sync with head.
 1.32.2.1 21-Jun-2006  yamt sync with head.
 1.34.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.34.10.1 19-Apr-2006  elad sync with head.
 1.34.8.3 14-Sep-2006  yamt sync with head.
 1.34.8.2 11-Aug-2006  yamt sync with head
 1.34.8.1 01-Apr-2006  yamt sync with head.
 1.34.6.1 22-Apr-2006  simonb Sync with head.
 1.34.4.1 09-Sep-2006  rpaulo sync with head
 1.35.4.3 17-Jun-2006  gdamore Undo the undo. Restore COM_INIT_REGS.
 1.35.4.2 17-Jun-2006  gdamore Revert COM_INIT_REGS.
 1.35.4.1 15-Jun-2006  gdamore Adapt to new com framework.
 1.37.4.2 10-Dec-2006  yamt sync with head.
 1.37.4.1 22-Oct-2006  yamt sync with head
 1.37.2.1 18-Nov-2006  ad Sync with head.
 1.39.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.39.24.2 23-Mar-2008  matt sync with HEAD
 1.39.24.1 06-Nov-2007  matt sync with HEAD
 1.39.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.39.8.1 23-Oct-2007  ad Sync with head.
 1.40.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.40.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.40.12.1 24-Mar-2008  keiichi sync with head.
 1.42.4.4 11-Mar-2010  yamt sync with head
 1.42.4.3 16-May-2009  yamt sync with head
 1.42.4.2 04-May-2009  yamt sync with head.
 1.42.4.1 16-May-2008  yamt sync with head.
 1.42.2.1 18-May-2008  yamt sync with head.
 1.43.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.43.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.49.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.49.12.1 30-Oct-2012  yamt sync with head
 1.50.36.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.50.36.1 25-Jun-2018  pgoyette Sync with HEAD
 1.50.30.1 26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.51.2.1 10-Jun-2019  christos Sync with HEAD
 1.52.14.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.53.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.24 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.23 04-Apr-2008  tsutsui branches: 1.23.2; 1.23.4;
Split device_t/softc for more ncr5380sbc variants, with related changes.
 1.22 19-Oct-2007  ad branches: 1.22.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.21 11-Dec-2005  christos branches: 1.21.30; 1.21.44; 1.21.46; 1.21.50;
merge ktrace-lwp.
 1.20 27-Feb-2005  perry branches: 1.20.4;
nuke trailing whitespace
 1.19 04-Feb-2005  perry de-__P
 1.18 10-Aug-2004  mycroft branches: 1.18.4; 1.18.6;
Rather than the silly state machine, set whatever higher-level reference
count there is (for SCSI, adapt_refcnt) to 1 and call the appropriate
"delref" function afterwards to disable the controller. This is a bit
simpler.

In a couple of cases, just remove the state machine, because it wasn't
really necessary.
 1.17 10-Aug-2004  mycroft Update to the new world order.
 1.16 10-Aug-2004  mycroft Use the right function for disabling after attach.
 1.15 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.14 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.13 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.12 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.11 10-Aug-2004  mycroft Update to the new world order.
 1.10 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.9 02-Oct-2002  thorpej branches: 1.9.6;
Add trailing ; to CFATTACH_DECL.
 1.8 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.7 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.6 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.5 13-Nov-2001  lukem branches: 1.5.8;
add RCSIDs
 1.4 27-Apr-2001  joda branches: 1.4.2;
make this compile with the new scsi framework
 1.3 25-Mar-2000  tsutsui branches: 1.3.6; 1.3.8;
Add a "sc_rev" member to ncr5380_softc and handle CXD1180 quirk
in MI ncr5380sbc.
 1.2 18-Mar-2000  mycroft This turns out to be the wrong interface for what I needed -- but I'll leave
the code here for now.
 1.1 18-Mar-2000  mycroft Preliminary support for 53c40x-based cards. Needs some more work.
 1.3.8.4 18-Oct-2002  nathanw Catch up to -current.
 1.3.8.3 20-Jun-2002  nathanw Catch up to -current.
 1.3.8.2 14-Nov-2001  nathanw Catch up to -current.
 1.3.8.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.6.2 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.3.6.1 25-Mar-2000  bouyer file nca_pcmcia.c was added on branch thorpej_scsipi on 2000-11-20 11:42:46 +0000
 1.4.2.3 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.4.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.4.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.8.1 20-Jun-2002  gehenna catch up with -current.
 1.9.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.9.6.4 04-Feb-2005  skrll Sync with HEAD.
 1.9.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.6.1 12-Aug-2004  skrll Sync with HEAD.
 1.18.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.18.6.1 12-Feb-2005  yamt sync with head.
 1.18.4.1 29-Apr-2005  kent sync with -current
 1.20.4.1 27-Oct-2007  yamt sync with head.
 1.21.50.1 25-Oct-2007  bouyer Sync with HEAD.
 1.21.46.1 06-Nov-2007  matt sync with HEAD
 1.21.44.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.21.30.1 23-Oct-2007  ad Sync with head.
 1.22.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.23.4.1 16-May-2008  yamt sync with head.
 1.23.2.1 18-May-2008  yamt sync with head.
 1.19 30-Sep-2008  jmcneill Remove esl(4)
 1.18 05-May-2008  jmcneill branches: 1.18.2; 1.18.6;
Use 2-clause license.
 1.17 17-Mar-2008  cube branches: 1.17.2; 1.17.4;
Fix fallout from softc split.
 1.16 15-Mar-2008  cube Split device_t and softc for opl(4). That should have been done along with
midi(4), because opl_softc embed a midi_softc.
Fixes PR#38242 by Onno van der Linden.
 1.15 19-Oct-2007  ad branches: 1.15.12; 1.15.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.14 16-Nov-2006  christos branches: 1.14.8; 1.14.22; 1.14.24; 1.14.28;
__unused removal on arguments; approved by core.
 1.13 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.12 09-Jun-2006  christos branches: 1.12.6; 1.12.8;
stack police: Introduce an opl_match function that uses malloc instead of
allocating ~2K of softc on the stack.
 1.11 11-Dec-2005  christos branches: 1.11.4; 1.11.8; 1.11.14;
merge ktrace-lwp.
 1.10 24-Mar-2005  jmcneill branches: 1.10.2;
Update my email address (the one listed hasn't been active in years).
 1.9 27-Feb-2005  perry nuke trailing whitespace
 1.8 11-Aug-2004  drochner branches: 1.8.4; 1.8.6;
adapt to esl_pcmcia changes
 1.7 02-Oct-2002  thorpej branches: 1.7.6;
Add trailing ; to CFATTACH_DECL.
 1.6 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.5 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.4 13-Nov-2001  lukem branches: 1.4.2;
add RCSIDs
 1.3 29-Sep-2001  augustss branches: 1.3.2; 1.3.4;
Get rid of eslreh.h and use ../isa/essreg.h.
Minor whitespace fixes.
 1.2 29-Sep-2001  augustss ANSIfy.
 1.1 29-Sep-2001  augustss Add esl driver for Eiger Labs sound card. From Jared D. McNeill
<jmcneill@invisible.yi.org>.
 1.3.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.3.4.3 14-Nov-2001  nathanw Catch up to -current.
 1.3.4.2 08-Oct-2001  nathanw Catch up to -current.
 1.3.4.1 29-Sep-2001  nathanw file opl_esl.c was added on branch nathanw_sa on 2001-10-08 20:11:21 +0000
 1.3.2.2 01-Oct-2001  fvdl Catch up with -current.
 1.3.2.1 29-Sep-2001  fvdl file opl_esl.c was added on branch thorpej-devvp on 2001-10-01 12:46:09 +0000
 1.4.2.3 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.4.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.2.1 13-Nov-2001  thorpej file opl_esl.c was added on branch kqueue on 2002-01-10 19:57:24 +0000
 1.7.6.5 01-Apr-2005  skrll Sync with HEAD.
 1.7.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.7.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.7.6.1 12-Aug-2004  skrll Sync with HEAD.
 1.8.6.2 26-Mar-2005  yamt sync with head.
 1.8.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.8.4.1 29-Apr-2005  kent sync with -current
 1.10.2.3 17-Mar-2008  yamt sync with head.
 1.10.2.2 27-Oct-2007  yamt sync with head.
 1.10.2.1 21-Jun-2006  yamt sync with head.
 1.11.14.1 19-Jun-2006  chap Sync with head.
 1.11.8.1 26-Jun-2006  yamt sync with head.
 1.11.4.1 09-Sep-2006  rpaulo sync with head
 1.12.8.2 10-Dec-2006  yamt sync with head.
 1.12.8.1 22-Oct-2006  yamt sync with head
 1.12.6.1 18-Nov-2006  ad Sync with head.
 1.14.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.14.24.2 23-Mar-2008  matt sync with HEAD
 1.14.24.1 06-Nov-2007  matt sync with HEAD
 1.14.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.14.8.1 23-Oct-2007  ad Sync with head.
 1.15.16.3 05-Oct-2008  mjf Sync with HEAD.
 1.15.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.15.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.15.12.1 24-Mar-2008  keiichi sync with head.
 1.17.4.2 04-May-2009  yamt sync with head.
 1.17.4.1 16-May-2008  yamt sync with head.
 1.17.2.1 18-May-2008  yamt sync with head.
 1.18.6.1 19-Oct-2008  haad Sync with HEAD.
 1.18.2.1 10-Oct-2008  skrll Sync with HEAD.
 1.96 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.95 24-Apr-2021  thorpej branches: 1.95.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.94 26-Jul-2011  dyoung branches: 1.94.70;
Don't copy iobase and iosize members from pcmciabus_attach_args to the
pcmcia_softc because they're not used in any meaningful way.
 1.93 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.92 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.91 02-Apr-2009  dyoung During shutdown, detach devices in an orderly fashion.

Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.

Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks. For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.

Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown. Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags. Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).

Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.

Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag. The default for kern.detachall is 0. SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.

This is a work in progress. In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.

Also commit some changes that are not easily untangled from the rest:

(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.

(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs. Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.
 1.90 15-Mar-2009  cegger ansify function definitions
 1.89 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.88 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.87 03-Jul-2008  drochner branches: 1.87.4; 1.87.10;
split device/softc
Now I'm through - all my devices are split.
 1.86 05-Apr-2008  cegger branches: 1.86.4; 1.86.6; 1.86.8;
use aprint_*_dev and device_xname
 1.85 16-Dec-2007  dyoung branches: 1.85.6;
Improve pci, cbb, cardslot, cardbus, and pcmcia to support detachment
of this entire device tree:

pci0 at mainbus0
elansc0 at pci0
gpio0 at elansc0
cbb0 at pci0
cardslot0 at cbb0
cardbus0 at cardslot0
pcmcia0 at cardslot0
cbb1 at pci0
cardslot1 at cbb1
cardbus1 at cardslot1
rtw0 at cardbus1
pcmcia1 at cardslot1
sip0 at pci0
nsphyter0 at sip0
sip1 at pci0
nsphyter1 at sip1

Whew!
 1.84 09-Dec-2007  jmcneill branches: 1.84.2;
Merge jmcneill-pm branch.
 1.83 01-Dec-2007  jmcneill branches: 1.83.2; 1.83.4;
aprintify
 1.82 16-Nov-2006  christos branches: 1.82.22; 1.82.24; 1.82.30;
__unused removal on arguments; approved by core.
 1.81 24-Oct-2006  drochner kill the "irq" llocator for pcmcia - this doesn't make sense because
irq mapping is done by the controller, and it is not used anywhere afaict
 1.80 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.79 29-Mar-2006  thorpej branches: 1.79.4; 1.79.8; 1.79.10;
Replace device_locators() with device_locator(), and use it.
 1.78 11-Dec-2005  christos branches: 1.78.4; 1.78.6; 1.78.8; 1.78.10; 1.78.12;
merge ktrace-lwp.
 1.77 26-Aug-2005  drochner use XXXCF_NLOCS constants instead of magic numbers
 1.76 25-Aug-2005  drochner kill a number of autoconf submatch functions which follow the
standard scheme:
if (<configured> != <wildcard> && <configured> != <real>)
then fail
else
ask device match function

This is handled by config_stdsubmatch() now.
 1.75 25-Aug-2005  drochner replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
 1.74 15-Aug-2005  christos PR/30995: Wada Keiji: pcmcia interface can't use ne2000 compatible card
Call pcmcia_socket_settype sooner. I removed the later call, so the submitter
should test the final code before I close the PR.
 1.73 27-Feb-2005  perry branches: 1.73.2; 1.73.4;
nuke trailing whitespace
 1.72 04-Feb-2005  perry de-__P
 1.71 18-Aug-2004  drochner branches: 1.71.4; 1.71.6;
Allow to rescan and detach by user request, using the new autoconf
functions.
For later rescans (eg after a driver LKM was loaded) to make sense,
don't consider it an error if no driver was attached on the initial
bus scan.
Someone who understands the enable/disable/powerup/down stuff please
review this.
 1.70 12-Aug-2004  mycroft Simplify a little. Pass down the card type from pcmcia_function_enable(),
which just gets it from the config entry for the function it's enabling.
Multifunction cards are defined to be of type I/O on every function, so there
is no possibility of accidentally switching.
 1.69 12-Aug-2004  mycroft If the card is being detached, do not try to write the CCR to disable the
function.
 1.68 12-Aug-2004  mycroft Always write the IOBASE/IOLIMIT registers if they're set in the CCR mask. We
can't really rely on multifunction devices having a CIS that reflects this --
e.g. some cards use a combined Ethernet+modem chip, but only actually serve
one of the functions. (We have to assume the configuration index reflects the
bits needed to enable the function.)
 1.67 12-Aug-2004  mycroft Write the configuration option register -- possibly switching the device into
its I/O mode -- as the *last* write to the CCR.
 1.66 12-Aug-2004  mycroft Don't call socket_settype() to enable I/O interrupts until after we've written
the CCR.
 1.65 12-Aug-2004  mycroft My previous understanding of the I/O base/limit registers was incorrect.
However, so was the old code. Now it works correctly. :-)
 1.64 11-Aug-2004  mycroft Output a message if we fail to find anything useful in the CIS, rather than
appearing to do nothing.
 1.63 11-Aug-2004  mycroft Do not ever set IOIS8. We are not running on an 8088.
 1.62 11-Aug-2004  mycroft Always use PCMCIA_WIDTH_AUTO rather than PCMCIA_WIDTH_IO16. This spec is
pretty clear on how this works.
 1.61 11-Aug-2004  mycroft Fix uninitialized variable warnings (which did not appear on x86).
 1.60 11-Aug-2004  mycroft Rather than having a call up from the low-level driver to get the card type,
instead have a call down from the PCMCIA mid-layer to set it. Use this from
pcmcia_function_enable(). (Currently the policy is the same, but this would
allow for more flexibility in deciding which mode to use.)

Now it is safe to hold the socket enabled during attach, so do that. Only
one enable/disable cycle to attach a card now!
 1.59 10-Aug-2004  mycroft Move the socket reference counting into pcmcia_socket_{enable,disable}(), and
use that where needed.
 1.58 10-Aug-2004  mycroft Whoops, look at both the ID numbers and the CIS strings in each pcmcia_product.
It's dumb that drivers depend on this, but...
 1.57 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.56 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.55 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.54 10-Aug-2004  mycroft Move the location of a printf() I added.
 1.53 10-Aug-2004  mycroft Be robust against child devices failing to handle the socket refcnt properly --
force it to 0 when a card is detached, possibly disabling the socket in the
process.

Add several new functions:
* pcmcia_config_alloc(pf, cfe)
Tries to allocate all the I/O and memory spaces in a config entry.
* pcmcia_config_free(pf)
Frees all the I/O and memory spaces for the active configuration.
* pcmcia_config_map(pf)
Maps all the allocated I/O and memory spaces for the active configuration.
* pcmcia_config_unmap(pf)
Unmaps all the allocated I/O and memory spaces for the active configuration.

And two higher-level functions:
* pcmcia_function_configure(pf, validator)
Tries to find a CIS config entry that it can allocate the spaces for. Each
entry is verified by calling the "validator" function -- which can also do
card- and driver-specific fixups. If successful, the regions are all mapped.
* pcmcia_function_unconfigure(pf)
Equivalent to calling both pcmcia_config_unmap() and pcmcia_config_free().

Most drivers are expected to use the latter two functions, which will greatly
reduce the amount of crufty code.
 1.52 09-Aug-2004  mycroft Dispense with all the interrupt multiplexing code here, and assume that the
underlying implementation DTRT. This has the side effect of causing us to
ignore the INTR and INTRACK bits in the CCR -- but this seems for the best
anyway, since they are not reliably implemented. (I note that Linux doesn't
bother either.)
 1.51 09-Aug-2004  mycroft Add newlines to the messages...
 1.50 09-Aug-2004  mycroft Whoops, nuke an unused variable.
 1.49 09-Aug-2004  mycroft Assume that io_map/unmap and intr_establish/disestablish will not be called
with the function enabled. If this happens, issue a warning. (This is only
really important for multifunction cards.)

This allows me to get rid of a bunch of extra code.
 1.48 09-Aug-2004  mycroft Make pcmcia_function_disable() primarily responsible for disabling the CCR
bits. pcmcia_intr_disestablish() continues to do this as a stopgap.
 1.47 09-Aug-2004  mycroft If the function is not enabled, do not attempt to immediately update the CCR.
XXX This is a stopgap until all drivers are converted to do their io_maps and
intr_establishes before function_enable.
 1.46 09-Aug-2004  mycroft Fix a debugging printf().
 1.45 09-Aug-2004  mycroft Do not set INTRACK ourselves.
 1.44 09-Aug-2004  mycroft Implement the correct (I think) interrupt acknowledgement sequence.
 1.43 09-Aug-2004  mycroft Multifunction fixes:
* Don't call handlers for functions that are not enabled.
* Always call the handler if the function doesn't support the STATUS register.
While I'm here, divide the CCR numbers by 2.
 1.42 08-Aug-2004  mycroft Copyright maintenance.
 1.41 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.40 08-Aug-2004  mycroft pcmcia_socket_{enable,disable}() weren't used. Reimplement them as public
functions taking a pcmcia* device structure.

XXX This is a method of last resort for dealing with stupid/insane cards that
we need to probe harder before we can choose a config entry. It should not be
used by most drivers.
 1.39 06-Aug-2004  mycroft Put a comma before the last CIS string too.
 1.38 07-Jul-2004  mycroft More cleanup:
* Print "devinfo" in a canonial place (like we do in the SCSI code).
* Use aprint_{error,normal}() during attach.
* More PCMCIA_STR_* removal.
 1.37 07-Jul-2004  mycroft Modify the format of pcmcia_devinfo() slightly.
 1.36 22-Oct-2003  briggs Maintain reference count properly for nested enables/disables.
 1.35 01-Jan-2003  thorpej branches: 1.35.2;
Use aprint_normal() in cfprint routines.
 1.34 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.33 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.32 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.31 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.30 27-Sep-2002  thorpej Rather than referencing the cfdriver directly in the cfdata entries,
instead use a string naming the driver. The cfdriver is then looked
up in a list which is built at run-time.
 1.29 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.28 15-Dec-2001  soren branches: 1.28.8;
To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.27 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.26 13-Nov-2001  lukem add RCSIDs
 1.25 13-May-2001  jmc branches: 1.25.2;
Turn off PCMCIADEBUG by default. This should get set with options in a config file
 1.24 29-Apr-2001  christos don't put a trailing comma in pcmcia_devinfo. All the drivers use
printf("%s\n", devinfo) and it looks stupid.
 1.23 28-Jul-2000  drochner branches: 1.23.2;
print parent device name too, so we know which socket a card was probed at
and whether pcmcia or cardbus
 1.22 08-May-2000  augustss KNF some comments.
 1.21 26-Feb-2000  uch IT8368E legacy mode requires mode change between I/O access and
attribute memory access. XXX
 1.20 22-Feb-2000  chopps remove bogus debug (was reading unmapped CCR)
 1.19 08-Feb-2000  enami - Don't rely on implicit declaration.
- Sinc wi/ existing coding style.
 1.18 07-Feb-2000  augustss Add a pcmcia_devinfo() function (akin to pci_devinfo). It generates a
string suitable for printing in the attach message.
 1.17 05-Feb-2000  nathanw LP64 printf fixes.
 1.16 04-Feb-2000  cgd replace the *_lookup table entry match/lookup functions in all of
these drivers with a single common function (which supports tables
of variable-sized structures). Things are mostly as they were before:
tables are terminated by entry with NULL name, etc. There's also
the ability to call a driver-specific match function which can be used
to augment the table lookup.
 1.15 23-Jan-2000  aymeric add right casts to printf bus_space parameters
 1.14 15-Oct-1999  haya branches: 1.14.2;
This is the first check-in of CardBus driver. CardBus driver contains
CardBus bus stub, YENTA PCI-CardBus bridge (cbb), 3Com 3C575TX driver
(ex) and Intel fxp driver.

TODO:
o Conform to the KNF more strictly.
o Be unified with pcmcia code as much as possible.
o Add more drivers for CardBus card, such as APA-1480 or USB card.

The affected files are listed below.

sys/arch/i386/conf/files.i386
sys/arch/macppc/conf/files.macppc
sys/conf/files
sys/dev/ic/elinkxl.c
sys/dev/ic/elinkxlvar.h
sys/dev/ic/i82365.c
sys/dev/ic/i82365var.h
sys/dev/isa/i82365_isasubr.c
sys/dev/pci/files.pci
sys/dev/pcmcia/pcmcia.c
sys/dev/pcmcia/pcmciachip.h

The added files are listed below.

sys/arch/i386/conf/CARDBUS
sys/arch/i386/include/rbus_machdep.h
sys/arch/i386/i386/rbus_machdep.c
sys/arch/macppc/include/rbus_machdep.h
sys/arch/macppc/macppc/rbus_machdep.c
sys/dev/cardbus/if_ex_cardbus.c
sys/dev/cardbus/Makefile.cardbusdevs
sys/dev/cardbus/cardbus.c
sys/dev/cardbus/cardbus_map.c
sys/dev/cardbus/cardbusdevs
sys/dev/cardbus/cardbusdevs.h
sys/dev/cardbus/cardbusdevs_data.h
sys/dev/cardbus/cardbusvar.h
sys/dev/cardbus/cardslot.c
sys/dev/cardbus/cardslotvar.h
sys/dev/cardbus/devlist2h.awk
sys/dev/cardbus/files.cardbus
sys/dev/cardbus/if_fxp_cardbus.c
sys/dev/cardbus/pccardcis.h
sys/dev/cardbus/rbus.c
sys/dev/cardbus/rbus.h
sys/dev/pci/pccbb.c
sys/dev/pci/pccbbreg.h
sys/dev/pci/pccbbvar.h
 1.13 24-Dec-1998  marc branches: 1.13.8;
add quirk support for cards which lie extensively about their CIS
 1.12 24-Dec-1998  marc add code to permit pcmcia intr debugging
 1.11 17-Nov-1998  thorpej Finish implementing interrupt-driven card insertion and removal support.

- Deactivate the card on removal and queue a REMOVAL event for the socket's
event thread to finish the detach.
- Queue an INSERTION event for the socket's event thread on insertion.

Implement a few missing infrastructure pieces to support this.

Hot swapping of PCMCIA cards now "works". (Not quite; things like network
devices need changes for their respestive subsystems. These changes are
coming soon...)
 1.10 14-Nov-1998  thorpej Make a comment about what pcmcia_detach_card() should do.
 1.9 13-Aug-1998  eeh Merge paddr_t changes into the main branch.
 1.8 09-Jun-1998  thorpej branches: 1.8.2;
Nuke __BROKEN_INDIRECT_CONFIG.
 1.7 05-Jun-1998  enami In the function pcmcia_card_gettype:
- When there is only one pcmcia function, don't use first config
entry to determine card type. Instead, use the config entry
actually used to initialize the pcmcia function if it is already
initialized, else a card is memory-type.
- Don't put a space after cast.
- Use SIMPLEQ_FIRST/NEXT macro.
 1.6 07-Mar-1998  christos - remove duplicate setting of CCR
- fix debugging code so that it compiles
- reorder the disabling code so that it is more logical
- add splhigh()/splx() in the first establish setting for symmetry
 1.5 01-Feb-1998  marc rewrite mfc intr management not to use unexported spl* functions
add mfc iobase/iosize support
add power management support
 1.4 12-Jan-1998  thorpej Update for changes to config.
 1.3 19-Oct-1997  enami Include locators.h and use symbolic name comes from it.
 1.2 16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1 30-Jul-1997  marc branches: 1.1.2;
file pcmcia.c was initially added on branch marc-pcmcia.
 1.1.2.14 16-Oct-1997  thorpej Copyright/license update.
 1.1.2.13 16-Oct-1997  thorpej Pass down the start and side of the i/o space allocation range to
the "pcmcia" layer so that drivers with Very Special i/o space allocation
needs can know what range they should be dealing with.
 1.1.2.12 15-Oct-1997  enami defopt PCMCIAVERBOSE.
 1.1.2.11 15-Oct-1997  enami No need to cast a generic pointer.
 1.1.2.10 14-Oct-1997  thorpej KNF, RCS IDs.
 1.1.2.9 29-Sep-1997  thorpej - In pcmcia_function_enable(), don't panic if the function is already
enabled; just return, instead.
- In pcmcia_function_disable(), add a check for "function is already
disabled", and, if it is, just return.
 1.1.2.8 27-Sep-1997  marc - add a card_gettype function to the chip->pcmcia interface, and remove
the variable from the card_attach function
- add power management calls
 1.1.2.7 23-Aug-1997  thorpej Split up pcmcia_enable_function() into pcmcia_function_init() and
pcmcia_function_enable(). Implement pcmcia_function_disable().
If the enabled count on a socket reaches 0, call the chipset-level
socket disable function. If the enabled count becomes non-0, call
the chipset-level socket enable function.
 1.1.2.6 11-Aug-1997  thorpej Pass the PCMCIA function structure rather than an IRQ mask to the
interrupt establish function.
 1.1.2.5 10-Aug-1997  thorpej Create a structure to encapsulate information about allocated i/o and
mem space on the pcmcia bus. Use this in chip-level window enable
functions rather than making assumptions about the bus space handles.

Also, clean up lots of debugging prints. Use patchables to enable them.
 1.1.2.4 31-Jul-1997  thorpej Pay attention to the "valid IRQ mask" in a device's CIS information.
This adds an additional "irqmask" argument to the chip-level "intr_establish"
functions.
 1.1.2.3 30-Jul-1997  thorpej If Really Verbse Debugging is compiled in, use a patchable variable to
turn the messages on/off, so you can clean up the output without rebuilding.
 1.1.2.2 30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.8.2.1 30-Jul-1998  eeh Split vm_offset_t and vm_size_t into paddr_t, psize_t, vaddr_t, and vsize_t.
 1.13.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.14.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.23.2.6 03-Jan-2003  thorpej Sync with HEAD.
 1.23.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.23.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.23.2.3 08-Jan-2002  nathanw Catch up to -current.
 1.23.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.23.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.25.2.3 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.25.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.25.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.28.8.1 20-Jun-2002  gehenna catch up with -current.
 1.35.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.35.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.35.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.35.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.35.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.35.2.3 25-Aug-2004  skrll Sync with HEAD.
 1.35.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.35.2.1 03-Aug-2004  skrll Sync with HEAD
 1.71.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.71.6.1 12-Feb-2005  yamt sync with head.
 1.71.4.1 29-Apr-2005  kent sync with -current
 1.73.4.4 21-Jan-2008  yamt sync with head
 1.73.4.3 07-Dec-2007  yamt sync with head
 1.73.4.2 30-Dec-2006  yamt sync with head.
 1.73.4.1 21-Jun-2006  yamt sync with head.
 1.73.2.1 12-Sep-2005  tron Pull up following revision(s) (requested by christos in ticket #761):
sys/dev/pcmcia/pcmcia.c: revision 1.74
PR/30995: Wada Keiji: pcmcia interface can't use ne2000 compatible card
Call pcmcia_socket_settype sooner. I removed the later call, so the submitter
should test the final code before I close the PR.
 1.78.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.78.10.1 19-Apr-2006  elad sync with head.
 1.78.8.1 01-Apr-2006  yamt sync with head.
 1.78.6.1 22-Apr-2006  simonb Sync with head.
 1.78.4.1 09-Sep-2006  rpaulo sync with head
 1.79.10.2 10-Dec-2006  yamt sync with head.
 1.79.10.1 22-Oct-2006  yamt sync with head
 1.79.8.1 18-Nov-2006  ad Sync with head.
 1.79.4.1 15-Jun-2006  gdamore Adapt to new com framework.
 1.82.30.2 27-Dec-2007  mjf Sync with HEAD.
 1.82.30.1 08-Dec-2007  mjf Sync with HEAD.
 1.82.24.1 09-Jan-2008  matt sync with HEAD
 1.82.22.4 08-Dec-2007  jmcneill Rename pnp(9) -> pmf(9), as requested by many.
 1.82.22.3 01-Dec-2007  jmcneill Sync with HEAD.
 1.82.22.2 06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.82.22.1 04-Sep-2007  joerg Add a basic generic network power management handler for PCMCIA as well.
Contrary to the versions for PCI/Cardbus, expect the caller to provide
the status variable as we currently have no way in hardware to do that.

This handler should be extended to power down/power up the slots on
D0/D3 transistions.
 1.83.4.1 11-Dec-2007  yamt sync with head.
 1.83.2.1 26-Dec-2007  ad Sync with head.
 1.84.2.1 02-Jan-2008  bouyer Sync with HEAD
 1.85.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.85.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.86.8.1 18-Jul-2008  simonb Sync with head.
 1.86.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.86.4.2 16-May-2009  yamt sync with head
 1.86.4.1 04-May-2009  yamt sync with head.
 1.87.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.87.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.94.70.3 28-Mar-2021  thorpej - Unwrap a line.
- No need to be explcit about interface attribute.
 1.94.70.2 22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.94.70.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.95.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.57 10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.56 03-Feb-2019  mrg - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
 1.55 12-May-2009  cegger branches: 1.55.64;
struct device * -> device_t, no functional changes intended.
 1.54 15-Mar-2009  cegger ansify function definitions
 1.53 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.52 03-Jul-2008  drochner branches: 1.52.4; 1.52.10;
split device/softc
Now I'm through - all my devices are split.
 1.51 05-Apr-2008  cegger branches: 1.51.4; 1.51.6; 1.51.8;
use aprint_*_dev and device_xname
 1.50 16-Nov-2006  christos branches: 1.50.48;
__unused removal on arguments; approved by core.
 1.49 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.48 02-Sep-2006  christos branches: 1.48.2; 1.48.4;
redo with c99 initializers
 1.47 02-Sep-2006  christos - comment out impossible comparison
- add missing initializer
 1.46 08-Apr-2006  christos - wrap memspace {}, pointed out by rui.
- comment out the memspace none case, pointed out by rui.
- move declarations to the top to avoid brace mess.
 1.45 08-Apr-2006  christos Split the tuple parsing code in its own function for each kind, instead of
having a single parsing function that has more than 1000 lines of code.
 1.44 08-Apr-2006  rpaulo Back out rev 1.42 and 1.43. It's been causing much more hassle than it should
and I don't feel like continue arguing about it.
 1.43 06-Apr-2006  rpaulo Add misssing }. Sorry for breaking the build.
 1.42 06-Apr-2006  rpaulo In pcmcia_parse_cis_tuple(), refactor the memspace section introducing
a switch statement and fixing CID 566.
 1.41 23-Feb-2006  gdamore branches: 1.41.2; 1.41.4; 1.41.6;
When unmapping and remapping, the mem handle and mem tags can change. Do
not assume that they will remain the same.
 1.40 11-Dec-2005  christos branches: 1.40.2; 1.40.4; 1.40.6;
merge ktrace-lwp.
 1.39 27-Feb-2005  perry branches: 1.39.4;
nuke trailing whitespace
 1.38 04-Feb-2005  perry de-__P
 1.37 15-Oct-2004  enami branches: 1.37.4; 1.37.6;
Rewrite the loop without using useless SIMPLEQ_FOREACH macro.
 1.36 17-Sep-2004  itojun deal with PCMCIA_TPCE_IO_RANGE_ADDRSIZE_NONE and
PCMCIA_TPCE_IO_RANGE_LENGTHSIZE_NONE properly. enami
solves kern/26726.
 1.35 10-Aug-2004  mycroft Constify.
 1.34 07-Aug-2004  mycroft Swap around the output in some other cases so it's consistent.
Remove some more DELAY()s.
 1.33 07-Aug-2004  mycroft Only DELAY() once per CIS region, not once per tuple.
For PCMCIACISDEBUG, print out the tuple *before* parsing it or calling the
callback, so that we can see the tuple that the callback claimed.
 1.32 22-Oct-2003  mjl Typo in comment. From OpenBSD.
 1.31 15-Aug-2002  christos branches: 1.31.6;
Fix multi-function card memory problems:
- centralize pcmcia function allocation and free'ing.
- free the cfe too, not just the pf in the multifunction card case.
- don't free pointers while walking the list, because free() will
fill the memory with deadbeef, thus killing list walking.
 1.30 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.29 12-Jan-2002  tsutsui branches: 1.29.8; 1.29.10;
Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.28 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.27 13-Nov-2001  lukem add RCSIDs
 1.26 25-Oct-2001  bouyer Commit changes I posted to tech-kern on Oct 14, which makes the ethernet part
of my Xircom RealPort Ethernet 10/100 + Modem (REM56G) work.
The modem part is still not usable (this would need some PCMCIA magic that
I don't know how to do; see my message to tech-kern on Oct 07).
Change to pcmcia_cis.c from OpenBSD.
I checked that this doesn't break a 3com 3C562D (ethernet+modem) which I
also have.
 1.25 24-Sep-2001  itohy branches: 1.25.2;
Add simple boundary check on CIS parsing.
I have a weird PC-card-style appliance (I'm not sure I may call it a PC card)
whose ``CIS'' reads zeros forever, which caused kernel panic.

For your interest, it is a cooling fan to be inserted to a PC card slot.
 1.24 07-Jul-2001  thorpej branches: 1.24.2; 1.24.4;
bzero -> memset
 1.23 13-May-2001  jmc Turn off PCMCIACISDEBUG by default. This should get set with options in a config file
 1.22 27-Mar-2001  toshii Change place of tuple.{memt,memh} initialization.
 1.21 10-Feb-2001  martin branches: 1.21.2;
Stopgap fix for PR 9984: sprinkle some (small) delays at appropriate
places into the CIS reading code.

The card in question has IO8 only enabled in its CIS info and is apparently
not able to keep up with quick reads. It words fine in a pcmcia slot but
panics(!) the kernel in a TI 1250 cardbus slot. This may be a failure of
the pci cardbus code when initializing this bridge. When finding (and
fixing) that, we should back this change out.

The card I am testing with is not broken, I have multiple versions of it
(AVM Fritz! pcmcia ISDN card), all work fine on windows and all cause
us to panic because of bogus CIS info read.

XXX - panicing because of bogus CIS data is probably another error.
 1.20 17-Oct-2000  haya Add a cis decoding function which decodes some CISTPL_FUNCE tuples for
disk and network functions.
 1.19 14-Jul-2000  jun apply Kenji Aoyama <aoyama@nk.mcu.or.jp>'s patch
on port-hpcmips-ja@jp.netbsd.org Mon, 10 Jul 2000 21:21:47 +0900

FIX:
Can't read CIS tuple chain:some TDK CF Flash memory card.
 1.18 21-Feb-2000  enami branches: 1.18.4;
Cosmetic changes.
 1.17 10-Feb-2000  chopps map common memory 8 bit for cis scan when following longlinks.
 1.16 25-Jan-2000  chopps The cfe is initialized to the default entry, when a table entry value
is present don't OR in the flags with the defaults, replace them.
 1.15 20-Jan-2000  enami Don't overwrite cfe->flags.
 1.14 14-Jan-2000  cgd Some additional sanity checks to keep this code from bursting into
flame if presented with bad CIS data (e.g. because of a memory space
conflict):
* more sanity checking on LONGLINK_MFC CIS tuples (exact length check, sanity
check on size vs. size of array we allocated for them), to avoid various
missteps which could cause this code to complete trash the kernel stack.
* clear the entire contents of the state structure before processing, so
things like uninitted pointers will actually have a known value!
* be more careful with CISTPL_CFTABLE_ENTRY: check to see that the current
state's default_entry isn't NULL before dereferencing it.
 1.13 07-Nov-1999  enami Print range of all iospaces or all memspaces if their length aren't zero.
 1.12 11-Jul-1999  bad branches: 1.12.2; 1.12.4; 1.12.8;
In pcmcia_pars_cis_tuple(): in the PCMCIA_TPCE_FS_MEMSPACE_TABLE case
there is one more memspace in the table then the PCMCIA_TPCE_MS_COUNT
mask produces.
 1.11 11-Jul-1999  bad In pcmcia_print_cis(): When printing io and mem spaces don't append trailing
0s if length or hostaddr are zero, instead DTRT.
 1.10 29-Dec-1998  marc branches: 1.10.2; 1.10.4;
check for end of tuple while reading cfe data
 1.9 22-Aug-1998  msaitoh fix version string (from PC Card Standard, April 1998 (Release 6.1))
 1.8 13-Aug-1998  nathanw Use PCMCIA_FUNCTION definitions.
Initialize function ID in new pcmcia_function structures to
PCMCIA_FUNCTION_UNSPEC, not PCMCIA_FUNCTION_MULTIFUNCTION (0).
 1.7 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.6 01-Jul-1998  marc better MFC parsing (for 3c56[23]D), and make sure the pf is zeroed out before using it (for adaptec 1460b)
 1.5 29-May-1998  msaitoh add some information from "PC Card standard March 1997"
 1.4 09-Mar-1998  christos - fix pcmcia_scan_cis to return:
-1 error
0 desired tuple not found
1 desired tuple found
 1.3 19-Oct-1997  enami Make `manufacturer' and `product' 32bit wide so that they can contain
both 16bit id values found in card CIS and special value to indicate
that no value found in CIS. Use that special value for the card that
doesn't have id values. Test that value in ne2000_match().
 1.2 16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1 30-Jul-1997  marc branches: 1.1.2;
file pcmcia_cis.c was initially added on branch marc-pcmcia.
 1.1.2.10 16-Oct-1997  thorpej Copyright/license update.
 1.1.2.9 15-Oct-1997  enami No need to cast a generic pointer.
 1.1.2.8 14-Oct-1997  thorpej KNF, RCS IDs.
 1.1.2.7 18-Sep-1997  marc deal with the case of a card with a LONGLINK_MFC and an implicit but
invalid LONGLINK. Also be more verbose for debugging of this sort of
situation.
 1.1.2.6 23-Aug-1997  thorpej Make sure the newly allocated function structure is zero'd.
 1.1.2.5 10-Aug-1997  thorpej Always print a message if the CIS has a wrong checksum. Do not fail if
the checksum is wrong; many WaveLAN cards have bad checksums, but work fine.
 1.1.2.4 10-Aug-1997  thorpej Create a structure to encapsulate information about allocated i/o and
mem space on the pcmcia bus. Use this in chip-level window enable
functions rather than making assumptions about the bus space handles.

Also, clean up lots of debugging prints. Use patchables to enable them.
 1.1.2.3 30-Jul-1997  thorpej If Really Verbse Debugging is compiled in, use a patchable variable to
turn the messages on/off, so you can clean up the output without rebuilding.
 1.1.2.2 30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.10.4.1 02-Aug-1999  thorpej Update from trunk.
 1.10.2.1 15-Jan-2000  he Pull up revision 1.14 (requesged by cgd):
Make PCMCIA CIS parsing more robust.
 1.12.8.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.4.1 15-Nov-1999  fvdl Sync with -current
 1.12.2.3 21-Apr-2001  bouyer Sync with HEAD
 1.12.2.2 11-Feb-2001  bouyer Sync with HEAD.
 1.12.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.18.4.2 13-Mar-2001  he Pull up revision 1.21 (requested by martin):
Add some small delays at appropriate places in CIS reading code.
This is a stopgap fix for PR#9984, avoiding a panic when an
``AVM Fritz!'' ISDN card is installed in a cardbus slot.
 1.18.4.1 22-Aug-2000  jun Pullup rev. 1.19 (approved by thorpej):
apply Kenji Aoyama <aoyama@nk.mcu.or.jp>'s patch
on port-hpcmips-ja@jp.netbsd.org Mon, 10 Jul 2000 21:21:47 +0900
FIX:
Can't read CIS tuple chain:some TDK CF Flash memory card.
 1.21.2.9 27-Aug-2002  nathanw Catch up to -current.
 1.21.2.8 20-Jun-2002  nathanw Catch up to -current.
 1.21.2.7 28-Feb-2002  nathanw Catch up to -current.
 1.21.2.6 08-Jan-2002  nathanw Catch up to -current.
 1.21.2.5 14-Nov-2001  nathanw Catch up to -current.
 1.21.2.4 26-Sep-2001  nathanw Catch up to -current.
Again.
 1.21.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.21.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.21.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.24.4.1 01-Oct-2001  fvdl Catch up with -current.
 1.24.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.24.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.24.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.24.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.25.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.29.10.1 21-Oct-2003  jmc Pullup to rev 1.31 (requested in ticket #699)
Enable support for multi-function pcmcia cards.
 1.29.8.2 29-Aug-2002  gehenna catch up with -current.
 1.29.8.1 20-Jun-2002  gehenna catch up with -current.
 1.31.6.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.31.6.6 04-Feb-2005  skrll Sync with HEAD.
 1.31.6.5 19-Oct-2004  skrll Sync with HEAD
 1.31.6.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.31.6.3 18-Sep-2004  skrll Sync with HEAD.
 1.31.6.2 12-Aug-2004  skrll Sync with HEAD.
 1.31.6.1 03-Aug-2004  skrll Sync with HEAD
 1.37.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.37.6.1 12-Feb-2005  yamt sync with head.
 1.37.4.1 29-Apr-2005  kent sync with -current
 1.39.4.2 30-Dec-2006  yamt sync with head.
 1.39.4.1 21-Jun-2006  yamt sync with head.
 1.40.6.1 22-Apr-2006  simonb Sync with head.
 1.40.4.1 09-Sep-2006  rpaulo sync with head
 1.40.2.1 01-Mar-2006  yamt sync with head.
 1.41.6.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.41.4.1 19-Apr-2006  elad sync with head.
 1.41.2.2 03-Sep-2006  yamt sync with head.
 1.41.2.1 03-Sep-2006  yamt sync with head.
(this file has not been synced at all after branching? why?)
 1.48.4.2 10-Dec-2006  yamt sync with head.
 1.48.4.1 22-Oct-2006  yamt sync with head
 1.48.2.1 18-Nov-2006  ad Sync with head.
 1.50.48.2 28-Sep-2008  mjf Sync with HEAD.
 1.50.48.1 02-Jun-2008  mjf Sync with HEAD.
 1.51.8.1 18-Jul-2008  simonb Sync with head.
 1.51.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.51.4.2 16-May-2009  yamt sync with head
 1.51.4.1 04-May-2009  yamt sync with head.
 1.52.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.52.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.55.64.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.55.64.1 10-Jun-2019  christos Sync with HEAD
 1.36 10-Nov-2019  chs in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
 1.35 14-Sep-2013  joerg branches: 1.35.30;
GC pcmcia_sierra_ac850_func0 and *cfe0
 1.34 14-Mar-2009  dsl branches: 1.34.12; 1.34.22; 1.34.26;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.33 06-Sep-2008  rmind branches: 1.33.2; 1.33.8;
PR/38382: Jean-Yves Moulin: Support for Sierra Wireless Aircard 850.
 1.32 03-Jul-2008  drochner branches: 1.32.2;
split device/softc
Now I'm through - all my devices are split.
 1.31 05-Apr-2008  cegger branches: 1.31.4; 1.31.6; 1.31.8;
use aprint_*_dev and device_xname
 1.30 10-Feb-2007  ichiro branches: 1.30.40;
make tags for AX420N(NEC Infrontia)
 1.29 03-Sep-2006  christos use c99 initializers
 1.28 14-May-2006  elad integrate kauth.
 1.27 14-Apr-2006  christos Coverity CID 773: Add a KASSERT to appease coverity.
 1.26 11-Dec-2005  christos branches: 1.26.4; 1.26.6; 1.26.8; 1.26.10; 1.26.12;
merge ktrace-lwp.
 1.25 27-Feb-2005  perry branches: 1.25.4;
nuke trailing whitespace
 1.24 24-Oct-2004  enami branches: 1.24.4; 1.24.6;
Back out part of previous. The card refered in PR/27255 needs to be
handled differently (at least the current code doesn't handle well).
 1.23 15-Oct-2004  enami - Don't change the matching logic.
- Prepare to describe a card which has NULL CIS string.
- Factor out common code.
- Deal with malloc return value.
 1.22 14-Oct-2004  christos PR/27255: Nikos Ntarmos: PCMCIA NIC with blank CIS tuples crashes the kernel
Simplify the code for readability.
 1.21 10-Aug-2004  mycroft Constify.
 1.20 15-Aug-2002  christos branches: 1.20.6;
Fix multi-function card memory problems:
- centralize pcmcia function allocation and free'ing.
- free the cfe too, not just the pf in the multifunction card case.
- don't free pointers while walking the list, because free() will
fill the memory with deadbeef, thus killing list walking.
 1.19 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.18 13-Jan-2002  aymeric branches: 1.18.8; 1.18.10;
Remove the quirks I added for an ethernet card I have.
This ``quick fix'' shall not make it into a release, and the problem doesn't
come from the card but rather from my laptop.
 1.17 23-Dec-2001  ichiro support FUJITSU MB86960/5 based ethernet cards
FMV-J181,182,182A
 1.16 16-Dec-2001  ichiro missing Misc Attribute of PCMCIA functions
FUJITSU CF Ether ITCFJ182A supported "Power down"
Power down supply current are 20mA
 1.15 16-Dec-2001  ichiro support FUJITSU CF EthernetCard
ITCFJ181A

mbe0 at pcmcia1 function 0: Fujitsu J182A Compact Flash Ethernet
mbe0: Ethernet address 00:00:0e:c5:01:ea
 1.14 15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.13 13-Nov-2001  lukem add RCSIDs
 1.12 27-Jun-2001  ichiro branches: 1.12.2;
enabling EMTAC A2424i Wavelan Card
It work fine.
 1.11 16-May-2001  lukem fix previous delint
 1.10 16-May-2001  lukem delint: zero sized array initalisation is a gccism
 1.9 13-May-2001  jmc Turn off PCMCIADEBUG by default. This should get set with options in a config file
 1.8 18-Jan-2001  jdolecek branches: 1.8.2;
constify
 1.7 10-Jan-2001  aymeric Added four config entries for the DLink DE-650CT.
XXX I think we should have if_ne_pcmcia.c try to allocate I/O addresses
around 0x300 or we'll end up with a lot of quirks for NE2k based
cards which have bad CIS's.
 1.6 12-Apr-2000  scw Add support for the SOHOware PCMCIA Ethernet card, model ND5100-E.
This seems to be a re-badged NDC (National Datacomms. Corp) card.
It needs a quirk entry due to lack of manufacturer tuple in the CIS.
For some reason, the 'Tx/Rx' LED on the connector module is inverted
such that it is off during network activity...
 1.5 11-Oct-1999  thorpej branches: 1.5.2;
Add quirks for the 3Com/Megahertz 3CCFEM556BI 10/100 Ethernet/Modem,
from Ryoji KATO, PR #8331.
 1.4 14-Aug-1999  tron branches: 1.4.2;
Add support for 3Com 3CXEM556B-INT as suggested by Noriyuki KOIZUMI in
PR kern/8188.
 1.3 29-Dec-1998  marc branches: 1.3.2;
added support for quirks based on cis strings, added quirk entry for SVEC_LANCARD
 1.2 25-Dec-1998  marc initialize a variable to avoid a false compiler warning.
 1.1 24-Dec-1998  marc add quirk support for cards which lie extensively about their CIS
 1.3.2.1 08-Feb-2000  he Pull up revisions 1.4-1.5 (requested by enami):
Add support for 3Com/Megaherz 10/100 Ethernet Modem combined
card (3CCFEM556BI and 3CXEM556B-INT). Should fix PR#8331 and
PR#8188.
 1.4.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.5.2.2 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.5.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.8.2.7 27-Aug-2002  nathanw Catch up to -current.
 1.8.2.6 20-Jun-2002  nathanw Catch up to -current.
 1.8.2.5 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.4 08-Jan-2002  nathanw Catch up to -current.
 1.8.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.8.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.8.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.12.2.4 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.12.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.12.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.12.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.18.10.1 21-Oct-2003  jmc Pullup to rev 1.20 (requested in ticket #699)
Enable support for multi-function pcmcia cards.
 1.18.8.2 29-Aug-2002  gehenna catch up with -current.
 1.18.8.1 20-Jun-2002  gehenna catch up with -current.
 1.20.6.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.20.6.5 02-Nov-2004  skrll Sync with HEAD.
 1.20.6.4 19-Oct-2004  skrll Sync with HEAD
 1.20.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.20.6.1 12-Aug-2004  skrll Sync with HEAD.
 1.24.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.24.4.1 29-Apr-2005  kent sync with -current
 1.25.4.3 26-Feb-2007  yamt sync with head.
 1.25.4.2 30-Dec-2006  yamt sync with head.
 1.25.4.1 21-Jun-2006  yamt sync with head.
 1.26.12.1 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.26.10.1 19-Apr-2006  elad sync with head.
 1.26.8.2 03-Sep-2006  yamt sync with head.
 1.26.8.1 24-May-2006  yamt sync with head.
 1.26.6.1 22-Apr-2006  simonb Sync with head.
 1.26.4.1 09-Sep-2006  rpaulo sync with head
 1.30.40.2 28-Sep-2008  mjf Sync with HEAD.
 1.30.40.1 02-Jun-2008  mjf Sync with HEAD.
 1.31.8.1 18-Jul-2008  simonb Sync with head.
 1.31.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.31.4.1 04-May-2009  yamt sync with head.
 1.32.2.1 19-Oct-2008  haad Sync with HEAD.
 1.33.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.33.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.34.26.1 18-May-2014  rmind sync with head
 1.34.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.34.12.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.35.30.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.6 17-Feb-2001  martin Rename pcmcia_isic.[ch] to i4b_isic_pcmcia.[ch] to better fit in the
grand sheme of names.
 1.5 10-Feb-2001  martin Make pcmcia_isicattach return values the other way round (zero on success,
errno otherwise). Actually use that return value to avoid installing an
interrupt handler (possibly sharing an interrupt with other cards!) and
initialising the softc with bogus/half baked values.
 1.4 03-Feb-2001  martin Stopgap fix: block interrupts in attach routine until handler is
established.

XXX real fix: make enable/disable for real and invoke them when needed.
XXX This has to wait until the layer 1 <-> layer 2 interface is
XXX restructured.
 1.3 19-Jan-2001  martin Add another CIS variant for ELSA mc/isdn card
 1.2 18-Jan-2001  martin Add support for another PCMCIA ISDN card: Sedlbauer speed star II.
While there fix two outdated comments.
 1.1 05-Jan-2001  martin branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jan-2001  martin branches: 1.1.1.1.2;
Initial import of ISDN4BSD release 0.96
 1.1.1.1.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.1.1.1.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.1.1.1.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.1.1.1.2.1 05-Jan-2001  bouyer file pcmcia_isic.c was added on branch thorpej_scsipi on 2001-01-05 17:36:23 +0000
 1.3 17-Feb-2001  martin Rename pcmcia_isic.[ch] to i4b_isic_pcmcia.[ch] to better fit in the
grand sheme of names.
 1.2 18-Jan-2001  martin Add support for another PCMCIA ISDN card: Sedlbauer speed star II.
While there fix two outdated comments.
 1.1 05-Jan-2001  martin branches: 1.1.1;
Initial revision
 1.1.1.1 05-Jan-2001  martin branches: 1.1.1.1.2;
Initial import of ISDN4BSD release 0.96
 1.1.1.1.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.1.1.1.2.3 11-Feb-2001  bouyer Sync with HEAD.
 1.1.1.1.2.2 05-Jan-2001  bouyer Sync with HEAD
 1.1.1.1.2.1 05-Jan-2001  bouyer file pcmcia_isic.h was added on branch thorpej_scsipi on 2001-01-05 17:36:23 +0000
 1.17 26-Jul-2011  dyoung Don't copy iobase and iosize members from pcmciabus_attach_args to the
pcmcia_softc because they're not used in any meaningful way.
 1.16 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.15 26-Jun-2008  drochner branches: 1.15.10;
constify the pcmcia/cardbus method tables
 1.14 19-Oct-2007  ad branches: 1.14.16; 1.14.20; 1.14.22; 1.14.24;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.13 11-Dec-2005  christos branches: 1.13.30; 1.13.44; 1.13.46; 1.13.50;
merge ktrace-lwp.
 1.12 30-May-2005  christos branches: 1.12.2;
- add const
- avoid variable shadow
- do proper UNCONST with XXXUNCONST
 1.11 27-Feb-2005  perry nuke trailing whitespace
 1.10 04-Feb-2005  perry de-__P
 1.9 13-Sep-2004  drochner branches: 1.9.4; 1.9.6;
a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
on "locators.h"
 1.8 11-Aug-2004  mycroft Rather than having a call up from the low-level driver to get the card type,
instead have a call down from the PCMCIA mid-layer to set it. Use this from
pcmcia_function_enable(). (Currently the policy is the same, but this would
allow for more flexibility in deciding which mode to use.)

Now it is safe to hold the socket enabled during attach, so do that. Only
one enable/disable cycle to attach a card now!
 1.7 20-Jun-2004  thorpej Define and use pcmciabuscf_controller as an alias for
cf_loc[PCMCIABUSCF_CONTROLLER] and pcmciabuscf_socket
as an alias for cf_loc[PCMCIABUSCF_SOCKET].
 1.6 15-Dec-2001  soren branches: 1.6.16;
To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.5 13-Jan-2000  joda branches: 1.5.6; 1.5.8;
add flags for memory width
 1.4 15-Oct-1999  haya branches: 1.4.2;
This is the first check-in of CardBus driver. CardBus driver contains
CardBus bus stub, YENTA PCI-CardBus bridge (cbb), 3Com 3C575TX driver
(ex) and Intel fxp driver.

TODO:
o Conform to the KNF more strictly.
o Be unified with pcmcia code as much as possible.
o Add more drivers for CardBus card, such as APA-1480 or USB card.

The affected files are listed below.

sys/arch/i386/conf/files.i386
sys/arch/macppc/conf/files.macppc
sys/conf/files
sys/dev/ic/elinkxl.c
sys/dev/ic/elinkxlvar.h
sys/dev/ic/i82365.c
sys/dev/ic/i82365var.h
sys/dev/isa/i82365_isasubr.c
sys/dev/pci/files.pci
sys/dev/pcmcia/pcmcia.c
sys/dev/pcmcia/pcmciachip.h

The added files are listed below.

sys/arch/i386/conf/CARDBUS
sys/arch/i386/include/rbus_machdep.h
sys/arch/i386/i386/rbus_machdep.c
sys/arch/macppc/include/rbus_machdep.h
sys/arch/macppc/macppc/rbus_machdep.c
sys/dev/cardbus/if_ex_cardbus.c
sys/dev/cardbus/Makefile.cardbusdevs
sys/dev/cardbus/cardbus.c
sys/dev/cardbus/cardbus_map.c
sys/dev/cardbus/cardbusdevs
sys/dev/cardbus/cardbusdevs.h
sys/dev/cardbus/cardbusdevs_data.h
sys/dev/cardbus/cardbusvar.h
sys/dev/cardbus/cardslot.c
sys/dev/cardbus/cardslotvar.h
sys/dev/cardbus/devlist2h.awk
sys/dev/cardbus/files.cardbus
sys/dev/cardbus/if_fxp_cardbus.c
sys/dev/cardbus/pccardcis.h
sys/dev/cardbus/rbus.c
sys/dev/cardbus/rbus.h
sys/dev/pci/pccbb.c
sys/dev/pci/pccbbreg.h
sys/dev/pci/pccbbvar.h
 1.3 17-Nov-1998  thorpej branches: 1.3.10;
Finish implementing interrupt-driven card insertion and removal support.

- Deactivate the card on removal and queue a REMOVAL event for the socket's
event thread to finish the detach.
- Queue an INSERTION event for the socket's event thread on insertion.

Implement a few missing infrastructure pieces to support this.

Hot swapping of PCMCIA cards now "works". (Not quite; things like network
devices need changes for their respestive subsystems. These changes are
coming soon...)
 1.2 16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1 30-Jul-1997  marc branches: 1.1.2;
file pcmciachip.h was initially added on branch marc-pcmcia.
 1.1.2.12 16-Oct-1997  thorpej Copyright/license update.
 1.1.2.11 16-Oct-1997  thorpej Pass down the start and side of the i/o space allocation range to
the "pcmcia" layer so that drivers with Very Special i/o space allocation
needs can know what range they should be dealing with.
 1.1.2.10 16-Oct-1997  enami Define new macro constant PCMCIA_WIDTH_AUTO to indicate auto size
I/O window.
 1.1.2.9 14-Oct-1997  thorpej KNF, RCS IDs.
 1.1.2.8 14-Oct-1997  thorpej Allow the i/o address alignment to be specified in the call to
pcmcia_io_alloc(). If the caller does not care about the alignment, 0
should be passed.
 1.1.2.7 27-Sep-1997  marc add a card_gettype function to the chip->pcmcia interface, and remove
the variable from the card_attach function
 1.1.2.6 23-Aug-1997  thorpej Define chipset-level socket enable/disable entry points.
 1.1.2.5 11-Aug-1997  thorpej Pass the PCMCIA function structure rather than an IRQ mask to the
interrupt establish function.
 1.1.2.4 10-Aug-1997  thorpej Create a structure to encapsulate information about allocated i/o and
mem space on the pcmcia bus. Use this in chip-level window enable
functions rather than making assumptions about the bus space handles.

Also, clean up lots of debugging prints. Use patchables to enable them.
 1.1.2.3 31-Jul-1997  thorpej Pay attention to the "valid IRQ mask" in a device's CIS information.
This adds an additional "irqmask" argument to the chip-level "intr_establish"
functions.
 1.1.2.2 30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.3.10.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.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.5.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.5.6.1 08-Jan-2002  nathanw Catch up to -current.
 1.6.16.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.16.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.16.5 04-Feb-2005  skrll Sync with HEAD.
 1.6.16.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.16.3 18-Sep-2004  skrll Sync with HEAD.
 1.6.16.2 12-Aug-2004  skrll Sync with HEAD.
 1.6.16.1 03-Aug-2004  skrll Sync with HEAD
 1.9.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.6.1 12-Feb-2005  yamt sync with head.
 1.9.4.1 29-Apr-2005  kent sync with -current
 1.12.2.1 27-Oct-2007  yamt sync with head.
 1.13.50.1 25-Oct-2007  bouyer Sync with HEAD.
 1.13.46.1 06-Nov-2007  matt sync with HEAD
 1.13.44.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.13.30.1 23-Oct-2007  ad Sync with head.
 1.14.24.1 27-Jun-2008  simonb Sync with head.
 1.14.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.14.20.2 16-May-2009  yamt sync with head
 1.14.20.1 04-May-2009  yamt sync with head.
 1.14.16.1 29-Jun-2008  mjf Sync with HEAD.
 1.15.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.236 17-Oct-2021  andvar s/Versin/Version/
 1.235 06-Apr-2019  msaitoh s/pcmica/pcmcia/
 1.234 16-Mar-2018  sevan branches: 1.234.2;
Add 3Com Wireless Bluetooth PC Card (version 3.0) 3CRWB6096B
 1.233 16-Mar-2018  sevan typo
 1.232 01-Jun-2016  pgoyette branches: 1.232.16;
Ooopppsss - add it with the correct product ID.
 1.231 01-Jun-2016  pgoyette Add 3Com 3CRWE777A - from OpenBSD
 1.230 23-Aug-2012  kiyohara branches: 1.230.2; 1.230.16;
Add AmbiCom WL54-CF.
 1.229 26-Nov-2011  nonaka Add Corega Ether CF-TD LAN Card.
 1.228 21-Jan-2009  jnemeth branches: 1.228.14;
add a comment explaining how to regenerate pcmicadevs.h and pcmciadevs_data.h
 1.227 06-Sep-2008  rmind branches: 1.227.2;
PR/38382: Jean-Yves Moulin: Support for Sierra Wireless Aircard 850.
 1.226 19-Jun-2008  imp branches: 1.226.2;
Add in OLICOM cards from FreeBSD's pccarddevs table:
GoCard Ethernet (aka OC-2220)
GoCard Combo Eth/Modem 28.8 (aka OC-2231)
GoCard Combo Eth/Modem 33.6 (aka OC-2232)
GoCard Combo Token Ring 16/4 Modem 28.8 (aka OC-3231)
GoCard Combo Token Ring 16/4 Modem 33.6 (aka OC-3232)
 1.225 16-May-2008  jnemeth branches: 1.225.2;
add Corega LAPCCTXD FastEthernet
 1.224 28-Apr-2008  martin branches: 1.224.2;
Remove clause 3 and 4 from TNF licenses
 1.223 22-Sep-2007  kiyohara branches: 1.223.20; 1.223.22; 1.223.24;
Add TDK Bluetooth PC Card.
and reorder.
 1.222 20-Aug-2007  kiyohara branches: 1.222.2;
Add support for AnyCom BlueCard.
 1.221 10-Feb-2007  ichiro branches: 1.221.6; 1.221.14; 1.221.18;
add AirH pcmcia modem.
NEC Infrontia AX420N
 1.220 16-Nov-2006  christos branches: 1.220.2;
add another device.
 1.219 23-Sep-2006  jmcneill PR# 15666: EDIMAX EP-4101 PCMCIA card support (patch included)
 1.218 23-Sep-2006  jmcneill PR# 27840: patch for IO DATA PCET/TX-R PCMCIA Ethernet card support
 1.217 28-Jul-2006  scottr branches: 1.217.4; 1.217.6;
Add Siemens SS1021 WLAN.
 1.216 19-Jun-2006  gdamore Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.) This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
 1.215 23-Mar-2006  christos branches: 1.215.2; 1.215.4;
PR/33133: Dave J. Barnes: Belkin F5D5020 Ethernet PCMCIA card not recognised
 1.214 11-Dec-2005  christos branches: 1.214.4; 1.214.6; 1.214.8; 1.214.10; 1.214.12;
merge ktrace-lwp.
 1.213 07-Nov-2005  tsutsui Fix pp_cisinfo[0] of the TEAC IDECARDII entry.
If pp_cisinfo[0] is NULL, current pcmcia_product_lookup()
never matches the device.
 1.212 06-Jul-2005  dyoung branches: 1.212.2;
Add Alvarion (vendor) and Alvarion Ltd. BreezeNET PC-DS.11b (product).
From PR kern/30231.
 1.211 07-May-2005  martin Add SMC2531W-B EliteConnect Wireless Adapter.
From Matthias Petermann in PR kern/30001.
 1.210 23-Mar-2005  martin From Gabriel Fort�, via Julien Rampon in mail to tech-net:
add Proxim RangeLAN-DS 8430
 1.209 19-Mar-2005  christos PR/29482: Kirk Strauser: Add support for Microsoft MN-520 PCMCIA WLAN card
 1.208 21-Jan-2005  imp branches: 1.208.2; 1.208.6;
Replace NETGEAR_2 with INTERSIL to reflect who actually owns the ID. Add some IDs from FreeBSD
 1.207 10-Aug-2004  mycroft branches: 1.207.4;
Copyright maintenance.
 1.206 10-Aug-2004  mycroft Remove some CIS strings that we don't actually want to match on -- in some
cases they contain minor revision numbers, and one was even someone's MAC
address!
 1.205 10-Aug-2004  mycroft Remove a very silly hack WRT the Digital vendor ID.
 1.204 07-Aug-2004  mycroft Clean up the Lucent (and clone) entries a bit.
Add the Hermes II (doesn't work yet, but it's harmless).
 1.203 06-Aug-2004  mycroft A few things:
* The DEPCM-XX cards don't need to be recognized by OUI or string -- they
work just fine with the IO-DATA PC-LAT/E attachment, and are probable OEM.
So, remove the DEPCM case.
* PCMCIA_STR_* elimination.
* The Megahertz EM3336 is not always an X-Jack device, so take the "XJ" out
of the product number.
 1.202 05-Aug-2004  mycroft Match Spectrum24 by product ID, not string.
 1.201 05-Aug-2004  mycroft Add Asustek WL-100, per PR 26559.
 1.200 17-Jul-2004  mycroft Remove ZONET ZEN.
 1.199 09-Jul-2004  enami Add BUFFALO LPC-CF-CLT Ethernet Adapter.
 1.198 09-Jul-2004  enami Sort BUFFALO entries by id.
 1.197 07-Jul-2004  mycroft Fix a typo.
 1.196 07-Jul-2004  mycroft Add a few more cards.
 1.195 07-Jul-2004  mycroft Add the NextCom Next Hawk.
 1.194 19-Jun-2004  itohy Add corega FEtherII PCC-TXD.
From website of Sano Yukihiko.
 1.193 01-Feb-2004  uwe Add CIS for TAMARACK Ethernet Card (another ne2000 clone).
From PR: 12273 and Mathias Menzel-Nielsen (matze matzsoft de).

While here, sort some stray entries alphabetically.
 1.192 25-Jan-2004  sekiya Add definition for IO-DATA WCF12 wireless CF card and allow the wi driver to
match it. Definition originally from FreeBSD by way of Steve Rumble.
 1.191 28-Dec-2003  itohy - RATOC System Inc. uses the same product ID for many different cards,
so do not define product ID for REX-R280. Use CIS instead.
- Add definition for REX-9530 and REX-CFU1.
- White space police.
 1.190 25-Dec-2003  nonaka Added "corega WLCFL-11" CF size wireless LAN card.
 1.189 07-Dec-2003  ichiro add bluetooth products
Anycom BlueCard LSE041 R1B
Anycom Bluetooth CF Card LSE039
 1.188 07-Nov-2003  hamajima support Corega Ether PCC-TL -- from Yasushi Oshima
 1.187 22-Oct-2003  christos support for NE2000_TYPE_AX88790 from
Yong-Jhen Hong yongjhen at alqualonde dot org
 1.186 16-Sep-2003  onoe Add Sony PEGA-WL110 CF WLAN
 1.185 11-Sep-2003  ichiro add product
Quatech Inc, PCMCIA Enhanced Parallel Port Card
 1.184 26-Jul-2003  martin Add socket communications 10/100 CF ethernet card.
 1.183 02-May-2003  gmcgarry branches: 1.183.2;
Add NTT DoCoMO PALDIO 611S PCMCIA.
From PR#9768.
 1.182 09-Apr-2003  christos A cardflash NE2000 from Michael Francini francini at mindspring dot com.
 1.181 29-Mar-2003  perry support Corega PCCL-11 -- from Christopher SEKIYA in PR 20932
 1.180 27-Mar-2003  ichiro add product TOSHIBA PA2673U CBIDE2 (IODATA OEM)
 1.179 16-Jan-2003  kanaoka Add SMC 8041TX 10/100 Ether PC Card.
 1.178 29-Dec-2002  jdc Add D-Link DWL650H wireless card (a different product than the plain DWL650).
 1.177 15-Sep-2002  bouyer Add ACCTON EN2216-PCMCIA-ETHERNET (there seems to be different variants of
the ACCTON EN2216) to pcmciadevs, and support this adapter by if_ne_pcmcia.
Tested by R�mi Zara <remi_zara@mac.com>.
 1.176 04-Sep-2002  mason Support this device, which is evidently a rebadged GEMTEK WLAN which we
already support under another name:

wi0 at pcmcia0 function 0: NETGEAR MA401RA Wireless PC, Card, ISL37300PEval-RevA
wi0: 802.11 address <whatever>
wi0: using RF:PRISM2.5 MAC:ISL3873B(PCMCIA)
wi0: Intersil Firmware: Primary (1.0.7), Station (1.3.6)
 1.175 23-Jul-2002  rjs Add entries for:

Ositech Seven of Diamonds Ethernet Card
Netgear FA410TX Ethernet Card
 1.174 23-Jul-2002  mjl Add Dynalink L10C as provided by Cliff Albert in PR/17686.
 1.173 17-Jun-2002  martin Add ELSA XI325 Wireless LAN, from Jasper Wallace
 1.172 08-Jun-2002  martin Add ACTIONTEC wireless lan card.
 1.171 03-Jun-2002  jonathan Add device-id for D-Link DFE-670 (10/100 DL10022-like card).
 1.170 01-Jun-2002  itojun new ne0 pcmcia pccard: corega EtherII PCC-TD
PR 17134, From: <fujiwara@f.pyon.org>, Kazunori@netbsd.org, Fujiwara@netbsd.org
 1.169 31-May-2002  mycroft Add a Nortel e-Mobility card.
 1.168 26-May-2002  tshiozak add PLANEX GW-NS11H Wireless LAN PC Card
 1.167 07-May-2002  onoe branches: 1.167.2; 1.167.4;
Add LINKSYS Instant Wireless Network CF Card
 1.166 06-May-2002  chris Add in Netgear FA411.
 1.165 30-Apr-2002  uch add BUFFALO LPC3-CLT Ethernet Adapter
 1.164 10-Apr-2002  ichiro add product Instant Wireless Network PC Card, Version 3
 1.163 04-Mar-2002  martin Add ELSA MicroLink mc all (ISDN + modem) card, OEMd from TDK.
 1.162 31-Jan-2002  is fix typo
 1.161 30-Jan-2002  is Fix typo: ASIX, not AMBIX
 1.160 30-Jan-2002  is Add Lantech Fastnet/TX (really generic ASIX AX88190) card
 1.159 28-Jan-2002  aymeric sort a couple of entries by vendor number.
 1.158 17-Jan-2002  joda add support for Ericsson PRISM2 card (kern/15130)
 1.157 13-Jan-2002  aymeric add Edimax Technology Inc. PCMCIA Ethernet Card
 1.156 29-Dec-2001  pooka Socket Communications Low-Power CF WLAN
 1.155 29-Dec-2001  ichiro add product
IBM Smart Capture Card II
 1.154 23-Dec-2001  ichiro change CIS name
 1.153 18-Dec-2001  ichiro add CIS strings of FUJITSU FMV-181,182,182A
delete ITCFJ182A, because FMV-182[A] ID is same as ITCFJ182A.
 1.152 16-Dec-2001  ichiro add FUJITSU CF EthernetCard
ITCFJ181A
 1.151 04-Dec-2001  christos PR/13711: Peter Seebach: Symbol's Spectrum24 pcmcia/prism2 card isn't probed.
 1.150 27-Nov-2001  enami cvs -q update -j1.147 -j1.148 pcmciadevs
 1.149 26-Nov-2001  yamt add IBM SCSI PCMCIA.
 1.148 26-Nov-2001  ichiro add device: BUFFALO AirStation CFtype WLAN Card
 1.147 19-Nov-2001  imp Merge from FreeBSD:
o Add devices from OpenBSD
o Minor sorting problems in my sorting attempt.
o A few additional -1 vendors for better card pattern generation.
o Add Zoom Air_4000 (needs to be added to awi)
o Add Netgear FA411 info (needs to be added to ne, plus quirks/fixes
to base pccard stuff before it will work).
o Merges through FreeBSD 1.22
 1.146 18-Nov-2001  mrg add entries to allow one to match:
The Linksys Group, Inc., Instant Wireless Network PC Card, ISL37300PRevA
 1.145 08-Nov-2001  christos PR/14503: Cesar Crusius: Add Xircom XE2000.
 1.144 27-Oct-2001  ichiro add ELSA CF wavelan card
XI-800
 1.143 21-Oct-2001  mjl branches: 1.143.2;
Add Corega PCC-TD, as per PR/14161
 1.142 20-Oct-2001  mjl Add Corega PCCB-11, as per PR/14298
 1.141 14-Oct-2001  christos add another cdrom. The box says fujitsu, but the guts seem to be panasonic.
Mmm, inbreeding.
 1.140 09-Oct-2001  imp Sort in a sane way. This file had become somewhat disordered over
time. Vendors are sorted by number. Vendors are grouped
alphabetically, with entries within a vendor's group arranged
numerically. CIS entries sorted alphabetically by identifier.
 1.139 29-Sep-2001  augustss Add Eiger Labs sound card.
 1.138 18-Sep-2001  ichiro fixed typo
 1.137 17-Sep-2001  ichiro add product
GEMTEK CF-size WaveLAN Card based Intersil Prism2.5 Eval-Card
 1.136 17-Sep-2001  ichiro add product
Symbol Spectrum24 LA4100 Series CF-size WaveLAN card
 1.135 21-Aug-2001  pooka branches: 1.135.2;
add vendor Psion and product Psion Gold Card
 1.134 07-Aug-2001  christos Add zonet zen (Henrik Berglund)
 1.133 31-Jul-2001  christos recognize dlink-660+, from jandberg@netbsd.org (Jukka Andberg)
 1.132 09-Jul-2001  itojun branches: 1.132.2;
add product code for 3Com 3CRWE62092A Wireless LAN
(what is the sorting rule for the file?)
 1.131 29-Jun-2001  christos PR/13337: de SAINT LEGER Rodolphe: Add support for the cn40bc ne clone.
 1.130 21-May-2001  ichiro add product COREGA FEther PCC-TXF
 1.129 20-May-2001  ichiro make compile again
(fix warning : missing white space after `#define....)
 1.128 20-May-2001  ichiro add vendorID National Instruments
add productID PCMCIA-GPIB
 1.127 18-May-2001  jhawk Support the Socket EA pcmcia ethernet (ne). It's ooooold.
 1.126 17-May-2001  ichiro add products
Intel PRO/Wireless 2011 LAN PC Card
 1.125 16-May-2001  ichiro add product
BUFFALO AirStation 11Mbps WLAN Card
 1.124 14-May-2001  ichiro add product Corega FEther PCC-TXD
 1.123 06-Apr-2001  onoe Add Cisco Aironet 350 Series
 1.122 18-Mar-2001  ichiro add product I-O DATA WN-B11/PCM wlan
 1.121 19-Feb-2001  aymeric branches: 1.121.2;
Add an entry for the Synergy 21 S21810+
From Stefan Blomen <Stefan.Blomen@gmx.de>
 1.120 13-Feb-2001  thorpej Add a new D-Link ID (they seem to actually have a valid one, now!),
and add the DMF-560TX product.
 1.119 11-Feb-2001  ichiro typo
 1.118 10-Feb-2001  ichiro add some wavelan card
 1.117 29-Jan-2001  ichiro add products
Contec FLEXLAN/FX-DS110-PCC wavelan card
 1.116 28-Jan-2001  ichiro add product id
COMPAQ Wireless Card NC5004(Prism2)
 1.115 23-Jan-2001  tv Re-add $FreeBSD$ RCS Id for the purposes of synchronization tracking.

This is not unprecedented, as we do it in >100 places in the tree.
If you disagree with this philosophy, take it to tech-kern for a discussion
FIRST before reverting; TNF, not one particular person, owns this file.
 1.114 23-Jan-2001  thorpej Add Xircom CreditCard Token Ring II (woo, I found my card!)
 1.113 20-Jan-2001  thorpej There is absolutely no point in having a FreeBSD RCS ID in this file.
 1.112 20-Jan-2001  taca In 1.111
> o Add RATOC REX_R280 card.
Since this already exists in pcmciadevs, delete it for preventing compile error.
 1.111 20-Jan-2001  imp Sync file with FreeBSD 1.8:
o Add NAKAGAWA METAL's LNT-10TN card.
o Add KINGSTON KNE-PC2 ethernet card.
o Add RATOC REX_R280 card.
o Add $FreeBSD$ id.

I've not added these cards the their respective drivers, however.
 1.110 16-Jan-2001  nonaka Add Roland SCP-55
 1.109 11-Jan-2001  ichiro add product
NANOSPEED ROOT-RZ2000 WLAN Card
 1.108 10-Jan-2001  ichiro add EMTAC A2424i 11Mbps WLAN Card
 1.107 20-Dec-2000  haya Add IO Data CBIDE2 ata interface card.
 1.106 20-Dec-2000  jhawk s/NULL}/NULL }/
Did I mention this awk script really sucks?
 1.105 19-Dec-2000  thorpej " " -> "&sp" in two entries, per Rafal Boni.
 1.104 19-Dec-2000  thorpej Add SMC 2632W. From Rafal Boni, kern/11775.
 1.103 08-Dec-2000  drochner add IBM microdrive
 1.102 21-Nov-2000  soren Typo.
 1.101 10-Nov-2000  hubertf Add ELSA WaveLAN card & a noname clone(?)
 1.100 03-Nov-2000  toddpw Add support for Socket Comm. PC Card Ethernet, and tidy up naming.
 1.99 02-Nov-2000  msaitoh add support:
MELCO LPC2-TX
Telecom Device TCD-HPC100
MACNICA ME1-JEIDA
 1.98 24-Aug-2000  imp Sort BAY into numerical order.
 1.97 26-Jul-2000  onoe add Samsung MagicLAN SWL-2000N
 1.96 24-Jul-2000  gmcgarry Add entries for all Xircom ethernet models.
 1.95 18-Jul-2000  onoe Add Farallon SkyLINE 11mb card as Intersil Prism2
vendor:product of the card is Lucent:WaveLAN, and CIS string shows
"INTERSIL" "HFA384x/IEEE"...
 1.94 30-Jun-2000  joda add 3Com 3CRWE737A (AirConnect)
 1.93 13-Jun-2000  soren branches: 1.93.2;
Include vendor name for IBM products.
 1.92 09-Jun-2000  onoe Add Farallon SkyLINE Wireless LAN Card for awi(4) driver.
Tested on FreeBSD 3.4-RELEASE by Dirk-Willem van Gulik <dirkx@webweaving.org>.
 1.91 06-Jun-2000  soren Add Olicom GoCard.
 1.90 05-Jun-2000  gmcgarry - Clean up XIRCOM entries
- Add entry for Xircom CreditCard Ethernet + Modem 28
- Add entry for Intel EtherExpress PRO/100
- Add entry for Compaq Netelligent 10/100 Ethernet
 1.89 11-May-2000  is branches: 1.89.2;
RATOC REX-R280 (another if_mbe_pcmcia card) support by UCHIYAMA Yasushi.
Originally part of pr 6789, reworked by the submitter to fit into -current.
 1.88 17-Apr-2000  joda Panasonic KXLC003
 1.87 12-Apr-2000  scw Add support for the SOHOware PCMCIA Ethernet card, model ND5100-E.
This seems to be a re-badged NDC (National Datacomms. Corp) card.
It needs a quirk entry due to lack of manufacturer tuple in the CIS.
For some reason, the 'Tx/Rx' LED on the connector module is inverted
such that it is off during network activity...
 1.86 26-Mar-2000  itojun add CIS for Corega Wireless LAN PCC-11 (no driver support yet)
 1.85 22-Mar-2000  mycroft Add the Nokia C020 WLAN card.
(`Guess who Charles works for...')
 1.84 20-Mar-2000  tron Add support for RPTI-EP400 PCMCIA network adapter. Patches supplied by
Tim Walls in PR kern/9644.
 1.83 18-Mar-2000  mycroft Add the Panasonic 4X CD-ROM Interface CArd.
 1.82 16-Mar-2000  onoe cards for if_awi:
Add AirSurfer Pro
Change the name for AMD Am79C930. The same CIS strings are used
both for Melco WLI-PCM and NTT-EL SS Magic.
 1.81 13-Mar-2000  cgd Add 3com Megahertz 3C1 10Mbps LAN CF+ Card
 1.80 27-Feb-2000  uch Add Billionton Systems Inc. LNT-10TN NE2000 Compatible card.
 1.79 09-Feb-2000  enami Add an entry for Planex FNW-3700-T.
 1.78 09-Feb-2000  enami Add an entry for Melco LPC3-TX.
 1.77 09-Feb-2000  enami Add an entry for Xircom CompactCard Ethernet CFE-10.
 1.76 03-Feb-2000  enami Add an entry for Icom WAVEMASTER SL-200.
 1.75 01-Feb-2000  enami Add an entry for Melco WLI PCM (but driver isn't available yet).
 1.74 01-Feb-2000  enami Print more detailed name for Corega ethernet cards.
 1.73 26-Jan-2000  thorpej Add the Linksys Etherfast.
 1.72 25-Jan-2000  soren Add Lexar Media CF.
 1.71 25-Jan-2000  thorpej Fix a typo.
 1.70 25-Jan-2000  mycroft Use the Ethernet vendor ID to differentiate multiple cards with the same
vendor,product pair. (Yuck.)
 1.69 25-Jan-2000  jlam Fix product code for Aironet PC4800. Should be 0x0007.
 1.68 25-Jan-2000  sommerfeld Add ID for BayStack 660 (DS version of 650)
 1.67 23-Jan-2000  chopps WebGear->Raytheon
 1.66 18-Jan-2000  jlam Add Aironet Wireless Communications' vendor and product codes.
 1.65 09-Jan-2000  joda add vendor-ids for Intel, Xircom, and Compaq (2) -- from Free/OpenBSD
 1.64 08-Jan-2000  augustss Add EXP Computer Inc. PCMCIA controller.
From Brad Spencer <brad@anduin.eldar.org> in PR 9140.
 1.63 23-Dec-1999  augustss Add the WebGear Aviator2.4 card. No driver yet, though. :(
 1.62 05-Dec-1999  danw add Epson EEN10B ethernet
 1.61 29-Nov-1999  itojun improve cnw driver, looking at bsdi/freebsd-pao cnw driver by wide+prb@bsdi.
- implement ioctls compatible with bsdi/freebsd-pao. stat type is
changed from u_int to u_quad_t to avoid overflows. now it is possible
to switch domain/encryption key from the userland, using cnwctl(8).
- implement multicast/promiscuous mode. tested with IPv6.
 1.60 29-Nov-1999  jun Support for TDK LAC-CF010
by Ichiro Fukuhara (ichiro@ichiro.org) on kern/8900
ichiro test TDK CF Card on Opensource matsuri,tokyo and send patch to us.
thanx.
 1.59 27-Nov-1999  soren IBM cards update.
 1.58 26-Nov-1999  soren Add two 3Com modems.
 1.57 20-Nov-1999  jtk add Xircom CE3 10/100 Ethernet
 1.56 06-Nov-1999  enami branches: 1.56.2;
Support an earlier version of IO-DATA PCLA/T.
 1.55 28-Oct-1999  sommerfeld Add BayStack 650 802.11 FH card
 1.54 28-Oct-1999  jun add
SOCKET LOW POWER ETHERNET Compact Flash Card.
 1.53 28-Oct-1999  jun add entry Corega PCC-TX PCMCIA card.
 1.52 28-Oct-1999  jun Sorry backout Patch about COREGA FAST_ETHER_PCC_TX.
 1.51 28-Oct-1999  jun add Corega PCC-TX PCMCIA Card (not CardBus but 100Base-TX) Entry.
 1.50 27-Oct-1999  is Yet another Fujitsu Ethernet card.
Contributed by HEO SeonMeyong in PR 8658.
 1.49 11-Oct-1999  thorpej branches: 1.49.2; 1.49.4;
Add 3Com/Megahertz 3CCFEM556BI 10/100 Ethernet/Modem. From Ryoji KATO,
PR #8331.
 1.48 27-Sep-1999  enami branches: 1.48.2;
Oops, s/FMW/FNW/g.
 1.47 27-Sep-1999  enami Add entry for Planex Communications Inc. FMW-3600-T.
 1.46 25-Sep-1999  enami Add support for Corega EthernetII PCC T. This diff is submitted
as PR#8485 by HEO SeonMeyong.
 1.45 09-Sep-1999  is Ambicom support by Vincent Aymeric
 1.44 07-Sep-1999  soren Match 1460 names with Adaptec.
 1.43 24-Aug-1999  tron Add Allied Telesis LA-PCM (NE2000 compatible) and Contec C-NET(PC)C
(MB8696x based) pcmcia ethernet cards. Patches supplied by
Kawamoto Yosihisa in PR kern/8260 and kern/8261.
 1.42 14-Aug-1999  tron Add support for 3Com 3CXEM556B-INT as suggested by Noriyuki KOIZUMI in
PR kern/8188.
 1.41 06-Aug-1999  cgd add an entry for the IBM EtherJet Ethernet PC Card (cs8920 based)
 1.40 22-Jul-1999  hwr Insert a space in New Media Corporation. Fixes kern/7817 by Lloyd Parkes.
 1.39 14-Jul-1999  sommerfeld Add a few 802.11 cards
 1.38 23-Jun-1999  mjl Corrected tyop.
 1.37 23-Jun-1999  mjl Add manufacturer Lasat Communications A/S, product Lasat Credit 288 Modem.
 1.36 19-Jun-1999  mjl Added NewMedia BusToaster SCSI Host Adapter
 1.35 24-May-1999  christos Fix PR/7634 properly, by adding the card to pcmciadevs
 1.34 27-Apr-1999  thorpej Add the Fujitsu LA501 Ethernet card. PR #6524, Stephen Ma.
 1.33 19-Feb-1999  abs branches: 1.33.2;
Add ID for IBM 'PCMCIA Portable CD-ROM Drive'. We only have one of these and it
may be broken (it choked under Windows), but it at least now probes.
 1.32 19-Feb-1999  nathanw Fix typo.
XXX fix Makefile.pcmciadevs to catch this sort of thing.
 1.31 19-Feb-1999  nathanw Add Fujitsu SCSI 600 card
 1.30 01-Jan-1999  christos Add Xircom Netwave driver from Michael Eriksson
 1.29 29-Dec-1998  marc add SVEC losing ethernet card
 1.28 24-Dec-1998  marc add product id for 3Com/Megahertz 3CXEM556
 1.27 20-Dec-1998  nathanw Add IBM Wireless LAN Entry and Xircom CreditCard Ethernet+Modem.
 1.26 19-Dec-1998  nathanw Add original Xircom CreditCard Ethernet.
 1.25 18-Dec-1998  thorpej Oops, tyop.
 1.24 18-Dec-1998  thorpej Add the Compex vendor ID, and product ID for the Compex Linkport ENET-B.
PR #6349, Ingolf Koch.
 1.23 18-Dec-1998  thorpej Add the SVEC/Hawking Tech. combo card. PR #6461, Rafal Boni.
 1.22 18-Dec-1998  thorpej Add Corega vendor ID and product CIS info for the PCC-T Ethernet card.
PR #6603, Takahiro Kambe.
 1.21 04-Nov-1998  itohy (manufacturer, product) = (0x149, 0x265) is used both
"Linksys EthernetCard" and some new versions of "D-Link DE-650".
Changed the product string as such.
 1.20 27-Oct-1998  thorpej Product ID for Xircom CreditCard CE2 10base-T Ethernet.
 1.19 08-Oct-1998  thorpej Correct product ID for Socket Communications Dual Serial Adapter.
 1.18 08-Oct-1998  thorpej Add Megahertz X-JACK 56kbps Modem, from Johnny C. Lam, PR #6173.
 1.17 07-Oct-1998  jtk update for a broken variant of the Linksys E-CARD
 1.16 20-Sep-1998  dbj Added support for a Dayna Communicard E that probes with a
different product id (0x2f) than the one we had (0x2d)
 1.15 10-Sep-1998  kenh Reorganize the probe routine and add a quirk table. Much of this code
comes from Enami Tsugutomo (enami@but-b.or.jp). Also add a couple more
devices to the pcmcia devices table.
 1.14 05-Sep-1998  christos Assign copyright to TNF.
 1.13 17-Aug-1998  thorpej Add product ID for the 3Com 3c574-TX 10/100Mbps Ethernet, provided
by Laine Stump.
 1.12 15-Aug-1998  thorpej Consolidate the Socket products, pointed out by Nathan Williams.
 1.11 15-Aug-1998  thorpej Oops, that Socket Communications vendor ID was redundant. Sort the vendors
so I won't make that mistake again.
 1.10 15-Aug-1998  thorpej Oops, that SMC product ID is actually for the 8016 EtherCard. *sigh*
 1.9 15-Aug-1998  thorpej Add SMC vendor ID, and SMC 8020BT EtherEZ product ID.
 1.8 15-Aug-1998  thorpej Add the Trust Combo EthernetCard product ID, from Dante Profeta.
 1.7 15-Aug-1998  thorpej Add vendor ID for Socket Communications, and product ID for the
Socket Communcations Dual RS232 card.
 1.6 15-Aug-1998  thorpej Add the D-Link DE-660. From Tero Kivinen <kivinen@ssh.fi>, PR #5691.
 1.5 14-Aug-1998  thorpej Add vendor ID for NewMedia Corporation, and product ID for NewMedia
BASICS Ethernet. From Stefan Grefen, PR 5902.
 1.4 30-Jul-1998  thorpej Add Simple Technology vendor ID, and Simple Technology Communcator 28.8
product ID.
 1.3 22-Jul-1998  christos branches: 1.3.2;
Don't print bogus info about vendors in pcmciadevs_data.h
(Reported by John Kohl)
 1.2 20-Jul-1998  christos Remove duplicate DEC card
 1.1 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.3.2.1 08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.33.2.3 11-May-2000  he Pull up revision 1.39 (requested by jhawk):
Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.
 1.33.2.2 08-Feb-2000  he Pull up revisions 1.42 and 1.49 (requested by enami):
Add support for 3Com/Megaherz 10/100 Ethernet Modem combined
card (3CCFEM556BI and 3CXEM556B-INT). Should fix PR#8331 and
PR#8188.
 1.33.2.1 27-Apr-1999  perry branches: 1.33.2.1.2; 1.33.2.1.4;
pullup 1.33->1.34 (thorpej): Add Fujitsu LA501 (PR6524, Stephen Ma)
 1.33.2.1.4.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.33.2.1.2.3 02-Aug-1999  thorpej Update from trunk.
 1.33.2.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.33.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.48.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.49.4.1 15-Nov-1999  fvdl Sync with -current
 1.49.2.9 21-Apr-2001  bouyer Sync with HEAD
 1.49.2.8 27-Mar-2001  bouyer Sync with HEAD.
 1.49.2.7 12-Mar-2001  bouyer Sync with HEAD.
 1.49.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.49.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.49.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.49.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.49.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.49.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.56.2.2 06-Nov-1999  enami Support an earlier version of IO-DATA PCLA/T.
 1.56.2.1 06-Nov-1999  enami file pcmciadevs was added on branch comdex-fall-1999 on 1999-11-06 00:58:33 +0000
 1.89.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.93.2.8 14-Feb-2002  he Pull up revision 1.134,1.157 (via patch, requested by aymeric):
Add support for the following cards:
o Edimax Technology Inc. EP4000A
o Linksys Etherfast clone (Level One)
o Zonet Zen
 1.93.2.7 16-Jun-2001  he Pull up revision 1.111 (partial, via patch, requested by toddpw):
Add support for ``Kingston KNE-PC2 Ethernet'' pcmcia cards.
 1.93.2.6 26-May-2001  he Pull up revision 1.127 (requested by jhawk):
Support the Socket EA pcmcia ethernet cards.
 1.93.2.5 04-Apr-2001  he Pull up revision 1.100 (requested by toddpw):
Add support for the Socket Communications LP-E Type II PCMCIA
NE2000 clone card.
 1.93.2.4 16-Mar-2001  he Pull up revision 1.121 (via patch, requested by aymeric):
Add an entry and support for the Synergy 21 S21810+.
 1.93.2.3 09-Aug-2000  gmcgarry Pull up rev 1.96:

Add entries for all Xircom ethernet models.
 1.93.2.2 21-Jul-2000  onoe Pullup 802.11 stuff (approved by jhawk)
- add support for Corega Wireless LAN PCC-11, and Faralon SkyLINE 11Mb
to wi driver.
syssrc/sys/dev/pcmcia/pcmciadevs 1.95
syssrc/sys/dev/pcmcia/pcmciadevs.h 1.94
syssrc/sys/dev/pcmcia/pcmciadevs_data.h 1.94
syssrc/sys/dev/pcmcia/if_wi.c 1.24
syssrc/sys/dev/pcmcia/if_wivar.h 1.11
 1.93.2.1 03-Jul-2000  thorpej Pull up rev. 1.94:
add 3Com 3CRWE737A (AirConnect)
 1.121.2.16 17-Jan-2003  thorpej Sync with HEAD.
 1.121.2.15 29-Dec-2002  thorpej Sync with HEAD.
 1.121.2.14 17-Sep-2002  nathanw Catch up to -current.
 1.121.2.13 01-Aug-2002  nathanw Catch up to -current.
 1.121.2.12 20-Jun-2002  nathanw Catch up to -current.
 1.121.2.11 17-Apr-2002  nathanw Catch up to -current.
 1.121.2.10 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.121.2.9 28-Feb-2002  nathanw Catch up to -current.
 1.121.2.8 08-Jan-2002  nathanw Catch up to -current.
 1.121.2.7 14-Nov-2001  nathanw Catch up to -current.
 1.121.2.6 22-Oct-2001  nathanw Catch up to -current.
 1.121.2.5 08-Oct-2001  nathanw Catch up to -current.
 1.121.2.4 21-Sep-2001  nathanw Catch up to -current.
 1.121.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.121.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.121.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.132.2.8 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.132.2.7 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.132.2.6 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.132.2.5 16-Mar-2002  jdolecek Catch up with -current.
 1.132.2.4 11-Feb-2002  jdolecek Sync w/ -current.
 1.132.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.132.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.132.2.1 03-Aug-2001  lukem update to -current
 1.135.2.2 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.135.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.143.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.167.4.6 19-Nov-2002  tron Pull up revision 1.176 (requested by abs in ticket #971):
Support this device, which is evidently a rebadged GEMTEK WLAN which we
already support under another name:
wi0 at pcmcia0 function 0: NETGEAR MA401RA Wireless PC, Card, ISL37300PEval-RevA
wi0: 802.11 address <whatever>
wi0: using RF:PRISM2.5 MAC:ISL3873B(PCMCIA)
wi0: Intersil Firmware: Primary (1.0.7), Station (1.3.6)
 1.167.4.5 18-Sep-2002  thorpej pullup-1-6 ticket #829, bouyer@antioche.eu.org.

1.95 -> 1.96 syssrc/sys/dev/pcmcia/if_ne_pcmcia.c
1.176 -> 1.177 syssrc/sys/dev/pcmcia/pcmciadevs

Original log message:

Add ACCTON EN2216-PCMCIA-ETHERNET (there seems to be different variants of
the ACCTON EN2216) to pcmciadevs, and support this adapter by if_ne_pcmcia.
Tested by R�mi Zara <remi_zara@mac.com>.
 1.167.4.4 18-Jun-2002  lukem Pull up revision 1.173 (requested by martin in ticket #295):
Add ELSA XI325 Wireless LAN, from Jasper Wallace
 1.167.4.3 11-Jun-2002  lukem Pull up revision 1.171 (requested by jonathan in ticket #146):
Add support for the D-Link DFE-670TXD pcmcia card.
 1.167.4.2 10-Jun-2002  tv Pull up revision 1.172 (requested by martin in ticket #215):
Add ACTIONTEC wireless lan card.
 1.167.4.1 31-May-2002  tv Pull up revision 1.169 (requested by mycroft in ticket #108):
Support Nortel e-Mobility cards.
 1.167.2.3 29-Aug-2002  gehenna catch up with -current.
 1.167.2.2 20-Jun-2002  gehenna catch up with -current.
 1.167.2.1 30-May-2002  gehenna Catch up with -current.
 1.183.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.183.2.6 01-Apr-2005  skrll Sync with HEAD.
 1.183.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.183.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.183.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.183.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.183.2.1 03-Aug-2004  skrll Sync with HEAD
 1.207.4.1 29-Apr-2005  kent sync with -current
 1.208.6.7 31-Jul-2006  tron Pull up following revision(s) (requested by scottr in ticket #1436):
sys/dev/pcmcia/pcmciadevs: revision 1.217 via patch
sys/dev/pcmcia/if_wi_pcmcia.c: revision 1.69 via patch
Add Siemens SS1021 WLAN.
 1.208.6.6 28-Jul-2006  tron Backout commit which went into the wrong branch accidentally.
 1.208.6.5 28-Jul-2006  scottr Regenerate headers, this time with correct rcsid
 1.208.6.4 09-Nov-2005  tron Pull up following revision(s) (requested by tsutsui in ticket #945):
sys/dev/pcmcia/pcmciadevs: revision 1.213
Fix pp_cisinfo[0] of the TEAC IDECARDII entry.
If pp_cisinfo[0] is NULL, current pcmcia_product_lookup()
never matches the device.
 1.208.6.3 07-May-2005  tron Pull up revision 1.211 (requested by martin in ticket #260):
Add SMC2531W-B EliteConnect Wireless Adapter.
From Matthias Petermann in PR kern/30001.
 1.208.6.2 07-May-2005  tron Restore file which was deleted by accident because of a CVS glitch.
 1.208.6.1 07-May-2005  tron Pull up revision 1.211 (requested by martin in ticket #260):
Add SMC2531W-B EliteConnect Wireless Adapter.
From Matthias Petermann in PR kern/30001.
 1.208.2.1 26-Mar-2005  yamt sync with head.
 1.212.2.5 27-Oct-2007  yamt sync with head.
 1.212.2.4 03-Sep-2007  yamt sync with head.
 1.212.2.3 26-Feb-2007  yamt sync with head.
 1.212.2.2 30-Dec-2006  yamt sync with head.
 1.212.2.1 21-Jun-2006  yamt sync with head.
 1.214.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.214.10.1 19-Apr-2006  elad sync with head.
 1.214.8.3 11-Aug-2006  yamt sync with head
 1.214.8.2 26-Jun-2006  yamt sync with head.
 1.214.8.1 01-Apr-2006  yamt sync with head.
 1.214.6.1 22-Apr-2006  simonb Sync with head.
 1.214.4.1 09-Sep-2006  rpaulo sync with head
 1.215.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.215.2.1 22-Jun-2006  chap Complete a sync sys/ with head.
 1.217.6.2 10-Dec-2006  yamt sync with head.
 1.217.6.1 22-Oct-2006  yamt sync with head
 1.217.4.1 18-Nov-2006  ad Sync with head.
 1.220.2.1 14-Nov-2012  riz Pull up following revision(s) (requested by jnemeth in ticket #1467):
sys/dev/pcmcia/pcmciadevs: revision 1.225
sys/dev/pcmcia/if_ne_pcmcia.c: revision 1.155
add Corega LAPCCTXD FastEthernet
added Corega LAPCCTXT FastEthernet
 1.221.18.2 02-Oct-2007  joerg Sync with HEAD.
 1.221.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.221.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.221.6.2 09-Oct-2007  ad Sync with head.
 1.221.6.1 20-Aug-2007  ad Sync with HEAD.
 1.222.2.1 06-Nov-2007  matt sync with HEAD
 1.223.24.2 04-May-2009  yamt sync with head.
 1.223.24.1 16-May-2008  yamt sync with head.
 1.223.22.1 18-May-2008  yamt sync with head.
 1.223.20.3 28-Sep-2008  mjf Sync with HEAD.
 1.223.20.2 29-Jun-2008  mjf Sync with HEAD.
 1.223.20.1 02-Jun-2008  mjf Sync with HEAD.
 1.224.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.224.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.225.2.1 27-Jun-2008  simonb Sync with head.
 1.226.2.1 19-Oct-2008  haad Sync with HEAD.
 1.227.2.1 03-Mar-2009  skrll Sync with HEAD.
 1.228.14.2 30-Oct-2012  yamt sync with head
 1.228.14.1 17-Apr-2012  yamt sync with head
 1.230.16.1 09-Jul-2016  skrll Sync with HEAD
 1.230.2.1 03-Dec-2017  jdolecek update from HEAD
 1.232.16.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.234.2.1 10-Jun-2019  christos Sync with HEAD
 1.235 17-Oct-2021  andvar regen
 1.234 16-Mar-2018  sevan regen
 1.233 01-Jun-2016  pgoyette branches: 1.233.16;
Regen
 1.232 23-Aug-2012  kiyohara branches: 1.232.2; 1.232.16;
Regen.
 1.231 26-Nov-2011  nonaka regen.
 1.230 06-Sep-2008  rmind branches: 1.230.28;
Regen.
 1.229 19-Jun-2008  imp branches: 1.229.2;
Sync to pcmciadevs 1.226
 1.228 16-May-2008  jnemeth branches: 1.228.2;
regen for Corega LAPCCTXD FastEthernet
 1.227 28-Apr-2008  martin branches: 1.227.2;
Remove clause 3 and 4 from TNF licenses
 1.226 22-Sep-2007  kiyohara branches: 1.226.20; 1.226.22; 1.226.24;
Regen.
 1.225 20-Aug-2007  kiyohara branches: 1.225.2;
Regen.
 1.224 10-Feb-2007  ichiro branches: 1.224.6; 1.224.14; 1.224.18;
regen.
 1.223 16-Nov-2006  christos branches: 1.223.2;
regen
 1.222 23-Sep-2006  jmcneill Regen for PR# 15666.
 1.221 23-Sep-2006  jmcneill Regen for PR# 27840.
 1.220 28-Jul-2006  scottr branches: 1.220.4; 1.220.6;
Regenerate with correct rcsids
 1.219 28-Jul-2006  scottr Add Siemens SS1021 WLAN.
 1.218 19-Jun-2006  gdamore Regen pcmciadevs. Sorry.
 1.217 23-Mar-2006  christos branches: 1.217.2; 1.217.4;
Regen
 1.216 11-Dec-2005  christos branches: 1.216.4; 1.216.6; 1.216.8; 1.216.10; 1.216.12;
merge ktrace-lwp.
 1.215 07-Nov-2005  tsutsui Regen from pcmciadevs rev 1.213:
> Fix pp_cisinfo[0] of the TEAC IDECARDII entry.
> If pp_cisinfo[0] is NULL, current pcmcia_product_lookup()
> never matches the device.
 1.214 06-Jul-2005  dyoung branches: 1.214.2;
Regen.
 1.213 07-May-2005  martin Regen.
 1.212 23-Mar-2005  martin Regen (Proxim RangeLAN-DS 8430 added)
 1.211 19-Mar-2005  christos Regen
 1.210 27-Feb-2005  perry branches: 1.210.2;
regen
 1.209 21-Jan-2005  imp branches: 1.209.2;
Update to using new INTERSIL names, plus a couple generic entries from FreeBSD
 1.208 10-Aug-2004  mycroft branches: 1.208.4;
Regen.
 1.207 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.206 10-Aug-2004  mycroft Regen.
 1.205 07-Aug-2004  mycroft Regen.
 1.204 06-Aug-2004  mycroft Regen.
 1.203 05-Aug-2004  mycroft Regen.
 1.202 05-Aug-2004  mycroft Regen.
 1.201 17-Jul-2004  mycroft Regen.
 1.200 09-Jul-2004  enami Regen.
 1.199 07-Jul-2004  mycroft Regen.
 1.198 07-Jul-2004  mycroft Regen.
 1.197 07-Jul-2004  mycroft Regen.
 1.196 19-Jun-2004  itohy Regen from pcmciadevs rev 1.194.
 1.195 01-Feb-2004  uwe Regen for TAMARAC Ethernet card.
 1.194 25-Jan-2004  sekiya Regen.
 1.193 28-Dec-2003  itohy Regen from pcmciadevs rev 1.191.
 1.192 25-Dec-2003  nonaka regen.
 1.191 07-Dec-2003  ichiro regen.
 1.190 07-Nov-2003  wiz regen, so "generated from" line is correct.
 1.189 07-Nov-2003  hamajima support Corega Ether PCC-TL -- from Yasushi Oshima
 1.188 22-Oct-2003  christos Regen
 1.187 16-Sep-2003  onoe regen: Add Sony PEGA-WL110 CF WLAN
 1.186 11-Sep-2003  ichiro regen.
 1.185 26-Jul-2003  martin Regen (added socket communications 10/100 CF ethernet card)
 1.184 02-May-2003  gmcgarry branches: 1.184.2;
Regen: NTT DoCoMO PALDIO 611S PCMCIA
 1.183 09-Apr-2003  christos regen
 1.182 29-Mar-2003  perry regen
 1.181 27-Mar-2003  ichiro regen
 1.180 16-Jan-2003  kanaoka Regen. Add SMC 8041TX 10/100 Ether PC Card.
 1.179 29-Dec-2002  jdc Regenerate (DWL650H addition).
 1.178 15-Sep-2002  bouyer Regen: add ACCTON EN2216.
 1.177 04-Sep-2002  mason Commit with correct RCS IDs in these files - hadn't looked into them
previously to note that they reference the RCS ID in "pcmciadevs".
Hence, committed versions which incorrectly pointed back to the RCS ID
of the "pcmciadevs" that existed prior to my addition. Corrected in this
commit.
 1.176 04-Sep-2002  mason Support this device, which is evidently a rebadged GEMTEK WLAN which we
already support under another name:

wi0 at pcmcia0 function 0: NETGEAR MA401RA Wireless PC, Card, ISL37300PEval-RevA
wi0: 802.11 address <whatever>
wi0: using RF:PRISM2.5 MAC:ISL3873B(PCMCIA)
wi0: Intersil Firmware: Primary (1.0.7), Station (1.3.6)
 1.175 23-Jul-2002  rjs Regenerate.
 1.174 23-Jul-2002  mjl Regen for Dynalink L10C
 1.173 17-Jun-2002  martin Regen (XI325 Wireless LAN added)
 1.172 08-Jun-2002  martin Regen (ACTIONTEC wireless lan card added)
 1.171 03-Jun-2002  jonathan Regen from pcmciadevs 1.171 after adding D-link DFE-670 ethernet card.
 1.170 01-Jun-2002  itojun regen
 1.169 31-May-2002  mycroft Regen.
 1.168 26-May-2002  tshiozak add PLANEX GW-NS11H Wireless LAN PC Card.
 1.167 07-May-2002  onoe branches: 1.167.2; 1.167.4;
regen: Add LINKSYS Instant Wireless Network CF Card
 1.166 06-May-2002  chris Regenerate for Netgear FA411.
 1.165 30-Apr-2002  uch regen.
 1.164 10-Apr-2002  ichiro regen
 1.163 10-Mar-2002  martin Regen (seems I forgot that after TDK/Elsa ISDN MCall addition)
 1.162 04-Mar-2002  martin regen (ELSA MicroLink mc all added)
 1.161 01-Feb-2002  is regenerate: fix typo in card name string.
 1.160 30-Jan-2002  is Fix typo: ASIX, not AMBIX
 1.159 30-Jan-2002  is Add Lantech Fastnet/TX (really generic ASIX AX88190) card
 1.158 17-Jan-2002  joda add support for Ericsson PRISM2 card (kern/15130)
 1.157 13-Jan-2002  aymeric regen
 1.156 29-Dec-2001  pooka regen
 1.155 29-Dec-2001  ichiro regen
 1.154 23-Dec-2001  ichiro regen
 1.153 18-Dec-2001  ichiro regen
 1.152 16-Dec-2001  ichiro regen
 1.151 04-Dec-2001  christos Regen.
 1.150 27-Nov-2001  enami Regen.
 1.149 26-Nov-2001  yamt - regen for IBM SCSI PCMCIA.
 1.148 26-Nov-2001  ichiro regen
 1.147 19-Nov-2001  imp regenerate for 1.147
 1.146 18-Nov-2001  mrg regen
 1.145 08-Nov-2001  christos Regen.
 1.144 27-Oct-2001  ichiro regen
 1.143 21-Oct-2001  mjl branches: 1.143.2;
Regen
 1.142 20-Oct-2001  mjl Regen.
 1.141 14-Oct-2001  christos Regen.
 1.140 09-Oct-2001  imp Resync after the sort
 1.139 29-Sep-2001  augustss Regen.
 1.138 18-Sep-2001  ichiro regen
 1.137 17-Sep-2001  ichiro regen
 1.136 17-Sep-2001  ichiro regen
 1.135 21-Aug-2001  pooka branches: 1.135.2;
regen: psion gold card
 1.134 07-Aug-2001  christos regen
 1.133 31-Jul-2001  christos regen.
 1.132 09-Jul-2001  itojun branches: 1.132.2;
regen
 1.131 29-Jun-2001  christos regen
 1.130 21-May-2001  ichiro regen
 1.129 20-May-2001  ichiro delete RCS Id from pcmciadevs rev 1.128
 1.128 20-May-2001  ichiro make compile again
(fix warning : missing white space after `#define....)
 1.127 20-May-2001  ichiro regen
 1.126 18-May-2001  jhawk Regen
 1.125 17-May-2001  ichiro regen
 1.124 16-May-2001  ichiro regen
 1.123 14-May-2001  ichiro regen
 1.122 06-Apr-2001  onoe regen: add Cisco Aironet 350 Series.
 1.121 18-Mar-2001  ichiro regen
 1.120 19-Feb-2001  aymeric branches: 1.120.2;
regen
 1.119 13-Feb-2001  thorpej Regen; D-Link DMF-560TX.
 1.118 11-Feb-2001  ichiro regen
 1.117 10-Feb-2001  ichiro regen
 1.116 29-Jan-2001  ichiro regen
 1.115 28-Jan-2001  ichiro regen.
 1.114 23-Jan-2001  tv Regen.
 1.113 23-Jan-2001  thorpej Regen; added Xircom CreditCard Token Ring II.
 1.112 20-Jan-2001  thorpej Regen; there is absolutely no point in having a FreeBSD RCS ID in this file.
 1.111 20-Jan-2001  taca Regen.
 1.110 20-Jan-2001  imp Sync to pcmicadevs 1.111
 1.109 16-Jan-2001  nonaka regen
 1.108 11-Jan-2001  ichiro regen
 1.107 10-Jan-2001  ichiro regen.
 1.106 20-Dec-2000  haya regen.
 1.105 20-Dec-2000  sommerfeld Regen, because jhawk didn't
 1.104 19-Dec-2000  thorpej Regen.
 1.103 19-Dec-2000  thorpej Regen; add SMC 2632W.
 1.102 08-Dec-2000  drochner regen
 1.101 21-Nov-2000  soren Regen.
 1.100 10-Nov-2000  hubertf Regen for ELSA WaveLan IDs
 1.99 03-Nov-2000  toddpw Add support for Socket Comm. PC Card Ethernet, and tidy up naming.
 1.98 02-Nov-2000  msaitoh regen
 1.97 24-Aug-2000  imp Sync to 1.98 of pcmciadevs
 1.96 26-Jul-2000  onoe add Samsung MagicLAN SWL-2000N
 1.95 24-Jul-2000  gmcgarry Regen.
 1.94 18-Jul-2000  onoe Add Farallon SkyLINE 11mb card as Intersil Prism2
vendor:product of the card is Lucent:WaveLAN, and CIS string shows
"INTERSIL" "HFA384x/IEEE"...
 1.93 30-Jun-2000  joda regen
 1.92 13-Jun-2000  soren branches: 1.92.2;
Regen.
 1.91 09-Jun-2000  onoe Add Farallon SkyLINE Wireless LAN Card for awi(4) driver.
Tested on FreeBSD 3.4-RELEASE by Dirk-Willem van Gulik <dirkx@webweaving.org>.
 1.90 05-Jun-2000  gmcgarry Regen.
 1.89 11-May-2000  is branches: 1.89.2;
RATOC REX-R280 (another if_mbe_pcmcia card) support by UCHIYAMA Yasushi.
Originally part of pr 6789, reworked by the submitter to fit into -current.
 1.88 17-Apr-2000  joda regen
 1.87 12-Apr-2000  scw Regen
 1.86 26-Mar-2000  itojun regen (sorry forgot to do separate commit for them)
 1.85 26-Mar-2000  itojun add CIS for Corega Wireless LAN PCC-11 (no driver support yet)
 1.84 22-Mar-2000  mycroft Regen.
 1.83 20-Mar-2000  tron Regen.
 1.82 18-Mar-2000  mycroft Regen.
 1.81 16-Mar-2000  onoe Regen.
 1.80 13-Mar-2000  cgd regen
 1.79 27-Feb-2000  uch regen.
 1.78 09-Feb-2000  enami Regen.
 1.77 03-Feb-2000  enami Regen.
 1.76 01-Feb-2000  enami Regen.
 1.75 01-Feb-2000  enami Regen.
 1.74 26-Jan-2000  thorpej Regen.
 1.73 25-Jan-2000  soren Regen.
 1.72 25-Jan-2000  thorpej Regen.
 1.71 25-Jan-2000  mycroft Regen.
 1.70 25-Jan-2000  jlam Regen.
 1.69 25-Jan-2000  sommerfeld Regen
 1.68 23-Jan-2000  chopps regen
 1.67 18-Jan-2000  jlam Regen.
 1.66 09-Jan-2000  joda regen
 1.65 08-Jan-2000  augustss Regen.
 1.64 23-Dec-1999  augustss Regen.
 1.63 05-Dec-1999  danw regenerate
 1.62 29-Nov-1999  itojun regen.
 1.61 29-Nov-1999  jun regen.
 1.60 27-Nov-1999  soren Regen.
 1.59 26-Nov-1999  soren Regen.
 1.58 20-Nov-1999  jtk regen
 1.57 06-Nov-1999  enami branches: 1.57.2;
Regen.
 1.56 28-Oct-1999  sommerfeld regenerate
 1.55 28-Oct-1999  jun add
SOCKET LOW POWER ETHERNET Compact Flash Card.
 1.54 28-Oct-1999  jun add entry Corega PCC-TX PCMCIA card.
 1.53 27-Oct-1999  is Regenerate.
 1.52 11-Oct-1999  thorpej branches: 1.52.2; 1.52.4;
Regen.
 1.51 27-Sep-1999  enami branches: 1.51.2;
Regen. (btw, this typo was pointed out by kawamoto@es.osaka-u.ac.jp).
 1.50 27-Sep-1999  enami Regen.
 1.49 25-Sep-1999  enami regen.
 1.48 09-Sep-1999  is Ambicom support by Vincent Aymeric
 1.47 07-Sep-1999  soren Match 1460 names with Adaptec.
 1.46 24-Aug-1999  tron Regen.
 1.45 14-Aug-1999  tron Regen.
 1.44 06-Aug-1999  cgd regen for updated pcmciadevs
 1.43 22-Jul-1999  hwr Regen.
 1.42 14-Jul-1999  sommerfeld Blitz port of the FreeBSD wi* driver for the Lucent WaveLan IEEE
PCMCIA wireless LAN.
Original driver written by Bill Paul <wpaul@ctr.columbia.edu>
 1.41 23-Jun-1999  mjl Regen after tyop.
 1.40 23-Jun-1999  mjl Regen.
 1.39 19-Jun-1999  mjl Regen
 1.38 24-May-1999  christos Regen
 1.37 27-Apr-1999  thorpej Regen.
 1.36 19-Feb-1999  abs branches: 1.36.2;
Add ID for IBM 'PCMCIA Portable CD-ROM Drive'. We only have one of these and it
may be broken (it choked under Windows), but it at least now probes.
 1.35 19-Feb-1999  nathanw Regen.
 1.34 19-Feb-1999  nathanw Regen.
 1.33 01-Jan-1999  christos Regen
 1.32 29-Dec-1998  marc rebuilt from pcmciadevs
 1.31 25-Dec-1998  marc check in generated files again so the included CVS id is correct
 1.30 24-Dec-1998  marc add product id for 3Com/Megahertz 3CXEM556
 1.29 20-Dec-1998  nathanw Regen.
 1.28 19-Dec-1998  nathanw Regen.
 1.27 18-Dec-1998  thorpej Regen.
 1.26 18-Dec-1998  thorpej Regen.
 1.25 18-Dec-1998  thorpej Regen.
 1.24 18-Dec-1998  thorpej Regen.
 1.23 04-Nov-1998  itohy regen.
 1.22 27-Oct-1998  thorpej Regen.
 1.21 08-Oct-1998  thorpej Regen.
 1.20 08-Oct-1998  thorpej Regen.
 1.19 07-Oct-1998  jtk regen data files
 1.18 20-Sep-1998  dbj Regenerated .h files to fix "generated from" CVS id.
 1.17 20-Sep-1998  dbj Added support for a Dayna Communicard E that probes with a
different product id (0x2f) than the one we had (0x2d)
 1.16 10-Sep-1998  kenh Regen
 1.15 05-Sep-1998  christos Regen.
 1.14 17-Aug-1998  thorpej Regen.
 1.13 15-Aug-1998  thorpej Regen.
 1.12 15-Aug-1998  thorpej Regen.
 1.11 15-Aug-1998  thorpej Regen.
 1.10 15-Aug-1998  thorpej Regen.
 1.9 15-Aug-1998  thorpej Regen.
 1.8 15-Aug-1998  thorpej Regen.
 1.7 15-Aug-1998  thorpej Regen.
 1.6 14-Aug-1998  thorpej Regen.
 1.5 30-Jul-1998  thorpej Regen.
 1.4 22-Jul-1998  christos branches: 1.4.2;
Regen
 1.3 20-Jul-1998  christos Regen
 1.2 19-Jul-1998  christos Regen
 1.1 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.4.2.1 08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.36.2.3 11-May-2000  he Pull up regenerated files (requested by jhawk):
Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.
 1.36.2.2 08-Feb-2000  he Pull up regenerated files (requested by enami):
Add support for 3Com/Megaherz 10/100 Ethernet Modem combined
card (3CCFEM556BI and 3CXEM556B-INT). Should fix PR#8331 and
PR#8188.
 1.36.2.1 27-Apr-1999  perry branches: 1.36.2.1.2; 1.36.2.1.4;
Regen.
 1.36.2.1.4.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.36.2.1.2.3 02-Aug-1999  thorpej Regen.
 1.36.2.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.36.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.51.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.52.4.1 15-Nov-1999  fvdl Sync with -current
 1.52.2.9 21-Apr-2001  bouyer Sync with HEAD
 1.52.2.8 27-Mar-2001  bouyer Sync with HEAD.
 1.52.2.7 12-Mar-2001  bouyer Sync with HEAD.
 1.52.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.52.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.52.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.52.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.52.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.52.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.57.2.2 06-Nov-1999  enami Regen.
 1.57.2.1 06-Nov-1999  enami file pcmciadevs.h was added on branch comdex-fall-1999 on 1999-11-06 00:59:57 +0000
 1.89.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.92.2.8 14-Feb-2002  he Pull up regenerated files (requested by aymeric):
Add support for the following cards:
o Edimax Technology Inc. EP4000A
o Linksys Etherfast clone (Level One)
o Zonet Zen
 1.92.2.7 16-Jun-2001  he Pull up regenerated files (requested by toddpw):
Add support for ``Kingston KNE-PC2 Ethernet'' pcmcia cards.
 1.92.2.6 26-May-2001  he Pull up regenerated files (requested by jhawk):
Support the Socket EA pcmcia ethernet cards.
 1.92.2.5 04-Apr-2001  he Pull up regenerated files (requested by toddpw):
Add support for the Socket Communications LP-E Type II PCMCIA
NE2000 clone card.
 1.92.2.4 16-Mar-2001  he Pull up regenerated files (requested by aymeric):
Add an entry and support for the Synergy 21 S21810+.
 1.92.2.3 09-Aug-2000  gmcgarry Regen.
 1.92.2.2 21-Jul-2000  onoe Pullup 802.11 stuff (approved by jhawk)
- add support for Corega Wireless LAN PCC-11, and Faralon SkyLINE 11Mb
to wi driver.
syssrc/sys/dev/pcmcia/pcmciadevs 1.95
syssrc/sys/dev/pcmcia/pcmciadevs.h 1.94
syssrc/sys/dev/pcmcia/pcmciadevs_data.h 1.94
syssrc/sys/dev/pcmcia/if_wi.c 1.24
syssrc/sys/dev/pcmcia/if_wivar.h 1.11
 1.92.2.1 03-Jul-2000  thorpej Regen.
 1.120.2.16 17-Jan-2003  thorpej Sync with HEAD.
 1.120.2.15 29-Dec-2002  thorpej Sync with HEAD.
 1.120.2.14 17-Sep-2002  nathanw Catch up to -current.
 1.120.2.13 01-Aug-2002  nathanw Catch up to -current.
 1.120.2.12 20-Jun-2002  nathanw Catch up to -current.
 1.120.2.11 17-Apr-2002  nathanw Catch up to -current.
 1.120.2.10 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.120.2.9 28-Feb-2002  nathanw Catch up to -current.
 1.120.2.8 08-Jan-2002  nathanw Catch up to -current.
 1.120.2.7 14-Nov-2001  nathanw Catch up to -current.
 1.120.2.6 22-Oct-2001  nathanw Catch up to -current.
 1.120.2.5 08-Oct-2001  nathanw Catch up to -current.
 1.120.2.4 21-Sep-2001  nathanw Catch up to -current.
 1.120.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.120.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.120.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.132.2.8 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.132.2.7 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.132.2.6 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.132.2.5 16-Mar-2002  jdolecek Catch up with -current.
 1.132.2.4 11-Feb-2002  jdolecek Sync w/ -current.
 1.132.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.132.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.132.2.1 03-Aug-2001  lukem update to -current
 1.135.2.2 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.135.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.143.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.167.4.6 19-Nov-2002  tron Regen for ticket #971.
 1.167.4.5 18-Sep-2002  thorpej Regenerate.
 1.167.4.4 18-Jun-2002  lukem regen for ticket #295
 1.167.4.3 11-Jun-2002  lukem regen for ticket #146
 1.167.4.2 10-Jun-2002  tv Regen.
 1.167.4.1 31-May-2002  tv Pullup regen.
 1.167.2.3 29-Aug-2002  gehenna catch up with -current.
 1.167.2.2 20-Jun-2002  gehenna catch up with -current.
 1.167.2.1 30-May-2002  gehenna Catch up with -current.
 1.184.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.184.2.7 01-Apr-2005  skrll Sync with HEAD.
 1.184.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.184.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.184.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.184.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.184.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.184.2.1 03-Aug-2004  skrll Sync with HEAD
 1.208.4.1 29-Apr-2005  kent sync with -current
 1.209.2.2 26-Mar-2005  yamt sync with head.
 1.209.2.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.210.2.5 31-Jul-2006  tron Regen for ticket #1436.
 1.210.2.4 28-Jul-2006  tron Backout commit which went into the wrong branch accidentally.
 1.210.2.3 28-Jul-2006  scottr Regenerate headers, this time with correct rcsid
 1.210.2.2 09-Nov-2005  tron Regen for ticket #945.
 1.210.2.1 07-May-2005  tron Regen for ticket 260.
 1.214.2.5 27-Oct-2007  yamt sync with head.
 1.214.2.4 03-Sep-2007  yamt sync with head.
 1.214.2.3 26-Feb-2007  yamt sync with head.
 1.214.2.2 30-Dec-2006  yamt sync with head.
 1.214.2.1 21-Jun-2006  yamt sync with head.
 1.216.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.216.10.1 19-Apr-2006  elad sync with head.
 1.216.8.3 11-Aug-2006  yamt sync with head
 1.216.8.2 26-Jun-2006  yamt sync with head.
 1.216.8.1 01-Apr-2006  yamt sync with head.
 1.216.6.1 22-Apr-2006  simonb Sync with head.
 1.216.4.1 09-Sep-2006  rpaulo sync with head
 1.217.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.217.2.1 22-Jun-2006  chap Complete a sync sys/ with head.
 1.220.6.2 10-Dec-2006  yamt sync with head.
 1.220.6.1 22-Oct-2006  yamt sync with head
 1.220.4.1 18-Nov-2006  ad Sync with head.
 1.223.2.1 14-Nov-2012  riz Regen for ticket 1467.
 1.224.18.2 02-Oct-2007  joerg Sync with HEAD.
 1.224.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.224.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.224.6.2 09-Oct-2007  ad Sync with head.
 1.224.6.1 20-Aug-2007  ad Sync with HEAD.
 1.225.2.1 06-Nov-2007  matt sync with HEAD
 1.226.24.2 04-May-2009  yamt sync with head.
 1.226.24.1 16-May-2008  yamt sync with head.
 1.226.22.1 18-May-2008  yamt sync with head.
 1.226.20.3 28-Sep-2008  mjf Sync with HEAD.
 1.226.20.2 29-Jun-2008  mjf Sync with HEAD.
 1.226.20.1 02-Jun-2008  mjf Sync with HEAD.
 1.227.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.227.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.228.2.1 27-Jun-2008  simonb Sync with head.
 1.229.2.1 19-Oct-2008  haad Sync with HEAD.
 1.230.28.2 30-Oct-2012  yamt sync with head
 1.230.28.1 17-Apr-2012  yamt sync with head
 1.232.16.1 09-Jul-2016  skrll Sync with HEAD
 1.232.2.1 03-Dec-2017  jdolecek update from HEAD
 1.233.16.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.235 17-Oct-2021  andvar regen
 1.234 16-Mar-2018  sevan regen
 1.233 01-Jun-2016  pgoyette branches: 1.233.16;
Regen
 1.232 23-Aug-2012  kiyohara branches: 1.232.2; 1.232.16;
Regen.
 1.231 26-Nov-2011  nonaka regen.
 1.230 06-Sep-2008  rmind branches: 1.230.28;
Regen.
 1.229 19-Jun-2008  imp branches: 1.229.2;
Sync to pcmciadevs 1.226
 1.228 16-May-2008  jnemeth branches: 1.228.2;
regen for Corega LAPCCTXD FastEthernet
 1.227 28-Apr-2008  martin branches: 1.227.2;
Remove clause 3 and 4 from TNF licenses
 1.226 22-Sep-2007  kiyohara branches: 1.226.20; 1.226.22; 1.226.24;
Regen.
 1.225 20-Aug-2007  kiyohara branches: 1.225.2;
Regen.
 1.224 10-Feb-2007  ichiro branches: 1.224.6; 1.224.14; 1.224.18;
regen.
 1.223 16-Nov-2006  christos branches: 1.223.2;
regen
 1.222 23-Sep-2006  jmcneill Regen for PR# 15666.
 1.221 23-Sep-2006  jmcneill Regen for PR# 27840.
 1.220 28-Jul-2006  scottr branches: 1.220.4; 1.220.6;
Regenerate with correct rcsids
 1.219 28-Jul-2006  scottr Add Siemens SS1021 WLAN.
 1.218 19-Jun-2006  gdamore Regen pcmciadevs. Sorry.
 1.217 23-Mar-2006  christos branches: 1.217.2; 1.217.4;
Regen
 1.216 11-Dec-2005  christos branches: 1.216.4; 1.216.6; 1.216.8; 1.216.10; 1.216.12;
merge ktrace-lwp.
 1.215 07-Nov-2005  tsutsui Regen from pcmciadevs rev 1.213:
> Fix pp_cisinfo[0] of the TEAC IDECARDII entry.
> If pp_cisinfo[0] is NULL, current pcmcia_product_lookup()
> never matches the device.
 1.214 06-Jul-2005  dyoung branches: 1.214.2;
Regen.
 1.213 07-May-2005  martin Regen.
 1.212 23-Mar-2005  martin Regen (Proxim RangeLAN-DS 8430 added)
 1.211 19-Mar-2005  christos Regen
 1.210 27-Feb-2005  perry branches: 1.210.2;
regen
 1.209 21-Jan-2005  imp branches: 1.209.2;
Update to using new INTERSIL names, plus a couple generic entries from FreeBSD
 1.208 10-Aug-2004  mycroft branches: 1.208.4;
Regen.
 1.207 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.206 10-Aug-2004  mycroft Regen.
 1.205 07-Aug-2004  mycroft Regen.
 1.204 06-Aug-2004  mycroft Regen.
 1.203 05-Aug-2004  mycroft Regen.
 1.202 05-Aug-2004  mycroft Regen.
 1.201 17-Jul-2004  mycroft Regen.
 1.200 09-Jul-2004  enami Regen.
 1.199 07-Jul-2004  mycroft Regen.
 1.198 07-Jul-2004  mycroft Regen.
 1.197 07-Jul-2004  mycroft Regen.
 1.196 19-Jun-2004  itohy Regen from pcmciadevs rev 1.194.
 1.195 01-Feb-2004  uwe Regen for TAMARAC Ethernet card.
 1.194 25-Jan-2004  sekiya Regen.
 1.193 28-Dec-2003  itohy Regen from pcmciadevs rev 1.191.
 1.192 25-Dec-2003  nonaka regen.
 1.191 07-Dec-2003  ichiro regen.
 1.190 07-Nov-2003  wiz regen, so "generated from" line is correct.
 1.189 07-Nov-2003  hamajima support Corega Ether PCC-TL -- from Yasushi Oshima
 1.188 22-Oct-2003  christos Regen
 1.187 16-Sep-2003  onoe regen: Add Sony PEGA-WL110 CF WLAN
 1.186 11-Sep-2003  ichiro regen.
 1.185 26-Jul-2003  martin Regen (added socket communications 10/100 CF ethernet card)
 1.184 02-May-2003  gmcgarry branches: 1.184.2;
Regen: NTT DoCoMO PALDIO 611S PCMCIA
 1.183 09-Apr-2003  christos regen
 1.182 29-Mar-2003  perry regen
 1.181 27-Mar-2003  ichiro regen
 1.180 16-Jan-2003  kanaoka Regen. Add SMC 8041TX 10/100 Ether PC Card.
 1.179 29-Dec-2002  jdc Regenerate (DWL650H addition).
 1.178 15-Sep-2002  bouyer Regen: add ACCTON EN2216.
 1.177 04-Sep-2002  mason Commit with correct RCS IDs in these files - hadn't looked into them
previously to note that they reference the RCS ID in "pcmciadevs".
Hence, committed versions which incorrectly pointed back to the RCS ID
of the "pcmciadevs" that existed prior to my addition. Corrected in this
commit.
 1.176 04-Sep-2002  mason Support this device, which is evidently a rebadged GEMTEK WLAN which we
already support under another name:

wi0 at pcmcia0 function 0: NETGEAR MA401RA Wireless PC, Card, ISL37300PEval-RevA
wi0: 802.11 address <whatever>
wi0: using RF:PRISM2.5 MAC:ISL3873B(PCMCIA)
wi0: Intersil Firmware: Primary (1.0.7), Station (1.3.6)
 1.175 23-Jul-2002  rjs Regenerate.
 1.174 23-Jul-2002  mjl Regen for Dynalink L10C
 1.173 17-Jun-2002  martin Regen (XI325 Wireless LAN added)
 1.172 08-Jun-2002  martin Regen (ACTIONTEC wireless lan card added)
 1.171 03-Jun-2002  jonathan Regen from pcmciadevs 1.171 after adding D-link DFE-670 ethernet card.
 1.170 01-Jun-2002  itojun regen
 1.169 31-May-2002  mycroft Regen.
 1.168 26-May-2002  tshiozak add PLANEX GW-NS11H Wireless LAN PC Card.
 1.167 07-May-2002  onoe branches: 1.167.2; 1.167.4;
regen: Add LINKSYS Instant Wireless Network CF Card
 1.166 06-May-2002  chris Regenerate for Netgear FA411.
 1.165 30-Apr-2002  uch regen.
 1.164 10-Apr-2002  ichiro regen
 1.163 10-Mar-2002  martin Regen (seems I forgot that after TDK/Elsa ISDN MCall addition)
 1.162 01-Feb-2002  is regenerate: fix typo in card name string.
 1.161 30-Jan-2002  is Fix typo: ASIX, not AMBIX
 1.160 30-Jan-2002  is Add Lantech Fastnet/TX (really generic ASIX AX88190) card
 1.159 17-Jan-2002  joda add support for Ericsson PRISM2 card (kern/15130)
 1.158 13-Jan-2002  aymeric regen
 1.157 29-Dec-2001  pooka regen
 1.156 29-Dec-2001  ichiro regen
 1.155 23-Dec-2001  ichiro regen
 1.154 18-Dec-2001  ichiro regen
 1.153 16-Dec-2001  ichiro regen
 1.152 04-Dec-2001  christos Regen.
 1.151 27-Nov-2001  enami Regen.
 1.150 26-Nov-2001  yamt - regen for IBM SCSI PCMCIA.
 1.149 26-Nov-2001  ichiro regen
 1.148 19-Nov-2001  imp regenerate for 1.147
 1.147 18-Nov-2001  mrg regen
 1.146 08-Nov-2001  christos Regen.
 1.145 08-Nov-2001  haya Regen w/ devlist2h.awk ver 1.4.
 1.144 27-Oct-2001  ichiro regen
 1.143 21-Oct-2001  mjl branches: 1.143.2;
Regen
 1.142 20-Oct-2001  mjl Regen.
 1.141 14-Oct-2001  christos Regen.
 1.140 09-Oct-2001  imp Resync after the sort
 1.139 29-Sep-2001  augustss Regen.
 1.138 18-Sep-2001  ichiro regen
 1.137 17-Sep-2001  ichiro regen
 1.136 17-Sep-2001  ichiro regen
 1.135 21-Aug-2001  pooka branches: 1.135.2;
regen: psion gold card
 1.134 07-Aug-2001  christos regen
 1.133 31-Jul-2001  christos regen.
 1.132 09-Jul-2001  itojun branches: 1.132.2;
regen
 1.131 29-Jun-2001  christos regen
 1.130 21-May-2001  ichiro regen
 1.129 20-May-2001  ichiro delete RCS Id from pcmciadevs rev 1.128
 1.128 20-May-2001  ichiro make compile again
(fix warning : missing white space after `#define....)
 1.127 20-May-2001  ichiro regen
 1.126 18-May-2001  jhawk Regen
 1.125 17-May-2001  ichiro regen
 1.124 16-May-2001  ichiro regen
 1.123 14-May-2001  ichiro regen
 1.122 06-Apr-2001  onoe regen: add Cisco Aironet 350 Series.
 1.121 18-Mar-2001  ichiro regen
 1.120 19-Feb-2001  aymeric branches: 1.120.2;
regen
 1.119 13-Feb-2001  thorpej Regen; D-Link DMF-560TX.
 1.118 11-Feb-2001  ichiro regen
 1.117 10-Feb-2001  ichiro regen
 1.116 29-Jan-2001  ichiro regen
 1.115 28-Jan-2001  ichiro regen.
 1.114 23-Jan-2001  tv Regen.
 1.113 23-Jan-2001  thorpej Regen; added Xircom CreditCard Token Ring II.
 1.112 20-Jan-2001  thorpej Regen; there is absolutely no point in having a FreeBSD RCS ID in this file.
 1.111 20-Jan-2001  taca Regen.
 1.110 20-Jan-2001  imp Sync to pcmicadevs 1.111
 1.109 16-Jan-2001  nonaka regen
 1.108 11-Jan-2001  ichiro regen
 1.107 10-Jan-2001  ichiro regen.
 1.106 20-Dec-2000  haya regen.
 1.105 20-Dec-2000  sommerfeld Regen, because jhawk didn't
 1.104 19-Dec-2000  thorpej Regen.
 1.103 19-Dec-2000  thorpej Regen; add SMC 2632W.
 1.102 08-Dec-2000  drochner regen
 1.101 21-Nov-2000  soren Regen.
 1.100 10-Nov-2000  hubertf Regen for ELSA WaveLan IDs
 1.99 03-Nov-2000  toddpw Add support for Socket Comm. PC Card Ethernet, and tidy up naming.
 1.98 02-Nov-2000  msaitoh regen
 1.97 24-Aug-2000  imp Sync to 1.98 of pcmciadevs
 1.96 26-Jul-2000  onoe add Samsung MagicLAN SWL-2000N
 1.95 24-Jul-2000  gmcgarry Regen.
 1.94 18-Jul-2000  onoe Add Farallon SkyLINE 11mb card as Intersil Prism2
vendor:product of the card is Lucent:WaveLAN, and CIS string shows
"INTERSIL" "HFA384x/IEEE"...
 1.93 30-Jun-2000  joda regen
 1.92 13-Jun-2000  soren branches: 1.92.2;
Regen.
 1.91 09-Jun-2000  onoe Add Farallon SkyLINE Wireless LAN Card for awi(4) driver.
Tested on FreeBSD 3.4-RELEASE by Dirk-Willem van Gulik <dirkx@webweaving.org>.
 1.90 05-Jun-2000  gmcgarry Regen.
 1.89 11-May-2000  is branches: 1.89.2;
RATOC REX-R280 (another if_mbe_pcmcia card) support by UCHIYAMA Yasushi.
Originally part of pr 6789, reworked by the submitter to fit into -current.
 1.88 17-Apr-2000  joda regen
 1.87 12-Apr-2000  scw Regen
 1.86 26-Mar-2000  itojun regen (sorry forgot to do separate commit for them)
 1.85 26-Mar-2000  itojun add CIS for Corega Wireless LAN PCC-11 (no driver support yet)
 1.84 22-Mar-2000  mycroft Regen.
 1.83 20-Mar-2000  tron Regen.
 1.82 18-Mar-2000  mycroft Regen.
 1.81 16-Mar-2000  onoe Regen.
 1.80 13-Mar-2000  cgd regen
 1.79 27-Feb-2000  uch regen.
 1.78 09-Feb-2000  enami Regen.
 1.77 03-Feb-2000  enami Regen.
 1.76 01-Feb-2000  enami Regen.
 1.75 01-Feb-2000  enami Regen.
 1.74 26-Jan-2000  thorpej Regen.
 1.73 25-Jan-2000  soren Regen.
 1.72 25-Jan-2000  thorpej Regen.
 1.71 25-Jan-2000  mycroft Regen.
 1.70 25-Jan-2000  jlam Regen.
 1.69 25-Jan-2000  sommerfeld Regen
 1.68 23-Jan-2000  chopps regen
 1.67 18-Jan-2000  jlam Regen.
 1.66 09-Jan-2000  joda regen
 1.65 08-Jan-2000  augustss Regen.
 1.64 23-Dec-1999  augustss Regen.
 1.63 05-Dec-1999  danw regenerate
 1.62 29-Nov-1999  itojun regen.
 1.61 29-Nov-1999  jun regen.
 1.60 27-Nov-1999  soren Regen.
 1.59 26-Nov-1999  soren Regen.
 1.58 20-Nov-1999  jtk regen
 1.57 06-Nov-1999  enami branches: 1.57.2;
Regen.
 1.56 28-Oct-1999  sommerfeld regenerate
 1.55 28-Oct-1999  jun add
SOCKET LOW POWER ETHERNET Compact Flash Card.
 1.54 28-Oct-1999  jun add entry Corega PCC-TX PCMCIA card.
 1.53 27-Oct-1999  is Regenerate.
 1.52 11-Oct-1999  thorpej branches: 1.52.2; 1.52.4;
Regen.
 1.51 27-Sep-1999  enami branches: 1.51.2;
Regen. (btw, this typo was pointed out by kawamoto@es.osaka-u.ac.jp).
 1.50 27-Sep-1999  enami Regen.
 1.49 25-Sep-1999  enami regen.
 1.48 09-Sep-1999  is Ambicom support by Vincent Aymeric
 1.47 07-Sep-1999  soren Match 1460 names with Adaptec.
 1.46 24-Aug-1999  tron Regen.
 1.45 14-Aug-1999  tron Regen.
 1.44 06-Aug-1999  cgd regen for updated pcmciadevs
 1.43 22-Jul-1999  hwr Regen.
 1.42 14-Jul-1999  sommerfeld Blitz port of the FreeBSD wi* driver for the Lucent WaveLan IEEE
PCMCIA wireless LAN.
Original driver written by Bill Paul <wpaul@ctr.columbia.edu>
 1.41 23-Jun-1999  mjl Regen after tyop.
 1.40 23-Jun-1999  mjl Regen.
 1.39 19-Jun-1999  mjl Regen
 1.38 24-May-1999  christos Regen
 1.37 27-Apr-1999  thorpej Regen.
 1.36 19-Feb-1999  abs branches: 1.36.2;
Add ID for IBM 'PCMCIA Portable CD-ROM Drive'. We only have one of these and it
may be broken (it choked under Windows), but it at least now probes.
 1.35 19-Feb-1999  nathanw Regen.
 1.34 19-Feb-1999  nathanw Regen.
 1.33 01-Jan-1999  christos Regen
 1.32 29-Dec-1998  marc rebuilt from pcmciadevs
 1.31 25-Dec-1998  marc check in generated files again so the included CVS id is correct
 1.30 24-Dec-1998  marc add product id for 3Com/Megahertz 3CXEM556
 1.29 20-Dec-1998  nathanw Regen.
 1.28 19-Dec-1998  nathanw Regen.
 1.27 18-Dec-1998  thorpej Regen.
 1.26 18-Dec-1998  thorpej Regen.
 1.25 18-Dec-1998  thorpej Regen.
 1.24 18-Dec-1998  thorpej Regen.
 1.23 04-Nov-1998  itohy regen.
 1.22 27-Oct-1998  thorpej Regen.
 1.21 08-Oct-1998  thorpej Regen.
 1.20 08-Oct-1998  thorpej Regen.
 1.19 07-Oct-1998  jtk regen data files
 1.18 20-Sep-1998  dbj Regenerated .h files to fix "generated from" CVS id.
 1.17 20-Sep-1998  dbj Added support for a Dayna Communicard E that probes with a
different product id (0x2f) than the one we had (0x2d)
 1.16 10-Sep-1998  kenh Regen
 1.15 05-Sep-1998  christos Regen.
 1.14 17-Aug-1998  thorpej Regen.
 1.13 15-Aug-1998  thorpej Regen.
 1.12 15-Aug-1998  thorpej Regen.
 1.11 15-Aug-1998  thorpej Regen.
 1.10 15-Aug-1998  thorpej Regen.
 1.9 15-Aug-1998  thorpej Regen.
 1.8 15-Aug-1998  thorpej Regen.
 1.7 15-Aug-1998  thorpej Regen.
 1.6 14-Aug-1998  thorpej Regen.
 1.5 30-Jul-1998  thorpej Regen.
 1.4 22-Jul-1998  christos branches: 1.4.2;
Regen
 1.3 20-Jul-1998  christos Regen
 1.2 19-Jul-1998  christos Regen
 1.1 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.4.2.1 08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.36.2.3 11-May-2000  he Pull up regenerated files (requested by jhawk):
Add a driver for ``wi'', Lucent "Orinoco"/Wavelan.
 1.36.2.2 08-Feb-2000  he Pull up regenerated files (requested by enami):
Add support for 3Com/Megaherz 10/100 Ethernet Modem combined
card (3CCFEM556BI and 3CXEM556B-INT). Should fix PR#8331 and
PR#8188.
 1.36.2.1 27-Apr-1999  perry branches: 1.36.2.1.2; 1.36.2.1.4;
Regen.
 1.36.2.1.4.1 30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.36.2.1.2.3 02-Aug-1999  thorpej Regen.
 1.36.2.1.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.36.2.1.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.51.2.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.52.4.1 15-Nov-1999  fvdl Sync with -current
 1.52.2.9 21-Apr-2001  bouyer Sync with HEAD
 1.52.2.8 27-Mar-2001  bouyer Sync with HEAD.
 1.52.2.7 12-Mar-2001  bouyer Sync with HEAD.
 1.52.2.6 11-Feb-2001  bouyer Sync with HEAD.
 1.52.2.5 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.52.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.52.2.3 13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.52.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.52.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.57.2.2 06-Nov-1999  enami Regen.
 1.57.2.1 06-Nov-1999  enami file pcmciadevs_data.h was added on branch comdex-fall-1999 on 1999-11-06 00:59:57 +0000
 1.89.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.92.2.8 14-Feb-2002  he Pull up regenerated files (requested by aymeric):
Add support for the following cards:
o Edimax Technology Inc. EP4000A
o Linksys Etherfast clone (Level One)
o Zonet Zen
 1.92.2.7 16-Jun-2001  he Pull up regenerated files (requested by toddpw):
Add support for ``Kingston KNE-PC2 Ethernet'' pcmcia cards.
 1.92.2.6 26-May-2001  he Pull up regenerated files (requested by jhawk):
Support the Socket EA pcmcia ethernet cards.
 1.92.2.5 04-Apr-2001  he Pull up regenerated files (requested by toddpw):
Add support for the Socket Communications LP-E Type II PCMCIA
NE2000 clone card.
 1.92.2.4 16-Mar-2001  he Pull up regenerated files (requested by aymeric):
Add an entry and support for the Synergy 21 S21810+.
 1.92.2.3 09-Aug-2000  gmcgarry Regen.
 1.92.2.2 21-Jul-2000  onoe Pullup 802.11 stuff (approved by jhawk)
- add support for Corega Wireless LAN PCC-11, and Faralon SkyLINE 11Mb
to wi driver.
syssrc/sys/dev/pcmcia/pcmciadevs 1.95
syssrc/sys/dev/pcmcia/pcmciadevs.h 1.94
syssrc/sys/dev/pcmcia/pcmciadevs_data.h 1.94
syssrc/sys/dev/pcmcia/if_wi.c 1.24
syssrc/sys/dev/pcmcia/if_wivar.h 1.11
 1.92.2.1 03-Jul-2000  thorpej Regen.
 1.120.2.16 17-Jan-2003  thorpej Sync with HEAD.
 1.120.2.15 29-Dec-2002  thorpej Sync with HEAD.
 1.120.2.14 17-Sep-2002  nathanw Catch up to -current.
 1.120.2.13 01-Aug-2002  nathanw Catch up to -current.
 1.120.2.12 20-Jun-2002  nathanw Catch up to -current.
 1.120.2.11 17-Apr-2002  nathanw Catch up to -current.
 1.120.2.10 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.120.2.9 28-Feb-2002  nathanw Catch up to -current.
 1.120.2.8 08-Jan-2002  nathanw Catch up to -current.
 1.120.2.7 14-Nov-2001  nathanw Catch up to -current.
 1.120.2.6 22-Oct-2001  nathanw Catch up to -current.
 1.120.2.5 08-Oct-2001  nathanw Catch up to -current.
 1.120.2.4 21-Sep-2001  nathanw Catch up to -current.
 1.120.2.3 24-Aug-2001  nathanw Catch up with -current.
 1.120.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.120.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.132.2.8 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.132.2.7 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.132.2.6 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.132.2.5 16-Mar-2002  jdolecek Catch up with -current.
 1.132.2.4 11-Feb-2002  jdolecek Sync w/ -current.
 1.132.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.132.2.2 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.132.2.1 03-Aug-2001  lukem update to -current
 1.135.2.2 11-Oct-2001  fvdl Catch up with -current. Fix some bogons in the sparc64 kbd/ms
attach code. cd18xx conversion provided by mrg.
 1.135.2.1 01-Oct-2001  fvdl Catch up with -current.
 1.143.2.1 12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.167.4.6 19-Nov-2002  tron Regen for ticket #971.
 1.167.4.5 18-Sep-2002  thorpej Regenerate.
 1.167.4.4 18-Jun-2002  lukem regen for ticket #295
 1.167.4.3 11-Jun-2002  lukem regen for ticket #146
 1.167.4.2 10-Jun-2002  tv Regen.
 1.167.4.1 31-May-2002  tv Pullup regen.
 1.167.2.3 29-Aug-2002  gehenna catch up with -current.
 1.167.2.2 20-Jun-2002  gehenna catch up with -current.
 1.167.2.1 30-May-2002  gehenna Catch up with -current.
 1.184.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.184.2.7 01-Apr-2005  skrll Sync with HEAD.
 1.184.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.184.2.5 24-Jan-2005  skrll Sync with HEAD.
 1.184.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.184.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.184.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.184.2.1 03-Aug-2004  skrll Sync with HEAD
 1.208.4.1 29-Apr-2005  kent sync with -current
 1.209.2.2 26-Mar-2005  yamt sync with head.
 1.209.2.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.210.2.5 31-Jul-2006  tron Regen for ticket #1436.
 1.210.2.4 28-Jul-2006  tron Backout commit which went into the wrong branch accidentally.
 1.210.2.3 28-Jul-2006  scottr Regenerate headers, this time with correct rcsid
 1.210.2.2 09-Nov-2005  tron Regen for ticket #945.
 1.210.2.1 07-May-2005  tron Regen for ticket 260.
 1.214.2.5 27-Oct-2007  yamt sync with head.
 1.214.2.4 03-Sep-2007  yamt sync with head.
 1.214.2.3 26-Feb-2007  yamt sync with head.
 1.214.2.2 30-Dec-2006  yamt sync with head.
 1.214.2.1 21-Jun-2006  yamt sync with head.
 1.216.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.216.10.1 19-Apr-2006  elad sync with head.
 1.216.8.3 11-Aug-2006  yamt sync with head
 1.216.8.2 26-Jun-2006  yamt sync with head.
 1.216.8.1 01-Apr-2006  yamt sync with head.
 1.216.6.1 22-Apr-2006  simonb Sync with head.
 1.216.4.1 09-Sep-2006  rpaulo sync with head
 1.217.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.217.2.1 22-Jun-2006  chap Complete a sync sys/ with head.
 1.220.6.2 10-Dec-2006  yamt sync with head.
 1.220.6.1 22-Oct-2006  yamt sync with head
 1.220.4.1 18-Nov-2006  ad Sync with head.
 1.223.2.1 14-Nov-2012  riz Regen for ticket 1467.
 1.224.18.2 02-Oct-2007  joerg Sync with HEAD.
 1.224.18.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.224.14.1 03-Sep-2007  skrll Sync with HEAD.
 1.224.6.2 09-Oct-2007  ad Sync with head.
 1.224.6.1 20-Aug-2007  ad Sync with HEAD.
 1.225.2.1 06-Nov-2007  matt sync with HEAD
 1.226.24.2 04-May-2009  yamt sync with head.
 1.226.24.1 16-May-2008  yamt sync with head.
 1.226.22.1 18-May-2008  yamt sync with head.
 1.226.20.3 28-Sep-2008  mjf Sync with HEAD.
 1.226.20.2 29-Jun-2008  mjf Sync with HEAD.
 1.226.20.1 02-Jun-2008  mjf Sync with HEAD.
 1.227.2.2 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.227.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.228.2.1 27-Jun-2008  simonb Sync with head.
 1.229.2.1 19-Oct-2008  haad Sync with HEAD.
 1.230.28.2 30-Oct-2012  yamt sync with head
 1.230.28.1 17-Apr-2012  yamt sync with head
 1.232.16.1 09-Jul-2016  skrll Sync with HEAD
 1.232.2.1 03-Dec-2017  jdolecek update from HEAD
 1.233.16.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.12 07-Feb-2024  msaitoh Fix typo of "following" in comment.
 1.11 01-Sep-2019  mlelstv add PCMCIA_CISTPL_SDIO definition.
 1.10 11-Dec-2005  christos branches: 1.10.164; 1.10.170;
merge ktrace-lwp.
 1.9 12-Aug-2004  mycroft My previous understanding of the I/O base/limit registers was incorrect.
However, so was the old code. Now it works correctly. :-)
 1.8 09-Aug-2004  mycroft Multifunction fixes:
* Don't call handlers for functions that are not enabled.
* Always call the handler if the function doesn't support the STATUS register.
While I'm here, divide the CCR numbers by 2.
 1.7 29-Oct-1998  enami branches: 1.7.46;
Define some constants for function extension tuple of disk function.
 1.6 13-Aug-1998  nathanw Add PCMCIA_FUNCTION_* macros, for function types defined by
PCMCIA_CISTPL_FUNCID.
 1.5 29-May-1998  msaitoh add some information from "PC Card standard March 1997"
 1.4 22-Mar-1998  enami Define TPLFE_TYPE, which is sub code for CISTPL_FUNCE, for LAN card.
 1.3 01-Feb-1998  marc whitespace changes for readability
 1.2 16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1 30-Jul-1997  marc branches: 1.1.2;
file pcmciareg.h was initially added on branch marc-pcmcia.
 1.1.2.4 16-Oct-1997  thorpej Copyright/license update.
 1.1.2.3 14-Oct-1997  thorpej KNF, RCS IDs.
 1.1.2.2 30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.7.46.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.7.46.3 18-Sep-2004  skrll Sync with HEAD.
 1.7.46.2 25-Aug-2004  skrll Sync with HEAD.
 1.7.46.1 12-Aug-2004  skrll Sync with HEAD.
 1.10.170.1 25-Feb-2020  martin Pull up following revision(s) (requested by mrg in ticket #717):

sys/dev/fdt/dwcmmc_fdt.c 1.11
sys/dev/ic/bwfm.c 1.15-1.18
sys/dev/ic/bwfmreg.h 1.4-1.6
sys/dev/ic/bwfmvar.h 1.4,1.5
sys/dev/ic/dwc_mmc.c 1.21,1.22
sys/dev/ic/dwc_mmc_reg.h 1.8,1.9,1.12,1.13
sys/dev/pcmcia/pcmciareg.h 1.11
sys/dev/sdmmc/if_bwfm_sdio.c 1.4,1.6-1.12
sys/dev/sdmmc/if_bwfm_sdio.h 1.1,1.2
sys/dev/sdmmc/sdhc.c 1.105,1.106
sys/dev/sdmmc/sdmmc.c 1.37,1.39
sys/dev/sdmmc/sdmmc_cis.c 1.6,1.8
sys/dev/sdmmc/sdmmc_io.c 1.15-1.19
sys/dev/sdmmc/sdmmc_ioreg.h 1.4,1.5
sys/dev/sdmmc/sdmmc_mem.c 1.69-1.71
sys/dev/sdmmc/sdmmcdevs 1.5-1.8
sys/dev/sdmmc/sdmmcvar.h 1.31,1.33,1.34
sys/net/if_media.h 1.66

Add Broadcom devices
-
Fix typo
-
add PCMCIA_CISTPL_SDIO definition.
-
From OpenBSD:
- move event handling to workqueue
- check for save/restore capability
-
Tag work queue as MPsafe and increase length.
-
Juse use bpf_mtap(), the 802.11 encapsulation is handled by firmware.
-
From OpenBSD:
- support block length per function
- add functions to read/write regions
-
Decode (but not use) SDIO tuple in CIS.
-
Fix locking.
-
Add more SDIO defines (partially from version 3.0).
-
From OpenBSD:
- All the missing pieces (firmware load, chip setup, protocol handling)
TX queue and interrupt handling via sdmmc_task.
-
Fix locking.
-
Fix packet parsing.
-
Add parser for original firmware config files.
-
tagging work queue as MPSAFE was premature. Revert.
-
SD_IO_RW_EXTENDED is a data transfer command, so set ADTC flag instead of AC
Use correct function to verify if a task has been queued. Avoids race
that can corrupt the task queue.
-
More register definitions.
-
Add IFM_IEEE80211_VHT subtype, IFM_IEEE80211_11AC operating mode, and missing descriptions
-
If firmware is connected in HT or VHT mode, report it to SIOCGIFMEDIA
-
white space police.

Skip setting power when the voltage doesn't change.
Also increase some timeouts.
-
Add and use sdmmc_pause to avoid long-term busy waits.
-
Add sdio abort function.
-
Additional error messages.
-
Print parameters for SDIO devices.
-
Minor cosmetics.
-
Simplyfy sdmmc_io_set_blocklen function signature by dropping the
extra softc pointer. Aligns with OpenBSD.
-
Missing commit for sdio abort function.
-
More code from OpenBSD
-
no need to splnet() when enqueing packets
-
explicit structure padding
-
make internal functions static
-
also prepare for GPIO interrupts.
-
Avoid warnings for tautological shifts as sole conditional.
-
Follow the Linux driver an use the FDT "compatible" property to build a
filename for the nvram config file, fall back to the standard filename.
E.g.
[Caching 123 nodes and 1093 properties]
compatible 73696e6f 766f6970 2c627069 2d6d322d "sinovoip,bpi-m2-
0010: 7a65726f 00...... ........ ........ zero"
0015: 616c6c77 696e6e65 722c7375 6e38692d "allwinner,sun8i-
0025: 68322d70 6c757300 ........ ........ h2-plus"
interrupt-parent 00000001 ........ ........ ........ ....
model 42616e61 6e612050 69204250 492d4d32 "Banana Pi BPI-M2
0010: 2d5a6572 6f00.... ........ ........ -Zero"
name 00...... ........ ........ ........ ""
serial-number 30326330 30303432 65636431 36376566 02c00042ecd167ef
0010: 00...... ........ ........ ........ .
-rw-r--r-- 1 root wheel 875 Nov 2 12:06 brcmfmac43430-sdio.AP6212.txt
lrwxr-xr-x 1 root wheel 29 Dec 30 16:19 brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt -> brcmfmac43430-sdio.AP6212.txt
-rw-r--r-- 1 root wheel 874 Jun 30 2019 brcmfmac43430-sdio.raspberrypi,3-model-b.txt
-rw-r--r-- 1 root wheel 1864 Jun 30 2019 brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
lrwxr-xr-x 1 root wheel 29 Dec 30 11:24 brcmfmac43455-sdio.raspberrypi,4-model-b-plus.txt -> brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
-
Add product ID for Broadcom BCM43455
-
Use correct firmware for BCM43456
-
size check was backwards.
-
Be less noisy for some commands.
-
Fix DWC_MMC_INT_SDIO_INT bit
-
dwc_mmc fixes:
- Rockchip uses a different SDIO int bit, so take this into consideration
- Avoid unnecessary resets and always wait for resets to complete
- kpause instead of delay while holding spinlock
- Do not attempt autostop for SD_IO_RW_EXTENDED commands
- Allow for sub-blklen byte counts for single block transfers
-
More SDIO stability and performance fixes
 1.10.164.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.35 26-Jul-2011  dyoung Don't copy iobase and iosize members from pcmciabus_attach_args to the
pcmcia_softc because they're not used in any meaningful way.
 1.34 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.33 03-Jul-2008  drochner branches: 1.33.10;
split device/softc
Now I'm through - all my devices are split.
 1.32 23-Feb-2006  gdamore branches: 1.32.38; 1.32.64; 1.32.68; 1.32.70; 1.32.72;
Add new ihandle member to pcmcia_io_handle, similar to pcmcia_mem_handle's
mhandle structure. This is for opaque use by pcmcia chipsets.
 1.31 11-Dec-2005  christos branches: 1.31.2; 1.31.4; 1.31.6;
merge ktrace-lwp.
 1.30 27-Feb-2005  perry branches: 1.30.4;
nuke trailing whitespace
 1.29 04-Feb-2005  perry de-__P
 1.28 12-Aug-2004  mycroft branches: 1.28.4; 1.28.6;
Simplify a little. Pass down the card type from pcmcia_function_enable(),
which just gets it from the config entry for the function it's enabling.
Multifunction cards are defined to be of type I/O on every function, so there
is no possibility of accidentally switching.
 1.27 12-Aug-2004  mycroft If the card is being detached, do not try to write the CCR to disable the
function.
 1.26 12-Aug-2004  mycroft My previous understanding of the I/O base/limit registers was incorrect.
However, so was the old code. Now it works correctly. :-)
 1.25 11-Aug-2004  mycroft Rather than having a call up from the low-level driver to get the card type,
instead have a call down from the PCMCIA mid-layer to set it. Use this from
pcmcia_function_enable(). (Currently the policy is the same, but this would
allow for more flexibility in deciding which mode to use.)

Now it is safe to hold the socket enabled during attach, so do that. Only
one enable/disable cycle to attach a card now!
 1.24 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.23 10-Aug-2004  mycroft Be robust against child devices failing to handle the socket refcnt properly --
force it to 0 when a card is detached, possibly disabling the socket in the
process.

Add several new functions:
* pcmcia_config_alloc(pf, cfe)
Tries to allocate all the I/O and memory spaces in a config entry.
* pcmcia_config_free(pf)
Frees all the I/O and memory spaces for the active configuration.
* pcmcia_config_map(pf)
Maps all the allocated I/O and memory spaces for the active configuration.
* pcmcia_config_unmap(pf)
Unmaps all the allocated I/O and memory spaces for the active configuration.

And two higher-level functions:
* pcmcia_function_configure(pf, validator)
Tries to find a CIS config entry that it can allocate the spaces for. Each
entry is verified by calling the "validator" function -- which can also do
card- and driver-specific fixups. If successful, the regions are all mapped.
* pcmcia_function_unconfigure(pf)
Equivalent to calling both pcmcia_config_unmap() and pcmcia_config_free().

Most drivers are expected to use the latter two functions, which will greatly
reduce the amount of crufty code.
 1.22 09-Aug-2004  mycroft Dispense with all the interrupt multiplexing code here, and assume that the
underlying implementation DTRT. This has the side effect of causing us to
ignore the INTR and INTRACK bits in the CCR -- but this seems for the best
anyway, since they are not reliably implemented. (I note that Linux doesn't
bother either.)
 1.21 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.20 08-Aug-2004  mycroft pcmcia_socket_{enable,disable}() weren't used. Reimplement them as public
functions taking a pcmcia* device structure.

XXX This is a method of last resort for dealing with stupid/insane cards that
we need to probe harder before we can choose a config entry. It should not be
used by most drivers.
 1.19 07-Jul-2004  mycroft More cleanup:
* Print "devinfo" in a canonial place (like we do in the SCSI code).
* Use aprint_{error,normal}() during attach.
* More PCMCIA_STR_* removal.
 1.18 08-Jul-2003  itojun function prototype must not have variable name
 1.17 15-Aug-2002  christos branches: 1.17.6;
Fix multi-function card memory problems:
- centralize pcmcia function allocation and free'ing.
- free the cfe too, not just the pf in the multifunction card case.
- don't free pointers while walking the list, because free() will
fill the memory with deadbeef, thus killing list walking.
 1.16 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.15 15-Dec-2001  soren branches: 1.15.8; 1.15.10;
To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.14 18-Jan-2001  jdolecek branches: 1.14.2; 1.14.4;
constify
 1.13 17-Oct-2000  haya Add a cis decoding function which decodes some CISTPL_FUNCE tuples for
disk and network functions.
 1.12 08-Feb-2000  enami - Don't rely on implicit declaration.
- Sinc wi/ existing coding style.
 1.11 07-Feb-2000  augustss Add a pcmcia_devinfo() function (akin to pci_devinfo). It generates a
string suitable for printing in the attach message.
 1.10 04-Feb-2000  cgd replace the *_lookup table entry match/lookup functions in all of
these drivers with a single common function (which supports tables
of variable-sized structures). Things are mostly as they were before:
tables are terminated by entry with NULL name, etc. There's also
the ability to call a driver-specific match function which can be used
to augment the table lookup.
 1.9 29-Dec-1998  marc branches: 1.9.8;
added support for quirks based on cis strings, added quirk entry for SVEC_LANCARD
 1.8 24-Dec-1998  marc add quirk support for cards which lie extensively about their CIS
 1.7 17-Nov-1998  thorpej Finish implementing interrupt-driven card insertion and removal support.

- Deactivate the card on removal and queue a REMOVAL event for the socket's
event thread to finish the detach.
- Queue an INSERTION event for the socket's event thread on insertion.

Implement a few missing infrastructure pieces to support this.

Hot swapping of PCMCIA cards now "works". (Not quite; things like network
devices need changes for their respestive subsystems. These changes are
coming soon...)
 1.6 10-Oct-1998  thorpej Define missing pcmcia_io_free().
 1.5 19-Jul-1998  christos Add a devlist2h.awk so that we don't sprinkle the same constants over
each device driver file and use it.
 1.4 01-Feb-1998  marc add state to struct pcmcia_function for mfc iobase/iosize support
 1.3 19-Oct-1997  enami Make `manufacturer' and `product' 32bit wide so that they can contain
both 16bit id values found in card CIS and special value to indicate
that no value found in CIS. Use that special value for the card that
doesn't have id values. Test that value in ne2000_match().
 1.2 16-Oct-1997  thorpej Pull marc-pcmcia branch down from trunk.
 1.1 30-Jul-1997  marc branches: 1.1.2;
file pcmciavar.h was initially added on branch marc-pcmcia.
 1.1.2.8 16-Oct-1997  thorpej Copyright/license update.
 1.1.2.7 16-Oct-1997  thorpej Pass down the start and side of the i/o space allocation range to
the "pcmcia" layer so that drivers with Very Special i/o space allocation
needs can know what range they should be dealing with.
 1.1.2.6 14-Oct-1997  thorpej KNF, RCS IDs.
 1.1.2.5 14-Oct-1997  thorpej Allow the i/o address alignment to be specified in the call to
pcmcia_io_alloc(). If the caller does not care about the alignment, 0
should be passed.
 1.1.2.4 23-Aug-1997  thorpej Split up pcmcia_enable_function() into pcmcia_function_init() and
pcmcia_function_enable(). Implement pcmcia_function_disable().
If the enabled count on a socket reaches 0, call the chipset-level
socket disable function. If the enabled count becomes non-0, call
the chipset-level socket enable function.
 1.1.2.3 10-Aug-1997  thorpej Create a structure to encapsulate information about allocated i/o and
mem space on the pcmcia bus. Use this in chip-level window enable
functions rather than making assumptions about the bus space handles.

Also, clean up lots of debugging prints. Use patchables to enable them.
 1.1.2.2 30-Jul-1997  marc add the pcmcia device dir.
 1.1.2.1 30-Jul-1997  marc added pcmcia infrastructure and a few devices
 1.9.8.2 11-Feb-2001  bouyer Sync with HEAD.
 1.9.8.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.14.4.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.14.4.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.14.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.14.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.14.2.2 20-Jun-2002  nathanw Catch up to -current.
 1.14.2.1 08-Jan-2002  nathanw Catch up to -current.
 1.15.10.1 21-Oct-2003  jmc Pullup to rev 1.17 (requested in ticket #699)
Enable support for multi-function pcmcia cards.
 1.15.8.2 29-Aug-2002  gehenna catch up with -current.
 1.15.8.1 20-Jun-2002  gehenna catch up with -current.
 1.17.6.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.17.6.6 04-Feb-2005  skrll Sync with HEAD.
 1.17.6.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.17.6.4 18-Sep-2004  skrll Sync with HEAD.
 1.17.6.3 25-Aug-2004  skrll Sync with HEAD.
 1.17.6.2 12-Aug-2004  skrll Sync with HEAD.
 1.17.6.1 03-Aug-2004  skrll Sync with HEAD
 1.28.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.28.6.1 12-Feb-2005  yamt sync with head.
 1.28.4.1 29-Apr-2005  kent sync with -current
 1.30.4.1 21-Jun-2006  yamt sync with head.
 1.31.6.1 22-Apr-2006  simonb Sync with head.
 1.31.4.1 09-Sep-2006  rpaulo sync with head
 1.31.2.1 01-Mar-2006  yamt sync with head.
 1.32.72.1 18-Jul-2008  simonb Sync with head.
 1.32.70.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.32.68.2 16-May-2009  yamt sync with head
 1.32.68.1 04-May-2009  yamt sync with head.
 1.32.64.1 28-Sep-2008  mjf Sync with HEAD.
 1.32.38.2 06-Nov-2007  joerg Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
three layers (class logic, device logic, bus logic), all of them being
optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
not suspended (even partially), device_is_enabled returns true if the
device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
pnp_system_resume. Before running any suspend/resume handlers, check
that all currently attached devices support power management and bail
out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
can register what events they are interested in and whether the handler
should be global or not.
- Introduce device_active API for devices to mark themselve in use from
either the system or the device. Use this to implement the idle handling
for audio and input devices. This is intended to replace most ad-hoc
watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.
 1.32.38.1 04-Sep-2007  joerg Add a basic generic network power management handler for PCMCIA as well.
Contrary to the versions for PCI/Cardbus, expect the caller to provide
the status variable as we currently have no way in hardware to do that.

This handler should be extended to power down/power up the slots on
D0/D3 transistions.
 1.33.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.45 10-May-2023  riastradh pcmcom(4): Use config_detach_children.
 1.44 25-Sep-2022  thorpej Remove unnecessary include of <sys/malloc.h>.
 1.43 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.42 24-Apr-2021  thorpej branches: 1.42.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.41 08-Dec-2018  thorpej branches: 1.41.14;
Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.40 27-Oct-2012  chs branches: 1.40.36; 1.40.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.39 06-Dec-2009  dyoung branches: 1.39.12; 1.39.22;
device_t/softc split.
 1.38 12-Nov-2009  dyoung Don't use com_activate(), it's gone away. Delete superfluous
activation hook, pcmcom_activate().

Add a child-detachment hook and use it.

Use device_private().

Cosmetic: use __arraycount(). Join a couple of lines. Delete a
set of superfluous parentheses.
 1.37 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.36 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.35 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.34 28-Apr-2008  martin branches: 1.34.8; 1.34.14;
Remove clause 3 and 4 from TNF licenses
 1.33 05-Apr-2008  cegger branches: 1.33.2; 1.33.4;
use aprint_*_dev and device_xname
 1.32 14-Mar-2008  cube Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 1.31 19-Oct-2007  ad branches: 1.31.12; 1.31.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.30 16-Nov-2006  christos branches: 1.30.8; 1.30.22; 1.30.24; 1.30.28;
__unused removal on arguments; approved by core.
 1.29 16-Nov-2006  christos non working dual serial port.
 1.28 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.27 13-Jul-2006  gdamore branches: 1.27.4; 1.27.6;
Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.26 25-Mar-2006  thorpej branches: 1.26.4;
Use device_parent().
 1.25 11-Dec-2005  christos branches: 1.25.4; 1.25.6; 1.25.8; 1.25.10; 1.25.12;
merge ktrace-lwp.
 1.24 26-Aug-2005  drochner kill some more simple submatch() functions, use config_stdsubmatch()
 1.23 25-Aug-2005  drochner replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
 1.22 27-Feb-2005  perry branches: 1.22.4;
nuke trailing whitespace
 1.21 04-Feb-2005  perry de-__P
 1.20 13-Sep-2004  drochner branches: 1.20.4; 1.20.6;
a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
on "locators.h"
 1.19 10-Aug-2004  mycroft Update to the new world order. While I'm here, simplify a lot.
 1.18 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.17 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.16 09-Aug-2004  mycroft Correct the intr_establish order here.
 1.15 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.14 01-Jan-2003  thorpej branches: 1.14.2;
Use aprint_normal() in cfprint routines.
 1.13 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.12 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.11 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.10 27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.9 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.8 12-Jan-2002  tsutsui branches: 1.8.8;
Call malloc(9) with M_ZERO flag instead of memset() after malloc().
 1.7 13-Nov-2001  lukem add RCSIDs
 1.6 24-May-2000  itojun branches: 1.6.6; 1.6.8;
correct pcmcom detach (like card removal). PR 9334.
 1.5 04-Feb-2000  cgd replace the *_lookup table entry match/lookup functions in all of
these drivers with a single common function (which supports tables
of variable-sized structures). Things are mostly as they were before:
tables are terminated by entry with NULL name, etc. There's also
the ability to call a driver-specific match function which can be used
to augment the table lookup.
 1.4 20-Nov-1998  thorpej branches: 1.4.10;
Detach children in reverse order. We are more likely to be able to recycle
cloned unit numbers that way.
 1.3 19-Nov-1998  thorpej Add support for hot-swapping PCMCIA serial devices.
 1.2 14-Oct-1998  thorpej Nuke spurious ;
 1.1 10-Oct-1998  thorpej Device driver for PCMCIA multi-port serial cards. Currently supports
the Socket Communications, Inc. dual-rs232 device.
 1.4.10.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.6.8.4 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.6.8.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.8.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.6.8.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.6.5 03-Jan-2003  thorpej Sync with HEAD.
 1.6.6.4 18-Oct-2002  nathanw Catch up to -current.
 1.6.6.3 20-Jun-2002  nathanw Catch up to -current.
 1.6.6.2 28-Feb-2002  nathanw Catch up to -current.
 1.6.6.1 14-Nov-2001  nathanw Catch up to -current.
 1.8.8.1 20-Jun-2002  gehenna catch up with -current.
 1.14.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.2.4 04-Feb-2005  skrll Sync with HEAD.
 1.14.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1 12-Aug-2004  skrll Sync with HEAD.
 1.20.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.6.1 12-Feb-2005  yamt sync with head.
 1.20.4.1 29-Apr-2005  kent sync with -current
 1.22.4.4 17-Mar-2008  yamt sync with head.
 1.22.4.3 27-Oct-2007  yamt sync with head.
 1.22.4.2 30-Dec-2006  yamt sync with head.
 1.22.4.1 21-Jun-2006  yamt sync with head.
 1.25.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.25.10.1 19-Apr-2006  elad sync with head.
 1.25.8.2 11-Aug-2006  yamt sync with head
 1.25.8.1 01-Apr-2006  yamt sync with head.
 1.25.6.1 22-Apr-2006  simonb Sync with head.
 1.25.4.1 09-Sep-2006  rpaulo sync with head
 1.26.4.3 17-Jun-2006  gdamore Undo the undo. Restore COM_INIT_REGS.
 1.26.4.2 17-Jun-2006  gdamore Revert COM_INIT_REGS.
 1.26.4.1 15-Jun-2006  gdamore Adapt to new com framework.
 1.27.6.2 10-Dec-2006  yamt sync with head.
 1.27.6.1 22-Oct-2006  yamt sync with head
 1.27.4.1 18-Nov-2006  ad Sync with head.
 1.30.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.30.24.2 23-Mar-2008  matt sync with HEAD
 1.30.24.1 06-Nov-2007  matt sync with HEAD
 1.30.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.30.8.1 23-Oct-2007  ad Sync with head.
 1.31.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.31.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.31.12.1 24-Mar-2008  keiichi sync with head.
 1.33.4.4 11-Mar-2010  yamt sync with head
 1.33.4.3 16-May-2009  yamt sync with head
 1.33.4.2 04-May-2009  yamt sync with head.
 1.33.4.1 16-May-2008  yamt sync with head.
 1.33.2.1 18-May-2008  yamt sync with head.
 1.34.14.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.34.8.1 28-Apr-2009  skrll Sync with HEAD.
 1.39.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.39.12.1 30-Oct-2012  yamt sync with head
 1.40.38.1 10-Jun-2019  christos Sync with HEAD
 1.40.36.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.41.14.2 22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.41.14.1 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.42.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.10 23-Apr-2016  skrll Merge nick-nhusb

- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
 1.9 27-Nov-2011  rmind branches: 1.9.8; 1.9.24; 1.9.26; 1.9.30;
G/C unnecessary IPL_HARDUSB
 1.8 08-Mar-2011  kiyohara branches: 1.8.4;
Fix hci_private data. slhci(4) is assuming, it is slhci_softc. not device_t.
 1.7 04-Nov-2010  pgoyette branches: 1.7.2;
Don't include the now non-existent usb_port.h
 1.6 12-May-2009  cegger branches: 1.6.2; 1.6.4;
struct device * -> device_t, no functional changes intended.
 1.5 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.4 28-Mar-2008  drochner branches: 1.4.4; 1.4.18;
split device/softc for USB host controllers and the usb (control)
device,
this is hairy stuff, and I've only tested with uhci/ehci at pci,
please test the rest and report problems
 1.3 19-Oct-2007  ad branches: 1.3.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.2 16-Aug-2007  kiyohara branches: 1.2.2; 1.2.4; 1.2.6; 1.2.8; 1.2.12;
Replace to Matthew Orgass's slhci(4).
http://mail-index.netbsd.org/tech-kern/2007/06/26/0001.html
 1.1 22-May-2007  itohy branches: 1.1.2; 1.1.6;
file slhci_pcmcia.c was initially added on branch itohy-usb1.
 1.1.6.2 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.1.6.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.1.2.1 22-May-2007  itohy Overhaul of USB stack, mostly DMA related

This applies to NetBSD 4.99.13 (March 1, 2007)

usbdi(9) interface is based on FreeBSD version, excluding
- removal of portability code

Patch most NetBSD changes, excluding
- DMA memory "reserve", since we don't need contiguous buffers any longer
- volatiles in DMA structure, since it should not be needed
with proper bus_dmamap_sync(9)s

DMA/non-DMA memory management overhaul
- Move all DMA related code to usb_mem.[ch]
(add usb_alloc_buffer_dma(), usb_free_buffer_dma(), etc.).
XXX Should usb_mem.[ch] be renamed as usb_mem_dma.[ch] ?
- Add corresponding non-DMA code to usb_mem_nodma.[ch] .
Currently just use malloc(9).
- Above files are conditionally used by config framework (added
attributes to conf/files and dev/usb/files.usb).
- Add diagnostic panics when resource allocation is requested
on interrupt context.
- Change memory allocations (that require context) from NOWAIT to WAITOK.

Allocate DMA/non-DMA buffer per host interface, not globally.
advantage: Buffers can be freed on detaching host interface.
Activity of a host interface does not affect others.
disadvantages: It possibly consumes more memory.

API changes
- usbd_alloc_xfer() is changed:
old: usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev);
new: usbd_xfer_handle usbd_alloc_xfer(usbd_device_handle dev,
usbd_pipe_handle pipe);
- pipe argument of usbd_setup_*xfer() are now unused
XXX the pipe argument should be removed?
- add mapping APIs
- async request will be processed as a task (kernel thread context),
and delayed to some extent
- usbdivar.h: struct usbd_xfer: renamed a member "allocbuf" to "hcbuffer"
(mapped/allocated/refered buffer for HCI driver)
- usb_port.h: change usb_proc_ptr from struct ptoc * to struct lwp *
- usb_port.h: add usb_sigproc_ptr for psignal(9) (struct proc *)
- usb.h: add UE_MAXPKTSZ(ep) and UE_MAXPKTSZ_MASK macros for USB 2.0

changes to USB device drivers
- atu, aue, axe, cdce, cue, kue, rum, udav, upl, ural, url,
uaudio, ubt, ucom, ugen, uhidev, uirda, ulpt, umidi, urio,
uscanner, ustir, utoppy:
* catch up API change of usbd_alloc_xfer()
- umass, usscanner:
* catch up API change of usbd_alloc_xfer()
* eliminate memory copy for large transfer

ohci
- free resources on detach
- add lots of bus_dmamap_sync() operations
- simplify the code of loading std chain
- rewrite code of looking up TD/ITD from DMA addr by using allocation chunk
- add workaround for CMD Tech 670 and 673 chipsets
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf

slhci
- allocate xfer and slhci_xfer at once, and simplify relevant code
- add slhci_detach()
- remove second arg of slhci_attach() since it is the same as the first arg.
- add support for "mapping" (no, it doesn't map since it doesn't do DMA)
buffer and mbuf
- add pcmcia frontend
- NOT TESTED, missing hardware

ehci
- add lots of bus_dmamap_sync() operations, possibly too many
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf
- done only simple test

uhci
- add lots of bus_dmamap_sync() operations, possibly too many
- make sure resources are not allocated in interrupt context
- add support for mapping buffer and mbuf

To do
- review, test, debug
- rewrite network drivers to utilize usbd_map_buffer_mbuf()
- rewrite uaudio(4) to eliminate memcpy
- "pipe" argument of usbd_setup_*xfer() should eventually be removed
 1.2.12.1 25-Oct-2007  bouyer Sync with HEAD.
 1.2.8.3 27-Oct-2007  yamt sync with head.
 1.2.8.2 03-Sep-2007  yamt sync with head.
 1.2.8.1 16-Aug-2007  yamt file slhci_pcmcia.c was added on branch yamt-lazymbuf on 2007-09-03 14:38:06 +0000
 1.2.6.2 03-Sep-2007  skrll Sync with HEAD.
 1.2.6.1 16-Aug-2007  skrll file slhci_pcmcia.c was added on branch nick-csl-alignment on 2007-09-03 10:21:57 +0000
 1.2.4.1 06-Nov-2007  matt sync with HEAD
 1.2.2.3 23-Oct-2007  ad Sync with head.
 1.2.2.2 20-Aug-2007  ad Sync with HEAD.
 1.2.2.1 16-Aug-2007  ad file slhci_pcmcia.c was added on branch vmlocking on 2007-08-20 22:07:05 +0000
 1.3.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.4.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.4.4.1 16-May-2009  yamt sync with head
 1.6.4.2 21-Apr-2011  rmind sync with head
 1.6.4.1 05-Mar-2011  rmind sync with head
 1.6.2.1 06-Nov-2010  uebayasi Sync with HEAD.
 1.7.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.8.4.1 17-Apr-2012  yamt sync with head
 1.9.30.1 06-Sep-2016  skrll First pass at netbsd-7 updated with USB code from HEAD
 1.9.26.1 03-Dec-2014  skrll The grand renaming of structure members.

No functional change.
 1.9.24.1 05-Apr-2017  snj Pull up following revision(s) (requested by skrll in ticket #1395):
share/man/man4/axe.4: netbsd-7-nhusb
share/man/man4/axen.4: netbsd-7-nhusb
share/man/man4/cdce.4: netbsd-7-nhusb
share/man/man4/uaudio.4: netbsd-7-nhusb
share/man/man4/ucom.4: netbsd-7-nhusb
share/man/man4/uep.4: netbsd-7-nhusb
share/man/man4/urtw.4: netbsd-7-nhusb
share/man/man4/usb.4: netbsd-7-nhusb
share/man/man4/uyap.4: netbsd-7-nhusb
share/man/man4/xhci.4: netbsd-7-nhusb
share/man/man9/usbdi.9: netbsd-7-nhusb
sys/arch/amd64/conf/ALL: netbsd-7-nhusb
sys/arch/amd64/conf/GENERIC: netbsd-7-nhusb
sys/arch/amiga/dev/slhci_zbus.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_otg.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_usb.c: netbsd-7-nhusb
sys/arch/arm/amlogic/amlogic_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/at91/at91ohci.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm2835_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm53xx_usb.c: netbsd-7-nhusb
sys/arch/arm/ep93xx/epohci.c: netbsd-7-nhusb
sys/arch/arm/gemini/obio_ehci.c: netbsd-7-nhusb
sys/arch/arm/imx/files.imx23: netbsd-7-nhusb
sys/arch/arm/imx/imxusb.c: netbsd-7-nhusb
sys/arch/arm/imx/imxusbreg.h: netbsd-7-nhusb
sys/arch/arm/omap/obio_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/omap3_ehci.c: netbsd-7-nhusb
sys/arch/arm/omap/omapl1x_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/tiotg.c: netbsd-7-nhusb
sys/arch/arm/s3c2xx0/ohci_s3c24x0.c: netbsd-7-nhusb
sys/arch/arm/samsung/exynos_usb.c: netbsd-7-nhusb
sys/arch/arm/xscale/pxa2x0_ohci.c: netbsd-7-nhusb
sys/arch/arm/zynq/zynq_usb.c: netbsd-7-nhusb
sys/arch/hpcarm/dev/nbp_slhci.c: netbsd-7-nhusb
sys/arch/hpcmips/dev/plumohci.c: netbsd-7-nhusb
sys/arch/i386/conf/ALL: netbsd-7-nhusb
sys/arch/i386/conf/GENERIC: netbsd-7-nhusb
sys/arch/i386/pci/gcscehci.c: netbsd-7-nhusb
sys/arch/luna68k/conf/GENERIC: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahci.c: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahcivar.h: netbsd-7-nhusb
sys/arch/mips/alchemy/dev/ohci_aubus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ehci_arbus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ohci_arbus.c: netbsd-7-nhusb
sys/arch/mips/conf/files.adm5120: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ehci.c: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ohci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ehci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ohci.c: netbsd-7-nhusb
sys/arch/playstation2/dev/ohci_sbus.c: netbsd-7-nhusb
sys/arch/powerpc/booke/dev/pq3ehci.c: netbsd-7-nhusb
sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c: netbsd-7-nhusb
sys/arch/x68k/dev/slhci_intio.c: netbsd-7-nhusb
sys/conf/files: netbsd-7-nhusb
sys/dev/cardbus/ehci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/ohci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/uhci_cardbus.c: netbsd-7-nhusb
sys/dev/ic/sl811hs.c: netbsd-7-nhusb
sys/dev/ic/sl811hsvar.h: netbsd-7-nhusb
sys/dev/isa/slhci_isa.c: netbsd-7-nhusb
sys/dev/marvell/ehci_mv.c: netbsd-7-nhusb
sys/dev/pci/ehci_pci.c: netbsd-7-nhusb
sys/dev/pci/ohci_pci.c: netbsd-7-nhusb
sys/dev/pci/uhci_pci.c: netbsd-7-nhusb
sys/dev/pci/xhci_pci.c: netbsd-7-nhusb
sys/dev/pcmcia/slhci_pcmcia.c: netbsd-7-nhusb
sys/dev/usb/Makefile.usbdevs: netbsd-7-nhusb
sys/dev/usb/TODO: netbsd-7-nhusb
sys/dev/usb/TODO.usbmp: netbsd-7-nhusb
sys/dev/usb/aubtfwl.c: netbsd-7-nhusb
sys/dev/usb/auvitek.c: netbsd-7-nhusb
sys/dev/usb/auvitek_audio.c: netbsd-7-nhusb
sys/dev/usb/auvitek_dtv.c: netbsd-7-nhusb
sys/dev/usb/auvitek_i2c.c: netbsd-7-nhusb
sys/dev/usb/auvitek_video.c: netbsd-7-nhusb
sys/dev/usb/auvitekvar.h: netbsd-7-nhusb
sys/dev/usb/ehci.c: netbsd-7-nhusb
sys/dev/usb/ehcireg.h: netbsd-7-nhusb
sys/dev/usb/ehcivar.h: netbsd-7-nhusb
sys/dev/usb/emdtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_dtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_ir.c: netbsd-7-nhusb
sys/dev/usb/emdtvvar.h: netbsd-7-nhusb
sys/dev/usb/ezload.c: netbsd-7-nhusb
sys/dev/usb/ezload.h: netbsd-7-nhusb
sys/dev/usb/files.usb: netbsd-7-nhusb
sys/dev/usb/hid.c: netbsd-7-nhusb
sys/dev/usb/hid.h: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.c: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.h: netbsd-7-nhusb
sys/dev/usb/if_atu.c: netbsd-7-nhusb
sys/dev/usb/if_atureg.h: netbsd-7-nhusb
sys/dev/usb/if_aue.c: netbsd-7-nhusb
sys/dev/usb/if_auereg.h: netbsd-7-nhusb
sys/dev/usb/if_axe.c: netbsd-7-nhusb
sys/dev/usb/if_axen.c: netbsd-7-nhusb
sys/dev/usb/if_axenreg.h: netbsd-7-nhusb
sys/dev/usb/if_axereg.h: netbsd-7-nhusb
sys/dev/usb/if_cdce.c: netbsd-7-nhusb
sys/dev/usb/if_cdcereg.h: netbsd-7-nhusb
sys/dev/usb/if_cue.c: netbsd-7-nhusb
sys/dev/usb/if_cuereg.h: netbsd-7-nhusb
sys/dev/usb/if_kue.c: netbsd-7-nhusb
sys/dev/usb/if_kuereg.h: netbsd-7-nhusb
sys/dev/usb/if_otus.c: netbsd-7-nhusb
sys/dev/usb/if_otusvar.h: netbsd-7-nhusb
sys/dev/usb/if_rum.c: netbsd-7-nhusb
sys/dev/usb/if_rumreg.h: netbsd-7-nhusb
sys/dev/usb/if_rumvar.h: netbsd-7-nhusb
sys/dev/usb/if_run.c: netbsd-7-nhusb
sys/dev/usb/if_runvar.h: netbsd-7-nhusb
sys/dev/usb/if_smsc.c: netbsd-7-nhusb
sys/dev/usb/if_smscreg.h: netbsd-7-nhusb
sys/dev/usb/if_smscvar.h: netbsd-7-nhusb
sys/dev/usb/if_udav.c: netbsd-7-nhusb
sys/dev/usb/if_udavreg.h: netbsd-7-nhusb
sys/dev/usb/if_upgt.c: netbsd-7-nhusb
sys/dev/usb/if_upgtvar.h: netbsd-7-nhusb
sys/dev/usb/if_upl.c: netbsd-7-nhusb
sys/dev/usb/if_ural.c: netbsd-7-nhusb
sys/dev/usb/if_uralreg.h: netbsd-7-nhusb
sys/dev/usb/if_uralvar.h: netbsd-7-nhusb
sys/dev/usb/if_url.c: netbsd-7-nhusb
sys/dev/usb/if_urlreg.h: netbsd-7-nhusb
sys/dev/usb/if_urndis.c: netbsd-7-nhusb
sys/dev/usb/if_urndisreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtw.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn_data.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnvar.h: netbsd-7-nhusb
sys/dev/usb/if_urtwreg.h: netbsd-7-nhusb
sys/dev/usb/if_zyd.c: netbsd-7-nhusb
sys/dev/usb/if_zydreg.h: netbsd-7-nhusb
sys/dev/usb/irmce.c: netbsd-7-nhusb
sys/dev/usb/moscom.c: netbsd-7-nhusb
sys/dev/usb/motg.c: netbsd-7-nhusb
sys/dev/usb/motgvar.h: netbsd-7-nhusb
sys/dev/usb/ohci.c: netbsd-7-nhusb
sys/dev/usb/ohcireg.h: netbsd-7-nhusb
sys/dev/usb/ohcivar.h: netbsd-7-nhusb
sys/dev/usb/pseye.c: netbsd-7-nhusb
sys/dev/usb/slurm.c: netbsd-7-nhusb
sys/dev/usb/stuirda.c: netbsd-7-nhusb
sys/dev/usb/u3g.c: netbsd-7-nhusb
sys/dev/usb/uark.c: netbsd-7-nhusb
sys/dev/usb/uatp.c: netbsd-7-nhusb
sys/dev/usb/uaudio.c: netbsd-7-nhusb
sys/dev/usb/uberry.c: netbsd-7-nhusb
sys/dev/usb/ubsa.c: netbsd-7-nhusb
sys/dev/usb/ubsa_common.c: netbsd-7-nhusb
sys/dev/usb/ubsavar.h: netbsd-7-nhusb
sys/dev/usb/ubt.c: netbsd-7-nhusb
sys/dev/usb/uchcom.c: netbsd-7-nhusb
sys/dev/usb/ucom.c: netbsd-7-nhusb
sys/dev/usb/ucomvar.h: netbsd-7-nhusb
sys/dev/usb/ucycom.c: netbsd-7-nhusb
sys/dev/usb/udl.c: netbsd-7-nhusb
sys/dev/usb/udl.h: netbsd-7-nhusb
sys/dev/usb/udsbr.c: netbsd-7-nhusb
sys/dev/usb/udsir.c: netbsd-7-nhusb
sys/dev/usb/uep.c: netbsd-7-nhusb
sys/dev/usb/uftdi.c: netbsd-7-nhusb
sys/dev/usb/uftdireg.h: netbsd-7-nhusb
sys/dev/usb/ugen.c: netbsd-7-nhusb
sys/dev/usb/ugensa.c: netbsd-7-nhusb
sys/dev/usb/uhci.c: netbsd-7-nhusb
sys/dev/usb/uhcireg.h: netbsd-7-nhusb
sys/dev/usb/uhcivar.h: netbsd-7-nhusb
sys/dev/usb/uhid.c: netbsd-7-nhusb
sys/dev/usb/uhidev.c: netbsd-7-nhusb
sys/dev/usb/uhidev.h: netbsd-7-nhusb
sys/dev/usb/uhmodem.c: netbsd-7-nhusb
sys/dev/usb/uhso.c: netbsd-7-nhusb
sys/dev/usb/uhub.c: netbsd-7-nhusb
sys/dev/usb/uipad.c: netbsd-7-nhusb
sys/dev/usb/uipaq.c: netbsd-7-nhusb
sys/dev/usb/uirda.c: netbsd-7-nhusb
sys/dev/usb/uirdavar.h: netbsd-7-nhusb
sys/dev/usb/ukbd.c: netbsd-7-nhusb
sys/dev/usb/ukbdmap.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.h: netbsd-7-nhusb
sys/dev/usb/ulpt.c: netbsd-7-nhusb
sys/dev/usb/umass.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.h: netbsd-7-nhusb
sys/dev/usb/umass_quirks.c: netbsd-7-nhusb
sys/dev/usb/umass_quirks.h: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.c: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.h: netbsd-7-nhusb
sys/dev/usb/umassvar.h: netbsd-7-nhusb
sys/dev/usb/umcs.c: netbsd-7-nhusb
sys/dev/usb/umct.c: netbsd-7-nhusb
sys/dev/usb/umidi.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.h: netbsd-7-nhusb
sys/dev/usb/umodem.c: netbsd-7-nhusb
sys/dev/usb/umodem_common.c: netbsd-7-nhusb
sys/dev/usb/umodemvar.h: netbsd-7-nhusb
sys/dev/usb/ums.c: netbsd-7-nhusb
sys/dev/usb/uplcom.c: netbsd-7-nhusb
sys/dev/usb/urio.c: netbsd-7-nhusb
sys/dev/usb/urio.h: netbsd-7-nhusb
sys/dev/usb/usb.c: netbsd-7-nhusb
sys/dev/usb/usb.h: netbsd-7-nhusb
sys/dev/usb/usb_mem.c: netbsd-7-nhusb
sys/dev/usb/usb_mem.h: netbsd-7-nhusb
sys/dev/usb/usb_quirks.c: netbsd-7-nhusb
sys/dev/usb/usb_quirks.h: netbsd-7-nhusb
sys/dev/usb/usb_subr.c: netbsd-7-nhusb
sys/dev/usb/usbdevices.config: netbsd-7-nhusb
sys/dev/usb/usbdevs: netbsd-7-nhusb
sys/dev/usb/usbdevs.h: netbsd-7-nhusb
sys/dev/usb/usbdevs_data.h: netbsd-7-nhusb
sys/dev/usb/usbdi.c: netbsd-7-nhusb
sys/dev/usb/usbdi.h: netbsd-7-nhusb
sys/dev/usb/usbdi_util.c: netbsd-7-nhusb
sys/dev/usb/usbdi_util.h: netbsd-7-nhusb
sys/dev/usb/usbdivar.h: netbsd-7-nhusb
sys/dev/usb/usbhid.h: netbsd-7-nhusb
sys/dev/usb/usbhist.h: netbsd-7-nhusb
sys/dev/usb/usbroothub.c: netbsd-7-nhusb
sys/dev/usb/usbroothub.h: netbsd-7-nhusb
sys/dev/usb/usbroothub_subr.c: delete
sys/dev/usb/usbroothub_subr.h: delete
sys/dev/usb/uscanner.c: netbsd-7-nhusb
sys/dev/usb/uslsa.c: netbsd-7-nhusb
sys/dev/usb/usscanner.c: netbsd-7-nhusb
sys/dev/usb/ustir.c: netbsd-7-nhusb
sys/dev/usb/uthum.c: netbsd-7-nhusb
sys/dev/usb/utoppy.c: netbsd-7-nhusb
sys/dev/usb/uts.c: netbsd-7-nhusb
sys/dev/usb/uvideo.c: netbsd-7-nhusb
sys/dev/usb/uvisor.c: netbsd-7-nhusb
sys/dev/usb/uvscom.c: netbsd-7-nhusb
sys/dev/usb/uyap.c: netbsd-7-nhusb
sys/dev/usb/uyap_firmware.h: netbsd-7-nhusb
sys/dev/usb/uyurex.c: netbsd-7-nhusb
sys/dev/usb/x1input_rdesc.h: netbsd-7-nhusb
sys/dev/usb/xhci.c: netbsd-7-nhusb
sys/dev/usb/xhcireg.h: netbsd-7-nhusb
sys/dev/usb/xhcivar.h: netbsd-7-nhusb
sys/dev/usb/xinput_rdesc.h: netbsd-7-nhusb
sys/external/bsd/common/conf/files.linux: netbsd-7-nhusb
sys/external/bsd/common/include/linux/err.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/kernel.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/workqueue.h: netbsd-7-nhusb
sys/external/bsd/common/linux/linux_work.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/drm/files.drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/i915drm/files.i915drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/include/linux/err.h: delete
sys/external/bsd/drm2/include/linux/workqueue.h: delete
sys/external/bsd/drm2/linux/files.drmkms_linux: netbsd-7-nhusb
sys/external/bsd/drm2/linux/linux_work.c: delete
sys/external/bsd/dwc2/dwc2.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2var.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwctwo2netbsd: netbsd-7-nhusb
sys/external/bsd/dwc2/conf/files.dwc2: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_coreintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdddma.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hw.h: netbsd-7-nhusb
sys/modules/drmkms_linux/Makefile: netbsd-7-nhusb
sys/modules/i915drmkms/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libugenhc/ugenhc.c: netbsd-7-nhusb
sys/rump/dev/lib/libusb/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libusb/USB.ioconf: netbsd-7-nhusb
sys/rump/dev/lib/libusb/usb_at_ugenhc.c: delete
sys/rump/dev/lib/libusb/opt/opt_usb.h: delete
sys/rump/dev/lib/libusb/opt/opt_usbverbose.h: delete
sys/sys/mbuf.h: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.8: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.c: netbsd-7-nhusb
Merge netbsd-7-nhusb:
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
- Change the SOFTINT level from NET to SERIAL for the USB softint handler.
This gives the callback a chance of running when another softint handler
at SOFTINT_NET has blocked holding a lock, e.g. softnet_lock and most of
the network stack.
- kern/49065 - ifconfig tun0 ... sequence locks up system / lockup:
softnet_lock held across usb xfr
- kern/50491 - unkillable wait in usbd_transfer while using usmsc0
on raspberry pi 2
- kern/51395 - USB Ethernet makes xhci hang
- Various improvements to slhci(4)
- Various improvements to dwc2(4)
 1.9.8.1 03-Dec-2017  jdolecek update from HEAD
 1.21 12-Nov-2009  dyoung Remove superfluous activation hook.

Add a child-detachment hook.
 1.20 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.19 31-Mar-2008  tsutsui branches: 1.19.2; 1.19.4;
Split softc/device_t for spc(4) and misc related cleanup.
 1.18 19-Oct-2007  ad branches: 1.18.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.17 16-Nov-2006  christos branches: 1.17.8; 1.17.22; 1.17.24; 1.17.28;
__unused removal on arguments; approved by core.
 1.16 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.15 11-Dec-2005  christos branches: 1.15.20; 1.15.22;
merge ktrace-lwp.
 1.14 27-Feb-2005  perry branches: 1.14.4;
nuke trailing whitespace
 1.13 04-Feb-2005  perry de-__P
 1.12 10-Aug-2004  mycroft branches: 1.12.4; 1.12.6;
Rather than the silly state machine, set whatever higher-level reference
count there is (for SCSI, adapt_refcnt) to 1 and call the appropriate
"delref" function afterwards to disable the controller. This is a bit
simpler.

In a couple of cases, just remove the state machine, because it wasn't
really necessary.
 1.11 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.10 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.9 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.8 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.7 10-Aug-2004  mycroft Remove some useless code.
 1.6 10-Aug-2004  mycroft Update to the new world order.
 1.5 09-Aug-2004  mycroft Do io_map() and intr_establish() before enabling the function, always. This
prevents "stray interrupts" during attach.
 1.4 09-Aug-2004  mycroft Pass a valid alignment to pcmcia_io_alloc().
 1.3 09-Aug-2004  mycroft Add detach support for spc@pcmcia, modeled after aic@pcmcia.
 1.2 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.1 07-Jul-2004  mycroft branches: 1.1.2;
Add a quick-and-dirty attachment for my MB87030-based PCMCIA SCSI controller.
XXX Don't even think about detaching it yet.
 1.1.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.2.6 04-Feb-2005  skrll Sync with HEAD.
 1.1.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.1.2.3 12-Aug-2004  skrll Sync with HEAD.
 1.1.2.2 03-Aug-2004  skrll Sync with HEAD
 1.1.2.1 07-Jul-2004  skrll file spc_pcmcia.c was added on branch ktrace-lwp on 2004-08-03 10:50:18 +0000
 1.12.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.12.6.1 12-Feb-2005  yamt sync with head.
 1.12.4.1 29-Apr-2005  kent sync with -current
 1.14.4.2 27-Oct-2007  yamt sync with head.
 1.14.4.1 30-Dec-2006  yamt sync with head.
 1.15.22.2 10-Dec-2006  yamt sync with head.
 1.15.22.1 22-Oct-2006  yamt sync with head
 1.15.20.1 18-Nov-2006  ad Sync with head.
 1.17.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.17.24.1 06-Nov-2007  matt sync with HEAD
 1.17.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.17.8.1 23-Oct-2007  ad Sync with head.
 1.18.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.18.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.19.4.2 11-Mar-2010  yamt sync with head
 1.19.4.1 16-May-2008  yamt sync with head.
 1.19.2.1 18-May-2008  yamt sync with head.
 1.130 25-Sep-2022  thorpej Remove unnecessary include of <sys/malloc.h>.
 1.129 05-Oct-2021  rin Advertise ATAC_CAP_DATA32 also for memory-mapped mode.

It seems that this flag bit is not enabled because memory-mapped mode
has its own wdc_softc:data{in,out}_pio routines. However, nowadays,
32-bit data access capability of a disk drive is not checked by ata(4)
backend unless this flag bit is set.

Tested with CF cards of few vendors and hd64461pcmcia(4) found for some
hpcsh machine models.
 1.128 05-Oct-2021  rin Do not establish the unused interrupt handler for memory-mapped mode,
for the sake of clarity.
 1.127 03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.126 20-Oct-2017  jdolecek branches: 1.126.2; 1.126.4;
move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606
 1.125 07-Oct-2017  jdolecek Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)
 1.124 12-Oct-2013  christos branches: 1.124.18;
Pass the device name in, so we can debug what deferred drivers did not work.
 1.123 31-Jul-2012  bouyer branches: 1.123.2; 1.123.4;
Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
 1.122 26-Jul-2012  jakllsch Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
 1.121 24-Jul-2012  jakllsch Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.
 1.120 15-Jul-2012  dsl Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.
 1.119 05-Jul-2012  joerg Fix use of uninitialized variable.
 1.118 02-Jul-2012  bouyer Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
when SATA cable move was needed
 1.117 12-Nov-2009  dyoung branches: 1.117.12;
Remove superfluous activation hook.
 1.116 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.115 05-Apr-2009  uwe Register with pmf(9), tell it we don't need anything.
 1.114 21-Mar-2009  drochner Work around a problem with PCMCIA adapter drivers (eg for hpc*) which
attach pcmcia devices before interrupts are enabled. This is unclean
because pcmcia drivers use tsleep(9) in the attach code path but it
worked all the time and it is too late to change this on the 5.0 branch.
So just tolerate it.
Fixes a regression on hpcsh reported by Valeriy E. Ushakov.
 1.113 06-Feb-2009  drochner branches: 1.113.2;
-in the wdc@pcmcia driver, don't try to powerup/down while cold or
shutting down -- this is only supposed to happen from the pcmcia
kernel thread while the system is running
-in wd_shutdown, call ata_addref first, so that the adapter is either
active or we know that it isn't
This fixes a hang on shutdown-p reported by Dennis den Brok per
PR kern/40531. Verified by by Dennis and me.
(reported against 5.0-Beta, so this is a pullup candidate)
 1.112 05-Jun-2008  uwe branches: 1.112.6; 1.112.8;
aprint_naive("\n") in attach.
 1.111 28-Apr-2008  martin branches: 1.111.2;
Remove clause 3 and 4 from TNF licenses
 1.110 18-Mar-2008  cube branches: 1.110.2; 1.110.4;
Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
 1.109 19-Oct-2007  ad branches: 1.109.12; 1.109.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.108 16-Nov-2006  christos branches: 1.108.8; 1.108.22; 1.108.24; 1.108.28;
__unused removal on arguments; approved by core.
 1.107 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.106 19-Jun-2006  christos branches: 1.106.4; 1.106.6;
Add another rogue card.
 1.105 26-Mar-2006  bouyer branches: 1.105.4;
As we are going to sleep here, we need to use
config_pending_incr()/config_pending_decr() so that disks are probed
before trying to mount root, if the card is plugged in at boot time.
Should fix kern/33137 by KIYOHARA Takashi.
 1.104 22-Jan-2006  christos branches: 1.104.2; 1.104.4; 1.104.6; 1.104.8; 1.104.10;
Default to 2 drives for products not listed.
 1.103 16-Jan-2006  bouyer properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.
 1.102 11-Jan-2006  christos Add SanDisk pcmcia memory card adapter. Works like an IDE drive.
XXX: Linux driver has a hack not to probe the slave drive. We just
create a phantom drive:

wdc0 at pcmcia0 function 0: < , Memory Card Adapter II, V1.00>
wdc0: i/o mapped mode
atabus2 at wdc0 channel 0
wd1 at atabus2 drive 0: <Memory Card Adapter II>
wd1: drive supports 1-sector PIO transfers, LBA addressing
wd1: 241 MB, 965 cyl, 16 head, 32 sec, 512 bytes/sect x 494080 sectors
wd2 at atabus2 drive 1: <>
wd2: drive supports 1-sector PIO transfers, chs addressing
wd2: 0, 0 cyl, 0 head, 0 sec, 512 bytes/sect x 0 sectors
wd2: 32-bit data port
wd2: disk label read failed
wd2: disk label read failed
 1.101 11-Dec-2005  christos branches: 1.101.2;
merge ktrace-lwp.
 1.100 19-Jun-2005  bouyer branches: 1.100.2;
When the PCMCIA socket is powered up, the driver waits for the PCMCIA
controller to be ready, but the drive attached to it may not be ready yet.
Add a half a second delay before calling wdcattach(), to let the drive
have its electronic ready to properly respond to the register tests done
in wdcprobe1(). Delay based on experiments done by John Refling with
various devices as part of the audit-trail of kern/25659; complete
the fix for kern/25659.
 1.99 11-Mar-2005  matt branches: 1.99.2;
Just like wdc.c, if the bus_space implementation doesn't support stream
method, make them equivalent to the non-stream methods.
 1.98 27-Feb-2005  perry nuke trailing whitespace
 1.97 03-Oct-2004  toshii branches: 1.97.4; 1.97.6;
Make this compile on arches without __BUS_SPACE_HAS_STREAM_METHODS.
 1.96 07-Sep-2004  enami No need to disable if we failed before enabling it.
 1.95 20-Aug-2004  thorpej Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
 1.94 19-Aug-2004  thorpej Use ANSI function decls and "static".
 1.93 19-Aug-2004  thorpej - Add and use a CHAN_TO_WDC() macro to get the wdc_softc from an
ata_channel.
- Add and use a CHAN_TO_WDC_REGS() macro to get the wdc_regs from an
ata_channel.
- Add and use a CHAN_TO_PCIIDE() macro to get the pciide_softc from an
ata_channel.
- Add and use a CHAN_TO_PCHAN() macro to get the pciide_channel from an
ata_channel. (This one just hides a cast, and is really just for
consistency with the others.)
 1.92 16-Aug-2004  mycroft wdc_init_shadow_regs() must now be called after ch_wdc is filled in, or we get
a null pointer dereference.
 1.91 14-Aug-2004  thorpej - Split the register handles out of struct wdc_channel into a separate
wdc_regs structure, and array of which (indexed per channel) is pointed
to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
ata_channel. Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
maximum number of drives that can be present on the channel. For now,
this is always 2. Add an ATA_MAXDRIVES constant that places an upper
limit on this value, also currently 2.
 1.90 13-Aug-2004  mycroft Rearrange slightly so that we don't blow up if the card disappears during the
initial enable.
 1.89 12-Aug-2004  thorpej Move wdc_addref() and wdc_delref() to ata.c and rename them to
ata_*.
 1.88 11-Aug-2004  mycroft We don't need to implement DRIVE_NOSTREAM here, 'cause we never set
WDC_CAPABILITY_NOSTREAM.
 1.87 11-Aug-2004  mycroft "I was mistaken."
The memory window is not actually activate in I/O card configurations. It was
transparently falling back to 16-bit I/O mode.
Implement "memory card" mode correctly, with polling.
 1.86 11-Aug-2004  mycroft Make datain_pio and dataout_pio function pointers in wdc_softc, which can
be overridden by the backend if desired. Add experimental code to wdc_pcmcia
to use this in memory-mapped mode, disabled by default.
 1.85 11-Aug-2004  mycroft The memory mode we were trying to use before is a total loss -- we don't get
any interrupts, and therefore wedge on any access. However, there is another
memory mode that gives us a memory-mapped data register, which we can use.
Also set the new "DATA1K" flag to tell the wdc backend that we have a large
data area to read from -- this can be used with the region methods.
 1.84 10-Aug-2004  mycroft GC some unneeded struct elements.
 1.83 10-Aug-2004  mycroft Rather than the silly state machine, set whatever higher-level reference
count there is (for SCSI, adapt_refcnt) to 1 and call the appropriate
"delref" function afterwards to disable the controller. This is a bit
simpler.

In a couple of cases, just remove the state machine, because it wasn't
really necessary.
 1.82 10-Aug-2004  mycroft Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.81 10-Aug-2004  mycroft Enhance pcmcia_product_lookup():
* Remove the "expected function" value. This was just causing problems with
multifunction cards. Differentiating the functions is better done by
checking the function type (which we now do in ep and sm).
* Add support for matching CIS strings. This necessitated changing the calling
pattern a little too.

Use this enhanced version rather than driver-specific versions that do the
same thing.

Also, remove the last vestiges of PCMCIA_STR_*.
 1.80 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.79 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.78 10-Aug-2004  mycroft Copyright maintenance.
 1.77 10-Aug-2004  mycroft Remove some useless code.
 1.76 10-Aug-2004  mycroft Minor change to a printf().
 1.75 10-Aug-2004  mycroft Make the enable state machine during attach more robust.
 1.74 10-Aug-2004  mycroft Remove a very silly hack WRT the Digital vendor ID.
 1.73 10-Aug-2004  mycroft GC the "quirk" code.
 1.72 10-Aug-2004  mycroft Use pcmcia_function_{configure,unconfigure}().
XXX Memory mapped mode seems to be flaky with my CF cards, so I have
disabled it for now.
 1.71 09-Aug-2004  mycroft Do our io_map()s and intr_establish()es earlier.
 1.70 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.69 07-Jul-2004  mycroft More cleanup:
* Print "devinfo" in a canonial place (like we do in the SCSI code).
* Use aprint_{error,normal}() during attach.
* More PCMCIA_STR_* removal.
 1.68 25-May-2004  thorpej Add the notion of "shadow registers" to the wdc driver. These shadow
registers are registers that overlap with others on many controllers, but
which may actually be distinct on some controllers. Right now, the two
shadows are:

- wd_status (usually overlaps wd_command)
- wd_features (usually overlaps wd_error)

Add a new helper function, wdc_init_shadow_regs(), used to initialize
the shadow register handles on controllers where they do actually overlap.

Partially from Jordan Rhody @ Wasabi Systems, Inc.
 1.67 03-Jan-2004  thorpej More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc
 1.66 03-Jan-2004  thorpej Rename "struct channel_softc" to "struct wdc_channel".
 1.65 01-Jan-2004  thorpej Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers. Clean up the member names of these structures while at it.
 1.64 27-Nov-2003  fvdl There are some cards that map the ATA control and IDE DMA registers
in a different fashion. Individually, they have the same functionality,
but their layout is different. An example of such a chipset is
the Promise 203xx.

To be able to deal with this, transform the cmd and dma bus_space handles
into an array of handles, each seperately created with bus_space_subregion.
The code generated by using the extra indirection shouldn't change much,
since the extra indirection is negated by having the offset calculation
already done in bus_space_subregion. E.g.

bus_space_write_4(tag, handle, offset, value)

becomes

bus_space_write_4(tag, handles[offset], 0, value)

Reviewed by Manuel Bouyer. Tested on wdc_isa, wdc_pcmcia, viaide, piixide (i386)
and on cmdide (sparc64).
 1.63 23-Oct-2003  briggs After discussion between mycroft and enami, restore the WDC_PCMCIA_ATTACH
flag and use it to avoid an extra power cycle during the probe process.
 1.62 22-Oct-2003  briggs enami noted that my last fix was not correct. Simplify the code some (and
make it more correct) by removing a flag to track wdc attachment. Disable
the function after wdcattach() is called, and remove a conditional when
enabling the function in wdc_pcmcia_enable().
 1.61 22-Oct-2003  briggs Since we enable the pcmcia function on attach, disable it on the detach.
 1.60 08-Oct-2003  bouyer Make the ATA mid-layer appears as atabus, as proposed in
http://mail-index.netbsd.org/tech-kern/2003/09/25/0006.html
This adds a device (atabus) between IDE controllers and wd or atapibus, to
have each ATA channel show up in the device tree. Later there will be atabus
devices in /dev, so that we can do IOCTL on them.
Each atabus has its own kernel thread, to handle operations that needs polling,
e.g. reset and others.

Device probing on each bus it defered to the atabus thread creation.
This allows to do the reset and basic device probes in parallel, which reduce
boot time on systems with several pciide controllers.
 1.59 25-Sep-2003  mycroft Hide the use of config_interrupts() in one place.
 1.58 23-Sep-2003  mycroft Fix more probe delay and/or failure problems:
1) Don't wait for DRQ on an IDENTIFY command -- if it's not set when we see
BSY clear, abort the command and ignore the drive. (Do this by testing
for DRQ in the read/write cases in __wdccommand_intr().)
2) Don't wait for DRQ to deassert when we finish an IDENTIFY (or any other
non-block command that reads data) -- we don't do this for block I/O, and
empirically it doesn't clear on my CF cards at all, causing a pointless 1s
delay.
3) Add comments to some of the delay()s, and add missing ones in wdcreset()
and the WDCC_RECAL in the so-called "pre-ATA" probe.
4) Slightly simplify the reset sequence -- we were doing an extra I/O.
5) Modify the register writability test to make sure that registers are not
overlapped -- this can happen in some weird cases with a missing device 1.
6) Check the error register value after the reset -- if it's not 01h or 81h,
as appropriate (see ATA spec), punt.
Tested with a number of ATA-only, ATAPI-only, mixed ATA-ATAPI, CF, and IDE
disk configurations.

Also remove the SINGLE_DRIVE nonsense again.
 1.57 21-Sep-2003  bouyer Since we can't detect ghost drives in the wdc back-end, resurect
WDC_CAPABILITY_SINGLE_DRIVE.
 1.56 19-Sep-2003  mycroft 1) Use config_interrupts() to attach IDE and ATAPI drives. This eliminates
most polling.
2) Clean up some goofiness in pciide -- get rid of the whole "candisable" path
(it's gratuitous) and simplify the code by calling pciide_map_compat_intr(),
*_set_modes() and wdc_print_modes() from central locations.
3) Add a register writability and register ghost test to eliminate phantom
drives more quickly.
 1.55 30-Mar-2003  matt branches: 1.55.2;
Don't free chqueue since it's no longer malloc'ed.
 1.54 27-Mar-2003  ichiro add product TOSHIBA PA2673U CBIDE2 (IODATA OEM)
 1.53 22-Mar-2003  matt Don't malloc channel_queue, put it in the softc instead.
 1.52 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.51 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.50 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.49 01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.48 31-Mar-2002  martin branches: 1.48.2;
Backout previous. While it fixes half of the problem for me, it is not
the right fix.
 1.47 31-Mar-2002  martin Establish/disestablish the interrupt handler when enabling/disabling the
controller - no matter if we are called from attach or not.
This makes my FreeCOM CD drive work at first attach (PR 13480).

Something is wrong with the detach code; it won't work on second attach
and will panic on second detach - but that has to wait until the kids
took care of some easter eggs.
 1.46 29-Jan-2002  simonb Fix a tyop in a comment.
 1.45 16-Dec-2001  soren To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.44 13-Nov-2001  lukem add RCSIDs
 1.43 14-Oct-2001  christos quirk for panasonic adapter.
 1.42 25-Apr-2001  bouyer branches: 1.42.2;
Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
 1.41 08-Mar-2001  uch CF memory mapped addressing mode. http://www.compactflash.org/cfspc1_4.pdf
 1.40 21-Feb-2001  jdolecek branches: 1.40.2;
make some more constant arrays 'const'
 1.39 06-Jan-2001  takemura Add WDC_CAPABILITY_SINGLE_DRIVE to ignore secound drive. Wdc on pcmcia will
be attached with this flag.
Some CF Card (for ex. IBM MicroDrive and SanDisk) doesn't seem to implement
drive select command. In this case, you can't eliminate ghost drive properly.
So you should use this flag to ignore the ghost by force.
 1.38 27-Dec-2000  sato add Novac PCMCIA-IDE Card(Card for HD530P PCMCIA-IDE Box).
No vendor ID, no product ID, and the wpp_cis_info is 'PCMCIA', 'PnPIDE'.
 1.37 20-Dec-2000  haya Add IO Data CBIDE2 ata interface card.
 1.36 18-Dec-2000  abs Add a 'value engineered' generic pcmcia CD-ROM drive, badged 'AMACOM'.
No vendor ID, no product ID, and the wpp_cis_info is 'PCMCIA', 'CD-ROM'.
I'd be encouraged at some progress towards 'generic devices', except
someone else is bound to produce something that identifies the same, but
requires a quirk. Can I go back to my sparc now?
Make two other comments consistent while here.
 1.35 25-Oct-2000  haya METHOD CHANGE: Use CIS_FUNCE data which is decoded by pcmcia_cis.c,
instead of decode cis tuple by itself. This change leads to suppress
one power-cycling.
 1.34 20-Jul-2000  abs Add the pccard controller for a Toshiba Portege drive. No vendor ID, no
product ID, and in this temporary loan, no bleeding power supply so it
can only probe the controller and not the drive. Still, its something.
 1.33 28-Jun-2000  mrg remove include of <vm/vm.h>
 1.32 01-Apr-2000  bouyer branches: 1.32.4;
make it compile again after ATAPI changes.
 1.31 21-Feb-2000  enami Don't establish an interrupt if attach is in progress. Anyway, current wdc
and its children doesn't require interrupt on attach.
 1.30 05-Feb-2000  enami Remove unnecessary includes.
 1.29 04-Feb-2000  enami Free resources on attach failure.
 1.28 01-Feb-2000  enami The workaround for Hagiwara SYS-COM Compact Flash card is no longer necessary.
 1.27 24-Jan-2000  enami - fix comment style/indentaion.
- add comment to refer aic_pcmcia_enable.
 1.26 08-Jan-2000  augustss Add EXP Computer Inc. PCMCIA controller.
From Brad Spencer <brad@anduin.eldar.org> in PR 9140.
 1.25 09-Dec-1999  sommerfeld Fix hot-swapping for controllers which grab two ranges of port space.
(if the mapping of the second range succeeded, it would forget about
the window of the second address range, causing a subsequent insertion
event to fail..).

My Sony PCGA-CD51 now hot-swaps a lot better now.
 1.24 27-Nov-1999  soren Regen.
 1.23 21-Nov-1999  takemura Add a entry for Mobile Dock 2, which is 2.5" HDD adapter.
 1.22 20-Oct-1999  enami Cancel active transfers on aic/wdc detach.
Also makes LS-120 drive works for me again.
 1.21 23-Sep-1999  enami branches: 1.21.2; 1.21.4; 1.21.6;
Allow to detach wdc, atapibus, wd and cd.
 1.20 22-Sep-1999  enami print newline.
 1.19 19-Feb-1999  abs Add ID for IBM 'PCMCIA Portable CD-ROM Drive'. We only have one of these and it
may be broken (it choked under Windows), but it at least now probes.
 1.18 03-Dec-1998  bouyer Rename pio_mode, etc ... to PIO_cap, etc ... for consistency with the
ata_drive_datas struct. Suggested by Soren S. Jorvan.
 1.17 22-Nov-1998  pk Remove unwanted inclusion of an isa header file.
 1.16 21-Nov-1998  drochner in wdc_softc: access the per-channel data via a pointer array instead of
an array of fixed-sized channel_softc elements. This way IDE controllers
which more than 1 channel (pciide) can extend the channel data easily
for private needs.
To avoid the double dereference at runtime, change the argument of
wdcstart() to the channel data pointer instead of the array index.
 1.15 20-Nov-1998  thorpej Add support for power management and lazy interrupt establishment
to PCMCIA IDE controllers (include PCMCIA flash cards).
 1.14 29-Oct-1998  enami - match if the function just probing is disk and its interface is ATA.
- use product table only for the card which requires quirks or doesn't
have disk device interface tuple.
 1.13 29-Oct-1998  enami fix typo and some indentation.
 1.12 12-Oct-1998  bouyer Merge bouyer-ide
 1.11 10-Oct-1998  thorpej Use pcmcia_io_free() where appropriate.
 1.10 18-Sep-1998  enami Use an appropriate value for wpp_quirk_flag.
 1.9 10-Sep-1998  kenh Reorganize the probe routine and add a quirk table. Much of this code
comes from Enami Tsugutomo (enami@but-b.or.jp). Also add a couple more
devices to the pcmcia devices table.
 1.8 15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.7 09-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.6 05-Jun-1998  enami An oversight in previous commit.
 1.5 05-Jun-1998  enami - Don't print newline until pcmcia_io_map is called; it expects to write
from middle of line.
- Use SIMPLEQ_FIRST/NEXT macros.
 1.4 04-Jun-1998  enami branches: 1.4.2;
No need to define WDDEBUG or undefine ATAPI_DEBUG_WDC here.
 1.3 25-Apr-1998  matt Now works with the Digital Hinote Ultra Mobile Media CD-ROM
 1.2 23-Jan-1998  mycroft Slight cleanup.
 1.1 19-Jan-1998  matt Initial support for Digital Mobile Media Adapter.
 1.4.2.10 12-Oct-1998  bouyer Sync with HEAD.
 1.4.2.9 02-Oct-1998  bouyer Cleanup a few error message, remove some dead code. Re-add a reset at end of
attach, unless we have WDC_NO_EXTRA_RESETS.
Add support for data32iot/data32ioh from -current: each controller pass
WDC_CAPABILITY_DATA32 if they can do 32bit, and WDC_CAPABILITY_DATA16 if they
can do 16bit. For controller that support both, the usual autodetect
mechanism is still used.
 1.4.2.8 20-Sep-1998  bouyer sync with HEAD
 1.4.2.7 11-Sep-1998  bouyer Sync with HEAD.
 1.4.2.6 21-Aug-1998  bouyer Sync with -current
 1.4.2.5 13-Jun-1998  bouyer Sync with HEAD.
 1.4.2.4 09-Jun-1998  bouyer Sync with trunk.
 1.4.2.3 06-Jun-1998  bouyer Sync with HEAD.
 1.4.2.2 04-Jun-1998  bouyer Commit changes to the IDE system in a branch. This allows a better separation
between higth-level and low-level (i.e. registers read/write) and generalize
the queue for all commands. This also add supports for IDE DMA.
 1.4.2.1 04-Jun-1998  bouyer file wdc_pcmcia.c was added on branch bouyer-ide on 1998-06-04 16:55:05 +0000
 1.21.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.21.4.1 15-Nov-1999  fvdl Sync with -current
 1.21.2.7 12-Mar-2001  bouyer Sync with HEAD.
 1.21.2.6 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.21.2.5 05-Jan-2001  bouyer Sync with HEAD
 1.21.2.4 22-Nov-2000  bouyer Sync with HEAD.
 1.21.2.3 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.21.2.2 20-Oct-1999  thorpej Sync w/ trunk.
 1.21.2.1 19-Oct-1999  thorpej Adapt to scsipi API changes.
 1.32.4.2 26-Dec-2000  jhawk Pull up revision 1.36 via patch (requested by abs):
Support AMACOM "Value Engineered" CDROM.
 1.32.4.1 21-Jul-2000  abs Add Toshiba Portege 3110 CD entry - approved by Jason
 1.40.2.8 18-Oct-2002  nathanw Catch up to -current.
 1.40.2.7 20-Jun-2002  nathanw Catch up to -current.
 1.40.2.6 28-Feb-2002  nathanw Catch up to -current.
 1.40.2.5 08-Jan-2002  nathanw Catch up to -current.
 1.40.2.4 14-Nov-2001  nathanw Catch up to -current.
 1.40.2.3 22-Oct-2001  nathanw Catch up to -current.
 1.40.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.40.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.42.2.4 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.42.2.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.42.2.2 11-Feb-2002  jdolecek Sync w/ -current.
 1.42.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.48.2.1 20-Jun-2002  gehenna catch up with -current.
 1.55.2.9 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.55.2.8 01-Apr-2005  skrll Sync with HEAD.
 1.55.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.55.2.6 19-Oct-2004  skrll Sync with HEAD
 1.55.2.5 21-Sep-2004  skrll Fix the sync with head I botched.
 1.55.2.4 18-Sep-2004  skrll Sync with HEAD.
 1.55.2.3 25-Aug-2004  skrll Sync with HEAD.
 1.55.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.55.2.1 03-Aug-2004  skrll Sync with HEAD
 1.97.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.97.4.1 29-Apr-2005  kent sync with -current
 1.99.2.2 29-Mar-2006  tron Pull up following revision(s) (requested by bouyer in ticket #1232):
sys/dev/pcmcia/wdc_pcmcia.c: revision 1.105
As we are going to sleep here, we need to use
config_pending_incr()/config_pending_decr() so that disks are probed
before trying to mount root, if the card is plugged in at boot time.
Should fix kern/33137 by KIYOHARA Takashi.
 1.99.2.1 02-Jul-2005  tron Pull up revision 1.100 (requested by bouyer in ticket #500):
When the PCMCIA socket is powered up, the driver waits for the PCMCIA
controller to be ready, but the drive attached to it may not be ready yet.
Add a half a second delay before calling wdcattach(), to let the drive
have its electronic ready to properly respond to the register tests done
in wdcprobe1(). Delay based on experiments done by John Refling with
various devices as part of the audit-trail of kern/25659; complete
the fix for kern/25659.
 1.100.2.4 24-Mar-2008  yamt sync with head.
 1.100.2.3 27-Oct-2007  yamt sync with head.
 1.100.2.2 30-Dec-2006  yamt sync with head.
 1.100.2.1 21-Jun-2006  yamt sync with head.
 1.101.2.2 01-Feb-2006  yamt sync with head.
 1.101.2.1 15-Jan-2006  yamt sync with head.
 1.104.10.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.104.8.1 19-Apr-2006  elad sync with head.
 1.104.6.2 26-Jun-2006  yamt sync with head.
 1.104.6.1 01-Apr-2006  yamt sync with head.
 1.104.4.1 22-Apr-2006  simonb Sync with head.
 1.104.2.1 09-Sep-2006  rpaulo sync with head
 1.105.4.1 13-Jul-2006  gdamore Merge from HEAD.
 1.106.6.2 10-Dec-2006  yamt sync with head.
 1.106.6.1 22-Oct-2006  yamt sync with head
 1.106.4.1 18-Nov-2006  ad Sync with head.
 1.108.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.108.24.2 23-Mar-2008  matt sync with HEAD
 1.108.24.1 06-Nov-2007  matt sync with HEAD
 1.108.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.108.8.1 23-Oct-2007  ad Sync with head.
 1.109.16.3 29-Jun-2008  mjf Sync with HEAD.
 1.109.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.109.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.109.12.1 24-Mar-2008  keiichi sync with head.
 1.110.4.4 11-Mar-2010  yamt sync with head
 1.110.4.3 16-May-2009  yamt sync with head
 1.110.4.2 04-May-2009  yamt sync with head.
 1.110.4.1 16-May-2008  yamt sync with head.
 1.110.2.2 17-Jun-2008  yamt sync with head.
 1.110.2.1 18-May-2008  yamt sync with head.
 1.111.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.112.8.2 26-Mar-2009  snj Pull up following revision(s) (requested by drochner in ticket #614):
sys/dev/pcmcia/wdc_pcmcia.c: revision 1.114
Work around a problem with PCMCIA adapter drivers (eg for hpc*) which
attach pcmcia devices before interrupts are enabled. This is unclean
because pcmcia drivers use tsleep(9) in the attach code path but it
worked all the time and it is too late to change this on the 5.0 branch.
So just tolerate it.
Fixes a regression on hpcsh reported by Valeriy E. Ushakov.
 1.112.8.1 18-Feb-2009  snj Pull up following revision(s) (requested by drochner in ticket #441):
sys/dev/ata/wd.c: revision 1.368
sys/dev/pcmcia/wdc_pcmcia.c: revision 1.113
-in the wdc@pcmcia driver, don't try to powerup/down while cold or
shutting down -- this is only supposed to happen from the pcmcia
kernel thread while the system is running
-in wd_shutdown, call ata_addref first, so that the adapter is either
active or we know that it isn't
This fixes a hang on shutdown-p reported by Dennis den Brok per
PR kern/40531. Verified by by Dennis and me.
(reported against 5.0-Beta, so this is a pullup candidate)
 1.112.6.2 28-Apr-2009  skrll Sync with HEAD.
 1.112.6.1 03-Mar-2009  skrll Sync with HEAD.
 1.113.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.117.12.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.117.12.1 30-Oct-2012  yamt sync with head
 1.123.4.1 18-May-2014  rmind sync with head
 1.123.2.2 03-Dec-2017  jdolecek update from HEAD
 1.123.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.124.18.2 27-Sep-2017  jdolecek change wdc_init_shadow_regs() to accept only struct wdc_regs, it doesn't
touch anything else

factor out the probe-only struct ata_channel initialization to wdcprobe(), to
reduce duplication of logic in individual drivers, and to actually work now
that more init is needed beyond the memset()
 1.124.18.1 21-Jun-2017  jdolecek actually remove the KASSERT() for queue_active in wdc.c as it's superfluous,
and make struct ata_queue completly opaque to attachment code; fix two other
places which were not converted to ata_queue_alloc() which were surfaced
by this change
 1.126.4.1 10-Jun-2019  christos Sync with HEAD
 1.126.2.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.39 10-May-2023  riastradh xirc(4): Use config_detach_children.
 1.38 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.37 24-Apr-2021  thorpej branches: 1.37.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.36 05-Oct-2019  mrg branches: 1.36.10;
add missing break.

(this code is fun. it has switch inside switch, and both switches
have two cases, one with an identifier and one with a magic number.)
 1.35 08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.34 22-Jun-2018  msaitoh branches: 1.34.2;
It's not required to include net/bpfdesc.h. Remove it.
 1.33 14-Feb-2012  drochner branches: 1.33.40; 1.33.46;
fix incomplete device_t/softc split which led to crash on attachment,
closes PR kern/45874 by Hauke Fath
approved by releng
 1.32 19-Jan-2010  pooka branches: 1.32.12; 1.32.16;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.31 06-Dec-2009  dyoung device_t/softc split.
 1.30 13-Nov-2009  dyoung Don't use com_activate(), it's gone away. Thanks to Andreas Wrede
for pointing out that these drivers still used com_activate().

Use device_private(). Join some lines.

Remove superfluous activation hooks.

Add child-detachment hooks (not used, yet).

TBD: device_t/softc split.
 1.29 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.28 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.27 14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.26 14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.25 28-Jul-2008  drochner branches: 1.25.2; 1.25.8;
add missing device_private(), fixes crash in interrupt handler
 1.24 28-Apr-2008  martin branches: 1.24.2; 1.24.4; 1.24.6;
Remove clause 3 and 4 from TNF licenses
 1.23 05-Apr-2008  cegger branches: 1.23.2; 1.23.4;
use aprint_*_dev and device_xname
 1.22 14-Mar-2008  cube Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 1.21 19-Oct-2007  ad branches: 1.21.12; 1.21.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.20 16-Nov-2006  christos branches: 1.20.8; 1.20.22; 1.20.24; 1.20.28;
__unused removal on arguments; approved by core.
 1.19 12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.18 07-Sep-2006  dogcow branches: 1.18.2; 1.18.4;
remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.
 1.17 13-Jul-2006  gdamore Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.16 25-Mar-2006  thorpej branches: 1.16.4;
Use device_parent().
 1.15 11-Dec-2005  christos branches: 1.15.4; 1.15.6; 1.15.8; 1.15.10; 1.15.12;
merge ktrace-lwp.
 1.14 30-May-2005  christos branches: 1.14.2;
- add const
- avoid variable shadow
- do proper UNCONST with XXXUNCONST
 1.13 27-Feb-2005  perry nuke trailing whitespace
 1.12 04-Feb-2005  perry de-__P
 1.11 10-Aug-2004  mycroft branches: 1.11.2; 1.11.6; 1.11.8;
Now that all the silly string printing is gone, move the location where we
print a newline so it doesn't have to be done in every driver.
 1.10 10-Aug-2004  mycroft More careful about cleaning up pointers.
 1.9 10-Aug-2004  mycroft Print diagnostics in only one place if intr_establish() or function_enable()
fails.

Also, be a little more careful about passing up error values, and consistently
clear our interrupt handler pointer.
 1.8 09-Aug-2004  mycroft Minor change.
 1.7 09-Aug-2004  mycroft Do the I/O mapping in the main attach routine.
Also, we don't need to bother cleaning up on a failed attach -- we keep enough
state for the detach routine to do it.
 1.6 09-Aug-2004  mycroft Make pcmcia_function_disable() primarily responsible for disabling the CCR
bits. pcmcia_intr_disestablish() continues to do this as a stopgap.
 1.5 09-Aug-2004  mycroft Do our io_map()s and intr_establish()es earlier.
 1.4 09-Aug-2004  mycroft Add some code to deal with the interrupt mask register on early CEM cards.
Doesn't seem to work yet, but it's marginal progress.
 1.3 08-Aug-2004  mycroft Remove the "offset" and "size" arguments to pcmcia_io_map(). In the singular
case (ne@pcmcia) where we were using these to create a subregion, it is better
handled by calling bus_space_subregion().

Now there is a 1:1 mapping between I/O spaces in the config table and windows
mapped in the function. Rework the multifunction mapping code to take
advantage of this by using both I/O base addresses if necessary.
 1.2 08-Aug-2004  mycroft * Some rearrangement of where the power control hooks are called.
* Don't splnet() in xi_init() -- the callers do that.
* Don't do the enable call in xi_init() -- it should be done only in a process
context so it can sleep.
* Call xi_start() at the end of xi_init() to restart output.
* If the interface is already up, we only need to call xi_set_address() to
change state on SIOCSIFFLAGS.
 1.1 08-Aug-2004  mycroft Split "xi" into a "xirc" frontend (similar to mhzc; it attaches two child
devices) and a "xi" backend.

My CE2 and CEM2 cards are now probed correctly. However, there are still
some problems with one model of the CE2, and the CEM2 doesn't seem to get
any modem interrupts.

While I'm at it, fix several bugs:

* The tuple scan for the MAC address was broken in multiple ways.
* xi_intr() did not deal well with a shared interrupt.
* We were setting the wrong page number to look at the receive status. (How
did this work???)
* Remove the xi_full_reset() from xi_reset(). Move the parts of
xi_full_reset() needed to undo the effect of xi_stop() into xi_init(). This
allows a stop/init pair to DTRT, and much quicker, as used by various
ioctl()s.
* Set the TRS register before reading the TSO register, as the Linux driver
does. While I'm at it, fix the name.
* Fix numerous problems with xi_set_address(). "Where do I begin?" There's a
chance that multicast works now, but I haven't tested it.
* Explicitly clear the MSR register, and also force SELECT_MII to 0 if we
didn't find any PHYs.
* Clean up some cruft that appears to be bogus.

Probably needs more work, but it's a start.
 1.11.8.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.11.8.1 12-Feb-2005  yamt sync with head.
 1.11.6.1 29-Apr-2005  kent sync with -current
 1.11.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.11.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.11.2.5 04-Feb-2005  skrll Sync with HEAD.
 1.11.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.11.2.2 12-Aug-2004  skrll Sync with HEAD.
 1.11.2.1 10-Aug-2004  skrll file xirc.c was added on branch ktrace-lwp on 2004-08-12 11:42:05 +0000
 1.14.2.4 17-Mar-2008  yamt sync with head.
 1.14.2.3 27-Oct-2007  yamt sync with head.
 1.14.2.2 30-Dec-2006  yamt sync with head.
 1.14.2.1 21-Jun-2006  yamt sync with head.
 1.15.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.15.10.1 19-Apr-2006  elad sync with head.
 1.15.8.3 14-Sep-2006  yamt sync with head.
 1.15.8.2 11-Aug-2006  yamt sync with head
 1.15.8.1 01-Apr-2006  yamt sync with head.
 1.15.6.1 22-Apr-2006  simonb Sync with head.
 1.15.4.1 09-Sep-2006  rpaulo sync with head
 1.16.4.3 17-Jun-2006  gdamore Undo the undo. Restore COM_INIT_REGS.
 1.16.4.2 17-Jun-2006  gdamore Revert COM_INIT_REGS.
 1.16.4.1 15-Jun-2006  gdamore Adapt to new com framework.
 1.18.4.2 10-Dec-2006  yamt sync with head.
 1.18.4.1 22-Oct-2006  yamt sync with head
 1.18.2.1 18-Nov-2006  ad Sync with head.
 1.20.28.1 25-Oct-2007  bouyer Sync with HEAD.
 1.20.24.2 23-Mar-2008  matt sync with HEAD
 1.20.24.1 06-Nov-2007  matt sync with HEAD
 1.20.22.1 26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.20.8.1 23-Oct-2007  ad Sync with head.
 1.21.16.3 28-Sep-2008  mjf Sync with HEAD.
 1.21.16.2 02-Jun-2008  mjf Sync with HEAD.
 1.21.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.21.12.1 24-Mar-2008  keiichi sync with head.
 1.23.4.4 11-Mar-2010  yamt sync with head
 1.23.4.3 16-May-2009  yamt sync with head
 1.23.4.2 04-May-2009  yamt sync with head.
 1.23.4.1 16-May-2008  yamt sync with head.
 1.23.2.1 18-May-2008  yamt sync with head.
 1.24.6.1 19-Oct-2008  haad Sync with HEAD.
 1.24.4.1 31-Jul-2008  simonb Sync with head.
 1.24.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.25.8.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.2.1 28-Apr-2009  skrll Sync with HEAD.
 1.32.16.1 18-Feb-2012  mrg merge to -current.
 1.32.12.1 17-Apr-2012  yamt sync with head
 1.33.46.2 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.33.46.1 25-Jun-2018  pgoyette Sync with HEAD
 1.33.40.1 26-Jul-2018  snj Pull up following revision(s) (requested by msaitoh in ticket #938):
sys/arch/acorn32/podulebus/if_ie.c: revision 1.41
sys/arch/amiga/dev/if_es.c: revision 1.58
sys/arch/amiga/dev/if_qn.c: revision 1.45
sys/arch/arm/at91/at91emac.c: revision 1.20
sys/arch/arm/ep93xx/epe.c: revision 1.37
sys/arch/emips/ebus/if_le_ebus.c: revision 1.14
sys/arch/emips/ebus/if_le_ebus.c: revision 1.15
sys/arch/mac68k/dev/if_mc.c: revision 1.46
sys/arch/macppc/dev/am79c950.c: revision 1.39
sys/arch/newsmips/apbus/if_sn.c: revision 1.40
sys/arch/next68k/dev/mb8795.c: revision 1.59
sys/arch/playstation2/dev/if_smap.c: revision 1.25
sys/arch/playstation2/dev/if_smap.c: revision 1.26
sys/arch/sun2/dev/if_ec.c: revision 1.28
sys/arch/sun3/dev/if_ie.c: revision 1.63
sys/arch/x68k/dev/if_ne_intio.c: revision 1.19
sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.75
sys/arch/xen/xen/xennetback_xenbus.c: revision 1.63
sys/dev/bi/if_ni.c: revision 1.45
sys/dev/cadence/if_cemac.c: revision 1.12
sys/dev/ic/am7990.c: revision 1.78
sys/dev/ic/am79900.c: revision 1.27
sys/dev/ic/an.c: revision 1.67
sys/dev/ic/cs89x0.c: revision 1.40
sys/dev/ic/dm9000.c: revision 1.13
sys/dev/ic/dm9000.c: revision 1.14
sys/dev/ic/dp8390.c: revision 1.88
sys/dev/ic/elink3.c: revision 1.141
sys/dev/ic/elinkxl.c: revision 1.122
sys/dev/ic/hme.c: revision 1.98
sys/dev/ic/i82586.c: revision 1.77
sys/dev/ic/lance.c: revision 1.53
sys/dev/ic/mb86950.c: revision 1.27
sys/dev/ic/mb86960.c: revision 1.86
sys/dev/ic/mtd803.c: revision 1.34
sys/dev/ic/pdq_ifsubr.c: revision 1.59
sys/dev/ic/rrunner.c: revision 1.86
sys/dev/ic/seeq8005.c: revision 1.58
sys/dev/ic/sgec.c: revision 1.47
sys/dev/ic/smc90cx6.c: revision 1.72
sys/dev/ic/smc91cxx.c: revision 1.96
sys/dev/ic/tropic.c: revision 1.49
sys/dev/ic/wi.c: revision 1.245
sys/dev/isa/if_eg.c: revision 1.93
sys/dev/isa/if_el.c: revision 1.95
sys/dev/isa/if_iy.c: revision 1.101
sys/dev/ofw/ofnet.c: revision 1.58
sys/dev/pci/if_alc.c: revision 1.27
sys/dev/pci/if_de.c: revision 1.152
sys/dev/pci/if_fpa.c: revision 1.61
sys/dev/pci/if_jme.c: revision 1.34
sys/dev/pci/if_tl.c: revision 1.108
sys/dev/pci/if_vte.c: revision 1.19
sys/dev/pci/ixgbe/ixgbe.h: revision 1.50
sys/dev/pcmcia/if_cnw.c: revision 1.62
sys/dev/pcmcia/if_malo_pcmcia.c: revision 1.17
sys/dev/pcmcia/if_ray.c: revision 1.89
sys/dev/pcmcia/if_xi.c: revision 1.81
sys/dev/pcmcia/mhzc.c: revision 1.51
sys/dev/pcmcia/xirc.c: revision 1.34
sys/dev/qbus/if_de.c: revision 1.33
sys/dev/qbus/if_qe.c: revision 1.78
sys/dev/qbus/if_qt.c: revision 1.22
sys/dev/sbus/be.c: revision 1.87
sys/dev/sbus/qe.c: revision 1.68
sys/dev/scsipi/if_se.c: revision 1.96
sys/dev/usb/if_atu.c: revision 1.59
sys/net/if_l2tp.c: revision 1.28 via patch
sys/net/if_ppp.c: revision 1.160
It's not required to include net/bpfdesc.h. Remove it.
--
Simplify like other drivers. NULL check of ifp->if_bpf is done in
bpf_mtap(), so it's not required to do it here.
--
Remove duplicated inclusion of net/bpf.h.
--
Remove duplicated inclusion of net/bpf.h.
--
Simplify bpf_mtap() call. No functional change.
 1.34.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.34.2.1 10-Jun-2019  christos Sync with HEAD
 1.36.10.1 21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.37.8.1 04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed