History log of /netbsd-current/sys/dev/pci/twa.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.61 10-Dec-2021 andvar

s/occured/occurred/ in comments, log messages and man pages.


Revision tags: thorpej-i2c-spi-conf2-base
# 1.60 07-Aug-2021 thorpej

Merge thorpej-cfargs2.


Revision tags: thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base
# 1.59 24-Apr-2021 thorpej

branches: 1.59.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?).


Revision tags: thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.58 10-Nov-2019 chs

branches: 1.58.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.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.57 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.56 03-Sep-2018 riastradh

Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004
# 1.55 27-Sep-2016 pgoyette

branches: 1.55.6; 1.55.14; 1.55.16;
Add a missing ')' in the call to bswap64().

Should fix compile error of twa module for sparc and sparc64


# 1.54 27-Sep-2016 pgoyette

Modularize the ld driver and all of its attachments. Ensure that all
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907
# 1.53 07-Jul-2016 msaitoh

branches: 1.53.2;
KNF. Remove extra spaces. No functional change.


Revision tags: nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base
# 1.52 27-Sep-2014 christos

branches: 1.52.2;
fix size in memset() parameter. Thanks max.


# 1.51 21-Sep-2014 christos

fix memset size inconsistency


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.50 25-Jul-2014 dholland

branches: 1.50.2;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base
# 1.49 29-Mar-2014 christos

branches: 1.49.2;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.48 16-Mar-2014 dholland

Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.47 13-Mar-2014 hannken

Add __diagused.


# 1.46 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.45 17-Oct-2013 christos

- remove unused variables
- move debugging code inside debugging sections


# 1.44 14-Sep-2013 joerg

Comment out twa_error_table, but keep it around for documentation
purposes.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.43 02-Nov-2012 chs

branches: 1.43.2;
fix autoconf output (don't print from the match routine).


Revision tags: yamt-pagecache-base6
# 1.42 28-Jul-2012 matt

branches: 1.42.2;
Make this compile with i386/conf/ALL


# 1.41 27-Jul-2012 jakllsch

Convert twa(4) to device_t (CFATTACH_DECL_NEW).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.40 30-Jan-2012 drochner

branches: 1.40.2;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


# 1.39 27-Jan-2012 para

extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.38 31-Aug-2011 plunky

branches: 1.38.2; 1.38.6;
NULL does not need a cast


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.37 24-May-2011 joerg

Explicitly get rid of constness.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.36 22-Nov-2010 dholland

branches: 1.36.2;
Extend the workaround for the 3ware 9650 full-queue bug to a full-fledged
quirk, and use it for the 9690 as well where it's also needed. Patch by me,
problem hunted down by Jiri Novotny and Zdenek Slavet and reported in
PR 44002.


# 1.35 14-Nov-2010 uebayasi

Avoid pointless use of a sysctl definition, CTL_NAMES. Clean up whitespace.


# 1.34 13-Nov-2010 uebayasi

Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.33 18-Aug-2009 drochner

branches: 1.33.4;
put some strange text within an "#if 0"'d section into a comment
additionally to appease picky parsers


# 1.32 31-Jul-2009 bouyer

Disable completely bogus DIAGNOSTIC check.


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.31 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.30 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.29 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base simonb-wapbl-nbase simonb-wapbl-base mjf-devfs2-base
# 1.28 27-Jul-2008 joerg

branches: 1.28.4; 1.28.8; 1.28.10; 1.28.12;
Unbreak twa after the last two commits.


# 1.27 25-Jun-2008 gmcgarry

branches: 1.27.2;
Revert unintentional whitespace changes. From simonb.


# 1.26 24-Jun-2008 gmcgarry

Ragge says that 6.5.4 clause 2 says:

"Unless the type name specifies a void type, the type name shall specify
qualified or unqualified scalar type and the operand shall have scalar
type."

Therefore, don't cast to a union.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 wrstuden-revivesa-base
# 1.25 08-Jun-2008 joerg

branches: 1.25.2;
Mention 64bit support once during boot and not every time the controller
is reset.


# 1.24 08-Jun-2008 tsutsui

Replace device_lookup() with device_lookup_private() on getting softc
for future device_t/softc spilt.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.23 10-May-2008 joerg

Remove #if 0'd code for flashing firmware. It was never active and even
the FreeBSD version of the driver removed it.


# 1.22 08-May-2008 joerg

Add support for 3ware 9650 and 9690 based on patches contributed by
Wasabi Systems.

Fix bus_dma usage to fix write operations in the light of bounce buffers.
Use the 64bit bus_dma tag for 9550+ to avoid bouncing buffers.


# 1.21 07-May-2008 joerg

branches: 1.21.2;
First part of twa(4) improvements:
- more/better diagnostic messages
- dynamically allocate units in preparation for 9650+ support
- better distribute queue slots over disks according to size
- drain large request queue on 9550
- keep track of resets, will be needed for 9650.

This changes have been contributed by Wasabi Systems.


# 1.20 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.19 10-Apr-2008 cegger

branches: 1.19.2; 1.19.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.18 19-Oct-2007 ad

branches: 1.18.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.17 04-Mar-2007 christos

branches: 1.17.2; 1.17.14; 1.17.16; 1.17.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.16 16-Nov-2006 christos

branches: 1.16.2; 1.16.4; 1.16.12;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.15 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.14 11-Oct-2006 jmcneill

Size is the third argument to memset, not the second.


# 1.13 23-Sep-2006 manu

Tweak the twa(4) driver so that 3ware command line utility works with it.
This includes:
- fixing various structure definitions so that the ioctl parameter match
- adding a hw.twa*.driver_version sysctl
- do not refuse multiple device openings, as the management tool will do it.
I'm not sure we are safe. FreeBSD allows multiple openings, and use the
open flag only when an attempt to detach the device is done.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 rpaulo-netinet-merge-pcb-base yamt-pdpolicy-base8
# 1.12 03-Sep-2006 christos

branches: 1.12.2; 1.12.4; 1.12.6;
- add missing initializer
- inline comes first


# 1.11 26-Aug-2006 christos

PR/34292: Aaron Hodgen: twa driver incorrectly reports drive size/description


# 1.10 17-Aug-2006 christos

Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7
# 1.9 30-Jul-2006 bouyer

branches: 1.9.2;
Add some missing splvm()/splx() around uvm_km_* I noticed.


# 1.8 29-Jul-2006 wrstuden

Updated driver, contributed by Jordan Rhody of Wasabi Systems.

Main fix is to improve reliability under heavy load and frequent
status monitoring.


# 1.7 11-Jul-2006 simonb

Use c99 uintN_t.


# 1.6 11-Jul-2006 simonb

Sprinkle some KNF. Still a bit more needed...


# 1.5 10-Jul-2006 simonb

Remove some incorrect licencing goop.


# 1.4 10-Jul-2006 simonb

Update for timecounters (s/time.tv_sec/time_second/).


Revision tags: yamt-pdpolicy-base6 chap-midi-base chap-midi-nbase gdamore-uart-base simonb-timecounters-base
# 1.3 25-May-2006 wrstuden

branches: 1.3.2; 1.3.4; 1.3.6; 1.3.8; 1.3.10;
Add $NetBSD: ids, which work better than $netbsd: ones.


# 1.2 25-May-2006 wrstuden

Style changes from simonb at wasabisystems dot com:

Use config_stdsubmatch() instead of our own submatch function.
Use "__inline" in header files and "inline" in .c files.
Make some local function static.


# 1.1 24-May-2006 wrstuden

3ware 9000 driver, contributed by Wasabi Systems and written
by Jordan Rhody (based on the FreeBSD driver).

Contributed in NetBSD PR 33364.


# 1.60 07-Aug-2021 thorpej

Merge thorpej-cfargs2.


Revision tags: thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base
# 1.59 24-Apr-2021 thorpej

branches: 1.59.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?).


Revision tags: thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.58 10-Nov-2019 chs

branches: 1.58.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.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.57 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.56 03-Sep-2018 riastradh

Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004
# 1.55 27-Sep-2016 pgoyette

branches: 1.55.6; 1.55.14; 1.55.16;
Add a missing ')' in the call to bswap64().

Should fix compile error of twa module for sparc and sparc64


# 1.54 27-Sep-2016 pgoyette

Modularize the ld driver and all of its attachments. Ensure that all
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907
# 1.53 07-Jul-2016 msaitoh

branches: 1.53.2;
KNF. Remove extra spaces. No functional change.


Revision tags: nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base
# 1.52 27-Sep-2014 christos

branches: 1.52.2;
fix size in memset() parameter. Thanks max.


# 1.51 21-Sep-2014 christos

fix memset size inconsistency


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.50 25-Jul-2014 dholland

branches: 1.50.2;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base
# 1.49 29-Mar-2014 christos

branches: 1.49.2;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.48 16-Mar-2014 dholland

Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.47 13-Mar-2014 hannken

Add __diagused.


# 1.46 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.45 17-Oct-2013 christos

- remove unused variables
- move debugging code inside debugging sections


# 1.44 14-Sep-2013 joerg

Comment out twa_error_table, but keep it around for documentation
purposes.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.43 02-Nov-2012 chs

branches: 1.43.2;
fix autoconf output (don't print from the match routine).


Revision tags: yamt-pagecache-base6
# 1.42 28-Jul-2012 matt

branches: 1.42.2;
Make this compile with i386/conf/ALL


# 1.41 27-Jul-2012 jakllsch

Convert twa(4) to device_t (CFATTACH_DECL_NEW).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.40 30-Jan-2012 drochner

branches: 1.40.2;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


# 1.39 27-Jan-2012 para

extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.38 31-Aug-2011 plunky

branches: 1.38.2; 1.38.6;
NULL does not need a cast


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.37 24-May-2011 joerg

Explicitly get rid of constness.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.36 22-Nov-2010 dholland

branches: 1.36.2;
Extend the workaround for the 3ware 9650 full-queue bug to a full-fledged
quirk, and use it for the 9690 as well where it's also needed. Patch by me,
problem hunted down by Jiri Novotny and Zdenek Slavet and reported in
PR 44002.


# 1.35 14-Nov-2010 uebayasi

Avoid pointless use of a sysctl definition, CTL_NAMES. Clean up whitespace.


# 1.34 13-Nov-2010 uebayasi

Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.33 18-Aug-2009 drochner

branches: 1.33.4;
put some strange text within an "#if 0"'d section into a comment
additionally to appease picky parsers


# 1.32 31-Jul-2009 bouyer

Disable completely bogus DIAGNOSTIC check.


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.31 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.30 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.29 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base simonb-wapbl-nbase simonb-wapbl-base mjf-devfs2-base
# 1.28 27-Jul-2008 joerg

branches: 1.28.4; 1.28.8; 1.28.10; 1.28.12;
Unbreak twa after the last two commits.


# 1.27 25-Jun-2008 gmcgarry

branches: 1.27.2;
Revert unintentional whitespace changes. From simonb.


# 1.26 24-Jun-2008 gmcgarry

Ragge says that 6.5.4 clause 2 says:

"Unless the type name specifies a void type, the type name shall specify
qualified or unqualified scalar type and the operand shall have scalar
type."

Therefore, don't cast to a union.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 wrstuden-revivesa-base
# 1.25 08-Jun-2008 joerg

branches: 1.25.2;
Mention 64bit support once during boot and not every time the controller
is reset.


# 1.24 08-Jun-2008 tsutsui

Replace device_lookup() with device_lookup_private() on getting softc
for future device_t/softc spilt.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.23 10-May-2008 joerg

Remove #if 0'd code for flashing firmware. It was never active and even
the FreeBSD version of the driver removed it.


# 1.22 08-May-2008 joerg

Add support for 3ware 9650 and 9690 based on patches contributed by
Wasabi Systems.

Fix bus_dma usage to fix write operations in the light of bounce buffers.
Use the 64bit bus_dma tag for 9550+ to avoid bouncing buffers.


# 1.21 07-May-2008 joerg

branches: 1.21.2;
First part of twa(4) improvements:
- more/better diagnostic messages
- dynamically allocate units in preparation for 9650+ support
- better distribute queue slots over disks according to size
- drain large request queue on 9550
- keep track of resets, will be needed for 9650.

This changes have been contributed by Wasabi Systems.


# 1.20 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.19 10-Apr-2008 cegger

branches: 1.19.2; 1.19.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.18 19-Oct-2007 ad

branches: 1.18.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.17 04-Mar-2007 christos

branches: 1.17.2; 1.17.14; 1.17.16; 1.17.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.16 16-Nov-2006 christos

branches: 1.16.2; 1.16.4; 1.16.12;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.15 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.14 11-Oct-2006 jmcneill

Size is the third argument to memset, not the second.


# 1.13 23-Sep-2006 manu

Tweak the twa(4) driver so that 3ware command line utility works with it.
This includes:
- fixing various structure definitions so that the ioctl parameter match
- adding a hw.twa*.driver_version sysctl
- do not refuse multiple device openings, as the management tool will do it.
I'm not sure we are safe. FreeBSD allows multiple openings, and use the
open flag only when an attempt to detach the device is done.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 rpaulo-netinet-merge-pcb-base yamt-pdpolicy-base8
# 1.12 03-Sep-2006 christos

branches: 1.12.2; 1.12.4; 1.12.6;
- add missing initializer
- inline comes first


# 1.11 26-Aug-2006 christos

PR/34292: Aaron Hodgen: twa driver incorrectly reports drive size/description


# 1.10 17-Aug-2006 christos

Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7
# 1.9 30-Jul-2006 bouyer

branches: 1.9.2;
Add some missing splvm()/splx() around uvm_km_* I noticed.


# 1.8 29-Jul-2006 wrstuden

Updated driver, contributed by Jordan Rhody of Wasabi Systems.

Main fix is to improve reliability under heavy load and frequent
status monitoring.


# 1.7 11-Jul-2006 simonb

Use c99 uintN_t.


# 1.6 11-Jul-2006 simonb

Sprinkle some KNF. Still a bit more needed...


# 1.5 10-Jul-2006 simonb

Remove some incorrect licencing goop.


# 1.4 10-Jul-2006 simonb

Update for timecounters (s/time.tv_sec/time_second/).


Revision tags: yamt-pdpolicy-base6 chap-midi-base chap-midi-nbase gdamore-uart-base simonb-timecounters-base
# 1.3 25-May-2006 wrstuden

branches: 1.3.2; 1.3.4; 1.3.6; 1.3.8; 1.3.10;
Add $NetBSD: ids, which work better than $netbsd: ones.


# 1.2 25-May-2006 wrstuden

Style changes from simonb at wasabisystems dot com:

Use config_stdsubmatch() instead of our own submatch function.
Use "__inline" in header files and "inline" in .c files.
Make some local function static.


# 1.1 24-May-2006 wrstuden

3ware 9000 driver, contributed by Wasabi Systems and written
by Jordan Rhody (based on the FreeBSD driver).

Contributed in NetBSD PR 33364.


# 1.59 24-Apr-2021 thorpej

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?).


Revision tags: thorpej-cfargs-base thorpej-futex-base bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base phil-wifi-20191119
# 1.58 10-Nov-2019 chs

branches: 1.58.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.


Revision tags: netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.57 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.56 03-Sep-2018 riastradh

Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)


Revision tags: netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004
# 1.55 27-Sep-2016 pgoyette

branches: 1.55.6; 1.55.14; 1.55.16;
Add a missing ')' in the call to bswap64().

Should fix compile error of twa module for sparc and sparc64


# 1.54 27-Sep-2016 pgoyette

Modularize the ld driver and all of its attachments. Ensure that all
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907
# 1.53 07-Jul-2016 msaitoh

branches: 1.53.2;
KNF. Remove extra spaces. No functional change.


Revision tags: nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base
# 1.52 27-Sep-2014 christos

branches: 1.52.2;
fix size in memset() parameter. Thanks max.


# 1.51 21-Sep-2014 christos

fix memset size inconsistency


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.50 25-Jul-2014 dholland

branches: 1.50.2;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base
# 1.49 29-Mar-2014 christos

branches: 1.49.2;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.48 16-Mar-2014 dholland

Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.47 13-Mar-2014 hannken

Add __diagused.


# 1.46 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.45 17-Oct-2013 christos

- remove unused variables
- move debugging code inside debugging sections


# 1.44 14-Sep-2013 joerg

Comment out twa_error_table, but keep it around for documentation
purposes.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.43 02-Nov-2012 chs

branches: 1.43.2;
fix autoconf output (don't print from the match routine).


Revision tags: yamt-pagecache-base6
# 1.42 28-Jul-2012 matt

branches: 1.42.2;
Make this compile with i386/conf/ALL


# 1.41 27-Jul-2012 jakllsch

Convert twa(4) to device_t (CFATTACH_DECL_NEW).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.40 30-Jan-2012 drochner

branches: 1.40.2;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


# 1.39 27-Jan-2012 para

extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.38 31-Aug-2011 plunky

branches: 1.38.2; 1.38.6;
NULL does not need a cast


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.37 24-May-2011 joerg

Explicitly get rid of constness.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.36 22-Nov-2010 dholland

branches: 1.36.2;
Extend the workaround for the 3ware 9650 full-queue bug to a full-fledged
quirk, and use it for the 9690 as well where it's also needed. Patch by me,
problem hunted down by Jiri Novotny and Zdenek Slavet and reported in
PR 44002.


# 1.35 14-Nov-2010 uebayasi

Avoid pointless use of a sysctl definition, CTL_NAMES. Clean up whitespace.


# 1.34 13-Nov-2010 uebayasi

Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.33 18-Aug-2009 drochner

branches: 1.33.4;
put some strange text within an "#if 0"'d section into a comment
additionally to appease picky parsers


# 1.32 31-Jul-2009 bouyer

Disable completely bogus DIAGNOSTIC check.


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.31 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.30 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.29 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base simonb-wapbl-nbase simonb-wapbl-base mjf-devfs2-base
# 1.28 27-Jul-2008 joerg

branches: 1.28.4; 1.28.8; 1.28.10; 1.28.12;
Unbreak twa after the last two commits.


# 1.27 25-Jun-2008 gmcgarry

branches: 1.27.2;
Revert unintentional whitespace changes. From simonb.


# 1.26 24-Jun-2008 gmcgarry

Ragge says that 6.5.4 clause 2 says:

"Unless the type name specifies a void type, the type name shall specify
qualified or unqualified scalar type and the operand shall have scalar
type."

Therefore, don't cast to a union.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 wrstuden-revivesa-base
# 1.25 08-Jun-2008 joerg

branches: 1.25.2;
Mention 64bit support once during boot and not every time the controller
is reset.


# 1.24 08-Jun-2008 tsutsui

Replace device_lookup() with device_lookup_private() on getting softc
for future device_t/softc spilt.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.23 10-May-2008 joerg

Remove #if 0'd code for flashing firmware. It was never active and even
the FreeBSD version of the driver removed it.


# 1.22 08-May-2008 joerg

Add support for 3ware 9650 and 9690 based on patches contributed by
Wasabi Systems.

Fix bus_dma usage to fix write operations in the light of bounce buffers.
Use the 64bit bus_dma tag for 9550+ to avoid bouncing buffers.


# 1.21 07-May-2008 joerg

branches: 1.21.2;
First part of twa(4) improvements:
- more/better diagnostic messages
- dynamically allocate units in preparation for 9650+ support
- better distribute queue slots over disks according to size
- drain large request queue on 9550
- keep track of resets, will be needed for 9650.

This changes have been contributed by Wasabi Systems.


# 1.20 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.19 10-Apr-2008 cegger

branches: 1.19.2; 1.19.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.18 19-Oct-2007 ad

branches: 1.18.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.17 04-Mar-2007 christos

branches: 1.17.2; 1.17.14; 1.17.16; 1.17.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.16 16-Nov-2006 christos

branches: 1.16.2; 1.16.4; 1.16.12;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.15 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.14 11-Oct-2006 jmcneill

Size is the third argument to memset, not the second.


# 1.13 23-Sep-2006 manu

Tweak the twa(4) driver so that 3ware command line utility works with it.
This includes:
- fixing various structure definitions so that the ioctl parameter match
- adding a hw.twa*.driver_version sysctl
- do not refuse multiple device openings, as the management tool will do it.
I'm not sure we are safe. FreeBSD allows multiple openings, and use the
open flag only when an attempt to detach the device is done.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 rpaulo-netinet-merge-pcb-base yamt-pdpolicy-base8
# 1.12 03-Sep-2006 christos

branches: 1.12.2; 1.12.4; 1.12.6;
- add missing initializer
- inline comes first


# 1.11 26-Aug-2006 christos

PR/34292: Aaron Hodgen: twa driver incorrectly reports drive size/description


# 1.10 17-Aug-2006 christos

Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7
# 1.9 30-Jul-2006 bouyer

branches: 1.9.2;
Add some missing splvm()/splx() around uvm_km_* I noticed.


# 1.8 29-Jul-2006 wrstuden

Updated driver, contributed by Jordan Rhody of Wasabi Systems.

Main fix is to improve reliability under heavy load and frequent
status monitoring.


# 1.7 11-Jul-2006 simonb

Use c99 uintN_t.


# 1.6 11-Jul-2006 simonb

Sprinkle some KNF. Still a bit more needed...


# 1.5 10-Jul-2006 simonb

Remove some incorrect licencing goop.


# 1.4 10-Jul-2006 simonb

Update for timecounters (s/time.tv_sec/time_second/).


Revision tags: yamt-pdpolicy-base6 chap-midi-base chap-midi-nbase gdamore-uart-base simonb-timecounters-base
# 1.3 25-May-2006 wrstuden

branches: 1.3.2; 1.3.4; 1.3.6; 1.3.8; 1.3.10;
Add $NetBSD: ids, which work better than $netbsd: ones.


# 1.2 25-May-2006 wrstuden

Style changes from simonb at wasabisystems dot com:

Use config_stdsubmatch() instead of our own submatch function.
Use "__inline" in header files and "inline" in .c files.
Make some local function static.


# 1.1 24-May-2006 wrstuden

3ware 9000 driver, contributed by Wasabi Systems and written
by Jordan Rhody (based on the FreeBSD driver).

Contributed in NetBSD PR 33364.


# 1.58 10-Nov-2019 chs

in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.


Revision tags: netbsd-9-base phil-wifi-20190609 isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.57 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.56 03-Sep-2018 riastradh

Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)


Revision tags: netbsd-8-1-RELEASE netbsd-8-1-RC1 jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004
# 1.55 27-Sep-2016 pgoyette

branches: 1.55.6; 1.55.14; 1.55.16;
Add a missing ')' in the call to bswap64().

Should fix compile error of twa module for sparc and sparc64


# 1.54 27-Sep-2016 pgoyette

Modularize the ld driver and all of its attachments. Ensure that all
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907
# 1.53 07-Jul-2016 msaitoh

branches: 1.53.2;
KNF. Remove extra spaces. No functional change.


Revision tags: nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base
# 1.52 27-Sep-2014 christos

branches: 1.52.2;
fix size in memset() parameter. Thanks max.


# 1.51 21-Sep-2014 christos

fix memset size inconsistency


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.50 25-Jul-2014 dholland

branches: 1.50.2;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base
# 1.49 29-Mar-2014 christos

branches: 1.49.2;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.48 16-Mar-2014 dholland

Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.47 13-Mar-2014 hannken

Add __diagused.


# 1.46 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.45 17-Oct-2013 christos

- remove unused variables
- move debugging code inside debugging sections


# 1.44 14-Sep-2013 joerg

Comment out twa_error_table, but keep it around for documentation
purposes.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.43 02-Nov-2012 chs

branches: 1.43.2;
fix autoconf output (don't print from the match routine).


Revision tags: yamt-pagecache-base6
# 1.42 28-Jul-2012 matt

branches: 1.42.2;
Make this compile with i386/conf/ALL


# 1.41 27-Jul-2012 jakllsch

Convert twa(4) to device_t (CFATTACH_DECL_NEW).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.40 30-Jan-2012 drochner

branches: 1.40.2;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


# 1.39 27-Jan-2012 para

extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.38 31-Aug-2011 plunky

branches: 1.38.2; 1.38.6;
NULL does not need a cast


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.37 24-May-2011 joerg

Explicitly get rid of constness.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.36 22-Nov-2010 dholland

branches: 1.36.2;
Extend the workaround for the 3ware 9650 full-queue bug to a full-fledged
quirk, and use it for the 9690 as well where it's also needed. Patch by me,
problem hunted down by Jiri Novotny and Zdenek Slavet and reported in
PR 44002.


# 1.35 14-Nov-2010 uebayasi

Avoid pointless use of a sysctl definition, CTL_NAMES. Clean up whitespace.


# 1.34 13-Nov-2010 uebayasi

Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.33 18-Aug-2009 drochner

branches: 1.33.4;
put some strange text within an "#if 0"'d section into a comment
additionally to appease picky parsers


# 1.32 31-Jul-2009 bouyer

Disable completely bogus DIAGNOSTIC check.


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.31 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.30 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.29 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base simonb-wapbl-nbase simonb-wapbl-base mjf-devfs2-base
# 1.28 27-Jul-2008 joerg

branches: 1.28.4; 1.28.8; 1.28.10; 1.28.12;
Unbreak twa after the last two commits.


# 1.27 25-Jun-2008 gmcgarry

branches: 1.27.2;
Revert unintentional whitespace changes. From simonb.


# 1.26 24-Jun-2008 gmcgarry

Ragge says that 6.5.4 clause 2 says:

"Unless the type name specifies a void type, the type name shall specify
qualified or unqualified scalar type and the operand shall have scalar
type."

Therefore, don't cast to a union.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 wrstuden-revivesa-base
# 1.25 08-Jun-2008 joerg

branches: 1.25.2;
Mention 64bit support once during boot and not every time the controller
is reset.


# 1.24 08-Jun-2008 tsutsui

Replace device_lookup() with device_lookup_private() on getting softc
for future device_t/softc spilt.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.23 10-May-2008 joerg

Remove #if 0'd code for flashing firmware. It was never active and even
the FreeBSD version of the driver removed it.


# 1.22 08-May-2008 joerg

Add support for 3ware 9650 and 9690 based on patches contributed by
Wasabi Systems.

Fix bus_dma usage to fix write operations in the light of bounce buffers.
Use the 64bit bus_dma tag for 9550+ to avoid bouncing buffers.


# 1.21 07-May-2008 joerg

branches: 1.21.2;
First part of twa(4) improvements:
- more/better diagnostic messages
- dynamically allocate units in preparation for 9650+ support
- better distribute queue slots over disks according to size
- drain large request queue on 9550
- keep track of resets, will be needed for 9650.

This changes have been contributed by Wasabi Systems.


# 1.20 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.19 10-Apr-2008 cegger

branches: 1.19.2; 1.19.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.18 19-Oct-2007 ad

branches: 1.18.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.17 04-Mar-2007 christos

branches: 1.17.2; 1.17.14; 1.17.16; 1.17.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.16 16-Nov-2006 christos

branches: 1.16.2; 1.16.4; 1.16.12;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.15 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.14 11-Oct-2006 jmcneill

Size is the third argument to memset, not the second.


# 1.13 23-Sep-2006 manu

Tweak the twa(4) driver so that 3ware command line utility works with it.
This includes:
- fixing various structure definitions so that the ioctl parameter match
- adding a hw.twa*.driver_version sysctl
- do not refuse multiple device openings, as the management tool will do it.
I'm not sure we are safe. FreeBSD allows multiple openings, and use the
open flag only when an attempt to detach the device is done.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 rpaulo-netinet-merge-pcb-base yamt-pdpolicy-base8
# 1.12 03-Sep-2006 christos

branches: 1.12.2; 1.12.4; 1.12.6;
- add missing initializer
- inline comes first


# 1.11 26-Aug-2006 christos

PR/34292: Aaron Hodgen: twa driver incorrectly reports drive size/description


# 1.10 17-Aug-2006 christos

Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7
# 1.9 30-Jul-2006 bouyer

branches: 1.9.2;
Add some missing splvm()/splx() around uvm_km_* I noticed.


# 1.8 29-Jul-2006 wrstuden

Updated driver, contributed by Jordan Rhody of Wasabi Systems.

Main fix is to improve reliability under heavy load and frequent
status monitoring.


# 1.7 11-Jul-2006 simonb

Use c99 uintN_t.


# 1.6 11-Jul-2006 simonb

Sprinkle some KNF. Still a bit more needed...


# 1.5 10-Jul-2006 simonb

Remove some incorrect licencing goop.


# 1.4 10-Jul-2006 simonb

Update for timecounters (s/time.tv_sec/time_second/).


Revision tags: yamt-pdpolicy-base6 chap-midi-base chap-midi-nbase gdamore-uart-base simonb-timecounters-base
# 1.3 25-May-2006 wrstuden

branches: 1.3.2; 1.3.4; 1.3.6; 1.3.8; 1.3.10;
Add $NetBSD: ids, which work better than $netbsd: ones.


# 1.2 25-May-2006 wrstuden

Style changes from simonb at wasabisystems dot com:

Use config_stdsubmatch() instead of our own submatch function.
Use "__inline" in header files and "inline" in .c files.
Make some local function static.


# 1.1 24-May-2006 wrstuden

3ware 9000 driver, contributed by Wasabi Systems and written
by Jordan Rhody (based on the FreeBSD driver).

Contributed in NetBSD PR 33364.


Revision tags: isaki-audio2-base pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.57 09-Dec-2018 jdolecek

use pci_intr_establish_xname() everywhere


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906
# 1.56 03-Sep-2018 riastradh

Rename min/max -> uimin/uimax for better honesty.

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

HOWEVER! Some subsystems have

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

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

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

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

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

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

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)


Revision tags: jdolecek-ncqfixes-base pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202 matt-nb8-mediatek-base nick-nhusb-base-20170825 perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320 nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107 nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004
# 1.55 27-Sep-2016 pgoyette

branches: 1.55.6; 1.55.14;
Add a missing ')' in the call to bswap64().

Should fix compile error of twa module for sparc and sparc64


# 1.54 27-Sep-2016 pgoyette

Modularize the ld driver and all of its attachments. Ensure that all
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907
# 1.53 07-Jul-2016 msaitoh

branches: 1.53.2;
KNF. Remove extra spaces. No functional change.


Revision tags: nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base
# 1.52 27-Sep-2014 christos

branches: 1.52.2;
fix size in memset() parameter. Thanks max.


# 1.51 21-Sep-2014 christos

fix memset size inconsistency


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.50 25-Jul-2014 dholland

branches: 1.50.2;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base
# 1.49 29-Mar-2014 christos

branches: 1.49.2;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.48 16-Mar-2014 dholland

Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.47 13-Mar-2014 hannken

Add __diagused.


# 1.46 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.45 17-Oct-2013 christos

- remove unused variables
- move debugging code inside debugging sections


# 1.44 14-Sep-2013 joerg

Comment out twa_error_table, but keep it around for documentation
purposes.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.43 02-Nov-2012 chs

branches: 1.43.2;
fix autoconf output (don't print from the match routine).


Revision tags: yamt-pagecache-base6
# 1.42 28-Jul-2012 matt

branches: 1.42.2;
Make this compile with i386/conf/ALL


# 1.41 27-Jul-2012 jakllsch

Convert twa(4) to device_t (CFATTACH_DECL_NEW).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.40 30-Jan-2012 drochner

branches: 1.40.2;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


# 1.39 27-Jan-2012 para

extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.38 31-Aug-2011 plunky

branches: 1.38.2; 1.38.6;
NULL does not need a cast


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.37 24-May-2011 joerg

Explicitly get rid of constness.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.36 22-Nov-2010 dholland

branches: 1.36.2;
Extend the workaround for the 3ware 9650 full-queue bug to a full-fledged
quirk, and use it for the 9690 as well where it's also needed. Patch by me,
problem hunted down by Jiri Novotny and Zdenek Slavet and reported in
PR 44002.


# 1.35 14-Nov-2010 uebayasi

Avoid pointless use of a sysctl definition, CTL_NAMES. Clean up whitespace.


# 1.34 13-Nov-2010 uebayasi

Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.33 18-Aug-2009 drochner

branches: 1.33.4;
put some strange text within an "#if 0"'d section into a comment
additionally to appease picky parsers


# 1.32 31-Jul-2009 bouyer

Disable completely bogus DIAGNOSTIC check.


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.31 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.30 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.29 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base simonb-wapbl-nbase simonb-wapbl-base mjf-devfs2-base
# 1.28 27-Jul-2008 joerg

branches: 1.28.4; 1.28.8; 1.28.10; 1.28.12;
Unbreak twa after the last two commits.


# 1.27 25-Jun-2008 gmcgarry

branches: 1.27.2;
Revert unintentional whitespace changes. From simonb.


# 1.26 24-Jun-2008 gmcgarry

Ragge says that 6.5.4 clause 2 says:

"Unless the type name specifies a void type, the type name shall specify
qualified or unqualified scalar type and the operand shall have scalar
type."

Therefore, don't cast to a union.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 wrstuden-revivesa-base
# 1.25 08-Jun-2008 joerg

branches: 1.25.2;
Mention 64bit support once during boot and not every time the controller
is reset.


# 1.24 08-Jun-2008 tsutsui

Replace device_lookup() with device_lookup_private() on getting softc
for future device_t/softc spilt.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.23 10-May-2008 joerg

Remove #if 0'd code for flashing firmware. It was never active and even
the FreeBSD version of the driver removed it.


# 1.22 08-May-2008 joerg

Add support for 3ware 9650 and 9690 based on patches contributed by
Wasabi Systems.

Fix bus_dma usage to fix write operations in the light of bounce buffers.
Use the 64bit bus_dma tag for 9550+ to avoid bouncing buffers.


# 1.21 07-May-2008 joerg

branches: 1.21.2;
First part of twa(4) improvements:
- more/better diagnostic messages
- dynamically allocate units in preparation for 9650+ support
- better distribute queue slots over disks according to size
- drain large request queue on 9550
- keep track of resets, will be needed for 9650.

This changes have been contributed by Wasabi Systems.


# 1.20 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.19 10-Apr-2008 cegger

branches: 1.19.2; 1.19.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.18 19-Oct-2007 ad

branches: 1.18.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.17 04-Mar-2007 christos

branches: 1.17.2; 1.17.14; 1.17.16; 1.17.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.16 16-Nov-2006 christos

branches: 1.16.2; 1.16.4; 1.16.12;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.15 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.14 11-Oct-2006 jmcneill

Size is the third argument to memset, not the second.


# 1.13 23-Sep-2006 manu

Tweak the twa(4) driver so that 3ware command line utility works with it.
This includes:
- fixing various structure definitions so that the ioctl parameter match
- adding a hw.twa*.driver_version sysctl
- do not refuse multiple device openings, as the management tool will do it.
I'm not sure we are safe. FreeBSD allows multiple openings, and use the
open flag only when an attempt to detach the device is done.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 rpaulo-netinet-merge-pcb-base yamt-pdpolicy-base8
# 1.12 03-Sep-2006 christos

branches: 1.12.2; 1.12.4; 1.12.6;
- add missing initializer
- inline comes first


# 1.11 26-Aug-2006 christos

PR/34292: Aaron Hodgen: twa driver incorrectly reports drive size/description


# 1.10 17-Aug-2006 christos

Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7
# 1.9 30-Jul-2006 bouyer

branches: 1.9.2;
Add some missing splvm()/splx() around uvm_km_* I noticed.


# 1.8 29-Jul-2006 wrstuden

Updated driver, contributed by Jordan Rhody of Wasabi Systems.

Main fix is to improve reliability under heavy load and frequent
status monitoring.


# 1.7 11-Jul-2006 simonb

Use c99 uintN_t.


# 1.6 11-Jul-2006 simonb

Sprinkle some KNF. Still a bit more needed...


# 1.5 10-Jul-2006 simonb

Remove some incorrect licencing goop.


# 1.4 10-Jul-2006 simonb

Update for timecounters (s/time.tv_sec/time_second/).


Revision tags: yamt-pdpolicy-base6 chap-midi-base chap-midi-nbase gdamore-uart-base simonb-timecounters-base
# 1.3 25-May-2006 wrstuden

branches: 1.3.2; 1.3.4; 1.3.6; 1.3.8; 1.3.10;
Add $NetBSD: ids, which work better than $netbsd: ones.


# 1.2 25-May-2006 wrstuden

Style changes from simonb at wasabisystems dot com:

Use config_stdsubmatch() instead of our own submatch function.
Use "__inline" in header files and "inline" in .c files.
Make some local function static.


# 1.1 24-May-2006 wrstuden

3ware 9000 driver, contributed by Wasabi Systems and written
by Jordan Rhody (based on the FreeBSD driver).

Contributed in NetBSD PR 33364.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004
# 1.55 27-Sep-2016 pgoyette

Add a missing ')' in the call to bswap64().

Should fix compile error of twa module for sparc and sparc64


# 1.54 27-Sep-2016 pgoyette

Modularize the ld driver and all of its attachments. Ensure that all
parents are capable of rescan (or otherwise provide a means of attaching
children post-initialization).


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907
# 1.53 07-Jul-2016 msaitoh

branches: 1.53.2;
KNF. Remove extra spaces. No functional change.


Revision tags: nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319 nick-nhusb-base-20151226 nick-nhusb-base-20150921 nick-nhusb-base-20150606 nick-nhusb-base-20150406 nick-nhusb-base
# 1.52 27-Sep-2014 christos

branches: 1.52.2;
fix size in memset() parameter. Thanks max.


# 1.51 21-Sep-2014 christos

fix memset size inconsistency


Revision tags: netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.50 25-Jul-2014 dholland

branches: 1.50.2;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.


Revision tags: yamt-pagecache-base9 riastradh-xf86-video-intel-2-7-1-pre-2-21-15 rmind-smpnet-nbase rmind-smpnet-base
# 1.49 29-Mar-2014 christos

branches: 1.49.2;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.


Revision tags: riastradh-drm2-base3
# 1.48 16-Mar-2014 dholland

Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.


# 1.47 13-Mar-2014 hannken

Add __diagused.


# 1.46 25-Feb-2014 pooka

Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.


# 1.45 17-Oct-2013 christos

- remove unused variables
- move debugging code inside debugging sections


# 1.44 14-Sep-2013 joerg

Comment out twa_error_table, but keep it around for documentation
purposes.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
# 1.43 02-Nov-2012 chs

branches: 1.43.2;
fix autoconf output (don't print from the match routine).


Revision tags: yamt-pagecache-base6
# 1.42 28-Jul-2012 matt

branches: 1.42.2;
Make this compile with i386/conf/ALL


# 1.41 27-Jul-2012 jakllsch

Convert twa(4) to device_t (CFATTACH_DECL_NEW).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-base2 netbsd-6-base
# 1.40 30-Jan-2012 drochner

branches: 1.40.2;
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}
where it looks straightforward, and pci_aprint_devinfo_fancy in a few
others where drivers want to supply their own device names instead
of the pcidevs generated one. More complicated cases, where names
are composed at runtime, are left alone for now. It certainly makes
sense to simplify the drivers here rather than inventing a catch-all API.
This should serve as as example for new drivers, and also ensure
consistent output in the AB_QUIET ("boot -q") case. Also, it avoids
excessive stack usage where drivers attach child devices because the
buffer for the device name is not kept on the local stack anymore.


# 1.39 27-Jan-2012 para

extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged


Revision tags: jmcneill-usbmp-pre-base2 jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.38 31-Aug-2011 plunky

branches: 1.38.2; 1.38.6;
NULL does not need a cast


Revision tags: rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.37 24-May-2011 joerg

Explicitly get rid of constness.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base jruoho-x86intr-base matt-mips64-premerge-20101231
# 1.36 22-Nov-2010 dholland

branches: 1.36.2;
Extend the workaround for the 3ware 9650 full-queue bug to a full-fledged
quirk, and use it for the 9690 as well where it's also needed. Patch by me,
problem hunted down by Jiri Novotny and Zdenek Slavet and reported in
PR 44002.


# 1.35 14-Nov-2010 uebayasi

Avoid pointless use of a sysctl definition, CTL_NAMES. Clean up whitespace.


# 1.34 13-Nov-2010 uebayasi

Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3 yamt-nfs-mp-base11 uebayasi-xip-base2 yamt-nfs-mp-base10 uebayasi-xip-base1 yamt-nfs-mp-base9 uebayasi-xip-base matt-premerge-20091211 yamt-nfs-mp-base8 yamt-nfs-mp-base7 jym-xensuspend-nbase
# 1.33 18-Aug-2009 drochner

branches: 1.33.4;
put some strange text within an "#if 0"'d section into a comment
additionally to appease picky parsers


# 1.32 31-Jul-2009 bouyer

Disable completely bogus DIAGNOSTIC check.


Revision tags: jymxensuspend-base yamt-nfs-mp-base6 yamt-nfs-mp-base5 yamt-nfs-mp-base4 jym-xensuspend-base
# 1.31 12-May-2009 cegger

use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.


# 1.30 06-May-2009 cegger

struct device * -> device_t, no functional changes intended.


# 1.29 06-May-2009 cegger

struct cfdata * -> cfdata_t, no functional changes intended.


Revision tags: matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE yamt-nfs-mp-base3 nick-hppapmap-base4 nick-hppapmap-base3 netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 nick-hppapmap-base2 netbsd-5-0-RC2 netbsd-5-0-RC1 haad-dm-base2 haad-nbase2 ad-audiomp2-base netbsd-5-base nick-hppapmap-base matt-mips64-base2 haad-dm-base1 wrstuden-revivesa-base-4 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 haad-dm-base simonb-wapbl-nbase simonb-wapbl-base mjf-devfs2-base
# 1.28 27-Jul-2008 joerg

branches: 1.28.4; 1.28.8; 1.28.10; 1.28.12;
Unbreak twa after the last two commits.


# 1.27 25-Jun-2008 gmcgarry

branches: 1.27.2;
Revert unintentional whitespace changes. From simonb.


# 1.26 24-Jun-2008 gmcgarry

Ragge says that 6.5.4 clause 2 says:

"Unless the type name specifies a void type, the type name shall specify
qualified or unqualified scalar type and the operand shall have scalar
type."

Therefore, don't cast to a union.


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 wrstuden-revivesa-base
# 1.25 08-Jun-2008 joerg

branches: 1.25.2;
Mention 64bit support once during boot and not every time the controller
is reset.


# 1.24 08-Jun-2008 tsutsui

Replace device_lookup() with device_lookup_private() on getting softc
for future device_t/softc spilt.


Revision tags: yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2
# 1.23 10-May-2008 joerg

Remove #if 0'd code for flashing firmware. It was never active and even
the FreeBSD version of the driver removed it.


# 1.22 08-May-2008 joerg

Add support for 3ware 9650 and 9690 based on patches contributed by
Wasabi Systems.

Fix bus_dma usage to fix write operations in the light of bounce buffers.
Use the 64bit bus_dma tag for 9550+ to avoid bouncing buffers.


# 1.21 07-May-2008 joerg

branches: 1.21.2;
First part of twa(4) improvements:
- more/better diagnostic messages
- dynamically allocate units in preparation for 9650+ support
- better distribute queue slots over disks according to size
- drain large request queue on 9550
- keep track of resets, will be needed for 9650.

This changes have been contributed by Wasabi Systems.


# 1.20 28-Apr-2008 martin

Remove clause 3 and 4 from TNF licenses


Revision tags: yamt-pf42-baseX yamt-nfs-mp-base yamt-pf42-base
# 1.19 10-Apr-2008 cegger

branches: 1.19.2; 1.19.4;
use aprint_*_dev and device_xname


Revision tags: ad-socklock-base1 yamt-lazymbuf-base15 yamt-lazymbuf-base14 keiichi-mipv6-nbase nick-net80211-sync-base keiichi-mipv6-base bouyer-xeni386-merge1 vmlocking2-base3 bouyer-xeni386-nbase yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 bouyer-xeni386-base yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase vmlocking2-base1 matt-armv6-nbase jmcneill-base mjf-devfs-base bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base matt-armv6-base jmcneill-pm-base hpcarm-cleanup-base reinoud-bufcleanup-base
# 1.18 19-Oct-2007 ad

branches: 1.18.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: nick-csl-alignment-base5 yamt-x86pmap-base4 yamt-x86pmap-base3 yamt-x86pmap-base2 yamt-x86pmap-base matt-mips64-base nick-csl-alignment-base yamt-idlelwp-base8 thorpej-atomic-base mjf-ufs-trans-base vmlocking-base
# 1.17 04-Mar-2007 christos

branches: 1.17.2; 1.17.14; 1.17.16; 1.17.20;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 matt-nb4-arm-base netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 wrstuden-fixsa-base ad-audiomp-base post-newlock2-merge newlock2-nbase yamt-splraiseipl-base5 yamt-splraiseipl-base4 yamt-splraiseipl-base3 newlock2-base netbsd-4-base
# 1.16 16-Nov-2006 christos

branches: 1.16.2; 1.16.4; 1.16.12;
__unused removal on arguments; approved by core.


Revision tags: yamt-splraiseipl-base2
# 1.15 12-Oct-2006 christos

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386


# 1.14 11-Oct-2006 jmcneill

Size is the third argument to memset, not the second.


# 1.13 23-Sep-2006 manu

Tweak the twa(4) driver so that 3ware command line utility works with it.
This includes:
- fixing various structure definitions so that the ioctl parameter match
- adding a hw.twa*.driver_version sysctl
- do not refuse multiple device openings, as the management tool will do it.
I'm not sure we are safe. FreeBSD allows multiple openings, and use the
open flag only when an attempt to detach the device is done.


Revision tags: yamt-splraiseipl-base yamt-pdpolicy-base9 rpaulo-netinet-merge-pcb-base yamt-pdpolicy-base8
# 1.12 03-Sep-2006 christos

branches: 1.12.2; 1.12.4; 1.12.6;
- add missing initializer
- inline comes first


# 1.11 26-Aug-2006 christos

PR/34292: Aaron Hodgen: twa driver incorrectly reports drive size/description


# 1.10 17-Aug-2006 christos

Fix all the -D*DEBUG* code that it was rotting away and did not even compile.
Mostly from Arnaud Lacombe, many thanks!


Revision tags: abandoned-netbsd-4-base yamt-pdpolicy-base7
# 1.9 30-Jul-2006 bouyer

branches: 1.9.2;
Add some missing splvm()/splx() around uvm_km_* I noticed.


# 1.8 29-Jul-2006 wrstuden

Updated driver, contributed by Jordan Rhody of Wasabi Systems.

Main fix is to improve reliability under heavy load and frequent
status monitoring.


# 1.7 11-Jul-2006 simonb

Use c99 uintN_t.


# 1.6 11-Jul-2006 simonb

Sprinkle some KNF. Still a bit more needed...


# 1.5 10-Jul-2006 simonb

Remove some incorrect licencing goop.


# 1.4 10-Jul-2006 simonb

Update for timecounters (s/time.tv_sec/time_second/).


Revision tags: yamt-pdpolicy-base6 chap-midi-base chap-midi-nbase gdamore-uart-base simonb-timecounters-base
# 1.3 25-May-2006 wrstuden

branches: 1.3.2; 1.3.4; 1.3.6; 1.3.8; 1.3.10;
Add $NetBSD: ids, which work better than $netbsd: ones.


# 1.2 25-May-2006 wrstuden

Style changes from simonb at wasabisystems dot com:

Use config_stdsubmatch() instead of our own submatch function.
Use "__inline" in header files and "inline" in .c files.
Make some local function static.


# 1.1 24-May-2006 wrstuden

3ware 9000 driver, contributed by Wasabi Systems and written
by Jordan Rhody (based on the FreeBSD driver).

Contributed in NetBSD PR 33364.