summaryrefslogtreecommitdiff
path: root/sys/scsi/cd.c
AgeCommit message (Collapse)Author
2010-02-28If no TOC header is read, report EIO. Even if the command finishedKenneth R Westerback
ok. Stops cdio(1) from printing bogus TOC info. ok marco@ beck@
2010-01-15Abstract and merge the manual buf queue manipulating functions intoKenneth R Westerback
one place for easier debugging and maintenance. No intended functional changes. ok dlg@
2010-01-15Restore XS_BUSY delay behaviour for buf i/o. Same as for sync path.Kenneth R Westerback
ok dlg@
2010-01-12bring sd.c r1.180 over to the other drivers now using the antisemaphore,David Gwynne
ie, dont clear the WAITING flag when restarting the xxstart loops.
2010-01-11Bring mutex protections to ststart, cdstart and ssstart, as alreadyKenneth R Westerback
done in sd. Make names consistant across all three. ok dlg@ tested (cd) & ok beck@
2010-01-11Be as careful with sd/cd buf queue manipulations as was found necessary forKenneth R Westerback
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@
2010-01-09dont try to prevent multiple concurrent runs of a devices start routineDavid Gwynne
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@
2009-12-16nothing needs to see cd_softc except the driver, so move it into cd.cDavid Gwynne
ok marco@ guenther@
2009-12-13prefix all softc members with sc_, not just most of them.David Gwynne
2009-12-13use sc consistently as the name of the pointer to the softc variable, notDavid Gwynne
cd.
2009-12-12move cd(4) from using scsi_scsi_cmd over to scsi_xs_exec for doing io.David Gwynne
this brings it in line with the new midlayer changes. mostly borrowed from sd(4) changes. tested by krw@ and me ok krw@
2009-12-06nitems(array) is prettier than sizeof(array)/sizeof(array[0])David Gwynne
2009-12-06whitespace tweaksDavid Gwynne
2009-12-06ansify dvd functions a bit.David Gwynne
2009-10-13Get rid of devact enum, substitute it with an int and coresponding defines.Paul Irofti
This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
2009-08-13Replace the error strings that were being passed around with much simplerTheo de Raadt
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
2009-06-17Revert bufq's. this is inline with the major midlayer reverts thatThordur I. Bjornsson
have been going on. this appears to bring us back to stable state. lots of testing by oga and ariane and my self.
2009-06-03add a flexible buffer queue (bufq) api, based on the never usedThordur I. Bjornsson
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.
2009-02-16Extend the scsi_adapter minphys() callback to take a struct scsi_link *Miod Vallat
as additional argument. This will allow intermediate layers between scsi devices such as sd and scsi host adapters to take appropriate action if necessary.
2009-01-10Add support for the volume buttons and for the eject button foundRobert Nagy
on apple laptops. The eject button will only eject the disc when it's not used by anything. ok miod@
2008-08-01silence failures to run scsi_prevent. dmesg spam sucks.David Gwynne
ok krw@ marco@ miod@ deraadt@
2008-07-26deivce -> device typo fix in comment.Kenneth R Westerback
2008-06-22Replace MUSTEK_RETRIES, SCANJET_RETRIES and ST_RETRIES with SCSI_RETRIES,Kenneth R Westerback
all defined to 4. Replace some magic number 4's with SCSI_RETRIES. Fix a few lines that were now too long.
2008-06-21fgsch@ points out my last commit changed the retry limit for CD capacityKenneth R Westerback
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.
2008-06-21Eliminate cd_size() and use scsi_size() + tweaked cd_get_params()Kenneth R Westerback
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@
2008-06-17Nuke unnecessary re-definition of READ_CAPACITY, scsi_read_capacity, andKenneth R Westerback
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.
2008-06-15Don't bypass partition bounds check for RAW_PART. We now guarantee thatKenneth R Westerback
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@
2008-06-10Accidental commit. Clean up.Artur Grabowski
2008-06-10Buffer cache revampBob Beck
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
2008-05-27nuke unused lba2msf and msf2lba functions. krw@ ok.Federico G. Schwindt
2007-09-16MALLOC/FREE -> malloc/free, M_ZERO, extraneous casts,Kenneth R Westerback
extraneous #include <malloc.h>
2007-09-07The obvious bzero/memset -> M_ZERO changes.Kenneth R Westerback
2007-06-20b_cylinder does not need to be set on the callpath down into drivers.Theo de Raadt
cpu_disklabel can go away, since nothing anymore needs to use it; ok miod
2007-06-18avoid modification race in DIOCRLDINFO; ok krw miodTheo de Raadt
2007-06-08all drivers should spoof version 1 labelsTheo de Raadt
2007-06-07in OpenBSD as all old BSD unix, RAW_PART always starts at 0, so noTheo de Raadt
need for special case code; ok krw
2007-06-06now that all partition size/offsets are potentially 64-bit, change theTheo de Raadt
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
2007-06-05use six new macros to access & store the 48-bit disklabel fields relatedTheo de Raadt
to size. tested on almost all machines, double checked by miod and krw next comes the type handling surrounding these values
2007-06-01Don't initialize d_partitions[RAW_DISK] just before callingKenneth R Westerback
readdisklabel(), since all readdisklabel()'s do that already. ok deraadt@
2007-05-25ANSI-fication, minor KNF. No code change. My plane had power outletsKenneth R Westerback
this time!
2007-04-28Fix comments above DISKMINOR uses. DISKMINOR provides minor not majorKenneth R Westerback
number (wd.c), and the uses are to find the minimum minor to be detached.
2007-04-26Use the standard DISKPART/DISKUNIT/etc. defines rather than identicalKenneth R Westerback
but differently named SD/CD ones. No change to .o files. ok deraadt@ dlg@
2007-04-12Add cd_kill_buffers() as a separate function, like sd_kill_buffers()Kenneth R Westerback
and for the same reason of preparing for safer handling of users yanking usb devices out. No functional change. Copied from bluhm@'s change to sd.c.
2007-04-10``it's'' -> ``its'' when the grammar gods require this change.Miod Vallat
2007-04-10Always use idiom 'struct cd_softc *cd = (struct cd_softc *)self'. SpottedKenneth R Westerback
by bluhm@ for sd. No change to cd.o.
2007-02-03Make comment match code. ok pedroAlexander Bluhm
2006-12-23Add the ability to issue GPCMD_REPORT_KEY and GPCMD_SEND_KEY scsiKenneth R Westerback
commands via the DVD_LU_SEND_RPC_STATE and DVD_HOST_SEND_RPC_STATE ioctls respectively. Thus allowing any region protected DVDs mistakenly delivered by Santa to the wrong region to be viewed on recalcitrant DVD drives (with the aid of an appropriate utility like regionset). No change to any current functions. Found in my hackers@ folder from August. From netbsd -> Kurt Miller -> jmc@.
2006-12-12Give the SCSI layer the ability to requeue i/o's rejected by a driverKenneth R Westerback
using the new NO_CCB result. Currently a no-op since no driver produces that result. ok dlg@ marco@ deraadt@
2006-11-28rename scsibus_attach_args to scsi_attach_args. this can help avoidDavid Gwynne
confusing when trying to attach scsibus to a hba, since it is really meant for attaching scsi devices to scsibus. ok deraadt@ marco@
2006-11-27more magic removalBob Beck
ok miod@, deraadt@