Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/twa.c
RevisionDateAuthorComments
 1.61  10-Dec-2021  andvar s/occured/occurred/ in comments, log messages and man pages.
 1.60  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 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?).
 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.
 1.57  09-Dec-2018  jdolecek use pci_intr_establish_xname() everywhere
 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!)
 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).
 1.53  07-Jul-2016  msaitoh branches: 1.53.2;
KNF. Remove extra spaces. No functional change.
 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
 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.
 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.
 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.
 1.43  02-Nov-2012  chs branches: 1.43.2;
fix autoconf output (don't print from the match routine).
 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).
 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
 1.38  31-Aug-2011  plunky branches: 1.38.2; 1.38.6;
NULL does not need a cast
 1.37  24-May-2011  joerg Explicitly get rid of constness.
 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.
 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.
 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.
 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.
 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.
 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
 1.19  10-Apr-2008  cegger branches: 1.19.2; 1.19.4;
use aprint_*_dev and device_xname
 1.18  19-Oct-2007  ad branches: 1.18.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.17  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.
 1.16  16-Nov-2006  christos branches: 1.16.2; 1.16.4; 1.16.12;
__unused removal on arguments; approved by core.
 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.
 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!
 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/).
 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.3.10.4  03-Sep-2006  yamt sync with head.
 1.3.10.3  11-Aug-2006  yamt sync with head
 1.3.10.2  26-Jun-2006  yamt sync with head.
 1.3.10.1  25-May-2006  yamt file twa.c was added on branch yamt-pdpolicy on 2006-06-26 12:51:23 +0000
 1.3.8.5  27-Oct-2007  yamt sync with head.
 1.3.8.4  03-Sep-2007  yamt sync with head.
 1.3.8.3  30-Dec-2006  yamt sync with head.
 1.3.8.2  21-Jun-2006  yamt sync with head.
 1.3.8.1  25-May-2006  yamt file twa.c was added on branch yamt-lazymbuf on 2006-06-21 15:05:07 +0000
 1.3.6.2  19-Jun-2006  chap Sync with head.
 1.3.6.1  25-May-2006  chap file twa.c was added on branch chap-midi on 2006-06-19 04:01:37 +0000
 1.3.4.1  13-Jul-2006  gdamore Merge from HEAD.
 1.3.2.2  01-Jun-2006  kardel Sync with head.
 1.3.2.1  25-May-2006  kardel file twa.c was added on branch simonb-timecounters on 2006-06-01 22:36:49 +0000
 1.9.2.3  11-Nov-2006  bouyer Pull up following revision(s) (requested by manu in ticket #1528):
etc/MAKEDEV.tmpl: revision 1.66 via patch
sys/conf/majors: revision 1.30 via patch
sys/dev/pci/twareg.h: revision 1.6 via patch
sys/dev/pci/twa.c: revision 1.13 via patch
sys/dev/pci/twaio.h: revision 1.4 via patch
sys/compat/freebsd/freebsd_sysctl.c: revision 1.5 via patch
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.
Fix a bug in FreeBSD sysctl emulation: use copyin for
moving data to the kernel
 1.9.2.2  31-Jul-2006  tron Apply patch (requested by bouyer in ticket #1441):
Pullup the twa(4) driver for the 3ware Apache RAID controllers.
Matching revisions in current:
share/man/man4/twa.4 1.1
sys/dev/pci/ld_twa.c 1.2
sys/dev/pci/twa.c 1.9
sys/dev/pci/twaio.h 1.3
sys/dev/pci/twareg.h 1.5
sys/dev/pci/twavar.h 1.5
 1.9.2.1  30-Jul-2006  tron file twa.c was added on branch netbsd-3 on 2006-07-31 12:35:23 +0000
 1.12.6.2  10-Dec-2006  yamt sync with head.
 1.12.6.1  22-Oct-2006  yamt sync with head
 1.12.4.2  09-Sep-2006  rpaulo sync with head
 1.12.4.1  03-Sep-2006  rpaulo file twa.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:52:19 +0000
 1.12.2.1  18-Nov-2006  ad Sync with head.
 1.16.12.1  25-Aug-2009  snj Pull up following revision(s) (requested by bouyer in ticket #1349):
sys/dev/pci/twa.c: revision 1.32
Disable completely bogus DIAGNOSTIC check.
 1.16.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.16.2.1  25-Aug-2009  snj Pull up following revision(s) (requested by bouyer in ticket #1349):
sys/dev/pci/twa.c: revision 1.32
Disable completely bogus DIAGNOSTIC check.
 1.17.20.1  25-Oct-2007  bouyer Sync with HEAD.
 1.17.16.1  06-Nov-2007  matt sync with HEAD
 1.17.14.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.17.2.1  23-Oct-2007  ad Sync with head.
 1.18.16.4  28-Sep-2008  mjf Sync with HEAD.
 1.18.16.3  29-Jun-2008  mjf Sync with HEAD.
 1.18.16.2  02-Jun-2008  mjf Sync with HEAD.
 1.18.16.1  05-Apr-2008  mjf - add "file-system DEVFS" and "pseudo-device devfsctl" to conf/std seeing
as these are always needed.

- convert many, many drivers over to the New Devfs World Order. For a
list of device drivers yet to be converted see,
http://www.netbsd.org/~mjf/devfs-todo.html.

- add a new device_unregister_all(device_t) function to remove all device
names associated with a device_t, which saves us having to construct
device names when the driver is detached.

- add a DEV_AUDIO type for devices.
 1.19.4.4  19-Aug-2009  yamt sync with head.
 1.19.4.3  16-May-2009  yamt sync with head
 1.19.4.2  04-May-2009  yamt sync with head.
 1.19.4.1  16-May-2008  yamt sync with head.
 1.19.2.2  17-Jun-2008  yamt sync with head.
 1.19.2.1  18-May-2008  yamt sync with head.
 1.21.2.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.21.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.25.2.2  28-Jul-2008  simonb Sync with head.
 1.25.2.1  27-Jun-2008  simonb Sync with head.
 1.27.2.1  19-Oct-2008  haad Sync with HEAD.
 1.28.12.1  21-Apr-2010  matt sync to netbsd-5
 1.28.10.1  07-Aug-2009  snj Pull up following revision(s) (requested by bouyer in ticket #886):
sys/dev/pci/twa.c: revision 1.32
Disable completely bogus DIAGNOSTIC check.
 1.28.8.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.28.4.1  07-Aug-2009  snj Pull up following revision(s) (requested by bouyer in ticket #886):
sys/dev/pci/twa.c: revision 1.32
Disable completely bogus DIAGNOSTIC check.
 1.33.4.2  31-May-2011  rmind sync with head
 1.33.4.1  05-Mar-2011  rmind sync with head
 1.36.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.38.6.1  18-Feb-2012  mrg merge to -current.
 1.38.2.4  22-May-2014  yamt sync with head.

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

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.38.2.3  16-Jan-2013  yamt sync with (a bit old) head
 1.38.2.2  30-Oct-2012  yamt sync with head
 1.38.2.1  17-Apr-2012  yamt sync with head
 1.40.2.1  22-Nov-2012  riz Pull up following revision(s) (requested by chs in ticket #688):
sys/dev/pci/twa.c: revision 1.43
fix autoconf output (don't print from the match routine).
 1.42.2.3  03-Dec-2017  jdolecek update from HEAD
 1.42.2.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.42.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.43.2.1  18-May-2014  rmind sync with head
 1.49.2.1  10-Aug-2014  tls Rebase.
 1.50.2.1  30-Oct-2014  martin Pull up following revision(s) (requested by maxv in ticket #164):
sys/dev/ieee1394/fwcrom.c: revision 1.15
sys/dev/ieee1394/fwcrom.c: revision 1.16
sys/dev/marvell/if_gfe.c: revision 1.43
sys/dev/usb/stuirda.c: revision 1.16
sys/dev/pci/cxgb/cxgb_offload.c: revision 1.4
sys/dev/pci/twa.c: revision 1.51
sys/dev/pci/twa.c: revision 1.52
Various fixes in dev/: remove dead code and fix two inconsistencies.
 1.52.2.2  05-Oct-2016  skrll Sync with HEAD
 1.52.2.1  09-Jul-2016  skrll Sync with HEAD
 1.53.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.55.16.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.55.16.1  10-Jun-2019  christos Sync with HEAD
 1.55.14.2  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.55.14.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.55.6.1  30-Apr-2017  pgoyette More DEVSW_MODULE_INIT for modular drivers
 1.58.10.3  22-Mar-2021  thorpej Fix missing comma.
 1.58.10.2  22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.58.10.1  22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.59.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed