Commit Graph

1143 Commits

Author SHA1 Message Date
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
thorpej 3ddf26777f Use device_is_active() rather than testing dv_flags for DVF_ACTIVE
directly.
2006-02-20 16:50:36 +00:00
perry fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +00:00
reinoud a62dc37d89 Add name of the processed feature like the others have. 2006-02-08 23:09:15 +00:00
reinoud c0dbf19c1e Add support for SCSI MMC feature 0x0024: hardware assisted defect
management to be passed in mmc_discinfo's device capabilities.

When a device reports support for this the hardware will automatically
remap sectors on read- or write-errors. CD-MRW, DVD+MRW, DVD-RAM and BR-RE
support these.
2006-02-04 21:26:15 +00:00
reinoud 1b09e70fcd Adding two Ioctl's to scsipi's cd.c to abstract SCSI MMC devices. The
ioctl's and their structures are currenly hidden from inclusion for normal
userland applications to allow the MMC abstraction interface to mature
first.

Its useage is mainly for applications dedicated to handling and processing
SCSI MMC compliant devices and their media. Examples of these are CDs, DVDs
and comparable optical devices but also some magnetic swapable devices that
present themselves as a SCSI MMC compliant device.

Its current use is currently the to be committed in-kernel UDF filingsystem
and its userland tools.
2006-02-02 14:48:02 +00:00
christos a6c7e45e28 fix typo. 2006-01-07 07:18:06 +00:00
yamt 2addc3084c remove B_EINTR as it isn't used anymore. 2006-01-07 00:26:58 +00:00
yamt 690d424f28 - add simple functions to allocate/free a buffer for i/o.
- make bufpool static.
2006-01-04 10:13:05 +00:00
perry 93124077ae Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:27:29 +00:00
reinoud 19eca236e0 Improve disc size reporting. The current discsize thats reported is the
current recorded extent and not the complete maximum extent of the disc.

An empty CD/DVD disc is seen as having an invalid length and given 800 Mb
size. This makes it possible to write to a CD-R using `dd' as some tend to
do.

However when an extent is recorded the initial recorded length is seen as
valid and is thus set as absolute upperbound to read and write actions
preventing extention of the disc.

Committed after consultation on tech-kern with a positive advice by Manuel
Bouyer.
2005-12-21 13:11:27 +00:00
reinoud 4eae0d0cfe The as `unused' specified field in the readdiscinfo SCSI command is really
application_code to be able to write to -RW media when its in restricted
mode.
2005-12-20 01:44:22 +00:00
christos 04735b5d69 delete extraneous verbiage. 2005-12-16 17:54:36 +00:00
reinoud 4cdfa6bead Clean up cdgetdisklabel. It was jumping over a return... 2005-12-15 17:56:32 +00:00
reinoud cdfee8349d Allow SCIOCCOMMAND ioctl that executes a SCSI command to also be issued
within the kernel when the FKIOCTL flag is passed to the ioctl.

No code actually uses this yet but is committed for completion.
2005-12-14 21:55:47 +00:00
simonb ae278e7e7d Remove blank line added to end of file by previous change. 2005-12-11 23:34:27 +00:00
reinoud 700d0843b3 Add SCSI calls for read discinfo and read trackinfo. Also add the various
read toc formats returned.
2005-12-11 23:26:31 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
reinoud 17f915ee27 Fix illogical use of extra variable. It was mainly to get a better
readability in KNF. This solution gives better readability without the
extra variable.
2005-12-11 00:01:54 +00:00
reinoud 705000f60a Second stage of read TOC modifications. Introducing the various forms of
TOC reading. Note that the external interfaces haven't changed. Only the
formatted toc is requestable.

The read msinfo command hasn't been changed in this patch though it could
become more clever using the CD_TOC_MSINFO format.
2005-12-10 21:17:21 +00:00
bouyer 514622c61f Adapt previous change to recent scsipi. Pointed out by Simon Burge. 2005-12-09 09:24:30 +00:00
bouyer dd5eb5979f Some USB devices reports themselves as removable, but have no door and
so don't support the SCSI_PREVENT_ALLOW_MEDIUM_REMOVAL command.
When an "Illegal field in CDB" is reported for this command, mark the
device as non-removable (which is always true for USB keys from the SCSI
point of view), print a message and ignore the error.
For DIOCLOCK, return ENOTTY if the device is not removable instead of
trying a command which will fail.

Fix a problem reported by Hubert Feyrer for some USB umass devices, patch
tested by him.
2005-12-08 22:14:19 +00:00
tsutsui d0c28ccd6d Fix typo (FALLTHOUGH -> FALLTHROUGH). From Jeff Ito. 2005-11-26 13:54:18 +00:00
martin b1134bf887 Rework the funny "user_strat: No ioctl" error messages - the functions
have not been called user_strat for quite some time and the message is
confusing if you do not know the code.
2005-11-01 20:44:04 +00:00
bouyer 1421f4d030 Don't claim there is a data in or out phase if the datalen is 0 (userland
shouldn't claim it either, but a buggy software shouldn't be able to crash
the kernel anyway). Should fix port-sparc64/31925 by Johan A.van Zanten
(which should really be kern/31925).
Analysed and patch tested by Martin Husemann.
2005-11-01 15:40:00 +00:00
yamt 8217506e75 fix ioctl problems after the recent physio changes
in some drivers including wd and scsi.

- physio: if a caller provided a buf, stick to use it
  because some drivers use it as an identifier.
- sprinkle simple_locks.
- scsistrategy: rather than issueing an async request and
  waiting for its completion, simply issue a sync request.
  the way to wait for the completion had an assumption that
  B_CALL is never used.  it isn't the case after the recent
  physio() changes.

pointed/analyzed/tested by Martin Husemann.
2005-10-31 14:36:41 +00:00
yamt aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
reinoud 04d00c8e39 Cleanup and fix cd_size() function; it was returning wrong results.
Also factor out read_cd_capacity()
2005-09-06 22:19:14 +00:00
reinoud d462489ea5 Implement DIOCCACHESYNC for SCSI/ATAPI cd/mmc recordable devices found by
scsipi/cd.c by issueing the SYNCHRONISE CACHES scsi/atapi call as defined
per MMC standard.
2005-09-05 21:16:24 +00:00
reinoud b28d0c5529 Document executed SCSI commands with the IOCTL's to prevent confusion. 2005-08-28 22:51:01 +00:00
drochner 46ed4b50c4 s/locdesc_t/int/g 2005-08-26 12:42:11 +00:00
drochner e6a178f21f kill a number of autoconf submatch functions which follow the
standard scheme:
if (<configured> != <wildcard> && <configured> != <real>)
	then fail
else
	ask device match function

This is handled by config_stdsubmatch() now.
2005-08-25 22:33:18 +00:00
drochner fa3cb84d62 replace the "locdesc_t" structure carrying the number of locators
explicitely by a plain integer array
the length in now known to all relevant parties, so this avoids
duplication of information, and we can allocate that thing in
drivers without hacks
2005-08-25 18:35:38 +00:00
blymn 110bb51ae7 Split out stats attach code ready for shifting
Add sysctl hooks here for the time being.
2005-08-13 10:50:50 +00:00
blymn 1742ba7763 Add tape statistics structure pointer. 2005-08-07 12:25:08 +00:00
blymn d943093426 Gather statistics for tape drives. 2005-08-07 12:24:30 +00:00
rtr c19cae9065 change output from "rogue" to "quirks apply" - resolves pr#25387 2005-07-16 05:12:26 +00:00
drochner a8dbed44ea tighten the autoconf constraints by passing the atapi/ata/ata_hl attribute
to config_found()
(after some cleanup we might be able to kill SCSIPI_BUSTYPE_*)
2005-07-07 17:51:31 +00:00
bouyer a5bc956f51 Always allow open() on the raw partition to succeed, even if any of the
SCSI command in cdopen() fails. Fix PR kern/30288 by Pavel Cahyna.
2005-07-06 14:28:39 +00:00
thorpej 527d62e0a2 - When starting an ATA or ATAPI transfer, handle the case where (*dma_init)()
returns EINVAL, indicating that DMA cannot be done for this transfer.
  Fall back to PIO in this case.
- Add a geodeide_dma_init() routine that checks to make sure that transfers
  start on a 16 byte boundary, returning EINVAL if not.  Works around a chip
  bug that causes a hard system hang.

Problem reported and patch tested by Erik Fair.
2005-07-06 01:46:52 +00:00
peter 130e3c23a2 Fix typos. 2005-06-07 13:45:11 +00:00
jdc 7e31a175ec Remove cast to non-const and make this compile again. 2005-06-03 13:44:11 +00:00
xtraeme f55b68d1bd Add missing const. 2005-05-31 02:56:54 +00:00
christos a984bbf91a - remove bogus casts
- add more const
2005-05-30 04:25:32 +00:00
christos 3acb3fe622 - Sprinkle const
- Avoid variable shadowing.
- Eliminate some caddr_t abuse.
2005-05-29 22:00:50 +00:00
chs a4ef51503f as a stop-gap measure to allow boot-from-disk to work on hppa,
add some padding to the end of struct scsipi_xfer on that platform.
2005-05-18 13:58:10 +00:00
drochner 99c093bad3 fix more SSD_RCODE_VALID misuse introduced in cleanup 2005-04-25 17:52:30 +00:00
drochner d918258c4d Revert the part if 1.236 which comprises a functional change.
While I didn't observe a misbehaviour yet, this _must_ be
wrong because SSD_RCODE_VALID is used incorrectly.
2005-04-25 17:35:26 +00:00
drochner 3214fe94f4 revert the only part of rev. 1.177 which made a functional
change -- it broke error reporting because st->asc(q) are
not set
(actually, I believe that SSD_RCODE_VALID is misnamed)
2005-04-25 17:08:46 +00:00
drochner 6dda78f17a make the scsibus target/lun and the atapibus drive locators optional
(they already had default values; we could kill the [...=N] syntax
completely or at least have config(8) assume that a locator with
a default is optional)
2005-04-15 19:20:24 +00:00