Commit Graph

33 Commits

Author SHA1 Message Date
Peter Wemm
579f45fa60 Simplify the COMPAT_PCI_DRIVER/DATA_SET hack. We can add:
#define COMPAT_PCI_DRIVER(name,data) DATA_SET(pcidevice_set,data)
.. to 2.2.x and 3.x if people think it's worth it.  Driver writers can do
this if it's not defined.  (The reason for this is that I'm trying to
progressively eliminate use of linker_sets where it hurts modularity and
runtime load capability, and these DATA_SET's keep getting in the way.)
1999-05-09 17:07:30 +00:00
Doug Rabson
566643e39e Move the declaration of the interrupt type from the driver structure
to the BUS_SETUP_INTR call.
1999-05-08 21:59:43 +00:00
Peter Wemm
ac0c5aaf01 Use haveseen_ioport() which is now connected up to the resource manager. 1999-05-08 18:20:57 +00:00
Kenneth D. Merry
9deea8574e Add a number of interrelated CAM feature enhancements and bug fixes.
NOTE:  These changes will require recompilation of any userland
applications, like cdrecord, xmcd, etc., that use the CAM passthrough
interface.  A make world is recommended.

camcontrol.[c8]:
 - We now support two new commands, "tags" and "negotiate".

	- The tags commands allows users to view the number of tagged
	  openings for a device as well as a number of other related
	  parameters, and it allows users to set tagged openings for
	  a device.

	- The negotiate command allows users to enable and disable
	  disconnection and tagged queueing, set sync rates, offsets
	  and bus width.  Note that not all of those features are
	  available for all controllers.  Only the adv, ahc, and ncr
	  drivers fully support all of the features at this point.
	  Some cards do not allow the setting of sync rates, offsets and
	  the like, and some of the drivers don't have any facilities to
	  do so.  Some drivers, like the adw driver, only support enabling
	  or disabling sync negotiation, but do not support setting sync
	  rates.

 - new description in the camcontrol man page of how to format a disk
 - cleanup of the camcontrol inquiry command
 - add support in the 'devlist' command for skipping unconfigured devices if
   -v was not specified on the command line.
 - make use of the new base_transfer_speed in the path inquiry CCB.
 - fix CCB bzero cases

cam_xpt.c, cam_sim.[ch], cam_ccb.h:

 - new flags on many CCB function codes to designate whether they're
   non-immediate, use a user-supplied CCB, and can only be passed from
   userland programs via the xpt device.  Use these flags in the transport
   layer and pass driver to categorize CCBs.

 - new flag in the transport layer device matching code for device nodes
   that indicates whether a device is unconfigured

 - bump the CAM version from 0x10 to 0x11

 - Change the CAM ioctls to use the version as their group code, so we can
   force users to recompile code even when the CCB size doesn't change.

 - add + fill in a new value in the path inquiry CCB, base_transfer_speed.
   Remove a corresponding field from the cam_sim structure, and add code to
   every SIM to set this field to the proper value.

 - Fix the set transfer settings code in the transport layer.

scsi_cd.c:

 - make some variables volatile instead of just casting them in various
   places
 - fix a race condition in the changer code
 - attach unless we get a "logical unit not supported" error.  This should
   fix all of the cases where people have devices that return weird errors
   when they don't have media in the drive.

scsi_da.c:

 - attach unless we get a "logical unit not supported" error

scsi_pass.c:

 - for immediate CCBs, just malloc a CCB to send the user request in.  This
   gets rid of the 'held' count problem in camcontrol tags.

scsi_pass.h:

 - change the CAM ioctls to use the CAM version as their group code.

adv driver:

 - Allow changing the sync rate and offset separately.

adw driver

 - Allow changing the sync rate and offset separately.

aha driver:

 - Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs.

ahc driver:

 - Allow setting offset and sync rate separately

bt driver:

 - Don't return CAM_REQ_CMP for SET_TRAN_SETTINGS CCBs.

NCR driver:

 - Fix the ultra/ultra 2 negotiation bug
 - allow setting both the sync rate and offset separately

Other HBA drivers:
 - Put code in to set the base_transfer_speed field for
   XPT_GET_TRAN_SETTINGS CCBs.

Reviewed by:	gibbs, mjacob (isp), imp (aha)
1999-05-06 20:16:39 +00:00
Peter Wemm
96b3554e5c Use COMPAT_PCI_DRIVER() for registration if it exists. This shouldn't
hurt the driver portability to 3.x too much for where drivers are shared.
1999-04-24 20:17:05 +00:00
Justin T. Gibbs
74ed7047aa staticize. 1999-04-23 23:29:23 +00:00
Justin T. Gibbs
b5aedf623a Kill a compiler warning. 1999-04-23 23:26:10 +00:00
Justin T. Gibbs
d72b216c5b Handle the case when auto sense retrieval fails.
Give automatic request sense operations a 5 second timeout.
1999-04-19 21:27:36 +00:00
Peter Wemm
a49a3d4433 Implement an EISA new-bus framework. The old driver probe mechanism
had a quirk that made a shim rather hard to implement properly and it was
just easier to convert the drivers in one go.  The changes to the
buslogic driver go beyond just this - the whole driver was new-bus'ed
including pci and isa.  I have only tested the EISA part of this so far.

Submitted by:	 Doug Rabson <dfr@nlsystems.com>
1999-04-18 15:50:35 +00:00
Eivind Eklund
c6d0e3f0c1 Staticize. 1999-04-11 03:06:07 +00:00
Eivind Eklund
505ab9b86b Staticize. 1999-04-11 02:55:52 +00:00
Justin T. Gibbs
fcbe355ab9 Beef up the error handling routine to handle more errors.
Compensate for a bug in the AdvanSys firmware where a valid queue
full condition can be reported via a different error code.
1999-04-07 22:59:12 +00:00
Bruce Evans
2a32c15f45 Unspammed includes in <machine/cpufunc.h> in the !SMP case. Partially
unspammed them in the SMP case.
1999-01-08 19:17:49 +00:00
Justin T. Gibbs
b2608b2c73 Staticize the overrun buffer so that they are not shared between
cards of different bus types as each bus type may have a different
bus mapping.

Submitted by:	Eivind Eklund <eivind@yes.no>
1998-12-22 18:14:15 +00:00
Justin T. Gibbs
a466025179 Return NULL on resource shortage instead of blindly continuing.
Obtained from: Eivind Eklund <eivind@yes.no>
1998-12-22 18:12:09 +00:00
Matthew Dillon
2cbe36f725 probe function changed from returning char * to const char *. 1998-12-14 06:37:37 +00:00
Archie Cobbs
f1d19042b0 The "easy" fixes for compiling the kernel -Wunused: remove unreferenced static
and local variables, goto labels, and functions declared but not defined.
1998-12-07 21:58:50 +00:00
Archie Cobbs
2127f26023 Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
for possible buffer overflow problems. Replaced most sprintf()'s
with snprintf(); for others cases, added terminating NUL bytes where
appropriate, replaced constants like "16" with sizeof(), etc.

These changes include several bug fixes, but most changes are for
maintainability's sake. Any instance where it wasn't "immediately
obvious" that a buffer overflow could not occur was made safer.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
Reviewed by:	Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by:	Mike Spengler <mks@networkcs.com>
1998-12-04 22:54:57 +00:00
Justin T. Gibbs
3c1cabf7a2 Fix probes when a port address is specified. 1998-11-10 06:44:54 +00:00
Justin T. Gibbs
b4be89561b Correct the reporting of the queue full condition so that the XPT layer
can properly throttle tags.

Add diagnostic printfs for firmware result codes that we encounter but
don't know anything about.
1998-10-29 17:41:34 +00:00
Justin T. Gibbs
b9450b7b2f -Wunused cleanup.
Fixed bug in advansys.c where we did not properly clean up ccb_info data
structures in softc teardown.

Submitted by:	Poul-Henning Kamp <phk@freebsd.org>
1998-10-15 23:47:14 +00:00
Warner Losh
bb415a7e88 Fix breakage introduced by last patch. bde has added CC_QUIET flag to
hasseen_isadev so this will be less noisy when conflicts do exist.
Also eliminate redundant warnings about conflicts.

Requested by: bde
Reviewed by: gibbs
1998-10-12 18:53:33 +00:00
Warner Losh
19bed41a5d Fix conficts in probe:
o For bt and aha only probe the one I/O range if a specific I/O is specified
  in the config file.
o Don't even try to probe I/O ranges that have been seen already.
o If we conflict with an IRQ or DRQ, then fail the probe.

Requested by: bde, gibbs
Approved by: jkh
1998-10-10 00:44:12 +00:00
Justin T. Gibbs
f8c5944d43 Only pull 16 bits of residual information from completing queues. This
is a work-around from an LRAM access bug on the 940UA.  In a future
microcode revision, the high 16bits of residual information will be moved
to a safe location and we'll return to 32bit residuals.  Since we only
allow 64KB I/O, 16bits is enough.
1998-10-09 21:40:50 +00:00
Justin T. Gibbs
217a0a47e4 Don't set the active flag on a transaction resource until it has been
queued.

Perform dma segment setup outside of splcam protection as this can take
some time and the protection is not necessary.

Inline a function.

Clean up some whitespace.
1998-10-07 03:32:57 +00:00
Justin T. Gibbs
85186e4602 Add support for the ASC3550 AdvanSys SCSI Host Controller (aka 940UW). 1998-10-07 03:20:52 +00:00
Justin T. Gibbs
c279502fc6 Correct compilation with option DIAGNOSTIC set.
Upgrade to the latest firmware.
1998-09-20 05:04:05 +00:00
Justin T. Gibbs
07c20e11f7 EISA bus attachment for the AdvanSys driver. 1998-09-15 07:05:39 +00:00
Justin T. Gibbs
a5a2d1bfe9 Advance Systems SCSI Host Adapter driver for CAM. Currently only support
the 8bit SCSI AdvanSys products.
1998-09-15 07:03:43 +00:00
Peter Wemm
6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Justin T. Gibbs
ac323a042d A little 80 column cleanup. 1996-11-05 08:49:17 +00:00
Justin T. Gibbs
0a42ab8379 Advanced Systems Inc. SCSI Controller driver and ISA/VL front end.
I have only tested the ABP5140 card and only with a single CDROM drive
but it seems to work fine.  This driver relies on features found only in
the SCSI branch so will not work in -current until those changes
are brought in.  It also doesn't have any error handling code *yet*.
The goal is to use this driver as the development platform for the new
generic SCSI layer error recovery/handling code.

PCI and EISA front ends will show up as soon as I get my hands on
the cards.  There are also a few issues in the driver that I need
to clear up with AdvanSys before I can suggest sticking one of
these cards in your server. 8-)

Thanks to AdvanSys for releasing this code under a suitable copyright.

Obtained from:  Ported from the Linux driver writen by
		bobf@advansys.com (Bob Frey).
1996-10-07 02:07:07 +00:00