Commit Graph

1092 Commits

Author SHA1 Message Date
yamt 99229e5d39 introduce a function to drain bufq and use it where appropriate. 2005-03-31 11:28:53 +00:00
soren 999e530258 Remove a bit of old cruft. 2005-02-28 22:56:15 +00:00
perry f31bd063e9 nuke trailing whitespace 2005-02-27 00:26:58 +00:00
thorpej df9803ce96 Part 1 of a cleanup pass over the SCSI subsystem. The aim is to name
everything "scsi_*", since we really are talking about the SCSI command
set, ATAPI transport not withstanding.  Improve the names of many structures,
and prepend "SCSI_" onto all SCSI command opcodes.  Place items described
by the SCSI Primary Commands document into scsi_spc.h.
2005-02-21 00:29:06 +00:00
perry 18db93c7f6 de-__P 2005-02-04 02:10:35 +00:00
reinoud f323bc537c Backing out changes to clean up scsipi. I was pointed out there were
problems i hadn't seen. To prevent lossage i'd decided to back off all
changes and let them be reviewed on tech-kern.
2005-02-01 00:19:34 +00:00
simonb c9234f1972 Revert incorrect u_long->uint32_t conversion. 2005-01-31 23:46:33 +00:00
reinoud 4145e39ac7 Fix LP64 problems introduced by my u_long->uint32_t conversion. 2005-01-31 23:39:02 +00:00
reinoud b220d67a3e Part of the cleanup of sys/scsipi's use of types; rename all u_int* to
uint* and change the u_long's to uint32_t's where possible. Note that the
iocl definitions/hooks have to be ulong (or u_long) or they'll bomb out.
2005-01-31 23:06:41 +00:00
reinoud f93ea32254 As part of cleaning up sys/scsipi, replace all u_char by uint8_t and
replace all `short' with int16_t.
2005-01-31 21:13:16 +00:00
reinoud 842f22fc3a As in revision 1.213, not all information is returned in read-TOC format 0. In order to add a new generic read-toc ioctl, i renamed the origional to _f0 to indicate its only format 0. The routines can then be changed one at a time to the new generic calling. This patch fixes two calls i'd overseen.... silly me forgot to recompile :( 2005-01-30 23:42:58 +00:00
reinoud 82eee08288 The code asumes all programs want to know is TOC response format 0. Support
for TOC response format 1 and 2 are mandatory on CD/DVD too and provide
more information.

Next an IOCTL needs to be implemented that can read all TOC formats in a
generic way. This is pending.
2005-01-30 23:39:42 +00:00
ginsbach 661eb28d4c Add command to read the defect data from a direct access device. 2005-01-07 02:08:34 +00:00
thorpej 4127c59173 Define SYNCHRONIZE CACHE (16). 2004-12-07 23:21:06 +00:00
thorpej 6ad79ad747 SYNCHRONIZE_CACHE -> SYNCHRONIZE_CACHE_10 2004-12-07 23:16:40 +00:00
thorpej dffe7d8e8d READ_CAPACITY -> READ_CAPACITY_10 2004-12-07 23:14:03 +00:00
thorpej ce91ac7d6b USe more appropriate macro/struct names for READ/WRITE (6) and
READ/WRITE (10).
2004-12-07 23:07:31 +00:00
thorpej 78e83f262c Nothing references "struct scsi_generic" anymore; delete it. 2004-12-07 22:27:17 +00:00
thorpej e0747e9825 Use READ/WRITE (16) if the LBA is larger than 32 bits. Another bit
of kern/28514.
2004-12-04 19:02:25 +00:00
thorpej e112950229 And thus spake SBC-3:
If the number of logical blocks exceeds the maximum value that is able to be
specified in the RETURNED  LOGICAL BLOCK ADDRESS field, the device server
shall set the RETURNED LOGICAL BLOCK ADDRESS field to  FFFFFFFFh. The
application client should then issue a READ CAPACITY (16) command (see 5.11)
to  retrieve the READ CAPACITY (16) parameter data.

Implement this in scsipi_size().

First issue in kern/28514.
2004-12-03 20:20:32 +00:00
thorpej e9818f5b5e When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
2004-10-30 18:08:34 +00:00
yamt 05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
bouyer ccd16ca6dc Adjust some debug printfs after b_bcount was changed from long to int.
From Patrick Welche on current-users@
2004-10-17 17:49:04 +00:00
thorpej 0c85033412 Don't need the lock in the softc anymore. 2004-10-01 05:16:36 +00:00
enami b4a9b4deed Don't touch free'ed object. Fixes l_holdcnt leak reported by Andreas Wrede
on current-users.
2004-10-01 03:39:11 +00:00
dogcow f3084b1ba9 Fix debug message output args to match yamt's src/sys/sys/buf.h changes. 2004-09-26 09:00:37 +00:00
thorpej 72b84bf041 Add support for wedges to the SCSI disk driver. 2004-09-25 04:11:23 +00:00
mycroft 7ef0686963 If our enqueue failed -- because we're polling and there is already something
in the queue -- do not attempt to requeue it.  We only poll in two cases:

1) We have a non-interrupting controller.  In this case, execution of the
   previous command should have left the queue empty.  (Perhaps there should be
   a KASSERT() to this effect.)

2) We're in the shutdown path, either doing a cache sync or a dump.  In these
   cases, the retry behavior is useless, because we will no longer get
   interrupts to notify us that the earlier commands completed.  Instead we
   just spin for a few seconds and fail anyway.  (XXX We should probably clear
   the queue explicitly so that the shutdown/dump will succeed.)
2004-09-18 18:49:50 +00:00
mycroft b89029809c Since we always defer probing SCSI and ATAPI devices now, we can never be
"cold" -- so change the check for this to a KASSERT().
2004-09-18 18:29:00 +00:00
mycroft 007ffe47ec Oops; eliminate the EJUSTRETURN return value from scsipi_execute_xs(). Don't
know how this worked when I tested it.
2004-09-18 18:00:05 +00:00
mycroft a7aa9498f3 Minor rearrangement. Whitespace and #include cleanup. 2004-09-18 00:21:03 +00:00
mycroft 8f93b96f00 Standardize some variable names and the calling pattern for scsipi_command().
Use void pointer casts.
2004-09-18 00:08:16 +00:00
mycroft 1e243afe67 Remove the "xfer" argument to scsipi_command(). 2004-09-17 23:43:17 +00:00
mycroft cdc20e6ce8 In places where we've already called scsipi_make_xs(), call scsipi_execute_xs()
directly rather than going through scsipi_command().
2004-09-17 23:35:13 +00:00
mycroft ba781da1dc Change the way bustype_cmd is used. Rather than having it be responsible for
calling scsipi_make_xs() and scsipi_execute_xs(), instead push these into
scsipi_command.  Make bustype_cmd and PHOLD/PRELE be called from
scsipi_execute_xs().  This allows us to create a xfer structure -- possibly on
the stack -- and call scsipi_execute_xs() directly.
2004-09-17 23:30:22 +00:00
mycroft bd9548b268 Oops; fix ssrestart(). 2004-09-17 23:13:02 +00:00
mycroft 8b6c2af171 Do not manipulate xs->bp in "generic" code -- do it only in the psw_done
routine.  As part of this, pass down our pre-parsed error code -- though this
interface will probably change later to accomodate better error handling.
2004-09-17 23:10:50 +00:00
drochner 96b589fc18 a round of autoconf cleanup:
-convert submatch() style functions (passed to config_search() or
 config_found_sm()) to the locator passing variants
-pass interface attributes in some cases
-make submatch() functions look uniformly as far as possible
-avoid macros which just hide cfdata members, and reduce dependencies
 on "locators.h"
2004-09-13 12:55:47 +00:00
bouyer 4849b82163 Make the xxstart() functions reentrant again, as some drivers HBA can call
scsipi_done() from their scsipi_request().
For this, add a struct scsipi_xfer * argument to scsipi_command().
If not NULL scsipi_command() will use this to enqueue this xfer, otherwise
it'll try to allocate a new one. This scsipi_xfer has to be allocated
and initialised by scsipi_make_xs() or equivalent.
In xxstart(), allocate a scsipi_xfer using scsipi_make_xs(), and if not NULL,
dequeue the buffer before calling scsipi_command(). This makes sure that
scsipi_command() will not fail, and also makes sure that xxstart() won't
be called again between the BUFQ_PEEK() and BUFQ_GET().

Fix "dequeued wrong buf" panics reported by Juergen Hannken-Illjes in
private mail and Andreas Wrede on current-users@.
Thanks to Jason Thorpe and Chuck Silver for review, and Andreas Wrede for
testing the patch.
2004-09-09 19:35:30 +00:00
bouyer 76f52e0733 Fix comment: xxstart() can also be called from xxrestart() 2004-09-06 20:38:14 +00:00
chs 38f9a8eb8b make this compile on platforms where PAGE_SIZE is not a compile-time constant. 2004-09-02 12:39:56 +00:00
bouyer 80620a83a7 Improve handling of memory shortage, to fix problems like:
sd3(mpt0:0:1:0): unable to allocate scsipi_xfer
sd3: not queued, error 12
Havard Eidnes's analysis of this problem is that the scsipi_xfer pool is
competing for resources with other pools, including the the inode and vnode
pools which can grow quite large.

*_scsipi_cmd(): don't biodone the buffer if scsipi_make_xs() fails, let the
   caller deal with the problem
start function of block devices drivers: dequeue the buffer after the
   scsipi_command() call. If scsipi_command() fails with ENOMEM don't dequeue
   the buffer, and schedule a callout to call the start function after
   some delay.
scsipi_init(): prime the scsipi_xfer_pool with one page. This ensure that
   there is always some scsipi_xfer to play with. If scsipi_command() fails
   because of pool_get(), we're sure there will be resources available later,
   when the pending commands have completed.

Reviewed by Jason Thorpe and Havard Eidnes.
Todo: remove the "unable to allocate scsipi_xfer" and "not queued, error %d"
printfs, but I choose to keep them for now, to help make sure the code does
what it should.
2004-08-27 20:37:28 +00:00
bouyer fabf6fa880 Fix typo pointed out by Patrick Welche on current-users@ 2004-08-23 20:01:10 +00:00
thorpej 83a43d11ff Use ANSI function decls and make use of static. 2004-08-21 22:16:07 +00:00
thorpej 4deb00f885 Use ANSI function decls and make use of static. 2004-08-21 22:02:31 +00:00
thorpej f6b6634f46 Oops, missed one in last. 2004-08-21 21:30:58 +00:00
thorpej cb3eb355e7 Const poison scsipi_dtype(). 2004-08-21 21:30:29 +00:00
thorpej be6339d21a Use ANSI function decls and make use of static. 2004-08-21 21:29:39 +00:00
thorpej 3a4c3c0872 - De-__P.
- Use ANSI function decls.
2004-08-21 20:40:36 +00:00
thorpej 7994917f9b De-__P. 2004-08-21 17:41:18 +00:00