Commit Graph

43 Commits

Author SHA1 Message Date
Matthew Dillon b4e36adf1c Fix warnings preparing for -Wall -Wcast-qual
Also disable one usb module in LINT due to fatal compilation errors,
    temporary.
1999-01-27 20:09:21 +00:00
Matt Jacob 667d00a796 put it back the way it was 1999-01-20 23:00:31 +00:00
Matt Jacob 7781f5a621 temporary fix so alpha stays working while configure code is fixed 1999-01-20 19:08:45 +00:00
Kenneth D. Merry 6dd76100e4 By popular demand, back out the CONNER CFP* quirk entry, and return it to
its original form.  (Originally, it only applied to the CFP 2107.)

Hopefully we can come to some conclusion about which Conner drives are
broken for tagged queueing.
1999-01-20 01:13:20 +00:00
Kenneth D. Merry 1f04f5abd7 The Samsung WN34324U is broken for tagged queueing.
PR:		kern/9535
Submitted by:	NAKAJI Hiroyuki <nakaji@zeisei.dpri.kyoto-u.ac.jp>
1999-01-19 16:59:36 +00:00
Kenneth D. Merry 59190eaa10 Generalize the quirk entry for the Conner CFP* drives. It did just cover
the CFP2107, but it appears (not surprisingly) that the 1 gig and 4 gig
versions of that drive have the same problem with tagged queueing.

Also, fix the problem reported in PR kern/9482.  The XPT_DEV_MATCH case in
xptioctl() wasn't putting a proper path in the CCB before it called
xpt_action().  When CAMDEBUG is defined, and CAM_DEBUG_TRACE debugging is
turned on, the CAM_DEBUG statement at the beginning of xpt_action would end
up deferencing a NULL path pointer.  That of course caused a panic.

My solution is to just stick the xpt peripheral's path in the CCB.

PR:		kern/9482
Reviewed by:	gibbs
1999-01-19 01:02:47 +00:00
Peter Wemm 6d2a8f1ca0 Call the xpt_init() hook during at the start of the configure() process
via SYSINIT().  This gets a little closer to making cam useable as a
module.
1999-01-19 00:13:05 +00:00
Justin T. Gibbs c8bead2a12 Add support for wildcard device entries in the EDT. The target mode
'Black Hole' device uses this feature to schedule itself against any
target or lun attached to a controller that receives an unwanted request
from an initiator instead of having an instance per potential target/lun
request.

Use the wildcard entries to simplify wildcard async callback storage.

Don't announce devices twice to peripheral drivers.  The devices will
be announced as soon as the AC_PATH_REGISTERED event is registered by
the peripheral driver, so no manaul push of this event is required.

Reviewed by: Kenneth Merry <ken@FreeBSD.org>
1999-01-14 06:03:59 +00:00
Kenneth D. Merry 4cdd022168 The Quantum Atlas III evidently has an identical problem to the Atlas II.
It keeps returning queue full until we have reduced the number of tagged
openings to the minimum.

So, put in a quirk entry with the same work-around.  This quirk entry is
only for the 9G Atlas III, once someone comes up with inquiry information
for the 18G version of that drive, we can quirk it as well.

Submitted by:	"Johan Granlund" <johan@granlund.nu>
1999-01-07 01:11:24 +00:00
Kenneth D. Merry bfc0eb0f5a The Conner CFP2107 is a fixed-media drive, not removable media. This fixes
the quirk that disables tagged queueing for those drives.

Also, silence a warning by disabling xpt_for_all_targets() and
xpt_for_all_periphs().  These two functions are not currently used, but
they should not be removed.  They're part of a set of functions that
provide a way to execute a function for every {bus,target,device,periph} in
the system.

If anyone needs to use either function in the future, they can be
un-#ifdefed.
1999-01-05 21:37:07 +00:00
Matt Jacob 5d754af79f a more correct change that should meet the sniff test 1998-12-24 06:01:15 +00:00
Matt Jacob 93f8eaab7d Unstaticize swi_camnet && swi_cambio so Alpha kernels can build again. 1998-12-24 02:43:41 +00:00
Eivind Eklund 3c68dd1aec Staticize.
Reviewed by:	gibbs
1998-12-22 20:05:23 +00:00
Justin T. Gibbs bb6087e5bb Wire up the XPT_ABORT and XPT_RESET_DEV ccb function codes so they can
be delivered to controller drivers.

Adjust for changes to the ccb_hdr list types in cam_queue.h
1998-12-15 08:13:10 +00:00
Justin T. Gibbs 9819265820 Expand the hba_misc fied in the Path Inquiry ccb to allow a controller driver
to specify that it does not provide initiator services (PIM_NOINITIATOR)
and that the initial bus reset for device probing should be avoided
(PIM_NOBUSRESET).

Modify the XPT layer to honor these flags.
1998-12-10 04:05:49 +00:00
Matt Jacob aa872be6f3 use CAM_DEBUG_XPT to track XPT; correct a misspelling 1998-12-06 00:06:48 +00:00
Joerg Wunsch 36230d67d0 This old firmware of the TDC3620 hangs the SCSI bus upon serial
number requests.  Don't ask it so.
1998-11-25 13:50:10 +00:00
Kenneth D. Merry 25e5ca272b Generalize the quirk entry that disables multi-lun probing for Sony CDROM
drives.  It seems that quite a few (possibly all?) of their drives respond
to inquiries on multiple luns.  Hopefully we can detect problems like this
in the probe phase at some point.  For now, this is a pretty functional
solution.
1998-11-04 19:56:24 +00:00
Kenneth D. Merry ee9c90c75c Fix a problem with the way we handled device invalidation when attaching
to a device failed.

In theory, the same steps that happen when we get an AC_LOST_DEVICE async
notification should have been taken when a driver fails to attach.  In
practice, that wasn't the case.

This only affected the da, cd and ch drivers, but the fix affects all
peripheral drivers.

There were several possible problems:
 - In the da driver, we didn't remove the peripheral's softc from the da
   driver's linked list of softcs.  Once the peripheral and softc got
   removed, we'd get a kernel panic the next time the timeout routine
   called dasendorderedtag().
 - In the da, cd and possibly ch drivers, we didn't remove the
   peripheral's devstat structure from the devstat queue.  Once the
   peripheral and softc were removed, this could cause a panic if anyone
   tried to access device statistics.  (one component of the linked list
   wouldn't exist anymore)
 - In the cd driver, we didn't take the peripheral off the changer run
   queue if it was scheduled to run.  In practice, it's highly unlikely,
   and maybe impossible that the peripheral would have been on the
   changer run queue at that stage of the probe process.

The fix is:
 - Add a new peripheral callback function (the "oninvalidate" function)
   that is called the first time cam_periph_invalidate() is called for a
   peripheral.

 - Create new foooninvalidate() routines for each peripheral driver.  This
   routine is always called at splsoftcam(), and contains all the stuff
   that used to be in the AC_LOST_DEVICE case of the async callback
   handler.

 - Move the devstat cleanup call to the destructor/cleanup routines, since
   some of the drivers do I/O in their close routines.

 - Make sure that when we're flushing the buffer queue, we traverse it at
   splbio().

 - Add a check for the invalid flag in the pt driver's open routine.

Reviewed by:	gibbs
1998-10-22 22:16:56 +00:00
Kenneth D. Merry 50642f180c Fix several potential buffer overrun conditions. These changes have been
tested both in the kernel and in userland.  Also, fix a couple of printf
warnings that show up when CAMDEBUG is defined.

Reviewed by:		imp
Partially submitted by:	imp
1998-10-15 19:08:58 +00:00
Kenneth D. Merry 11021a1ab5 Clean up some unused variables.
Reviewed by:	ken
Submitted by:	phk
1998-10-15 17:46:26 +00:00
Kenneth D. Merry 1b6833dbb1 Narrow the quirk entry for the Seagate Elite 9 a bit to just cover drives
with 71* firmware revisions.  Scott Mace <smace@intt.ORG> reports that
drives with 00* firmware revisions do tagged queueing just fine.
1998-10-14 22:51:51 +00:00
Kenneth D. Merry 8597eafed0 Disable tagged queueing for the Seagate Elite 9GB drives. They tend to get
hung up when you send tags to them too quickly.  (CAM is able to recover
from the problem, but this just avoids it altogether.)

Reviewed by:	gibbs
Reported by:	Bret Ford <bford@uop.cs.uop.edu>
	and:	Martin Renters <martin@tdc.on.ca>
1998-10-14 21:17:39 +00:00
Kenneth D. Merry fce84cb42b Fix a bug in the scan lun code that showed up when we did the following
sequence of things:

- spin up a disk
  - send an async event to refresh the inquiry data
    - run through xpt_scan_lun() to re-probe the device
        - eventually finish the probe, but panic in xpt_done() because the
          periph pointer wasn't set.

Reviewed by:	gibbs
Reported by:	Philippe Regnauld <regnauld@deepo.prosa.dk>
1998-10-13 21:29:04 +00:00
Kenneth D. Merry 621a60d46b Add a "dummy light" (actually two dummy lights) to catch people who don't
have the passthrough device configured in their kernel.

This will hopefully reduce the number of people complaining that they can't
get {camcontrol, xmcd, tosha, cdrecord, etc.} to work.

Reviewed by:	gibbs
1998-10-12 21:54:13 +00:00
Justin T. Gibbs 2863f7b147 If the bus delay is >= 2 seconds, notify the user that we are waiting
for devices to settle.  This will hopefully allay any 'first installation'
fears that the machine has hung.
1998-10-10 21:10:36 +00:00
Justin T. Gibbs 2ba01e6ff4 Add a quirk entry for the CFP2107, another drive with broken
tagged queuing support.

Ensure that we report that a device supports tagged queuing even if
the system is waiting a "command count delay" before starting to use
them.

If a user disables disconnects on a device ensure that tagged queuing
is also turned off.  We did the right thing during initial configuration,
but could be confused by manual changes.
1998-10-07 03:25:21 +00:00
Kenneth D. Merry b1d26455e0 Disable multi-lun probing and serial number inquiries for the Exabyte 8200. 1998-10-06 19:27:19 +00:00
Kenneth D. Merry d05caa00c5 Add a new CAM debugging mode, CAM_DEBUG_CDB. This causes the kernel to
print out a one line description/dump of every SCSI CDB sent to a
particular debugging target or targets.

This is a good bit more useful than the other debugging modes, I think.

Change some things in LINT to note the availability of this new option.

Fix an erroneous argument to scsi_cdb_string() in scsi_all.c

Reviewed by:	gibbs
1998-10-02 21:00:58 +00:00
Justin T. Gibbs 03e3511b47 Correct problems with xpt_set_transfer_settings and async transfer
negotiation changes with wildcarded paths.
1998-09-25 22:35:56 +00:00
Justin T. Gibbs f0adc79010 Fix a few problems with the tag delay code:
- Tagged devices were limited to one transaction (oops)
 - We revert to untagged with a tag delay if the user changed the
   transfer negotiation values (via perhaps camcontrol some day).
 - xpt_async did not use the expanded path in some cases which could
   cause a panic.
1998-09-24 22:43:54 +00:00
Justin T. Gibbs fd21cc5ee0 Allow 5 untagged commands to go to a device before enabling tags after
enabling transfer negotiations, a BDR, or a bus reset to allow the controller
driver to negotiate without tagged messages getting in the way.  Some
devices are confused by attempts to negotiate and tag at the same time.
Some controllers (e.g. BT MultiMaster with certain firmware revs) will
never negotiate if you don't give them an untagged "window" to perform
negotiation in.

Bump the maximum tag count to 255.  The system reclaims unused tag space
as the tag count is dropped anyway, so we might as well try the max.

We should probably use a larger type than u_int8_t to hold our tag value
as SCSI over certain mediums allows for higher values.

Reviewed by:	 Kenneth Merry <ken@FreeBSD.org>
1998-09-23 03:03:19 +00:00
Kenneth D. Merry f24c39c7d5 Add several quirks:
Western Digital Enterprise drives have sorry performance (1.5MB/sec versus
8MB/sec) when doing tagged queueing.  Disable tagged queueing for them.

Submitted by:	Andrew Gallatin <gallatin@cs.duke.edu>

Some Sony CDROM drives don't like it when we probe more than one LUN.

Verified by:    Jean-Marc Zucconi <jmz@FreeBSD.ORG>

Some Sony CD-R's don't like multi-LUN probing either.

Submitted by:   Parag Patel <parag@cgt.com>
1998-09-22 20:41:12 +00:00
Justin T. Gibbs 53b062d3cc cam.c:
Clear up trailing NULs in cam_strvis.

cam_xpt.c:
	Nuke an experimental quirk entry for the Toshiba 3401.  The real
	problem with this device turned out to be a bug in the aic7xxx
	driver that was fixed months ago.

	Add a quirk entry to inhibit multiple lun scanning and serial number
	probing of DPT RAID volumes.  My DPT controller hangs up solid when
	I do either of these things to a RAID 1 volume.
1998-09-22 04:53:23 +00:00
Justin T. Gibbs e471e974cc cam_xpt.c:
Add quirk entry for a Samsung drive that doesn't like experiencing
	the queue full condition.

	Bump the timeouts for all probe activities to 60s.  We don't know
	what the seletion timeout (or equivelent on other mediums) is
	for controllers, which can make the transactions at the tail
	end of a parallel probe take a while to complete.  The DPT
	seems to be a card that takes a long time to see a selection timeout.

cam_periph.c:
	Don't call a device "gone" after a single selection timeout.  We
	need to come up with a better policy.  Until that time, you'll
	have to manually re-scan a bus via camcontrol for the system to
	decide that a device is really gone.  This should give devices
	experiencing temporary insanity to escape death.
1998-09-20 07:14:36 +00:00
Justin T. Gibbs ecdf111388 Only deregister out configuration hook manually if there are no SCSI
busses to configure.
1998-09-20 05:03:34 +00:00
Kenneth D. Merry 6747168dc9 Change the Atlas II quirk entries so they work with differential Atlas
II's.  Also, add a quirk entry for the 2 gig Atlas II.

Partially Submitted by:	Ted Buswell <tbuswell@mediaone.net>
1998-09-18 19:55:34 +00:00
Kenneth D. Merry a822eb2a8b Fix a formatting error.
Fix a problem reported by bde:  setting SCSI_DELAY to 0 doesn't work.  Now,
when the user sets SCSI_DELAY to 0, we re-set it to the minimum allowable
bus settle delay (100ms).

Fix a potential panic in xptfinishconfigfunc() if the CCB passed in is
NULL.  Reported by, I think, Nicolas Souchu.  Fix a memory leak in the same
function (we created a path, but didn't free it) by allocating the getdev
CCB and path on the stack.

Reviewed by:	gibbs
1998-09-17 23:58:53 +00:00
Kenneth D. Merry c5e6ca4410 Some Alpha patches for CAM from Doug Rabson.
Reviewed by:	gibbs
Submitted by:	dfr
1998-09-16 23:30:11 +00:00
Justin T. Gibbs 9bc66b835c Properly allocate our, per lun, probe peripheral softc from
the TEMP malloc pool.

Noticed by: Don Lewis <Don.Lewis@tsc.tdk.com>
1998-09-16 13:24:37 +00:00
Kenneth D. Merry 66a0780e8e Check to make sure that this device is opened read-write, not just read
only.  Previously, if the device was chmoded 644, someone could open it
with the O_RDONLY flag and issue any ioctl to the device.

Reviewed by:	imp, gibbs
1998-09-16 00:11:53 +00:00
Justin T. Gibbs 5ee58402df Correct printf format bugs. 1998-09-15 22:05:44 +00:00
Justin T. Gibbs 8b8a9b1d3e CAM Transport Layer (XPT).
Submitted by:	The CAM Team
1998-09-15 06:33:23 +00:00