Commit Graph

139 Commits

Author SHA1 Message Date
mrg
1180bee580 eliminate unused variables. 1996-03-29 14:50:12 +00:00
cgd
4b535677ab fix pasto: sdminphys -> cdminphys in comment. 1996-03-27 01:11:41 +00:00
mycroft
f20498187e SDUNIT -> CDUNIT in last. 1996-03-27 00:48:50 +00:00
mycroft
5ed22a9852 Put back dk_establish() for now. 1996-03-26 22:22:19 +00:00
mycroft
5f57f43753 Increase *OUTSTANDING.
Remove old dk_establish() garbage.
Support the `ancient' bit in both drivers.
1996-03-26 20:32:06 +00:00
mycroft
e819063285 Define a full set of [234][bl]tol() and lto[234][bl]() conversion functions,
inlined.
Use sized types in protocol structures.
Make the definition of scsi_sense_data less ugly.
1996-03-19 03:05:15 +00:00
thorpej
532e997971 New device attachment scheme:
- split softc size and match/attach out from cfdriver into
	  a new struct cfattach.

	- new "attach" directive for files.*.  May specify the name of
	  the cfattach structure, so that devices may be easily attached
	  to parents with different autoconfiguration semantics.
1996-03-17 00:57:14 +00:00
christos
0bc63f486d scsi prototypes 1996-02-14 21:46:52 +00:00
thorpej
919f6728ab Accept DIOCEJECT as a synonym for CDIOCEJECT. Implement DIOCLOCK
separately from CDIOCALLOW and CDIOCPREVENT, even though they perform
basically the same function (with a different interface XXX).
1996-01-30 18:28:02 +00:00
thorpej
8068d9eeb2 Handle cases like the following:
- controller calls scsi_done() with error XS_TIMEOUT
	- scsi_done() calls sddone()
	- sddone() calls disk_unbusy()
	- scsi_done() calls controller to retry command (missing the
	  call to disk_busy())
	- controller calls scsi_done()
	- scsi_done() calls sddone()
	- sddone() calls disk_busy(), which panics because of the imbalance.
Bug noticed by Leo Weppleman, who also suggested this fix; pass an additional
boolean argument ("complete") to the device's "done" routine, with a
value of `0' passed from the previous call to "done", and add an additional
call to "done" when the xfer resources are freed.
1996-01-12 22:43:26 +00:00
thorpej
5b39541e48 New generic disk framework. Highlights:
- New metrics handling.  Metrics are now kept in the new
	  `struct disk'.  Busy time is now stored as a timeval, and
	  transfer count in bytes.

	- Storage for disklabels is now dynamically allocated, so that
	  the size of the disk structure is not machine-dependent.

	- Several new functions for attaching and detaching disks, and
	  handling metrics calculation.

Old-style instrumentation is still supported in drivers that did it before.
However, old-style instrumentation is being deprecated, and will go away
once the userland utilities are updated for the new framework.

For usage and architectural details, see the forthcoming disk(9) manual
page.
1996-01-07 22:01:38 +00:00
thorpej
c9895db015 In both cd.c and sd.c:
If the read or write request can fit into a 6-byte cdb, then
	use a 6-byte cdb, otherwise use the 10-byte as before.

In sd.c:
	In sdattach(), make a note if the device is "ancient" (i.e.
	inqbuf.version & SID_ANSII == 0).

	Implement sdminphys(): if the device is "ancient", shorten the
	transfer so it will fit into a 6-byte cdb.

These changes have eliminated the rejected read/write requests on my
Sun 3/60 with 2 ESDI disks behind an Emulex MD21.
1995-12-07 19:11:32 +00:00
mycroft
fbecb8d22b Remove the gratuitous code to check for a disc at boot time. 1995-11-11 20:07:57 +00:00
mycroft
92221a1399 Return EINVAL if something other than a whole number of blocks is requested. 1995-10-10 02:52:56 +00:00
thorpej
249cddaaa7 Don't declare Debugger(). It's handled in <sys/systm.h>.
#include <sys/systm.h> where necessary, as suggested by Jonathan Stone.
Fixes PR #1511.
1995-09-26 19:26:48 +00:00
mycroft
8a9880e714 Fix oversight in previous. 1995-08-12 21:36:46 +00:00
mycroft
80d7b0695a minphys() functions really should return void. 1995-08-12 20:30:45 +00:00
mycroft
24a5e56396 Use an intermediate variable to shorten label initialization code. 1995-08-05 23:47:52 +00:00
cgd
3301cf82fd update SCSI minphys routines' definitions to match standard minphys()
definition and usage.
1995-07-24 06:55:37 +00:00
mycroft
7263209ce6 Make each disk and tape driver define its own read and write functions.
Deprecate rawread() and rawwrite() completely.  Remove d_strategy from cdevsw to
force the abstraction barrier.
1995-07-04 07:15:28 +00:00
cgd
d093e5d8b8 make dump stubs consistent 1995-06-26 05:15:33 +00:00
mycroft
1d2f0bce2a Make the byte-shifting code consistent. 1995-05-03 19:38:45 +00:00
mycroft
04e937dcbd Don't boundary check I/O to the `raw' partition. 1995-04-15 05:01:26 +00:00
mycroft
7e2dabf972 Add a missing unlock. 1995-04-01 10:29:41 +00:00
mycroft
1d568eab9a Revamp the locking mechanism slightly. 1995-03-29 23:04:39 +00:00
mycroft
b51403f60d Remove the write protect check altogether, and rely on the drive to do it. 1995-03-25 19:45:18 +00:00
mycroft
990077ba88 Don't bother with DIOCWLABEL. 1995-03-23 12:13:37 +00:00
mycroft
06d0a67a07 Check for read-only media in open(), not write(). 1995-03-23 12:11:07 +00:00
mycroft
d21add8356 Revert cdsize() to do nothing. 1995-03-23 11:51:22 +00:00
mycroft
4712cd33dc Rearrange DIOCWDINFO a little; closer to wd.c. 1995-03-23 11:43:09 +00:00
mycroft
562ca7760b Fix typo. 1995-03-23 11:37:51 +00:00
mycroft
02df08a47e Allow DIOCWDINFO even if label is not `writable'. 1995-03-23 11:33:18 +00:00
mycroft
e203e49ef5 Correct spelling of `fictitious'. Add patterns for optical memory devices.
From Alistair Crooks.
1995-03-07 21:46:06 +00:00
mycroft
7639253b70 Finish last change. 1995-01-30 11:50:23 +00:00
mycroft
321b00bd07 Some drives don't grok START with LoEj=1, either. 1995-01-30 11:47:56 +00:00
mycroft
0ece1143f6 Set the LoadEject bit when issuing a START. 1995-01-30 11:37:17 +00:00
mycroft
9085638020 Some devices really do require the START before the PREVENT. This makes no
sense.
1995-01-30 11:34:25 +00:00
mycroft
1611df6ae0 Update copyrights. 1995-01-26 12:05:49 +00:00
mycroft
b76a328caa Redo the `wait for spin up' code. The Mach 3 method clearly doesn't work.
Also, rearrange the first open sequences a bit; SDEV_OPEN is no longer magic.
1995-01-26 11:56:51 +00:00
mycroft
726fa4e94f Do the PREVENT before the START. 1995-01-23 18:17:22 +00:00
mycroft
e71e917e9d Remove unused macros. 1995-01-16 21:31:34 +00:00
mycroft
7650bd97fc Always boundary check I/O. 1995-01-13 10:46:32 +00:00
mycroft
8fd135209c Numerous changes. Many bugs fixed, better autoconfig, a few new features. 1994-12-28 19:42:47 +00:00
mycroft
3e7afdbe8a Remove DIOCSBAD handling. It's not actually handled, so why recognize it? 1994-12-16 04:38:30 +00:00
mycroft
ca65f2ce5d Remove dkbad.h. 1994-12-14 15:17:22 +00:00
mycroft
cc44b4600c There's no point in bothering to unlock what we didn't lock. 1994-11-23 07:54:15 +00:00
mycroft
95edd299b0 Add still more locking. 1994-11-22 03:23:49 +00:00
mycroft
fd32202948 Replace dev_unit with device_softc in scsi_link. Change argument to foostart()
to void*.
1994-11-21 10:39:09 +00:00
mycroft
5bd4115690 Add some missing locking, and some general cleanup. 1994-11-20 22:36:43 +00:00
cgd
6ac2bbfc35 be more careful with types, also pull in headers where necessary. 1994-10-30 21:43:03 +00:00
mycroft
e5d974c51f First cut at making user-level SCSI commands work. This is untested.
Partly from John Brezak.
1994-10-20 20:31:23 +00:00
mycroft
7d391c250d Fix minor omission. 1994-10-20 14:10:18 +00:00
mycroft
cd66683989 openpart -> openmask 1994-10-20 14:08:07 +00:00
mycroft
caaeda044b Similar changes to sd.c. 1994-10-20 14:03:38 +00:00
cgd
49c34d3337 move arch dependence to archs. clean up a bit. deal with weird MAXPARTITONS. 1994-10-14 18:26:22 +00:00
mycroft
da79c879cd On probe or open, retry the READ CAPACITY once if the drive reports NOT READY. 1994-08-11 23:51:26 +00:00
mycroft
558c00c001 Fix spelling of `STEREO'. 1994-08-05 22:56:19 +00:00
mycroft
b5c5c47f92 Obey the command queue size for the controller. 1994-08-04 09:52:47 +00:00
chopps
b10a5d5fac change to support other MAXPARTITIONS vals aside from 8 1994-07-04 20:39:46 +00:00
cgd
fccfa11af5 New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:39:25 +00:00
chopps
7d3285c3d4 resolve confusion over who owns the buf after calling scsi_scsi_cmd() 1994-06-16 15:57:39 +00:00
mycroft
a69dd750a2 b_un.b_addr -> b_data 1994-06-16 01:07:30 +00:00
mycroft
02ec14c597 Add dummy *dump() routines. 1994-05-11 09:49:17 +00:00
chopps
95faa87c60 remove union's from sense_data struct, conditionaly define RAW_PART 1994-05-09 07:40:47 +00:00
mycroft
58dfc9dffc Fix various types. Remove some outdated flags. 1994-04-11 03:53:58 +00:00
mycroft
8b10b2cd18 Combine scsi_start_unit() and scsi_stop_unit(), and increase the start
timeout (again).
1994-04-11 02:23:41 +00:00
mycroft
2e5a28159f New SCSI system, based on Julian's more recent work. 1994-03-29 04:29:20 +00:00
mycroft
adeebc448e Use b_actf, not av_forw. 1994-02-06 10:00:30 +00:00
mycroft
efdb9fa688 *strategy functions return void. 1994-01-11 17:19:37 +00:00
cgd
f59a5e6fcd fix from Nick Cuccia (cuccia@remarque.berkeley.edu), apparently
originating from Gary Grebus <glg@k8lt.ampr.org>: partition size
must be in units of DEV_BSIZE.
1993-12-23 09:35:51 +00:00
mycroft
b4d3382694 Canonicalize all #includes. 1993-12-17 07:56:32 +00:00
brezak
67dfce6728 Normalize play_msf changes with 386bsd patch. 1993-08-04 19:33:44 +00:00
brezak
80a965ba28 Add play_msf command and MSF variants. This is SCSI2 stuff and is needed for many flavors of player utilities. 1993-08-04 17:26:20 +00:00
mycroft
4862b84c92 Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
1993-08-01 19:22:24 +00:00
cgd
30c2a20262 patches from allen briggs to fix a minor bug in *attach() 1993-07-19 11:30:49 +00:00
andrew
1b69e917eb ANSIfications. 1993-06-27 06:59:20 +00:00
brezak
ebfdfc5b8a Silence size complaint at probe. 1993-06-17 12:18:29 +00:00
deraadt
1311db833c whoops. typo. 1993-06-16 04:31:37 +00:00
deraadt
a6d9adf224 fix to intuit the maximum number of scsi units available on a device
driver. this piece at least, should be safe from changing sizeof(dev_t)
1993-06-16 03:39:30 +00:00
deraadt
ee59868966 patch00149 by Julian Elischer <julian@jules.dialix.oz.au> & Rodney Grimes.
When an error was encountered, the sd/cd drivers printed blockno&ff0000
rather that blockno.
1993-05-25 07:27:31 +00:00
deraadt
e34f239662 First cut at cpu independent disklabels.
There will be niggly little details no doubt..
1993-05-20 22:48:23 +00:00
cgd
c59cd967ff add rcsids and clean up file headers 1993-05-20 03:46:09 +00:00
cgd
c2cbdf5d9e fix stupid line transposition (from John Brezak <brezak@osf.org>) 1993-05-11 08:07:50 +00:00
deraadt
a0bcb17e60 support for making dev->id_alive be set, this is for iostat to
find disk devices. wee bit of a kludge. sub-device attach()
routines must now return 1 for successful attach(), 0 otherwise.
Other bsd's do this too..
1993-05-04 08:27:29 +00:00
mycroft
c2f7555fda Display more meaningful message on SCSI `unit attention'. 1993-04-20 10:51:51 +00:00
deraadt
bee6f373e4 fixed various bugs like cdattach() returning garbage. 1993-04-12 12:10:28 +00:00
deraadt
2c98ef3b72 new scsi subsystem.
changes also in config/mkioconf.c
	i386/isa/wd.c, fd.c, and all scsi drivers.
1993-04-12 08:19:28 +00:00
glass
034707f9e5 fixed to be compliant, subservient, and to take advantage of the newly
hacked config(8)
1993-04-10 12:04:35 +00:00
cgd
e541169ce2 after 0.2.2 "stable" patches applied 1993-03-21 18:04:42 +00:00