Commit Graph

60 Commits

Author SHA1 Message Date
Joerg Wunsch
5eb14f7e7c Replace the annoying calls to Debugger() by panic()'s in the
#ifdef DIAGNOSTIC case, and a warning only otherwise.

People who want them to break into the debugger can always set the
breakpoint explicitly.  The existing behaviour was a misfeature from
the beginning, in the (wrong) assumption that the SCSI controller must
always be of essential importance to the entire system.
1996-07-20 22:02:44 +00:00
Gary Palmer
c23670e294 Clean up -Wunused warnings.
Reviewed by:		bde
1996-06-12 05:11:41 +00:00
Bruce Evans
3157adc8af Removed now-unused #includes of <machine/cpu.h>. They were for bootverbose
being declared in the wrong place.
1996-04-07 17:32:42 +00:00
Justin T. Gibbs
a9debe9ce1 Convert to use stdarg in aha_cmd. Use XS_SELTIMEOUT for selection timeouts.
Obtained from: stdarg fixes adapted from cgd's work on the NetBSD BT driver
1996-03-31 18:19:38 +00:00
Justin T. Gibbs
58a8ca6a4d Cleanse the SCSI subsystem of its internally defined types
u_int32, u_int16, u_int8, int32, int16, int8.
	Use the system defined *_t types instead.
1996-03-10 07:04:48 +00:00
Justin T. Gibbs
d026722aff Use the new adapter_softc field in the scsi_link structure so that
in the future, these drivers won't need to maintain an array of
configured units. They still need to because ISA interrupt handlers
take a unit number. :(

Pass "softc" pointers instead of unit numbers to many functions that
did a conversion of unit->softc anyway.
1996-01-07 19:22:39 +00:00
Peter Wemm
13b6889458 Add the attempted DMA address to the 'DMA beyond end of ISA' message so that
we can see if it's a small distance beyond the end, or way out. This may
give some clues as to whether it is being caused by something coalescing
the transfers in spite of the bounce buffers, or simply because of buffer
corruption.  (The BT driver seems to occasionally get hit by from this too,
except that it does not trap the transfer, and the system panics later
with vm_bounce_page_free.)  This "event" usually happens to me during a
savecore (on the rare occasion that a kernel coredump is actually taken
after a crash - the lack of kernel core dumps is another problem...).
1995-12-29 00:30:06 +00:00
Bruce Evans
44faa2919b Completed function declarations and added prototypes. Sorted prototypes. 1995-12-15 00:11:27 +00:00
David Greenman
efeaf95a41 Untangled the vm.h include file spaghetti. 1995-12-07 12:48:31 +00:00
Bruce Evans
0310c19f5d Replaced #includes of <sys/user.h> by less gross headers, usually
<sys/vm.h>.  Many device drivers need only the definition of vtophys()
from vm.

Added nearby #includes of <sys/conf.h> where appropriate.
1995-12-06 23:52:35 +00:00
Bruce Evans
4ff3de8e80 Added `#include "ioconf.h"' to <machine/conf.h> and cleaned up the
misplaced extern declarations (mostly prototypes of interrupt handlers)
that this exposed.  The prototypes should be moved back to the driver
sources when the functions are staticalized.

Added idempotency guards to <machine/conf.h>.  "ioconf.h" can't be
included when building LKMs so define a wart in bsd.kmod.mk to help
guard against including it.
1995-11-04 17:08:13 +00:00
Poul-Henning Kamp
4ccc87c594 Remove unused functions and variables, make things static, and other cleanups. 1995-10-28 15:39:31 +00:00
Peter Dufault
5dde8b2750 Support the 1542CP by recognizing the new ID. Try to make future
1542 revs work by assuming the next few sequential ID codes are
new Adaptec boards and enabling them after printing a warning.

Conditionalize the informational boot messages with "if (bootverbose)".
1995-10-01 15:09:51 +00:00
Bruce Evans
2e69f359d1 Fix benign type mismatches in isa interrupt handlers. Many returned int
instead of void.
1995-09-19 18:55:37 +00:00
Justin T. Gibbs
07b1c6b3c9 Remove hard coded assumption that SCSI busses have 7 targets.
This change forces the controller drivers to allocate a scsibus_data struct
via a call to scsi_alloc_bus(), fill in the adapter_link field, and optionally
modify any other fields of the struct.  Scsi_alloc_bus() initializes all fields
to the default, so the changes in most drivers are very minimal.  For drivers
that support Wide controllers, the maxtarg field will have to be updated to
allow probing of all targets (for an example, look at the aic7xxx driver).

Scsi_attachdevs() now takes a scsibus_data* as its argument instead of an
sc_link*.  This allows us to expand the role of the scsibus_data struct for
other bus level configuration setings (max number of transactions, current
transaction opennings, etc for better tagged queuing support).

Reviewed by: Rodney Grimes <rgrimes>, Peter Dufault <dufault>, Julian Elischer <julian>
1995-08-23 23:03:34 +00:00
Rodney W. Grimes
9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
Peter Dufault
bc0cfeb0ce Add scsi target support. 1995-04-14 15:13:46 +00:00
Garrett Wollman
6c0081e92b Add a class field to devconf and mst drivers.
For those where it was easy, drivers were also fixed to call
dev_attach() during probe rather than attach (in keeping with the
new design articulated in a mail message five months ago).  For
a few that were really easy, correct state tracking was added as well.
The `fd' driver was fixed to correctly fill in the description.
The CPU identify code was fixed to attach a `cpu' device.  The code
was also massively reordered to fill in cpu_model with somethingremotely
resembling what identifycpu() prints out.  A few bytes saved by using
%b to format the features list rather than lots of ifs.
1995-04-12 20:48:13 +00:00
Bruce Evans
3aa12267a5 Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) that I didn't notice when I fixed
"all" such warnings before.
1995-03-28 07:58:53 +00:00
Peter Dufault
8be820d189 Split byte packing functions into signed and unsigned versions.
Left most current invocations as signed, though that could be wrong.
1995-01-31 11:41:47 +00:00
Peter Dufault
8d38e0afd0 Print out exactly what we think the board is, and for the latest
rev Adaptec boards enable data transfer length detection instead
of assuming requested amount of data is transferred.
1995-01-19 12:33:10 +00:00
Peter Dufault
081964045f Added residual length for 1542C only 1995-01-08 13:41:28 +00:00
Garrett Wollman
2f86936a07 Finished device configuration database work for all ISA devices (except `ze')
and all SCSI devices (except that it's not done quite the way I want).  New
information added includes:

-	A text description of the device
-	A ``state''---unknown, unconfigured, idle, or busy
-	A generic parent device (with support in the m.i. code)
-	An interrupt mask type field (which will hopefully go away) so that
.	  ``doconfig'' can be written

This requires a new version of the `lsdev' program as well (next commit).
1994-10-23 21:28:03 +00:00
Garrett Wollman
f1d8109335 Add support for devconf to a large number of device drivers, and do
the right thing in dev_goawayall() when kdc_goaway is null.
1994-10-19 01:59:11 +00:00
Poul-Henning Kamp
702c623a8a Cosmetics. Silence gcc -Wall. Much more to do here :-( 1994-10-10 01:12:27 +00:00
David Greenman
868424648b Fixed up a couple of comments. 1994-09-21 18:17:56 +00:00
David Greenman
8a129caed5 1) Changed ddb into a option rather than a pseudo-device (use options DDB
in your kernel config now).
2) Added ps ddb function from 1.1.5. Cleaned it up a bit and moved into its
   own file.
3) Added \r handing in db_printf.
4) Added missing memory usage stats to statclock().
5) Added dummy function to pseudo_set so it will be emitted if there
   are no other pseudo declarations.
1994-08-27 16:14:39 +00:00
Paul Richards
d091793974 Ran ft.c through ident.
Added a missing #ifdef INET wrapper in lpt.c

Main change:
	Removed the timeout_func_t casts from timeout calls and
	correctly defined the timeout routines to conform to
	the new format.
lpt.c doesn't have this change.

Reviewed by:
Submitted by:
1994-08-23 07:52:29 +00:00
David Greenman
7b42c960f8 1) cleaned up after Garrett - fixed more redundant declarations, changed
use of timeout_t -> timeout_func_t in aha1542 and aha1742 drivers.
2) fix a bug in the portalfs that was uncovered by better prototyping -
   specifically, the time must be converted from timeval to timespec
   before storing in va_atime.
3) fixed/added some miscellaneous prototypes
1994-08-20 03:49:02 +00:00
Andreas Schulz
a41bb423b1 Reviewed by:
Corrected a little typo in a comment.
Throw out the typedef timeout_t with an ifdef __FreeBSD__, it is already
defined in sys/systm.h .
1994-08-19 21:02:05 +00:00
Poul-Henning Kamp
11a9e878f3 Added {} around two initializers for spare[2] in some structs. This calms
down -Wall a little bit.
1994-08-18 23:36:40 +00:00
Andreas Schulz
5e687d014e Reviewed by:
Added code to check for an adaptec 1542B Version 3.20 Board. This was the
first board that supports >1Gb drives and has the extended bios. So we
need also to disable the exbios like it is done for the 1542C/CF boards.
1994-08-14 21:06:00 +00:00
Garrett Wollman
f540b1065a Change all #includes to follow the current Berkeley style. Some of these
``changes'' are actually not changes at all, but CVS sometimes has trouble
telling the difference.

This also includes support for second-directory compiles.  This is not
quite complete yet, as `config' doesn't yet do the right thing.  You can
still make it work trivially, however, by doing the following:

rm /sys/compile
mkdir /usr/obj/sys/compile
ln -s M-. /sys/compile
cd /sys/i386/conf
config MYKERNEL
cd ../../compile/MYKERNEL
ln -s /sys @
rm machine
ln -s @/i386/include machine
make depend
make
1994-08-13 03:50:34 +00:00
Rodney W. Grimes
26f9a76710 The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.
Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman
1994-05-25 09:21:21 +00:00
Andreas Schulz
fbfd001f7e Added a missing unit argument in a printf. 1994-05-14 13:12:14 +00:00
Rodney W. Grimes
8568be7ca9 >From BETA_1_1 branch:
----------------------------
revision 1.20.2.2
date: 1994/05/03 05:16:50;  author: rgrimes;  state: Exp;  lines: +39 -16
Do a board reset if the AHA_INQUIRE command fails.  This is needed for the
DTC3290.  Change the messages about the BT545 to be generic to non adaptec
boards, since it appears that most vendors do not implement the AHA_INQUIRE
command in thier compatibility mode.
----------------------------
1994-05-03 05:44:53 +00:00
Garrett Wollman
d139b2ddba Tell the user that we didn't try to set the bus speed, in case they're
used to NetBSD or older versions of the code that did do it.
Will document TUNE_1542 also.
1994-04-21 22:14:43 +00:00
David Greenman
d5e26ef0ef Bounce buffers. From John Dyson with help from me. 1994-03-23 09:16:04 +00:00
Garrett Wollman
9131cc8d54 Delete some references to sleep() that somehow crept in. 1994-03-20 00:30:04 +00:00
Andreas Schulz
3b25168637 Added the missing bzero after the malloc in aha1542.c that seems to
produce the mbox not free messages on many systems. Bug reported from
hd@world.std.com.
1994-03-01 16:06:37 +00:00
Rodney W. Grimes
136cc9d5ef More sane AHA_RESET_TIMEOUT, from some testing by
Todd Pfaff <todd@flex.eng.mcmaster.ca> who was the person to report the
original problem on a 1542C.
1994-01-22 21:54:10 +00:00
Rodney W. Grimes
cdd2062aac >From: julian@TFS.COM (Julian Elischer)
Date: Mon, 17 Jan 94 20:52:14 PST

As reported on the -bugs list by some one, and confirmed by Julian:

> I increased AHA_RESET_TIMEOUT in aha1542.c from 1000 to 10000
> and now my 1542C is found everytime.
1994-01-22 07:46:25 +00:00
Andreas Schulz
253a42c5fc I have a new adaptec 1542CF board bought, that has the board id of 0x45.
Added it to the list of known boards and put it into the the list for
the mailbox unlock. Maybe all board-ids over 0x42 should be in the
mailbox unlock part ?
1994-01-09 18:11:21 +00:00
Garrett Wollman
aaf08d94ca Make everything compile with -Wtraditional. Make it easier to distribute
a binary link-kit.  Make all non-optional options (pagers, procfs) standard,
and update LINT to reflect new symtab requirements.

NB: -Wtraditional will henceforth be forgotten.  This editing pass was
primarily intended to detect any constructions where the old code might
have been relying on traditional C semantics or syntax.  These were all
fixed, and the result of fixing some of them means that -Wall is now a
realistic possibility within a few weeks.
1993-12-19 00:55:01 +00:00
Garrett Wollman
381fe1aaf4 Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, and
add same (sans -Werror) to Makefile for future compilations.
1993-11-25 01:38:01 +00:00
Rodney W. Grimes
57bb0ee45f New version of scsi code from Julian 1993-11-18 05:03:27 +00:00
Garrett Wollman
35089dd415 Fixed comments that start within a comment, so code compiles cleanly with
-Wcomment.
1993-11-17 23:25:28 +00:00
Rodney W. Grimes
ce0dbe6e66 Fix for 1542C support, it turns out that the 0x8 extended bios flag is only
set when extended translation is turned on, thus we need to do the mailbox
unlock command no matter what value is in the extended bios flag byte as
the other extensions (ie, > 2 drive support) cause the same problems.

The code has been changed to ALWAYS unlock the mailbox interface on ALL
1542C class boards.
1993-10-28 02:38:36 +00:00
Rodney W. Grimes
8b80a85bb0 Disable the aha_set_speed code since it breaks more than it fixes. 1993-10-16 12:27:20 +00:00
Rodney W. Grimes
37378adeb5 Add detection code for what model of AHA154X/Z we are running on,
then use that information to fix the enhancemode features of the
1542C/CF boards by turning them off.

When doing this I found that the Buslogic 545S does NOT properly
mimic the 1542 families AHA_INQUIRE command.  It only returns 1
byte of information, when the adaptec manual clearly states that 4
bytes are to be returned.  I added a printf that explains the error
when we see a 545S for now, I tried to come up with a better solution,
but it involved to much work for now.
1993-10-15 09:43:51 +00:00