summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi
Commit message (Collapse)AuthorAgeFilesLines
* Move initialization of announce_buf up to makemjacob1999-08-151-2/+3
| | | | sure it is initialized in all cases.
* Spring cleaning around strategy and disklabels/slices:phk1999-08-142-23/+7
| | | | | | | | | | | | | | Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout. please see comment in sys/conf.h about the flag argument. Remove strategy argument from all the diskslice/label/bad144 implementations, it should be found from the dev_t. Remove bogus and unused strategy1 routines. Remove open/close arguments from dssize(). Pick them up from dev_t. Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
* Merge the cons.c and cons.h to the best of my ability. alpha may orphk1999-08-091-2/+2
| | | | may not compile, I can't test it.
* Fix my complete botch. I hope. Tested this timemjacob1999-07-071-5/+5
|
* suggestions from bde to clean up last checkin slightymjacob1999-07-061-4/+4
|
* Make the change similar to that suggested by Nick Hibma to avoid divide bymjacob1999-07-031-3/+4
| | | | | | | zero traps. I actually can't believe that this compiler is *sooooo* stupid that it did a divide when there was 1024L*1024L instead of a right shift by 20. When we get quad type modifiers in kernel printf we can change to this too (to avoid overflow on > terabyte disk sizes).
* A minor tweak to shut up gcc (on the Alpha) for two (false) warnings.peter1999-07-031-2/+5
| | | | | How it can think that something that is initialized at declaration can be used while uninitialized is beyond me.
* Quirk Tandberg 4100 like Tandberg 4200.mjacob1999-06-241-1/+5
| | | | | | PR: 11675 Reviewed by: msmith@FreeBSD.ORG Submitted by: blank@uni-trier.de
* Simplify cdevsw registration.phk1999-05-317-25/+14
| | | | | | | | | | | | | | | | | | | | | | | | | 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-307-152/+146
| | | | | | | | | | | | | 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.
* Add TDC 3800 to quirk list for fixed mode device.mjacob1999-05-251-1/+5
| | | | | PR:11866 Submitted by: Helge Oldach hmo@sep.hamburg.com
* Add a default async handler funstion to cam_periph.c to remove duplicatedgibbs1999-05-228-55/+46
| | | | | | | | | code in all initiator type peripheral drivers. scsi_target.c: Release ATIO structures that wind up in the 'unkown command queue' for consumption by our userland counterpart, back to the controller when the exception for that command is cleared.
* Add a SA_FLAG_COMP_SUPP flag (to quirk compression asmjacob1999-05-111-454/+573
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SUPPORTED). Add a SA_FLAG_TAPE_FROZEN for (see below). Add a queue_count field to softc. Add HP T20* Travan-5 like tape device as a FIXED/512 type device. Works for me. Add TANDBERG SLR5 as a variable SA_QUIRK_1FM device. Change VIPER 2525 to 1024 byte blocksize. It's possible other drives should change too, but see below.. Change argument to sagetparams to be pointer to a sa_comp_t union- this can be either a DATA COMPRESSION or a DEVICE CONFIGURATION page. In general compression now tries to use the DATA COMPRESSION page and if that fails tries the DEVICE CONFIGURATION page. Change close routine to not rewind tape if there's a failure in either writing filemarks or in backing over one of two filemarks for a 2FM at EOT tape- instead mark the tape as 'frozen' and print a message saying that either an OFFLINE or REWIND or an MTEOM command is needed to clear this state (all bring certainty back to tape position). Fix sastrategy to not allow I/O to a frozen tape. Add MTIOCGETEOTMODEL/MTIOCSETEOTMODEL ioctls that get and set the EOT model for a tape drive (you can now dynamically change whether it's a 2 FM @ EOT or 1FM at EOT tape device). This ought to give folks something to handle the QIC drives we don't know about. Correctly propagate record of compression algorithm back. Clear FROZEN flag for EOM, REWIND and OFFLINE (and RETENSION and ERASE) cases. Fix an egregious bug in sadone that had left the device queue frozen for deferred (for fixed mode case) errors. Add comment in samount about how useless the test unit ready is for invalidating a mount (this has to be fixed later). Fix residual calculation (per Eivind) in saerror so that negative values for tape records being too large for the supplied buffer get caught. Do some other saerrro cleanup. Per Ken && Justin, add my name to copyright comment.
* Make clear that the DATA COMPRESSION page is a SCSI-3 entity- not a SCSI-2mjacob1999-05-111-3/+38
| | | | | | | | | entity. Add the Device Configuration page data structure- this structure should be used if you fail to fetch the DATA COMPRESSION page. Make a union type of a mode header, a device configuration page and the data compression page. Add a couple of QIC density defines (QIC 2G/QIC 4GB).
* Add a facility in the CAM error handling code to retry selection timeouts.ken1999-05-097-40/+58
| | | | | | | | | | | | | | | | | If the client requests that the error recovery code retry a selection timeout, it will be retried after half a second. The delay is to give the device time to recover. For most of these drivers, I only added selection timeout retries where they were also retrying unit attention type errors. The sa(4) driver calls saerror() in a number of places, but most of them don't request retrying unit attentions. Also, bump the default minimum CD changer timeout from 2 to 5 seconds and the maximum timeout from 10 to 15 seconds. Some Pioneer changers seem to have trouble with the shorter timeout. Reviewed by: gibbs
* Introduce two functions: physread() and physwrite() and use these directlyphk1999-05-076-86/+17
| | | | | | in *devsw[] rather than the 46 local copies of the same functions. (grog will do the same for vinum when he has time)
* Add a number of interrelated CAM feature enhancements and bug fixes.ken1999-05-064-34/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* Don't touch a path after we've free'd it.gibbs1999-05-041-4/+5
|
* Use macros for accessing the head of the heap so that codegibbs1999-04-191-2/+2
| | | | is isolated from implementation details of the heap.
* Make WangTek 51000 a fixed block device.mjacob1999-04-181-1/+5
| | | | | PR: kern/11194 Obtained from:naddy@mips.rhein-neckar.de
* Remove camq_regen(). We already perform modular comparisonsgibbs1999-04-071-12/+4
| | | | | for generation counts, so no further steps to deal with generation count wrap are required.
* Implement the control device for the "targ" target mode processor targetgibbs1999-03-052-81/+256
| | | | | | | | | | | emulator so that instances can be dynamically added and removed from the system. Properly reference count peripheral instances so they are cleaned up when destroyed by the control device. Set a timeout for test unit ready commands. Before it was uninitialized and could cause us to drop off the bus when no real timeout had occurred.
* Silence errors.gibbs1999-03-051-4/+11
| | | | | Reduce the number of accept target I/O entries we allow to better exercise the resource shortage handling code in controller drivers.
* Silence complaints about synchronize cache requests that fail with illegalgibbs1999-03-051-5/+33
| | | | request.
* +Match against T4000* for HP QIC quirks (not T4000S* where it doesn't thenmjacob1999-03-011-14/+28
| | | | | | | | | | catch a T4000s) + Set *some* kind of error at EOM if we're in fixed mode and have pending errs. Do not clear the ERR_PENDING bit if more buffers are queued. + Release the start_ccb in this case also, else we hang forever on rewinding. + Any kind of error for load to BOT in samount should then cause an attempt to use REWIND to come back to BOT. Do the initial load command quietly. + In samount, if we succeed, set the relative position markers.
* Completely set information in the transaction description before performinggibbs1999-02-111-4/+4
| | | | a selwakeup for it. Cosmetic.
* Add a prioritization field to the devstat_add_entry() call so thatken1999-02-106-15/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | peripheral drivers can determine where in the devstat(9) list they are inserted. This requires recompilation of libdevstat, systat, vmstat, rpc.rstatd, and any ports that depend on the devstat code, since the size of the devstat structure has changed. The devstat version number has been incremented as well to reflect the change. This sorts devices in the devstat list in "more interesting" to "less interesting" order. So, for instance, da devices are now more important than floppy drives, and so will appear before floppy drives in the default output from systat, iostat, vmstat, etc. The order of devices is, for now, kept in a central table in devicestat.h. If individual drivers were able to make a meaningful decision on what priority they should be at attach time, we could consider splitting the priority information out into the various drivers. For now, though, they have no way of knowing that, so it's easier to put them in an easy to find table. Also, move the checkversion() call in vmstat(8) to a more logical place. Thanks to Bruce and David O'Brien for suggestions, for reviewing this, and for putting up with the long time it has taken me to commit it. Bruce did object somewhat to the central priority table (he would rather the priorities be distributed in each driver), so his objection is duly noted here. Reviewed by: bde, obrien
* quiet the alpha compilermjacob1999-02-051-3/+3
|
* Extend unit numbers to a full 10 bits (split into sectionsmjacob1999-02-051-72/+323
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the minor). Establish and use a control mode open. Control mode opens may open the device without locking, but are prohibited from all but some ioctls. MTIOCGET always works. MTIOCERRSTAT works, but the clearing of latched error status is contingent upon whether another application has the device open, in which case an interruptible perip acquire is done. MTSETBSIZ, MTSETDNSTY and MTCOMP also require a periph aquire. Relative fileno and blkno are tracked. Note that just about any error will make these undefined, and if you space to EOD or use hardware block positioning, these are also lost until the next UNLOAD or REWIND. Driver state is also tracked and recorded in the unit softc to be passed back in mt_dsreg for a MTIOCGET call. Thanks to Dan Strick for suggesting this. Reintroduce 2 filemarks at EOD for all but QIC devices. I really think it's wrong, but there is a lot of 3rd party software that depends upon this (not the least of which is tcopy). Introduce a SA_QUIRK_1FM to ensure that some devices can be marked as only being able to do 1 FM at EOD. At samount time force a load to BOT if we aren't mounted. If the LOAD command fails, use the REWIND command (e.g., for the IBM 3590 which for some gawdawful reason doesn't support the LOAD (to BOT) command). Also at samount time, if you don't know fixed or variable, try to *set* to one of the known fixed (or variable, for special case) density codes. We only have to do this once per boot, so it's not that painful. This is another way to try and figure out the wierd QIC devices without having to quirk everything in the universe. A substantial amount of cleanup as to what operations can and what operations cannot be retried. Don't retry space operations if they fail- it'll just lead to lossage. Not yet done is invalidating mounts correctly after errors. ENOTIME.
* add QIC 525,320,1320,3080 codesmjacob1999-02-051-1/+4
|
* Sascha Blank <blank@uni-trier.de> convinced me I was anmjacob1999-01-161-20/+22
| | | | | | | | | | idiot about testing SA_QUIRK_2FM in samount. Fixed. Removed the NORRLS quirk (to save quirk space) and left the behaviour of being quiet about failed reserve/release (failed due Illegal Request) the same. Added a SF_QUIET_IR for prevent/allow for the same purposes.
* More bandaids. One important one from Sascha Blankmjacob1999-01-161-164/+92
| | | | | | | | | | | | | (<blank@fox.uni-trier.de>) about quirks being set as arithmetic values, not as bitfields. Add HP, Kennedy and M4 1/2" reel quirk entries. Do a lot of gratuitous source changing. Audit all functions that build ccbs for the tape driver and decide whether each one can be retried or not. Still to do is some more state management post errors.
* The target mode 'Black Hole' device. This peripheral driver provides inquirygibbs1999-01-141-0/+715
| | | | | | | | data and sense information for target mode devices for which no other peripheral driver is attached. This simplifies the task of dealing with luns that are not otherwise enabled for target mode if the controller does not have firmware that automatically deals with this case (e.g. the aic7xxx driver).
* Properly handle transfers that only consume partial buffers.gibbs1999-01-141-6/+10
|
* Make dsopen() and dsioctl() use cdstrategy1 instead of cdstrategy.eivind1999-01-121-3/+3
| | | | | This silence the warnings and makes it more obvious where the bugs have to be fixed.
* Clean up and fix quirk table (was missing necessary wildcards) and add a couplemjacob1999-01-121-34/+61
| | | | | | | | | | | | | | | | | | | | | from the old driver. Change format of quirk table to have a preferred block size for devices that need to be QUIRK_FIXED- this is loaded into the last_media_blocksize tag at saregister time and will be used in the first samount case. Change sasetparams to take a sense_flags argument so that probe time testing can be quieter (e.g. with SF_NO_PRINT). Fix a couple of silly bugs in the fixed/variable determination in samount- one was where there was a check against 'guessing' AND the density code being default density- *SMACK* - you're only guessing if you find the media code to be *other* than default density. Second bug was a test against current blocksize being zero- should be a test against whether current blocksize is not equal to the last blocksize if you had wanted to be fixed (suppose you came up in fixed, but not the preferred size?). And if you don't know what the fixed size should be, select 512 as the starting point, not BLKDEV_IOSIZE (reality wins). Finally, in doing the test set to variable mode, make sasetparams non-chatty.
* Make HP T4000S quirk to FIXED modemjacob1999-01-111-1/+5
|
* Add 'static' to the declaration, too.eivind1999-01-111-2/+2
|
* Like the problems just fixed in scsi_da.c, make suremjacob1999-01-071-6/+17
| | | | | | | to release the probe ccb before taking down the periph. Also, don't do cdscheduling if you're not going to attach the device after all. Reviewed by: ken@freebsd.org
* A better fix to avoid race conditions between failed probesmjacob1999-01-071-6/+15
| | | | | and peripheral removal. Obtained from:gibbs@freebsd.org
* Add a quirk that disables SYNCHRONIZE CACHEmjacob1999-01-051-1/+10
| | | | | PR: 8882 Obtained from: Hellmuth Michaelis hm@kts.org
* Temporary workaround (bandaid) for case where you have READmjacob1999-01-031-3/+5
| | | | | | | | CAPACITY fail for a non-removable media device. There's a race condition where the device entry is removed and then xpt_release_ccb is called which attempts to give back the ccb to a device that's now gone. In this bandaid release the ccb early and then remember to not call xpt_release_ccb later.
* Force ARCHIVE Vipers to be FIXEDmjacob1998-12-281-1/+5
|
* you can retry SYNC CACHE on UA errorsmjacob1998-12-231-2/+3
|
* Staticize.eivind1998-12-222-11/+11
| | | | Reviewed by: gibbs
* Add a quirk NORRLS (no reserve/release) which can (andmjacob1998-12-221-39/+84
| | | | | | | | | | | | | | | | | | | | | will) get set for the devices that don't actually support reserve/release (so we don't keep trying it). Add softc storage and manage storing last I/O and CTL commands that had errors (for correlative purposes). In saclose clear the 'MOUNTED' bit if we either rewind or unload (yes, this shouldn't be necessary since the next open should catch whether a tape change occurred, but I'm having some questions about that actually working so this is safer for the moment). Oh, forgot to mention in previous commit messages that some of the failures particularly at close time cause the tape to be ejected (for the sake of safety)- all this prior to redoing the state machine (which is in progress) which will try and handle this better. Complete the addition of the setmark support (from Martin.Birgmeier@aon.at).
* 1) Fix some serious bugs (1 botch on my part which caused a filemark to bemjacob1998-12-191-40/+89
| | | | | | | | | | written even it the tape was opened readonly- 2 botches in deferred error handling for FIXED LENGTH mode which caused panic && hand resp.). Fixed a memory leak in sa_mount. 2) Fixed an annoying bug when turning of compression to actually reflect this for future status calls. 3) Implement the MTIOCERRSTAT call where latched control and I/O residuals and sense data are returned to the application asking for them.
* Add in block position/block locate functions.mjacob1998-12-181-21/+141
|
* Add structures and function definitions pertinent for hardware locate support.mjacob1998-12-181-1/+51
|
* Correct the definition of the changer device capabilities page. Thegibbs1998-12-171-1/+1
| | | | previous definition confused some reserved bytes for exchange capabilities.
OpenPOWER on IntegriCloud