Commit Graph

1080 Commits

Author SHA1 Message Date
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
thorpej 6cb9b7482f Use ANSI function decls and make use of static. 2004-08-21 17:40:25 +00:00
thorpej 335b799580 atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().
2004-08-21 00:28:34 +00:00
thorpej 9cc521a148 Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
2004-08-20 06:39:37 +00:00
drochner 6ea832578d Use the new autoconf functions to rescan busses and detach devices
on user request.
This duplicates the functionality provided by a private ioctl
interface (accessible through scsictl(8)), but in a more generic way.
2004-08-18 11:50:59 +00:00
thorpej 4b51cecfc2 - Split the register handles out of struct wdc_channel into a separate
wdc_regs structure, and array of which (indexed per channel) is pointed
  to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
  ata_channel.  Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
  maximum number of drives that can be present on the channel.  For now,
  this is always 2.  Add an ATA_MAXDRIVES constant that places an upper
  limit on this value, also currently 2.
2004-08-14 15:08:04 +00:00
thorpej 46f4277564 WDCDEBUG -> ATADEBUG. 2004-08-13 04:10:49 +00:00
thorpej ab20886f7b Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.
2004-08-13 03:12:59 +00:00
thorpej 577bf67014 Move wdcstart() to ata.c and rename it to atastart(). 2004-08-13 02:16:40 +00:00
thorpej 996c3ca90e Move wdc_exec_xfer() to ata.c and rename it ata_exec_xfer(). 2004-08-13 02:10:43 +00:00
thorpej e6d61c5bc9 Move wdc_addref() and wdc_delref() to ata.c and rename them to
ata_*.
2004-08-12 22:39:40 +00:00
thorpej 2600c55e01 - Move wdc_xfer_pool, wdc_get_xfer(), wdc_free_xfer() to ata.c, and rename
to ata_*.
- Use a static initializer for the ata_xfer_pool.
2004-08-12 21:34:52 +00:00
thorpej 52ed169a28 Move wdc_probe_caps() to ata.c and rename it ata_probe_caps(). 2004-08-12 21:10:18 +00:00