summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_periph.h
Commit message (Collapse)AuthorAgeFilesLines
* Change cam_periph_ioctl() to take 'cmd' and a u_long instead of anscottl2009-06-221-1/+1
| | | | | | | | | int. All of its callers pass in cmd as a u_long, so this has always been a dangerous type demotion. It was spooted by clang/llvm trying to do a type promotion and sign extension within cam_periph_ioctl. Submitted by: rdivacky
* Periph driver fixes, second try.trasz2008-12-191-0/+1
| | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Inline cam_periph_lock|unlock to make debugging easier. Use morescottl2007-04-191-2/+13
| | | | CAM_SIM_LOCK() more uniformly.
* Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willscottl2007-04-151-1/+5
| | | | | | | | | | | 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.
* Start each of the license/copyright comments with /*-imp2005-01-051-1/+1
|
* Remove the camnet swi and CAM_PERIPH_NET. It has never been used, and givenscottl2004-10-051-2/+1
| | | | | that netowrk-over-scsi never really took off, there is little chance that it will ever be needed.
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-0/+2
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Centralize the devstat handling for all GEOM disk device driversphk2003-03-081-0/+2
| | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again.
* Change the peripheral driver list from a linker set to module drivenpeter2001-02-071-1/+24
| | | | | driver registration. This should allow things like da, sa, cd etc to be in seperate KLD's to the cam core and make them preloadable.
* Back out the previous change to the queue(3) interface.jake2000-05-261-4/+4
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-4/+4
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* *sigh* I must have been on something that night. Make xpt_periph ann_hibma2000-05-071-1/+1
| | | | | extern with the original in cam_xpt.c instead of replicating xpt_periph in all the sources using it (and hence not initialising it)
* Add a hack to cam that makes the cam_xpt available to the rest of then_hibma2000-04-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | kernel. Justin agress that there is no other reasonable alternative to do automatic rescans on connect. The problem is that when a new device attaches to a SIM (SCSI host controller) we need to send a XPT_SCAN_BUS command to the SIM using xpt_action. This requires however that there is a peripheral available to take the command (otherwise xpt_done and later bomb). The RESCAN ioctl uses the same periph. This enables a USB mass storage drive to do an automatic rescan on connection of the drive. The automatic dropping of a CAM entry on disconnection was already working (asynchronous event). The next thing to do is find someone to commit a change to vpo to do the same thing. Just port umass_cam_rescan and friends across to that driver. Approved by: gibbs
* Various typo's.n_hibma2000-03-151-1/+2
| | | | One minor nit. The speed was displayed wrong when below 1Mb/s.
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-2/+2
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Add the XPT_PATH_STATS and XPT_GDEV_STATS function codes. These ccbgibbs1999-05-221-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | types allow the reporting of error counts and other statistics. Currently we provide information on the last BDR or bus reset as well as active transaction inforamtion, but this will be expanded as more information is added to aid in error recovery. Use the 'last reset' information to better handle bus settle delays. Peripheral drivers now control whether a bus settle delay occurs and for how long. This allows target mode peripheral drivers to avoid having their device queue frozen by the XPT for what shoudl only be initiator type behavior. Don't perform a bus reset if the target device is incapable of performing transfer negotiation (e.g. Fiber Channel). If we don't perform a bus reset but the controller is capable of transfer negotiations, force negotiations on the first transaction to go to the device. This ensures that we aren't tripped up by a left over negotiation from the prom, BIOS, loader, etc. Add a default async handler funstion to cam_periph.c to remove duplicated code in all initiator type peripheral drivers. Allow mapping of XPT_CONT_TARGET_IO ccbs from userland. They are itentical to XPT_SCSI_IO ccbs as far as data mapping is concerned.
* Fix a problem with the way we handled device invalidation when attachingken1998-10-221-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to a device failed. In theory, the same steps that happen when we get an AC_LOST_DEVICE async notification should have been taken when a driver fails to attach. In practice, that wasn't the case. This only affected the da, cd and ch drivers, but the fix affects all peripheral drivers. There were several possible problems: - In the da driver, we didn't remove the peripheral's softc from the da driver's linked list of softcs. Once the peripheral and softc got removed, we'd get a kernel panic the next time the timeout routine called dasendorderedtag(). - In the da, cd and possibly ch drivers, we didn't remove the peripheral's devstat structure from the devstat queue. Once the peripheral and softc were removed, this could cause a panic if anyone tried to access device statistics. (one component of the linked list wouldn't exist anymore) - In the cd driver, we didn't take the peripheral off the changer run queue if it was scheduled to run. In practice, it's highly unlikely, and maybe impossible that the peripheral would have been on the changer run queue at that stage of the probe process. The fix is: - Add a new peripheral callback function (the "oninvalidate" function) that is called the first time cam_periph_invalidate() is called for a peripheral. - Create new foooninvalidate() routines for each peripheral driver. This routine is always called at splsoftcam(), and contains all the stuff that used to be in the AC_LOST_DEVICE case of the async callback handler. - Move the devstat cleanup call to the destructor/cleanup routines, since some of the drivers do I/O in their close routines. - Make sure that when we're flushing the buffer queue, we traverse it at splbio(). - Add a check for the invalid flag in the pt driver's open routine. Reviewed by: gibbs
* Fix a bug in the error recovery code. It was possible to have more thanken1998-10-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | one error recovery action oustanding for a given peripheral. This is bad for several reasons. The first problem is that the error recovery actions would likely be to fix the same problem. (e.g., we queue 5 CCBs to a disk, and the first one comes back with 0x04,0x02. We start error recovery, and the second one comes back with the same status. Then the third one comes back, and so on. Each one causes the drive to get nailed with a start unit, when we really only need one.) The other problem is that we only have space to store one CCB while we're doing error recovery. The subsequent error recovery actions that got started were over-writing the CCBs from previous error recovery actions, but we still tried to call the done routine N times for N error recovery actions. Each call to dadone() was done with the same CCB, though. So on the second one, we got a "biodone: buffer not busy" panic, since the buffer in question had already been through biodone(). In any case, this fixes things so that any any given time, there's only one error recovery action outstanding for any given peripheral driver. Reviewed by: gibbs Reported by: Philippe Regnauld <regnauld@deepo.prosa.dk> [ Philippe wins the "bug finder of the week" award ]
* CAM Transport Layer (XPT).gibbs1998-09-151-0/+135
Submitted by: The CAM Team
OpenPOWER on IntegriCloud