aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/trm
Commit message (Collapse)AuthorAgeFilesLines
* MFp4: Large set of CAM inprovements.Alexander Motin2010-01-281-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Unify bus reset/probe sequence. Whenever bus attached at boot or later, CAM will automatically reset and scan it. It allows to remove duplicate code from many drivers. - Any bus, attached before CAM completed it's boot-time initialization, will equally join to the process, delaying boot if needed. - New kern.cam.boot_delay loader tunable should help controllers that are still unable to register their buses in time (such as slow USB/ PCCard/ CardBus devices), by adding one more event to wait on boot. - To allow synchronization between different CAM levels, concept of requests priorities was extended. Priorities now split between several "run levels". Device can be freezed at specified level, allowing higher priority requests to pass. For example, no payload requests allowed, until PMP driver enable port. ATA XPT negotiate transfer parameters, periph driver configure caching and so on. - Frozen requests are no more counted by request allocation scheduler. It fixes deadlocks, when frozen low priority payload requests occupying slots, required by higher levels to manage theit execution. - Two last changes were holding proper ATA reinitialization and error recovery implementation. Now it is done: SATA controllers and Port Multipliers now implement automatic hot-plug and should correctly recover from timeouts and bus resets. - Improve SCSI error recovery for devices on buses without automatic sense reporting, such as ATAPI or USB. For example, it allows CAM to wait, while CD drive loads disk, instead of immediately return error status. - Decapitalize diagnostic messages and make them more readable and sensible. - Teach PMP driver to limit maximum speed on fan-out ports. - Make boot wait for PMP scan completes, and make rescan more reliable. - Fix pass driver, to return CCB to user level in case of error. - Increase number of retries in cd driver, as device may return several UAs. Notes: svn path=/head/; revision=203108
* Remove extraneous semicolons, no functional changes.Martin Blapp2010-01-071-1/+1
| | | | | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week Notes: svn path=/head/; revision=201758
* Separate the parallel scsi knowledge out of the core of the XPT, andScott Long2009-07-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modularize it so that new transports can be created. Add a transport for SATA Add a periph+protocol layer for ATA Add a driver for AHCI-compliant hardware. Add a maxio field to CAM so that drivers can advertise their max I/O capability. Modify various drivers so that they are insulated from the value of MAXPHYS. The new ATA/SATA code supports AHCI-compliant hardware, and will override the classic ATA driver if it is loaded as a module at boot time or compiled into the kernel. The stack now support NCQ (tagged queueing) for increased performance on modern SATA drives. It also supports port multipliers. ATA drives are accessed via 'ada' device nodes. ATAPI drives are accessed via 'cd' device nodes. They can all be enumerated and manipulated via camcontrol, just like SCSI drives. SCSI commands are not translated to their ATA equivalents; ATA native commands are used throughout the entire stack, including camcontrol. See the camcontrol manpage for further details. Testing this code may require that you update your fstab, and possibly modify your BIOS to enable AHCI functionality, if available. This code is very experimental at the moment. The userland ABI/API has changed, so applications will need to be recompiled. It may change further in the near future. The 'ada' device name may also change as more infrastructure is completed in this project. The goal is to eventually put all CAM busses and devices until newbus, allowing for interesting topology and management options. Few functional changes will be seen with existing SCSI/SAS/FC drivers, though the userland ABI has still changed. In the future, transports specific modules for SAS and FC may appear in order to better support the topologies and capabilities of these technologies. The modularization of CAM and the addition of the ATA/SATA modules is meant to break CAM out of the mold of being specific to SCSI, letting it grow to be a framework for arbitrary transports and protocols. It also allows drivers to be written to support discrete hardware without jeopardizing the stability of non-related hardware. While only an AHCI driver is provided now, a Silicon Image driver is also in the works. Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware is possible and encouraged. Help with new transports is also encouraged. Submitted by: scottl, mav Approved by: re Notes: svn path=/head/; revision=195534
* Prepare for future integration between CAM and newbus. xpt_bus_registerScott Long2007-06-171-1/+1
| | | | | | | | | | 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-0/+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
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+1
| | | | | | | | | | | | | | | | 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/+1
| | | | | | | | 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-139/+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/+161
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Since DELAY() was moved, most <machine/clock.h> #includes have beenPoul-Henning Kamp2006-05-161-1/+0
| | | | | | | unnecessary. Notes: svn path=/head/; revision=158651
* 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
* Use BUS_PROBE_DEFAULT in preference to 0. Also for vx, returnWarner Losh2005-03-011-2/+2
| | | | | | | | BUS_PROBE_LOW_PRIORITY in stead of ifdef for devices that xl and vx both support so that xl will snarf them on up. Notes: svn path=/head/; revision=142880
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-062-4/+5
| | | | Notes: svn path=/head/; revision=139749
* Add missing <sys/module.h> includesPoul-Henning Kamp2004-05-301-0/+1
| | | | Notes: svn path=/head/; revision=129879
* Call trm_Interrupt() in trm_poll(). This fixes the lock at reboot time someOlivier Houchard2004-04-101-1/+1
| | | | | | | | | | people reported. PR: kern/62864 Tested by: Putinas Piliponis <putinas.piliponis at icnspot.net> Notes: svn path=/head/; revision=128090
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-4/+4
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* Use one bus_dma_tag_t for all pSRB instead of creating one for each.Olivier Houchard2004-03-072-25/+50
| | | | | | | | Free what is allocated for pSRBs at unload time or if something bad happens, thanks to scottl for spotting this out. Notes: svn path=/head/; revision=126725
* Do not test if pDCB is not NULL, we dereference it before anyway, and itOlivier Houchard2004-02-201-3/+2
| | | | | | | | | | should not happen. Add a KASSERT instead. Reported by: Ted Unangst <tedu@coverity.com> Spotted out by: cperciva Notes: svn path=/head/; revision=126053
* Remove duplicate __FBSDID().Olivier Houchard2004-01-091-3/+1
| | | | | | | Mark trm as depending on cam. Notes: svn path=/head/; revision=124318
* Use PCIR_BAR(x) instead of PCIR_MAPS.John Baldwin2003-09-021-4/+4
| | | | | | | | Glanced over by: imp, gibbs Tested by: i386 LINT Notes: svn path=/head/; revision=119690
* Use __FBSDID().David E. O'Brien2003-08-241-0/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Prefer new location of pci include files (which have only been in theWarner Losh2003-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. Notes: svn path=/head/; revision=119287
* Remove two useless bzero() calls.Maxime Henrion2003-08-121-2/+0
| | | | | | | Reviewed by: cognet Notes: svn path=/head/; revision=118827
* Call bus_dmamap_create() to create the per-SRB buffer maps. Note that noneScott Long2003-08-091-0/+12
| | | | | | | | of the SRB resources are freed when the driver unloads; maybe that will be tackled another day. Notes: svn path=/head/; revision=118693
* Mega busdma API commit.Scott Long2003-07-011-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix some style bugs.Olivier Houchard2003-06-251-49/+50
| | | | Notes: svn path=/head/; revision=116813
* Merge common XPT_CALC_GEOMETRY functions into a single convenience function.Nate Lawson2003-06-141-21/+2
| | | | | | | | | | | | | | | | 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
* Fix indentation.Poul-Henning Kamp2003-05-311-1/+1
| | | | | | | Found by: FlexeLint Notes: svn path=/head/; revision=115513
* Bring back bus_dmasync_op_t. It is now a typedef to an int, though theScott Long2003-05-271-1/+1
| | | | | | | | | | | 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
* Merge diff between rev 1.08 and rev 1.11 of Tekram driver, this notably addOlivier Houchard2003-02-202-402/+733
| | | | | | | | | support for Tekram DC395U2W cards. Add a fix submitted by joerg@ to correctly report some errors to CAM. Use bus_dma instead of the remaining vtophys(). Notes: svn path=/head/; revision=111158
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-2/+2
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-2/+2
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Fix the panic that occurs when kldunloading trm by using the correctOlivier Houchard2002-12-162-29/+51
| | | | | | | | | | | prototype for trm_detach and freeing all resources. While I'm there, handle better errors in trm_attach and remove the PCI_BASE_ADDR0 definition, since it's what PCIR_MAPS is used for. MFC after: 3 days Notes: svn path=/head/; revision=107928
* Remove the remaining calls to free(), they are not needed anymore nowOlivier Houchard2002-11-141-9/+0
| | | | | | | device_get_softc() is used. Notes: svn path=/head/; revision=106922
* Import of the trm(4) driver (for Tekram DC395U/UW/F and DC315U SCSI adapters).Olivier Houchard2002-10-132-0/+4352
Reviewed by: mux, scottl Approved by: mux, scottl Notes: svn path=/head/; revision=105059