summaryrefslogtreecommitdiffstats
path: root/sys/scsi/cd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Restore setting xs->bp; fixes ncr(4) on VAX.matthew2010-07-011-1/+2
| | | | ok miod@, krw@
* Bring cd(4) into line with sd(4) and st(4) by implementing CDF_DYINGkrw2010-06-301-6/+29
| | | | | | to better handle detaching. ok deraadt@
* Move disk_attach() to the end of the attach functions, at which point thejsing2010-06-281-3/+5
| | | | | | disk is now ready to handle I/O. ok krw@ dlg@
* dont pass the dev_t from the scsi device drivers into the midlayer fordlg2010-06-151-2/+2
| | | | | | | ioctl requests, and dont pass the proc pointers around for any ioctl requests in scsi land at all. neither were used, so trim the fat. ok krw@ marco@
* Restore an unusual XS_SENSE semantic that inadvertantly got lostkrw2010-06-111-3/+9
| | | | | | | | | | | | in the great re-write. If the scsi device *_interpret_sense() function returns 0 that means there was no error. Fixes restore(8) problems seen on certain tape drives. Found and fix tested by Percey Piper. Suggestions from Matthew Dempsky. Thanks! ok dlg@
* cut cd(4) over to use xshandlers. based on the sd(4) diff and includes thedlg2010-06-031-100/+78
| | | | | | | WAITING fix. tested by sthen@ thib@ sobrado@ krw@ on atapiscsi, atascsi, and real scsi ok krw@ thib@
* move cd, st & ss over to bufq's again.thib2010-06-011-14/+10
| | | | | Tested by myself and krw. ok krw@
* dont let sys/ioctl.h imply that you get the ioctls in dkio.h. thisdlg2010-05-181-1/+2
| | | | | | | | | | | gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include <sys/dkio.h> to the places that actually want and use the disk ioctls. this became an issue when krw@'s X build failed when he was testing a change to dkio.h. tested by krw@ help from and ok miod@
* Recycle unused disklabel fields in order to create a disklabel uniquejsing2010-04-231-3/+1
| | | | | | | identifier, allowing the disk to be identified without relying on the device name. ok deraadt@ krw@ beck@ marco@ todd@
* i snuck fine grained locking into the midlayer as part of all thedlg2010-04-121-3/+4
| | | | | | | | | | | | | other stuff ive been doing in here. everything that needs protection inside the midlayer and the scsi device drivers (sd, cd, etc) uses mutexes now. this pushes splbio out of the midlayer. splbio is only taken before biodone is called now. ok beck@ marco@ krw@ deraadt@. theyre all terrified, but they all say if we're going to do then now is the right stage of the dev cycle.
* If no TOC header is read, report EIO. Even if the command finishedkrw2010-02-281-2/+5
| | | | | | | | ok. Stops cdio(1) from printing bogus TOC info. ok marco@ beck@
* Abstract and merge the manual buf queue manipulating functions intokrw2010-01-151-55/+5
| | | | | | | one place for easier debugging and maintenance. No intended functional changes. ok dlg@
* Restore XS_BUSY delay behaviour for buf i/o. Same as for sync path.krw2010-01-151-3/+10
| | | | ok dlg@
* bring sd.c r1.180 over to the other drivers now using the antisemaphore,dlg2010-01-121-2/+2
| | | | ie, dont clear the WAITING flag when restarting the xxstart loops.
* Bring mutex protections to ststart, cdstart and ssstart, as alreadykrw2010-01-111-12/+26
| | | | | | done in sd. Make names consistant across all three. ok dlg@ tested (cd) & ok beck@
* Be as careful with sd/cd buf queue manipulations as was found necessary forkrw2010-01-111-1/+5
| | | | | | | | | st's queue manipulations. i.e. ensure b_actb is correctly updated as the queue becomes empty or has an i/o requeued on it. Tested on claudio@'s backup crashing box. ok dlg@ beck@
* dont try to prevent multiple concurrent runs of a devices start routinedlg2010-01-091-14/+1
| | | | | | | | | | | | | by setting flags around the loop. there is a race which can prevent necessary work being completed by any of the currently running instances of xxstart. the caveat with the removal of this code is because multiple xxstarts can be running at the same time they can cause io reordering, but that is less of a problem than no io. found by and fix tested by claudio@ debugged with krw@ claudio@ beck@ deraadt@
* nothing needs to see cd_softc except the driver, so move it into cd.cdlg2009-12-161-1/+25
| | | | ok marco@ guenther@
* prefix all softc members with sc_, not just most of them.dlg2009-12-131-28/+29
|
* use sc consistently as the name of the pointer to the softc variable, notdlg2009-12-131-241/+241
| | | | cd.
* move cd(4) from using scsi_scsi_cmd over to scsi_xs_exec for doing io.dlg2009-12-121-92/+136
| | | | | | | | | this brings it in line with the new midlayer changes. mostly borrowed from sd(4) changes. tested by krw@ and me ok krw@
* nitems(array) is prettier than sizeof(array)/sizeof(array[0])dlg2009-12-061-4/+4
|
* whitespace tweaksdlg2009-12-061-17/+15
|
* ansify dvd functions a bit.dlg2009-12-061-19/+7
|
* Get rid of devact enum, substitute it with an int and coresponding defines.pirofti2009-10-131-3/+3
| | | | | | This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
* Replace the error strings that were being passed around with much simplerderaadt2009-08-131-10/+6
| | | | | | | | | errnos. Note that the error strings are being ignored, since we long ago decided to not spam the console, and there is no other nice way to use the errors (without changing the ioctls to pass it back) The errno is now useful, since we can pass b_error from failing IO up, and the drive can decide how to use that ok miod
* Revert bufq's. this is inline with the major midlayer reverts thatthib2009-06-171-7/+33
| | | | | | have been going on. this appears to bring us back to stable state. lots of testing by oga and ariane and my self.
* add a flexible buffer queue (bufq) api, based on the never usedthib2009-06-031-33/+7
| | | | | | | | | one by tedu@. It doesn't do anything smart yet, it just uses plain old disksort. we also keep the old method of queueing bufs since some miods have crazy MD drivers that need some love. ok beck@, art@ tested by many on many archs.
* Extend the scsi_adapter minphys() callback to take a struct scsi_link *miod2009-02-161-2/+2
| | | | | | as additional argument. This will allow intermediate layers between scsi devices such as sd and scsi host adapters to take appropriate action if necessary.
* Add support for the volume buttons and for the eject button foundrobert2009-01-101-2/+37
| | | | | | | | on apple laptops. The eject button will only eject the disc when it's not used by anything. ok miod@
* silence failures to run scsi_prevent. dmesg spam sucks.dlg2008-08-011-5/+9
| | | | ok krw@ marco@ miod@ deraadt@
* deivce -> device typo fix in comment.krw2008-07-261-2/+2
|
* Replace MUSTEK_RETRIES, SCANJET_RETRIES and ST_RETRIES with SCSI_RETRIES,krw2008-06-221-3/+3
| | | | | all defined to 4. Replace some magic number 4's with SCSI_RETRIES. Fix a few lines that were now too long.
* fgsch@ points out my last commit changed the retry limit for CD capacitykrw2008-06-211-24/+24
| | | | | | commands. Bump limit back to the standard 4, and at the same time eliminate SDRETRIES and CDRETRIES (both defined to 4) in favour of a new define, SCSI_RETRIES, also defined to 4.
* Eliminate cd_size() and use scsi_size() + tweaked cd_get_params()krw2008-06-211-59/+19
| | | | | | | | | | | | | instead. We do not make use of the PMI and RELADDR bits in the READ CAPACITY command, and thus there is no difference between cd and sd capacity handling. Brings cd and sd more into line, shrinks code and makes things easier to understand. Make types for blocksize and disksize consistant and MI. Make cdopen() as silent as sdopen(). ok marco@
* Nuke unnecessary re-definition of READ_CAPACITY, scsi_read_capacity, andkrw2008-06-171-6/+5
| | | | | | scsi_read_cap_data as READ_CD_CAPACITY, scsi_read_cd_capacity and scsi_read_cd_cap_data respectively. No functional change as all were identical to their counterparts.
* Don't bypass partition bounds check for RAW_PART. We now guarantee thatkrw2008-06-151-3/+2
| | | | | | | | | | | RAW_PART will always be 0 -> disksize, so the bounds check will always pass for i/o's to valid addresses. Now the i/o will be properly truncated if it goes past the end of the device. This prevents various adverse impacts of issuing i/o's for data past the end of the device. Repeatedly requested by todd@. ok weingart@ deraadt@
* Accidental commit. Clean up.art2008-06-101-3/+1
|
* Buffer cache revampbeck2008-06-101-1/+3
| | | | | | | | | | | | | | | | 1) remove multiple size queues, introduced as a stopgap. 2) decouple pages containing data from their mappings 3) only keep buffers mapped when they actually have to be mapped (right now, this is when buffers are B_BUSY) 4) New functions to make a buffer busy, and release the busy flag (buf_acquire and buf_release) 5) Move high/low water marks and statistics counters into a structure 6) Add a sysctl to retrieve buffer cache statistics Tested in several variants and beat upon by bob and art for a year. run accidentally on henning's nfs server for a few months... ok deraadt@, krw@, art@ - who promises to be around to deal with any fallout
* nuke unused lba2msf and msf2lba functions. krw@ ok.fgsch2008-05-271-32/+1
|
* MALLOC/FREE -> malloc/free, M_ZERO, extraneous casts,krw2007-09-161-17/+11
| | | | extraneous #include <malloc.h>
* The obvious bzero/memset -> M_ZERO changes.krw2007-09-071-5/+3
|
* b_cylinder does not need to be set on the callpath down into drivers.deraadt2007-06-201-12/+7
| | | | cpu_disklabel can go away, since nothing anymore needs to use it; ok miod
* avoid modification race in DIOCRLDINFO; ok krw miodderaadt2007-06-181-3/+6
|
* all drivers should spoof version 1 labelsderaadt2007-06-081-1/+2
|
* in OpenBSD as all old BSD unix, RAW_PART always starts at 0, so noderaadt2007-06-071-5/+3
| | | | need for special case code; ok krw
* now that all partition size/offsets are potentially 64-bit, change thederaadt2007-06-061-3/+3
| | | | | | | type of all variables to daddr64_t. this includes the APIs for XXsize() and XXdump(), all range checks inside bio drivers, internal variables for disklabel handling, and even uvm's swap offsets. re-read numerous times by otto, miod, krw, thib to look for errors
* use six new macros to access & store the 48-bit disklabel fields relatedderaadt2007-06-051-3/+3
| | | | | to size. tested on almost all machines, double checked by miod and krw next comes the type handling surrounding these values
* Don't initialize d_partitions[RAW_DISK] just before callingkrw2007-06-011-7/+1
| | | | | | readdisklabel(), since all readdisklabel()'s do that already. ok deraadt@
* ANSI-fication, minor KNF. No code change. My plane had power outletskrw2007-05-251-119/+45
| | | | this time!