summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert the xpt, pass, pt and target drivers to use the newken1999-11-171-1/+1
| | | | make_dev()/destroy_dev() interface.
* Fix Bus Device Resets from userland, and specifically from camcontrol.ken1999-10-311-1/+1
| | | | | | | | | | | camcontrol was setup to use the old scheme of going through the xpt(4) device, which never worked properly (and has been disabled for a while). camcontrol now sends BDRs through the pass(4) device, and XPT_RESET_DEV CCBs are put on the device queue in the transport layer, as they should be. Submitted by: luoqi Reviewed by: ken
* Protect xpt_run_dev_sendq in xpt_release_devq_device with splsoftcam. Thismjacob1999-10-161-3/+5
| | | | | | seems to handle the case of timeouts firing during probe but after a device has gone away. It really does help. Obtained from:gibbs@freebsd.org
* Removal of sys/device.hn_hibma1999-10-051-1/+0
| | | | | | | | | | | | | - Move intrhook stuff into kernel.h - Remove all occurrences of #device <device.h> - Add kernel.h were necessary (nowhere) - delete device.h This file contained the structures for cfdata (old style config) and is no longer used. It was included by most drivers. It confuses the remote debugger as the definition of 'struct device' in device.h is found before the one in bus_private.h.
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-5/+1
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* Implement the guts of the XPT_ABORT function code.gibbs1999-08-161-31/+111
| | | | | | | | | | | | | | | | Clear residuals for XPT_TARGET_IO/XPT_CONT_TARGET_IO calls just as we do for XPT_SCSI_IO calls. Make xpt_release_devq a proper reciprocal of xpt_freeze_devq by allowing the caller to decrement the count more than once per call. Change the semantics of xpt_path_cmp to return 1 for a match with a wildcard from path1 and 2 for a match with wildcards from path2. This change doesn't affect most callers as they only check for >=0 (exact match or one containing a wildcard). When cleaning up a device node, ensure that there are no timeouts outstanding that reference it.
* Put in a limit (8) for lun width- do not exceed probing this unless a devicemjacob1999-08-161-3/+9
| | | | | | | is quirked for allowing it. This will allow SCSI cards to specify their true correct lun width (32 for Qlogic SCSI, 16 or 65536 for Qlogic Fibre Channel) without crippling the system because of f/w breakage of a lot of drives. Reviewed by: gibbs@freebsd.org
* disable tag queing for the MICROP 4421-07 drive. It's an old 2gig drive.jmg1999-07-111-2/+8
| | | | convert MICROP to a static string
* Quirk NOLUNS cabletron device.mjacob1999-06-201-16/+15
| | | | | PR: 11677 Submitted by: "Matthew N. Dodd" <winter@jurai.net>
* Simplify cdevsw registration.phk1999-05-311-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* This commit should be a extensive NO-OP:phk1999-05-301-22/+21
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* Run xpt_action at splsoftcam() so that it cannot be re-entered by our SWI.gibbs1999-05-251-1/+5
| | | | | | | The XPT doesn't have a problem with this itself, but some controllers drivers may have been caught off guard by the old behavior. XPT_CONT_TARGET_IO is also a valid ccb type for cam_periph_unmapmem.
* Rely on the statistics in XPT_GDEV_STATS instead of the versions stillgibbs1999-05-231-1/+9
| | | | | retained in XPT_GDEV_TYPE for binary compatibility. Mark the legacy structure values for removal when we bump the major CAM revision.
* Add the XPT_PATH_STATS and XPT_GDEV_STATS function codes. These ccbgibbs1999-05-221-111/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Make xpt_path_comp work on wildcarded paths again.gibbs1999-05-181-7/+7
|
* Quirk this drive- all luns show up the same.mjacob1999-05-111-1/+11
| | | | Submitted by: Stephen McKay <syssgm@detir.qld.gov.au>
* Quirk NOLUNS CALIPER CP150.mjacob1999-05-111-1/+11
|
* Add a number of interrelated CAM feature enhancements and bug fixes.ken1999-05-061-23/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Release bus entries in the EDT when a path is released.gibbs1999-04-231-4/+14
| | | | | Null out path entries when the path is released to catch bugs. Free our configuration hook when we're done with it.
* Stage 1 of a cleanup of the i386 interrupt registration mechanism.peter1999-04-211-3/+1
| | | | | | | Interrupts under the new scheme are managed by the i386 nexus with the awareness of the resource manager. There is further room for optimizing the interfaces still. All the users of register_intr()/intr_create() should be gone, with the exception of pcic and i386/isa/clock.c.
* cam_periph.c:gibbs1999-04-191-23/+22
| | | | | | | | | | | | | | | | | Move handling of CAM_AUTOSENSE_FAIL into block dealing with all other scsi status errors. cam_queue.c: cam_queue.h: Fix 'off by one' heap bug in a more efficient manner. Since heap algorithms like to deal with indexes started from 1, offset our heap array pointer at allocation time to make this so for a C environment. This makes the implementation of the algorithm a bit more efficient. cam_xpt.c: Use macros for accessing the head of the heap so that code is isolated from implementation details of the heap.
* Well folks, this is it - The second stage of the removal for build supportpeter1999-04-171-2/+2
| | | | for LKM's..
* Remove camq_regen(). We already perform modular comparisonsgibbs1999-04-071-22/+20
| | | | | | | for generation counts, so no further steps to deal with generation count wrap are required. Fix an off by one problem in the camq heap code.
* Disable tagged queueing for the IBM DCAS drives. These drives have poorken1999-03-141-1/+30
| | | | | | | | | | | | | | | write performance when tagged queueing is enabled. Although the PR was submitted for the 4 gig version of this drive, the assumption is that the 2 gig version has the same problem. Therefore tagged queueing is disabled for both. Also, update the comment for the Western Digital Enterprise drives to note that the best performance for those drives is achieved when tagged queueing is disabled and write caching is enabled. PR: kern/10398 Submitted by: Hideaki Okada <hokada@isl.melco.co.jp>
* People who wanted the "tagged opening" message can boot -v. The restjkh1999-03-111-2/+2
| | | | | of us, who appear to have complained incessantly about this message since it appeared, can now stop.
* The 4 gig version of the Seagate Medalist Pro seems to have the sameken1999-03-071-5/+21
| | | | | | | | | | | trouble with tagged queueing as the 6.5 gig version. So, I've added a quirk entry for it to limit it to two outstanding transactions at a time, just like the 6.5G version. While I'm at it, add a quirk for the 9G version of the drive, since it most likely has the same problem. Submitted by: Jeremy Lea <reg@shale.csir.co.za>
* Protect access to the EDT with splcam() to protect against corruptiongibbs1999-03-051-35/+96
| | | | | | | | | | | | | | | | | | caused by temporary EDT allocations performed by controller drivers in their interrupt routiens. Reference count bus entries in the EDT in preparation for support for dynamic controller arrival and departure. Have children of the EDT hold references to their parents. Correct routing of the XPT_IMMED_NOTIFY ccb type for use in target mode applications. Fix a few cases where the generation count for EDT data members was not being updated when a modification occurred. splcam() problem Noticed by: Tor Egge <tegge@FreeBSD.org>
* Add a quirk entry for the Seagate Medalist Pro 6 gig drive. It seems thisken1999-02-261-4/+16
| | | | | | | | | | | drive has very poor write performance (1.4MB/sec vs. 12MB/sec) with anything more than two oustanding transactions. So, this limits the number of tagged commands to two for that drive. Thanks to Paul van der Zwan for doing a whole lot of testing to confirm this. Reported by: Paul van der Zwan <paulz@trantor.xs4all.nl>
* Fix sync rate and transfer rate printouts in xpt_announce_periph().ken1999-02-181-6/+18
| | | | | | | | | | | Sync rates like 4.032MHz were getting printed as 4.32MHz. Also, add a quirk entry for the 18G Quantum Atlas III. Like most other recent Quantum drives, it bogusly reports queue full. Thanks to Andre Albsmeier <andre.albsmeier@mchp.siemens.de> for the Atlas III inquiry information. Reviewed by: gibbs
* Fix warnings preparing for -Wall -Wcast-qualdillon1999-01-271-2/+2
| | | | | Also disable one usb module in LINT due to fatal compilation errors, temporary.
* put it back the way it wasmjacob1999-01-201-9/+2
|
* temporary fix so alpha stays working while configure code is fixedmjacob1999-01-201-2/+9
|
* By popular demand, back out the CONNER CFP* quirk entry, and return it token1999-01-201-2/+2
| | | | | | | its original form. (Originally, it only applied to the CFP 2107.) Hopefully we can come to some conclusion about which Conner drives are broken for tagged queueing.
* The Samsung WN34324U is broken for tagged queueing.ken1999-01-191-2/+13
| | | | | PR: kern/9535 Submitted by: NAKAJI Hiroyuki <nakaji@zeisei.dpri.kyoto-u.ac.jp>
* Generalize the quirk entry for the Conner CFP* drives. It did just coverken1999-01-191-4/+24
| | | | | | | | | | | | | | | | the CFP2107, but it appears (not surprisingly) that the 1 gig and 4 gig versions of that drive have the same problem with tagged queueing. Also, fix the problem reported in PR kern/9482. The XPT_DEV_MATCH case in xptioctl() wasn't putting a proper path in the CCB before it called xpt_action(). When CAMDEBUG is defined, and CAM_DEBUG_TRACE debugging is turned on, the CAM_DEBUG statement at the beginning of xpt_action would end up deferencing a NULL path pointer. That of course caused a panic. My solution is to just stick the xpt peripheral's path in the CCB. PR: kern/9482 Reviewed by: gibbs
* Call the xpt_init() hook during at the start of the configure() processpeter1999-01-191-5/+7
| | | | | via SYSINIT(). This gets a little closer to making cam useable as a module.
* Add support for wildcard device entries in the EDT. The target modegibbs1999-01-141-94/+42
| | | | | | | | | | | | | | | 'Black Hole' device uses this feature to schedule itself against any target or lun attached to a controller that receives an unwanted request from an initiator instead of having an instance per potential target/lun request. Use the wildcard entries to simplify wildcard async callback storage. Don't announce devices twice to peripheral drivers. The devices will be announced as soon as the AC_PATH_REGISTERED event is registered by the peripheral driver, so no manaul push of this event is required. Reviewed by: Kenneth Merry <ken@FreeBSD.org>
* The Quantum Atlas III evidently has an identical problem to the Atlas II.ken1999-01-071-1/+22
| | | | | | | | | | | It keeps returning queue full until we have reduced the number of tagged openings to the minimum. So, put in a quirk entry with the same work-around. This quirk entry is only for the 9G Atlas III, once someone comes up with inquiry information for the 18G version of that drive, we can quirk it as well. Submitted by: "Johan Granlund" <johan@granlund.nu>
* The Conner CFP2107 is a fixed-media drive, not removable media. This fixesken1999-01-051-2/+10
| | | | | | | | | | | | | the quirk that disables tagged queueing for those drives. Also, silence a warning by disabling xpt_for_all_targets() and xpt_for_all_periphs(). These two functions are not currently used, but they should not be removed. They're part of a set of functions that provide a way to execute a function for every {bus,target,device,periph} in the system. If anyone needs to use either function in the future, they can be un-#ifdefed.
* a more correct change that should meet the sniff testmjacob1998-12-241-14/+10
|
* Unstaticize swi_camnet && swi_cambio so Alpha kernels can build again.mjacob1998-12-241-3/+3
|
* Staticize.eivind1998-12-221-6/+6
| | | | Reviewed by: gibbs
* Wire up the XPT_ABORT and XPT_RESET_DEV ccb function codes so they cangibbs1998-12-151-5/+5
| | | | | | be delivered to controller drivers. Adjust for changes to the ccb_hdr list types in cam_queue.h
* Expand the hba_misc fied in the Path Inquiry ccb to allow a controller drivergibbs1998-12-101-8/+62
| | | | | | | | to specify that it does not provide initiator services (PIM_NOINITIATOR) and that the initial bus reset for device probing should be avoided (PIM_NOBUSRESET). Modify the XPT layer to honor these flags.
* use CAM_DEBUG_XPT to track XPT; correct a misspellingmjacob1998-12-061-13/+16
|
* This old firmware of the TDC3620 hangs the SCSI bus upon serialjoerg1998-11-251-1/+12
| | | | number requests. Don't ask it so.
* Generalize the quirk entry that disables multi-lun probing for Sony CDROMken1998-11-041-4/+3
| | | | | | | drives. It seems that quite a few (possibly all?) of their drives respond to inquiries on multiple luns. Hopefully we can detect problems like this in the probe phase at some point. For now, this is a pretty functional solution.
* Fix a problem with the way we handled device invalidation when attachingken1998-10-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud