Commit Graph

207 Commits

Author SHA1 Message Date
Matt Jacob
2759b3c7c4 Widen width of tag && initiator ids to u_int
(from u_int8_t) in ccb_accept_tio structure. This
matches usage elsewhere and also allows me to
overload the tag id with the RX_ID for fibre
channel target mode.
Reviewed by:	gibbs@freebsd.org
2000-01-03 08:54:51 +00:00
Matt Jacob
b6fd7c6188 Change error message make sense and add a missing
periph_release on a failed open so that the periph
dtor for it will get called when we deallocate the
instance from targioctl.
1999-12-30 02:32:13 +00:00
Matt Jacob
72c968cec7 Restore this driver to a working state. The control device has
to be created at init time. The unit devices are created at
ctor when new instances are created and bound and destroyed
when that instance is closed. As such, there is just s single
static control dev_t for this driver (the per-unit dev_t's are
still in the softc).

When we have decommissionable periph drivers, a destroy_device
on the control device will have to called.
1999-12-29 22:55:01 +00:00
Peter Wemm
c447342094 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 05:07:58 +00:00
Peter Wemm
664a31e496 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
Matt Jacob
b6a0d1ab0c Make sure we don't look at an edt entry that could go away when we try
and figure out whether to probe higher than logical unit 7.
Obtained from:gibbs@freebsd.org
1999-12-20 16:16:53 +00:00
David E. O'Brien
a5a299e5d7 Add FAST-80 timing to the scsi syncrates table.
Submitted by:	Gerard Roudier <groudier@club-internet.fr>
1999-12-16 16:04:54 +00:00
Matt Jacob
cda9006f07 minor comment update 1999-12-13 19:40:00 +00:00
Kenneth D. Merry
223b7a2363 Quirk all Pioneer changers as changers up front, instead of waiting for the
second LUN to show up.

mjacob's change (which is correct) in rev 1.21 of cam_periph.c to elminiate
infinite retries of the SCSI busy status bit seems to have broken probing
of Pioneer changers that aren't already quirked.

The right way to fix this is probably to change things around so we can
guarantee 100% sequential probing of LUN-based changers even if they aren't
quirked.  This should fix things for now, though.
1999-12-11 23:00:44 +00:00
Kenneth D. Merry
86b2c8466d Revamp the devstat priority system. All disks now have the same priority.
The same goes for CD drivers and tape drivers.  In systems with mixed IDE
and SCSI, devices in the same priority class will be sorted in attach
order.

Also, the 'CCD' priority is now the 'ARRAY' priority, and a number of
drivers have been modified to use that priority.

This includes the necessary changes to all drivers, except the ATA drivers.
Soren will modify those separately.

This does not include and does not require any change in the devstat
version number, since no known userland applications use the priority
enumerations.

Reviewed by:	msmith, sos, phk, jlemon, mjacob, bde
1999-12-08 04:45:23 +00:00
Kenneth D. Merry
aa11587317 Recognize the Pioneer CD-ROM DRM-6324X as a changer.
PR:		kern/15198
Submitted by:	Don Lewis <truckman@FreeBSD.org>
1999-12-07 04:14:56 +00:00
Matt Jacob
6af65c6902 Add back in a prefatory TUR when the tape is *not* mounted. This seems
to help with some older tape drives.
1999-12-04 01:13:59 +00:00
Matt Jacob
160f42cca4 Correct some botched timeout defines. Allocate only 8KB for the test read
in samount. Make things a lot quieter in samount (and other places). Fix
ridiculous and not so ridiculous bugs in compression related code in both
sagetparams and sasetparams.
1999-12-03 23:14:11 +00:00
Matt Jacob
ddc83e8523 Don't clear the SA_FLAG_TAPE_LOCKED prior to calling
saprevent when we're doing an OFFLINE ioctl- saprevent
won't unlock the door, which then causes the unload to
fail on some units.

If we've already unloaded the tape, don't try and rewind and
unload in saclose. This is a slightly riskier change because
we're now going to depend on SA_FLAG_TAPE_MOUNTED to say whether
we've really unloaded the tape. This involved changing the
setting in sadone for tape errors to SA_FLAG_TAPE_FROZEN (which
is more accurate anyway-if you get an EIO you've probably lost
tape position anyway) where it used to just clear the mounted
flag.
1999-11-21 20:23:58 +00:00
Matt Jacob
2728bfbd9e Add make_dev functions. Tested with only one changer (sigh- all my others
are broken).
Submitted by:	ken@freebsd.org
1999-11-21 19:17:47 +00:00
Matt Jacob
44198f294c Fix a couple of boo-boos in the last delta. 1999-11-17 17:11:21 +00:00
Matt Jacob
387c08f0e8 Fix for 11815 (at mount time do a throwaway read of the front of the
tape to force the drive to do a media access so it knows what media
may be inserted).

Also Ken's make_dev patches- relatively untested.
1999-11-17 06:05:09 +00:00
Kenneth D. Merry
273a1a3da7 Get rid of some trailing commas in enumerated types that cause gcc to
complain when some warnings are turned on.

Requested by:	Bertrand Petit <elrond@phoe.frmug.org>
1999-11-17 05:06:52 +00:00
Kenneth D. Merry
73d2691976 Convert the xpt, pass, pt and target drivers to use the new
make_dev()/destroy_dev() interface.
1999-11-17 04:59:09 +00:00
Kenneth D. Merry
10e1cf639d Fix Bus Device Resets from userland, and specifically from camcontrol.
camcontrol was setup to use the old scheme of going through the xpt(4)
device, which never worked properly (and has been disabled for a while).

camcontrol now sends BDRs through the pass(4) device, and XPT_RESET_DEV
CCBs are put on the device queue in the transport layer, as they should be.

Submitted by:	luoqi
Reviewed by:	ken
1999-10-31 02:39:44 +00:00
Poul-Henning Kamp
02c58685a4 Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for the
"rw" argument, rather than hijacking B_{READ|WRITE}.

Fix two bugs (physio & cam) resulting by the confusion caused by this.

Submitted by:   Tor.Egge@fast.no
Reviewed by:    alc, ken (partly)
1999-10-30 06:32:05 +00:00
Poul-Henning Kamp
923502ff91 useracc() the prequel:
Merge the contents (less some trivial bordering the silly comments)
of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>.  This puts
the #defines for the vm_inherit_t and vm_prot_t types next to their
typedefs.

This paves the road for the commit to follow shortly: change
useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE}
as argument.
1999-10-29 18:09:36 +00:00
Matt Jacob
66a9bb81f6 Mark path for deallocation only *after* you've successfully allocated it. 1999-10-27 21:49:36 +00:00
Matt Jacob
af51b059b5 Put an upper bound on the number of BUSY status retries we'll do (use the
retry count for the ccb). This is probably not quite the right thing, but it
is better than silently hanging on (possibly broken) h/w which is what we
do now.

Reviewed by:Justin/Ken: they weren't entirely happy about it but didn't say no.
1999-10-16 23:53:09 +00:00
Matt Jacob
0642b69a16 Protect xpt_run_dev_sendq in xpt_release_devq_device with splsoftcam. This
seems to handle the case of timeouts firing during probe but after a device
has gone away. It really does help.
Obtained from:gibbs@freebsd.org
1999-10-16 23:31:34 +00:00
Nick Hibma
3e2c6ca3b9 Removal of sys/device.h
- Move intrhook stuff into kernel.h
- Remove all occurrences of #device <device.h>
- Add kernel.h were necessary (nowhere)
- delete device.h

This file contained the structures for cfdata (old style config) and is no
longer used. It was included by most drivers.

It confuses the remote debugger as the definition of 'struct device' in
device.h is found before the one in bus_private.h.
1999-10-05 21:19:41 +00:00
Matt Jacob
f219e08f02 Another 1FM@EOD quirk (from mike@sentex.net for a Seagate STT20000),
and add a config option that allows one to default to 1FM@EOD for tapes
otherwise unquirked or unknown as to which to prefer. Note that tcopy
will be broken for these tapes until tcopy is fixed.
1999-10-02 20:17:16 +00:00
Poul-Henning Kamp
779b1b3d5b Introduce the disk mini-layer and devstat_end_transaction_buf() in cam/scsi.
Somewhat reviewed by:   ken
1999-10-01 09:34:10 +00:00
Matt Jacob
a8dafb4d99 Ooops- forgot to commit this.
PR:		14009
Submitted by:	jreynold@primenet.com
1999-09-28 05:14:52 +00:00
Poul-Henning Kamp
d6a0e38a1b Remove five now unused fields from struct cdevsw. They should never
have been there in the first place.  A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags
1999-09-25 18:24:47 +00:00
Poul-Henning Kamp
c4da3dcc64 Remove unneeded disk-related includes. 1999-09-12 08:23:21 +00:00
Poul-Henning Kamp
a35de5c8a7 Don't register a block major for tapes.
Reviewed by:	mjacob
1999-09-08 17:01:41 +00:00
Poul-Henning Kamp
10af1a2b5f We don't need to pass the diskname argument all over the diskslice/label
code, we can find the name from any convenient dev_t
1999-08-28 14:33:44 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Bruce Evans
1195ae1843 Cast pointers to uintptr_t instead of casting them to u_long. Don't
depend on gcc's feature of casting lvalues.  Cosmetic.
1999-08-24 00:04:45 +00:00
Poul-Henning Kamp
9dcbe2404a Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().
1999-08-23 20:59:21 +00:00
Bruce Evans
d918320517 Use devtoname() to print dev_t's instead of casting them to long or u_long
for misprinting in %lx format.
1999-08-23 20:35:21 +00:00
Mike Smith
fcb893a801 Implement a new generic mechanism for attaching handler functions to
events, in order to pave the way for removing a number of the ad-hoc
implementations currently in use.

Retire the at_shutdown family of functions and replace them with
new event handler lists.

Rework kern_shutdown.c to take greater advantage of the use of event
handlers.

Reviewed by:	green
1999-08-21 06:24:40 +00:00
Kenneth D. Merry
3ece1bd296 Fix short timeout problems with the pt(4) driver:
- increase the default timeout from 10 seconds to 60 seconds
- add a new kernel option, SCSI_PT_DEFAULT_TIMEOUT, that lets users specify
  the default timeout for the pt driver to use
- add two new ioctls, one to get the timeout for a given pt device, the
  other to set the timeout for a given pt device.  The idea is that
  userland applications using the device can set the timeout to suit their
  purposes.  The ioctls are defined in a new header file, sys/ptio.h

PR:		10266
Reviewed by:	gibbs, joerg
1999-08-20 03:48:11 +00:00
Bill Fumerola
b8e49f681b Welcome devtoname(), to most likely be used when printing information
about a dev_t.

printf("%x", dev) now becomes printf("%s", devtoname(dev)) because
printing actual information about the device is much more useful then
printing a pointer to an address that would never help the developer debug.

Submitted by:	phk, bde
1999-08-17 20:25:50 +00:00
Justin T. Gibbs
e414ac576f Bump CAM version number. 1999-08-16 23:18:24 +00:00
Justin T. Gibbs
0e5f60747c Checkpoint work on handling error conditions.
Handle errors reported through immediate notify ccbs.  This includes
bus resets, BDR messages, and abort messages.

Properly setup CA conditions for errors such as uncorectable parity
in data phases, reselection failure, and IDE message received.

Add a mechanism for stalling the queue of transactions to a particular
initiator while a CA is in progress.  Since we don't yet support
tagged I/O, this is largely just for show right now.

Properly bzero our softc at init time (oops).

Add more documentation on what all of the queues in our softc do.
1999-08-16 22:39:25 +00:00
Justin T. Gibbs
e5f5a0d8b1 xpt_release_devq now takes a count. 1999-08-16 22:23:01 +00:00
Justin T. Gibbs
2cefde5ff3 Implement the guts of the XPT_ABORT function code.
Clear residuals for XPT_TARGET_IO/XPT_CONT_TARGET_IO calls just
as we do for XPT_SCSI_IO calls.

Make xpt_release_devq a proper reciprocal of xpt_freeze_devq by
allowing the caller to decrement the count more than once per call.

Change the semantics of xpt_path_cmp to return 1 for a match
with a wildcard from path1 and 2 for a match with wildcards
from path2.  This change doesn't affect most callers as they
only check for >=0 (exact match or one containing a wildcard).

When cleaning up a device node, ensure that there are no timeouts
outstanding that reference it.
1999-08-16 22:22:41 +00:00
Justin T. Gibbs
b8b98bc375 Add another flag for debugging just peripheral drivers. The whole debugging
mechanism should be completely  revamped, but this will serve for the time
being.

Take advantage of some new behavior in xpt_path_comp which allows the
caller to determine which path, if any, had wildcards in it that allowed
for a match to succeed.  We can now use this to filter out wildcard
nodes in the EDT.

Make the amount of time we pause after writing a debug message
configurable.
1999-08-16 22:18:14 +00:00
Justin T. Gibbs
bf8bb7acc0 Add another command characteristic flag for commands that are queued
on physical devices as oposed to just in the XPT.  This is used to
mark XPT_SCSI_IO, XPT_RESET_DEV, XPT_ENG_EXEC, XPT_TARGET_IO, and
XPT_CONT_TARGET_IO function codes.

Change tag_id and init_id to be u_int from u_int8_t.  Some topologies
supported by CAM support much larger ID and tag ID address spaces
than parallel SCSI.

Kill some unused fields in the IMMED_NOTIFY ccb type.
1999-08-16 22:14:47 +00:00
Matt Jacob
48f6456d82 Put in a limit (8) for lun width- do not exceed probing this unless a device
is quirked for allowing it. This will allow SCSI cards to specify their true
correct lun width (32 for Qlogic SCSI, 16 or 65536 for Qlogic Fibre Channel)
without crippling the system because of f/w breakage of a lot of drives.
Reviewed by:	gibbs@freebsd.org
1999-08-16 17:47:39 +00:00
Justin T. Gibbs
f22adc7f6d Fix a long standing bug in the camq teardown code. 1999-08-16 02:23:42 +00:00
Matt Jacob
6ba823115e Move initialization of announce_buf up to make
sure it is initialized in all cases.
1999-08-15 23:34:40 +00:00
Poul-Henning Kamp
49ff4debd3 Spring cleaning around strategy and disklabels/slices:
Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout.
please see comment in sys/conf.h about the flag argument.

Remove strategy argument from all the diskslice/label/bad144
implementations, it should be found from the dev_t.

Remove bogus and unused strategy1 routines.

Remove open/close arguments from dssize().  Pick them up from dev_t.

Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
1999-08-14 11:40:51 +00:00