summaryrefslogtreecommitdiff
path: root/sys/dev/ic/cac.c
AgeCommit message (Collapse)Author
2021-08-07Merge thorpej-cfargs2.thorpej
2021-04-24Merge thorpej-cfargs branch:thorpej
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?).
2019-11-10in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAITchs
and remove code to handle failures that can no longer happen.
2019-05-08bio(4) drivers: remove noop fallthrough-to-default bio(4) cmd casescnst
* Makes it easier to do code/feature analysis by not having extra noop code/symbols spattered around. * Only an issue in cac(4) and ciss(4); other drivers don't do this. * No binary changes.
2018-09-03Rename min/max -> uimin/uimax for better honesty.riastradh
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!)
2017-10-28Kill some more extern struct cfdriver declarations.riastradh
Down with externs in .c!
2016-09-27Modularize the ld driver and all of its attachments. Ensure that allpgoyette
parents are capable of rescan (or otherwise provide a means of attaching children post-initialization).
2016-07-07KNF. Remove extra spaces. No functional change.msaitoh
2015-03-12Dedup the conversion of bioc_disk and bioc_vol to envsys_data_tchristos
2012-10-27split device_t/softc for all remaining drivers.chs
replace "struct device *" with "device_t". use device_xname(), device_unit(), etc.
2011-06-20Initialize current value for ENVSYS_DRIVE sensorspgoyette
2011-06-20Initializes sensors states before registering.pgoyette
2010-11-13Don't pull in the whole uvm(9) API to access only PAGE_SIZE anduebayasi
some other constants. These are provided by sys/param.h now.
2010-03-14Remove setting of edata->monitor since that member no longer exists.pgoyette
2009-05-12struct device * -> device_t, no functional changes intended.cegger
2009-03-18bzero -> memsetcegger
2008-06-08Replace device_lookup() with device_lookup_private() on getting softctsutsui
for future device_t/softc spilt.
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-08use aprint_*_dev and device_xnamecegger
2008-03-14Initial bio(4) support; only volume status is handled. The driver doesn'tmhitch
yet know about physical drives. Derived from the OpenBSD ciss(4) bio(4) support.
2007-12-05Match the docs: MUTEX_DRIVER/SPIN are now only for porting code writtenad
for Solaris.
2007-10-19machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.had
2007-07-09Merge some of the less invasive changes from the vmlocking branch:ad
- kthread, callout, devsw API changes - select()/poll() improvements - miscellaneous MT safety improvements
2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos
2007-02-09Merge newlock2 to head.ad
2006-12-29- Print number of channels and firmware revision.ad
- Cut polling delay to make crashdumps faster.
2006-11-28Improve error handling. Related to PR/21900.ad
2006-11-16__unused removal on arguments; approved by core.christos
2006-10-12- sprinkle __unused on function decls.christos
- fix a couple of unused bugs - no more -Wno-unused for i386
2006-01-29Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>dsl
The bswap.h and endian.h files are all rather incestuous, but I want to get the constant folding stuff into one place - sys/bswap.h
2005-12-11merge ktrace-lwp.christos
2005-08-25kill a number of autoconf submatch functions which follow thedrochner
standard scheme: if (<configured> != <wildcard> && <configured> != <real>) then fail else ask device match function This is handled by config_stdsubmatch() now.
2005-08-25replace the "locdesc_t" structure carrying the number of locatorsdrochner
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
2005-05-30- add missing constchristos
- fix variable shadowing - remove unneeded casts
2005-02-27nuke trailing whitespaceperry
2004-09-13a round of autoconf cleanup:drochner
-convert submatch() style functions (passed to config_search() or config_found_sm()) to the locator passing variants -pass interface attributes in some cases -make submatch() functions look uniformly as far as possible -avoid macros which just hide cfdata members, and reduce dependencies on "locators.h"
2004-08-24Use ANSI function decls and more use of static.thorpej
2003-12-05cac_cmd:pk
* don't let cac_ccb_alloc() sleep since it regularly runs in an interrupt context * return EAGAIN instead EBUSY (or -1), which is what the upper ld layer expects to get on transient resource shortages. * ignore error from cac_ccb_start(), since a `fifo full' condition is handled internally in the lower layer, i.e. the transaction started from ldstart() has been queued at the lower layer and must be taken off ld's disk queue.
2003-01-31Use aprint_*().thorpej
2003-01-06specified, not specifed.wiz
2003-01-01Use aprint_normal() in cfprint routines.thorpej
2002-09-27Introduce a new routine, config_match(), which invokes thethorpej
cfattach->ca_match function in behalf of the caller. Use it rather than invoking cfattach->ca_match directly.
2002-06-01SIMPLEQ rototill:lukem
- 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
2002-01-25- Always validate the return value read from the outbound FIFO.ad
- Copy access method info into the softc so we don't double dereference. - Remove static on functions.
2001-11-13add/cleanup RCSIDlukem
2001-07-19Use BUS_DMA_READ and BUS_DMA_WRITE in some obvious places.thorpej
2001-03-07Add BUS_DMA_STREAMING to data transfer maps.thorpej
2000-12-11Report soft-errors-per-unit once per minute at most.ad
2000-11-14NBPG -> PAGE_SIZEthorpej
2000-11-08Move lsu stuff to more logical locations, and push queueing into the lsuad
driver.