Commit Graph

1015 Commits

Author SHA1 Message Date
soren 98ec436df3 As in scsiconf.c, don't print the numberic device type in the attach message. 2002-10-04 18:58:45 +00:00
soren 3a89aff59e Slightly simplicy the SCSI device attachment message:
- Use the plain words 'disk' and 'tape' instead of 'direct' and 'sequential'.
- Media status will be printed in the frontend, so don't bother with it.
- Don't bother printing the SCSI version, which is fixed these days, or the
  numberic device type.
2002-10-04 17:53:33 +00:00
soren af7ec6d1b2 Pass on indication of absent media in the general case as in the optical
device case.
2002-10-04 03:43:06 +00:00
soren 25674469e6 Leave error printing to the callers of scsipi_size(). 2002-10-04 03:41:50 +00:00
thorpej b75a007d9f Add trailing ; to CFATTACH_DECL. 2002-10-02 16:51:16 +00:00
thorpej 239b192ca3 Use CFATTACH_DECL(). 2002-09-30 23:07:07 +00:00
thorpej bf97c13c6c Declare all cfattach structures const. 2002-09-27 20:41:46 +00:00
thorpej f818766afe Declare all cfattach structures const. 2002-09-27 20:31:45 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
thorpej 6c88de3b53 Introduce a new routine, config_match(), which invokes the
cfattach->ca_match function in behalf of the caller.  Use it
rather than invoking cfattach->ca_match directly.
2002-09-27 03:17:40 +00:00
jmc c7258354f0 Force the initial probes to happen within the newly forked off kthread.
This eliminates problems where the underlying interrupt handler isn't the
specific layer calling scsipi_complete() for a given scsi transaction.
This avoids deadlocks where the kthread that called the autoconf routines
to configure a scsibus shouldn't be the one put to sleep waiting on a
scsipi_complete (only the scsibus's kthread should be doing that).

To avoid jitter this will force the scsibus's to probe in the order they
run through autoconf (so machines with multiple bus's don't move sd* devices
around on every reboot).
2002-09-19 08:31:05 +00:00
chs 128b037bfc remove all vesitages of dk_establish(). 2002-09-18 01:46:23 +00:00
chs f0beff44d2 recognize HP ScanJet 4c.
add a catch-all case for other HP scanners.
remove a local version of atoi() in favor of strtoul() from libkern.
2002-09-14 21:41:24 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
hannken 815491c0b3 Remove the old device buffer queue interface.
Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>
2002-08-30 15:43:36 +00:00
bouyer 36969486b0 Add yet another broken sony cdrom. This one, in addition to broken LUN
handling, has broken sync negotiation. Also add PQUIRK_NOWIDE to be safe.
Fix PR kern/17773.
2002-08-02 08:00:36 +00:00
wiz 645df36eff Spell '[Rr]ight' correctly. From Jim Bernard. 2002-07-26 14:11:34 +00:00
wiz 5db23d2c5d enouth -> enough. 2002-07-26 01:00:39 +00:00
mjacob 0bf3a73821 Fixes kern/17573: correctly describe the bfi && physical sector defect list
formats.

Obtained from PR submitter.
2002-07-24 23:45:03 +00:00
matt 7a023d8f5f Add a quirk for a HITACHI driver (CAP_SYNC|CAP_WIDE16). 2002-07-23 21:10:16 +00:00
bouyer 4a33970e19 Do PIO transfers for len < 4 bytes. From Matthias Drochner in private mail. 2002-07-22 20:31:56 +00:00
hannken 4d121bd094 Convert to new device buffer queue interface. 2002-07-22 14:59:43 +00:00
hannken 7de36862a8 Rename bufq_init() to bufq_alloc().
Add bufq_free() to remove a buffer queue.
Avoid MALLOC while holding a spinlock.

From Chuck Silvers.
2002-07-21 15:32:17 +00:00
hannken 10ff5e6607 Implement a new device buffer queue interface.
One basic struct, a function to setup a queue with a specific strategy and
three macros to put buf's into the queue, get and remove the next buf or
get the next buf without removal.

The BUFQ_XXX interface will be removed in the future.
The B_ORDERED flag is not longer supported.

Approved by: Jason R. Thorpe <thorpej@wasabisystems.com>
2002-07-16 18:03:17 +00:00
mjacob 787aeb4081 As per a discussion on tech-kern a while back- honor retries for
XS_SELTIMEOUT and XS_TIMEOUT errors- but only do so if the device exists
already.

Devices that are being probed won't be found via periph_lookup, so we can
use that to find if a device exists for the purposes of honoring retries.
2002-06-05 00:15:33 +00:00
bouyer 622fdb1fe6 Doh, the return of scsipi_lookup_periph() was meant to be assigned to
periph.
periph was used uninitialised, and caused a panic when the scsibus is reset
with siop or esiop, and possibly others HBA drivers.
2002-06-03 16:17:57 +00:00
drochner eafdf8c95d add translations for two ASC/ASCQs which occur before
the DVD player's region code is dealt with
2002-05-28 16:40:03 +00:00
drochner 259cb04e6f put multisession offset code into a separate function and initialize
the p_cdsession field of partition 'a' in the default disklabel
2002-05-27 16:42:30 +00:00
bouyer 29270413af If the data len if not a multiple of 2 bytes, force PIO mode. DMA can't
deal with such xfers, and can wedge the system with some controllers.
It's a bug to request such xfers for ATAPI, but as the request may come
from userland we have to protect against it.
2002-05-18 14:49:55 +00:00
mjacob 16fa96cfc8 Give XS_DRIVER_STUFFUP a case all by itself. 2002-05-17 18:56:05 +00:00
thorpej 64c6407d7b Garbage-collect the empty-for-years "su" device. 2002-05-16 02:59:57 +00:00
thorpej f4cc1100b0 Don't use a 2-dimensional array for the channel's periph table. Instead,
hash the target and lun together and use a hash table.  This will be
necessary in order to support very large (64-bit) LUN number spaces.
2002-05-16 02:54:20 +00:00
bouyer 445778d624 The number of sector is unsigned long, so use %lu to print it. 2002-05-15 13:01:27 +00:00
bouyer 3d5ee1e719 Change PQUIRK_CAP_SYNC to set PERIPH_CAP_SYNC aslo for devices that
improperly claim to only support DT clocking.
Add a PQUIRK_CAP_WIDE16 quirk.
Add a quirk for IBM DXHS36D SCSI disk (claims to only support DT).
2002-05-15 11:43:22 +00:00
bouyer 36ce07cc3b scsipi_print_xfer_mode(): PERIPH_CAP_DT is an equivalent of
(PERIPH_CAP_SYNC | PERIPH_CAP_WIDE16) here.
2002-05-15 11:19:38 +00:00
bouyer f23186dae7 Don't return an error for "Not Ready To Ready Transition (Medium May Have
Changed)" and "Power On, Reset, or Bus Device Reset Occurred" senses, if
we're trying to open the device.
2002-05-06 13:43:57 +00:00
bouyer df3d2c7ac3 If periph->periph_callout is already active, don't freeze the periph again:
scispi_periph_timed_thaw() will be called only one time anyway.
2002-05-05 15:16:30 +00:00
thorpej ca83c89dd4 A statement must follow a label. 2002-05-05 06:01:28 +00:00
bouyer b3f8d22993 Back out previous. It has issues with multiple dumps to one tape using
/dev/nrstx, as pointed out by Matthew Jacob.
My problem is probably related to mt using /dev/nrst0 instead of /dev/enrst0
by default.
2002-05-03 20:41:17 +00:00
bouyer 1d5fb5d90e If we get a Unit Attention Not Ready To Ready Transition (medium may have
changed) sense, and the periph was not open, then ignore the error.
2002-05-02 12:36:23 +00:00
bouyer cd3578d7ef More copyright fixes, pointed out by Thomas. Thanks ! 2002-04-23 20:41:13 +00:00
bouyer 15c40f8b5b The IBM drive I have here supports DT, but claim version 3 only.
So check for version 3, not 4 when looking for DT support.
This should be safe as these bits are reserved for older devices, they
should be set to 0 when not supported.
2002-04-23 17:28:43 +00:00
bouyer d77c3b3d84 Add the Parallel Protocol Request message. 2002-04-23 09:46:51 +00:00
bouyer e49057af19 Report SPC-2 features (DT clocking, quick arbitration and selection,
information unit transfers) though periph_cap.
2002-04-23 09:09:55 +00:00
joda 518cc55c27 Maxtor D040H2 also can't modesense 2002-04-15 12:40:28 +00:00
bouyer e5727031fb Implement mstohz() as discussed on tech-kern, and use it in SCSI drivers
to convert xs->timeout to callout() parameter.
2002-04-05 18:27:45 +00:00
bouyer 4940346b10 Add a chan_name to struct scsipi_channel, holding the channel's name.
Set this to dv_xname for scsibus and atapibus.
Set the name of the kernel thread to chan_name instead of controller's
name:channel number (so that we can use this name for controller-specific
threads).
2002-04-01 20:37:41 +00:00
martin 3adb535884 Don't clear the adapt structure of the attaching channel - this nukes
all function pointers passed in from the adapter driver.

This partly fixes PR 13480, i.e. the FREECOM CD driver works now in pcmcia
adapters.

The remaining issue (timing problems with slow cards and cardbus bridges)
is probably the cause of several other PRs too.
2002-03-31 14:36:59 +00:00
christos 03b1503c21 PR/16110: Chris Jepeway: scsipi_complete() calls (*psw_done)() b/4
setting buffer fields
2002-03-28 22:01:22 +00:00
mjacob 6424bafe73 kern/16014- if we do an 'mt offline', make sure we've allowed the tape
to be ejected (PR_ALLOW). This got nuked in a previous change.
2002-03-22 21:39:36 +00:00
mjacob ff9ae73488 Forced commit so that some more detail on the previous patches can be
inserted into comments. I really think that more testing was required,
but Christos was eager.

+ Add in tape block/file position reporting support.

+ Change the prevent/allow ejection code so that if the device
  is close the tape can be ejected. This allows robots to eject
  the tape even if the tape isn't at BOT.

+ Don't do a null filemark write if we're reading block position. This
  was such an abysmal performance killer that it had to go. Assume
  that the tape will DTRT and tell you what the tape position really is
  including any buffered data. You are depending on the tape to do
  the right thing to report position at all, so the risk factors don't
  increase appreciably here. BTW- we only do this for logical block
  position. For 'hardware' block position, we still flush.

+ Some substantial tweaking in st_interpret_sense. This essentially duplicates
  the FreeBSD driver's exception handling code. This is to try and correctly
  handle EOM cases. I'm not sure that this is now correct with respect to
  the ENABLE EARLY WARNING code- I hadn't gotten around to validating that.
  Add in full 32 bit residuals- this can then be available to an update
  MTIOCGET in the future.

+ Make sure we handle SKEY_VOLUME_OVERFLOW correctly.
2002-03-22 02:03:30 +00:00
christos e5160e810e Add the ability to report file number/block number. From Matt Jacob. 2002-03-20 14:53:59 +00:00
chs bbc8f01aef add a quirk for some disks I have that don't like tagged queuing. 2002-03-16 23:26:34 +00:00
bouyer 0b16dfbbae Present the same interface to periph driver for ASYNC scsipi_command() in the
normal case, and in the polling or "no thread yet" cases:
don't return an error from scsipi_complete(), as the error should already have
been handled in scsipi_complete() and eventually periph driver callbacks.
Should fix kern/15190.
2002-03-16 17:21:19 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
enami 147331af13 Fix broken indentation. 2002-02-21 05:30:30 +00:00
thorpej 3e9025cfbf Remove a pretty much useless autoconfiguration message. 2002-02-10 23:28:27 +00:00
bouyer 3ba24c2b42 IF we change the ATA modes, also reset the device, so that we can retry
the command with the new mode.
2002-01-27 22:00:40 +00:00
uwe 2536236e11 Add notag quirk for Seagate "ST11200N SUN1.05". 2002-01-23 18:13:08 +00:00
bouyer f03445a59f For fixed block drive, for invalid sense error code, set info to
xs->datalen / st->blksize instead of xs->datalen; as code assume later
that info is a block number.
Should fix kern/2727.
2002-01-12 20:30:11 +00:00
tsutsui 1267bddc09 Call malloc(9) with M_ZERO flag instead of memset() after malloc(). 2002-01-12 16:29:30 +00:00
drochner dcea5d31ee -don't apply scsipi_strvis() twice, it tries to octal-print the string
terminating zero and uninitialized dada following
-use use the "vendor" field for the name which is used in the default
 disklabel, the "product" field is meaningless or not existing for ATAPI
 (serial number)
2002-01-09 18:48:18 +00:00
thorpej 229efaff69 Add ioctls to get (DIOCGCACHE) and set (DIOCSCACHE) cache enables
on disks in a generic way.  Implement these ioctls for SCSI disks.

This is not fully fleshed-out yet, but it allows people to experiment
with disk caches more easily.
2002-01-09 04:12:11 +00:00
augustss 8164bd8bae Move some USB device quirks to the umass_quirk table. 2001-12-29 14:06:18 +00:00
augustss b965a7d6eb Remove some quirk entries that are handled in umass_quirk now. 2001-12-29 13:55:02 +00:00
nathanw 5dbef63175 Use PQUIRK_ONLYBIG for all Olympus cameras, not just the C-1.
Use PQUIRK_ONLYBIG for the PQI TravelFlash.
2001-12-27 18:57:46 +00:00
gehenna 59c47ef767 The FujiFilm USB storage drive doesn't have a flex geom page and
doesn't know REQUEST SENSE.
2001-12-22 13:29:50 +00:00
nathanw 8d1585affa The Olympus C-1 engine cameras seem to need the PQIRK_ONLYBIG quirk. 2001-12-14 22:15:52 +00:00
veego 9d39bbf3a8 Support for dvd region code (RPC). 2001-12-09 22:56:10 +00:00
yamt 272f471ee0 add detach support for st. 2001-12-07 11:26:30 +00:00
bouyer bfc80822c7 Update my copyrigth. 2001-12-03 00:20:22 +00:00
bouyer 65768c08e2 No need to include atavar.h here. 2001-12-02 22:59:40 +00:00
bouyer 4809ad42cb Clean up attach of wd/atapibus:
kill ata_atapi_attach. Change atapibus to use a struct scsipi_channel instead
of ata_atapi_attach as attach arch. Create a ata_device, compatible with
scsipi_channel, to attach wd.
2001-12-02 22:44:32 +00:00
bouyer c6c2c476eb Hum, no need to print a message each time we're waiting for the drive. 2001-12-01 00:05:04 +00:00
bouyer e6922f82d6 Various quirks for the ATAPI OnStream DI-30, mostly from the FreeBSD driver.
Many thanks to Chris Pinnock for giving me remote access to his hardware.
2001-12-01 00:03:45 +00:00
bouyer cd8d64fe2b For ATAPI tape drives, poll for DSC (using a callout), to get the real
status of the command, and make sure the drive is ready for the next one.
2001-12-01 00:00:29 +00:00
lukem ecb81c3f6d - convert usage of "defopt" to "defflag" where the relevant option does
not support a value (e.g., it's to be used as "options FOO" instead of
  "options FOO=xxx"). options that take a value were converted to
  defparam recently.
- minor whitespace & formatting cleanups
2001-11-28 10:21:10 +00:00
fredette 4fd267f75d Added the new defopt SCSI_OLD_NOINQUIRY; this is used instead
of sun2 to wrap code that conjures up INQUIRY responses for
certain specific old devices.
2001-11-28 01:04:49 +00:00
fredette 83c021b2a7 Added quirk entries for Adaptec and Emulex SCSI interposer boards.
Decode a limited set of SASI/SCSI-1 sense codes, and under sun2
only, conjure up INQUIRY responses for these boards.
2001-11-26 20:39:29 +00:00
lukem 0fa231134c - replace "defopt" with "defparam" for options which must take a value,
as config(8) will warn for value-less defparam options
- minor whitespace/formatting cleanup
- consolidate opt_tcp_recvspace.h and opt_tcp_sendspace.h into opt_tcp_space.h
2001-11-20 14:34:18 +00:00
tsutsui 859356d03b Add a new quirk value PQUIRK_CAP_SYNC for SCSI1 devices which support
sync transfers, and set PERIPH_CAP_SYNC for them in scsi_probe_device().
As per discussion on tech-kern.
2001-11-19 22:50:00 +00:00
soren eefc317219 Remove duplicate struct scsipi_start_stop. 2001-11-19 17:18:08 +00:00
soren 27e3d258cd Floptical drive needs PQUIRK_NODOORLOCK as well. 2001-11-19 16:54:20 +00:00
soren ae27210d46 Insite Floptical drive needs PQUIRK_NOLUNS. 2001-11-19 00:22:47 +00:00
tsutsui c8f45396b3 Fix formatting of scsi_quirk_patterns[] and wrap long lines. 2001-11-18 17:22:43 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem 7ba10b3532 add RCSIDs 2001-11-13 06:54:32 +00:00
augustss a1ba73d6c3 Add a quirk for a USB CD/RW. 2001-11-06 13:31:20 +00:00
tsutsui 5e6dd3ae03 Add common macro to check message length. 2001-11-04 12:03:03 +00:00
tsutsui f82eb7bfa1 Replace a magic number with macro. 2001-11-03 15:52:03 +00:00
bouyer da77194a02 We can't have XS_CTL_DATA_OUT and XS_CTL_DATA_IN at the same time.
Pointed out by Bernd Ernesti.
2001-10-22 16:16:00 +00:00
mjl 51a4b6098f Add ST15150N to quirk table, as per PR/13817. 2001-10-21 23:25:04 +00:00
christos 070d583bb3 PR/14256: Kevin P. Neal: Add quirk for micropolis drive. 2001-10-16 13:33:02 +00:00
bouyer 69fff4726e Refuse to register a callback if the completion thread isn't started yet. 2001-10-14 21:17:41 +00:00
bouyer a84535fd3e Call ADAPTER_REQ_GROW_RESOURCES from the completion thread, if possible.
This allows HBA drivers to call bus_dmamem_map() safely.
2001-10-14 20:31:24 +00:00
bouyer ce6aaa187a Split channel flags in chan_flags used for communications between
scsipi and HBA, and chan_tflags used for communications between scsipi
and its kernel thread. No functionnal change.
2001-10-14 19:03:43 +00:00
mjacob 87a8b82ae9 Restore previous functionality- in scsipi_periph_timed_thaw check to
make sure the completion thread is running before you try to schedule
it.

Fixes port-i386/14013
2001-09-27 18:11:06 +00:00
mjacob 79d74959da Restore previous definitions. 2001-09-27 18:07:51 +00:00
fvdl 000902fbf6 Unfortunately, the previous change seems to make most (all?) configurations
using the ahc driver hang when probing scsi devices. The problem may be in
the ahc driver and not in this change, but back it out until this has been
fixed anyway.
2001-09-21 13:54:47 +00:00
mjacob 849eac52f2 Rather than run a periph's queue from scsipi_periph_timed_thaw which is
called via a callout, kick the completion thread to run it for us (uses
a new flag, SCSIPI_CHAN_KICK).

If we've received BUSY status and we haven't started the completion
thread yet, don't freeze do a callout to scsipi_periph_timed_thaw which
then will try and kick the completion thread- instead treat the command
as if it were a polled command and just call delay for 1 second.

If DIAGNOSTIC is defined, and the periph qfreeze count is less than
zero, panic because some HBA has corrupted the periph structure's
accounting.
2001-09-18 20:20:26 +00:00
enami 750c07de04 Pass the correct pointer to atapibusprint(). 2001-09-13 06:27:23 +00:00
thorpej f7a403a447 Define more caching parameters from SCSI-3. 2001-09-03 17:14:49 +00:00
thorpej 3ac8a43f8b Comment what the PF bit means in the MODE SELECT command, and
define a scsipi_mode_page_header, which has the common fields
(page code and page length) of all mode pages.
2001-09-02 22:06:16 +00:00
thorpej dda09e1b39 Add the Force Unit Access and Disable Page Out bits to the
READ(10) and WRITE(10) commands.
2001-09-02 20:17:04 +00:00
thorpej e6bfee4968 Use the AUDIO_PAGE definition common to SCSI and ATAPI. 2001-09-02 19:53:40 +00:00
thorpej ac7519b12e Centralize the definition of the page code mask and page-savable bit
in the pages returned by MODE SENSE.
2001-09-02 19:35:20 +00:00
thorpej d737e7fda8 Oops, name the caching parameters page structure member. 2001-09-02 16:47:45 +00:00
tsutsui 354cce66e5 Use be16toh(), be32toh(), le16toh() and le32toh() rather than
ntohs(), ntohl() or homegrown bswap() functions.

XXX Does anyone use drives with PQUIRK_LITTLETOC on big endian machines?
2001-09-02 13:11:53 +00:00
thorpej 2cf7638731 Add the caching parameters mode page. 2001-09-01 02:39:21 +00:00
mjacob 18e1071fce Add table value for Ultra3, so configuring an Ultra3 disk shows:
sd1: sync (12.5ns offset 14), 16-bit (160.000MB/s) transfers, tagged queueing enabled

instead of:

sd1: sync (36.0ns offset 14), 16-bit (55.554MB/s) transfers, tagged queueing enabled
2001-09-01 00:54:38 +00:00
augustss 60ffafe273 Add a new quirk, PQUIRK_NOBIGMODESENSE, for devices that need big
SCSI ops, but still fails on big mode sense.
Makes M-Sys DiskOnKey work.
2001-08-31 07:09:41 +00:00
augustss 033a7fa40d Some quirks for USB M-Sys DiskOnKey. Still not enough to make it work. 2001-08-31 06:54:42 +00:00
ad dacf7e8e3d Don't special case the retry for Media Changed... More later. 2001-08-20 15:45:10 +00:00
ad 13499203a2 Two changes submitted by Sergey Svishchev <svs@ropnet.ru>:
- Don't send START UNIT upon open if the drive is playing audio (PR 11768).
- If we receive sense indicating that the media changed, retry (PR 8326).
2001-08-20 11:31:10 +00:00
ad ab54b70cae Cosmetic change. 2001-08-20 11:20:51 +00:00
ad 52449ef3bf Medium Not Present has number of defined ASCQs. Pointed out by Sergey
Svishchev <svs@ropnet.ru> in PR 8326.
2001-08-20 07:47:01 +00:00
ad d861b4992a Add descriptions for Medium Not Present ASCQs. 2001-08-20 07:41:14 +00:00
yamt 75ed9ccf7f fix scsipi_target_detach with wildcard target. 2001-08-19 14:05:13 +00:00
eeh 0cbe02398a Add support for smaller sector sizes so we can mount ffs filesystems. 2001-08-15 22:21:01 +00:00
bouyer f2cacede49 Adn scsipi_target_detach() and scsipi_thread_call_callback() as discussed
on tech-kern. scsipi_target_detach() accept wildcard target/lun as requested.
2001-07-18 20:19:24 +00:00
thorpej aafd882086 bcmp -> memcmp 2001-07-18 18:27:08 +00:00
thorpej 38bdc75312 bcopy -> memcpy 2001-07-18 18:25:41 +00:00
thorpej 03746a443a bzero -> memset 2001-07-18 18:21:04 +00:00
bouyer c399f05222 scsipi_set_xfer_mode(): issue a ADAPTER_REQ_SET_XFER_MODE request to adapter
only if we succesfully attached at last one device for this I_T.
2001-07-13 20:00:23 +00:00
wiz cc0b68092e Correct various misspellings of 'transfer' and inflected forms. 2001-07-08 18:06:42 +00:00
ross f54fe9f3b1 compile tweak for non-SCSIVERBOSE 2001-06-27 23:14:26 +00:00
bouyer 6a91469e6d Some ATAPI CD occasionally reports "ATA illegal indication length" for
a request sense command, but the sense is properly transfered anyway.
Ignore the error for this case.
2001-06-27 13:22:36 +00:00
bouyer 4fadc33006 Better diagnostic when a REQUEST SENSE is terminated with CHECK CONDITION. 2001-06-27 13:21:30 +00:00
bouyer 90d0e67408 Add a XS_CTL_SILENT_NODEV flag: if the sense info is "not ready, medium
not present" don't print any message but still return ENODEV.
Use this in cd driver to allow open of character raw partition even if
the drive is empty (older drives fails at LOAD_UNLOAD time, newer
ones fail at TEST_UNIT_READY time).
2001-06-26 15:32:02 +00:00
bouyer f47d097cf5 Make it compile with SCSIPI_DEBUG 2001-06-26 12:46:56 +00:00
wiz 15223234d7 Fix some typos in comments. 2001-06-24 10:18:13 +00:00
lukem b7f8c7eb86 delint 2001-06-19 10:43:26 +00:00
bouyer 49ed2592ce Add my copyrigth and remove the older ones. None of the original authors of
the st driver wrote something in this file.
2001-06-18 09:41:06 +00:00
bouyer 0a63f01fef Snapshot of ATAPI tapes support. Known to be able to read/write to tape with:
st0 at atapibus0 drive 1: <Seagate STT8000A, , 5.51> type 1 sequential
removable
Major changes may still happen in order to properly support other ATAPI
tape drives.
2001-06-18 09:05:05 +00:00
bjh21 4bc5a3b295 Add explicit support for IDE and SCSI adaptors which don't support interrupts.
On such adaptors, all transfers are done in polling mode.

OK'ed by Manuel on tech-kern.
2001-06-13 18:17:38 +00:00
pk b9e61207ff Add nolun/nosync quirk for "IBM CDRM00201 !F"
See PR#13031.
2001-06-11 13:58:18 +00:00
bouyer 88f3192778 Fix typo in sddump() which caused core dumps to fail with ENXIO. 2001-06-01 08:39:54 +00:00
tron 264d7e1264 Install "dev/scsipi/scsipi_cd.h" again because it is e.g. used by the
CD player include in version 2.x of the "kdemultimedia" package.
2001-05-31 21:54:07 +00:00
bouyer 708bb529d3 uninitialised variable (from Krister Walfridsson):
in st_cmprss(), init flags to 0 (never changed, but this should change soon
anyway, for ATAPI tapes support)
2001-05-30 20:28:17 +00:00
mrg c13e3a6693 use _KERNEL_OPT 2001-05-30 11:40:35 +00:00
chs ffcbc851a0 fix some problems in sddump() with uninitialized variables. 2001-05-29 01:02:39 +00:00
bouyer 72b4ba8aed In scsipi_channel_thaw(), if the count drops to 0, call scsipi_run_queue(). 2001-05-23 15:50:32 +00:00
chs fae4d6d720 fix typo in previous revision so that the scsi code compiles again. 2001-05-23 02:16:19 +00:00
mjacob b9eb902304 Make SDRETRIES an option you can dig out of opt_scsi.h.
Add SD_IO_TIMEOUT (an option in opt_scsi.h) also, which defaults to the
normal 60 * 1000 timeout for normal read/write commamds. This allows you
to shorten or lengthen the timeout as needed.
2001-05-22 18:59:57 +00:00
mjacob 38f6ada8b6 Add SDRETRIES and SD_IO_TIMEOUT option for sd. 2001-05-22 18:58:15 +00:00
bouyer 2a604875d6 Remove one extra byte from scsipi_mode_select; pointed out by Juergen
Hannken-Illjes.
2001-05-22 15:14:24 +00:00
mjacob 3462fe5d99 Remove reference to adapter_q in scsipi structure. Comment about the
usage of channel_q.
2001-05-21 15:50:46 +00:00
christos 2ed6d9dbf7 PR/12991: Dave Huang: DVD ioctls don't work because we send the wrong size
CDB (16 instead of 12).
2001-05-20 21:07:58 +00:00
is 5c9dc5b0d0 When abusing structs to describe on-wire (or in-hardware) data structures,
they need to be packed. (Without this, breaks on at least m68k.)
2001-05-18 21:11:43 +00:00
enami e4334b830d Don't capitalize the word sync or async. It's inconsistient with other
messages.
2001-05-18 16:25:07 +00:00
bouyer 8b5bf22895 Workaround for broken drives (explained to me by Chris G. Demetriou):
some devices can't handle tag number larger than some values and always
reject commands with QUEUE FULL if the tag number is larger than this.
Under some circonstances the scsipi system may not decrease periph_openings
(as a workaround of other odd behavior) and we may end up requeuing the command
with a hight tag value again, and the driver could loop on this.
Workaround: in case of queue full, decrease periph_openings to
min(periph_active - 1, periph_openings - 1) so that, after some iteration,
periph_openings is less than the max tag value acceptable by the device.

Solves the problem with tagged queuing on ncr53c9x for me.
2001-05-18 12:56:28 +00:00
bouyer 7ddcb8122d SDEV_DB -> SCSIPI_DB 2001-05-17 20:02:56 +00:00
lukem b6b83e2ec3 delint; use MAX(sizeof(..),sizeof(..)) instead of max(...) for array size 2001-05-15 14:03:27 +00:00
lukem 13a9902fc6 delint: can't have an empty case item at the end of a switch; need a ; at least 2001-05-15 13:53:20 +00:00
bouyer bc980d7eba Use SCSI/ATAPI common definition for MODE_{SELECT,SENSE}{,_BIG}. Define
functions to send theses commands in scsipi_base.c and use them instead
of ad-hoc commands setups.
2001-05-14 20:35:27 +00:00
drochner 06fc2f85cc Since __HAVE_OLD_DISKLABEL, DISKMINOR(u, p) isn't continuous over "p"
anymore. So we can't pass a range to vdevgone() but have to loop over the
partitions explicitely.
(otherwise the next device unit will be killed)
2001-05-06 18:30:56 +00:00
hannken 3446a61cb3 Fix a typo from thorpej_scsipi merge. No-sense information with retval == 0
should only print if SCSIPI_DEBUG is defined.
2001-05-06 11:31:08 +00:00
bouyer 27155d9a6d Add an ATAPI front-end to the st driver. Completely untested for now,
but st at scsi should still work :)
2001-05-04 07:48:56 +00:00
bouyer 28d47d8db3 Use same type for first field of struct ata_atapi_attach and struct
scsipi_channel, so umass has better chances of working on big-endian systems.
2001-05-02 09:47:45 +00:00
lukem 85772a1cef remove some lint 2001-04-30 02:34:58 +00:00
tsutsui 862125c057 Don't forget to set XS_CTL_DATA_OUT (that was removed in previous). 2001-04-28 09:33:25 +00:00
thorpej 335ac52a5b Use simple tags for read and write, unless B_ORDERED is set, in
which case we use an ordered tag.
2001-04-28 04:11:31 +00:00
bouyer 74b15b27a2 Don't forget to call psw_done() ! 2001-04-27 21:36:58 +00:00
bouyer 937a7a3ed9 Pull up the thorpej_scsipi branch to main branch.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
  ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
  to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
  peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
  recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
  scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
  (no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
  set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
  the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
  will be requeued, or a REQUEST SENSE will be sent as appropriate.

Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
2001-04-25 17:53:04 +00:00
augustss e4cc721094 Correct the opcode for SCSI_MODE_SENSE_BIG. 2001-04-19 10:16:25 +00:00
jdolecek 372e5956ef Only install headers which are actually used by our userland. This
saves about 2.2MB under /usr/include/dev/. Discussed on tech-kern@
recently.

I HOPE to get the list right. The headers I left in are ones
used for MI tools and those whose usage I discovered by grep over tree sources.
Feel free to put needed includes back in if you encounter anything which
should not be removed from lists.
2001-04-11 07:42:31 +00:00
augustss 95af1455f2 The ZiO! MMC adapter doesn't have a flex geometry page. 2001-04-01 19:05:44 +00:00
augustss 2ff439c85c Add quirks for Panasonic MultiMediaCard adapter (attaches via USB). 2001-03-20 22:39:51 +00:00
augustss 93b623b541 Extend quirks to 32 bits. Add two new ATAPI quirks, one to
deal with a bad byte5 of the capacity descriptor, one to
handle devices that lack the flex geometry page.
2001-03-20 22:39:08 +00:00
explorer b12c43f70a Only lock the pack in if the disk device is a removable one. This fixes a
problem with Hitachi SCA drives
2001-03-09 16:07:39 +00:00
fvdl b72e6ca276 Add quirks for VMware emulated disks, for NetBSD as a guest OS. 2001-02-26 22:31:27 +00:00
lukem 3aeb5f2f29 whitespace police 2001-02-24 01:59:46 +00:00
pk 672f49bfa2 Turn off command tagging by default for pre-SCSI2 devices. 2001-02-16 22:54:27 +00:00
mycroft f2d987f8a4 Force certain commands (i.e. DVD authentication) to PIO mode. They are
explicitly not supported in DMA mode, and generally return an `illegal field
in CDB' error.
This should have been done ages ago.
2001-01-22 07:00:39 +00:00
kenh 4a962c6cd9 Retry requests if the CD-ROM drive returns the sense code "Device in
Process of Becoming Ready".
2001-01-19 22:47:46 +00:00
jdolecek 34c8ae80da constify 2001-01-18 20:28:15 +00:00
fvdl d040bd5908 Return error in the case of using ODIOCGDINFO or ODIOCGDEFLABEL when
the number of partitions is > OLDMAXPARTITIONS. This is better
than silently truncating the label (don't want to silently throw
away partitions when using an old disklabel binary on a label with
> 8 partitions). From Enami Tsugutomo.
2001-01-08 02:03:45 +00:00
fvdl e2d1c1f926 Adapt all disk devices in MI directories to handle ODIOC* calls
for ports that have bumped MAXPARTITIONS (and thus define
__HAVE_OLD_DISKLABEL).
2001-01-07 18:09:01 +00:00
augustss 5806434428 Call vdevgone() with correct minor range. 2001-01-01 18:34:12 +00:00
augustss 2f1e60b46c Support device detach.
Don't call scanjet_attach() for all HP scanners.
Also, ANSIfy while I'm here.
2001-01-01 18:28:49 +00:00
ad 2f5cf27275 PR 6402: some SCSI devices use \377 as blank, so adjust scsipi_strvis(). 2000-12-31 17:54:29 +00:00
thorpej b0c9cd5f7b ALTQ'ify. 2000-12-14 07:27:21 +00:00
augustss a48cc8927a Don't access (in core) disk label of a removable disk that is not there. 2000-12-08 02:30:51 +00:00
ad 9ecde86321 I2O HBAs provide an abstracted view of the bus; use SCBUSIOLLSCAN to give
them an oppertunity to re-scan it before we do.
2000-12-03 13:30:36 +00:00
wiz 972c941cf6 Fix typo in comment reported by Tetsuya Isaki in kern/11587. 2000-11-29 12:49:56 +00:00
chs f6b62f776c avoid division and remainder operations for devices where
the sector size is DEV_BSIZE (ie. practically everything).
2000-11-24 00:17:35 +00:00
soren a622a1b6d2 Remove obsolete comment. 2000-11-22 00:32:24 +00:00
thorpej b84f740be0 Move bpfattach()/bpfdetach() calls into ether_ifattach()/ether_ifdetach(). 2000-11-15 01:02:11 +00:00
pk fbf62501af Mark the "TOSHIBA, XM-4101TASUNSLCD" CD-R for a-sync operation only. 2000-11-14 08:52:35 +00:00
pk 8ba559d056 st_touch_tape(): Pass XS_CTL_SILENT to st_mode_select(). 2000-11-03 12:08:41 +00:00
pk 4c7351ec7d * st_touch_tape(): start probing at the block size from the sense data if
we have it.

* st_unmount(): reset density to the device default. This prevents using
  stale density values after changing to a medium with different density.

  Section 9.3.3 of the SCSI specs states that a device shall return the
  density value specified in the last succesfull MODE SELECT after an
  unload operation, in case it is not able to automatically determine
  the density of the new medium.
2000-11-03 10:46:18 +00:00
pk e3aaa6c1ab * Per st(4), retrieving status and setting modes on the control device
should succeed even if no media is loaded.

* In stopen(), check the return value of st_mount_tape().
2000-11-03 10:22:02 +00:00
pk f71476a62f Introduce ST_Q_ERASE_NOIMM, a quirk indicating that the device rejects
an ERASE command with the `Immed' bit on.

Use it on the VIPER 21247 & 21531.
2000-11-02 13:34:59 +00:00
pk e4958f1fe6 Prevent printing sense information twice. 2000-11-02 13:12:58 +00:00
pk 9c058471c3 Remove useless check for SDEV_MEDIA_LOADED from st_read_block_limits().
This command should work whether or not media is present in the device.
2000-11-02 00:56:59 +00:00
pk 3867a66a9a * In st_touch_tape(), don't bail out if the MODE SELECT fails since we are,
after all, probing the device for acceptable parameters.

* In st_loadquirks(), copy mode-specific quirks from the quirk table
  to `st_softc'; otherwise all such quirks save ST_Q_FORCE_BLKSIZE are ignored.
2000-11-02 00:52:15 +00:00
ad 5df1120c67 Add some more completion status codes. 2000-10-05 11:23:05 +00:00
thorpej 7ca3fb9ef0 Move the check for "promisc + unicast + not for us" into ether_input(),
and change Ethernet drivers to always pass all received frames to
ether_input() (with a few exceptions, which are documented in the
code).
2000-10-01 23:32:39 +00:00
ad 382141e2f7 Add a new, optional method to scsipi_adapter (scsipi_accesschk()), and use
it when considering whether to attach devices. This is to facilitate
`non-SCSI' RAID controller drivers that want to provide SCSI pass-through
services to the kernel.
2000-09-22 16:45:17 +00:00
matt b0c9fcd14a Add a NOPREVENT quirk which prevents the sending of PREVENT messages (some
manual 9track tapes don't support it).  Add a quirk entry for the NCR H621
9track tape drive.
2000-08-16 19:22:25 +00:00