summaryrefslogtreecommitdiff
path: root/sys/dev/i2o
AgeCommit message (Collapse)Author
2023-05-31Fix typo.ad
2022-05-30s/identifing/identifying/ and s/multipler/multiplier/ in comments.andvar
2022-05-04fix various typos in comments and log messages.andvar
2022-04-17fix various typos in comments.andvar
2021-11-01fix typos, mainly in words minimum and maximum, but also few others.andvar
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.
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-28Add some #includes to make a few more header files compile.riastradh
2017-10-28Kill some more extern struct cfdriver declarations.riastradh
Down with externs in .c!
2017-08-09While ld(4) is MP safe, many backends are not.mlelstv
Add a flag for backends that are MP safe. Take KERNEL_LOCK when calling into a backend that doesn't have the flag set. Do the same for the discard routine. Fixes PR 52462.
2017-08-09Don't wait for allocation in polling mode.mlelstv
2017-02-27refactor the ld(4) DIOCCACHESYNC hook into general ioctl hook, so that ↵jdolecek
attachments would be able to implement arbitrary other ioctls
2016-09-16modify ldattach() to have default strategy as a parameterjdolecek
2015-09-06More on PR 41200: headers that declare ioctls should include sys/ioccom.h.dholland
This covers (I think) all the MI headers outside of external/ (and dist/).
2015-08-16 Fix device_t/softc split bug.msaitoh
2015-08-16 Fix a buffer pointer check in iop_msg_unmap(). The number of im_xfermsaitoh
is IOP_MAX_MSG_XFERS and it's three. iop_systab_set() makes three ximit buffers. In this case, iop_msg_unmap() overrruns by "if((++ix)->ix_size == 0)". Check overrun first. This change fixes a bug that iop(4) panics while attaching iopsp(4).
2015-04-13Convert sys/dev to use <sys/rndsource.h>.riastradh
2014-07-25Add d_discard to all struct cdevsw instances I could find.dholland
All have been set to "nodiscard"; some should get a real implementation.
2014-03-20make this compile again.christos
XXX: 32 bit pointer issues.
2014-03-16Change (mostly mechanically) every cdevsw/bdevsw I can find to usedholland
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.
2013-10-17remove unused variables and __USE a debugging variablechristos
2013-09-14#if 0 iop_status, but keep it for documentation purposes.joerg
2012-10-27split device_t/softc for all remaining drivers.chs
replace "struct device *" with "device_t". use device_xname(), device_unit(), etc.
2012-02-02Entropy-pool implementation move and cleanup.tls
1) Move core entropy-pool code and source/sink/sample management code to sys/kern from sys/dev. 2) Remove use of NRND as test for presence of entropy-pool code throughout source tree. 3) Remove use of RND_ENABLED in device drivers as microoptimization to avoid expensive operations on disabled entropy sources; make the rnd_add calls do this directly so all callers benefit. 4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might have lead to slight entropy overestimation for some sources. 5) Add new source types for environmental sensors, power sensors, VM system events, and skew between clocks, with a sample implementation for each. ok releng to go in before the branch due to the difficulty of later pullup (widespread #ifdef removal and moved files). Tested with release builds on amd64 and evbarm and live testing on amd64.
2011-08-07Replace some wakeup_one(9) uses with mutex(9) or plain wakeup(9).rmind
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-02-21Fix confusion about PRE/POST in previous; and another place that has thebouyer
same issue. Also add a BUS_DMASYNC_POSTWRITE to the POLL operation. Problem pointed out by tsutsui@. Still not perfect (a BUS_DMASYNC_PREREAD would be needed after the testing the condition in the POLL() macro), but closer.
2010-02-21Fix bus_dmamap_sync(): it should be a BUS_DMASYNC_POSTWRITE afterbouyer
writing to DMA memory. Found by code inspection.
2010-02-19Don't mix BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTWRITE.asau
Suggested by <bouyer>, fixes PR kern/42662
2009-10-21Remove uarea swap-out functionality:rmind
- Addresses the issue described in PR/38828. - Some simplification in threading and sleepq subsystems. - Eliminates pmap_collect() and, as a side note, allows pmap optimisations. - Eliminates XS_CTL_DATA_ONSTACK in scsipi code. - Avoids few scans on LWP list and thus potentially long holds of proc_lock. - Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k. - Removes __SWAP_BROKEN cases. Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on acorn26 (thanks to <bjh21>). Discussed on <tech-kern>, reviewed by <ad>.
2009-05-12struct device * -> device_t, no functional changes intended.cegger
2009-05-12struct cfdata * -> cfdata_t, no functional changes intended.cegger
2008-12-15More device_t/softc split fallout, this time in iop(4). Fix frommhitch
Juan Romero Pardines. Tested on alpha by me.
2008-09-14Use the physical address from the bus_dmamap_load() map, not the one frommhitch
the bus_dmamem_alloc(). Fixes iop(4) on alpha, and possibly sparc64 as described in the thread http://mail-index.netbsd.org/port-sparc64/2008/06/04/msg000413.html.
2008-09-09Complete device_t/softc split for the ld(4) attachments. This shouldtron
prevent crashes while attaching a drive. Patch supplied by Juan RP in PR kern/39468.
2008-09-08Replace most gcc-specific __attribute__ uses with BSD-style sys/cdef.hgmcgarry
preprocessor macros.
2008-08-11Add a flags argument to the ld(4) flush handlers, and call these with asimonb
"poll" flag when called from ld_shutdown(). This is the infrastructure part of kern/38655 - in itself it doesn't fix the panic referenced in that PR. XXX: At least ld_twa.c and perhaps ld_iop.c and ld_icp.c need to check for this new poll flag and do something useful.
2008-06-08Replace device_lookup() with device_lookup_private() on getting softctsutsui
for future device_t/softc spilt.
2008-06-08Fix up bus_dmamap_sync calls.ad
2008-05-11Include machine/cputypes.h explicitly.ad
2008-05-10Fix a tyop in a comment.simonb
2008-05-05- Convert hashinit() to use kmem_alloc(). The hash tables can be largead
and it's better to not have them in kmem_map. - Convert a couple of minor items along the way to kmem_alloc(). - Fix some memory leaks.
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-06use aprint_*_dev and device_xnamecegger
2008-02-11Don't get under the device_t abstraction by measuring the lengthdyoung
of dv_xname, especially not to set the length of a buffer that (apparently) belongs to the kernel ABI. Instead, set the buffer length to 16, which is the current length of dv_xname.
2007-12-05Match the docs: MUTEX_DRIVER/SPIN are now only for porting code writtenad
for Solaris.
2007-12-01The I2O LAN stuff was never tested and is just more code to maintain -ad
remove it.
2007-12-01I2OVERBOSE/opt_i2o.h were removedad