aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ahb
Commit message (Collapse)AuthorAgeFilesLines
* Reform the busdma API so that new types may be added without modifyingKonstantin Belousov2013-02-121-59/+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>) Notes: svn path=/head/; revision=246713
* Add locking to the ahb(4) driver and mark it MPSAFE.John Baldwin2012-10-152-105/+93
| | | | | | | | | | | | | - 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
* Remove a stale comment.Scott Long2012-03-121-1/+0
| | | | | | | Submitted by: jimharris Notes: svn path=/head/; revision=232886
* Final pass at having devices use their bus parent for dma tags. TheScott Long2012-03-121-2/+2
| | | | | | | | | | | | | | | | | | 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
* Fix a compile error from the last change.Scott Long2007-06-171-1/+1
| | | | Notes: svn path=/head/; revision=170883
* Prepare for future integration between CAM and newbus. xpt_bus_registerScott Long2007-06-172-5/+7
| | | | | | | | | | 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
* Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willScott Long2007-04-151-1/+1
| | | | | | | | | | | | | | 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
* Handle errors from bus_setup_intr().Alexander Leidinger2007-04-011-2/+4
| | | | | | | | Found by: Coverity Prevent (tm) CID: 1066 Notes: svn path=/head/; revision=168219
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+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@ Notes: svn path=/head/; revision=166901
* Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed.Matt Jacob2006-12-111-0/+2
| | | | | | | | PR: 106543 MFC after: 3 days Notes: svn path=/head/; revision=165102
* 2nd and final commit that moves us to CAM_NEW_TRAN_CODEMatt Jacob2006-11-021-33/+0
| | | | | | | | | as the default. Reviewed by multitudes. Notes: svn path=/head/; revision=163896
* The first of 3 major steps to move the CAM layer forward to usingMatt Jacob2006-10-311-5/+55
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix missing update to reflect change in scsi_inquiry data structure.Matt Jacob2006-05-311-1/+1
| | | | Notes: svn path=/head/; revision=159105
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-291-1/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-062-2/+2
| | | | Notes: svn path=/head/; revision=139749
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-4/+2
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* Make this at least compile on 64 bit platforms. Its been breakingAndrew Gallatin2003-07-301-1/+2
| | | | | | | the alpha tinderbox for far too long. Notes: svn path=/head/; revision=118225
* Mega busdma API commit.Scott Long2003-07-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge common XPT_CALC_GEOMETRY functions into a single convenience function.Nate Lawson2003-06-141-18/+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 Notes: svn path=/head/; revision=116351
* Bring back bus_dmasync_op_t. It is now a typedef to an int, though theScott Long2003-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) Notes: svn path=/head/; revision=115343
* I deserve a big pointy hat for having missed all those referencesMaxime Henrion2003-04-101-2/+2
| | | | | | | to bus_dmasync_op_t in my last commit. Notes: svn path=/head/; revision=113350
* Clean up argument comments for bus_dma_tag_create() calls.Matthew N. Dodd2003-03-291-17/+26
| | | | Notes: svn path=/head/; revision=112782
* Consolidate MIN/MAX macros into one place (param.h).Alfred Perlstein2003-02-021-2/+0
| | | | | | | Submitted by: Hiten Pandya <hiten@unixdaemons.com> Notes: svn path=/head/; revision=110232
* Fix new gcc-3.1 warnings. I think this gets GENERIC compiling cleanlyPeter Wemm2002-05-241-0/+1
| | | | | | | again. Notes: svn path=/head/; revision=97208
* Turn on interrupt-entropy harvesting for all/any mass storage devicesMark Murray2001-03-011-1/+1
| | | | | | | | | | 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
* Add the use of M_ZERO to some malloc calls.David Malone2000-10-291-2/+1
| | | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Approved by: gibbs Notes: svn path=/head/; revision=67888
* Convert all users of fldoff() to offsetof(). fldoff() is badPoul-Henning Kamp2000-10-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove unneeded #include <machine/clock.h>Poul-Henning Kamp2000-10-151-1/+0
| | | | Notes: svn path=/head/; revision=67164
* Fix typo (accessable --> accessible).Alexander Langer2000-06-141-1/+1
| | | | | | | | | PR: 18588 Submitted by: Anatoly Vorobey <mellon@pobox.com> Reviewed by: asmodai Notes: svn path=/head/; revision=61686
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-3/+3
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-3/+3
| | | | | | | | | | | 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
* Remove #include "eisa.h" and #if NEISA > 0Peter Wemm2000-01-291-4/+0
| | | | Notes: svn path=/head/; revision=56872
* Use rman_get_bustag and rman_get_bushandle to initialize bus tag andYoshihiro Takahashi2000-01-171-5/+5
| | | | | | | bus handle. Notes: svn path=/head/; revision=56177
* Pre 4.0 tidy up.Peter Wemm2000-01-141-2/+2
| | | | | | | | | | | | | | | 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
* $Id$ -> $FreeBSD$Peter Wemm1999-08-282-2/+2
| | | | Notes: svn path=/head/; revision=50477
* Properly set the alignment argument to bus_dma_tag_create(). If weJustin T. Gibbs1999-08-161-3/+3
| | | | | | | don't care about the alignment, set it to 1, meaning single byte alignment. Notes: svn path=/head/; revision=49860
* Move the specification of EDGE/LEVEL triggered interrupts toMatthew N. Dodd1999-08-011-6/+13
| | | | | | | | | | | | | | | | | | | | 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
* Move the declaration of the interrupt type from the driver structureDoug Rabson1999-05-081-3/+2
| | | | | | | to the BUS_SETUP_INTR call. Notes: svn path=/head/; revision=46743
* Add a number of interrelated CAM feature enhancements and bug fixes.Kenneth D. Merry1999-05-061-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ahb.c:Justin T. Gibbs1999-04-231-3/+3
| | | | | | | | | | 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
* Implement an EISA new-bus framework. The old driver probe mechanismPeter Wemm1999-04-181-91/+97
| | | | | | | | | | | | 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
* Staticize.Eivind Eklund1999-04-111-2/+2
| | | | Notes: svn path=/head/; revision=45577
* Poll for bus reset completion instead of assuming that our interruptJustin T. Gibbs1999-03-051-2/+7
| | | | | | | is enabled. Notes: svn path=/head/; revision=44508
* Correct test in poll loop for determining that the mailbox is free toJustin T. Gibbs1999-01-281-7/+2
| | | | | | | accept a new command. Notes: svn path=/head/; revision=43316
* Fix parenthesization, but the code still looks wrong.Matthew Dillon1999-01-281-2/+7
| | | | Notes: svn path=/head/; revision=43312
* Hook up ahapoll so that dumps, synchronize cache commands or any otherJustin T. Gibbs1998-10-091-1/+2
| | | | | | | command that comes in through xpt_polled_action works correctly. Notes: svn path=/head/; revision=40132
* Use %p with (void *) casts to print pointers with printf.Justin T. Gibbs1998-09-171-4/+4
| | | | Notes: svn path=/head/; revision=39390
* Fix printf format bugs.Justin T. Gibbs1998-09-161-17/+18
| | | | Notes: svn path=/head/; revision=39324
* Adaptec 174x EISA SCSI Host Adapter driver for CAM.Justin T. Gibbs1998-09-152-0/+1627
Notes: svn path=/head/; revision=39219