summaryrefslogtreecommitdiff
path: root/sys/dev/ahb
AgeCommit message (Collapse)Author
2017-02-16Remove the ahb driver for the EISA Adaptec 174x.Warner Losh
Notes: svn path=/head/; revision=313826
2017-01-05In the same vein as r311350, fix whitespace in handling of XPT_PATH_INQ inRavi Pokala
several more drivers. Sponsored by: Panasas Notes: svn path=/head/; revision=311351
2017-01-04Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers
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 Reviewed by: imp, sephe, slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9037 Differential Revision: https://reviews.freebsd.org/D9038 Notes: svn path=/head/; revision=311305
2016-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
2015-03-22Remove MAXBSIZE use from drivers where it has nothing to do.Alexander Motin
In some cases limits are just not needed, in others -- DFLTPHYS is the right constant to use instead. MFC after: 1 month Notes: svn path=/head/; revision=280347
2014-11-21Prevent overflow issues in timeout processingSteven Hartland
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 Notes: svn path=/head/; revision=274819
2014-06-11Fix a few more drivers that were explicitly destroying the bus_dmaJohn Baldwin
map created by bus_dmamem_alloc(). Notes: svn path=/head/; revision=267365
2013-02-12Reform the busdma API so that new types may be added without modifyingKonstantin Belousov
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>) Notes: svn path=/head/; revision=246713
2012-10-15Add locking to the ahb(4) driver and mark it MPSAFE.John Baldwin
- 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. - Compare pointers against NULL. - Let new-bus allocate a softc rather than doing it by hand. Tested by: no one Notes: svn path=/head/; revision=241590
2012-03-12Remove a stale comment.Scott Long
Submitted by: jimharris Notes: svn path=/head/; revision=232886
2012-03-12Final pass at having devices use their bus parent for dma tags. TheScott Long
remaining drivers that haven't been converted have various problems or complexities that will be dealt with later. This list includes: hptrr, hptmv, hpt27xx - device aggregation across multiple parents drm - want to talk to the maintainer first tsec, sec - Openfirmware devices, not sure if changes are warranted fatm - Done except for unused testing code usb - want to talk to the maintainer first ce, cp, ctau, cx - Significant driver changes needed to convey parent info There are also devices tucked into architecture subtrees that I'll leave for the respective maintainers to deal with. Notes: svn path=/head/; revision=232883
2007-06-17Fix a compile error from the last change.Scott Long
Notes: svn path=/head/; revision=170883
2007-06-17Prepare for future integration between CAM and newbus. xpt_bus_registerScott Long
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. Notes: svn path=/head/; revision=170872
2007-04-15Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willScott Long
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. Notes: svn path=/head/; revision=168752
2007-04-01Handle errors from bus_setup_intr().Alexander Leidinger
Found by: Coverity Prevent (tm) CID: 1066 Notes: svn path=/head/; revision=168219
2007-02-23o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati
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@ Notes: svn path=/head/; revision=166901
2006-12-11Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed.Matt Jacob
PR: 106543 MFC after: 3 days Notes: svn path=/head/; revision=165102
2006-11-022nd and final commit that moves us to CAM_NEW_TRAN_CODEMatt Jacob
as the default. Reviewed by multitudes. Notes: svn path=/head/; revision=163896
2006-10-31The first of 3 major steps to move the CAM layer forward to usingMatt Jacob
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 Notes: svn path=/head/; revision=163816
2006-05-31Fix missing update to reflect change in scsi_inquiry data structure.Matt Jacob
Notes: svn path=/head/; revision=159105
2005-05-29Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi
and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
2005-01-06Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh
Notes: svn path=/head/; revision=139749
2004-03-17Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
2003-07-30Make this at least compile on 64 bit platforms. Its been breakingAndrew Gallatin
the alpha tinderbox for far too long. Notes: svn path=/head/; revision=118225
2003-07-01Mega busdma API commit.Scott Long
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 Notes: svn path=/head/; revision=117126
2003-06-14Merge common XPT_CALC_GEOMETRY functions into a single convenience function.Nate Lawson
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 Notes: svn path=/head/; revision=116351
2003-05-27Bring back bus_dmasync_op_t. It is now a typedef to an int, though theScott Long
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) Notes: svn path=/head/; revision=115343
2003-04-10I deserve a big pointy hat for having missed all those referencesMaxime Henrion
to bus_dmasync_op_t in my last commit. Notes: svn path=/head/; revision=113350
2003-03-29Clean up argument comments for bus_dma_tag_create() calls.Matthew N. Dodd
Notes: svn path=/head/; revision=112782
2003-02-02Consolidate MIN/MAX macros into one place (param.h).Alfred Perlstein
Submitted by: Hiten Pandya <hiten@unixdaemons.com> Notes: svn path=/head/; revision=110232
2002-05-24Fix new gcc-3.1 warnings. I think this gets GENERIC compiling cleanlyPeter Wemm
again. Notes: svn path=/head/; revision=97208
2001-03-01Turn on interrupt-entropy harvesting for all/any mass storage devicesMark Murray
I could find. I have no doubt missed a couple. Interrupt entropy harvesting is still conditional on the kern.random.sys.harvest_interrupt sysctl. Notes: svn path=/head/; revision=73280
2000-10-29Add the use of M_ZERO to some malloc calls.David Malone
Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Approved by: gibbs Notes: svn path=/head/; revision=67888
2000-10-27Convert all users of fldoff() to offsetof(). fldoff() is badPoul-Henning Kamp
because it only takes a struct tag which makes it impossible to use unions, typedefs etc. Define __offsetof() in <machine/ansi.h> Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h> Remove myriad of local offsetof() definitions. Remove includes of <stddef.h> in kernel code. NB: Kernelcode should *never* include from /usr/include ! Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API. Deprecate <struct.h> with a warning. The warning turns into an error on 01-12-2000 and the file gets removed entirely on 01-01-2001. Paritials reviews by: various. Significant brucifications by: bde Notes: svn path=/head/; revision=67708
2000-10-15Remove unneeded #include <machine/clock.h>Poul-Henning Kamp
Notes: svn path=/head/; revision=67164
2000-06-14Fix typo (accessable --> accessible).Alexander Langer
PR: 18588 Submitted by: Anatoly Vorobey <mellon@pobox.com> Reviewed by: asmodai Notes: svn path=/head/; revision=61686
2000-05-26Back out the previous change to the queue(3) interface.Jake Burkholder
It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
2000-05-23Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder
the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
2000-01-29Remove #include "eisa.h" and #if NEISA > 0Peter Wemm
Notes: svn path=/head/; revision=56872
2000-01-17Use rman_get_bustag and rman_get_bushandle to initialize bus tag andYoshihiro Takahashi
bus handle. Notes: svn path=/head/; revision=56177
2000-01-14Pre 4.0 tidy up.Peter Wemm
Collect together the components of several drivers and export eisa from the i386-only area (It's not, it's on some alphas too). The code hasn't been updated to work on the Alpha yet, but that can come later. Repository copies were done a while ago. Moving these now keeps them in consistant place across the 4.x series as the newbusification progresses. Submitted by: mdodd Notes: svn path=/head/; revision=55953
1999-08-28$Id$ -> $FreeBSD$Peter Wemm
Notes: svn path=/head/; revision=50477
1999-08-16Properly set the alignment argument to bus_dma_tag_create(). If weJustin T. Gibbs
don't care about the alignment, set it to 1, meaning single byte alignment. Notes: svn path=/head/; revision=49860
1999-08-01Move the specification of EDGE/LEVEL triggered interrupts toMatthew N. Dodd
eisa_add_intr() which now takes an additional arguement (one of EISA_TRIGGER_LEVEL or EISA_TRIGGER_EDGE). The flag RR_SHAREABLE has no effect when passed to bus_alloc_resource(dev, SYS_RES_IRQ, ...) in an EISA device context as the eisa_alloc_resource() call (bus_alloc_resource method) now deals with this flag directly, depending on the device ivars. This change does nothing more than move all the 'shared = inb(foo + iobsse)' nonesense to the device probe methods rather than the device attach. Also, print out 'edge' or 'level' in the IRQ announcement message. Reviewed by: dfr Notes: svn path=/head/; revision=49360
1999-05-08Move the declaration of the interrupt type from the driver structureDoug Rabson
to the BUS_SETUP_INTR call. Notes: svn path=/head/; revision=46743
1999-05-06Add a number of interrelated CAM feature enhancements and bug fixes.Kenneth D. Merry
NOTE: These changes will require recompilation of any userland applications, like cdrecord, xmcd, etc., that use the CAM passthrough interface. A make world is recommended. camcontrol.[c8]: - We now support two new commands, "tags" and "negotiate". - The tags commands allows users to view the number of tagged openings for a device as well as a number of other related parameters, and it allows users to set tagged openings for a device. - The negotiate command allows users to enable and disable disconnection and tagged queueing, set sync rates, offsets and bus width. Note that not all of those features are available for all controllers. Only the adv, ahc, and ncr drivers fully support all of the features at this point. Some cards do not allow the setting of sync rates, offsets and the like, and some of the drivers don't have any facilities to do so. Some drivers, like the adw driver, only support enabling or disabling sync negotiation, but do not support setting sync rates. - new description in the camcontrol man page of how to format a disk - cleanup of the camcontrol inquiry command - add support in the 'devlist' command for skipping unconfigured devices if -v was not specified on the command line. - make use of the new base_transfer_speed in the path inquiry CCB. - fix CCB bzero cases cam_xpt.c, cam_sim.[ch], cam_ccb.h: - new flags on many CCB function codes to designate whether they're non-immediate, use a user-supplied CCB, and can only be passed from userland programs via the xpt device. Use these flags in the transport layer and pass driver to categorize CCBs. - new flag in the transport layer device matching code for device nodes that indicates whether a device is unconfigured - bump the CAM version from 0x10 to 0x11 - Change the CAM ioctls to use the version as their group code, so we can force users to recompile code even when the CCB size doesn't change. - add + fill in a new value in the path inquiry CCB, base_transfer_speed. Remove a corresponding field from the cam_sim structure, and add code to every SIM to set this field to the proper value. - Fix the set transfer settings code in the transport layer. scsi_cd.c: - make some variables volatile instead of just casting them in various places - fix a race condition in the changer code - attach unless we get a "logical unit not supported" error. This should fix all of the cases where people have devices that return weird errors when they don't have media in the drive. scsi_da.c: - attach unless we get a "logical unit not supported" error scsi_pass.c: - for immediate CCBs, just malloc a CCB to send the user request in. This gets rid of the 'held' count problem in camcontrol tags. scsi_pass.h: - change the CAM ioctls to use the CAM version as their group code. adv driver: - Allow changing the sync rate and offset separately. adw driver - Allow changing the sync rate and offset separately. aha driver: - Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs. ahc driver: - Allow setting offset and sync rate separately bt driver: - Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs. NCR driver: - Fix the ultra/ultra 2 negotiation bug - allow setting both the sync rate and offset separately Other HBA drivers: - Put code in to set the base_transfer_speed field for XPT_GET_TRAN_SETTINGS CCBs. Reviewed by: gibbs, mjacob (isp), imp (aha) Notes: svn path=/head/; revision=46581
1999-04-23ahb.c:Justin T. Gibbs
Synchronize malloc types for our softc. ahc_eisa.c: Sync to aic7xxx driver bus dma and new bus changes. Notes: svn path=/head/; revision=45967
1999-04-18Implement an EISA new-bus framework. The old driver probe mechanismPeter Wemm
had a quirk that made a shim rather hard to implement properly and it was just easier to convert the drivers in one go. The changes to the buslogic driver go beyond just this - the whole driver was new-bus'ed including pci and isa. I have only tested the EISA part of this so far. Submitted by: Doug Rabson <dfr@nlsystems.com> Notes: svn path=/head/; revision=45791
1999-04-11Staticize.Eivind Eklund
Notes: svn path=/head/; revision=45577
1999-03-05Poll for bus reset completion instead of assuming that our interruptJustin T. Gibbs
is enabled. Notes: svn path=/head/; revision=44508