summaryrefslogtreecommitdiffstats
path: root/sys/cam
Commit message (Collapse)AuthorAgeFilesLines
* Back out the previous change to the queue(3) interface.jake2000-05-2610-41/+40
| | | | | | 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-2310-40/+41
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Apply a `fixup' to the blocksize gathered from the device after a READjoerg2000-05-221-0/+10
| | | | | | | | | | CAPACITY operation. SCSI-3 mandates this to be 2048, but some older drives like my old Plasmon CD-R report weird numbers between 2048 and up to 2352 bytes depending on the mode of the last track etc. This in turn confuses stuff like the slice code since it refuses to work with devices that do not have a blocksize which is a multiple of 512 bytes. Reviewed by: ken
* Implement a new camcontrol function, 'camcontrol format'.ken2000-05-212-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libcam/Makefile: Add scsi_da.c to libcam for the new scsi_format_unit() function. camcontrol.8: Update the man page for the new format functionality, and take out the examples section describing how to do it with 'camcontrol cmd'. camcontrol.c: New format functionality. Note that unlike the rest of the camcontrol subcommands, this one is interactive by default. Because of the potential destructiveness of the format command, I thought it necessary to get confirmation from the user before spamming a disk. You can disable the interactive behavior, and the status meter with command line arguments. scsi_da.c: Add the new scsi_format_unit() cdb building function and use #ifdef _KERNEL to make this file compile in both the kernel and userland. The format unit function is currently only defined in the non-kernel case, because nothing in the kernel is using it. If that changes, it should be un-ifdefed and compiled in both cases. scsi_da.h: New function declaration, CDB structure and format data structures. Thanks to Nick Hibma for providing some valuable input on these changes.
* Implement an optimization of the VM<->pmap API. Pass vm_page_t's directlypeter2000-05-211-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to various pmap_*() functions instead of looking up the physical address and passing that. In many cases, the first thing the pmap code was doing was going to a lot of trouble to get back the original vm_page_t, or it's shadow pv_table entry. Inspired by: John Dyson's 1998 patches. Also: Eliminate pv_table as a seperate thing and build it into a machine dependent part of vm_page_t. This eliminates having a seperate set of structions that shadow each other in a 1:1 fashion that we often went to a lot of trouble to translate from one to the other. (see above) This happens to save 4 bytes of physical memory for each page in the system. (8 bytes on the Alpha). Eliminate the use of the phys_avail[] array to determine if a page is managed (ie: it has pv_entries etc). Store this information in a flag. Things like device_pager set it because they create vm_page_t's on the fly that do not have pv_entries. This makes it easier to "unmanage" a page of physical memory (this will be taken advantage of in subsequent commits). Add a function to add a new page to the freelist. This could be used for reclaiming the previously wasted pages left over from preloaded loader(8) files. Reviewed by: dillon
* Add support for the DVD ioctl interface.ken2000-05-122-1/+1083
|
* Some prettifying for the quirk comments.mjacob2000-05-091-5/+16
| | | | | | | | | | Add a SA_QUIRK_NO_MODESEL type and use it for the OnStream real SCSI device (not the broken one). This one is still broken in that it can't be set to the same fixed block size it reports [ unflattering comments about this company elided ]. If we're unable to set buffered mode on, complain, but drive on. It's not a fatal error to not be in buffered mode.
* *sigh* I must have been on something that night. Make xpt_periph ann_hibma2000-05-072-1/+3
| | | | | extern with the original in cam_xpt.c instead of replicating xpt_periph in all the sources using it (and hence not initialising it)
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-058-7/+8
| | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
* Add in include of <machine/clock.h> which defines DELAY.mjacob2000-05-021-0/+1
|
* Add $FreeBSD$peter2000-05-013-0/+4
|
* Remove unneeded #include <sys/kernel.h>phk2000-04-291-1/+0
|
* Remove unneeded <sys/buf.h> includes.phk2000-04-182-2/+0
| | | | | Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
* Don't include <sys/buf.h> twice.phk2000-04-182-2/+0
|
* Overlooked a s/b_act/bio_queue/ substitution due to targ not being in LINT.phk2000-04-161-2/+2
| | | | Spotted by: mjacob
* Complete the bio/buf divorce for all code below devfs::strategyphk2000-04-156-281/+281
| | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS
* Add a hack to cam that makes the cam_xpt available to the rest of then_hibma2000-04-032-2/+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
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.phk2000-04-026-35/+35
| | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde.
* Fix two problems in the ch(4) driver.ken2000-04-021-2/+13
| | | | | | | | | | | | - Mike Smith discovered a panic in the changer probe code if the probe command (mode sense) fails. So we need to release the CCB used in the probe before we unlock the peripheral. (i.e. the same fix mjacob put in the CD and DA drivers) - A newline was missing in a warning message. (PR kern/17512) PR: kern/17512 Submitted by: Louis Mamakos <louie@uu.net> (newline fix)
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newphk2000-03-206-16/+15
| | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful.
* o clear the ccb_flags field before sending an accept target I/O ccb togibbs2000-03-181-6/+9
| | | | | | | | | | | | | | | an HBA. Garbage in this field confuses the driver in targdone(). o When completing a CCB on behalf of a user process, we need to *de-queue* the ccb from our pending ccb list, not queue it again. o All continue target I/O operations need to have a timeout set. We use 5 seconds throughout this driver. o Remove some logging printfs. o During abort processing, remove ccbs that are on the pending queue from the pending queue, not the work queue.
* Per Justin's request- remove his name from Copyright.mjacob2000-03-181-6/+1
|
* Add a quirk entry for Y-E Data USB floppy drive.n_hibma2000-03-151-0/+10
| | | | Driver follows in the next few days.
* Various typo's.n_hibma2000-03-155-6/+7
| | | | One minor nit. The speed was displayed wrong when below 1Mb/s.
* Some minor fixing - final for 4.0. Debugging messages toned down a bit.mjacob2000-02-291-21/+15
| | | | Approved: jkh
* Fix 'camcontrol inquiry'. The inquiry data structure changes (increased token2000-02-202-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 256 bytes) caused it to break on many devices. The SCSI spec says that for commands with 8-bit length fields, a value of 0 means 256 bytes. As it turns out, many devices don't deal with that properly. Some interpret the 0 as 0, and return no data. Others return more than 256 bytes of data, and cause an overrun. The fix is to tell the device we've only allocated SHORT_INQUIRY_LENGTH (36 bytes) of inquiry data, instead of sizeof(struct scsi_inquiry_data). camcontrol.c: Change inq_len in the call to scsi_inquiry() to SHORT_INQUIRY_LENGTH, and add a long comment explaining the reason for the change. scsi_all.h: Add a comment above the definitinon of SHORT_INQUIRY_LENGTH alerting people that it is both the initial probe inquiry length, and the minimum amount of data needed for scsi_print_inquiry() to function. scsi_all.c: Add a comment about SHORT_INQUIRY_LENGTH being the minimum amount of data needed for scsi_print_inquiry() to function. Reviewed by: gibbs Approved by: jkh Reported by: "John W. DeBoskey" <jwd@unx.sas.com>
* Add a quirk type (and one for ARCHIVE Python's) that disables themjacob2000-02-031-24/+33
| | | | | | | dummy read at sa_mount that attempts to latch up density. This breaks on at least one drive and sends it into the weeds. Approved: jkh
* Because we added 4 bytes to the inquiry data size, we need tomjacob2000-01-251-1/+1
| | | | | rev the CAM revision too. Tsk. Submitted by: ken@freebsd.org
* Redo the SHORT INQUIRY length stuff to be a bit cleaner.mjacob2000-01-251-32/+27
| | | | Obtained from:gibbs@freebsd.org
* When autosense fails, make sure we retry the command.ken2000-01-251-1/+1
| | | | | PR: kern/15975 Submitted by: Carl Mascott <cmascott@world.std.com>, n_hibma
* Propagate sense data through from SIM (if there) and mark the CTIOmjacob2000-01-251-51/+88
| | | | | | | | | | | that there's sense to send with status (if the SIM does it), and then clear any pending contingent allegiance state for this initiator if the SIM actually did send the sense data. Widen MAX_INITITATORS to 256- that's still not quite right, but will accomodate the widest Fibre Channel support in FreeBSD now. Obtained from:(partially) gibbs@freebsd.org
* Propagate sense data through from SIM (if there) and mark the CTIOmjacob2000-01-251-2/+28
| | | | | that there's sense to send with status (if the SIM does it). Reviewed by: gibbs@freebsd.org
* Go for the gusto and do the full 256 bytes for inquiry data.mjacob2000-01-252-6/+8
| | | | Obtained from:gibbs@freebsd.org
* A minimal update to the device wiring code so that it looks at thepeter2000-01-233-160/+83
| | | | | | dynamic resource tables rather than relying on a duplicated cam-specific table generated by config(8) in ioconf.c. This was a major holdup to getting loader / userconfig driven configuration of scsi wiring.
* Clean up some of the SAF-TE matching code. Addmjacob2000-01-211-10/+16
| | | | a few missing newlines in printouts.
* Do the minor changes needed because of change to ccb_getdev structure.mjacob2000-01-176-14/+16
| | | | | | JKH Trading Stamps applied. Reviewed by: gibbs@freebsd.org, ken@freebsd.org
* Increase size of the scsi_inquiry_data structure to it's nearlymjacob2000-01-171-1/+44
| | | | | | | | | | | | | | full size. Define a SHORT_INQUIRY_LENGTH for use during initial probing (covers the size used previously). Define some SPC-2 related fields (and define the revision code for SPC-2) which includes some further SPI-3 defines. Don't go all the way (256 bytes) for the structure- stop 4 bytes short- because we haven't auditted the source base to find any u_int8_t potential overflow issues. Add RBC (single byte device) and OCR (Optical Character Reader) device type codes. Approved by JKH. Reviewed by: gibbs@freebsd.org, ken@freebsd.org
* Remove garbage collected tags from their usage in the ccb_getdevmjacob2000-01-171-12/+39
| | | | | | | | | | | | | | | | | | structure. Remove usage of the (now gone) pd_type tag of same. Add an extra probing state such that if we successfully run an initial inquiry (36 bytes), rerun another one with a longer data size as informed by the 'additional length' field in the first returned inquiry data (making sure not to get bigger than the actual scsi_inquiry_data structure- which has also been modified- see separate checkin of scsi_all.h). This allows devices such as SAF-TE devices (which have identifying marks in offsets 48-53 in inquiry data) to be successfully found without special case inquiry commands. There are also a lot of other things such as version codes that are coming in in the SPC2 specification that it would be useful to get our hands on. Reviewed by: gibbs@freebsd.org, ken@freebsd.org
* Shift bits for CAM flags so that the top bit isn't set in an enummjacob2000-01-171-28/+13
| | | | | | | | | | | | | (at request of Ken Merry). Garbage collect items out of the ccb_getdev structure and and a length field so that consumes will know how much of the inq_data tag is valid. Clean up a few misspellings. Add a CAM_SEND_STATUS target mode flag. All of this necessitated a CAM_VERSION bump. JHK approved. Reviewed by: gibbs@freebsd.org, ken@freebsd.org
* Add a CAM_SENT_STATUS for use in target mode. JHK approved.mjacob2000-01-171-1/+4
| | | | Reviewed by: gibbs@freebsd.org, ken@freebsd.org
* Do not propagate the ENCI_SVALID bit for overall enclosure statusmjacob2000-01-171-5/+4
| | | | to userland apps- they get confused.
* Add in SAF-TE handling code and do some minor consistency cleanups.mjacob2000-01-171-10/+1017
|
* buglet fixmjacob2000-01-151-1/+1
|
* Do a wad of cleanup and put into place at least *one* functionalmjacob2000-01-151-85/+1077
| | | | | portion of SES retrieval (native SES itself) and implement all the appropriate ioctls. Seems to work...
* Move the kernel specific stuff into scsi_ses.c. Redo the ioctlsmjacob2000-01-151-46/+19
| | | | | | | | | to be more platform independent. Add a ses_hlptxt structure definition and retrieval ioctl for when we are able to retrieve object help text SES Objects can have up to 64 KBytes of associated 'help' text- the Sun A5000 uses this, for example, to give physical location information (e.g., 'left power supply').
* add SEND/RECEIVE diagnostic opcodes, SEND is a Mandatory commandmjacob2000-01-151-0/+2
|
* Remove inclusion of dkbad.h- seems like a bug, but I had a stalemjacob2000-01-151-1/+0
| | | | | dkbad.h in /usr/include/sys- the local build process shouldn't have been happy with that, but not finding dkbad.h in ../../sys. Hmm.
* add functional but stub SES/SAF-TE drivermjacob2000-01-152-0/+763
|
* Clean up the xpt_sim creation to mirror how HBA drivers perform this task.gibbs2000-01-142-74/+127
| | | | | | | | | | | | | | Clean up node creation in the EDT so that initialization follows member declaration. Sort registered paths by pathid so that we probe busses in order of ascending pathid. This makes hardwiring of busses without wiring individual targets do what the user expects. (submitted by tegge@FreeBSD.org) Fix an EDT node leak. Target nodes would never go away. Implement xpt_bus_deregister(). (prodded by some patches from T. Ichinoseki, but implemented differently.)
* Widen width of tag && initiator ids to u_intmjacob2000-01-031-2/+2
| | | | | | | | (from u_int8_t) in ccb_accept_tio structure. This matches usage elsewhere and also allows me to overload the tag id with the RX_ID for fibre channel target mode. Reviewed by: gibbs@freebsd.org
OpenPOWER on IntegriCloud