summaryrefslogtreecommitdiffstats
path: root/sys/dev/dpt
Commit message (Collapse)AuthorAgeFilesLines
* MFC r311305 (by asomers):mav2017-03-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name) The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are fixed-length strings. AFAICT the only place they're read is in sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated. However, the kernel doesn't null-terminate them. A bunch of copy-pasted code uses strncpy to write them, and doesn't guarantee null-termination. For at least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually overflows. You can see the result by doing "camcontrol negotiate da0 -v". This change null-terminates those fields everywhere they're set in the kernel. It also shortens a few strings to ensure they'll fit within the 16-character field. PR: 215474 Reported by: Coverity CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005 CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000 CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014 CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021 CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027 CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187 CID: 1010035 1010036 1010042 1010041 1010040 1010039
* sys/dev: minor spelling fixes.pfg2016-05-032-6/+6
| | | | Most affect comments, very few have user-visible effects.
* Remove MAXBSIZE use from drivers where it has nothing to do.mav2015-03-221-1/+1
| | | | | | | In some cases limits are just not needed, in others -- DFLTPHYS is the right constant to use instead. MFC after: 1 month
* Prevent overflow issues in timeout processingsmh2014-11-211-2/+2
| | | | | | | | | | | | | | | | | | | | | Previously, any timeout value for which (timeout * hz) will overflow the signed integer, will give weird results, since callout(9) routines will convert negative values of ticks to '1'. For unsigned integer overflow we will get sufficiently smaller timeout values than expected. Switch from callout_reset, which requires conversion to int based ticks to callout_reset_sbt to avoid this. Also correct isci to correctly resolve ccb timeout. This was based on the original work done by Eygene Ryabinkin <rea@freebsd.org> back in 5 Aug 2011 which used a macro to help avoid the overlow. Differential Revision: https://reviews.freebsd.org/D1157 Reviewed by: mav, davide MFC after: 1 month Sponsored by: Multiplay
* Remove dpt_isa.c and commented out references to it. It was never connectedjhb2014-11-131-267/+0
| | | | | | to the build in either sys/conf/files* or sys/modules/dpt/Makefile. Also, it was denoted as "doesn't quite work yet" when the file was initially added (which may account for it never having been hooked up to the build).
* Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,jhb2014-06-101-1/+0
| | | | | | | | | don't create a map before calling bus_dmamem_alloc() (such maps were leaked). It is believed that the extra destroy of the map was generally harmless since bus_dmamem_alloc() often uses special maps for which bus_dmamap_destroy() is a no-op (e.g. on x86). Reviewed by: scottl
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIscottl2013-08-121-11/+5
| | | | | | | | | | | | | | | | | command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day
* options DPT_HANDLE_TIMEOUTS hasn't worked since dpt(4) was converted to CAMsbruno2013-04-102-163/+0
| | | | | | | | | | | | | | | somewhere around svn r39402 to r39234. I don't know of anyone who really wants to test these changes, but they only remove the deprecated code in question. This shreds the driver down a bit and *removes* options from the kernel configs. These don't appear to be referenced in the man page, so no need to check it there. PR: kern/44587 Obtained from: Yahoo! Inc. MFC after: 2 weeks
* Reform the busdma API so that new types may be added without modifyingkib2013-02-121-48/+14
| | | | | | | | | | | | | | | | | | | | | every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. The cam changes unify the bus_dmamap_load* handling in cam drivers. The arm and mips implementations are updated to track virtual addresses for sync(). Previously this was done in a type specific way. Now it is done in a generic way by recording the list of virtuals in the map. Submitted by: jeff (sponsored by EMC/Isilon) Reviewed by: kan (previous version), scottl, mjacob (isp(4), no objections for target mode changes) Discussed with: ian (arm changes) Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris), amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)
* Fix build of dpt(4).pluknet2012-10-161-2/+2
|
* Add locking to the dpt(4) driver and mark it MPSAFE.jhb2012-10-155-286/+233
| | | | | | | | | | | - Use device_printf() and device_get_unit() instead of storing the unit number in the softc. - Remove use of explicit bus space handles and tags. - Remove the global dpt_softcs list and use devclass_get_device() instead. - Use pci_enable_busmaster() rather than frobbing the PCI command register directly. Tested by: no one
* Fix the following clang warning in dpt(4):dim2012-04-211-1/+1
| | | | | | | | | | | sys/dev/dpt/dpt_scsi.c:612:18: error: implicit truncation from 'int' to bitfield changes value from -2 to 2 [-Werror,-Wconstant-conversion] dpt->cache_type = DPT_CACHE_WRITEBACK; ^ ~~~~~~~~~~~~~~~~~~~ by defining DPT_CACHE_WRITEBACK as 2, since dpt_softc::cache_type is an unsigned bitfield. No binary change. MFC after: 1 week
* Remove comments about creating DMA tags as children of the DMA tags of theirjmallett2012-03-121-1/+0
| | | | | | parent bus where the code has now been modified to do so. Reviewed by: scottl
* Convert a number of drivers to obtaining their parent DMA tag from theirscottl2012-03-121-1/+1
| | | | PCI device attachment.
* Remove duplicate assignment of CTS_SPI_VALID_SYNC_RATE bitkevlo2012-02-261-1/+0
|
* Get rid of #ident, GCC 4.4 warns about it being deprecated.trasz2010-01-082-4/+1
| | | | OK-ed by: scottl
* Prepare for future integration between CAM and newbus. xpt_bus_registerscottl2007-06-175-2/+5
| | | | | | | now takes a device_t to be the parent of the bus that is being created. Most SIMs have been updated with a reasonable argument, but a few exceptions just pass NULL for now. This argument isn't used yet and the newbus integration likely won't be ready until after 7.0-RELEASE.
* Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willscottl2007-04-151-1/+2
| | | | | | | | | | | use to synchornize and protect all data objects that are used for that SIM. Drivers that are not yet MPSAFE register Giant and operate as usual. RIght now, no drivers are MPSAFE, though a few will be changed in the coming week as this work settles down. The driver API has changed, so all CAM drivers will need to be recompiled. The userland API has not changed, so tools like camcontrol do not need to be recompiled.
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-232-2/+2
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Wrap the EISA-specific parts of the dpt(4) and si(4) back-ends inmarius2007-01-183-0/+12
| | | | | | | the newly added DEV_EISA. This is done so that these back-ends can be compiled on platforms not providing in{b,w,l}()/out{b,w,l}() and friends (but may wish to use them together with bus front-ends other than the EISA one).
* Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed.mjacob2006-12-113-0/+6
| | | | | PR: 106543 MFC after: 3 days
* 2nd and final commit that moves us to CAM_NEW_TRAN_CODEmjacob2006-11-021-24/+0
| | | | | | as the default. Reviewed by multitudes.
* The first of 3 major steps to move the CAM layer forward to usingmjacob2006-10-311-4/+39
| | | | | | | | | | | | | | | | | | | | | the CAM_NEW_TRAN_CODE that has been in the tree for some years now. This first step consists solely of adding to or correcting CAM_NEW_TRAN_CODE pieces in the kernel source tree such that a both a GENERIC (at least on i386) and a LINT build with CAM_NEW_TRAN_CODE as an option will compile correctly and run (at least with some the h/w I have). After a short settle time, the other pieces (making CAM_NEW_TRAN_CODE the default and updating libcam and camcontrol) will be brought in. This will be an incompatible change in that the size of structures related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change in both size and content. However, basic system operation and basic system utilities work well enough with this change. Reviewed by: freebsd-scsi and specific stakeholders
* Commit the results of the typo hunt by Darren Pilgrim.yar2006-08-041-1/+1
| | | | | | | | | | This change affects documentation and comments only, no real code involved. PR: misc/101245 Submitted by: Darren Pilgrim <darren pilgrim bitfreak org> Tested by: md5(1) MFC after: 1 week
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-161-1/+0
| | | | unnecessary.
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-294-6/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Remove unnecessary dpt_free().mdodd2005-04-131-1/+0
|
* Use BUS_PROBE_DEFAULT for pci probe return valueimp2005-03-051-1/+1
|
* remove gratuitous null ptr checksam2005-02-241-2/+1
| | | | Noticed by: Coverity Prevent analysis tool
* o nuke duplicate call of dpt_free when dpt_init failssam2005-02-241-3/+1
| | | | | | | o nuke gratuitous null ptr check; softc can never be null in this routine Noticed by: Coverity Prevent analysis tool Reviewed by: mdodd
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-062-2/+2
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-173-14/+12
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Adjust $FreeBSD$'s.obrien2004-03-171-2/+1
|
* Device megapatch 1/6:phk2004-02-211-1/+0
| | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
* - Handle failure of cam_sim_alloc().mdodd2004-01-171-0/+12
| | | | | | | This prevents xpt_bus_register() from dereferencing NULL. - Assign pointer to NULL after cam_sim_free(). Submitted by: Paul Twohey <twohey@CS.Stanford.EDU>
* Use PCIR_BAR(x) instead of PCIR_MAPS.jhb2003-09-021-2/+2
| | | | | Glanced over by: imp, gibbs Tested by: i386 LINT
* Use __FBSDID().obrien2003-08-244-4/+12
| | | | Also some minor style cleanups.
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Mega busdma API commit.scottl2003-07-014-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs
* Merge common XPT_CALC_GEOMETRY functions into a single convenience function.njl2003-06-141-20/+1
| | | | | | | | | | | | | Devices below may experience a change in geometry. * Due to a bug, aic(4) never used extended geometry. Changes all drives >1G to now use extended translation. * sbp(4) drives exactly 1 GB in size now no longer use extended geometry. * umass(4) drives exactly 1 GB in size now no longer use extended geometry. For all other controllers in this commit, this should be a no-op. Looked over by: scottl
* Bring back bus_dmasync_op_t. It is now a typedef to an int, though thescottl2003-05-271-2/+2
| | | | | | | | BUS_DMASYNC_ definitions remain as before. The does not change the ABI, and reverts the API to be a bit more compatible and flexible. This has survived a full 'make universe'. Approved by: re (bmah)
* I deserve a big pointy hat for having missed all those referencesmux2003-04-101-2/+2
| | | | to bus_dmasync_op_t in my last commit.
* Remove useless code.mdodd2003-03-291-6/+0
|
* Don't compile the identify method yet.mdodd2003-03-291-0/+4
|
* Clean up argument comments for bus_dma_tag_create() calls.mdodd2003-03-291-24/+38
|
* - Track resources in our softc.mdodd2003-03-295-127/+278
| | | | | | | | | | - Sanitize dpt_alloc(). - Add helper functions for resource alloc/release. - Add detach method. - Relocate definition of devclass_t. - Move some debugging output behind bootverbose. - Implement an identify method for ISA devices but don't use it right now.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Correct typo.grog2003-01-161-1/+1
| | | | | Submitted by: Alan Day <alan@alanday.com> MFC after: 2 weeks
* Use bus_addr_t instead of u_int32_t in functions to convert betweenjhb2002-11-061-3/+3
| | | | physical and virtual addresses.
OpenPOWER on IntegriCloud