Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/tcic2.c
RevisionDateAuthorComments
 1.42  13-Feb-2024  andvar s/enqueing/enqueuing/ in debug messages (took a bait from recent Nick's commit)
s/occaision/occasion/ in comment.
 1.41  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.40  24-Apr-2021  thorpej branches: 1.40.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.39  03-Sep-2018  riastradh branches: 1.39.14;
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.38  27-Oct-2012  chs branches: 1.38.36; 1.38.38;
split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.37  24-Aug-2012  msaitoh branches: 1.37.2;
Fix typos
 1.36  26-Jul-2011  dyoung branches: 1.36.2;
Don't set the iobase and iosize members of pcmciabus_attach_args because
they're not used in any meaningful way.
 1.35  19-Apr-2010  dyoung Add default implementations for bus_space_is_equal(9),
bus_space_tag_create(9), and bus_space_tag_destroy(9). Use
bus_space_is_equal(9) throughout the kernel to compare
bus_space_tag_t's. Tested on i386 and on sparc64.
 1.34  22-Mar-2010  dyoung pckbc.c, vga.c: It doesn't appear to be helpful to compare two
bus_space_tag_t's in pckbc_is_console() and vga_is_console(), and MI
code should never do such a thing, so don't do it.

tcic2.c: #if 0 some diagnostic code that compares two bus_space_tag_t's.
 1.33  14-Mar-2009  dsl branches: 1.33.2; 1.33.4;
ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.32  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.31  13-Feb-2009  bouyer More printf format fixes.
 1.30  08-Apr-2008  cegger branches: 1.30.4; 1.30.12; 1.30.14; 1.30.18; 1.30.20;
use aprint_*_dev and device_xname
 1.29  29-Mar-2008  ad Make TCICDEBUG / TCICISADEBUG compile.
 1.28  19-Oct-2007  ad branches: 1.28.16;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.27  09-Jul-2007  ad branches: 1.27.6; 1.27.8; 1.27.12;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.26  16-Nov-2006  christos branches: 1.26.8; 1.26.10;
__unused removal on arguments; approved by core.
 1.25  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.24  14-Apr-2006  christos branches: 1.24.8; 1.24.10;
Coverity CID 2501: Make it painfully obvious that memh is initialized.
 1.23  11-Dec-2005  christos branches: 1.23.4; 1.23.6; 1.23.8; 1.23.10; 1.23.12;
merge ktrace-lwp.
 1.22  25-Aug-2005  drochner kill a number of autoconf submatch functions which follow the
standard scheme:
if (<configured> != <wildcard> && <configured> != <real>)
then fail
else
ask device match function

This is handled by config_stdsubmatch() now.
 1.21  25-Aug-2005  drochner replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
 1.20  30-May-2005  christos branches: 1.20.2;
- add missing const
- fix variable shadowing
- remove unneeded casts
 1.19  27-Feb-2005  perry nuke trailing whitespace
 1.18  04-Feb-2005  perry de-__P
 1.17  13-Sep-2004  drochner branches: 1.17.4; 1.17.6;
use locator passing versions of xxxsubmatch() and simplify the code by
using arithmetics instead of case statements
 1.16  11-Aug-2004  mycroft Add a settype function.
Nuke address windows earlier in power up sequence.
 1.15  20-Jun-2004  thorpej Define and use pcmciabuscf_controller as an alias for
cf_loc[PCMCIABUSCF_CONTROLLER] and pcmciabuscf_socket
as an alias for cf_loc[PCMCIABUSCF_SOCKET].
 1.14  28-Dec-2003  christos make the printf statements on chip_io_map complete lines.
 1.13  02-Nov-2003  wiz Fix some typos. From Tom Cosgrove via jmc@openbsd.
 1.12  01-Jan-2003  thorpej branches: 1.12.2;
Use aprint_normal() in cfprint routines.
 1.11  27-Sep-2002  thorpej Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller. Use it
rather than invoking cfattach->ca_match directly.
 1.10  01-Jun-2002  lukem SIMPLEQ rototill:
- implement SIMPLEQ_REMOVE(head, elm, type, field). whilst it's O(n),
this mirrors the functionality of SLIST_REMOVE() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE()
- remove the unnecessary elm arg from SIMPLEQ_REMOVE_HEAD().
this mirrors the functionality of SLIST_REMOVE_HEAD() (the other
singly-linked list type) and FreeBSD's STAILQ_REMOVE_HEAD()
- remove notes about SIMPLEQ not supporting arbitrary element removal
- use SIMPLEQ_FOREACH() instead of home-grown for loops
- use SIMPLEQ_EMPTY() appropriately
- use SIMPLEQ_*() instead of accessing sqh_first,sqh_last,sqe_next directly
- reorder manual page; be consistent about how the types are listed
- other minor cleanups
 1.9  15-Dec-2001  soren branches: 1.9.8;
To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
 1.8  15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.7  13-Nov-2001  lukem add/cleanup RCSID
 1.6  28-Jun-2000  mrg branches: 1.6.2; 1.6.4;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.5  16-Jun-2000  cgd beat back the undead: __BROKEN_INDIRECT_CONFIG had risen, and was
terrorizing innocent hackers...
 1.4  08-May-2000  explorer branches: 1.4.2;
set paa_busname to pcmcia, like the i82365.c driver does.
 1.3  13-Jan-2000  joda (tcic_chip_do_mem_map): handle 8-bit memory
 1.2  06-Jul-1999  thorpej branches: 1.2.2;
Make the kthread API a bit more friendly to loadable kernel modules.
 1.1  23-Mar-1999  bad branches: 1.1.4;
A backend for Databook's TCIC family of PCMCIA chips.

Thanks to Andreas Lohrum, O'Reilly Verlag, Terry Moore, and Holger Czukay
for hardware, documentation, and support.
 1.1.4.1  02-Aug-1999  thorpej Update from trunk.
 1.2.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.4.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.6.4.3  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.6.4.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.5  03-Jan-2003  thorpej Sync with HEAD.
 1.6.2.4  18-Oct-2002  nathanw Catch up to -current.
 1.6.2.3  20-Jun-2002  nathanw Catch up to -current.
 1.6.2.2  08-Jan-2002  nathanw Catch up to -current.
 1.6.2.1  14-Nov-2001  nathanw Catch up to -current.
 1.9.8.1  20-Jun-2002  gehenna catch up with -current.
 1.12.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.12.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.12.2.5  04-Feb-2005  skrll Sync with HEAD.
 1.12.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.12.2.2  12-Aug-2004  skrll Sync with HEAD.
 1.12.2.1  03-Aug-2004  skrll Sync with HEAD
 1.17.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.17.6.1  12-Feb-2005  yamt sync with head.
 1.17.4.1  29-Apr-2005  kent sync with -current
 1.20.2.4  27-Oct-2007  yamt sync with head.
 1.20.2.3  03-Sep-2007  yamt sync with head.
 1.20.2.2  30-Dec-2006  yamt sync with head.
 1.20.2.1  21-Jun-2006  yamt sync with head.
 1.23.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.23.10.1  19-Apr-2006  elad sync with head.
 1.23.8.1  24-May-2006  yamt sync with head.
 1.23.6.1  22-Apr-2006  simonb Sync with head.
 1.23.4.1  09-Sep-2006  rpaulo sync with head
 1.24.10.2  10-Dec-2006  yamt sync with head.
 1.24.10.1  22-Oct-2006  yamt sync with head
 1.24.8.1  18-Nov-2006  ad Sync with head.
 1.26.10.1  11-Jul-2007  mjf Sync with head.
 1.26.8.4  23-Oct-2007  ad Sync with head.
 1.26.8.3  13-May-2007  ad - Pass the error number and residual count to biodone(), and let it handle
setting error indicators. Prepare to eliminate B_ERROR.
- Add a flag argument to brelse() to be set into the buf's flags, instead
of doing it directly. Typically used to set B_INVAL.
- Add a "struct cpu_info *" argument to kthread_create(), to be used to
create bound threads. Change "bool mpsafe" to "int flags".
- Allow exit of LWPs in the IDL state when (l != curlwp).
- More locking fixes & conversion to the new API.
 1.26.8.2  10-Apr-2007  ad Nuke the deferred kthread creation stuff, as it's no longer needed.
Pointed out by thorpej@.
 1.26.8.1  09-Apr-2007  ad - Add two new arguments to kthread_create1: pri_t pri, bool mpsafe.
- Fork kthreads off proc0 as new LWPs, not new processes.
 1.27.12.1  25-Oct-2007  bouyer Sync with HEAD.
 1.27.8.1  06-Nov-2007  matt sync with HEAD
 1.27.6.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.28.16.2  02-Jun-2008  mjf Sync with HEAD.
 1.28.16.1  03-Apr-2008  mjf Sync with HEAD.
 1.30.20.1  26-Jul-2009  snj branches: 1.30.20.1.2;
Pull up following revision(s) (requested by dholland in ticket #874):
sys/dev/ic/ciss.c: revision 1.15
sys/dev/isa/isadma.c: revision 1.59
sys/dev/usb/ulpt.c: revision 1.82
sys/dev/ic/tcic2.c: revision 1.31
sys/dev/isa/if_ntwoc_isa.c: revision 1.18
sys/dev/pci/if_sk.c: revision 1.57
sys/dev/pcmcia/if_cnw.c: revision 1.46
More printf format fixes.
 1.30.20.1.2.1  21-Apr-2010  matt sync to netbsd-5
 1.30.18.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.30.14.1  26-Jul-2009  snj Pull up following revision(s) (requested by dholland in ticket #874):
sys/dev/ic/ciss.c: revision 1.15
sys/dev/isa/isadma.c: revision 1.59
sys/dev/usb/ulpt.c: revision 1.82
sys/dev/ic/tcic2.c: revision 1.31
sys/dev/isa/if_ntwoc_isa.c: revision 1.18
sys/dev/pci/if_sk.c: revision 1.57
sys/dev/pcmcia/if_cnw.c: revision 1.46
More printf format fixes.
 1.30.12.2  28-Apr-2009  skrll Sync with HEAD.
 1.30.12.1  03-Mar-2009  skrll Sync with HEAD.
 1.30.4.2  11-Aug-2010  yamt sync with head.
 1.30.4.1  04-May-2009  yamt sync with head.
 1.33.4.1  30-May-2010  rmind sync with head
 1.33.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.36.2.1  30-Oct-2012  yamt sync with head
 1.37.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.38.38.1  10-Jun-2019  christos Sync with HEAD
 1.38.36.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.39.14.2  22-Mar-2021  thorpej Audit CFARG_IATTR in config_found() calls, and remove it in situations
where the interface attribute is not ambiguous.
 1.39.14.1  22-Mar-2021  thorpej Mechanical conversion of config_found_sm_loc() -> config_found().
CFARG_IATTR usage needs to be audited.
 1.40.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed