Home | History | Annotate | only in /src/sys/arch/arm/ep93xx
History log of /src/sys/arch/arm/ep93xx
RevisionDateAuthorComments
 1.6 17-Jun-2020  thorpej <sys/extent.h> not needed here.
 1.5 18-Sep-2012  matt Add bounce buffer support for ARM bus_dma(9). Add macros to help initialize
bus_dma_tag structures.
 1.4 01-Jul-2011  dyoung branches: 1.4.2; 1.4.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.2 11-Dec-2005  christos branches: 1.2.80;
merge ktrace-lwp.
 1.1 22-Dec-2004  joff branches: 1.1.4;
ep93xx ARM system-on-chip support
 1.1.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.1 22-Dec-2004  skrll file ep93xx_busdma.c was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.2.80.1 11-Mar-2010  yamt sync with head
 1.4.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.2.1 30-Oct-2012  yamt sync with head
 1.28 02-May-2023  jmcneill TS7200: Defer event counter registration until after evcnt is initialized

Patch from Lloyd Parkes <lloyd@must-have-coffee.gen.nz> in PR# kern/57386
 1.27 21-Nov-2021  skrll branches: 1.27.4;
Trailing whitespace.
 1.26 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.25 10-Nov-2019  chs branches: 1.25.8;
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.24 08-Apr-2015  ozaki-r branches: 1.24.18;
Include sys/lwp.h instead of arm/cpu.h

sys/lwp.h is preferred because arm/cpu.h has a dependency on sys/lwp.h.

Suggested by skrll@ and matt@
 1.23 07-Apr-2015  ozaki-r Add missing #include <arm/cpu.h>
 1.22 26-Mar-2014  christos branches: 1.22.6;
kill sprintf
 1.21 02-Mar-2014  joerg GC ipending.
 1.20 18-Dec-2013  skrll Remove unused variable
 1.19 18-Aug-2013  matt <arm/locore.h> fallout (fixes some include ordering errors)
 1.18 12-Nov-2012  skrll branches: 1.18.2;
C99 types
 1.17 02-Aug-2012  skrll branches: 1.17.2;
Remove irqframe and replace with identical trapframe.
 1.16 01-Jul-2011  dyoung branches: 1.16.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.15 20-Dec-2010  matt Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits. Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.
 1.14 13-Jun-2010  tsutsui Apply fixes for PR port-arm/43339:
Set proper IPL_SOFTfoo values even in !FAST_SOFTINTS case.
Some assertions in MI code expect they have unique values,
per comments from rmind@.

Also cleanup various "interrupt hierarchy" code since IPL_NONE and
IPL_SOFTfoo should not be set by any hardware interrupt establish functions.

Ok'ed by mrg@, tested on shark and hpcarm.
 1.13 28-Apr-2008  martin branches: 1.13.20; 1.13.22;
Remove clause 3 and 4 from TNF licenses
 1.12 27-Apr-2008  matt Merge kernel changes in matt-armv6 to HEAD.
 1.11 06-Jan-2008  matt branches: 1.11.6; 1.11.8; 1.11.10;
Truly kill current_intr_depth once and for all.
 1.10 06-Jan-2008  matt Cleanup softint lossage.
 1.9 03-Dec-2007  ad branches: 1.9.6;
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.8 24-Nov-2006  wiz branches: 1.8.8; 1.8.24; 1.8.26; 1.8.28; 1.8.30; 1.8.36;
s/heirarchy/hierarchy/, from Zafer.
 1.7 24-Dec-2005  perry branches: 1.7.20; 1.7.22;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.6 12-Nov-2005  hamajima delete dummy entries for vmstat. (unnecessary since May 2005)
 1.5 12-Nov-2005  hamajima add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.4 14-Aug-2005  joff Fix argument mismatch (clockframe * vs. irqframe *) in ep93xx_intr_dispatch() that
has been causing compile failures.
 1.3 05-Jan-2005  joff branches: 1.3.4; 1.3.12;
Avoid duplicate IRQ deliveries by processing at most 1 IRQ for each VIC read
 1.2 29-Dec-2004  joff Fix the potential recursion processing soft interrupts that was eating
all the stack.
 1.1 22-Dec-2004  joff ep93xx processor VIC interrupt controller support
 1.3.12.4 21-Jan-2008  yamt sync with head
 1.3.12.3 07-Dec-2007  yamt sync with head
 1.3.12.2 30-Dec-2006  yamt sync with head.
 1.3.12.1 21-Jun-2006  yamt sync with head.
 1.3.4.4 11-Dec-2005  christos Sync with head.
 1.3.4.3 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.3.4.1 05-Jan-2005  skrll file ep93xx_intr.c was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.7.22.1 10-Dec-2006  yamt sync with head.
 1.7.20.1 12-Jan-2007  ad Sync with head.
 1.8.36.2 18-Feb-2008  mjf Sync with HEAD.
 1.8.36.1 08-Dec-2007  mjf Sync with HEAD.
 1.8.30.3 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.8.30.2 09-Jan-2008  matt sync with HEAD
 1.8.30.1 09-Nov-2007  matt Make all the evbarm kernels build again. Fix lossage from rebase.
 1.8.28.2 20-Jan-2008  chris Sync to HEAD.
 1.8.28.1 01-Jan-2008  chris Sync with HEAD.
 1.8.26.1 09-Dec-2007  jmcneill Sync with HEAD.
 1.8.24.2 28-Feb-2008  rjs Sync with HEAD.
 1.8.24.1 26-Dec-2007  rjs Sync with HEAD.
 1.8.8.1 03-Dec-2007  ad Sync with HEAD.
 1.9.6.1 08-Jan-2008  bouyer Sync with HEAD
 1.11.10.2 11-Aug-2010  yamt sync with head.
 1.11.10.1 16-May-2008  yamt sync with head.
 1.11.8.1 18-May-2008  yamt sync with head.
 1.11.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.13.22.2 05-Mar-2011  rmind sync with head
 1.13.22.1 03-Jul-2010  rmind sync with head
 1.13.20.1 17-Aug-2010  uebayasi Sync with HEAD.
 1.16.2.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.16.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.16.2.1 30-Oct-2012  yamt sync with head
 1.17.2.3 03-Dec-2017  jdolecek update from HEAD
 1.17.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.18.2.2 18-May-2014  rmind sync with head
 1.18.2.1 28-Aug-2013  rmind sync with head
 1.22.6.2 06-Jun-2015  skrll Sync with HEAD
 1.22.6.1 06-Apr-2015  skrll Sync with HEAD
 1.24.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.25.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.27.4.1 02-May-2023  martin Pull up following revision(s) (requested by jmcneill in ticket #155):

sys/arch/arm/ep93xx/ep93xx_intr.c: revision 1.28
sys/arch/arm/ep93xx/ep93xxvar.h: revision 1.7
sys/arch/evbarm/tsarm/tsarm_machdep.c: revision 1.36

TS7200: Defer event counter registration until after evcnt is initialized

Patch from Lloyd Parkes in PR kern/57386
 1.5 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.4 27-Apr-2008  matt Merge kernel changes in matt-armv6 to HEAD.
 1.3 06-Jan-2008  matt branches: 1.3.6; 1.3.8; 1.3.10;
Cleanup softint lossage.
 1.2 11-Dec-2005  christos branches: 1.2.46; 1.2.50; 1.2.52; 1.2.58; 1.2.66;
merge ktrace-lwp.
 1.1 22-Dec-2004  joff branches: 1.1.4; 1.1.12;
ep93xx processor VIC interrupt controller support
 1.1.12.1 21-Jan-2008  yamt sync with head
 1.1.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.1 22-Dec-2004  skrll file ep93xx_intr.h was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.2.66.1 08-Jan-2008  bouyer Sync with HEAD
 1.2.58.1 18-Feb-2008  mjf Sync with HEAD.
 1.2.52.2 28-Jan-2008  matt Given the that there are only 4 IPLs (ignoring soft IPLs), a number of
cleanups can be done:
Remove _SPL_* aliases.
Don't store irqmasks in ci_cpl, just make it an ipl level.
Add fast softint switching support.
 1.2.52.1 09-Jan-2008  matt sync with HEAD
 1.2.50.1 20-Jan-2008  chris Sync to HEAD.
 1.2.46.1 28-Feb-2008  rjs Sync with HEAD.
 1.3.10.2 11-Mar-2010  yamt sync with head
 1.3.10.1 16-May-2008  yamt sync with head.
 1.3.8.1 18-May-2008  yamt sync with head.
 1.3.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.7 21-Nov-2021  skrll Trailing whitespace.
 1.6 16-Mar-2018  ryo use designated initializer to make adaptability and flexibility for changing struct bus_space.
no functional change.
 1.5 01-Jul-2011  dyoung branches: 1.5.52;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.3 24-Nov-2005  yamt branches: 1.3.80;
bus_dmamem_map: honour BUS_DMA_NOWAIT. noted by Manuel Bouyer.
bus_space_map: always do NOWAIT allocation as it used to be before yamt-km.

we have too many copies!
 1.2 01-Apr-2005  yamt branches: 1.2.2; 1.2.8;
merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
save some resources like pv_entry. also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
 1.1 22-Dec-2004  joff branches: 1.1.2; 1.1.4; 1.1.6;
ep93xx processor bus_space impl
 1.1.6.1 28-Jan-2005  yamt convert arch/arm to new apis.
 1.1.4.4 11-Dec-2005  christos Sync with head.
 1.1.4.3 01-Apr-2005  skrll Sync with HEAD.
 1.1.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.1 22-Dec-2004  skrll file ep93xx_space.c was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.1.2.1 29-Apr-2005  kent sync with -current
 1.2.8.1 29-Nov-2005  yamt sync with head.
 1.2.2.1 21-Jun-2006  yamt sync with head.
 1.3.80.1 11-Mar-2010  yamt sync with head
 1.5.52.1 22-Mar-2018  pgoyette Synch with HEAD, resolve conflicts
 1.9 21-Nov-2021  skrll Trailing whitespace.
 1.8 17-Sep-2021  andvar some love to double letters (in comments).
 1.7 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.6 13-Feb-2006  hamajima branches: 1.6.74;
add SYSCON DeviceCfg register.
 1.5 12-Nov-2005  hamajima branches: 1.5.4; 1.5.6; 1.5.8;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.4 14-Aug-2005  joff SSP locations needs to be defined since tspld device uses it to talk to the
TS-7200 temperature sensor. While here, add some more GPIO registers too.
 1.3 31-Jan-2005  joff branches: 1.3.6;
Add Port-B GPIO register equates
 1.2 10-Jan-2005  joff branches: 1.2.2; 1.2.4; 1.2.6;
Add GPIO addresses
 1.1 22-Dec-2004  joff ep93xx ARM system-on-chip support
 1.2.6.1 12-Feb-2005  yamt sync with head.
 1.2.4.5 11-Dec-2005  christos Sync with head.
 1.2.4.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.4.3 04-Feb-2005  skrll Sync with HEAD.
 1.2.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.2.4.1 10-Jan-2005  skrll file ep93xxreg.h was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.2.2.1 29-Apr-2005  kent sync with -current
 1.3.6.1 21-Jun-2006  yamt sync with head.
 1.5.8.1 22-Apr-2006  simonb Sync with head.
 1.5.6.1 09-Sep-2006  rpaulo sync with head
 1.5.4.1 18-Feb-2006  yamt sync with head.
 1.6.74.1 11-Mar-2010  yamt sync with head
 1.7 02-May-2023  jmcneill TS7200: Defer event counter registration until after evcnt is initialized

Patch from Lloyd Parkes <lloyd@must-have-coffee.gen.nz> in PR# kern/57386
 1.6 12-Nov-2012  skrll branches: 1.6.68;
C99 types
 1.5 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.4 01-Jul-2011  dyoung branches: 1.4.2; 1.4.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.2 11-Dec-2005  christos branches: 1.2.80;
merge ktrace-lwp.
 1.1 22-Dec-2004  joff branches: 1.1.4;
ep93xx ARM system-on-chip support
 1.1.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.1 22-Dec-2004  skrll file ep93xxvar.h was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.2.80.1 11-Mar-2010  yamt sync with head
 1.4.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.4.2.1 30-Oct-2012  yamt sync with head
 1.6.68.1 02-May-2023  martin Pull up following revision(s) (requested by jmcneill in ticket #155):

sys/arch/arm/ep93xx/ep93xx_intr.c: revision 1.28
sys/arch/arm/ep93xx/ep93xxvar.h: revision 1.7
sys/arch/evbarm/tsarm/tsarm_machdep.c: revision 1.36

TS7200: Defer event counter registration until after evcnt is initialized

Patch from Lloyd Parkes in PR kern/57386
 1.23 21-Nov-2021  skrll Trailing whitespace.
 1.22 29-May-2020  rin For struct timecounter, use C99 initializers.
Compile tested. No functional changes intended.
 1.21 06-Mar-2014  maxv Fix uninitialized variable. Found by my code scanner.

ok christos@
 1.20 12-Nov-2012  skrll branches: 1.20.2;
C99 types
 1.19 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.18 01-Jul-2011  dyoung branches: 1.18.2; 1.18.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.17 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.16 19-Dec-2008  kenh Switch back original ARM assembler code used to calculate the number of ticks
needed to wait in delay(). New code overflowed for large delay values. Broke,
among other things, the RTC probe for the TS-7200.
 1.15 27-May-2008  hamajima branches: 1.15.6;
- convert inline asm umull to C
- add "-march=armv4 -mtune=arm9" to CPUFLAGS

Relevant mailing list threads:
http://mail-index.netbsd.org/source-changes/2008/05/25/msg195537.html
http://mail-index.netbsd.org/port-arm/2008/05/26/msg000228.html
 1.14 25-May-2008  hamajima fix countdown of "remaining" variable in delay(). Armadillo9 works again.
speed up an initial value calculation of "remaining" variable in delay().
 1.13 10-May-2008  martin Backout previous: the license sweep touched these files in error, so
restore the old license.
 1.12 28-Apr-2008  martin branches: 1.12.2;
Remove clause 3 and 4 from TNF licenses
 1.11 20-Jan-2008  joerg branches: 1.11.6; 1.11.8; 1.11.10;
Convert evbarm to timecounter. Only one of the systems was tested, the
rest of the patch is compile-time tested only.
 1.10 06-Jan-2007  christos branches: 1.10.20; 1.10.24; 1.10.26; 1.10.32; 1.10.38;
Add generic TOD support. From Bucky Katz.
 1.9 10-Sep-2006  gdamore branches: 1.9.4;
First pass at enabling a lot of ARM ports to convert swiftly to
__HAVE_GENERIC_TODR. Just put #define __HAVE_GENERIC_TODR in types.h
if your port uses one of these files.
 1.8 24-Dec-2005  perry branches: 1.8.8; 1.8.20;
bare asm -> __asm
 1.7 12-Nov-2005  hamajima add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.6 04-Jun-2005  he branches: 1.6.2;
Fix -Wcast-qual by sprinkling some consts, and remove named
parameters from a function prototype to avoid shadowing.
Also fix a couple of other shadowing problems.
 1.5 04-Jun-2005  he Fix the various todr_gettime() and todr_settime() fallouts from
-Wcast-qual differently, by instead changing the signatore of those
"functions" to take a "volatile struct timeval*" instead of a
"struct timeval*". Many places, these functions are called with
&time, and time is declared as volatile in <sys/kernel.h>. This
way we can get rid of all the ugly casts which now also triggered
warnings, and caused more code to be added to work around the
problem.

Reviewed by thorpej.
 1.4 26-Feb-2005  simonb Watch out for those unexpected tains.
 1.3 06-Jan-2005  joff branches: 1.3.2; 1.3.4; 1.3.6;
Add missing newline after preposterous time warning printf
 1.2 27-Dec-2004  joff do things the todr(9) way
 1.1 22-Dec-2004  joff ep93xx processor system tick timer and microtime()/delay() impl
 1.3.6.1 19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.3.4.5 11-Dec-2005  christos Sync with head.
 1.3.4.4 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.3.4.3 04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.3.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.3.4.1 06-Jan-2005  skrll file epclk.c was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.3.2.1 29-Apr-2005  kent sync with -current
 1.6.2.4 21-Jan-2008  yamt sync with head
 1.6.2.3 26-Feb-2007  yamt sync with head.
 1.6.2.2 30-Dec-2006  yamt sync with head.
 1.6.2.1 21-Jun-2006  yamt sync with head.
 1.8.20.2 12-Jan-2007  ad Sync with head.
 1.8.20.1 18-Nov-2006  ad Sync with head.
 1.8.8.1 14-Sep-2006  yamt sync with head.
 1.9.4.1 30-Apr-2007  bouyer Pull up following revision(s) (requested by rearnsha in ticket #592):
sys/arch/arm/footbridge/footbridgevar.h: revision 1.5
sys/arch/arm/ep93xx/epclk.c: revision 1.10
sys/arch/arm/ixp12x0/ixp12x0_clk.c: revision 1.11
sys/arch/arm/footbridge/footbridge.c: revision 1.17
sys/arch/arm/footbridge/isa/dsrtc.c: revision 1.10
sys/arch/arm/s3c2xx0/s3c2800_clk.c: revision 1.10
sys/arch/arm/xscale/ixp425_timer.c: revision 1.13
sys/arch/arm/xscale/becc_timer.c: revision 1.11
sys/arch/arm/xscale/i80321_timer.c: revision 1.16
sys/arch/arm/s3c2xx0/s3c24x0_clk.c: revision 1.7
Add generic TOD support. From Bucky Katz.
 1.10.38.1 20-Jan-2008  bouyer Sync with HEAD
 1.10.32.1 18-Feb-2008  mjf Sync with HEAD.
 1.10.26.1 23-Mar-2008  matt sync with HEAD
 1.10.24.1 27-Jan-2008  chris Sync to HEAD.
 1.10.20.1 28-Feb-2008  rjs Sync with HEAD.
 1.11.10.2 11-Mar-2010  yamt sync with head
 1.11.10.1 04-May-2009  yamt sync with head.
 1.11.8.1 04-Jun-2008  yamt sync with head
 1.11.6.2 17-Jan-2009  mjf Sync with HEAD.
 1.11.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.12.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.15.6.1 19-Jan-2009  skrll Sync with HEAD.
 1.18.12.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.18.2.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.18.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.18.2.1 30-Oct-2012  yamt sync with head
 1.20.2.1 18-May-2014  rmind sync with head
 1.4 21-Nov-2021  skrll Trailing whitespace.
 1.3 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.2 12-Nov-2005  hamajima branches: 1.2.82;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1 22-Dec-2004  joff branches: 1.1.4; 1.1.12;
ep93xx processor system tick timer and microtime()/delay() impl
 1.1.12.1 21-Jun-2006  yamt sync with head.
 1.1.4.3 11-Dec-2005  christos Sync with head.
 1.1.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.1 22-Dec-2004  skrll file epclkreg.h was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.2.82.1 11-Mar-2010  yamt sync with head
 1.36 26-Oct-2022  riastradh ddb/db_active.h: New home for extern db_active.

This can be included unconditionally, and db_active can then be
queried unconditionally; if DDB is not in the kernel, then db_active
is a constant zero. Reduces need for #include opt_ddb.h, #ifdef DDB.
 1.35 12-Feb-2022  riastradh sys: Fix various abuse of struct device internals.

Will help to make struct device opaque later.
 1.34 21-Nov-2021  skrll PR port-evbarm/40307 options KGDB doesn't work for some evbarm hosts

Apply patch from Lloyd Parkes with some KNF tweaks from me.
 1.33 21-Nov-2021  skrll Trailing whitespace.
 1.32 20-Nov-2020  thorpej malloc(9) -> kmem(9)
 1.31 10-Nov-2019  chs branches: 1.31.8;
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.30 13-Apr-2015  riastradh branches: 1.30.18;
MD rnd.h cleanups. Please let me know if I broke anything!
 1.29 15-Nov-2014  christos branches: 1.29.2;
centralize the call unit / dialout macros
 1.28 10-Aug-2014  tls Merge tls-earlyentropy branch into HEAD.
 1.27 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.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 08-Mar-2014  skrll Remove unused variables
 1.24 12-Nov-2012  skrll branches: 1.24.2;
C99 types
 1.23 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.22 02-Feb-2012  tls branches: 1.22.6;
Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

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

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

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

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

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.21 01-Jul-2011  dyoung branches: 1.21.2; 1.21.6;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.20 24-Apr-2011  rmind Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.19 14-Mar-2009  dsl branches: 1.19.4; 1.19.6;
Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.18 11-Jun-2008  cegger branches: 1.18.4; 1.18.10;
use device_lookup_private to get softc
 1.17 28-Apr-2008  martin branches: 1.17.2; 1.17.4;
Remove clause 3 and 4 from TNF licenses
 1.16 06-Jan-2008  matt branches: 1.16.6; 1.16.8; 1.16.10;
Cleanup softint lossage.
 1.15 19-Nov-2007  ad branches: 1.15.6;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.14 04-Mar-2007  christos branches: 1.14.2; 1.14.16; 1.14.18; 1.14.20; 1.14.22; 1.14.26; 1.14.28;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13 01-Oct-2006  elad branches: 1.13.4;
More from Matt Fleming:

Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
 1.12 01-Oct-2006  elad Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks!
 1.11 23-Jul-2006  ad branches: 1.11.4; 1.11.6;
Use the LWP cached credentials where sane.
 1.10 14-May-2006  elad integrate kauth.
 1.9 26-Mar-2006  thorpej Use device_unit() (and remove a couple of places where it is not
needed).
 1.8 08-Mar-2006  he branches: 1.8.2;
Remove yet another instance of the macro triplet SET/CLR/ISSET, now
found in <sys/types.h>.
 1.7 20-Feb-2006  thorpej branches: 1.7.2; 1.7.4;
Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
 1.6 14-Dec-2005  christos branches: 1.6.2; 1.6.4; 1.6.6;
proc -> lwp, ansi
 1.5 11-Dec-2005  christos merge ktrace-lwp.
 1.4 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.3 04-Jun-2005  he branches: 1.3.2;
Fix -Wcast-qual by sprinkling some consts, and remove named
parameters from a function prototype to avoid shadowing.
Also fix a couple of other shadowing problems.
 1.2 29-Dec-2004  joff branches: 1.2.4;
improve intr handling behavior in light of the fact that there is no transmit completion irqs on epcom
 1.1 22-Dec-2004  joff ep93xx processor on-chip UART driver
 1.2.4.3 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.2.4.1 29-Dec-2004  skrll file epcom.c was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.3.2.5 21-Jan-2008  yamt sync with head
 1.3.2.4 07-Dec-2007  yamt sync with head
 1.3.2.3 03-Sep-2007  yamt sync with head.
 1.3.2.2 30-Dec-2006  yamt sync with head.
 1.3.2.1 21-Jun-2006  yamt sync with head.
 1.6.6.2 01-Jun-2006  kardel Sync with head.
 1.6.6.1 22-Apr-2006  simonb Sync with head.
 1.6.4.1 09-Sep-2006  rpaulo sync with head
 1.6.2.1 01-Mar-2006  yamt sync with head.
 1.7.4.4 13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.7.4.3 19-Apr-2006  elad sync with head - hopefully this will work
 1.7.4.2 10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.7.4.1 08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.7.2.4 11-Aug-2006  yamt sync with head
 1.7.2.3 24-May-2006  yamt sync with head.
 1.7.2.2 01-Apr-2006  yamt sync with head.
 1.7.2.1 13-Mar-2006  yamt sync with head.
 1.8.2.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.8.2.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.11.6.1 22-Oct-2006  yamt sync with head
 1.11.4.1 18-Nov-2006  ad Sync with head.
 1.13.4.1 12-Mar-2007  rmind Sync with HEAD.
 1.14.28.2 18-Feb-2008  mjf Sync with HEAD.
 1.14.28.1 08-Dec-2007  mjf Sync with HEAD.
 1.14.26.1 21-Nov-2007  bouyer Sync with HEAD
 1.14.22.1 09-Jan-2008  matt sync with HEAD
 1.14.20.2 20-Jan-2008  chris Sync to HEAD.
 1.14.20.1 01-Jan-2008  chris Sync with HEAD.
 1.14.18.1 21-Nov-2007  joerg Sync with HEAD.
 1.14.16.2 28-Feb-2008  rjs Sync with HEAD.
 1.14.16.1 26-Dec-2007  rjs Sync with HEAD.
 1.14.2.1 03-Dec-2007  ad Sync with HEAD.
 1.15.6.1 08-Jan-2008  bouyer Sync with HEAD
 1.16.10.2 04-May-2009  yamt sync with head.
 1.16.10.1 16-May-2008  yamt sync with head.
 1.16.8.2 17-Jun-2008  yamt sync with head.
 1.16.8.1 18-May-2008  yamt sync with head.
 1.16.6.2 29-Jun-2008  mjf Sync with HEAD.
 1.16.6.1 02-Jun-2008  mjf Sync with HEAD.
 1.17.4.1 18-Jun-2008  simonb Sync with head.
 1.17.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.18.10.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.4.1 28-Apr-2009  skrll Sync with HEAD.
 1.19.6.1 06-Jun-2011  jruoho Sync with HEAD.
 1.19.4.1 31-May-2011  rmind sync with head
 1.21.6.1 18-Feb-2012  mrg merge to -current.
 1.21.2.4 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.21.2.3 16-Jan-2013  yamt sync with (a bit old) head
 1.21.2.2 30-Oct-2012  yamt sync with head
 1.21.2.1 17-Apr-2012  yamt sync with head
 1.22.6.3 03-Dec-2017  jdolecek update from HEAD
 1.22.6.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.22.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.24.2.1 18-May-2014  rmind sync with head
 1.26.2.2 10-Aug-2014  tls Rebase.
 1.26.2.1 07-Apr-2014  tls Be a little more clear and consistent about harvesting entropy from devices:

1) deprecate RND_FLAG_NO_ESTIMATE

2) define RND_FLAG_COLLECT_TIME, RND_FLAG_COLLECT_VALUE

3) define RND_FLAG_ESTIMATE_TIME, RND_FLAG_ESTIMATE_VALUE

4) define RND_FLAG_DEFAULT: RND_FLAG_COLLECT_TIME|
RND_FLAG_COLLECT_VALUE|RND_FLAG_ESTIMATE_TIME

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

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

7) 0 -> RND_FLAG_DEFAULT, actually gather entropy from various drivers
that had stubbed out code, other minor cleanups.
 1.29.2.1 06-Jun-2015  skrll Sync with HEAD
 1.30.18.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.31.8.1 14-Dec-2020  thorpej Sync w/ HEAD.
 1.4 21-Nov-2021  skrll Trailing whitespace.
 1.3 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.2 11-Dec-2005  christos branches: 1.2.80;
merge ktrace-lwp.
 1.1 22-Dec-2004  joff branches: 1.1.4;
ep93xx processor on-chip UART driver
 1.1.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.1 22-Dec-2004  skrll file epcomreg.h was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.2.80.1 11-Mar-2010  yamt sync with head
 1.9 21-Nov-2021  skrll PR port-evbarm/40307 options KGDB doesn't work for some evbarm hosts

Apply patch from Lloyd Parkes with some KNF tweaks from me.
 1.8 14-Apr-2015  riastradh Include <sys/rndsource.h> where it is actually used.

I had removed <sys/rnd.h> from files that didn't mention anything of
the rnd(9) API. But they included other files which assumed
<sys/rnd.h> had already been included.
 1.7 27-Oct-2012  chs branches: 1.7.14;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.6 02-Feb-2012  tls branches: 1.6.6;
Entropy-pool implementation move and cleanup.

1) Move core entropy-pool code and source/sink/sample management code
to sys/kern from sys/dev.

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

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

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

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

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files). Tested with release
builds on amd64 and evbarm and live testing on amd64.
 1.5 19-Nov-2011  tls branches: 1.5.2;
First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes
the following:

An initial cleanup and minor reorganization of the entropy pool
code in sys/dev/rnd.c and sys/dev/rndpool.c. Several bugs are
fixed. Some effort is made to accumulate entropy more quickly at
boot time.

A generic interface, "rndsink", is added, for stream generators to
request that they be re-keyed with good quality entropy from the pool
as soon as it is available.

The arc4random()/arc4randbytes() implementation in libkern is
adjusted to use the rndsink interface for rekeying, which helps
address the problem of low-quality keys at boot time.

An implementation of the FIPS 140-2 statistical tests for random
number generator quality is provided (libkern/rngtest.c). This
is based on Greg Rose's implementation from Qualcomm.

A new random stream generator, nist_ctr_drbg, is provided. It is
based on an implementation of the NIST SP800-90 CTR_DRBG by
Henric Jungheim. This generator users AES in a modified counter
mode to generate a backtracking-resistant random stream.

An abstraction layer, "cprng", is provided for in-kernel consumers
of randomness. The arc4random/arc4randbytes API is deprecated for
in-kernel use. It is replaced by "cprng_strong". The current
cprng_fast implementation wraps the existing arc4random
implementation. The current cprng_strong implementation wraps the
new CTR_DRBG implementation. Both interfaces are rekeyed from
the entropy pool automatically at intervals justifiable from best
current cryptographic practice.

In some quick tests, cprng_fast() is about the same speed as
the old arc4randbytes(), and cprng_strong() is about 20% faster
than rnd_extract_data(). Performance is expected to improve.

The AES code in src/crypto/rijndael is no longer an optional
kernel component, as it is required by cprng_strong, which is
not an optional kernel component.

The entropy pool output is subjected to the rngtest tests at
startup time; if it fails, the system will reboot. There is
approximately a 3/10000 chance of a false positive from these
tests. Entropy pool _input_ from hardware random numbers is
subjected to the rngtest tests at attach time, as well as the
FIPS continuous-output test, to detect bad or stuck hardware
RNGs; if any are detected, they are detached, but the system
continues to run.

A problem with rndctl(8) is fixed -- datastructures with
pointers in arrays are no longer passed to userspace (this
was not a security problem, but rather a major issue for
compat32). A new kernel will require a new rndctl.

The sysctl kern.arandom() and kern.urandom() nodes are hooked
up to the new generators, but the /dev/*random pseudodevices
are not, yet.

Manual pages for the new kernel interfaces are forthcoming.
 1.4 23-Oct-2009  snj branches: 1.4.12;
Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.3 11-Dec-2005  christos branches: 1.3.80;
merge ktrace-lwp.
 1.2 29-Dec-2004  joff branches: 1.2.4;
improve intr handling behavior in light of the fact that there is no transmit completion irqs on epcom
 1.1 22-Dec-2004  joff ep93xx processor on-chip UART driver
 1.2.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.2.4.1 29-Dec-2004  skrll file epcomvar.h was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.3.80.1 11-Mar-2010  yamt sync with head
 1.4.12.2 30-Oct-2012  yamt sync with head
 1.4.12.1 17-Apr-2012  yamt sync with head
 1.5.2.1 18-Feb-2012  mrg merge to -current.
 1.6.6.2 03-Dec-2017  jdolecek update from HEAD
 1.6.6.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.7.14.1 06-Jun-2015  skrll Sync with HEAD
 1.52 04-Oct-2025  thorpej Add a shared function to query the common properties used for configuring
an Ethernet address.
 1.51 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.50 27-Sep-2022  skrll branches: 1.50.10;
Remove unnecessary sys/malloc.h include
 1.49 17-Sep-2022  thorpej Eliminate use of IFF_OACTIVE.
 1.48 19-Feb-2020  thorpej When a media change is requested, don't just all (*if_init)(). That's
needlessly disruptive and incompatible with future locking changes.
We can use both ether_mediachange() and ether_mediastatus() instead.
 1.47 03-Feb-2020  skrll More if_stat*
 1.46 03-Feb-2020  skrll Adopt <net/if_stats.h>
 1.45 21-Oct-2019  msaitoh branches: 1.45.2;
if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.
 1.44 30-May-2019  msaitoh branches: 1.44.2;
Simplify MII structure initialization and reference. No functional change.
 1.43 28-May-2019  msaitoh Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.42 23-May-2019  msaitoh Whitespace fix (mainly tabify).
 1.41 23-May-2019  msaitoh No functional change:
- Change ac(was arpcom) to ec(ethercom)
- Simplify MII structure initialization.
- u_int*_t -> uint*_t.
- KNF
 1.40 05-Feb-2019  msaitoh Remove very old IFF_NOTRAILERS flag.
 1.39 22-Jan-2019  msaitoh Change MII PHY read/write API from:

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

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

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

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

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

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


Tested with the following device:

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

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

Not tested (PHY):
amhphy
bmtphy
dmphy
etphy
glxtphy
ikphy
iophy
lxtphy
nsphyter
pnaphy
rdcphy
sqphy
tlphy
tqphy
urlphy
 1.38 26-Jun-2018  msaitoh branches: 1.38.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.37 22-Jun-2018  msaitoh It's not required to include net/bpfdesc.h. Remove it.
 1.36 22-Feb-2017  nonaka branches: 1.36.6; 1.36.12;
Apply deferred if_start to more MD drivers.
 1.35 15-Dec-2016  ozaki-r branches: 1.35.2;
Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

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

Proposed on tech-kern and tech-net
 1.34 10-Jun-2016  ozaki-r branches: 1.34.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.33 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.32 20-May-2015  ozaki-r Remove leftover use of AF_NS and NS option

Unnecessary NETISR_NS is also removed.
 1.31 08-Mar-2014  skrll branches: 1.31.6;
Remove unused variables
 1.30 02-Mar-2014  joerg Make the empty loop body explicit.
 1.29 12-Nov-2012  skrll branches: 1.29.2;
C99 types
 1.28 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.27 22-Jul-2012  matt branches: 1.27.2;
Fix mii_statchg to take a 'struct ifnet *' instead of device_t. This fixes
problem with a common MDIO bus used for multiple interfaces.
Some drivers converted to CFATTACL_DECL_NEW.
 1.26 01-Jul-2011  dyoung branches: 1.26.2;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.25 05-Apr-2010  joerg 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.24 22-Jan-2010  martin branches: 1.24.2; 1.24.4;
Unify the name of the device property to hold a MAC address - there was
no clear majority for either "mac-addr" vs. "mac-address", but a quick
gallup poll among developers selected the latter.
 1.23 19-Jan-2010  pooka 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.22 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.21 18-Mar-2009  cegger bzero -> memset
 1.20 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.19 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.18 10-May-2008  martin branches: 1.18.6; 1.18.12;
Backout previous: the license sweep touched these files in error, so
restore the old license.
 1.17 28-Apr-2008  martin branches: 1.17.2;
Remove clause 3 and 4 from TNF licenses
 1.16 20-Jan-2008  dogcow branches: 1.16.10;
kill unused variables
 1.15 19-Jan-2008  dyoung Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange(). Check for
a non-ENXIO error return from mii_mediachg(). (ENXIO indicates
that a PHY is suspended.)

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

I have made a few miscellaneous changes, too:

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

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

XXX This patch affects more architectures than I can feasibly
XXX compile and run. I have compiled macppc, sparc64, i386. I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
 1.14 19-Jan-2008  chris Remove arm support for IPKDB.

It hasn't worked since arm was broken out from arm32 in Jan 2001, and
no-one has noticed or cared to fix it.
 1.13 17-Oct-2007  garbled branches: 1.13.2; 1.13.8;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.12 09-Jul-2007  ad branches: 1.12.6; 1.12.10; 1.12.12;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.11 05-Mar-2007  he branches: 1.11.2; 1.11.4; 1.11.10;
Cast to char* before doing pointer arithmetic, convert one void* to char*
for ease of pointer arithmetic.
 1.10 04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.9 24-Jan-2007  hubertf branches: 1.9.2;
Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
 1.8 05-May-2006  thorpej branches: 1.8.8;
Remove the devprop API and switch everthing over to the new proplib. Add
a new device_properties() accessor for device_t that returns the device's
property dictionary.
 1.7 29-Mar-2006  thorpej Use device_cfdata().
 1.6 18-Feb-2006  thorpej branches: 1.6.2; 1.6.4; 1.6.6;
- Don't expose dev_propdb directly -- provide devprop_*() wrappers instead.
- Rework the ARMADILLO / epe device properties interaction so that it actually
associates the MAC address property with the epe device instance.
 1.5 24-Dec-2005  perry branches: 1.5.2; 1.5.4; 1.5.6;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.4 12-Nov-2005  hamajima add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.3 19-Oct-2005  hamajima Fix write sequence to PHY.
I write a data first, but I wrote a command first.
 1.2 17-Jan-2005  joff branches: 1.2.2; 1.2.8; 1.2.10; 1.2.12;
dont use TX intrs and various other performance improvements
 1.1 22-Dec-2004  joff branches: 1.1.2;
ep93xx processor on-chip 1/10/100 ethernet MAC driver
 1.1.2.1 29-Apr-2005  kent sync with -current
 1.2.12.1 26-Oct-2005  yamt sync with head
 1.2.10.4 21-Jan-2008  yamt sync with head
 1.2.10.3 03-Sep-2007  yamt sync with head.
 1.2.10.2 26-Feb-2007  yamt sync with head.
 1.2.10.1 21-Jun-2006  yamt sync with head.
 1.2.8.1 21-Oct-2005  riz Pull up following revision(s) (requested by hamajima in ticket #904):
sys/arch/arm/ep93xx/epe.c: revision 1.3
Fix write sequence to PHY.
I write a data first, but I wrote a command first.
 1.2.2.4 11-Dec-2005  christos Sync with head.
 1.2.2.3 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.2.2.2 17-Jan-2005  skrll Sync with HEAD.
 1.2.2.1 17-Jan-2005  skrll file epe.c was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.5.6.2 01-Jun-2006  kardel Sync with head.
 1.5.6.1 22-Apr-2006  simonb Sync with head.
 1.5.4.1 09-Sep-2006  rpaulo sync with head
 1.5.2.1 18-Feb-2006  yamt sync with head.
 1.6.6.2 24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.6.6.1 31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.6.4.2 11-May-2006  elad sync with head
 1.6.4.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.6.2.2 24-May-2006  yamt sync with head.
 1.6.2.1 01-Apr-2006  yamt sync with head.
 1.8.8.1 01-Feb-2007  ad Sync with head.
 1.9.2.1 12-Mar-2007  rmind Sync with HEAD.
 1.11.10.1 03-Oct-2007  garbled Sync with HEAD
 1.11.4.1 11-Jul-2007  mjf Sync with head.
 1.11.2.1 15-Jul-2007  ad Sync with head.
 1.12.12.2 23-Mar-2008  matt sync with HEAD
 1.12.12.1 06-Nov-2007  matt sync with HEAD
 1.12.10.2 20-Jan-2008  chris Sync to HEAD.
 1.12.10.1 01-Jan-2008  chris Sync with HEAD.
 1.12.6.1 28-Feb-2008  rjs Sync with HEAD.
 1.13.8.1 20-Jan-2008  bouyer Sync with HEAD
 1.13.2.1 18-Feb-2008  mjf Sync with HEAD.
 1.16.10.3 11-Aug-2010  yamt sync with head.
 1.16.10.2 11-Mar-2010  yamt sync with head
 1.16.10.1 04-May-2009  yamt sync with head.
 1.17.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.18.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.18.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.24.4.1 30-May-2010  rmind sync with head
 1.24.2.1 30-Apr-2010  uebayasi Sync with HEAD.
 1.26.2.3 22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.26.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.26.2.1 30-Oct-2012  yamt sync with head
 1.27.2.3 03-Dec-2017  jdolecek update from HEAD
 1.27.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.27.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.29.2.1 18-May-2014  rmind sync with head
 1.31.6.5 28-Aug-2017  skrll Sync with HEAD
 1.31.6.4 05-Feb-2017  skrll Sync with HEAD
 1.31.6.3 09-Jul-2016  skrll Sync with HEAD
 1.31.6.2 19-Mar-2016  skrll Sync with HEAD
 1.31.6.1 06-Jun-2015  skrll Sync with HEAD
 1.34.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.34.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.35.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.36.12.3 26-Jan-2019  pgoyette Sync with HEAD
 1.36.12.2 28-Jul-2018  pgoyette Sync with HEAD
 1.36.12.1 25-Jun-2018  pgoyette Sync with HEAD
 1.36.6.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.36.6.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.38.2.3 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.38.2.2 08-Apr-2020  martin Merge changes from current as of 20200406
 1.38.2.1 10-Jun-2019  christos Sync with HEAD
 1.44.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.45.2.1 29-Feb-2020  ad Sync with head.
 1.50.10.1 02-Aug-2025  perseant Sync with HEAD
 1.5 21-Nov-2021  skrll Trailing whitespace.
 1.4 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.3 11-Dec-2005  christos branches: 1.3.80;
merge ktrace-lwp.
 1.2 17-Jan-2005  joff branches: 1.2.2;
dont use TX intrs and various other performance improvements
 1.1 22-Dec-2004  joff branches: 1.1.2;
ep93xx processor on-chip 1/10/100 ethernet MAC driver
 1.1.2.1 29-Apr-2005  kent sync with -current
 1.2.2.2 17-Jan-2005  skrll Sync with HEAD.
 1.2.2.1 17-Jan-2005  skrll file epereg.h was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.3.80.1 11-Mar-2010  yamt sync with head
 1.8 17-Sep-2022  thorpej Eliminate use of IFF_OACTIVE.
 1.7 12-Nov-2012  skrll C99 types
 1.6 22-Jul-2012  matt branches: 1.6.2;
Fix mii_statchg to take a 'struct ifnet *' instead of device_t. This fixes
problem with a common MDIO bus used for multiple interfaces.
Some drivers converted to CFATTACL_DECL_NEW.
 1.5 23-Oct-2009  snj branches: 1.5.12;
Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.4 04-Mar-2007  christos branches: 1.4.46;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.3 11-Dec-2005  christos branches: 1.3.26;
merge ktrace-lwp.
 1.2 17-Jan-2005  joff branches: 1.2.2; 1.2.10;
dont use TX intrs and various other performance improvements
 1.1 22-Dec-2004  joff branches: 1.1.2;
ep93xx processor on-chip 1/10/100 ethernet MAC driver
 1.1.2.1 29-Apr-2005  kent sync with -current
 1.2.10.1 03-Sep-2007  yamt sync with head.
 1.2.2.2 17-Jan-2005  skrll Sync with HEAD.
 1.2.2.1 17-Jan-2005  skrll file epevar.h was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.3.26.1 12-Mar-2007  rmind Sync with HEAD.
 1.4.46.1 11-Mar-2010  yamt sync with head
 1.5.12.2 16-Jan-2013  yamt sync with (a bit old) head
 1.5.12.1 30-Oct-2012  yamt sync with head
 1.6.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.8 21-Nov-2021  skrll Trailing whitespace.
 1.7 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.6 24-Apr-2021  thorpej branches: 1.6.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.5 27-Oct-2012  chs branches: 1.5.52;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.4 01-Jul-2011  dyoung branches: 1.4.2; 1.4.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 03-Aug-2009  he Move the include of <sys/gpio.h> up above <dev/gpio/gpiovar.h>, so that
GPIOMAXNAME gets defined before being used. Also remove the > 0 test on
NGPIO around the include of <sys/gpio.h>.
 1.2 27-Feb-2009  kenh Improved support for GPIO support on the EP93xx ARM processors.
Specifically:

Support disabling specific pins on specific ports.
Modification of TS7200 kernel config file for GPIO support.
Documentatin for the current and improved GPIO interface (epgpio).
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.22; 1.1.86; 1.1.94; 1.1.100;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.100.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.1.94.1 03-Mar-2009  skrll Sync with HEAD.
 1.1.86.2 19-Aug-2009  yamt sync with head.
 1.1.86.1 04-May-2009  yamt sync with head.
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file epgpio.c was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file epgpio.c was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.4.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.2.1 30-Oct-2012  yamt sync with head
 1.5.52.6 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.5.52.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.5.52.4 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.5.52.3 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.5.52.2 02-Apr-2021  thorpej config_found_ia() -> config_found() w/ CFARG_IATTR.
 1.5.52.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.6.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.22;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file epgpioreg.h was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file epgpioreg.h was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.22;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file epgpiovar.h was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file epgpiovar.h was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.5 21-Nov-2021  skrll Trailing whitespace.
 1.4 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.3 01-Jul-2011  dyoung branches: 1.3.2; 1.3.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.2 26-Mar-2006  thorpej branches: 1.2.6;
Use device_unit() (and remove a couple of places where it is not
needed).
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.8; 1.1.10; 1.1.12; 1.1.14; 1.1.16;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.16.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.1.14.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.1.12.1 01-Apr-2006  yamt sync with head.
 1.1.10.1 22-Apr-2006  simonb Sync with head.
 1.1.8.1 09-Sep-2006  rpaulo sync with head
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file epled.c was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.2.6.2 21-Jun-2006  yamt sync with head.
 1.2.6.1 26-Mar-2006  yamt file epled.c was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.3.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.3.2.1 30-Oct-2012  yamt sync with head
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.22;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file epledvar.h was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file epledvar.h was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.11 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.10 24-Apr-2021  thorpej branches: 1.10.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.9 09-Apr-2018  jakllsch branches: 1.9.16;
Stop potential misuse of vendor names and USB vendor IDs in root hub
device and string descriptors.

Firstly: Few vendors have identical PCI-SIG vendor IDs and USB-IF vendor
IDs. As such, using the PCI vendor ID as a USB vendor ID may trample
on whomever is allocated that USB vendor ID.

Secondly: The vendor of the host controller hardware implementation has
little to nothing to do with our usbroothub implementation. Thus we
should not potentially associate any problems therewith to such third
party.

This change will result in root hubs being identified by USB Vendor ID
0x0000. Root hub vendor string will now be "NetBSD" (or, specifically:
ostype). Product ID (0x0000) and product strings remain unchanged.
 1.8 23-Apr-2016  skrll branches: 1.8.16;
Merge nick-nhusb

- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
 1.7 12-Nov-2012  skrll branches: 1.7.12; 1.7.14; 1.7.18;
C99 types
 1.6 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.5 01-Jul-2011  dyoung branches: 1.5.2; 1.5.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 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.3 03-Apr-2008  drochner branches: 1.3.4; 1.3.12; 1.3.18;
update for device/softc split,
compile-tested by yamt -- could someone please give it a functional test?
 1.2 11-Dec-2005  christos branches: 1.2.76;
merge ktrace-lwp.
 1.1 22-Dec-2004  joff branches: 1.1.4;
ep93xx processor on-chip USB OHCI driver glue
 1.1.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.1 22-Dec-2004  skrll file epohci.c was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.2.76.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.18.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.12.1 28-Apr-2009  skrll Sync with HEAD.
 1.3.4.1 04-May-2009  yamt sync with head.
 1.5.12.2 03-Dec-2017  jdolecek update from HEAD
 1.5.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.5.2.1 30-Oct-2012  yamt sync with head
 1.7.18.1 06-Sep-2016  skrll First pass at netbsd-7 updated with USB code from HEAD
 1.7.14.4 05-Dec-2014  skrll Use int for return type for [eou]chi_init and motg_init.
 1.7.14.3 05-Dec-2014  skrll KNF. Remove ( ) from return statements.
 1.7.14.2 03-Dec-2014  skrll The grand renaming of structure members.

No functional change.
 1.7.14.1 03-Dec-2014  skrll Trailing whitespace.
 1.7.12.1 05-Apr-2017  snj Pull up following revision(s) (requested by skrll in ticket #1395):
share/man/man4/axe.4: netbsd-7-nhusb
share/man/man4/axen.4: netbsd-7-nhusb
share/man/man4/cdce.4: netbsd-7-nhusb
share/man/man4/uaudio.4: netbsd-7-nhusb
share/man/man4/ucom.4: netbsd-7-nhusb
share/man/man4/uep.4: netbsd-7-nhusb
share/man/man4/urtw.4: netbsd-7-nhusb
share/man/man4/usb.4: netbsd-7-nhusb
share/man/man4/uyap.4: netbsd-7-nhusb
share/man/man4/xhci.4: netbsd-7-nhusb
share/man/man9/usbdi.9: netbsd-7-nhusb
sys/arch/amd64/conf/ALL: netbsd-7-nhusb
sys/arch/amd64/conf/GENERIC: netbsd-7-nhusb
sys/arch/amiga/dev/slhci_zbus.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_otg.c: netbsd-7-nhusb
sys/arch/arm/allwinner/awin_usb.c: netbsd-7-nhusb
sys/arch/arm/amlogic/amlogic_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/at91/at91ohci.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm2835_dwctwo.c: netbsd-7-nhusb
sys/arch/arm/broadcom/bcm53xx_usb.c: netbsd-7-nhusb
sys/arch/arm/ep93xx/epohci.c: netbsd-7-nhusb
sys/arch/arm/gemini/obio_ehci.c: netbsd-7-nhusb
sys/arch/arm/imx/files.imx23: netbsd-7-nhusb
sys/arch/arm/imx/imxusb.c: netbsd-7-nhusb
sys/arch/arm/imx/imxusbreg.h: netbsd-7-nhusb
sys/arch/arm/omap/obio_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/omap3_ehci.c: netbsd-7-nhusb
sys/arch/arm/omap/omapl1x_ohci.c: netbsd-7-nhusb
sys/arch/arm/omap/tiotg.c: netbsd-7-nhusb
sys/arch/arm/s3c2xx0/ohci_s3c24x0.c: netbsd-7-nhusb
sys/arch/arm/samsung/exynos_usb.c: netbsd-7-nhusb
sys/arch/arm/xscale/pxa2x0_ohci.c: netbsd-7-nhusb
sys/arch/arm/zynq/zynq_usb.c: netbsd-7-nhusb
sys/arch/hpcarm/dev/nbp_slhci.c: netbsd-7-nhusb
sys/arch/hpcmips/dev/plumohci.c: netbsd-7-nhusb
sys/arch/i386/conf/ALL: netbsd-7-nhusb
sys/arch/i386/conf/GENERIC: netbsd-7-nhusb
sys/arch/i386/pci/gcscehci.c: netbsd-7-nhusb
sys/arch/luna68k/conf/GENERIC: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahci.c: netbsd-7-nhusb
sys/arch/mips/adm5120/dev/ahcivar.h: netbsd-7-nhusb
sys/arch/mips/alchemy/dev/ohci_aubus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ehci_arbus.c: netbsd-7-nhusb
sys/arch/mips/atheros/dev/ohci_arbus.c: netbsd-7-nhusb
sys/arch/mips/conf/files.adm5120: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ehci.c: netbsd-7-nhusb
sys/arch/mips/ralink/ralink_ohci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ehci.c: netbsd-7-nhusb
sys/arch/mips/rmi/rmixl_ohci.c: netbsd-7-nhusb
sys/arch/playstation2/dev/ohci_sbus.c: netbsd-7-nhusb
sys/arch/powerpc/booke/dev/pq3ehci.c: netbsd-7-nhusb
sys/arch/powerpc/ibm4xx/dev/dwctwo_plb.c: netbsd-7-nhusb
sys/arch/x68k/dev/slhci_intio.c: netbsd-7-nhusb
sys/conf/files: netbsd-7-nhusb
sys/dev/cardbus/ehci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/ohci_cardbus.c: netbsd-7-nhusb
sys/dev/cardbus/uhci_cardbus.c: netbsd-7-nhusb
sys/dev/ic/sl811hs.c: netbsd-7-nhusb
sys/dev/ic/sl811hsvar.h: netbsd-7-nhusb
sys/dev/isa/slhci_isa.c: netbsd-7-nhusb
sys/dev/marvell/ehci_mv.c: netbsd-7-nhusb
sys/dev/pci/ehci_pci.c: netbsd-7-nhusb
sys/dev/pci/ohci_pci.c: netbsd-7-nhusb
sys/dev/pci/uhci_pci.c: netbsd-7-nhusb
sys/dev/pci/xhci_pci.c: netbsd-7-nhusb
sys/dev/pcmcia/slhci_pcmcia.c: netbsd-7-nhusb
sys/dev/usb/Makefile.usbdevs: netbsd-7-nhusb
sys/dev/usb/TODO: netbsd-7-nhusb
sys/dev/usb/TODO.usbmp: netbsd-7-nhusb
sys/dev/usb/aubtfwl.c: netbsd-7-nhusb
sys/dev/usb/auvitek.c: netbsd-7-nhusb
sys/dev/usb/auvitek_audio.c: netbsd-7-nhusb
sys/dev/usb/auvitek_dtv.c: netbsd-7-nhusb
sys/dev/usb/auvitek_i2c.c: netbsd-7-nhusb
sys/dev/usb/auvitek_video.c: netbsd-7-nhusb
sys/dev/usb/auvitekvar.h: netbsd-7-nhusb
sys/dev/usb/ehci.c: netbsd-7-nhusb
sys/dev/usb/ehcireg.h: netbsd-7-nhusb
sys/dev/usb/ehcivar.h: netbsd-7-nhusb
sys/dev/usb/emdtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_dtv.c: netbsd-7-nhusb
sys/dev/usb/emdtv_ir.c: netbsd-7-nhusb
sys/dev/usb/emdtvvar.h: netbsd-7-nhusb
sys/dev/usb/ezload.c: netbsd-7-nhusb
sys/dev/usb/ezload.h: netbsd-7-nhusb
sys/dev/usb/files.usb: netbsd-7-nhusb
sys/dev/usb/hid.c: netbsd-7-nhusb
sys/dev/usb/hid.h: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.c: netbsd-7-nhusb
sys/dev/usb/if_athn_usb.h: netbsd-7-nhusb
sys/dev/usb/if_atu.c: netbsd-7-nhusb
sys/dev/usb/if_atureg.h: netbsd-7-nhusb
sys/dev/usb/if_aue.c: netbsd-7-nhusb
sys/dev/usb/if_auereg.h: netbsd-7-nhusb
sys/dev/usb/if_axe.c: netbsd-7-nhusb
sys/dev/usb/if_axen.c: netbsd-7-nhusb
sys/dev/usb/if_axenreg.h: netbsd-7-nhusb
sys/dev/usb/if_axereg.h: netbsd-7-nhusb
sys/dev/usb/if_cdce.c: netbsd-7-nhusb
sys/dev/usb/if_cdcereg.h: netbsd-7-nhusb
sys/dev/usb/if_cue.c: netbsd-7-nhusb
sys/dev/usb/if_cuereg.h: netbsd-7-nhusb
sys/dev/usb/if_kue.c: netbsd-7-nhusb
sys/dev/usb/if_kuereg.h: netbsd-7-nhusb
sys/dev/usb/if_otus.c: netbsd-7-nhusb
sys/dev/usb/if_otusvar.h: netbsd-7-nhusb
sys/dev/usb/if_rum.c: netbsd-7-nhusb
sys/dev/usb/if_rumreg.h: netbsd-7-nhusb
sys/dev/usb/if_rumvar.h: netbsd-7-nhusb
sys/dev/usb/if_run.c: netbsd-7-nhusb
sys/dev/usb/if_runvar.h: netbsd-7-nhusb
sys/dev/usb/if_smsc.c: netbsd-7-nhusb
sys/dev/usb/if_smscreg.h: netbsd-7-nhusb
sys/dev/usb/if_smscvar.h: netbsd-7-nhusb
sys/dev/usb/if_udav.c: netbsd-7-nhusb
sys/dev/usb/if_udavreg.h: netbsd-7-nhusb
sys/dev/usb/if_upgt.c: netbsd-7-nhusb
sys/dev/usb/if_upgtvar.h: netbsd-7-nhusb
sys/dev/usb/if_upl.c: netbsd-7-nhusb
sys/dev/usb/if_ural.c: netbsd-7-nhusb
sys/dev/usb/if_uralreg.h: netbsd-7-nhusb
sys/dev/usb/if_uralvar.h: netbsd-7-nhusb
sys/dev/usb/if_url.c: netbsd-7-nhusb
sys/dev/usb/if_urlreg.h: netbsd-7-nhusb
sys/dev/usb/if_urndis.c: netbsd-7-nhusb
sys/dev/usb/if_urndisreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtw.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn.c: netbsd-7-nhusb
sys/dev/usb/if_urtwn_data.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnreg.h: netbsd-7-nhusb
sys/dev/usb/if_urtwnvar.h: netbsd-7-nhusb
sys/dev/usb/if_urtwreg.h: netbsd-7-nhusb
sys/dev/usb/if_zyd.c: netbsd-7-nhusb
sys/dev/usb/if_zydreg.h: netbsd-7-nhusb
sys/dev/usb/irmce.c: netbsd-7-nhusb
sys/dev/usb/moscom.c: netbsd-7-nhusb
sys/dev/usb/motg.c: netbsd-7-nhusb
sys/dev/usb/motgvar.h: netbsd-7-nhusb
sys/dev/usb/ohci.c: netbsd-7-nhusb
sys/dev/usb/ohcireg.h: netbsd-7-nhusb
sys/dev/usb/ohcivar.h: netbsd-7-nhusb
sys/dev/usb/pseye.c: netbsd-7-nhusb
sys/dev/usb/slurm.c: netbsd-7-nhusb
sys/dev/usb/stuirda.c: netbsd-7-nhusb
sys/dev/usb/u3g.c: netbsd-7-nhusb
sys/dev/usb/uark.c: netbsd-7-nhusb
sys/dev/usb/uatp.c: netbsd-7-nhusb
sys/dev/usb/uaudio.c: netbsd-7-nhusb
sys/dev/usb/uberry.c: netbsd-7-nhusb
sys/dev/usb/ubsa.c: netbsd-7-nhusb
sys/dev/usb/ubsa_common.c: netbsd-7-nhusb
sys/dev/usb/ubsavar.h: netbsd-7-nhusb
sys/dev/usb/ubt.c: netbsd-7-nhusb
sys/dev/usb/uchcom.c: netbsd-7-nhusb
sys/dev/usb/ucom.c: netbsd-7-nhusb
sys/dev/usb/ucomvar.h: netbsd-7-nhusb
sys/dev/usb/ucycom.c: netbsd-7-nhusb
sys/dev/usb/udl.c: netbsd-7-nhusb
sys/dev/usb/udl.h: netbsd-7-nhusb
sys/dev/usb/udsbr.c: netbsd-7-nhusb
sys/dev/usb/udsir.c: netbsd-7-nhusb
sys/dev/usb/uep.c: netbsd-7-nhusb
sys/dev/usb/uftdi.c: netbsd-7-nhusb
sys/dev/usb/uftdireg.h: netbsd-7-nhusb
sys/dev/usb/ugen.c: netbsd-7-nhusb
sys/dev/usb/ugensa.c: netbsd-7-nhusb
sys/dev/usb/uhci.c: netbsd-7-nhusb
sys/dev/usb/uhcireg.h: netbsd-7-nhusb
sys/dev/usb/uhcivar.h: netbsd-7-nhusb
sys/dev/usb/uhid.c: netbsd-7-nhusb
sys/dev/usb/uhidev.c: netbsd-7-nhusb
sys/dev/usb/uhidev.h: netbsd-7-nhusb
sys/dev/usb/uhmodem.c: netbsd-7-nhusb
sys/dev/usb/uhso.c: netbsd-7-nhusb
sys/dev/usb/uhub.c: netbsd-7-nhusb
sys/dev/usb/uipad.c: netbsd-7-nhusb
sys/dev/usb/uipaq.c: netbsd-7-nhusb
sys/dev/usb/uirda.c: netbsd-7-nhusb
sys/dev/usb/uirdavar.h: netbsd-7-nhusb
sys/dev/usb/ukbd.c: netbsd-7-nhusb
sys/dev/usb/ukbdmap.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.c: netbsd-7-nhusb
sys/dev/usb/ukyopon.h: netbsd-7-nhusb
sys/dev/usb/ulpt.c: netbsd-7-nhusb
sys/dev/usb/umass.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.c: netbsd-7-nhusb
sys/dev/usb/umass_isdata.h: netbsd-7-nhusb
sys/dev/usb/umass_quirks.c: netbsd-7-nhusb
sys/dev/usb/umass_quirks.h: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.c: netbsd-7-nhusb
sys/dev/usb/umass_scsipi.h: netbsd-7-nhusb
sys/dev/usb/umassvar.h: netbsd-7-nhusb
sys/dev/usb/umcs.c: netbsd-7-nhusb
sys/dev/usb/umct.c: netbsd-7-nhusb
sys/dev/usb/umidi.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.c: netbsd-7-nhusb
sys/dev/usb/umidi_quirks.h: netbsd-7-nhusb
sys/dev/usb/umodem.c: netbsd-7-nhusb
sys/dev/usb/umodem_common.c: netbsd-7-nhusb
sys/dev/usb/umodemvar.h: netbsd-7-nhusb
sys/dev/usb/ums.c: netbsd-7-nhusb
sys/dev/usb/uplcom.c: netbsd-7-nhusb
sys/dev/usb/urio.c: netbsd-7-nhusb
sys/dev/usb/urio.h: netbsd-7-nhusb
sys/dev/usb/usb.c: netbsd-7-nhusb
sys/dev/usb/usb.h: netbsd-7-nhusb
sys/dev/usb/usb_mem.c: netbsd-7-nhusb
sys/dev/usb/usb_mem.h: netbsd-7-nhusb
sys/dev/usb/usb_quirks.c: netbsd-7-nhusb
sys/dev/usb/usb_quirks.h: netbsd-7-nhusb
sys/dev/usb/usb_subr.c: netbsd-7-nhusb
sys/dev/usb/usbdevices.config: netbsd-7-nhusb
sys/dev/usb/usbdevs: netbsd-7-nhusb
sys/dev/usb/usbdevs.h: netbsd-7-nhusb
sys/dev/usb/usbdevs_data.h: netbsd-7-nhusb
sys/dev/usb/usbdi.c: netbsd-7-nhusb
sys/dev/usb/usbdi.h: netbsd-7-nhusb
sys/dev/usb/usbdi_util.c: netbsd-7-nhusb
sys/dev/usb/usbdi_util.h: netbsd-7-nhusb
sys/dev/usb/usbdivar.h: netbsd-7-nhusb
sys/dev/usb/usbhid.h: netbsd-7-nhusb
sys/dev/usb/usbhist.h: netbsd-7-nhusb
sys/dev/usb/usbroothub.c: netbsd-7-nhusb
sys/dev/usb/usbroothub.h: netbsd-7-nhusb
sys/dev/usb/usbroothub_subr.c: delete
sys/dev/usb/usbroothub_subr.h: delete
sys/dev/usb/uscanner.c: netbsd-7-nhusb
sys/dev/usb/uslsa.c: netbsd-7-nhusb
sys/dev/usb/usscanner.c: netbsd-7-nhusb
sys/dev/usb/ustir.c: netbsd-7-nhusb
sys/dev/usb/uthum.c: netbsd-7-nhusb
sys/dev/usb/utoppy.c: netbsd-7-nhusb
sys/dev/usb/uts.c: netbsd-7-nhusb
sys/dev/usb/uvideo.c: netbsd-7-nhusb
sys/dev/usb/uvisor.c: netbsd-7-nhusb
sys/dev/usb/uvscom.c: netbsd-7-nhusb
sys/dev/usb/uyap.c: netbsd-7-nhusb
sys/dev/usb/uyap_firmware.h: netbsd-7-nhusb
sys/dev/usb/uyurex.c: netbsd-7-nhusb
sys/dev/usb/x1input_rdesc.h: netbsd-7-nhusb
sys/dev/usb/xhci.c: netbsd-7-nhusb
sys/dev/usb/xhcireg.h: netbsd-7-nhusb
sys/dev/usb/xhcivar.h: netbsd-7-nhusb
sys/dev/usb/xinput_rdesc.h: netbsd-7-nhusb
sys/external/bsd/common/conf/files.linux: netbsd-7-nhusb
sys/external/bsd/common/include/linux/err.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/kernel.h: netbsd-7-nhusb
sys/external/bsd/common/include/linux/workqueue.h: netbsd-7-nhusb
sys/external/bsd/common/linux/linux_work.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/atombios_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_encoders.c: netbsd-7-nhusb
sys/external/bsd/drm2/drm/files.drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/i915drm/files.i915drmkms: netbsd-7-nhusb
sys/external/bsd/drm2/include/linux/err.h: delete
sys/external/bsd/drm2/include/linux/workqueue.h: delete
sys/external/bsd/drm2/linux/files.drmkms_linux: netbsd-7-nhusb
sys/external/bsd/drm2/linux/linux_work.c: delete
sys/external/bsd/dwc2/dwc2.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwc2var.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dwctwo2netbsd: netbsd-7-nhusb
sys/external/bsd/dwc2/conf/files.dwc2: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_core.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_coreintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcd.h: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdddma.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdintr.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hcdqueue.c: netbsd-7-nhusb
sys/external/bsd/dwc2/dist/dwc2_hw.h: netbsd-7-nhusb
sys/modules/drmkms_linux/Makefile: netbsd-7-nhusb
sys/modules/i915drmkms/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libugenhc/ugenhc.c: netbsd-7-nhusb
sys/rump/dev/lib/libusb/Makefile: netbsd-7-nhusb
sys/rump/dev/lib/libusb/USB.ioconf: netbsd-7-nhusb
sys/rump/dev/lib/libusb/usb_at_ugenhc.c: delete
sys/rump/dev/lib/libusb/opt/opt_usb.h: delete
sys/rump/dev/lib/libusb/opt/opt_usbverbose.h: delete
sys/sys/mbuf.h: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.8: netbsd-7-nhusb
usr.sbin/usbdevs/usbdevs.c: netbsd-7-nhusb
Merge netbsd-7-nhusb:
- API / infrastructure changes to support memory management changes.
- Memory management improvements and bug fixes.
- HCDs should now be MP safe
- conversion to KERNHIST based debug
- FS/LS isoc support on ehci(4).
- conversion to kmem(9)
- Some USB 3 support - mostly from Takahiro HAYASHI (t-hash).
- interrupt transfers now get proper DMA operations
- general bug fixes
- kern/48308
- uhub status notification improvements
- umass(4) probe fix (applied to HEAD already)
- ohci(4) short transfer fix
- Change the SOFTINT level from NET to SERIAL for the USB softint handler.
This gives the callback a chance of running when another softint handler
at SOFTINT_NET has blocked holding a lock, e.g. softnet_lock and most of
the network stack.
- kern/49065 - ifconfig tun0 ... sequence locks up system / lockup:
softnet_lock held across usb xfr
- kern/50491 - unkillable wait in usbd_transfer while using usmsc0
on raspberry pi 2
- kern/51395 - USB Ethernet makes xhci hang
- Various improvements to slhci(4)
- Various improvements to dwc2(4)
 1.8.16.1 16-Apr-2018  pgoyette Sync with HEAD, resolve some conflicts
 1.9.16.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.10.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.12 27-Sep-2022  skrll malloc -> kmem
 1.11 21-Nov-2021  skrll Trailing whitespace.
 1.10 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.9 24-Apr-2021  thorpej branches: 1.9.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.8 10-Nov-2019  chs branches: 1.8.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.7 27-Oct-2012  chs branches: 1.7.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.6 26-Jul-2011  dyoung branches: 1.6.2; 1.6.12;
Don't set the iobase and iosize members of pcmciabus_attach_args because
they're not used in any meaningful way.
 1.5 01-Jul-2011  dyoung #include <sys/bus.h> instead of <machine/bus.h>.
 1.4 29-Jun-2008  hamajima fixed some bugs.
- correct argument of eppcic_set_pcreg()
- add wait after set of timing register
 1.3 17-Oct-2007  garbled branches: 1.3.16; 1.3.20; 1.3.22; 1.3.24;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.2 09-Jul-2007  ad branches: 1.2.10; 1.2.12;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.22; 1.1.36; 1.1.38; 1.1.44;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.44.1 03-Oct-2007  garbled Sync with HEAD
 1.1.38.1 11-Jul-2007  mjf Sync with head.
 1.1.36.1 15-Jul-2007  ad Sync with head.
 1.1.22.3 03-Sep-2007  yamt sync with head.
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file eppcic.c was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file eppcic.c was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.2.12.1 06-Nov-2007  matt sync with HEAD
 1.2.10.1 01-Jan-2008  chris Sync with HEAD.
 1.3.24.1 03-Jul-2008  simonb Sync with head.
 1.3.22.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.3.20.1 04-May-2009  yamt sync with head.
 1.3.16.1 29-Jun-2008  mjf Sync with HEAD.
 1.6.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.6.2.1 30-Oct-2012  yamt sync with head
 1.7.38.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.8.10.2 18-Apr-2021  thorpej config_found() takes a device_t, not a softc. This is a bug left-over
from decoupling of device_t / softcs long ago.
 1.8.10.1 23-Mar-2021  thorpej Convert config_found_ia() call sites where the device only carries
a single interface attribute to bare config_found() calls.
 1.9.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.3 12-Nov-2012  skrll C99 types
 1.2 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.22; 1.1.120; 1.1.130;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.130.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.1.120.2 16-Jan-2013  yamt sync with (a bit old) head
 1.1.120.1 30-Oct-2012  yamt sync with head
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file eppcicvar.h was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file eppcicvar.h was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.9 07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

Change todr_chip_handle::bus_cookie -> todr_chip_handle::todr_devaux.
Nothing was using the old field, but I decided to keep it around just
in cause something needs it in the future.

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.8 07-Sep-2025  thorpej Remove unnecessary NULL-initialization of TODR handle fields.
 1.7 21-Nov-2021  skrll Trailing whitespace.
 1.6 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.5 01-Jul-2011  dyoung branches: 1.5.2; 1.5.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.4 05-Jan-2010  mbalmer One semicolon is enough.
 1.3 12-Dec-2009  tsutsui Remove `volatile' qualifier from argument types of
struct timeval passed to todr_gettime(9) and todr_settime(9).
We no longer have an ancient and volatile struct timeval `time'
global since we have switched to MI timercounter(9) on all port.

XXX1: some of these RTC drivers still assume 32bit time_t
XXX2: some of these should be rewritten to use todr_[gs]ettime_ymdhms()
XXX3: todr(9) man page doesn't mention todr_[gs]ettime_ymdhms()
 1.2 04-Sep-2006  gdamore branches: 1.2.62;
Remove unused todr_setcal/todr_getcal and all the assorted stub
implementations.
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.8; 1.1.12; 1.1.22;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.22.3 30-Dec-2006  yamt sync with head.
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file eprtc.c was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.12.1 14-Sep-2006  yamt sync with head.
 1.1.8.1 09-Sep-2006  rpaulo sync with head
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file eprtc.c was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.2.62.1 11-Mar-2010  yamt sync with head
 1.5.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.5.2.1 30-Oct-2012  yamt sync with head
 1.2 24-Mar-2022  andvar s/interger/integer/ and s/Compensatin/Compensation/ in comments.
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.22;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file eprtcreg.h was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file eprtcreg.h was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.22;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file epsmcreg.h was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file epsmcreg.h was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.16 21-Nov-2021  skrll Trailing whitespace.
 1.15 07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.14 24-Apr-2021  thorpej branches: 1.14.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.13 12-Nov-2012  skrll branches: 1.13.52;
C99 types
 1.12 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.11 01-Jul-2011  dyoung branches: 1.11.2; 1.11.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.10 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.9 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.8 10-May-2008  martin branches: 1.8.6; 1.8.12;
Backout previous: the license sweep touched these files in error, so
restore the old license.
 1.7 28-Apr-2008  martin branches: 1.7.2;
Remove clause 3 and 4 from TNF licenses
 1.6 08-Mar-2006  lukem branches: 1.6.70;
Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
 1.5 12-Nov-2005  hamajima branches: 1.5.6; 1.5.8; 1.5.10; 1.5.12;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.4 26-Aug-2005  drochner s/locdesc_t/int/g
 1.3 30-Jun-2005  drochner branches: 1.3.2;
adaptions to config_search() change, and minor autoconf fixes, mostly from Havard Eidnes
 1.2 04-Jun-2005  he Fix -Wcast-qual by sprinkling some consts, and remove named
parameters from a function prototype to avoid shadowing.
Also fix a couple of other shadowing problems.
 1.1 22-Dec-2004  joff branches: 1.1.4;
ep93xx ARM system-on-chip support
 1.1.4.4 11-Dec-2005  christos Sync with head.
 1.1.4.3 10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.1 22-Dec-2004  skrll file epsoc.c was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.3.2.1 21-Jun-2006  yamt sync with head.
 1.5.12.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.5.10.1 13-Mar-2006  yamt sync with head.
 1.5.8.1 22-Apr-2006  simonb Sync with head.
 1.5.6.1 09-Sep-2006  rpaulo sync with head
 1.6.70.2 11-Mar-2010  yamt sync with head
 1.6.70.1 04-May-2009  yamt sync with head.
 1.7.2.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.8.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.8.6.1 28-Apr-2009  skrll Sync with HEAD.
 1.11.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.11.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.11.2.1 30-Oct-2012  yamt sync with head
 1.13.52.8 05-Apr-2021  thorpej Treat config_probe() as if it were a boolean function; don't compare
return value > 0... except for the odd balls, which are now really easy
to spot.
 1.13.52.7 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.13.52.6 04-Apr-2021  thorpej CFARG_SUBMATCH -> CFARG_SEARCH for the indirect configuration uses.
 1.13.52.5 03-Apr-2021  thorpej Give config_attach() the tagged variadic argument treatment and
mechanically convert all call sites.
 1.13.52.4 22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.13.52.3 22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.13.52.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.13.52.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.14.8.1 04-Aug-2021  thorpej Adapt to CFARGS().
 1.6 12-Nov-2012  skrll C99 types
 1.5 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.4 01-Jul-2011  dyoung branches: 1.4.2; 1.4.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 23-Oct-2009  snj Switch to a 2 clause license. Approved by joff@ (copyright holder).
 1.2 12-Nov-2005  hamajima branches: 1.2.82;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1 22-Dec-2004  joff branches: 1.1.4; 1.1.12;
ep93xx ARM system-on-chip support
 1.1.12.1 21-Jun-2006  yamt sync with head.
 1.1.4.3 11-Dec-2005  christos Sync with head.
 1.1.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.1 22-Dec-2004  skrll file epsocvar.h was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.2.82.1 11-Mar-2010  yamt sync with head
 1.4.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.2.2 16-Jan-2013  yamt sync with (a bit old) head
 1.4.2.1 30-Oct-2012  yamt sync with head
 1.6 21-Nov-2021  skrll Trailing whitespace.
 1.5 27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.4 01-Jul-2011  dyoung branches: 1.4.2; 1.4.12;
#include <sys/bus.h> instead of <machine/bus.h>.
 1.3 21-Aug-2006  hamajima fix unterminated #ifdef. PR34240.
 1.2 26-Mar-2006  thorpej branches: 1.2.6; 1.2.8;
Use device_unit() (and remove a couple of places where it is not
needed).
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.8; 1.1.10; 1.1.12; 1.1.14; 1.1.16;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.16.1 28-Mar-2006  tron Merge 2006-03-28 NetBSD-current into the "peter-altq" branch.
 1.1.14.1 19-Apr-2006  elad sync with head - hopefully this will work
 1.1.12.2 03-Sep-2006  yamt sync with head.
 1.1.12.1 01-Apr-2006  yamt sync with head.
 1.1.10.1 22-Apr-2006  simonb Sync with head.
 1.1.8.1 09-Sep-2006  rpaulo sync with head
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file epwdog.c was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.2.8.1 23-Aug-2006  tron Pull up following revision(s) (requested by hamajima in ticket #44):
sys/arch/arm/ep93xx/epwdog.c: revision 1.3
fix unterminated #ifdef. PR34240.
 1.2.6.3 30-Dec-2006  yamt sync with head.
 1.2.6.2 21-Jun-2006  yamt sync with head.
 1.2.6.1 26-Mar-2006  yamt file epwdog.c was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.4.12.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.4.2.1 30-Oct-2012  yamt sync with head
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.22;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file epwdogreg.h was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file epwdogreg.h was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.1 12-Nov-2005  hamajima branches: 1.1.4; 1.1.22;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1.22.2 21-Jun-2006  yamt sync with head.
 1.1.22.1 12-Nov-2005  yamt file epwdogvar.h was added on branch yamt-lazymbuf on 2006-06-21 14:49:16 +0000
 1.1.4.2 11-Dec-2005  christos Sync with head.
 1.1.4.1 12-Nov-2005  christos file epwdogvar.h was added on branch ktrace-lwp on 2005-12-11 10:28:15 +0000
 1.4 27-Feb-2009  kenh Improved support for GPIO support on the EP93xx ARM processors.
Specifically:

Support disabling specific pins on specific ports.
Modification of TS7200 kernel config file for GPIO support.
Documentatin for the current and improved GPIO interface (epgpio).
 1.3 27-May-2008  hamajima branches: 1.3.6; 1.3.12;
- convert inline asm umull to C
- add "-march=armv4 -mtune=arm9" to CPUFLAGS

Relevant mailing list threads:
http://mail-index.netbsd.org/source-changes/2008/05/25/msg195537.html
http://mail-index.netbsd.org/port-arm/2008/05/26/msg000228.html
 1.2 12-Nov-2005  hamajima branches: 1.2.78; 1.2.80; 1.2.82; 1.2.84;
add new EP93xx device drivers.
epgpio: GPIO Interface (support gpio(4))
epled: LED on epgpio
eppcic: PCMCIA Interface
eprtc: Realtime clock
epwdog: Watchdog timer

changes
ep93xx_intr: add dummy entries to keep vmstat happy.
epclk: I use Timer1 and generate 100Hz if set.
epe: attach epclk and epgpio first.
fetch the Ethernet address from property if set.
I use config flags and modify MDCDIV.
 1.1 22-Dec-2004  joff branches: 1.1.4; 1.1.12;
ep93xx ARM system-on-chip support
 1.1.12.1 21-Jun-2006  yamt sync with head.
 1.1.4.3 11-Dec-2005  christos Sync with head.
 1.1.4.2 17-Jan-2005  skrll Sync with HEAD.
 1.1.4.1 22-Dec-2004  skrll file files.ep93xx was added on branch ktrace-lwp on 2005-01-17 19:29:12 +0000
 1.2.84.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.2.82.1 04-May-2009  yamt sync with head.
 1.2.80.1 04-Jun-2008  yamt sync with head
 1.2.78.1 02-Jun-2008  mjf Sync with HEAD.
 1.3.12.1 13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.6.1 03-Mar-2009  skrll Sync with HEAD.

RSS XML Feed