Home | History | Annotate | only in /src/sys/dev/qbus
History log of /src/sys/dev/qbus
RevisionDateAuthorComments
 1.58 26-Oct-2022  riastradh vax/dhu(4): Convert to ttylock/ttyunlock.
 1.57 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.56 24-Apr-2011  rmind branches: 1.56.14; 1.56.28;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.55 11-Jun-2008  drochner branches: 1.55.18; 1.55.24;
fix some missing pieces of device/softc split
 1.54 27-May-2008  ad branches: 1.54.2;
PR kern/38763 "hanging in tty" bugfix breaks the build for vax (and
probably others)
 1.53 25-May-2008  ad Properly fix the "hanging in tty" bug that was worked around with cv_wakeup()
some time again.
 1.52 11-Mar-2008  matt branches: 1.52.2; 1.52.4; 1.52.6;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.51 03-Dec-2007  ad branches: 1.51.10; 1.51.14;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.50 19-Nov-2007  ad - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.49 07-Nov-2007  ad Merge tty changes from the vmlocking branch.
 1.48 19-Oct-2007  ad branches: 1.48.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.47 04-Mar-2007  christos branches: 1.47.2; 1.47.14; 1.47.16; 1.47.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.46 01-Oct-2006  elad branches: 1.46.4;
Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!

Also, add forgotten splx() calls in some places.
 1.45 21-Jul-2006  ad branches: 1.45.4; 1.45.6;
- Use the LWP cached credentials where sane.
- Minor cosmetic changes.
 1.44 15-May-2006  yamt - include kauth.h for kauth_authorize_generic.
- wrap a long line.
 1.43 14-May-2006  elad integrate kauth.
 1.42 29-Mar-2006  thorpej Use device_private().
 1.41 11-Dec-2005  christos branches: 1.41.4; 1.41.6; 1.41.8; 1.41.10; 1.41.12;
make this compile again (from Johnny Billquist)
 1.40 11-Dec-2005  christos merge ktrace-lwp.
 1.39 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.

Also change this to use the proc argument instead of curproc.
 1.38 26-Feb-2005  simonb branches: 1.38.4;
White space nits.
 1.37 04-Feb-2005  perry de-__P
 1.36 12-May-2004  wiz branches: 1.36.4; 1.36.6;
Remove UCB ad clause in Hugh Graham's license.
Ok'd by Hugh Graham and board.
 1.35 25-Apr-2004  matt Constify the speedtab arrays
 1.34 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.33 06-Apr-2003  ragge branches: 1.33.2;
A bunch of fixes to make the DHU driver much more efficient,
from Hugh Graham (hugh@openbsd.org).
 1.32 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.31 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.30 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.29 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.28 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.27 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.26 17-Mar-2002  atatat branches: 1.26.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.25 13-Nov-2001  lukem add RCSIDs
 1.24 26-May-2001  ragge branches: 1.24.2; 1.24.4;
Use cdev_decl() instead of local prototyping.
 1.23 02-May-2001  scw Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.22 31-Mar-2001  enami Remove unnecessary test of tp->t_linesw against NULL; they are results
of confusion while correcting compilation error after t_line is
replaced with t_linesw.
 1.21 02-Nov-2000  eeh branches: 1.21.2;
Adapt to the new line discipline scheme.
 1.20 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.19 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.18 30-Mar-2000  augustss branches: 1.18.2;
Remove register declarations.
 1.17 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.16 06-Jun-1999  ragge branches: 1.16.2; 1.16.4;
Fix map register/DMA wait queues.
Still to do:
BDP handling. Currently missing.
Ubareset's won't work at all.
 1.15 28-May-1999  ragge The DHU code changed to use bus_space.
XXX - still need to use bus_dma.
 1.14 28-May-1999  ragge Copied from ../../arch/vax/uba/dhu.c,v
 1.13 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.12 13-Apr-1998  ragge t_wopen fixes.
 1.11 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.10 12-Jan-1998  thorpej Update for changes to config.
 1.9 11-Jan-1997  ragge Update due to changes to uba/mscp functions.
 1.8 13-Oct-1996  christos backout previous kprintf change
 1.7 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.6 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.5 19-May-1996  ragge Update from Ken Wellsch.
 1.4 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.3 18-Mar-1996  ragge Ubareset are now possible, devices that wants it now set it up
during autoconfig. ifubareset (if_reset) no longer used, actually
it's just a normal ubareset and is now handled like that.
 1.2 17-Mar-1996  ragge Update from Ken Wellsch: The DHU driver can now handle DMA transfers.
 1.1 02-Mar-1996  ragge Unibus/Q22 bus device driver for DHU-11 serial card.
Written by Ken Wellsch. (kcwellsc@math.uwaterloo.ca)
 1.16.4.3 21-Apr-2001  bouyer Sync with HEAD
 1.16.4.2 22-Nov-2000  bouyer Sync with HEAD.
 1.16.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.16.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.18.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.21.2.11 11-Nov-2002  nathanw Catch up to -current
 1.21.2.10 18-Oct-2002  nathanw Catch up to -current.
 1.21.2.9 17-Sep-2002  nathanw Catch up to -current.
 1.21.2.8 12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.21.2.7 10-Jul-2002  nathanw Whitespace.
 1.21.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.21.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.21.2.4 28-Mar-2002  ragge curproc-> => curproc->l_proc->
 1.21.2.3 14-Nov-2001  nathanw Catch up to -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.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.24.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.24.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.24.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.24.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.26.4.1 16-May-2002  gehenna Add the character device switch.
Fix type of arguments.
 1.33.2.7 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.33.2.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.33.2.5 04-Feb-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 Adapt to new world order.

Vax GENERIC compiles.
 1.33.2.1 03-Aug-2004  skrll Sync with HEAD
 1.36.6.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.36.6.1 12-Feb-2005  yamt sync with head.
 1.36.4.1 29-Apr-2005  kent sync with -current
 1.38.4.7 17-Mar-2008  yamt sync with head.
 1.38.4.6 07-Dec-2007  yamt sync with head
 1.38.4.5 15-Nov-2007  yamt sync with head.
 1.38.4.4 27-Oct-2007  yamt sync with head.
 1.38.4.3 03-Sep-2007  yamt sync with head.
 1.38.4.2 30-Dec-2006  yamt sync with head.
 1.38.4.1 21-Jun-2006  yamt sync with head.
 1.41.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.41.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.41.10.3 19-Apr-2006  elad sync with head.
 1.41.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.41.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.41.8.3 11-Aug-2006  yamt sync with head
 1.41.8.2 24-May-2006  yamt sync with head.
 1.41.8.1 01-Apr-2006  yamt sync with head.
 1.41.6.2 01-Jun-2006  kardel Sync with head.
 1.41.6.1 22-Apr-2006  simonb Sync with head.
 1.41.4.1 09-Sep-2006  rpaulo sync with head
 1.45.6.1 22-Oct-2006  yamt sync with head
 1.45.4.1 18-Nov-2006  ad Sync with head.
 1.46.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.47.20.3 21-Nov-2007  bouyer Sync with HEAD
 1.47.20.2 13-Nov-2007  bouyer Sync with HEAD
 1.47.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.47.16.4 23-Mar-2008  matt sync with HEAD
 1.47.16.3 09-Jan-2008  matt sync with HEAD
 1.47.16.2 08-Nov-2007  matt sync with -HEAD
 1.47.16.1 06-Nov-2007  matt sync with HEAD
 1.47.14.4 09-Dec-2007  jmcneill Sync with HEAD.
 1.47.14.3 21-Nov-2007  joerg Sync with HEAD.
 1.47.14.2 11-Nov-2007  joerg Sync with HEAD.
 1.47.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.47.2.1 23-Oct-2007  ad Sync with head.
 1.48.2.2 08-Dec-2007  mjf Sync with HEAD.
 1.48.2.1 19-Nov-2007  mjf Sync with HEAD.
 1.51.14.3 29-Jun-2008  mjf Sync with HEAD.
 1.51.14.2 02-Jun-2008  mjf Sync with HEAD.
 1.51.14.1 03-Apr-2008  mjf Sync with HEAD.
 1.51.10.1 24-Mar-2008  keiichi sync with head.
 1.52.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.52.4.1 04-May-2009  yamt sync with head.
 1.52.2.2 17-Jun-2008  yamt sync with head.
 1.52.2.1 04-Jun-2008  yamt sync with head
 1.54.2.1 18-Jun-2008  simonb Sync with head.
 1.55.24.1 06-Jun-2011  jruoho Sync with HEAD.
 1.55.18.1 31-May-2011  rmind sync with head
 1.56.28.1 10-Aug-2014  tls Rebase.
 1.56.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5 06-Apr-2003  ragge A bunch of fixes to make the DHU driver much more efficient,
from Hugh Graham (hugh@openbsd.org).
 1.4 28-May-1999  ragge branches: 1.4.2;
The DHU code changed to use bus_space.
XXX - still need to use bus_dma.
 1.3 28-May-1999  ragge Copied from ../../arch/vax/uba/dhureg.h,v
 1.2 17-Mar-1996  ragge Update from Ken Wellsch: The DHU driver can now handle DMA transfers.
 1.1 02-Mar-1996  ragge Unibus/Q22 bus device driver for DHU-11 serial card.
Written by Ken Wellsch. (kcwellsc@math.uwaterloo.ca)
 1.4.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.49 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.48 16-Mar-2014  dholland branches: 1.48.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.47 27-Oct-2012  chs branches: 1.47.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.46 24-Apr-2011  rmind branches: 1.46.4; 1.46.14;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.45 12-May-2009  cegger branches: 1.45.4; 1.45.6;
struct device * -> device_t, no functional changes intended.
 1.44 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.43 11-Jun-2008  drochner branches: 1.43.10;
use device_lookup_private() to get the softc -- while device/softc
are not split yet, it is better than a typecast
 1.42 27-May-2008  ad branches: 1.42.2;
PR kern/38763 "hanging in tty" bugfix breaks the build for vax (and
probably others)
 1.41 28-Apr-2008  martin branches: 1.41.2;
Remove clause 3 and 4 from TNF licenses
 1.40 05-Apr-2008  cegger branches: 1.40.2; 1.40.4;
use aprint_*_dev and device_xname
 1.39 19-Nov-2007  ad branches: 1.39.14;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.38 19-Oct-2007  ad branches: 1.38.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.37 04-Mar-2007  christos branches: 1.37.2; 1.37.14; 1.37.16; 1.37.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.36 01-Oct-2006  elad branches: 1.36.4;
Adapt MD code to KAUTH_DEVICE_TTY_OPEN, batch #2 from Matt Fleming, thanks!

Also, add forgotten splx() calls in some places.
 1.35 21-Jul-2006  ad branches: 1.35.4; 1.35.6;
- Use the LWP cached credentials where sane.
- Minor cosmetic changes.
 1.34 15-May-2006  yamt - include kauth.h for kauth_authorize_generic.
- wrap a long line.
 1.33 14-May-2006  elad integrate kauth.
 1.32 29-Mar-2006  thorpej Use device_private().
 1.31 11-Dec-2005  christos branches: 1.31.4; 1.31.6; 1.31.8; 1.31.10; 1.31.12;
merge ktrace-lwp.
 1.30 06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.29 26-Feb-2005  simonb branches: 1.29.4;
White space nits.
 1.28 22-Mar-2004  bjh21 branches: 1.28.8; 1.28.10;
Move my copyright notice to the 3-clause UCB licence.
 1.27 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.26 23-Oct-2002  jdolecek branches: 1.26.6;
merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.25 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.24 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.23 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.22 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.21 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.20 17-Mar-2002  atatat branches: 1.20.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.19 13-Nov-2001  lukem add RCSIDs
 1.18 26-May-2001  ragge branches: 1.18.2; 1.18.4;
Use cdev_decl() instead of local prototyping.
 1.17 02-May-2001  scw Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.16 31-Mar-2001  enami Remove unnecessary test of tp->t_linesw against NULL; they are results
of confusion while correcting compilation error after t_line is
replaced with t_linesw.
 1.15 02-Nov-2000  eeh branches: 1.15.2;
Adapt to the new line discipline scheme.
 1.14 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.13 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.12 30-Mar-2000  augustss branches: 1.12.2;
Remove register declarations.
 1.11 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.10 06-Jun-1999  ragge branches: 1.10.2; 1.10.4;
Fix map register/DMA wait queues.
Still to do:
BDP handling. Currently missing.
Ubareset's won't work at all.
 1.9 27-May-1999  ragge Moved from ../dec/qbus/dl.c,v
 1.8 27-May-1999  ragge Directory called qbus instead of uba, per request from Matt/Jason/...
(More describing name actually)
 1.7 26-May-1999  ragge DL-11 driver bus'ified. UNTESTED.
 1.6 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.5 13-Apr-1998  ragge t_wopen fixes.
 1.4 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.3 12-Jan-1998  thorpej Update for changes to config.
 1.2 05-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.1 04-Feb-1997  ragge branches: 1.1.8;
Support for DL11 (-compatible) async ctlr.
Written by Ben Harris (bjh@mail.dotcom.fr).
 1.1.8.1 14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.10.4.3 21-Apr-2001  bouyer Sync with HEAD
 1.10.4.2 22-Nov-2000  bouyer Sync with HEAD.
 1.10.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.10.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.12.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.15.2.7 11-Nov-2002  nathanw Catch up to -current
 1.15.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.15.2.5 17-Sep-2002  nathanw Catch up to -current.
 1.15.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.15.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.15.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.15.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.18.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.18.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 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.4.1 16-May-2002  gehenna Add the character device switch.
 1.26.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.26.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 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 Adapt to new world order.

Vax GENERIC compiles.
 1.26.6.1 03-Aug-2004  skrll Sync with HEAD
 1.28.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.28.8.1 29-Apr-2005  kent sync with -current
 1.29.4.5 07-Dec-2007  yamt sync with head
 1.29.4.4 27-Oct-2007  yamt sync with head.
 1.29.4.3 03-Sep-2007  yamt sync with head.
 1.29.4.2 30-Dec-2006  yamt sync with head.
 1.29.4.1 21-Jun-2006  yamt sync with head.
 1.31.12.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.31.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.31.10.3 19-Apr-2006  elad sync with head.
 1.31.10.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.31.10.1 08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.31.8.3 11-Aug-2006  yamt sync with head
 1.31.8.2 24-May-2006  yamt sync with head.
 1.31.8.1 01-Apr-2006  yamt sync with head.
 1.31.6.2 01-Jun-2006  kardel 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.35.6.1 22-Oct-2006  yamt sync with head
 1.35.4.1 18-Nov-2006  ad Sync with head.
 1.36.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.37.20.2 21-Nov-2007  bouyer Sync with HEAD
 1.37.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.37.16.2 09-Jan-2008  matt sync with HEAD
 1.37.16.1 06-Nov-2007  matt sync with HEAD
 1.37.14.2 21-Nov-2007  joerg Sync with HEAD.
 1.37.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.37.2.1 23-Oct-2007  ad Sync with head.
 1.38.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.39.14.2 29-Jun-2008  mjf Sync with HEAD.
 1.39.14.1 02-Jun-2008  mjf Sync with HEAD.
 1.40.4.3 16-May-2009  yamt sync with head
 1.40.4.2 04-May-2009  yamt sync with head.
 1.40.4.1 16-May-2008  yamt sync with head.
 1.40.2.3 17-Jun-2008  yamt sync with head.
 1.40.2.2 04-Jun-2008  yamt sync with head
 1.40.2.1 18-May-2008  yamt sync with head.
 1.41.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.42.2.1 18-Jun-2008  simonb Sync with head.
 1.43.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.45.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.45.4.1 31-May-2011  rmind sync with head
 1.46.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.46.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.46.4.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.46.4.1 30-Oct-2012  yamt sync with head
 1.47.2.1 18-May-2014  rmind sync with head
 1.48.2.1 10-Aug-2014  tls Rebase.
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 26-Feb-2005  simonb White space nits.
 1.4 14-May-2000  bjh21 branches: 1.4.28; 1.4.36; 1.4.38;
Release dlreg.h into the public domain. It's hardly a great creative
work, after all.
 1.3 27-May-1999  ragge branches: 1.3.2; 1.3.4;
Moved from ../dec/qbus/dlreg.h,v
 1.2 26-May-1999  ragge DL-11 driver bus'ified. UNTESTED.
 1.1 04-Feb-1997  ragge Support for DL11 (-compatible) async ctlr.
Written by Ben Harris (bjh@mail.dotcom.fr).
 1.3.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.3.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.4.38.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.36.1 29-Apr-2005  kent sync with -current
 1.4.28.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.30 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.29 13-Nov-2001  lukem add RCSIDs
 1.28 02-May-2001  scw branches: 1.28.2; 1.28.4;
Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.27 31-Mar-2001  enami Remove unnecessary test of tp->t_linesw against NULL; they are results
of confusion while correcting compilation error after t_line is
replaced with t_linesw.
 1.26 30-Dec-2000  ragge branches: 1.26.2;
Changes for dzkbd/dzms. This is not yet finished, but at least the
kernel is useable.
 1.25 02-Nov-2000  eeh Adapt to the new line discipline scheme.
 1.24 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.23 04-Jun-2000  matt Start couting interrupts.
 1.22 30-Apr-2000  ragge branches: 1.22.2;
Change to use new ubareset() functionality.
 1.21 30-Mar-2000  augustss Remove register declarations.
 1.20 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.19 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.18 06-Jun-1999  ragge branches: 1.18.2; 1.18.4;
Fix map register/DMA wait queues.
Still to do:
BDP handling. Currently missing.
Ubareset's won't work at all.
 1.17 27-May-1999  ragge Moved from ../dec/qbus/dz.c,v
 1.16 27-May-1999  ragge Directory called qbus instead of uba, per request from Matt/Jason/...
(More describing name actually)
 1.15 26-May-1999  ragge DZ-11 routines bus'ified. Small fixes to uba routines.
 1.14 13-Mar-1999  ragge Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.13 05-Nov-1998  ragge EGCS fixes.
 1.12 10-Aug-1998  ragge Kickoff xmit interrupts, needed on chip DC7201.
 1.11 04-Jul-1998  jonathan defopt DDB.
 1.10 14-Jun-1998  ragge Add catch function for keyboard.
 1.9 23-May-1998  ragge Fixed bug with lost characters in DDB output.
 1.8 21-May-1998  ragge Support for DDB on DZ console.
 1.7 17-May-1998  ragge Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.6 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.5 12-Jan-1998  thorpej Update for changes to config.
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.1 08-Apr-1996  ragge Drivers for DZ11/DZV11/DZQ11 serial cards.
Written (mostly) by Ken Wellsch.
 1.18.4.4 21-Apr-2001  bouyer Sync with HEAD
 1.18.4.3 05-Jan-2001  bouyer Sync with HEAD
 1.18.4.2 22-Nov-2000  bouyer Sync with HEAD.
 1.18.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.18.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.22.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.26.2.4 28-Feb-2002  nathanw Catch up to -current.
 1.26.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.26.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.26.2.1 09-Apr-2001  nathanw Catch up with -current.
 1.28.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.28.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.28.2.2 16-Mar-2002  jdolecek Catch up with -current.
 1.28.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.29 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.28 15-Mar-2008  matt branches: 1.28.48; 1.28.68;
Switch dz driver to PRIVALLOC and device_* accessors.
 1.27 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.26 19-Oct-2007  ad branches: 1.26.12; 1.26.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.25 14-May-2006  elad branches: 1.25.18; 1.25.32; 1.25.34; 1.25.38;
integrate kauth.
 1.24 29-Mar-2006  thorpej Use device_private().
 1.23 11-Dec-2005  christos branches: 1.23.4; 1.23.6; 1.23.8; 1.23.10; 1.23.12;
merge ktrace-lwp.
 1.22 26-Feb-2005  simonb branches: 1.22.4;
White space nits.
 1.21 04-Feb-2005  perry de-__P
 1.20 13-Dec-2003  ad branches: 1.20.8; 1.20.10;
Add write barriers (a no-op on vax).
 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 26-Sep-2002  ad Update for dzattach() change.
 1.15 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.14 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.13 13-Nov-2001  lukem add RCSIDs
 1.12 05-Jun-2000  matt branches: 1.12.4; 1.12.6;
Adjust to new evcnt stuff.
 1.11 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.10 30-Apr-2000  ragge branches: 1.10.2;
Change to use new ubareset() functionality.
 1.9 30-Mar-2000  augustss Remove register declarations.
 1.8 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.7 06-Jun-1999  ragge branches: 1.7.2; 1.7.4;
Fix map register/DMA wait queues.
Still to do:
BDP handling. Currently missing.
Ubareset's won't work at all.
 1.6 27-May-1999  ragge Moved from ../dec/qbus/dz_uba.c,v
 1.5 27-May-1999  ragge Directory called qbus instead of uba, per request from Matt/Jason/...
(More describing name actually)
 1.4 26-May-1999  ragge DZ-11 routines bus'ified. Small fixes to uba routines.
 1.3 13-Mar-1999  ragge Avoid warning if !QBA.
 1.2 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.1 17-May-1998  ragge Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.7.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.7.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.10.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.12.6.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.12.6.2 16-Mar-2002  jdolecek Catch up with -current.
 1.12.6.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.12.4.3 18-Oct-2002  nathanw Catch up to -current.
 1.12.4.2 28-Feb-2002  nathanw Catch up to -current.
 1.12.4.1 14-Nov-2001  nathanw Catch up to -current.
 1.19.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.19.6.4 04-Feb-2005  skrll Sync with HEAD.
 1.19.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.19.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.19.6.1 03-Aug-2004  skrll Sync with HEAD
 1.20.10.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.20.10.1 12-Feb-2005  yamt sync with head.
 1.20.8.1 29-Apr-2005  kent sync with -current
 1.22.4.3 17-Mar-2008  yamt sync with head.
 1.22.4.2 27-Oct-2007  yamt sync with head.
 1.22.4.1 21-Jun-2006  yamt sync with head.
 1.23.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.23.10.1 19-Apr-2006  elad sync with head.
 1.23.8.1 01-Apr-2006  yamt sync with head.
 1.23.6.1 22-Apr-2006  simonb Sync with head.
 1.23.4.1 09-Sep-2006  rpaulo sync with head
 1.25.38.1 25-Oct-2007  bouyer Sync with HEAD.
 1.25.34.2 23-Mar-2008  matt sync with HEAD
 1.25.34.1 06-Nov-2007  matt sync with HEAD
 1.25.32.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.25.18.1 23-Oct-2007  ad Sync with head.
 1.26.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.26.12.1 24-Mar-2008  keiichi sync with head.
 1.28.68.1 28-Aug-2017  skrll Sync with HEAD
 1.28.48.1 03-Dec-2017  jdolecek update from HEAD
 1.5 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.4 27-May-1999  ragge branches: 1.4.2; 1.4.16; 1.4.18;
Moved from ../dec/qbus/dzreg.h,v
 1.3 26-May-1999  ragge DZ-11 routines bus'ified. Small fixes to uba routines.
 1.2 17-May-1998  ragge Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.1 08-Apr-1996  ragge Drivers for DZ11/DZV11/DZQ11 serial cards.
Written (mostly) by Ken Wellsch.
 1.4.18.1 16-Mar-2002  jdolecek Catch up with -current.
 1.4.16.1 28-Feb-2002  nathanw Catch up to -current.
 1.4.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.11 25-Feb-2002  ad Move the dz driver to dev/dec, since it can be shared with pmax.
 1.10 30-Dec-2000  ragge branches: 1.10.2; 1.10.4;
Changes for dzkbd/dzms. This is not yet finished, but at least the
kernel is useable.
 1.9 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.8 04-Jun-2000  matt Start couting interrupts.
 1.7 30-Apr-2000  ragge branches: 1.7.2;
Change to use new ubareset() functionality.
 1.6 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.5 27-May-1999  ragge branches: 1.5.2; 1.5.4;
Moved from ../dec/qbus/dzvar.h,v
 1.4 26-May-1999  ragge DZ-11 routines bus'ified. Small fixes to uba routines.
 1.3 13-Mar-1999  ragge Change vsbus to take a locator for all devices.
Figure out interrupt vector/mask on vsbus by forcing all devices to
generate interrupts in the match routine, like on unibus.
 1.2 14-Jun-1998  ragge Add catch function for keyboard.
 1.1 17-May-1998  ragge Split the DZ11 driver into two parts; can now use the same driver on
both unibus/qbus devices and vaxstations.
 1.5.4.2 05-Jan-2001  bouyer Sync with HEAD
 1.5.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.5.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.7.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.10.4.1 16-Mar-2002  jdolecek Catch up with -current.
 1.10.2.1 28-Feb-2002  nathanw Catch up to -current.
 1.19 21-Apr-2025  mrg add missing ifuba attribute for qe(4), from Josh Moyer on port-vax.
 1.18 21-Oct-2024  rin qbus/qt(4): Add missing dependency to `ifuba`
 1.17 11-Mar-2008  matt branches: 1.17.130;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.16 11-Dec-2005  christos branches: 1.16.46; 1.16.66; 1.16.70;
merge ktrace-lwp.
 1.15 29-Aug-2003  ragge branches: 1.15.16;
The qt driver must be probed first, so that the qe driver is skipped
if it is a qt card.
 1.14 28-Aug-2003  ragge Add qt.
 1.13 23-Mar-2003  ragge branches: 1.13.2;
Driver for RX01/02 floppies, written by Jochen Kunz.
 1.12 26-Aug-2002  ragge Include DMF32/DMZ32 files. The actual device drivers will be checked in when
the licensing of the 4.4BSD encumbered files are solved.
 1.11 25-Feb-2002  ad branches: 1.11.8;
Move the dz driver to dev/dec, since it can be shared with pmax.
 1.10 13-Jun-2001  lukem branches: 1.10.2;
be more specific about which interlan controller the qbus/if_il supports
 1.9 06-May-2001  ragge Add il, dmc, ts and if_uba.
 1.8 30-Dec-2000  ragge branches: 1.8.2;
Changes for dzkbd/dzms. This is not yet finished, but at least the
kernel is useable.
 1.7 22-Apr-2000  ragge Add the famous "rl" disk.
 1.6 20-Jun-1999  ragge branches: 1.6.2; 1.6.4;
add qe and qd.
 1.5 06-Jun-1999  ragge Fix map register/DMA wait queues.
Still to do:
BDP handling. Currently missing.
Ubareset's won't work at all.
 1.4 27-May-1999  ragge Moved from ../dec/qbus/files.uba,v
 1.3 27-May-1999  ragge Directory called qbus instead of uba, per request from Matt/Jason/...
(More describing name actually)
 1.2 26-May-1999  ragge DZ-11 routines bus'ified. Small fixes to uba routines.
 1.1 24-May-1999  ragge First step towards MI Unibus/Q22 bus code.
 1.6.4.2 05-Jan-2001  bouyer Sync with HEAD
 1.6.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.6.2.3 01-Jul-1999  thorpej Sync w/ -current.
 1.6.2.2 21-Jun-1999  thorpej Sync w/ -current.
 1.6.2.1 20-Jun-1999  thorpej file files.uba was added on branch chs-ubc2 on 1999-06-21 01:18:52 +0000
 1.8.2.3 27-Aug-2002  nathanw Catch up to -current.
 1.8.2.2 28-Feb-2002  nathanw Catch up to -current.
 1.8.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.10.2.2 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.10.2.1 16-Mar-2002  jdolecek Catch up with -current.
 1.11.8.1 29-Aug-2002  gehenna catch up with -current.
 1.13.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.13.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.13.2.1 03-Aug-2004  skrll Sync with HEAD
 1.15.16.1 17-Mar-2008  yamt sync with head.
 1.16.70.1 03-Apr-2008  mjf Sync with HEAD.
 1.16.66.1 24-Mar-2008  keiichi sync with head.
 1.16.46.1 23-Mar-2008  matt sync with HEAD
 1.17.130.1 02-Aug-2025  perseant Sync with HEAD
 1.36 01-Aug-2021  andvar fix typos in word "otherwise".
 1.35 29-Jan-2020  thorpej branches: 1.35.10;
Adopt <net/if_stats.h>.
 1.34 26-Jun-2018  msaitoh branches: 1.34.2; 1.34.10;
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.33 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.32 22-May-2017  ragge branches: 1.32.2; 1.32.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.31 15-Dec-2016  ozaki-r 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.30 09-Feb-2016  ozaki-r branches: 1.30.2;
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.29 05-Apr-2010  joerg branches: 1.29.18; 1.29.36;
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.28 19-Jan-2010  pooka branches: 1.28.2; 1.28.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.27 12-May-2009  cegger KNF
 1.26 18-Apr-2009  tsutsui Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
 1.25 18-Mar-2009  cegger bcopy -> memcpy
 1.24 16-Dec-2008  christos branches: 1.24.2;
replace bitmask_snprintf(9) with snprintb(3)
 1.23 11-Mar-2008  matt branches: 1.23.4; 1.23.12;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.22 19-Oct-2007  ad branches: 1.22.12; 1.22.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.21 04-Mar-2007  christos branches: 1.21.2; 1.21.14; 1.21.16; 1.21.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.20 29-Mar-2006  thorpej branches: 1.20.14;
Use device_private().
 1.19 25-Mar-2006  thorpej Use device_parent().
 1.18 11-Dec-2005  christos branches: 1.18.4; 1.18.6; 1.18.8; 1.18.10; 1.18.12;
merge ktrace-lwp.
 1.17 27-Jun-2005  ragge branches: 1.17.2;
Fixes due to cast-qual addition.
 1.16 26-Feb-2005  simonb White space nits.
 1.15 07-Aug-2003  agc branches: 1.15.8; 1.15.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.14 02-Oct-2002  thorpej branches: 1.14.6;
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 06-May-2001  ragge branches: 1.10.2;
Use if_uba + ether_ioctl routines. Removed ~150 lines of duplicated code.
 1.9 26-Apr-2001  ragge Use ubmemalloc() to get mapped uba memory.
Only copy mbufs if there are more than two in a mbuf chain (on transmit).
This squeezed another 5% out of the DEUNA. (now closing up to 100 K/s :-)
 1.8 14-Dec-2000  thorpej branches: 1.8.2;
ALTQ'ify.
 1.7 15-Nov-2000  thorpej branches: 1.7.2;
Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.6 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.5 08-Jun-2000  ragge Fix a transmit bug and get a little more out from the receive logic.
 1.4 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.3 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.2 28-May-2000  ragge Some updates to the DEUNA driver:
- Change the transmit logic to send from a pre-allocated buffer instead
of doing DMA out of the mbufs directly. Timing shows that it takes
4 times longer to map in the mbufs via the sgmap routines instead of
just copying the data! This must be fixed sometine in the future.
- A bunch of other minor fixes.
 1.1 30-Apr-2000  ragge branches: 1.1.2;
Rewritten (most of) the DEUNA/DELUA driver. No more data copy, packet
header fiddling and forget driver support for trailers.
 1.1.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.7.2.4 05-Jan-2001  bouyer Sync with HEAD
 1.7.2.3 22-Nov-2000  bouyer Sync with HEAD.
 1.7.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.7.2.1 15-Nov-2000  bouyer file if_de.c was added on branch thorpej_scsipi on 2000-11-20 11:42:49 +0000
 1.8.2.3 18-Oct-2002  nathanw Catch up to -current.
 1.8.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.8.2.1 21-Jun-2001  nathanw Catch up to -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.14.6.5 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.14.6.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.14.6.1 03-Aug-2004  skrll Sync with HEAD
 1.15.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.15.8.1 29-Apr-2005  kent sync with -current
 1.17.2.4 17-Mar-2008  yamt sync with head.
 1.17.2.3 27-Oct-2007  yamt sync with head.
 1.17.2.2 03-Sep-2007  yamt sync with head.
 1.17.2.1 21-Jun-2006  yamt sync with head.
 1.18.12.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.18.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.18.10.1 19-Apr-2006  elad sync with head.
 1.18.8.1 01-Apr-2006  yamt sync with head.
 1.18.6.1 22-Apr-2006  simonb Sync with head.
 1.18.4.1 09-Sep-2006  rpaulo sync with head
 1.20.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.21.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.21.16.2 23-Mar-2008  matt sync with HEAD
 1.21.16.1 06-Nov-2007  matt sync with HEAD
 1.21.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.21.2.1 23-Oct-2007  ad Sync with head.
 1.22.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.22.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.22.12.1 24-Mar-2008  keiichi sync with head.
 1.23.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.23.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.23.4.4 11-Aug-2010  yamt sync with head.
 1.23.4.3 11-Mar-2010  yamt sync with head
 1.23.4.2 16-May-2009  yamt sync with head
 1.23.4.1 04-May-2009  yamt sync with head.
 1.24.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.28.4.1 30-May-2010  rmind sync with head
 1.28.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.29.36.3 28-Aug-2017  skrll Sync with HEAD
 1.29.36.2 05-Feb-2017  skrll Sync with HEAD
 1.29.36.1 19-Mar-2016  skrll Sync with HEAD
 1.29.18.1 03-Dec-2017  jdolecek update from HEAD
 1.30.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.32.8.2 28-Jul-2018  pgoyette Sync with HEAD
 1.32.8.1 25-Jun-2018  pgoyette Sync with HEAD
 1.32.2.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.10.1 29-Feb-2020  ad Sync with head.
 1.34.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.35.10.1 01-Aug-2021  thorpej Sync with HEAD.
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 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.2 28-May-2000  ragge branches: 1.2.4; 1.2.28;
Some updates to the DEUNA driver:
- Change the transmit logic to send from a pre-allocated buffer instead
of doing DMA out of the mbufs directly. Timing shows that it takes
4 times longer to map in the mbufs via the sgmap routines instead of
just copying the data! This must be fixed sometine in the future.
- A bunch of other minor fixes.
 1.1 30-Apr-2000  ragge branches: 1.1.2;
Rewritten (most of) the DEUNA/DELUA driver. No more data copy, packet
header fiddling and forget driver support for trailers.
 1.1.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.2.28.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.28.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.28.1 03-Aug-2004  skrll Sync with HEAD
 1.2.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.2.4.1 28-May-2000  bouyer file if_dereg.h was added on branch thorpej_scsipi on 2000-11-20 11:42:49 +0000
 1.30 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.29 04-Apr-2022  andvar branches: 1.29.8; 1.29.10;
fix various typos, mainly in comments.
 1.28 05-Feb-2020  skrll Adopt <net/if_stats.h>
 1.27 04-Feb-2020  skrll Adopt <net/if_stats.h>
 1.26 20-Jul-2016  ozaki-r branches: 1.26.16; 1.26.24;
Apply pserialize to some iterations of IP address lists
 1.25 07-Jul-2016  ozaki-r branches: 1.25.2;
Switch the address list of intefaces to pslist(9)

As usual, we leave the old list to avoid breaking kvm(3) users.
 1.24 20-Apr-2016  knakahara IFQ_ENQUEUE refactor (3/3) : eliminate pktattr argument from IFQ_ENQUEUE caller
 1.23 05-Jun-2014  rmind branches: 1.23.4;
- Implement pktqueue interface for lockless IP input queue.
- Replace ipintrq and ip6intrq with the pktqueue mechanism.
- Eliminate kernel-lock from ipintr() and ip6intr().
- Some preparation work to push softnet_lock out of ipintr().

Discussed on tech-net.
 1.22 15-May-2014  msaitoh Save a NETISR_* value in a variable and call schednetisr() after enqueue
a packet for readability and future modification.
 1.21 27-Oct-2012  chs branches: 1.21.2; 1.21.10;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.20 12-May-2009  cegger branches: 1.20.12; 1.20.22;
struct device * -> device_t, no functional changes intended.
 1.19 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.18 16-Dec-2008  christos branches: 1.18.2;
replace bitmask_snprintf(9) with snprintb(3)
 1.17 07-Nov-2008  dyoung *** 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.16 05-Apr-2008  cegger branches: 1.16.4; 1.16.10; 1.16.12;
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 04-Mar-2007  christos branches: 1.14.2; 1.14.14; 1.14.16; 1.14.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 29-Mar-2006  thorpej branches: 1.13.14;
Use device_private().
 1.12 29-Mar-2006  thorpej Use device_cfdata().
 1.11 25-Mar-2006  thorpej Use device_parent().
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.6; 1.10.8; 1.10.10; 1.10.12;
merge ktrace-lwp.
 1.9 26-Feb-2005  simonb branches: 1.9.4;
White space nits.
 1.8 24-Jan-2005  matt branches: 1.8.2;
Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them.
 1.7 07-Aug-2003  agc branches: 1.7.8;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 02-Oct-2002  thorpej branches: 1.6.6;
Add trailing ; to CFATTACH_DECL.
 1.5 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.4 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.3 05-Mar-2002  itojun bring in latest ALTQ from kjc. ALTQify some of the drivers.
 1.2 13-Nov-2001  lukem add RCSIDs
 1.1 06-May-2001  ragge branches: 1.1.2; 1.1.4;
Driver for the DMC-11/DMR-11 DDCMP interface, (untested) from 4.4BSD.
 1.1.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.1.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.4 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 06-May-2001  nathanw file if_dmc.c was added on branch nathanw_sa on 2001-06-21 20:05:26 +0000
 1.6.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.6.4 04-Feb-2005  skrll Sync with HEAD.
 1.6.6.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.6.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.6.1 03-Aug-2004  skrll Sync with HEAD
 1.7.8.1 29-Apr-2005  kent sync with -current
 1.8.2.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.9.4.3 27-Oct-2007  yamt sync with head.
 1.9.4.2 03-Sep-2007  yamt sync with head.
 1.9.4.1 21-Jun-2006  yamt sync with head.
 1.10.12.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.10.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.10.10.1 19-Apr-2006  elad sync with head.
 1.10.8.1 01-Apr-2006  yamt sync with head.
 1.10.6.1 22-Apr-2006  simonb Sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.13.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.14.16.1 06-Nov-2007  matt sync with HEAD
 1.14.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.14.2.1 23-Oct-2007  ad Sync with head.
 1.15.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.15.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.16.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.16.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.16.4.2 16-May-2009  yamt sync with head
 1.16.4.1 04-May-2009  yamt sync with head.
 1.18.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.20.22.3 03-Dec-2017  jdolecek update from HEAD
 1.20.22.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.20.12.1 30-Oct-2012  yamt sync with head
 1.21.10.1 10-Aug-2014  tls Rebase.
 1.21.2.1 18-May-2014  rmind sync with head
 1.23.4.3 05-Oct-2016  skrll Sync with HEAD
 1.23.4.2 09-Jul-2016  skrll Sync with HEAD
 1.23.4.1 22-Apr-2016  skrll Sync with HEAD
 1.25.2.1 26-Jul-2016  pgoyette Sync with HEAD
 1.26.24.1 29-Feb-2020  ad Sync with head.
 1.26.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.29.10.1 02-Aug-2025  perseant Sync with HEAD
 1.29.8.1 16-Nov-2023  thorpej IFQ_CLASSIFY() -> ifq_classify_packet().
 1.4 11-Dec-2005  christos merge ktrace-lwp.
 1.3 26-Feb-2005  simonb White space nits.
 1.2 07-Aug-2003  agc branches: 1.2.8; 1.2.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.1 06-May-2001  ragge branches: 1.1.2; 1.1.24;
Driver for the DMC-11/DMR-11 DDCMP interface, (untested) from 4.4BSD.
 1.1.24.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.24.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 06-May-2001  nathanw file if_dmcreg.h was added on branch nathanw_sa on 2001-06-21 20:05:27 +0000
 1.2.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.8.1 29-Apr-2005  kent sync with -current
 1.37 01-Aug-2021  andvar fix typos in word "otherwise".
 1.36 21-Oct-2019  msaitoh branches: 1.36.12;
if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.35 28-May-2019  msaitoh branches: 1.35.2;
Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.34 24-May-2019  msaitoh Make if_il.c compilable again.
 1.33 24-May-2019  msaitoh Revert previous.
 1.32 24-May-2019  msaitoh Make it compilable. Not tested.
 1.31 23-May-2019  msaitoh Whitespace fix (mainly tabify).
 1.30 23-May-2019  msaitoh -No functional change:
- KNF
- u_int*_t -> uint*_t.
 1.29 09-Feb-2016  ozaki-r branches: 1.29.10; 1.29.18;
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.28 12-Sep-2015  christos add missing splx() found by brainy
 1.27 29-May-2014  wiz branches: 1.27.4;
Add missing braces. From Henning Petersen in PR 48846.
 1.26 27-Oct-2012  chs branches: 1.26.10;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.25 02-Feb-2010  wiz branches: 1.25.12; 1.25.22;
Fix incomplete line (deleto?), found by cppcheck and reported by
Henning Petersen in PR 42719.
 1.24 12-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.23 12-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.22 18-Apr-2009  tsutsui Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
 1.21 18-Mar-2009  cegger bcopy -> memcpy
 1.20 16-Dec-2008  christos branches: 1.20.2;
replace bitmask_snprintf(9) with snprintb(3)
 1.19 05-Apr-2008  cegger branches: 1.19.4; 1.19.12;
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 26-Aug-2007  dyoung branches: 1.17.2; 1.17.6;
Constify: LLADDR -> CLLADDR. I'm aiming here to make it easier to
identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).
 1.16 04-Mar-2007  christos branches: 1.16.2; 1.16.10; 1.16.14;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.15 07-Sep-2006  dogcow branches: 1.15.8;
remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.
 1.14 29-Mar-2006  thorpej Use device_private().
 1.13 25-Mar-2006  thorpej Use device_parent().
 1.12 11-Dec-2005  christos branches: 1.12.4; 1.12.6; 1.12.8; 1.12.10; 1.12.12;
merge ktrace-lwp.
 1.11 26-Feb-2005  simonb branches: 1.11.4;
White space nits.
 1.10 07-Aug-2003  agc branches: 1.10.8; 1.10.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.9 15-Jan-2003  bouyer branches: 1.9.2;
Ragge said this chip should autopad, so just remove the check.
 1.8 02-Oct-2002  thorpej 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 22-May-2002  wiz bcmp -> memcmp.
 1.4 05-Mar-2002  itojun branches: 1.4.6; 1.4.8;
bring in latest ALTQ from kjc. ALTQify some of the drivers.
 1.3 06-Dec-2001  msaitoh #endif ... -> #endif /* ... */
 1.2 13-Nov-2001  lukem add RCSIDs
 1.1 06-May-2001  ragge branches: 1.1.2; 1.1.4;
Driver for the Interlan NI1010 Ethernet Controller, from 4.4BSD.
 1.1.4.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.1.4.3 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.4.2 16-Mar-2002  jdolecek Catch up with -current.
 1.1.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.1.2.8 17-Jan-2003  thorpej Sync with HEAD.
 1.1.2.7 18-Oct-2002  nathanw Catch up to -current.
 1.1.2.6 20-Jun-2002  nathanw Catch up to -current.
 1.1.2.5 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.4 08-Jan-2002  nathanw Catch up to -current.
 1.1.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 06-May-2001  nathanw file if_il.c was added on branch nathanw_sa on 2001-06-21 20:05:27 +0000
 1.4.8.1 27-Jan-2003  jmc Pullup revisions 1.8-1.9 (requested by bouyer in ticket #1094)
This chip should autopad, so just remove the check.
 1.4.6.1 30-May-2002  gehenna Catch up with -current.
 1.9.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.9.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.9.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.9.2.1 03-Aug-2004  skrll Sync with HEAD
 1.10.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.10.8.1 29-Apr-2005  kent sync with -current
 1.11.4.4 27-Oct-2007  yamt sync with head.
 1.11.4.3 03-Sep-2007  yamt sync with head.
 1.11.4.2 30-Dec-2006  yamt sync with head.
 1.11.4.1 21-Jun-2006  yamt sync with head.
 1.12.12.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.12.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.12.10.1 19-Apr-2006  elad sync with head.
 1.12.8.2 14-Sep-2006  yamt sync with head.
 1.12.8.1 01-Apr-2006  yamt sync with head.
 1.12.6.1 22-Apr-2006  simonb Sync with head.
 1.12.4.1 09-Sep-2006  rpaulo sync with head
 1.15.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.16.14.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.16.14.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.16.10.1 03-Sep-2007  skrll Sync with HEAD.
 1.16.2.2 23-Oct-2007  ad Sync with head.
 1.16.2.1 09-Oct-2007  ad Sync with head.
 1.17.6.1 25-Oct-2007  bouyer Sync with HEAD.
 1.17.2.1 06-Nov-2007  matt sync with HEAD
 1.18.16.2 17-Jan-2009  mjf Sync with HEAD.
 1.18.16.1 02-Jun-2008  mjf Sync with HEAD.
 1.19.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.19.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.19.4.3 11-Mar-2010  yamt sync with head
 1.19.4.2 16-May-2009  yamt sync with head
 1.19.4.1 04-May-2009  yamt sync with head.
 1.20.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.25.22.3 03-Dec-2017  jdolecek update from HEAD
 1.25.22.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.25.22.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.25.12.1 30-Oct-2012  yamt sync with head
 1.26.10.1 10-Aug-2014  tls Rebase.
 1.27.4.2 19-Mar-2016  skrll Sync with HEAD
 1.27.4.1 22-Sep-2015  skrll Sync with HEAD
 1.29.18.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.29.18.1 10-Jun-2019  christos Sync with HEAD
 1.29.10.1 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.35.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.36.12.1 01-Aug-2021  thorpej Sync with HEAD.
 1.3 11-Dec-2005  christos merge ktrace-lwp.
 1.2 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.1 06-May-2001  ragge branches: 1.1.2; 1.1.24;
Driver for the Interlan NI1010 Ethernet Controller, from 4.4BSD.
 1.1.24.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.1.24.2 18-Sep-2004  skrll Sync with HEAD.
 1.1.24.1 03-Aug-2004  skrll Sync with HEAD
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 06-May-2001  nathanw file if_il.h was added on branch nathanw_sa on 2001-06-21 20:05:27 +0000
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 26-Feb-2005  simonb White space nits.
 1.3 07-Aug-2003  agc branches: 1.3.8; 1.3.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.2 03-May-2003  wiz branches: 1.2.2;
DMA, not dma nor Dma.
 1.1 06-May-2001  ragge branches: 1.1.2;
Driver for the Interlan NI1010 Ethernet Controller, from 4.4BSD.
 1.1.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.1.2.1 06-May-2001  nathanw file if_ilreg.h was added on branch nathanw_sa on 2001-06-21 20:05:28 +0000
 1.2.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.1 03-Aug-2004  skrll Sync with HEAD
 1.3.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.8.1 29-Apr-2005  kent sync with -current
 1.83 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.82 25-Mar-2024  mrg branches: 1.82.2;
vax/qe(4): supply an ipf->if_init() so that if_init() doesn't crash.

convert the existing qeinit() to one compatible with if_init.

should fix PR#58068.
 1.81 28-May-2019  msaitoh branches: 1.81.2; 1.81.28;
Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.80 23-May-2019  msaitoh -No functional change:
- KNF
- u_int*_t -> uint*_t.
 1.79 26-Jun-2018  msaitoh branches: 1.79.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.78 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.77 22-May-2017  ragge branches: 1.77.2; 1.77.8;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.76 15-Dec-2016  ozaki-r 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.75 10-Jun-2016  ozaki-r branches: 1.75.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.74 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.73 18-Aug-2014  riastradh branches: 1.73.2;
Avoid leak in error branch, noted by maxv@, compile-tested for vax.
 1.72 25-Oct-2013  martin branches: 1.72.4;
Fix dmamap cleanup in an error path
 1.71 05-Apr-2010  joerg branches: 1.71.8; 1.71.14; 1.71.18; 1.71.20; 1.71.22; 1.71.28;
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 18-Mar-2009  cegger bzero -> memset
 1.68 07-Nov-2008  dyoung branches: 1.68.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.67 11-Mar-2008  matt branches: 1.67.4; 1.67.10; 1.67.12;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.66 22-Dec-2007  tsutsui branches: 1.66.2; 1.66.6;
Apply changes for struct ifnet->if_sadl constify:
http://mail-index.netbsd.org/source-changes/2007/12/20/0033.html
 1.65 19-Oct-2007  ad branches: 1.65.4; 1.65.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.64 06-Sep-2007  he branches: 1.64.4;
Remove a now-unused local variable.
 1.63 01-Sep-2007  dyoung 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.62 04-Mar-2007  christos branches: 1.62.2; 1.62.10; 1.62.14; 1.62.16;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.61 29-Mar-2006  thorpej branches: 1.61.14;
Use device_private().
 1.60 11-Dec-2005  christos branches: 1.60.4; 1.60.6; 1.60.8; 1.60.10; 1.60.12;
merge ktrace-lwp.
 1.59 26-Feb-2005  simonb branches: 1.59.4;
White space nits.
 1.58 30-Oct-2004  thorpej branches: 1.58.4; 1.58.6;
When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.57 17-Jan-2003  bouyer branches: 1.57.2; 1.57.6;
Redo previous in a better way:
allocate a static buffer, which is added at the end of short packets
to pad the buffer to ETHER_MIN_LEN - ETHER_CRC_LEN.
While I'm there fix 2 bugs:
in qeinit(), unload the right dmamap if bus_dmamap_load fails
in qestart, don't dmamap_load the mbuf if its len is 0.
Tested on simh-vax.
 1.56 15-Jan-2003  bouyer Zero out the extra space stolen from mbuf to pad packet to ETHER_MIN_LEN
XXX should it be ETHER_MIN_LEN - ETHER_CRC_LEN ?
XXX2 we assume there are enouth space in the mbuf for the padding bytes.
But other places in the code assumes this already.
 1.55 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.54 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.53 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.52 27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.51 08-Jun-2002  ragge Detection bug: If a packet is received while in the match() routine the stack
would be overwritten, so allocate memory for a full packet via malloc()
instead. Use correct buffer maxlen (must be 2 complemet). Bug reported
and helped to find by Roar Thron�s.
 1.50 22-May-2002  wiz bcmp -> memcmp.
 1.49 13-Nov-2001  lukem branches: 1.49.8; 1.49.10;
add RCSIDs
 1.48 26-Apr-2001  ragge branches: 1.48.2;
Use uballoc()/ubmemalloc() for data structure allocation.
 1.47 12-Apr-2001  thorpej splimp -> splnet
 1.46 25-Feb-2001  ragge branches: 1.46.2;
Do not send looped-back setup packets into the IP stack.
Handle xmit interrupts due to invalid transmit list (``cannot happen'')
Shoot the one that wrote the software for those cards.
 1.45 14-Dec-2000  thorpej ALTQ'ify.
 1.44 15-Nov-2000  thorpej Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach().
 1.43 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.42 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.41 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.40 30-Mar-2000  augustss branches: 1.40.2;
Remove register declarations.
 1.39 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.38 01-Aug-1999  ragge branches: 1.38.2;
Add a timeout-routine that checks if transmit logic dies, and reset it
in that case. This is not uncommon when the interface is heavy loaded.
 1.37 20-Jun-1999  ragge branches: 1.37.2;
Totally rewritten DEQNA device driver, that uses the bus.h interface
instead. This almost doubled the receive speed of the interface :-)
 1.36 06-Jun-1999  ragge Copied from ../../arch/vax/if/if_qe.c,v
 1.35 23-May-1999  ragge Make this file compile again.
 1.34 18-May-1999  thorpej 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.33 29-Nov-1998  ragge branches: 1.33.2;
the btoc/ctob/btop macros must use CLBYTES, not NBPG. How this should
work in the long run is an open issue; some parts must be reworked
in a MI way.
 1.32 05-Nov-1998  ragge EGCS fixes.
 1.31 05-Jul-1998  jonathan defopt NS, NSIP.
 1.30 05-Jul-1998  jonathan defopt ISO TPIP.
 1.29 05-Jul-1998  jonathan defopt LLC
 1.28 05-Jul-1998  jonathan defopt CCITT.
 1.27 05-Jul-1998  jonathan defopt INET, NETATALK.
 1.26 20-Jun-1998  ragge Fix some compile-time warnings. Pointed out by David Brownlee.
 1.25 13-Mar-1998  ragge Add support for "root on qe".
 1.24 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.23 12-Jan-1998  thorpej Update for changes to config.
 1.22 02-May-1997  ragge BPF and multicast support added, patches provided by Jonathan Stone
and Ken Wellsch. Fixes PR#2796.
 1.21 19-Apr-1997  ragge Fix so that these files compile again after recent ARP changes.
 1.20 15-Mar-1997  is New ARP system, supports IPv4 over any hardware link.

Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
 1.19 12-Feb-1997  ragge Fix so it works with root over NFS.
 1.18 13-Oct-1996  christos branches: 1.18.6;
backout previous kprintf change
 1.17 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.16 20-Aug-1996  ragge Change uba* functions to take pointers, rather than uba unit numbers.
 1.15 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.14 07-May-1996  thorpej Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)()
to take a struct ifnet *, rather than a unit number.
 1.13 18-Mar-1996  ragge Ubareset are now possible, devices that wants it now set it up
during autoconfig. ifubareset (if_reset) no longer used, actually
it's just a normal ubareset and is now handled like that.
 1.12 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.11 11-Feb-1996  ragge Add prototypes.
 1.10 02-Feb-1996  mycroft Fix #includes.
 1.9 02-Feb-1996  mycroft Fix #includes.
 1.8 24-Dec-1995  mycroft The IST_* and IPL_* constants are not bus-specific; don't treat them as such.
Change splimp -> splnet in Ethernet, ARCnet, and FDDI drivers.
 1.7 01-Dec-1995  ragge DELUA/DENUA & DELQA/DEQNA Ethernet adapters converted to new config.
 1.6 30-Nov-1995  jtc merge in changes from 1.1 release branch
 1.5 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.4 05-Jul-1995  ragge branches: 1.4.2;
Changes due to common network code mods.
 1.3 16-Jun-1995  ragge DELAY() removed, now common.
 1.2 11-Apr-1995  mycroft Sync with the rest of the world. Say goodbye to Mr. Trailer.
 1.1 30-Mar-1995  ragge Support for DEQNA/DELQA added.
 1.4.2.1 15-Oct-1995  ragge Type changing to be able to compile with -Werror.
 1.18.6.3 10-Mar-1997  is netinet/if_ether.h => netinet/if_inarp.h
 1.18.6.2 06-Mar-1997  is Merge in fix from the Trunk.
 1.18.6.1 06-Mar-1997  is Convert to new ARP code.
 1.33.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.37.2.3 02-Aug-1999  thorpej Update from trunk.
 1.37.2.2 21-Jun-1999  thorpej Sync w/ -current.
 1.37.2.1 20-Jun-1999  thorpej file if_qe.c was added on branch chs-ubc2 on 1999-06-21 01:18:52 +0000
 1.38.2.5 21-Apr-2001  bouyer Sync with HEAD
 1.38.2.4 12-Mar-2001  bouyer Sync with HEAD.
 1.38.2.3 05-Jan-2001  bouyer Sync with HEAD
 1.38.2.2 22-Nov-2000  bouyer Sync with HEAD.
 1.38.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.40.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.46.2.5 17-Jan-2003  thorpej Sync with HEAD.
 1.46.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.46.2.3 20-Jun-2002  nathanw Catch up to -current.
 1.46.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.46.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.48.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.48.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.48.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.49.10.3 29-Jan-2003  jmc Pullup revisions 1.56-1.57 (requested by bouyer in ticket #1093)
Redo previous in a better way:
Allocate a static buffer, which is added at the end of short packets
to pad the buffer to ETHER_MIN_LEN - ETHER_CRC_LEN.
 1.49.10.2 27-Jan-2003  jmc Pullup revisions 1.55-1.56 (requested by bouyer in ticket #1093)
Zero out the buffer when padding packet to ETHER_MIN_LEN
 1.49.10.1 10-Jun-2002  tv Pull up revision 1.51 (requested by ragge in ticket #212):
Detection bug: If a packet is received while in the match() routine the stack
would be overwritten, so allocate memory for a full packet via malloc()
instead. Use correct buffer maxlen (must be 2 complemet). Bug reported
and helped to find by Roar Thron�s.
 1.49.8.2 20-Jun-2002  gehenna catch up with -current.
 1.49.8.1 30-May-2002  gehenna Catch up with -current.
 1.57.6.1 24-Jan-2005  he Pull up revision 1.58 (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.57.2.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.57.2.1 02-Nov-2004  skrll Sync with HEAD.
 1.58.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.58.4.1 29-Apr-2005  kent sync with -current
 1.59.4.5 17-Mar-2008  yamt sync with head.
 1.59.4.4 21-Jan-2008  yamt sync with head
 1.59.4.3 27-Oct-2007  yamt sync with head.
 1.59.4.2 03-Sep-2007  yamt sync with head.
 1.59.4.1 21-Jun-2006  yamt sync with head.
 1.60.12.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.60.10.1 19-Apr-2006  elad sync with head.
 1.60.8.1 01-Apr-2006  yamt sync with head.
 1.60.6.1 22-Apr-2006  simonb Sync with head.
 1.60.4.1 09-Sep-2006  rpaulo sync with head
 1.61.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.62.16.3 23-Mar-2008  matt sync with HEAD
 1.62.16.2 09-Jan-2008  matt sync with HEAD
 1.62.16.1 06-Nov-2007  matt sync with HEAD
 1.62.14.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.62.14.2 02-Oct-2007  joerg Sync with HEAD.
 1.62.14.1 03-Sep-2007  jmcneill Sync with HEAD.
 1.62.10.2 10-Sep-2007  skrll Sync with HEAD.
 1.62.10.1 03-Sep-2007  skrll Sync with HEAD.
 1.62.2.2 23-Oct-2007  ad Sync with head.
 1.62.2.1 09-Oct-2007  ad Sync with head.
 1.64.4.1 25-Oct-2007  bouyer Sync with HEAD.
 1.65.8.1 02-Jan-2008  bouyer Sync with HEAD
 1.65.4.1 26-Dec-2007  ad Sync with head.
 1.66.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.66.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.66.2.1 24-Mar-2008  keiichi sync with head.
 1.67.12.2 28-Apr-2009  skrll Sync with HEAD.
 1.67.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.67.10.1 13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.67.4.3 11-Aug-2010  yamt sync with head.
 1.67.4.2 11-Mar-2010  yamt sync with head
 1.67.4.1 04-May-2009  yamt sync with head.
 1.68.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.28.1 03-Nov-2014  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1117):
sys/dev/rasops/rasops.c: revision 1.72
sys/dev/vme/if_ie_vme.c: revision 1.31
sys/dev/qbus/if_qe.c: revision 1.73
sys/altq/altq_jobs.c: revision 1.7
sys/net/if_gre.c: revision 1.160
sys/dev/ic/oosiop.c: revision 1.14
- Fix error branches in altq_jobs.c to avoid leaks, noted by maxv@.
- Fix leaks in oosiop_alloc_cb error branches, noted by maxv@.
While here, avoid a sketchy pointer cast that probably falls afoul of
strict aliasing rules. Compile-tested only, with hppa.
- Don't leak f on failurein rasops.c. Noted by maxv@.
Compile-tested only, with zaurus.
- Avoid leak in error branch in if_qe.c, noted by maxv@, compile-tested for
vax.
- Sizeof struct ievme, not sizeof size_t in if_ie_vme.c.
Noted by maxv@, compile-tested for sparc.
- Don't leak in gre_clone_create error branch.
Noted by maxv@, compile-tested for amd64.
 1.71.22.1 18-May-2014  rmind sync with head
 1.71.20.1 03-Nov-2014  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1117):
sys/dev/rasops/rasops.c: revision 1.72
sys/dev/vme/if_ie_vme.c: revision 1.31
sys/dev/qbus/if_qe.c: revision 1.73
sys/altq/altq_jobs.c: revision 1.7
sys/net/if_gre.c: revision 1.160
sys/dev/ic/oosiop.c: revision 1.14
- Fix error branches in altq_jobs.c to avoid leaks, noted by maxv@.
- Fix leaks in oosiop_alloc_cb error branches, noted by maxv@.
While here, avoid a sketchy pointer cast that probably falls afoul of
strict aliasing rules. Compile-tested only, with hppa.
- Don't leak f on failurein rasops.c. Noted by maxv@.
Compile-tested only, with zaurus.
- Avoid leak in error branch in if_qe.c, noted by maxv@, compile-tested for
vax.
- Sizeof struct ievme, not sizeof size_t in if_ie_vme.c.
Noted by maxv@, compile-tested for sparc.
- Don't leak in gre_clone_create error branch.
Noted by maxv@, compile-tested for amd64.
 1.71.18.2 03-Dec-2017  jdolecek update from HEAD
 1.71.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.71.14.1 03-Nov-2014  msaitoh Pull up following revision(s) (requested by riastradh in ticket #1117):
sys/dev/rasops/rasops.c: revision 1.72
sys/dev/vme/if_ie_vme.c: revision 1.31
sys/dev/qbus/if_qe.c: revision 1.73
sys/altq/altq_jobs.c: revision 1.7
sys/net/if_gre.c: revision 1.160
sys/dev/ic/oosiop.c: revision 1.14
- Fix error branches in altq_jobs.c to avoid leaks, noted by maxv@.
- Fix leaks in oosiop_alloc_cb error branches, noted by maxv@.
While here, avoid a sketchy pointer cast that probably falls afoul of
strict aliasing rules. Compile-tested only, with hppa.
- Don't leak f on failurein rasops.c. Noted by maxv@.
Compile-tested only, with zaurus.
- Avoid leak in error branch in if_qe.c, noted by maxv@, compile-tested for
vax.
- Sizeof struct ievme, not sizeof size_t in if_ie_vme.c.
Noted by maxv@, compile-tested for sparc.
- Don't leak in gre_clone_create error branch.
Noted by maxv@, compile-tested for amd64.
 1.71.8.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.72.4.1 22-Aug-2014  martin Pull up following revision(s) (requested by riastradh in ticket #44):
sys/altq/altq_jobs.c 1.7
Fix error branches to avoid leaks, noted by maxv@.
sys/dev/ic/oosiop.c 1.14
Fix leaks in oosiop_alloc_cb error branches, noted by maxv@.
While here, avoid a sketchy pointer cast that probably falls afoul
of strict aliasing rules.
sys/dev/qbus/if_qe.c 1.73
Avoid leak in error branch, noted by maxv@, compile-tested for vax.
sys/dev/rasops/rasops.c 1.72
Don't leak f on failure. Noted by maxv@.
sys/dev/vme/if_ie_vme.c 1.31
Sizeof struct ievme, not sizeof size_t.
Noted by maxv@, compile-tested for sparc.
sys/net/if_gre.c 1.160
Don't leak in gre_clone_create error branch.
Noted by maxv@, compile-tested for amd64.
 1.73.2.4 28-Aug-2017  skrll Sync with HEAD
 1.73.2.3 05-Feb-2017  skrll Sync with HEAD
 1.73.2.2 09-Jul-2016  skrll Sync with HEAD
 1.73.2.1 19-Mar-2016  skrll Sync with HEAD
 1.75.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.77.8.2 28-Jul-2018  pgoyette Sync with HEAD
 1.77.8.1 25-Jun-2018  pgoyette Sync with HEAD
 1.77.2.2 25-Mar-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1951):

sys/dev/qbus/if_qe.c: revision 1.82

vax/qe(4): supply an ipf->if_init() so that if_init() doesn't crash.

convert the existing qeinit() to one compatible with if_init.
should fix PR#58068.
 1.77.2.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.79.2.1 10-Jun-2019  christos Sync with HEAD
 1.81.28.1 25-Mar-2024  martin Pull up following revision(s) (requested by riastradh in ticket #647):

sys/dev/qbus/if_qe.c: revision 1.82

vax/qe(4): supply an ipf->if_init() so that if_init() doesn't crash.

convert the existing qeinit() to one compatible with if_init.
should fix PR#58068.
 1.81.2.1 25-Mar-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1822):

sys/dev/qbus/if_qe.c: revision 1.82

vax/qe(4): supply an ipf->if_init() so that if_init() doesn't crash.

convert the existing qeinit() to one compatible with if_init.
should fix PR#58068.
 1.82.2.1 02-Aug-2025  perseant Sync with HEAD
 1.11 18-Aug-2025  andvar Fix various typos, mainly in comments:
s/invaid/invalid/
s/instad/instead/
s/wich/with/
s/tranform/transform/
s/tranmist/transmit/
s/tranceiver/transceiver/
s/Tranparent/Transparent/
s/tranlated/translated/
s/tranfer/transfer/
s/tranmissions/transmissions/
s/condtions/conditions/
s/Recient/Recent/
 1.10 09-Feb-2024  andvar s/discriptor/descriptor/ in comments.
 1.9 11-Dec-2005  christos merge ktrace-lwp.
 1.8 26-Feb-2005  simonb White space nits.
 1.7 07-Aug-2003  agc branches: 1.7.8; 1.7.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.6 19-Jun-2001  wiz branches: 1.6.22;
`existent', not `existant'
 1.5 20-Jun-1999  ragge branches: 1.5.2; 1.5.16;
Totally rewritten DEQNA device driver, that uses the bus.h interface
instead. This almost doubled the receive speed of the interface :-)
 1.4 06-Jun-1999  ragge Copied from ../../arch/vax/if/if_qereg.h,v
 1.3 12-Apr-1999  pk Ungarble the copyright notice.
 1.2 15-May-1997  ragge branches: 1.2.16;
Multicast definitions, forgotten in previous checkins.
 1.1 30-Mar-1995  ragge Support for DEQNA/DELQA added.
 1.2.16.1 12-Apr-1999  pk Pullup copyright text corrections.
 1.5.16.1 21-Jun-2001  nathanw Catch up to -current.
 1.5.2.2 21-Jun-1999  thorpej Sync w/ -current.
 1.5.2.1 20-Jun-1999  thorpej file if_qereg.h was added on branch chs-ubc2 on 1999-06-21 01:18:52 +0000
 1.6.22.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.6.22.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.29 08-Jan-2025  tsutsui Use ETHER_CRC_LEN where appropriate.
 1.28 08-Jan-2025  tsutsui Fix misc style, especially weird indent, per KNF.
 1.27 02-Sep-2022  thorpej branches: 1.27.10;
Remove unnecessary inclusion of <net/netisr.h>.
 1.26 20-Dec-2021  rhialto Set up multicast (input) filter on qt (DELQA-Turbo).
 1.25 29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.24 21-Oct-2019  msaitoh branches: 1.24.2;
if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.23 26-Jun-2018  msaitoh branches: 1.23.2; 1.23.8;
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.22 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.21 15-Dec-2016  ozaki-r branches: 1.21.8; 1.21.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.20 12-Dec-2016  maya acknowleg -> acknowledg, proceedure -> procedure.
only comments were changed.

from miod
 1.19 09-Feb-2016  ozaki-r branches: 1.19.2;
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.18 05-Apr-2010  joerg branches: 1.18.18; 1.18.36;
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.17 19-Jan-2010  pooka branches: 1.17.2; 1.17.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.16 11-Jan-2009  matt Initialize sc->sc_dev before we use it.
 1.15 16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.14 11-Mar-2008  matt branches: 1.14.4; 1.14.12;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.13 04-Jan-2008  joerg branches: 1.13.2; 1.13.6;
Add missing sys/device.h.
 1.12 19-Oct-2007  ad branches: 1.12.2; 1.12.8;
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 07-Sep-2006  dogcow branches: 1.10.8;
remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.
 1.9 29-Mar-2006  thorpej Use device_private().
 1.8 25-Mar-2006  thorpej Use device_parent().
 1.7 11-Dec-2005  christos branches: 1.7.4; 1.7.6; 1.7.8; 1.7.10; 1.7.12;
merge ktrace-lwp.
 1.6 26-Feb-2005  simonb branches: 1.6.4;
White space nits.
 1.5 30-Oct-2004  thorpej branches: 1.5.4; 1.5.6;
- qtinit(): Don't skip initialization if we're already marked RUNNING.
ether_ioctl() will call (*if_init)() when flags change. Instead, do
what other drivers do and stop the interface in this case before
re-initializing.
- qtioctl(): Now that qtinit() does the right thing, remove the check
for IFF_PROMISC change.

When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.4 31-Aug-2003  ragge branches: 1.4.4; 1.4.6;
Add stop routine. Add support for turning the device into promiscous mode.
Force interrupt in probe so that the interrupt vector can be detected.
 1.3 29-Aug-2003  ragge bus-ify. Make bpf work, but no promiscuous mode yet.
 1.2 29-Aug-2003  ragge Make the qt driver work under NetBSD. Still to do:
- bus-ify.
- bpf support.
- multicast support.
 1.1 28-Aug-2003  ragge Driver for the DELQA-PLUS card in Turbo mode, from 2.11BSD, written by
Steven M. Schultz.
 1.4.6.1 30-Jan-2005  he Pull up revision 1.5 (requested by thorpej in ticket #942):
In qtinit(), don't skip initialization if the interface is
already RUNNING. ether_ioctl() will call (*if_init)() when
flags change. Instead, do what other drivers do, and stop
the interface in this case before re-initializing.
In qtioctl(), now that qtinit() does the right thing, remove
the check for the IFF_PROMISC change.
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#37678.
 1.4.4.6 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.4.5 02-Nov-2004  skrll Sync with HEAD.
 1.4.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.4.4.2 03-Aug-2004  skrll Sync with HEAD
 1.4.4.1 31-Aug-2003  skrll file if_qt.c was added on branch ktrace-lwp on 2004-08-03 10:50:28 +0000
 1.5.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.4.1 29-Apr-2005  kent sync with -current
 1.6.4.6 17-Mar-2008  yamt sync with head.
 1.6.4.5 21-Jan-2008  yamt sync with head
 1.6.4.4 27-Oct-2007  yamt sync with head.
 1.6.4.3 03-Sep-2007  yamt sync with head.
 1.6.4.2 30-Dec-2006  yamt sync with head.
 1.6.4.1 21-Jun-2006  yamt sync with head.
 1.7.12.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.7.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.7.10.1 19-Apr-2006  elad sync with head.
 1.7.8.2 14-Sep-2006  yamt sync with head.
 1.7.8.1 01-Apr-2006  yamt sync with head.
 1.7.6.1 22-Apr-2006  simonb Sync with head.
 1.7.4.1 09-Sep-2006  rpaulo sync with head
 1.10.8.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.11.16.3 23-Mar-2008  matt sync with HEAD
 1.11.16.2 09-Jan-2008  matt 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.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.12.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.13.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.13.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.13.2.1 24-Mar-2008  keiichi sync with head.
 1.14.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.14.4.3 11-Aug-2010  yamt sync with head.
 1.14.4.2 11-Mar-2010  yamt sync with head
 1.14.4.1 04-May-2009  yamt sync with head.
 1.17.4.1 30-May-2010  rmind sync with head
 1.17.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.18.36.2 05-Feb-2017  skrll Sync with HEAD
 1.18.36.1 19-Mar-2016  skrll Sync with HEAD
 1.18.18.1 03-Dec-2017  jdolecek update from HEAD
 1.19.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.21.14.2 28-Jul-2018  pgoyette Sync with HEAD
 1.21.14.1 25-Jun-2018  pgoyette Sync with HEAD
 1.21.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.21.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.23.8.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.23.2.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.23.2.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.24.2.1 29-Feb-2020  ad Sync with head.
 1.27.10.1 02-Aug-2025  perseant Sync with HEAD
 1.6 20-Dec-2021  rhialto Set up multicast (input) filter on qt (DELQA-Turbo).
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 26-Feb-2005  simonb White space nits.
 1.3 29-Aug-2003  ragge branches: 1.3.4; 1.3.10; 1.3.12;
bus-ify. Make bpf work, but no promiscuous mode yet.
 1.2 29-Aug-2003  ragge Make the qt driver work under NetBSD. Still to do:
- bus-ify.
- bpf support.
- multicast support.
 1.1 28-Aug-2003  ragge Driver for the DELQA-PLUS card in Turbo mode, from 2.11BSD, written by
Steven M. Schultz.
 1.3.12.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.10.1 29-Apr-2005  kent sync with -current
 1.3.4.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.4.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.4.3 18-Sep-2004  skrll Sync with HEAD.
 1.3.4.2 03-Aug-2004  skrll Sync with HEAD
 1.3.4.1 29-Aug-2003  skrll file if_qtreg.h was added on branch ktrace-lwp on 2004-08-03 10:50:28 +0000
 1.32 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.31 13-Nov-2010  uebayasi branches: 1.31.18; 1.31.36;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.30 11-Mar-2008  matt branches: 1.30.26;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.29 19-Oct-2007  ad branches: 1.29.12; 1.29.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.28 08-Mar-2007  he branches: 1.28.2; 1.28.14; 1.28.16; 1.28.20;
Cast to char* before doing pointer arithmetic.
 1.27 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.26 11-Dec-2005  christos branches: 1.26.26;
merge ktrace-lwp.
 1.25 26-Feb-2005  simonb branches: 1.25.4;
White space nits.
 1.24 07-Aug-2003  agc branches: 1.24.8; 1.24.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.23 01-Apr-2003  thorpej branches: 1.23.2;
Use PAGE_SIZE rather than NBPG.
 1.22 13-Nov-2001  lukem add RCSIDs
 1.21 16-Aug-2001  ragge branches: 1.21.2;
Trying to get these files out of Attic.
 1.20 16-Aug-2001  ragge Trying to get files out of Attic.
 1.19 06-May-2001  ragge branches: 1.19.2;
Back from the dead, but now changed to use the bus_dma interface.
Still to do:
- ubaresets
- BDP handling
 1.18 30-Apr-2000  ragge Discard these old leftovers from the IMP and trailer days!
 1.17 30-Mar-2000  augustss Remove register declarations.
 1.16 06-Jun-1999  ragge branches: 1.16.2; 1.16.4;
Copied from ../../arch/vax/if/if_uba.c,v
 1.15 01-Jan-1999  ragge Giant change: NBPG now set to 4k and CLSIZE == 1 for vax. This change
made a whole bunch of annoying bugs disappear; mostly depending on
bad use of NBPG in non-MD code. The VAX port was the only port that
used this historical "feature".

The CL* macros should probably go away totally, there is no reason
at all to keep them.
 1.14 29-Nov-1998  ragge branches: 1.14.2;
the btoc/ctob/btop macros must use CLBYTES, not NBPG. How this should
work in the long run is an open issue; some parts must be reworked
in a MI way.
 1.13 05-Nov-1998  ragge EGCS fixes.
 1.12 20-Aug-1996  ragge Change uba* functions to take pointers, rather than uba unit numbers.
 1.11 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.10 11-Feb-1996  ragge Add prototypes.
 1.9 02-Feb-1996  mycroft Fix #includes.
 1.8 02-Feb-1996  mycroft Fix #includes.
 1.7 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.6 11-Apr-1995  mycroft GC old comment about trailers.
 1.5 11-Apr-1995  mycroft Sync with the rest of the world. Say goodbye to Mr. Trailer.
 1.4 13-Feb-1995  ragge Bug fixes to get network function OK.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge fixed minor problem with mtpr()
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.14.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.16.4.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck, and commit Makefile which
I forgot in the batch of commits.
 1.16.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.19.2.2 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.19.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.21.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.21.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.21.2.1 16-Aug-2001  nathanw file if_uba.c was added on branch nathanw_sa on 2001-08-24 00:10:33 +0000
 1.23.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.23.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.23.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.23.2.1 03-Aug-2004  skrll Sync with HEAD
 1.24.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.24.8.1 29-Apr-2005  kent sync with -current
 1.25.4.3 17-Mar-2008  yamt sync with head.
 1.25.4.2 27-Oct-2007  yamt sync with head.
 1.25.4.1 03-Sep-2007  yamt sync with head.
 1.26.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.28.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.28.16.2 23-Mar-2008  matt sync with HEAD
 1.28.16.1 06-Nov-2007  matt sync with HEAD
 1.28.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.28.2.1 23-Oct-2007  ad Sync with head.
 1.29.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.29.12.1 24-Mar-2008  keiichi sync with head.
 1.30.26.1 05-Mar-2011  rmind sync with head
 1.31.36.1 09-Jul-2016  skrll Sync with HEAD
 1.31.18.1 03-Dec-2017  jdolecek update from HEAD
 1.15 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.14 11-Dec-2005  christos branches: 1.14.26;
merge ktrace-lwp.
 1.13 26-Feb-2005  simonb branches: 1.13.4;
White space nits.
 1.12 07-Aug-2003  agc branches: 1.12.8; 1.12.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.11 16-Aug-2001  ragge branches: 1.11.2; 1.11.22;
Trying to get these files out of Attic.
 1.10 16-Aug-2001  ragge Trying to get files out of Attic.
 1.9 06-May-2001  ragge branches: 1.9.2;
Back from the dead, but now changed to use the bus_dma interface.
Still to do:
- ubaresets
- BDP handling
 1.8 30-Apr-2000  ragge Discard these old leftovers from the IMP and trailer days!
 1.7 06-Jun-1999  ragge branches: 1.7.2; 1.7.4;
Copied from ../../arch/vax/if/if_uba.h,v
 1.6 20-Aug-1996  ragge Change uba* functions to take pointers, rather than uba unit numbers.
 1.5 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.4 11-Feb-1996  ragge Add prototypes.
 1.3 11-May-1995  jtc KERNEL -> _KERNEL
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.7.4.1 20-Nov-2000  bouyer Remove files that are no longer on the trunck, and commit Makefile which
I forgot in the batch of commits.
 1.7.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.9.2.1 25-Aug-2001  thorpej Merge Aug 24 -current into the kqueue branch.
 1.11.22.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.11.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.11.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.11.22.1 03-Aug-2004  skrll Sync with HEAD
 1.11.2.2 24-Aug-2001  nathanw Catch up with -current.
 1.11.2.1 16-Aug-2001  nathanw file if_uba.h was added on branch nathanw_sa on 2001-08-24 00:10:33 +0000
 1.12.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.12.8.1 29-Apr-2005  kent sync with -current
 1.13.4.1 03-Sep-2007  yamt sync with head.
 1.14.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.63 07-Oct-2025  andvar Fix few typos in comments.
 1.62 01-Aug-2023  andvar fix various typos in comments.
 1.61 16-Apr-2022  andvar fix various typos in comments and log messages.
 1.60 12-Dec-2021  andvar fix various typos in comments.
 1.59 26-Sep-2021  thorpej Change the kqueue filterops::f_isfd field to filterops::f_flags, and
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.

This does not constitute a functional or ABI change, as the field location
and size, and the value placed in that field, are the same as the previous
code, but we're bumping __NetBSD_Version__ so 3rd-party module source code
can adapt, as needed.

NetBSD 9.99.89
 1.58 18-Dec-2020  thorpej Use sel{record,remove}_knote().
 1.57 25-Oct-2017  maya branches: 1.57.18;
Use C99 initializer for filterops

Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- { a, b, c, d
+ {
+ .f_isfd = a,
+ .f_attach = b,
+ .f_detach = c,
+ .f_event = d,
};
 1.56 18-Oct-2014  snj src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.55 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.54 16-Mar-2014  dholland branches: 1.54.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.53 27-Oct-2012  chs branches: 1.53.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.52 24-Apr-2011  rmind branches: 1.52.4; 1.52.14;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.51 13-Nov-2010  uebayasi branches: 1.51.2;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.50 18-May-2009  ad branches: 1.50.4;
Don't pass a buffer to physio(), let it be allocated dynamically.

This leaves only scsipi and atapi doing the same.
 1.49 18-Apr-2009  tsutsui Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
 1.48 18-Mar-2009  cegger bcopy -> memcpy
 1.47 18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.46 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.45 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.44 12-Jun-2008  cegger branches: 1.44.4; 1.44.10;
use device_lookup_private to get softc
 1.43 11-Mar-2008  matt branches: 1.43.2; 1.43.4; 1.43.6; 1.43.8;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.42 01-Mar-2008  rmind Welcome to 4.99.55:

- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call. It will
indicate which event (POLL_IN, POLL_OUT, etc) happen. If unknown,
zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.41 05-Dec-2007  pooka branches: 1.41.8; 1.41.12;
Do not "return 1" from kqfilter for errors. That value is passed
directly to the userland caller and results in a mysterious EPERM.
Instead, return EINVAL or something else sensible depending on the
case.
 1.40 19-Nov-2007  ad branches: 1.40.2;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.39 19-Oct-2007  ad branches: 1.39.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.38 29-Jul-2007  ad branches: 1.38.4; 1.38.6; 1.38.10; 1.38.12;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.37 04-Mar-2007  christos branches: 1.37.2; 1.37.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.36 28-Mar-2006  thorpej branches: 1.36.14;
Use device_unit().
 1.35 25-Mar-2006  thorpej 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 26-Feb-2005  simonb branches: 1.33.4;
White space nits.
 1.32 04-Feb-2005  perry de-__P
 1.31 07-Aug-2003  agc branches: 1.31.8; 1.31.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.30 26-Nov-2002  christos branches: 1.30.6;
si_ -> sel_
 1.29 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.28 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.27 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.26 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.25 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.24 17-Mar-2002  atatat branches: 1.24.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.23 13-Nov-2001  lukem add RCSIDs
 1.22 02-May-2001  scw branches: 1.22.2; 1.22.4;
Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.21 02-Nov-2000  eeh branches: 1.21.2;
Adapt to the new line discipline scheme.
 1.20 28-Jun-2000  mrg remove include of <vm/vm.h>
 1.19 27-May-2000  thorpej sleep() -> tsleep()
 1.18 30-Mar-2000  augustss Remove register declarations.
 1.17 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.16 18-Jan-2000  thorpej iodone() -> biodone()
 1.15 20-Jun-1999  ragge branches: 1.15.2; 1.15.4;
QDSS should now work as console.
XXX - still vax-specific.
 1.14 20-Jun-1999  ragge Copied from ../../arch/vax/uba/qd.c,v
 1.13 17-Apr-1999  ragge Only allocate QDSS memory if there is a QDSS as console.
QDSS should also work on KA650 now. (untested)
 1.12 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.11 01-Jan-1999  ragge Giant change: NBPG now set to 4k and CLSIZE == 1 for vax. This change
made a whole bunch of annoying bugs disappear; mostly depending on
bad use of NBPG in non-MD code. The VAX port was the only port that
used this historical "feature".

The CL* macros should probably go away totally, there is no reason
at all to keep them.
 1.10 29-Nov-1998  ragge the btoc/ctob/btop macros must use CLBYTES, not NBPG. How this should
work in the long run is an open issue; some parts must be reworked
in a MI way.
 1.9 05-Nov-1998  ragge EGCS fixes.
 1.8 04-Jul-1998  jonathan defopt DDB.
 1.7 20-Jun-1998  ragge Don't try to configure QDSS console on KA650 until it's fixed.
 1.6 13-Apr-1998  ragge Wall cleaning.
 1.5 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.4 13-Oct-1996  christos backout previous kprintf change
 1.3 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.2 02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.1 18-Aug-1996  jonathan Import framebuffer drivers from 4.4-Lite2 as the root for NetBSD drivers.
Only change from Lite (or lite2, qv.c and qd.c do not change) is adding
NetBSD RCS ids.
 1.15.4.2 22-Nov-2000  bouyer Sync with HEAD.
 1.15.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.15.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.15.2.1 20-Jun-1999  thorpej file qd.c was added on branch chs-ubc2 on 1999-07-01 23:35:33 +0000
 1.21.2.7 11-Dec-2002  thorpej Sync with HEAD.
 1.21.2.6 11-Nov-2002  nathanw Catch up to -current
 1.21.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.21.2.4 17-Sep-2002  nathanw Catch up to -current.
 1.21.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.21.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.21.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.22.4.2 13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.22.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.22.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.22.2.5 02-Oct-2002  jdolecek use (intptr_t) rathern than (u_long) to cast kn_hook pointer to dev_t
use (void *)(intptr_t) to cast dev_t to kn_hook pointer
 1.22.2.4 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.22.2.3 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.22.2.2 12-Sep-2001  thorpej More coffee for me, please. selwakeup -> selnotify
 1.22.2.1 12-Sep-2001  thorpej Add kqueue support (not compiled yet).
 1.24.4.1 16-May-2002  gehenna Add the character device switch.
Replace the direct-access to devsw table with calling devsw API.
Fix type of arguments.
 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 03-Aug-2004  skrll Sync with HEAD
 1.31.10.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.31.10.1 12-Feb-2005  yamt sync with head.
 1.31.8.1 29-Apr-2005  kent sync with -current
 1.33.4.5 17-Mar-2008  yamt sync with head.
 1.33.4.4 07-Dec-2007  yamt sync with head
 1.33.4.3 27-Oct-2007  yamt sync with head.
 1.33.4.2 03-Sep-2007  yamt sync with head.
 1.33.4.1 21-Jun-2006  yamt sync with head.
 1.34.12.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 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.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.36.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.37.10.1 15-Aug-2007  skrll Sync with HEAD.
 1.37.2.2 23-Oct-2007  ad Sync with head.
 1.37.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.38.12.2 29-Jul-2007  ad It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.38.12.1 29-Jul-2007  ad file qd.c was added on branch matt-mips64 on 2007-07-29 12:15:45 +0000
 1.38.10.2 21-Nov-2007  bouyer Sync with HEAD
 1.38.10.1 25-Oct-2007  bouyer Sync with HEAD.
 1.38.6.3 23-Mar-2008  matt sync with HEAD
 1.38.6.2 09-Jan-2008  matt sync with HEAD
 1.38.6.1 06-Nov-2007  matt sync with HEAD
 1.38.4.3 09-Dec-2007  jmcneill Sync with HEAD.
 1.38.4.2 21-Nov-2007  joerg Sync with HEAD.
 1.38.4.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.2.1 08-Dec-2007  mjf Sync with HEAD.
 1.40.2.1 08-Dec-2007  ad Sync with head.
 1.41.12.2 29-Jun-2008  mjf Sync with HEAD.
 1.41.12.1 03-Apr-2008  mjf Sync with HEAD.
 1.41.8.1 24-Mar-2008  keiichi sync with head.
 1.43.8.1 18-Jun-2008  simonb Sync with head.
 1.43.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.43.4.2 20-Jun-2009  yamt sync with head
 1.43.4.1 04-May-2009  yamt sync with head.
 1.43.2.1 17-Jun-2008  yamt sync with head.
 1.44.10.2 23-Jul-2009  jym Sync with HEAD.
 1.44.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.44.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.50.4.2 31-May-2011  rmind sync with head
 1.50.4.1 05-Mar-2011  rmind sync with head
 1.51.2.1 06-Jun-2011  jruoho Sync with HEAD.
 1.52.14.3 03-Dec-2017  jdolecek update from HEAD
 1.52.14.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.52.14.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.52.4.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.52.4.1 30-Oct-2012  yamt sync with head
 1.53.2.1 18-May-2014  rmind sync with head
 1.54.2.1 10-Aug-2014  tls Rebase.
 1.57.18.1 03-Jan-2021  thorpej Sync w/ HEAD.
 1.7 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 11-Dec-2005  christos branches: 1.6.26;
merge ktrace-lwp.
 1.5 26-Feb-2005  simonb branches: 1.5.4;
White space nits.
 1.4 07-Aug-2003  agc branches: 1.4.8; 1.4.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 20-Jun-1999  ragge branches: 1.3.2; 1.3.38;
QDSS should now work as console.
XXX - still vax-specific.
 1.2 20-Jun-1999  ragge Copied from ../../arch/vax/include/qdioctl.h,v
 1.1 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.3.38.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.38.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.38.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.38.1 03-Aug-2004  skrll Sync with HEAD
 1.3.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.3.2.1 20-Jun-1999  thorpej file qdioctl.h was added on branch chs-ubc2 on 1999-07-01 23:35:34 +0000
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.5.4.1 03-Sep-2007  yamt sync with head.
 1.6.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.9 17-Aug-2021  andvar fix multiplei repetitive typos in comments, messages and documentation. mainly because copy paste code big amount of files are affected.
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 26-Feb-2005  simonb White space nits.
 1.6 07-Aug-2003  agc branches: 1.6.8; 1.6.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 06-Jan-2003  wiz branches: 1.5.2;
interrupt with two rs.
 1.4 29-Sep-2002  wiz "definitions" has lots of 'i's, but that's not reason to leave one out.
 1.3 20-Jun-1999  ragge branches: 1.3.2; 1.3.16; 1.3.18;
QDSS should now work as console.
XXX - still vax-specific.
 1.2 20-Jun-1999  ragge Copied from ../../arch/vax/include/qdreg.h,v
 1.1 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.3.18.1 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.16.2 07-Jan-2003  thorpej Sync with HEAD.
 1.3.16.1 18-Oct-2002  nathanw Catch up to -current.
 1.3.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.3.2.1 20-Jun-1999  thorpej file qdreg.h was added on branch chs-ubc2 on 1999-07-01 23:35:35 +0000
 1.5.2.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.2.1 03-Aug-2004  skrll Sync with HEAD
 1.6.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.8.1 29-Apr-2005  kent sync with -current
 1.8 02-Jun-2024  andvar Fix various typos, mainly triple letters.
 1.7 11-Dec-2005  christos merge ktrace-lwp.
 1.6 26-Feb-2005  simonb White space nits.
 1.5 07-Aug-2003  agc branches: 1.5.8; 1.5.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.4 11-Jun-2001  wiz branches: 1.4.22;
Fix various misspellings of compatible/compatibility.
 1.3 20-Jun-1999  ragge branches: 1.3.2; 1.3.16;
QDSS should now work as console.
XXX - still vax-specific.
 1.2 20-Jun-1999  ragge Copied from ../../arch/vax/include/qduser.h,v
 1.1 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.3.16.1 21-Jun-2001  nathanw Catch up to -current.
 1.3.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.3.2.1 20-Jun-1999  thorpej file qduser.h was added on branch chs-ubc2 on 1999-07-01 23:35:35 +0000
 1.4.22.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.4.22.1 03-Aug-2004  skrll Sync with HEAD
 1.5.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.5.8.1 29-Apr-2005  kent sync with -current
 1.6 11-Dec-2005  christos merge ktrace-lwp.
 1.5 26-Feb-2005  simonb White space nits.
 1.4 07-Aug-2003  agc branches: 1.4.8; 1.4.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.3 20-Jun-1999  ragge branches: 1.3.2; 1.3.38;
QDSS should now work as console.
XXX - still vax-specific.
 1.2 20-Jun-1999  ragge Copied from ../../arch/vax/include/qevent.h,v
 1.1 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.3.38.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.38.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.3.38.2 18-Sep-2004  skrll Sync with HEAD.
 1.3.38.1 03-Aug-2004  skrll Sync with HEAD
 1.3.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.3.2.1 20-Jun-1999  thorpej file qevent.h was added on branch chs-ubc2 on 1999-07-01 23:35:35 +0000
 1.4.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.4.8.1 29-Apr-2005  kent sync with -current
 1.8 11-Dec-2005  christos merge ktrace-lwp.
 1.7 26-Feb-2005  simonb White space nits.
 1.6 07-Aug-2003  agc branches: 1.6.8; 1.6.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5 13-Nov-2001  lukem branches: 1.5.16;
add RCSIDs
 1.4 20-Jun-1999  ragge branches: 1.4.2; 1.4.16; 1.4.18;
QDSS should now work as console.
XXX - still vax-specific.
 1.3 20-Jun-1999  ragge Copied from ../../arch/vax/uba/qfont.c,v
 1.2 13-Apr-1998  ragge Wall cleaning.
 1.1 21-Mar-1998  ragge Add support for QDSS graphic console. Code originated from 4.4BSD,
ported to NetBSD by Boris Gjenero <bgjenero@undergrad.math.uwaterloo.ca>
 1.4.18.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.4.16.1 14-Nov-2001  nathanw Catch up to -current.
 1.4.2.2 01-Jul-1999  thorpej Sync w/ -current.
 1.4.2.1 20-Jun-1999  thorpej file qfont.c was added on branch chs-ubc2 on 1999-07-01 23:35:36 +0000
 1.5.16.4 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.5.16.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.5.16.2 18-Sep-2004  skrll Sync with HEAD.
 1.5.16.1 03-Aug-2004  skrll Sync with HEAD
 1.6.10.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.6.8.1 29-Apr-2005  kent sync with -current
 1.37 12-Aug-2021  andvar fix various typos in comments.
 1.36 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.35 24-Apr-2021  thorpej branches: 1.35.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.34 29-Oct-2019  christos branches: 1.34.10;
Implement what the documentation in rfreg.h states, and do not apply the
wrong mask to the command register (which kind of works, but really?!?!)
Found by gcc -Wtautological-compare
 1.33 08-Dec-2015  christos branches: 1.33.18;
Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
 1.32 26-Apr-2015  mlelstv Use C99-style initializers for struct dkdriver.
 1.31 02-Jan-2015  christos We have three sets of DTYPE_ constants in the kernel:
altq Drop Type
disklabel Disk Type
file Descriptor Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
 1.30 31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.29 04-Aug-2014  ryoon branches: 1.29.4;
Fix typo in comment.
 1.28 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.27 25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.26 16-Mar-2014  dholland branches: 1.26.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.25 27-Oct-2012  chs branches: 1.25.2;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.24 22-Jan-2009  cegger branches: 1.24.14; 1.24.24;
buildfix: re-adapt to major()/minor() return a 32bit value again.
 1.23 13-Jan-2009  yamt g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.22 12-Jan-2009  cegger use PRIu64 format to printf DISKPART
 1.21 25-Jul-2008  dsl branches: 1.21.2;
Replace a 'do { ... } while (0);' with 'for (;;) { ... break; }'
so that the 'continue' has the (probably) desired effect.
 1.20 15-Mar-2008  jkunz branches: 1.20.4; 1.20.6; 1.20.8; 1.20.10;
Use device_* accessors.
 1.19 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.18 04-Jan-2008  joerg branches: 1.18.2; 1.18.6;
Catch up with rename of buf's b_un.b_addr -> b_data.
 1.17 19-Oct-2007  ad branches: 1.17.2; 1.17.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.16 08-Oct-2007  ad branches: 1.16.2;
Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.15 29-Jul-2007  ad branches: 1.15.4; 1.15.6; 1.15.8; 1.15.10;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.14 08-Mar-2007  he branches: 1.14.2; 1.14.6; 1.14.10;
Cast to char* before doing pointer arithmetic.
 1.13 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.12 29-Mar-2006  thorpej branches: 1.12.14;
Use device_private().
 1.11 25-Mar-2006  thorpej Use device_parent().
 1.10 11-Dec-2005  christos branches: 1.10.4; 1.10.6; 1.10.8; 1.10.10; 1.10.12;
merge ktrace-lwp.
 1.9 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.8 26-Feb-2005  simonb branches: 1.8.4;
White space nits.
 1.7 28-Oct-2004  yamt branches: 1.7.4; 1.7.6;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.6 06-Oct-2004  wiz Fix some typos in comments and panic()s.
 1.5 24-Feb-2004  wiz occured -> occurred. From Peter Postma.
 1.4 13-Aug-2003  ragge Improved driver with much better error handling, from Jochen Kunz
(the original author of the driver).
 1.3 14-Jul-2003  lukem add missing __KERNEL_RCSID()
 1.2 03-May-2003  wiz branches: 1.2.2;
DMA, not dma nor Dma.
 1.1 23-Mar-2003  ragge Driver for RX01/02 floppies, written by Jochen Kunz.
 1.2.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.2.6 02-Nov-2004  skrll Sync with HEAD.
 1.2.2.5 19-Oct-2004  skrll Sync with HEAD
 1.2.2.4 21-Sep-2004  skrll Fix the sync with head I botched.
 1.2.2.3 18-Sep-2004  skrll Sync with HEAD.
 1.2.2.2 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.2.2.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.5 17-Mar-2008  yamt sync with head.
 1.8.4.4 21-Jan-2008  yamt sync with head
 1.8.4.3 27-Oct-2007  yamt sync with head.
 1.8.4.2 03-Sep-2007  yamt sync with head.
 1.8.4.1 21-Jun-2006  yamt sync with head.
 1.10.12.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.10.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.10.10.1 19-Apr-2006  elad sync with head.
 1.10.8.1 01-Apr-2006  yamt sync with head.
 1.10.6.1 22-Apr-2006  simonb Sync with head.
 1.10.4.1 09-Sep-2006  rpaulo sync with head
 1.12.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.10.1 15-Aug-2007  skrll Sync with HEAD.
 1.14.6.1 19-Mar-2007  reinoud Remove direct references to buf->b_un.b_addr instead of using buf->b_data.
This allows UVM- or other structures to be used eventually.
 1.14.2.3 23-Oct-2007  ad Sync with head.
 1.14.2.2 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.14.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.15.10.2 29-Jul-2007  ad It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.15.10.1 29-Jul-2007  ad file rf.c was added on branch matt-mips64 on 2007-07-29 12:15:45 +0000
 1.15.8.1 14-Oct-2007  yamt sync with head.
 1.15.6.3 23-Mar-2008  matt sync with HEAD
 1.15.6.2 09-Jan-2008  matt sync with HEAD
 1.15.6.1 06-Nov-2007  matt sync with HEAD
 1.15.4.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.16.2.1 25-Oct-2007  bouyer Sync with HEAD.
 1.17.8.1 08-Jan-2008  bouyer Sync with HEAD
 1.17.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.18.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.18.6.2 28-Sep-2008  mjf Sync with HEAD.
 1.18.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.18.2.1 24-Mar-2008  keiichi sync with head.
 1.20.10.1 19-Oct-2008  haad Sync with HEAD.
 1.20.8.1 28-Jul-2008  simonb Sync with head.
 1.20.6.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.20.4.1 04-May-2009  yamt sync with head.
 1.21.2.2 03-Mar-2009  skrll Sync with HEAD.
 1.21.2.1 19-Jan-2009  skrll Sync with HEAD.
 1.24.24.3 03-Dec-2017  jdolecek update from HEAD
 1.24.24.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.24.24.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.24.14.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.24.14.1 30-Oct-2012  yamt sync with head
 1.25.2.1 18-May-2014  rmind sync with head
 1.26.2.1 10-Aug-2014  tls Rebase.
 1.29.4.3 27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.29.4.2 06-Jun-2015  skrll Sync with HEAD
 1.29.4.1 06-Apr-2015  skrll Sync with HEAD
 1.33.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.34.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.35.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 29-Oct-2019  christos Implement what the documentation in rfreg.h states, and do not apply the
wrong mask to the command register (which kind of works, but really?!?!)
Found by gcc -Wtautological-compare
 1.4 11-Dec-2005  christos branches: 1.4.164;
merge ktrace-lwp.
 1.3 26-Feb-2005  simonb White space nits.
 1.2 06-Oct-2004  wiz branches: 1.2.4; 1.2.6;
Fix some typos in comments and panic()s.
 1.1 23-Mar-2003  ragge branches: 1.1.2;
Driver for RX01/02 floppies, written by Jochen Kunz.
 1.1.2.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.1.2.1 19-Oct-2004  skrll Sync with HEAD
 1.2.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.4.1 29-Apr-2005  kent sync with -current
 1.4.164.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.53 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.52 24-Apr-2021  thorpej branches: 1.52.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.51 22-May-2017  ragge branches: 1.51.26;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.50 26-Apr-2015  mlelstv Use C99-style initializers for struct dkdriver.
 1.49 02-Jan-2015  christos We have three sets of DTYPE_ constants in the kernel:
altq Drop Type
disklabel Disk Type
file Descriptor Type
(not to mention constants that contain the string DTYPE).
Let's make them two, by changing the disklabel one to be DisK TYPE since the
other disklabel constants seem to do that. Not many userland programs use
these constants (and the ones that they do are mostly in ifdefs). They will
be fixed shortly.
 1.48 31-Dec-2014  christos make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will
go do dk_ioctl once all the drivers have been converted.
 1.47 31-Dec-2014  christos Centralize wedge ioctls in disk_ioctl.
 1.46 09-Nov-2014  mlelstv branches: 1.46.2;
support DIOCMWEDGES ioctl
 1.45 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.44 25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.43 16-Mar-2014  dholland branches: 1.43.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.42 18-Apr-2009  tsutsui branches: 1.42.12; 1.42.22; 1.42.26;
Remove extra whitespace added by a stupid tool.
XXX: more in src/sys/arch
 1.41 18-Mar-2009  cegger bcopy -> memcpy
 1.40 13-Jan-2009  yamt branches: 1.40.2;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.39 11-Jun-2008  drochner branches: 1.39.4;
fix some missing pieces of device/softc split
 1.38 11-Mar-2008  matt branches: 1.38.2; 1.38.4; 1.38.6; 1.38.8;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.37 19-Oct-2007  ad branches: 1.37.12; 1.37.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.36 08-Oct-2007  ad branches: 1.36.2;
Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
 1.35 29-Jul-2007  ad branches: 1.35.4; 1.35.6; 1.35.8; 1.35.10;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.34 21-Jul-2007  ad Replace some uses of lockmgr().
 1.33 10-Mar-2007  christos branches: 1.33.2; 1.33.10;
whitespace
 1.32 09-Mar-2007  he Cast to char* before doing pointer arithmetic.
 1.31 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.30 29-Mar-2006  thorpej branches: 1.30.14;
Use device_private().
 1.29 28-Mar-2006  thorpej Use device_unit().
 1.28 25-Mar-2006  thorpej Use device_parent().
 1.27 11-Dec-2005  christos branches: 1.27.4; 1.27.6; 1.27.8; 1.27.10; 1.27.12;
merge ktrace-lwp.
 1.26 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.25 27-Jun-2005  ragge branches: 1.25.2;
Fixes due to cast-qual addition.
 1.24 26-Feb-2005  simonb White space nits.
 1.23 28-Oct-2004  yamt branches: 1.23.4; 1.23.6;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.22 25-Sep-2004  thorpej Add support for wedges to the RL01/RL02 disk driver.
XXX Can't do autodiscovery here, since we can't do I/O in rlattach().
 1.21 10-May-2003  thorpej branches: 1.21.2;
Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself. This paves the way for some future changes.
 1.20 02-May-2003  dsl Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
 1.19 02-Apr-2003  he Change SBSIZE -> SBLOCKSIZE, to track changes caused by the UFS2 merge.
 1.18 01-Jan-2003  thorpej Use aprint_normal() in cfprint routines.
 1.17 23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.16 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.15 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.14 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.13 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.12 22-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Anders Magnusson <ragge@netbsd.org>
 1.11 23-Mar-2002  ragge branches: 1.11.2;
Call rlreset() per controller, not per disk.
Be more informative about the state of the disk (locked, unloaded etc...)
Send NULL as proc pointer to bus_dma_load if B_PHYS is not set.
Break out softc's from rl.c to rlvar.h for inclusion elsewhere.
 1.10 13-Nov-2001  lukem add RCSIDs
 1.9 19-Jun-2001  wiz branches: 1.9.2; 1.9.4;
`existent', not `existant'
 1.8 12-Apr-2001  thorpej splimp -> splbio.
 1.7 08-Jan-2001  fvdl branches: 1.7.2;
Return error in the case of using ODIOCGDINFO or ODIOCGDEFLABEL when
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
 1.6 07-Jan-2001  fvdl Adapt all disk devices in MI directories to handle ODIOC* calls
for ports that have bumped MAXPARTITIONS (and thus define
__HAVE_OLD_DISKLABEL).
 1.5 05-Jun-2000  matt branches: 1.5.2; 1.5.4;
Adjust to new evcnt stuff.
 1.4 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.3 19-May-2000  thorpej branches: 1.3.2;
A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.2 30-Apr-2000  ragge Change to use new ubareset() functionality.
 1.1 22-Apr-2000  ragge Add the famous "rl" disk.
 1.3.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.5.4.4 21-Apr-2001  bouyer Sync with HEAD
 1.5.4.3 18-Jan-2001  bouyer Sync with head (for UBC+NFS fixes, mostly).
 1.5.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.5.4.1 05-Jun-2000  bouyer file rl.c was added on branch thorpej_scsipi on 2000-11-20 11:42:50 +0000
 1.5.2.1 01-May-2001  he Pull up revisions 1.6-1.7 (requested by fvdl):
Increase the number of BSD disklabel partitions on i386 to 16.
 1.7.2.8 03-Jan-2003  thorpej Sync with HEAD.
 1.7.2.7 11-Nov-2002  nathanw Catch up to -current
 1.7.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.7.2.5 17-Sep-2002  nathanw Catch up to -current.
 1.7.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.7.2.3 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.7.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.7.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.9.4.1 10-Oct-2001  fvdl Convert all remaining devices.
 1.9.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.9.2.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 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.11.2.3 29-Aug-2002  gehenna catch up with -current.
 1.11.2.2 07-Jun-2002  gehenna make this compile
 1.11.2.1 16-May-2002  gehenna Add the block/character device switch.
Replace the hard-coded major with calling devsw API.
 1.21.2.8 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.21.2.7 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.21.2.6 04-Feb-2005  skrll Adapt to branch.
 1.21.2.5 02-Nov-2004  skrll Sync with HEAD.
 1.21.2.4 19-Oct-2004  skrll Sync with HEAD
 1.21.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.21.2.1 12-Aug-2004  skrll Adapt to new world order.

Vax GENERIC compiles.
 1.23.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.23.4.1 29-Apr-2005  kent sync with -current
 1.25.2.4 17-Mar-2008  yamt sync with head.
 1.25.2.3 27-Oct-2007  yamt sync with head.
 1.25.2.2 03-Sep-2007  yamt sync with head.
 1.25.2.1 21-Jun-2006  yamt sync with head.
 1.27.12.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.27.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.27.10.1 19-Apr-2006  elad sync with head.
 1.27.8.1 01-Apr-2006  yamt sync with head.
 1.27.6.1 22-Apr-2006  simonb Sync with head.
 1.27.4.1 09-Sep-2006  rpaulo sync with head
 1.30.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.33.10.1 15-Aug-2007  skrll Sync with HEAD.
 1.33.2.3 23-Oct-2007  ad Sync with head.
 1.33.2.2 20-Aug-2007  ad - Alter disk attach/detach to fix a panic when closing a vnd device.
- Sync with HEAD.
 1.33.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.35.10.2 29-Jul-2007  ad It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.35.10.1 29-Jul-2007  ad file rl.c was added on branch matt-mips64 on 2007-07-29 12:15:45 +0000
 1.35.8.1 14-Oct-2007  yamt sync with head.
 1.35.6.2 23-Mar-2008  matt sync with HEAD
 1.35.6.1 06-Nov-2007  matt sync with HEAD
 1.35.4.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.36.2.1 25-Oct-2007  bouyer Sync with HEAD.
 1.37.16.3 17-Jan-2009  mjf Sync with HEAD.
 1.37.16.2 29-Jun-2008  mjf Sync with HEAD.
 1.37.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.37.12.1 24-Mar-2008  keiichi sync with head.
 1.38.8.1 18-Jun-2008  simonb Sync with head.
 1.38.6.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.38.4.1 04-May-2009  yamt sync with head.
 1.38.2.1 17-Jun-2008  yamt sync with head.
 1.39.4.2 28-Apr-2009  skrll Sync with HEAD.
 1.39.4.1 19-Jan-2009  skrll Sync with HEAD.
 1.40.2.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.42.26.1 18-May-2014  rmind sync with head
 1.42.22.2 03-Dec-2017  jdolecek update from HEAD
 1.42.22.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.42.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.43.2.1 10-Aug-2014  tls Rebase.
 1.46.2.3 28-Aug-2017  skrll Sync with HEAD
 1.46.2.2 06-Jun-2015  skrll Sync with HEAD
 1.46.2.1 06-Apr-2015  skrll Sync with HEAD
 1.51.26.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.52.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.5 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.4 11-Dec-2005  christos branches: 1.4.120; 1.4.140;
merge ktrace-lwp.
 1.3 26-Feb-2005  simonb White space nits.
 1.2 23-Mar-2002  ragge branches: 1.2.10; 1.2.18; 1.2.20;
Call rlreset() per controller, not per disk.
Be more informative about the state of the disk (locked, unloaded etc...)
Send NULL as proc pointer to bus_dma_load if B_PHYS is not set.
Break out softc's from rl.c to rlvar.h for inclusion elsewhere.
 1.1 22-Apr-2000  ragge branches: 1.1.6; 1.1.8; 1.1.10;
Add the famous "rl" disk.
 1.1.10.1 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 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 22-Apr-2000  bouyer file rlreg.h was added on branch thorpej_scsipi on 2000-11-20 11:42:50 +0000
 1.2.20.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.18.1 29-Apr-2005  kent sync with -current
 1.2.10.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.4.140.1 28-Aug-2017  skrll Sync with HEAD
 1.4.120.1 03-Dec-2017  jdolecek update from HEAD
 1.11 16-Apr-2020  rin Revert previous for now:
http://mail-index.netbsd.org/source-changes/2020/04/16/msg116278.html

The reasoning turned out to be wrong; __KERNEL_RCSID() in header files
does *not* overwrite RCSID in main source files. The real problem is that
it inserts its RCSID into *every* object files. However, it can be still
useful even if heavily duplicated.
 1.10 16-Apr-2020  rin Stop using __KERNEL_RCSID() in header files; it confuses ident(1) by
overwriting RCSID in main source files.

XXX
The first argument of __KERNEL_RCSID() is neglected for ELF. If we wish
to have RCSID of header files in kernel binary, we need something like
__FBSDID() macro in FreeBSD.
 1.9 22-May-2017  ragge branches: 1.9.22;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.8 11-Mar-2008  matt branches: 1.8.48; 1.8.68;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.7 04-Mar-2007  christos branches: 1.7.16; 1.7.32; 1.7.36;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.6 11-Dec-2005  christos branches: 1.6.26;
merge ktrace-lwp.
 1.5 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.4 26-Feb-2005  simonb branches: 1.4.4;
White space nits.
 1.3 04-Feb-2005  perry de-__P
 1.2 22-Jul-2002  hannken branches: 1.2.6; 1.2.14; 1.2.16;
Convert to new device buffer queue interface.

Approved by: Anders Magnusson <ragge@netbsd.org>
 1.1 23-Mar-2002  ragge branches: 1.1.2; 1.1.4; 1.1.8;
Call rlreset() per controller, not per disk.
Be more informative about the state of the disk (locked, unloaded etc...)
Send NULL as proc pointer to bus_dma_load if B_PHYS is not set.
Break out softc's from rl.c to rlvar.h for inclusion elsewhere.
 1.1.8.3 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.1.8.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.8.1 23-Mar-2002  jdolecek file rlvar.h was added on branch kqueue on 2002-06-23 17:48:32 +0000
 1.1.4.1 29-Aug-2002  gehenna catch up with -current.
 1.1.2.3 01-Aug-2002  nathanw Catch up to -current.
 1.1.2.2 01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.1.2.1 23-Mar-2002  nathanw file rlvar.h was added on branch nathanw_sa on 2002-04-01 07:47:04 +0000
 1.2.16.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.14.1 29-Apr-2005  kent sync with -current
 1.2.6.3 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.6.2 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.6.1 04-Feb-2005  skrll Sync with HEAD.
 1.4.4.3 17-Mar-2008  yamt sync with head.
 1.4.4.2 03-Sep-2007  yamt sync with head.
 1.4.4.1 21-Jun-2006  yamt sync with head.
 1.6.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.7.36.1 03-Apr-2008  mjf Sync with HEAD.
 1.7.32.1 24-Mar-2008  keiichi sync with head.
 1.7.16.1 23-Mar-2008  matt sync with HEAD
 1.8.68.1 28-Aug-2017  skrll Sync with HEAD
 1.8.48.1 03-Dec-2017  jdolecek update from HEAD
 1.9.22.1 20-Apr-2020  bouyer Sync with HEAD
 1.36 17-Apr-2022  andvar fix various typos in comments.
 1.35 12-Feb-2022  riastradh ts(4): Skip fabricating bogus struct device in tsmatch.

Doesn't appear to be used anywhere in tsmatch. Let's not invent
bogus autoconf guts here.
 1.34 01-Jan-2022  msaitoh s/sytem/system/
 1.33 08-Dec-2019  ad Revert previous. No performance gain worth the potential headaches
with buffers in these contexts.
 1.32 08-Dec-2019  ad Avoid thundering herd: cv_broadcast(&bp->b_busy) -> cv_signal(&bp->b_busy)
 1.31 25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.30 25-Jul-2014  dholland Add d_discard to all struct bdevsw instances I could find.

I've set them all to nodiscard. Some of them (wd, dk, vnd, ld,
raidframe, maybe cgd) should be implemented for real.
 1.29 16-Mar-2014  dholland branches: 1.29.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.28 15-Dec-2010  matt branches: 1.28.8; 1.28.18; 1.28.22;
Need to include <sys/device.h> since vax's <sys/cpu.h> doesn't.
 1.27 13-Jan-2009  yamt branches: 1.27.6;
g/c BUFQ_FOO() macros and use bufq_foo() directly.
 1.26 16-Dec-2008  christos replace bitmask_snprintf(9) with snprintb(3)
 1.25 05-Apr-2008  cegger branches: 1.25.4; 1.25.12;
use aprint_*_dev and device_xname
 1.24 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.23 15-Feb-2008  ad branches: 1.23.2; 1.23.6;
Give bbusy() an interlock argument. If the we need to wait for the buffer,
the interlock is dropped and reacquired when awoken. This allows for
busying buffers attached to a list that is not locked by bufcache_lock.
 1.22 02-Jan-2008  ad Merge vmlocking2 to head.
 1.21 19-Oct-2007  ad branches: 1.21.2; 1.21.4; 1.21.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.20 29-Jul-2007  ad branches: 1.20.4; 1.20.6; 1.20.10; 1.20.12;
It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.19 04-Mar-2007  christos branches: 1.19.2; 1.19.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.18 14-May-2006  elad branches: 1.18.14;
integrate kauth.
 1.17 29-Mar-2006  thorpej Use device_private().
 1.16 25-Mar-2006  thorpej 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 15-Oct-2005  yamt - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
from sys/bufq.h to sys/bufq_impl.h.
(is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c. (not tested)
 1.13 26-Feb-2005  simonb branches: 1.13.4;
White space nits.
 1.12 28-Oct-2004  yamt branches: 1.12.4; 1.12.6;
move buffer queue related stuffs from buf.h to their own header, bufq.h.
 1.11 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.10 23-Oct-2002  jdolecek branches: 1.10.6;
merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.9 02-Oct-2002  thorpej 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 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.5 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.4 22-Jul-2002  hannken Convert to new device buffer queue interface.

Approved by: Anders Magnusson <ragge@netbsd.org>
 1.3 13-Nov-2001  lukem branches: 1.3.8;
add RCSIDs
 1.2 13-May-2001  ragge branches: 1.2.2; 1.2.4; 1.2.6;
Update the TS11 driver to useable state.
Thanks to Michael Kukat for providing a machine to test this driver.
 1.1 13-May-2001  ragge Moved from sys/arch/vax/uba/.
 1.2.6.1 10-Oct-2001  fvdl Convert all remaining devices.
 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 06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.2.4.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.7 11-Nov-2002  nathanw Catch up to -current
 1.2.2.6 18-Oct-2002  nathanw Catch up to -current.
 1.2.2.5 17-Sep-2002  nathanw Catch up to -current.
 1.2.2.4 01-Aug-2002  nathanw Catch up to -current.
 1.2.2.3 14-Nov-2001  nathanw Catch up to -current.
 1.2.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.1 13-May-2001  nathanw file ts.c was added on branch nathanw_sa on 2001-06-21 20:05:30 +0000
 1.3.8.2 29-Aug-2002  gehenna catch up with -current.
 1.3.8.1 16-May-2002  gehenna Add the character device switch.
 1.10.6.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.10.6.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.10.6.4 02-Nov-2004  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 03-Aug-2004  skrll Sync with HEAD
 1.12.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.12.4.1 29-Apr-2005  kent sync with -current
 1.13.4.6 17-Mar-2008  yamt sync with head.
 1.13.4.5 27-Feb-2008  yamt sync with head.
 1.13.4.4 21-Jan-2008  yamt sync with head
 1.13.4.3 27-Oct-2007  yamt sync with head.
 1.13.4.2 03-Sep-2007  yamt sync with head.
 1.13.4.1 21-Jun-2006  yamt sync with head.
 1.15.12.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 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.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.18.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.19.10.1 15-Aug-2007  skrll Sync with HEAD.
 1.19.2.2 23-Oct-2007  ad Sync with head.
 1.19.2.1 19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.20.12.2 29-Jul-2007  ad It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.20.12.1 29-Jul-2007  ad file ts.c was added on branch matt-mips64 on 2007-07-29 12:15:45 +0000
 1.20.10.1 25-Oct-2007  bouyer Sync with HEAD.
 1.20.6.3 23-Mar-2008  matt sync with HEAD
 1.20.6.2 09-Jan-2008  matt sync with HEAD
 1.20.6.1 06-Nov-2007  matt sync with HEAD
 1.20.4.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 02-Jan-2008  bouyer Sync with HEAD
 1.21.4.1 02-Jan-2008  ad Buffer cache locking changes.
 1.21.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.23.6.3 17-Jan-2009  mjf Sync with HEAD.
 1.23.6.2 02-Jun-2008  mjf Sync with HEAD.
 1.23.6.1 03-Apr-2008  mjf Sync with HEAD.
 1.23.2.1 24-Mar-2008  keiichi sync with head.
 1.25.12.1 19-Jan-2009  skrll Sync with HEAD.
 1.25.4.1 04-May-2009  yamt sync with head.
 1.27.6.1 05-Mar-2011  rmind sync with head
 1.28.22.1 18-May-2014  rmind sync with head
 1.28.18.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.28.8.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.29.2.1 10-Aug-2014  tls Rebase.
 1.6 05-Feb-2024  andvar s/bufffer/buffer/ in comments and log message.
 1.5 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.4 11-Dec-2005  christos branches: 1.4.120; 1.4.140;
merge ktrace-lwp.
 1.3 26-Feb-2005  simonb White space nits.
 1.2 13-May-2001  ragge branches: 1.2.2; 1.2.24; 1.2.32; 1.2.34;
Update the TS11 driver to useable state.
Thanks to Michael Kukat for providing a machine to test this driver.
 1.1 13-May-2001  ragge Moved from sys/arch/vax/uba/.
 1.2.34.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.2.32.1 29-Apr-2005  kent sync with -current
 1.2.24.1 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.2.2.2 21-Jun-2001  nathanw Catch up to -current.
 1.2.2.1 13-May-2001  nathanw file tsreg.h was added on branch nathanw_sa on 2001-06-21 20:05:31 +0000
 1.4.140.1 28-Aug-2017  skrll Sync with HEAD
 1.4.120.1 03-Dec-2017  jdolecek update from HEAD
 1.83 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.82 24-Apr-2021  thorpej branches: 1.82.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.81 10-Nov-2019  chs branches: 1.81.10;
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.80 22-May-2017  ragge branches: 1.80.10;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.79 13-Nov-2010  uebayasi branches: 1.79.18; 1.79.36;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.78 23-Nov-2009  rmind branches: 1.78.4;
Remove some unecessary includes sys/user.h header.
 1.77 11-Mar-2008  matt branches: 1.77.4;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.76 19-Oct-2007  ad branches: 1.76.12; 1.76.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.75 04-Mar-2007  christos branches: 1.75.2; 1.75.14; 1.75.16; 1.75.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.74 25-Mar-2006  thorpej branches: 1.74.14;
Use device_parent().
 1.73 11-Dec-2005  christos branches: 1.73.4; 1.73.6; 1.73.8; 1.73.10; 1.73.12;
merge ktrace-lwp.
 1.72 26-Aug-2005  drochner s/locdesc_t/int/g
 1.71 26-Feb-2005  simonb branches: 1.71.4;
White space nits.
 1.70 14-Dec-2004  chs branches: 1.70.2; 1.70.4;
use the generated macros in locators.h rather than hard-coded numbers
to index the cf_loc[] array. reviewed by allen briggs.
 1.69 08-Sep-2004  drochner use interface attribute / locator passing versions
of config_search()
 1.68 28-Aug-2003  ragge Keep track of which addresses that are used by devices, so that probing
do not fiddle with registers on already found devices.
 1.67 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.66 18-Jun-2003  drochner branches: 1.66.2;
don't #include <sys/dkstat.h> where it is (appearently) unused
 1.65 01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.64 01-Jan-2003  thorpej Use aprint_normal() in cfprint routines.
 1.63 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.62 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.61 25-Sep-2002  thorpej Don't include <sys/map.h>.
 1.60 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.59 15-Nov-2001  lukem branches: 1.59.8;
don't need <sys/types.h> when including <sys/param.h>
 1.58 13-Nov-2001  lukem add RCSIDs
 1.57 26-Apr-2001  ragge branches: 1.57.2;
Add functions to allocate mapped-in qbus memory.
 1.56 12-Apr-2001  thorpej splimp -> spluba.
 1.55 28-Jun-2000  mrg branches: 1.55.2;
remove include of <vm/vm.h>
 1.54 26-Jun-2000  mrg remove/move more mach vm header files:

<vm/pglist.h> -> <uvm/uvm_pglist.h>
<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
<vm/vm_object.h> -> nothing
<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
 1.53 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.52 04-Jun-2000  matt Start couting interrupts.
 1.51 30-Apr-2000  ragge branches: 1.51.2;
Add function uba_reset_establish() to register reset functions like
uba_intr_establish(). Basic framework for resource (BDP) allocation,
not yet finished.
 1.50 30-Mar-2000  augustss Remove register declarations.
 1.49 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.48 20-Jun-1999  ragge branches: 1.48.2; 1.48.4;
Fix a erroneous malloc.
 1.47 06-Jun-1999  ragge Fix map register/DMA wait queues.
Still to do:
BDP handling. Currently missing.
Ubareset's won't work at all.
 1.46 27-May-1999  ragge Moved from ../dec/qbus/uba.c,v
 1.45 27-May-1999  ragge Directory called qbus instead of uba, per request from Matt/Jason/...
(More describing name actually)
 1.44 26-May-1999  ragge DZ-11 routines bus'ified. Small fixes to uba routines.
 1.43 24-May-1999  ragge First step towards MI Unibus/Q22 bus code.
 1.42 02-Feb-1999  ragge Another giant change: Allocate register space dynamic instead of compiled-in.
This is done on a physical page size basis, instead of virtual (as the
(on vax yet non-existing) bus_* routines does). This is similar to the
way uba allocation is done.
 1.41 19-Jan-1999  ragge Fix some void pointers.
 1.40 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.39 01-Jan-1999  ragge Giant change: NBPG now set to 4k and CLSIZE == 1 for vax. This change
made a whole bunch of annoying bugs disappear; mostly depending on
bad use of NBPG in non-MD code. The VAX port was the only port that
used this historical "feature".

The CL* macros should probably go away totally, there is no reason
at all to keep them.
 1.38 29-Nov-1998  ragge the btoc/ctob/btop macros must use CLBYTES, not NBPG. How this should
work in the long run is an open issue; some parts must be reworked
in a MI way.
 1.37 05-Nov-1998  ragge EGCS fixes.
 1.36 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.35 06-Oct-1998  matt Change backplace0 to mainbus0 (for consistency with other ports).
Remove unused function protocols from ka410.h and ka43.h
Fix some ka46 missing references
 1.34 21-Mar-1998  ragge ubasetup() must be non-static. (used by QDSS)
 1.33 02-Mar-1998  ragge Support for UVM on VAXen.
 1.32 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.31 18-Jan-1998  ragge Make kernel compile & run again after latest config changes.
 1.30 12-Jan-1998  thorpej Update for changes to config.
 1.29 13-Oct-1996  christos backout previous kprintf change
 1.28 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.27 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.26 20-Aug-1996  ragge Modified to get cleaner match/attach code for different parent buses.
Fix so that resource wait queueing works.
Changed all functions to take a pointer to uba_softc instead of unit
number, except for ubareset(). This must be done later.
 1.25 20-Jul-1996  ragge CPU determine code. ts driver converted to new config. May work, untested.
 1.24 11-Jul-1996  ragge Automatic changing of root device after boot now works.
 1.23 01-Jul-1996  ragge Remove code that took care of old config devices. Don't support
old config anymore, all devices should use new config by now.
Add structures to handle DMA devices using new config.
Fixed bug that caused unwanted ubareset's on 11/780.
 1.22 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.21 18-Mar-1996  ragge Ubareset are now possible, devices that wants it now set it up
during autoconfig. ifubareset (if_reset) no longer used, actually
it's just a normal ubareset and is now handled like that.
 1.20 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.19 09-Mar-1996  ragge Check on which SBI we are frobbing, not always 0.
 1.18 07-Mar-1996  ragge Support for VAX 8600/8650 added. Works with lots of Unibus adapters,
and will probably work with Massbus adapters as well. (Not tested,
but it's the same code as for 11/780). Ubareset's may cause crashes
on 8600 also like 11/780, but they are more uncommon. No support
for console RL02 yet, but it's likely to come.
 1.17 02-Mar-1996  ragge Add support for DW780. Note that ubareset's don't work properly.
This is not a problem on other Unibus adapters, but DW780's do
ubareset's more often. This needs to be fixed by someone someday.
 1.16 11-Feb-1996  ragge Remove csralloc(), not usable anymore.
Add ubasetvec() to steal interrupt vectors for device drivers that
need more than one vector. Add prototype for it.
 1.15 02-Feb-1996  mycroft Fix type errors.
 1.14 02-Feb-1996  mycroft Fix #includes.
 1.13 02-Feb-1996  mycroft Fix #includes.
 1.12 28-Dec-1995  thorpej Move the old-style disk instrumentation "structures" to a central location
(sys/kern/subr_disk.c) and note that they should/will be deperecated.
 1.11 13-Dec-1995  ragge MicroVAX III support added.
Dummy match/attach routines for tmscp.
Conversion of uda.c towards new config.
 1.10 01-Dec-1995  ragge UBA converted to new config. (uba's now can be *'ed). Bug causing
DMA writes to nonexistent memory pages fixed. Code for old config
of non-mass-storage devices removed. (they now must use new config).
 1.9 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.8 16-Jun-1995  ragge d_reset reference removed. Calling of ubareset must be solved.
 1.7 30-Mar-1995  ragge Bug fixes of interrupt handlers.
 1.6 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.5 13-Feb-1995  ragge Fixes for new config.
 1.4 25-Nov-1994  ragge New handling of pte:s for physio.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Fixed bugs according to old memory system.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.48.4.2 21-Apr-2001  bouyer Sync with HEAD
 1.48.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.48.2.3 01-Jul-1999  thorpej Sync w/ -current.
 1.48.2.2 21-Jun-1999  thorpej Sync w/ -current.
 1.48.2.1 20-Jun-1999  thorpej file uba.c was added on branch chs-ubc2 on 1999-06-21 01:18:55 +0000
 1.51.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.55.2.6 03-Jan-2003  thorpej Sync with HEAD.
 1.55.2.5 18-Oct-2002  nathanw Catch up to -current.
 1.55.2.4 20-Jun-2002  nathanw Catch up to -current.
 1.55.2.3 08-Jan-2002  nathanw Catch up to -current.
 1.55.2.2 14-Nov-2001  nathanw Catch up to -current.
 1.55.2.1 21-Jun-2001  nathanw Catch up to -current.
 1.57.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.57.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.57.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.59.8.1 20-Jun-2002  gehenna catch up with -current.
 1.66.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.66.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.66.2.4 18-Dec-2004  skrll Sync with HEAD.
 1.66.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.66.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.66.2.1 03-Aug-2004  skrll Sync with HEAD
 1.70.4.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.70.2.1 29-Apr-2005  kent sync with -current
 1.71.4.4 17-Mar-2008  yamt sync with head.
 1.71.4.3 27-Oct-2007  yamt sync with head.
 1.71.4.2 03-Sep-2007  yamt sync with head.
 1.71.4.1 21-Jun-2006  yamt sync with head.
 1.73.12.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.73.10.1 19-Apr-2006  elad sync with head.
 1.73.8.1 01-Apr-2006  yamt sync with head.
 1.73.6.1 22-Apr-2006  simonb Sync with head.
 1.73.4.1 09-Sep-2006  rpaulo sync with head
 1.74.14.1 12-Mar-2007  rmind Sync with HEAD.
 1.75.20.1 25-Oct-2007  bouyer Sync with HEAD.
 1.75.16.2 23-Mar-2008  matt sync with HEAD
 1.75.16.1 06-Nov-2007  matt sync with HEAD
 1.75.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.75.2.1 23-Oct-2007  ad Sync with head.
 1.76.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.76.12.1 24-Mar-2008  keiichi sync with head.
 1.77.4.1 11-Mar-2010  yamt sync with head
 1.78.4.1 05-Mar-2011  rmind sync with head
 1.79.36.1 28-Aug-2017  skrll Sync with HEAD
 1.79.18.1 03-Dec-2017  jdolecek update from HEAD
 1.80.10.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.81.10.5 05-Apr-2021  thorpej config_match() -> config_probe() for the straight-forward indirect config
cases. There are still a few odd balls using config_match() which should
be sorted out later.
 1.81.10.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.81.10.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.81.10.2 21-Mar-2021  thorpej CFARG_IATTR usage audit:

If a device carries only one interface attribute, there is no need
to specify it when calling config_search(); that specification is
meant only to disambiguate which interface attribute (which is a
proxy for "what kind of attach args are being used") is having
children attached. cfparent_match() will take care of ensuring that
any potential children can attach to one of the parent's iterface
attributes, and if the parent only carries one, no disambiguation is
necessary.
 1.81.10.1 20-Mar-2021  thorpej The proliferation if config_search_*() and config_found_*() combinations
is a little absurd, so begin to tidy this up:

- Introduce a new cfarg_t enumerated type, that defines the types of
tag-value variadic arguments that can be passed to the various
config_*() functions (CFARG_SUBMATCH, CFARG_IATTR, and CFARG_LOCATORS,
for now, plus a CFARG_EOL sentinel).
- Collapse config_search_*() into config_search() that takes these
variadic arguments.
- Convert all call sites of config_search_*() to the new signature.
Noticed several incorrect usages along the way, which will be
audited in a future commit.
 1.82.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.17 22-May-2017  ragge Update copyright notice for Ludd (remove clause 3 & 4).
 1.16 30-Apr-2000  ragge branches: 1.16.176; 1.16.196;
Add function uba_reset_establish() to register reset functions like
uba_intr_establish(). Basic framework for resource (BDP) allocation,
not yet finished.
 1.15 13-Feb-2000  ragge Waked up from the dead
 1.14 12-Jul-1999  ragge branches: 1.14.2;
Unused in MI code.
 1.13 27-May-1999  ragge branches: 1.13.2;
Moved from ../dec/qbus/ubareg.h,v
 1.12 27-May-1999  ragge Directory called qbus instead of uba, per request from Matt/Jason/...
(More describing name actually)
 1.11 24-May-1999  ragge First step towards MI Unibus/Q22 bus code.
 1.10 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.9 20-Aug-1996  ragge Modified to get cleaner match/attach code for different parent buses.
Fix so that resource wait queueing works.
Changed all functions to take a pointer to uba_softc instead of unit
number, except for ubareset(). This must be done later.
 1.8 20-Jul-1996  ragge CPU determine code. ts driver converted to new config. May work, untested.
 1.7 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.6 09-Mar-1996  ragge Check on which SBI we are frobbing, not always 0.
 1.5 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.4 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.3 13-Feb-1995  ragge Fixes for new config.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.13.2.2 02-Aug-1999  thorpej Update from trunk.
 1.13.2.1 21-Jun-1999  thorpej Sync w/ -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.16.196.1 28-Aug-2017  skrll Sync with HEAD
 1.16.176.1 03-Dec-2017  jdolecek update from HEAD
 1.39 11-Mar-2008  matt Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.38 04-Mar-2007  christos branches: 1.38.16; 1.38.32; 1.38.36;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37 11-Dec-2005  christos branches: 1.37.26;
merge ktrace-lwp.
 1.36 26-Feb-2005  simonb branches: 1.36.4;
White space nits.
 1.35 04-Feb-2005  perry de-__P
 1.34 28-Aug-2003  ragge branches: 1.34.8; 1.34.10;
Keep track of which addresses that are used by devices, so that probing
do not fiddle with registers on already found devices.
 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 13-May-2001  ragge branches: 1.32.22;
Add bus type to softc.
 1.31 26-Apr-2001  ragge Add functions to allocate mapped-in qbus memory.
 1.30 05-Jun-2000  matt branches: 1.30.4;
Adjust to new evcnt stuff.
 1.29 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.28 04-Jun-2000  matt Start couting interrupts.
 1.27 30-Apr-2000  ragge branches: 1.27.2;
Add function uba_reset_establish() to register reset functions like
uba_intr_establish(). Basic framework for resource (BDP) allocation,
not yet finished.
 1.26 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.25 06-Jun-1999  ragge branches: 1.25.2; 1.25.4;
Fix map register/DMA wait queues.
Still to do:
BDP handling. Currently missing.
Ubareset's won't work at all.
 1.24 27-May-1999  ragge Moved from ../dec/qbus/ubavar.h,v
 1.23 26-May-1999  ragge DZ-11 routines bus'ified. Small fixes to uba routines.
 1.22 24-May-1999  ragge First step towards MI Unibus/Q22 bus code.
 1.21 19-Jan-1999  ragge Allocate (almost) all interrupt vectors dynamically. Simplifies much
work when adding support for new machines and devices.
 1.20 18-Oct-1998  ragge Support for DWBUA (BI to Unibus adapter) and KLESI-B (TMSCP tape ctlr) added.
 1.19 12-Jan-1998  thorpej Update for changes to config.
 1.18 20-Aug-1996  ragge Modified to get cleaner match/attach code for different parent buses.
Fix so that resource wait queueing works.
Changed all functions to take a pointer to uba_softc instead of unit
number, except for ubareset(). This must be done later.
 1.17 11-Jul-1996  ragge Automatic changing of root device after boot now works.
 1.16 01-Jul-1996  ragge Changed data structures due to removal of old config system.
 1.15 08-Apr-1996  ragge Added prototypes to everything. Made all files compile with -Wall.
 1.14 18-Mar-1996  ragge Ubareset are now possible, devices that wants it now set it up
during autoconfig. ifubareset (if_reset) no longer used, actually
it's just a normal ubareset and is now handled like that.
 1.13 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.12 02-Mar-1996  ragge Add support for DW780. Note that ubareset's don't work properly.
This is not a problem on other Unibus adapters, but DW780's do
ubareset's more often. This needs to be fixed by someone someday.
 1.11 11-Feb-1996  ragge Remove csralloc(), not usable anymore.
Add ubasetvec() to steal interrupt vectors for device drivers that
need more than one vector. Add prototype for it.
 1.10 02-Feb-1996  mycroft Fix #includes.
 1.9 01-Feb-1996  mycroft LOCORE -> _LOCORE
 1.8 01-Dec-1995  ragge UBA converted to new config. (uba's now can be *'ed). Bug causing
DMA writes to nonexistent memory pages fixed. Code for old config
of non-mass-storage devices removed. (they now must use new config).
 1.7 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.6 11-May-1995  jtc KERNEL -> _KERNEL
 1.5 30-Mar-1995  ragge Bug fixes of interrupt handlers.
 1.4 28-Mar-1995  jtc KERNEL -> _KERNEL
 1.3 13-Feb-1995  ragge Fixes for new config.
 1.2 26-Oct-1994  cgd new RCS ID format.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.25.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.25.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.27.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.30.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.32.22.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.32.22.4 04-Feb-2005  skrll Sync with HEAD.
 1.32.22.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.32.22.2 18-Sep-2004  skrll Sync with HEAD.
 1.32.22.1 03-Aug-2004  skrll Sync with HEAD
 1.34.10.2 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.34.10.1 12-Feb-2005  yamt sync with head.
 1.34.8.1 29-Apr-2005  kent sync with -current
 1.36.4.2 17-Mar-2008  yamt sync with head.
 1.36.4.1 03-Sep-2007  yamt sync with head.
 1.37.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.38.36.1 03-Apr-2008  mjf Sync with HEAD.
 1.38.32.1 24-Mar-2008  keiichi sync with head.
 1.38.16.1 23-Mar-2008  matt sync with HEAD
 1.64 22-May-2022  andvar fix various small typos, mainly in comments.
 1.63 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.62 24-Apr-2021  thorpej branches: 1.62.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.61 22-May-2017  ragge branches: 1.61.26;
Update copyright notice for Ludd (remove clause 3 & 4).
 1.60 12-May-2009  cegger branches: 1.60.22; 1.60.40;
KNF
 1.59 18-Mar-2009  cegger bzero -> memset
 1.58 11-Mar-2008  matt branches: 1.58.4; 1.58.12; 1.58.18;
Rototill the vax code. Switch to devicet/PRIV_ALLOC. Cleanup vax autoconf
code. Move to prototype definitions. staticfy, constify, avoid casting.
Use device_* accessors.
 1.57 19-Oct-2007  ad branches: 1.57.12; 1.57.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.56 29-Mar-2006  thorpej branches: 1.56.18; 1.56.32; 1.56.34; 1.56.38;
Use device_private().
 1.55 25-Mar-2006  thorpej Use device_parent().
 1.54 27-Feb-2006  thorpej branches: 1.54.2; 1.54.4; 1.54.6;
Use device_is_a().
 1.53 11-Dec-2005  christos branches: 1.53.2; 1.53.4; 1.53.6;
merge ktrace-lwp.
 1.52 27-Jun-2005  ragge branches: 1.52.2;
Fixes due to cast-qual addition.
 1.51 26-Feb-2005  simonb White space nits.
 1.50 31-Oct-2004  he branches: 1.50.4; 1.50.6;
Include the <sys/bufq.h> header to allow these to compile again.
 1.49 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.48 01-Jan-2003  thorpej branches: 1.48.2;
Use aprint_normal() in cfprint routines.
 1.47 02-Oct-2002  thorpej Add trailing ; to CFATTACH_DECL.
 1.46 30-Sep-2002  thorpej Use CFATTACH_DECL().
 1.45 27-Sep-2002  thorpej Declare all cfattach structures const.
 1.44 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.43 14-Jun-2002  ragge Must check B_PHYS, not b_proc, if it is DMA to userspace, otherwise the
machine will crash. This fixes a panic when a Unibus adapter runs out
of map registers (happens frequently), reported by Johnny Billquist.
 1.42 13-Nov-2001  lukem branches: 1.42.8; 1.42.10;
add RCSIDs
 1.41 10-Jun-2001  ragge branches: 1.41.2;
Only use b_proc if B_PHYS is set.
 1.40 29-Apr-2001  ragge Use ubmemalloc() for data structures. Remove unused vars. KNF.
 1.39 12-Apr-2001  thorpej Protect the call to uba_done() with spluba().
 1.38 10-Jun-2000  ragge branches: 1.38.4;
Must be able to compile without "mtc".
 1.37 05-Jun-2000  matt Adjust to new evcnt stuff.
 1.36 04-Jun-2000  matt More event counter stuff. Plus a little cruft cleanup while doing it.
 1.35 19-May-2000  thorpej branches: 1.35.2;
A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well. This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
 1.34 30-Apr-2000  ragge Change to use new ubareset() functionality.
 1.33 30-Mar-2000  augustss Remove register declarations.
 1.32 24-Jan-2000  matt Revamp the VAX interrupt handling code. Make it compatible with all the
other ports. Clean up some things.
 1.31 21-Jan-2000  thorpej Update for sys/buf.h/disksort_*() changes.
 1.30 06-Jun-1999  ragge branches: 1.30.2; 1.30.4;
Fix map register/DMA wait queues.
Still to do:
BDP handling. Currently missing.
Ubareset's won't work at all.
 1.29 29-May-1999  ragge Copied from ../../arch/vax/uba/uda.c,v
 1.28 24-Jan-1998  ragge Remove __BROKEN_INDIRECT_CONFIG and change all drivers to use
config_search instead.
 1.27 12-Jan-1998  thorpej Update for changes to config.
 1.26 02-Nov-1997  ragge #include files must be in the correct order.
 1.25 04-Jul-1997  ragge Fix bug causing all uda's to be recognized as ctlr 1 from boot.
 1.24 12-Mar-1997  ragge Fast and dirty fix to avoid panics during autoconf of KFQSA DSSI disks.
Controller errors showing up can't be handled anyway.
 1.23 13-Oct-1996  christos backout previous kprintf change
 1.22 11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.21 27-Aug-1996  cgd change cfprint_t type definition to take a const char *, rather than
a char *, because that's what was really intended, and because
if the print function modifies the string, various things could become
unhappy (so the string should _not_ be modified).
 1.20 20-Aug-1996  ragge Use the same device driver for both uda and mtc. Actually, the only
difference is vcid. The unit names must differ, so that it is possible
to distinguish them at autoconf time.
 1.19 20-Jul-1996  ragge CPU determine code. ts driver converted to new config. May work, untested.
 1.18 11-Jul-1996  ragge Automatic changing of root device after boot now works.
 1.17 01-Jul-1996  ragge Change to new config and to support new MSCP system.
 1.16 19-May-1996  ragge Fixed all (proto)type errors. Fixes PR 2377.
 1.15 17-Mar-1996  ragge Convert all devices according to the changes to config.
 1.14 07-Mar-1996  ragge Support for VAX 8600/8650 added. Works with lots of Unibus adapters,
and will probably work with Massbus adapters as well. (Not tested,
but it's the same code as for 11/780). Ubareset's may cause crashes
on 8600 also like 11/780, but they are more uncommon. No support
for console RL02 yet, but it's likely to come.
 1.13 02-Mar-1996  ragge Fix some too long delays. Set some structs volatile that otherwise
caused hangs during autoconfig.
 1.12 11-Feb-1996  ragge register -> volatile in some places, to make it work OK with -O2.
 1.11 02-Feb-1996  mycroft Fix #includes.
 1.10 13-Dec-1995  ragge MicroVAX III support added.
Dummy match/attach routines for tmscp.
Conversion of uda.c towards new config.
 1.9 10-Nov-1995  ragge Dynamic allocate uba_softc and interrupt vectors.
Allow for more that one uba.
 1.8 31-Aug-1995  ragge Patches from Ken Wellsch/Ken Lalonde to support some Dilog MSCP cards
(DQ256 SMD card, SQ706A and SU726A SCSI card).
 1.7 05-Jul-1995  ragge uda/tmscp read/write added.
 1.6 30-Mar-1995  ragge Bug fixes of interrupt handlers.
 1.5 23-Feb-1995  ragge Support for uVAXII, new tmscp driver added.
 1.4 13-Feb-1995  ragge Fixes for new config.
 1.3 26-Oct-1994  cgd new RCS ID format.
 1.2 08-Oct-1994  ragge Fixed bugs according to old memory system.
 1.1 02-Aug-1994  ragge Initial VAX port merging.
 1.30.4.2 21-Apr-2001  bouyer Sync with HEAD
 1.30.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.30.2.1 21-Jun-1999  thorpej Sync w/ -current.
 1.35.2.1 22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.38.4.5 03-Jan-2003  thorpej Sync with HEAD.
 1.38.4.4 18-Oct-2002  nathanw Catch up to -current.
 1.38.4.3 20-Jun-2002  nathanw Catch up to -current.
 1.38.4.2 14-Nov-2001  nathanw Catch up to -current.
 1.38.4.1 21-Jun-2001  nathanw Catch up to -current.
 1.41.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.41.2.2 23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.41.2.1 10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.42.10.1 14-Jun-2002  lukem Pull up revision 1.43 (requested by ragge in ticket #273):
Must check B_PHYS, not b_proc, if it is DMA to userspace, otherwise the
machine will crash. This fixes a panic when a Unibus adapter runs out
of map registers (happens frequently), reported by Johnny Billquist.
 1.42.8.1 20-Jun-2002  gehenna catch up with -current.
 1.48.2.6 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.48.2.5 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.48.2.4 02-Nov-2004  skrll Sync with HEAD.
 1.48.2.3 21-Sep-2004  skrll Fix the sync with head I botched.
 1.48.2.2 18-Sep-2004  skrll Sync with HEAD.
 1.48.2.1 03-Aug-2004  skrll Sync with HEAD
 1.50.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.50.4.1 29-Apr-2005  kent sync with -current
 1.52.2.3 17-Mar-2008  yamt sync with head.
 1.52.2.2 27-Oct-2007  yamt sync with head.
 1.52.2.1 21-Jun-2006  yamt sync with head.
 1.53.6.1 22-Apr-2006  simonb Sync with head.
 1.53.4.1 09-Sep-2006  rpaulo sync with head
 1.53.2.1 01-Mar-2006  yamt sync with head.
 1.54.6.2 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.54.6.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.54.4.1 19-Apr-2006  elad sync with head.
 1.54.2.1 01-Apr-2006  yamt sync with head.
 1.56.38.1 25-Oct-2007  bouyer Sync with HEAD.
 1.56.34.2 23-Mar-2008  matt sync with HEAD
 1.56.34.1 06-Nov-2007  matt sync with HEAD
 1.56.32.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.56.18.1 23-Oct-2007  ad Sync with head.
 1.57.16.1 03-Apr-2008  mjf Sync with HEAD.
 1.57.12.1 24-Mar-2008  keiichi sync with head.
 1.58.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.58.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.58.4.2 16-May-2009  yamt sync with head
 1.58.4.1 04-May-2009  yamt sync with head.
 1.60.40.1 28-Aug-2017  skrll Sync with HEAD
 1.60.22.1 03-Dec-2017  jdolecek update from HEAD
 1.61.26.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.62.8.1 04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed