Commit Graph

79460 Commits

Author SHA1 Message Date
Justin T. Gibbs
544c53b8be Updates for new non-packetized SCB-ID collision avoidance,
busy target table addressing changes, our qoufifo scheme,
and long lun support.

Drop bus reset hold delay to 25us.

Remove chip workarounds for revisions that never went to
production.

Add aic7901A identification information.

Remove untagged queue logic.
2002-08-31 06:48:42 +00:00
Justin T. Gibbs
3f293aaf2c Identify the AIC7901A as such instead of an AIC7902.
Push protocol violation handler to its own routine.  We now
properly detect and recovery from the following target induced
protocol violations:
	o Unexpected or invalid non-packetized Relesection
	o Command complete with no status message
	o Good Status after incomplete cdb transfer

Add an SCB collision avoidance algorithm that allows us to
use all 512 SCBs for non-packetized operations.  There is
still the possibility of running out of SCBs with non-colliding
tag identifiers, but the algorithm ensures that the stall will
be rare and short lived.

Convert to a read-only algorithm for validing entries in the
qoufifo.  The sequencer now toggles the high bit of the SCB
identifier on each wrap around of the qinfifo.  If the high
bit doesn't match the expected value for this pass of the
qoufifo, the entry is not valid.  This has the benefit of
working on machines that have large granularity cache write
back semantics without requiring any additional memory.

Remove lots of code related to untagged SCB queues.  Since
these controllers can keep a fully busy target table, we
will never have untagged SCB queues.

Lots of improvements to diagnostic logging.

Clarify some comments.

Don't clear BUSFREE interrupt enable in SIMODE1 in the SELTO
handler.  Just clearing the interrupt status is sufficient and
this avoids the chance of disabling busfree detection in connection
that occurs while we are handling the busfree interrupt.

Clear all possible interrupt sources when handling a busfree
interrupt.  The hardware clears some but not all of them.

Don't panic if we get into the default SCSIINT handler.
Dump the card state and clear all interrupt sources in the
hope that we can continue.

LASTPHASE != PREVPHASE.  Use the correct PREVPHASE for testing
against values in the PERRDIAG register.

According to SPI4, the bus free that is required after certain
PPR negotiations will only occur at the end of all message phases.
Handle the bus free if it occurs after a transaction in either
the message-in or message-out phases.  The busfree can also occur
if the status of IU_REQ changes due to a WDTR or SDTR message.
We now set the expect busfree flag in ahd_set_syncrate so that
it works regardless of message type.

Correct a problem with missing certain busfree events.  The
chip supports single-stepping even if a SCSIINT is pending.
This obviates the need to clear all of the SCSI interrupt enables
prior to single stepping.  Since ENBUSFREE can only be disabled
manually and not re-enabled, avoiding touching this bit in the
single-step case yields reliable bus free detection.

Enhance ahd_clear_intstat to clear all SCSIINT sources.

Only use ahd_update_pending_scbs() if we are active on the
bus.  We cannot modify the "MK_MESSAGE" bits on SCBs in the
execution queue if a selection might be in process since
the sequencer uses this bit to detect PPR negotiation to
a target with an outstanding IU_REQ agreement.

Allocate the SCB delivery mechansim's sentinal SCB specially
so we don't waste a valid SCB for this task.

Move tranceive state settle logic to ahd_chip_init() since
this needs to occur after every chip reset, not just the
chip reset that happens during primary driver initialization.

Correct a bug with transmitting lun information in packetized
connections.

Restrict busy target table operations to the range of luns
that can be used for non-packetized connections.  Larger luns
can only be accessed in packetized mode.

Correct a busy target table addressing bug.

Be more careful about how we shutdown the DMA engines during
bus reset events.

Only freeze the SIMQ once regardless of the number of bus
reset events that occur while we are polling for the resets
to stop.

Don't rely on the sequencer remaining paused() during our
reset poll.  It is safe for the sequencer to run during this
time, and many callers to the bus reset code would need to
be modified to make this assumption universally true.

Even if we are not going to clobber SCB state when an auto-request
sense SCB has a check condition, we must still unfreeze the queue.
Re-arrange the BAD STATUS handler to handle this case appropriately.

Modify the SCB download size depending on whether long luns are
being stored in the SCB.

Add ahd_print_register() for pretty printing register diagnostics.

Don't trust that the flexport logic to detect the presence of
a seeprom is available.  It may not be on some motherboard
implementations.

"the the" -> "the"
2002-08-31 06:48:14 +00:00
Justin T. Gibbs
d10a3e08c6 If interrupts are disabled on the card, don't bother running
our interrupt handler.  Our handler was called due to a shared
interrupt, and the card's interrupts are explicitly disabled
to prevent entry into our interrupt handler.
2002-08-31 06:46:37 +00:00
Justin T. Gibbs
6c746b27b7 Update Perforce Ids. 2002-08-31 06:45:28 +00:00
Justin T. Gibbs
274c41275c Move interrupt enable into the OSM.
Set the AHC_LSCBS_ENABLED softc flag appropriately.

Convert to using softc storage for our seeprom data.

Break seeprom parsing out into a separate routine.

Change our policy in regards to AHC_SPIOCAP so that we
will allow auto-termination to take place on some aic7855
based cards.

Remove initialized but never really used variables.
2002-08-31 06:44:56 +00:00
Justin T. Gibbs
4c4797e6b4 Cleanup endian macros.
Honor the AHC_REG_PRETTY_PRINT option.

Add lock placeholders for new locks used by the core.  These
are not currently needed for FreeBSD.
2002-08-31 06:44:20 +00:00
Justin T. Gibbs
226aa6ea7a Enable card interrupts from the OSM.
Use "offset == 0" not "period == 0" to denote async trasnfers.

Implement TARG_IMMEDIATE_SCB non-disconnected target mode
SCB delivery scheme.

In our timeout handler, don't rely on the phase already being
set to denote an active connection.  IDENTIFY_SEEN is more
than sufficient.

Verify that the softc passed in ahc_detach is still known
to the driver before blindly using it.
2002-08-31 06:43:55 +00:00
Justin T. Gibbs
62cdfa05f2 Add a prefix to be used for assembler generated tables and
functions for register pretty-printing.

Only clear SELDO once we've recorded enough information for
the host to understand that the connection is valid.  The
host uses the SELDO status as a handshake to close this
race window.

Correct a bug in target mode handling of non-disconnected
transactions.  The host would indicate the correct SCB to
DMA by setting the SCB id in the currently selected hardware
SCB.  Unfortunately, we would then immediated allocate a
hardware SCB which, depending on the access patern might not
be the same hardware SCB that the host setup for us.  Avoid
this by having the host put the SCBID into scratch ram.
2002-08-31 06:43:15 +00:00
Justin T. Gibbs
264fafe657 Convert to new assembler field syntax.
Document the SXFRCTL2 register found on U2 and U160 controllers.

Overload the MWI_RESIDUAL field for use as the SCB to be downloaded
for "immediate" (or those without the disconnect privledge)
transactions.

Add scratch ram locations for the 274X that give us a bit more
information including whether to enable extended translation.
2002-08-31 06:42:38 +00:00
Justin T. Gibbs
3b06611aa7 Drop the bus reset hold delay back down to 25us. The 250us
value slipped in from a debugging session.

Add AHC_LSCBS_ENABLED and AHC_SCB_CONFIG_USED ahc_flags which
allow for some code to move to the core.

Remove extern for ahc_syncrates[].  The OSMs no longer need
direct access to this array.

Add serial eeprom field to the ahc softc.

Prototype ahc_search_untagged_queues() and ahc_print_register().

Convert to AHC_SHOW_XXX debug option format.
2002-08-31 06:42:10 +00:00
Justin T. Gibbs
31b6c79691 Add ahc_print_devinfo() to simplify some diagnostic output.
Switch to using the same AHC_SHOW_XXX format as the ahd driver.

Always give the target a MSG_INITIATOR_DET_ERR for unexpected
DT or ST phase errors.

Add AHC_SHOW_SELTO diagnostics.

Force renegotiation whenever an unexpected bus free occurs
to rule out a negotiation mismatch as the cause for the error.

Use "offset != 0" as an intenal indicator of "async" rather than
using a period of 0.

In ahc_fetch_devinfo(), correct a bug in getting "our id" as
target.  We weren't looking at all the SEQ_FLAGS that indicate
that we are still in a selected rather than reselected state.

Add support for the AHC_SHOW_MESSAGES debugging option.

If ahc_parse_msg() tells us to terminate the message loop,
do so without acking the message.  The message may be one
that the sequencer needs to handle on its own.

In ahc_parse_msg() return MSGLOOP_TERMINATED for all messages
the sequencer handles.

Allocate storage for, and track, seeprom contents in our softc.

Touch all SCB bytes to avoid parity errors should one of our
debugging routines read an otherwise uninitiatlized byte.

S/G lists must be 8 byte aligned.  Reflect this in our DMA tag.

"the the" -> "the" in a comment

When pausing the card to perform error recovery, ensure that we
are not in the process of being selected or have just been selected
but have not yet handled that selection.  This leaves only one other
race window, in the command complete handler, that needs to be fixed
to make recovery 100% bullet proof.

Convert a few straglers from bsd u_intX_t to inttypes uintX_t.

Remove unused variables.

Split out searching of the untagged holding queues to its own
routine.  In certain recovery scenarios, we want to just
remove entries in the untagged queue without touching related
transactions that are in the QINFIFO or WAITING queues that are
searched by ahc_search_qinfifo().

Add an implementation of the ahc_print_register() routine which
"pretty prints" registers.  The extra bloat in the form of string
tables for this feature is controlled by the AHC_REG_PRETTY_PRINT
option.

Fix a few bugs in ahc_enable_lun() that could prevent controllers
lacking the multiple-target-id feature from changing "our id" on
the fly.  Add a large comment to this section while I'm here
describing the restrictions on "id switching".
2002-08-31 06:41:37 +00:00
Justin T. Gibbs
b73b70cca7 Pass unparsed serial eeprom information into the driver core.
Honor the extended translation setting for EISA cards now that
I've determined where this information is kept.

Defer card interrupt enabling to the OSM since it may have
some initialization to perform that must occur before interrupts
can be enabled.
2002-08-31 06:40:32 +00:00
Justin T. Gibbs
63183d8c4e Update assembler syntax and assembler to allow generation of register
description tables used for diagnostic "pretty printing".
2002-08-31 06:39:41 +00:00
Bruce Evans
efdfb8fea3 db_ps.c:
Don't attempt to follow null pointers for zombie processes in db_ps().

Style fix: use explicit an comparison with NULL for all null pointer
checks in db_ps() instead of for half of them.

db_interface.c:
Fixed ddb's handling of traps from with ddb on i386's only.

This was mostly fixed in rev.1.27 (by longjmp()'ing back to the top
level) but was completly broken in rev.1.48 (by not unwinding the new
state (mainly db_active) either before or after the longjmp().  This
mostly never worked for other arches, since rev.1.27 has not been ported
and lower level longjmp()'s only handle traps for memory accesses.  All
cases should be handled at a lower level to provided better control and
simplify unwinding of state.

Implementation details: don't pretend to maintain db_active in a nested
way -- ddb cannot be reentered in a nested way.  Use db_active instead
of the db_global_jmpbuf_valid flag and longjmp()'s return value for things
related to reentering ddb.  [re]entering is still not atomic enough.
2002-08-31 04:25:44 +00:00
Peter Wemm
31cdffc6d8 Take a shot at fixing up a whole stack of style and other embarresing
unforced errors that Bruce identified.  I have not yet addressed all of
his concerns.
2002-08-31 03:33:32 +00:00
John Baldwin
ea9b09fef2 Maxmem is a long, so update printf format so this compiles. 2002-08-31 03:21:59 +00:00
Peter Wemm
0b1482d1fd Do not use an object for the pte and pv zones on ia64 because it overrides
the pmap_allocf() function that we provide above.  We still use the limits
via other means.

Submitted by:	jeff
2002-08-31 03:11:20 +00:00
Justin T. Gibbs
621c0e6c92 Tell the user about a failed IRQ mapping rather than fail silently. 2002-08-31 03:04:08 +00:00
Giorgos Keramidas
e81b47f153 Typo in [^[:alnum:]] character class.
PR:		docs/41728
Submitted by:	osgene@web.de
2002-08-31 02:26:19 +00:00
Kris Kennaway
b5cdcc000b test -h is deprecated; use -L instead.
Submitted by:	april <april@oublinet.net>
PR:		misc/38724 (part of)
MFC after:	3 days
2002-08-31 02:22:33 +00:00
Andrey A. Chernov
c9887a654b Switch to new format which allows unlimited numbers of chains and
usually saves 2K in both data file and program memory.
Updated libc required.
2002-08-31 01:48:56 +00:00
Andrey A. Chernov
c14170612e Use ntohl() to read cnains number in new format 2002-08-31 01:05:39 +00:00
Scott Long
f1757c6ee7 Make ficl work on sparc64. The assumption that int == long == void * is
very pervasive in this code.  This fixes a few of those assumptions and
band-aids over some others.

Tested on: ia32 alpha sparc64

Reviewed by:	peter jake (in concept)
2002-08-31 01:04:53 +00:00
Jacques Vidrine
88268f8f47 Pass the pointy hat! Remove accidently imported files. 2002-08-30 21:53:25 +00:00
Jacques Vidrine
c825f43432 Remove some parts of the Heimdal distribution which we do not use
and have never used.
2002-08-30 21:37:10 +00:00
Greg Lehey
6c4028203e Add dates of foundation for Malaya, Malaysia and Singapore. 2002-08-30 21:36:16 +00:00
Jacques Vidrine
797fe7ebb1 Update build infrastructure after import of Heimdal Kerberos 2002/08/29. 2002-08-30 21:33:20 +00:00
Jacques Vidrine
bafe3deb75 Remove files no longer relevant after latest import. 2002-08-30 21:28:12 +00:00
Jacques Vidrine
7b173f654d Resolve conflicts after import of Heimdal Kerberos circa 2002/08/29. 2002-08-30 21:25:14 +00:00
Jacques Vidrine
714b4175a0 This commit was generated by cvs2svn to compensate for changes in r102644,
which included commits to RCS files with non-trunk default branches.
2002-08-30 21:23:27 +00:00
Jacques Vidrine
8373020d34 Import of Heimdal Kerberos from KTH repository circa 2002/08/29. 2002-08-30 21:23:27 +00:00
Robert Drehmel
2f4772b37f Add the 'restrict' type qualifier to the function prototype
of the swab(3) function in its manual page to match the
standardization by POSIX.1-2001.
2002-08-30 21:18:39 +00:00
Robert Drehmel
9abf5797a0 - Update the manual page of bcmp(3) by replacing
.In string.h
   with
     .In strings.h
   and adding a sentence to the HISTORY section.
 - Use an ANSI-C function definition.
 - Include <strings.h> instead of <string.h>.
 - Apply style(9): Put a space after return keywords.
2002-08-30 21:07:40 +00:00
Andrey A. Chernov
cbc98d0541 Style fix 2002-08-30 20:39:53 +00:00
Andrey A. Chernov
3ce74edd70 Prepare for switching to unlimited chains format 2002-08-30 20:34:36 +00:00
Robert Drehmel
c9ab23eea5 - Convert the function definition to declare its arguments
in the ANSI-C format.
 - Change the code a bit to hopefully save some cycles.
   I.e. (simplified) change

     a = b + 1;
     while (--b & 0x7)
	/* ... */
   to
     a = b;
     for (; b & 0x7; b--)
	/* ... */
   and
     while (--a >= 0)
	/* ... */
   to
     for (; a > 0; a--)
	/* ... */
 - Equip two function arguments of swab() with the 'restrict'
   type qualifier in form of the '__restrict' macro.  This is
   specified by POSIX.1-2001.
2002-08-30 20:33:05 +00:00
Andrey A. Chernov
8e52da4dfc Prepare for switching to unlimited chains format.
Optimize chains lookup a bit.
2002-08-30 20:26:02 +00:00
Robert Drehmel
425289a9db - Update the manual pages of index() and rindex() to show
<strings.h> as the associated header file.
   The prototypes have been moved there from <string.h> because
   POSIX.1-2001 said so.
 - Conditionally include either <strings.h> or <string.h> based
   on whether the [r]index() or str[r]chr() functions are
   compiled, respectively.
 - Style(9) tells us to
    - put a space after the return keyword
    - to check for a NUL character without using the ! operator.
    - use NULL instead of (type *)NULL where the compiler knows
      the type.
   Apply these rules.
 - Rather use ANSI-C function definitions than K&R ones.
 - For index(3), correct second function argument's type; it was
   declared to be a `const char' before and is now an `int'.
2002-08-30 19:42:07 +00:00
Robert Drehmel
554331bbb9 - Update the manual page to show that the associated header file
is <strings.h> and not <string.h> anymore.
 - Tell the reader about this change in the HISTORY section.
 - Switch to use an ANSI-C function definition.
 - Include <strings.h> instead of <string.h> in the source file.
2002-08-30 19:08:53 +00:00
Justin T. Gibbs
e211c13e86 Add IDs for upcoming LSI U320 products that use the MegaRAID interface.
Adjust format of one comment so it doesn't wrap at 80 columns.
Submitted by:	"Moore, Eric Dean" <emoore@lsil.com>
2002-08-30 18:28:00 +00:00
Matthew Dillon
cac4515267 Implement data, text, and vmem limit checking in the elf loader and svr4
compat code.  Clean up accounting for multiple segments.  Part 1/2.

Submitted by:	Andrey Alekseyev <uitm@zenon.net> (with some modifications)
MFC after:	3 days
2002-08-30 18:09:46 +00:00
Justin T. Gibbs
817bd00cec Reserve majors 171 and 172 for the "mide" (LSI MegaRAID IDE control device)
and "mided" (LSI MegaRAID IDE disk device).

Submitted by:	"Moore, Eric Dean" <emoore@lsil.com>
2002-08-30 16:54:02 +00:00
Robert Drehmel
c271a3613c - Update strcasecmp(3)/strncasecmp(3) to reflect the fact that
the prototypes for both functions are now in the <strings.h>
   header, as required by IEEE Std 1003.1-2001.
 - Add one sentence about that in the HISTORY section.
 - Include <strings.h> in the source file to have the prototypes
   in scope when the _ANSI_SOURCE macro is defined.
2002-08-30 15:40:01 +00:00
John Baldwin
401e7fff61 Revert previous untested revision. The i386 loader consists of three parts:
At the front is btxldr, in the middle is BTX itself (our mini-kernel), and
then the 'client' (loader.bin) which is the actual loader itself.  boot2
just executes a raw ELF or a.out binary with the only setup provided being
that a bootinfo structure is passed on the stack.  Now, since loader.bin
is a BTX client, the loader needs to be able to locate a BTX kernel for
the client to execute in the context.  Thus, just like pxelder, btxldr
uses the a.out header on the loader binary to find the BTX kernel stored
in the loader and set it up.  It does _not_ just reuse the BTX kernel
that boot2 invoked it with.  This is because it can't assume that it will
_have_ a "spare" BTX kernel lying around.  For example, when cdboot
loads the loader there isn't an existing BTX kernel.  In fact, cdboot
will only work with an a.out loader as well since it also "borrows" the
BTX kernel in the loader binary (which it finds by parsing the a.out
header) just as pxeldr does.  The only difference between cdboot and
pxeldr is where they get /boot/loader from.

If we wanted to make /boot/loader be an actual ELF binary we would need
to change the following utilites to handle that (and they all have to be
able to handle locating the BTX kernel inside of an ELF binary somehow):
- btxldr
- pxeldr
- cdboot

If we didn't want to require a flag day but make the transition smooth
then we need to be able to support both a.out and ELF versions of
/boot/loader which isn't exactly trivial since all three of these utilities
are written in assembly.

Pointy-hat to:	peter
2002-08-30 14:59:47 +00:00
Maxim Sobolev
d8afaeb24b Whitespace-only: don't mix tabs and spaces for doing identation. 2002-08-30 14:21:01 +00:00
Maxim Sobolev
25faf49d12 Fix a silly typo in user-setable promisc mode code.
Pointed out by:	Yann Berthier <yb@sainte-barbe.org>
MFC after:	1 day
2002-08-30 13:37:13 +00:00
Hellmuth Michaelis
949f39b532 establish default values for /etc/rc.d/pcvt script 2002-08-30 13:01:42 +00:00
Hellmuth Michaelis
2455cd9ea2 document options for integrating pcvt configuration into the new /etc/rc.d
startup system.
2002-08-30 12:44:44 +00:00
Hellmuth Michaelis
6b6c162a88 integrate pcvt configuration into the new /etc/rc.d startup system
PR:           i386/7100
Reviewed by:  Gordon Tetlow <gordon@FreeBSD.org>
2002-08-30 12:43:23 +00:00
Mitsuru IWASAKI
6c40705212 s/hint.acpi.0.disable/hint.acpi.0.disabled/
Fix device hints entry for disabling acpi(4).
This also should fix the arbitration with apm(4) when both drivers
are enabled.

Note that your /boot/device.hints needs to be updated if you want to
stop auto-loading acpi.ko or disable acpi(4).
2002-08-30 11:11:07 +00:00