Commit Graph

150 Commits

Author SHA1 Message Date
Marius Strobl
cde74953ae Don't try reading the SXP_PINS_DIFF on the 10160 and 12160 SCSI
controllers. Reading this register, for which there are indications
that it doesn't really exist, returns 0 on at least some 12160
and doing so on Sun Fire V880 causes a data access error exception.

Reported and tested by:	Beat Gaetzi
Approved by:		mjacob
Obtained from:		OpenBSD (modulo setting isp_lvdmode)
2008-12-15 21:42:38 +00:00
Matt Jacob
bb4f528dd8 Be more conservative- turn off fast posting and RIO for 22XX cards.
Approved by:	re (ken)
MFC after:	3 days
2007-07-10 07:55:04 +00:00
Matt Jacob
4607e8eed3 Recover from some major omissions/problems with the 24XX port.
First, we were never correctly checking for a 24XX Status Type 0
response- that cased us to fall through to evaluate status for
commands as if this were a 2100/2200/2300 Status Type 0 response.
This is *close*, but not quite the same. This has been reported
to be apparent with some wierd lun configuration problems with
some arrays. It became glaringly apparent on sparc64 where none
of the correct byte swap things were done.

Fixing this omission then caused a whole universe shifting debug
cycle of endian issues for the 2400. The manual for 24XX f/w turns
out to be wrong about the endianness of a couple of entities. The
lun and cdb fields for the type 7 request are *not* unconditionally
big endian- they happen to be opposite of whatever the endian of
the current machine type is. Same with the sense data for the
24XX type 0 response.

While we're at it investigate and resolve some NVRAM endian
issues.

Approved by:	re (ken)
MFC after:	3 days
2007-07-02 20:08:20 +00:00
Matt Jacob
530755ca2d If we're going to (for 23XX and 24XX cards) DMA firmware from the
request queues rather than shove it down a word at a time, we have
to remember to put it into little endian format. Use the macros
ISP_IOXPUT_{16,32} for this purpose. Otherwise, on sparc the firmware
is loaded garbled and we get a (not surprisingly) firmware checksum
failure and the card won't start and we don't attach it.

Approved by:	re (bruce)
MFC after:	3 days
2007-06-24 01:41:16 +00:00
Matt Jacob
0a70657fcc Make this an MP safe driver but also still be multi-release.
Seems to work on RELENG_4 through -current and also on sparc64
now. There may still be some issues with the auto attach/detach
code to sort out.

MFC after:	3 days
2007-05-05 20:17:23 +00:00
Matt Jacob
c6048aee5d some minor error message cleanups 2007-03-29 21:29:26 +00:00
Matt Jacob
5f634111fa MFP4: a) Some constification from NetBSD (gcc 4.1.2)
b) Split default param fetching/setting into scsi and fibre functions
and retry the fibre fetch more than once.

MFC after:	1 week
2007-03-22 23:38:32 +00:00
Matt Jacob
f6a6ae8f5c Don't call isp_intr from isp_start- this seems to, in rare cases,
cause confusion with at least the 23XX chipsets where the output
queue index pointer just gets a bit whacko.

MFC after:	1 day
2007-03-14 05:58:07 +00:00
Matt Jacob
9418a60cb0 Restore optr if you trash it for 24XX target mode.
MFC after:	3 days
2007-03-13 06:44:07 +00:00
Matt Jacob
70273f9064 Fix compilation issues found in RELENG_4 port and merge the
diffs back to -current to keep versions identical.
2007-03-12 04:54:30 +00:00
Matt Jacob
e48b2487a0 Fix some stupid copyright mistakes that have been there for quite some time. 2007-03-10 02:39:54 +00:00
Matt Jacob
af4394d40a Don't attempt to load illegal hard loop addresses into
an ICB. This shows up on card restarts, and usually for
2200-2300 cards. What happens is that we start up,
attempting to acquire a hard address. We end up instead
being an F-port topology, which reports out a loop id
of 0xff (or 0xffff for 2K Login f/w). Then, if we restart,
we end up telling the card to go off an acquire this loop
address, which the card then rejects. Bah.

Compilation fixes from Solaris port.
2007-02-23 21:59:21 +00:00
Matt Jacob
1b960c0b77 Be a bit more restrictive about printing out 'bad' pdb entries
during loop rescans. They're not bad so much as unstable, so
don't print this stuff out unless ISP_LOGSANCFG is set.
2007-02-23 05:39:58 +00:00
Matt Jacob
6c81a0aecb MFP4: Move default setting to the end of isp_reset instead of the
front of isp_init so we can read NVRAM even if we're role ISP_NONE.
Prepare for reintroduction of channels (for FC) for N-Port
Virtualization.

Fix a botch in handle assignment that caused us to nuke one device
when a new one arrives and end up with two devices with the same
identity in the virtual target mapping table.
2007-01-20 04:00:21 +00:00
Matt Jacob
450ca4603d Check the return from registering FC4 types with the fabric name
server.

Don't complain about a hard loop id of 0xffff- we get this in
point-to-point topologies with the 2300 and 2K Login firmware.

Up the timeout on register FC4 types commands.
2007-01-05 22:59:26 +00:00
Matt Jacob
a4f3a2bef4 Try an experiment with using DMA to load firmware into a 2200- VERIFY
CHECKSUM fails. Oh well, but keep a couple of the changes.

Avoid overflow in usec counters when waiting for mailbox completion.
2006-12-17 16:59:19 +00:00
Matt Jacob
3bda7a83b0 Implement ISP_RESET0 for PCI and SBUS attachments- isp_reset has
been modified to call ISP_RESET0 if it fails to do a reset. This
gives us a chance to disable interrupts.
2006-12-16 05:54:29 +00:00
Matt Jacob
dd9fc7c319 Make ISPCTL_PLOGX find a handle to log into the management server
with- not hope for the best. Change some things which were gated
off of 24XX to be gated off of 2K login support. Convert some
isp_prt calls to xpt_print calls.
2006-12-05 07:50:23 +00:00
Matt Jacob
04697f7aa3 Make the SAN login/logout stuff more common between different chipsets
and provied an isp_control entry point so that the outer layers can
do PLOGI/LOGO explicitly. Add MS IOCB support. This completes the cycle
for base support for SMI-S.
2006-11-18 03:53:16 +00:00
Matt Jacob
2cad1d9857 Increase the timeout for some SAN commands.
Only complain about FC Reponse errors if they're nonzero.

Shorten some PortID printouts for local loop.

Add an internal isp_xcmd_t data structure which we'll use for some
CT-Passthru support as part of adding SMI-S.
2006-11-16 00:39:56 +00:00
Matt Jacob
e49f99cd9f minor change to reduce some diff noise 2006-11-16 00:31:46 +00:00
Matt Jacob
f7c631bcf0 Push things closer to path failover by implementing loop down and
gone device timers and zombie state entries. There are tunables
that can be used to select a number of parameters.

loop_down_limit - how long to wait for loop to come back up before
declaring
all devices dead (default 300 seconds)

gone_device_time- how long to wait for a device that has appeared
to leave the loop or fabric to reappear (default 30 seconds)

Internal tunables include (which should be externalized):

quick_boot_time- how long to wait when booting for loop to come up

change_is_bad- whether or not to accept devices with the same
WWNN/WWPN that reappear at a different PortID as being the 'same'
device.

Keen students of some of the subtle issues here will ask how
one can keep devices from being re-accepted at all (the answer
is to set a gone_device_time to zero- that effectively would
be the same thing).
2006-11-14 08:45:48 +00:00
Matt Jacob
10365e5a68 Add 4Gb (24XX) support and lay the foundation for a lot of new stuff. 2006-11-02 03:21:32 +00:00
Matt Jacob
54256b0109 fix bug in 2322 receive sequencer f/w load 2006-09-01 04:18:17 +00:00
Matt Jacob
1e6fdb7e32 Fix 2KLOGIN code to specify *ibits* (not *obits*) so that the
options field in register 10 will be deterministic, not random.

Correct the number of input bits for EXECUTE_FIRMWARE 0..1 to
0..2- the 2322 and 24XX cards use mailbox register 2 to specify
whether the f/w being executed is freshly loaded or not.

Correct the number of input bits for {READ,WRITE}_RAM_WORD_EXTENDED
so that register 8 gets picked up.

Fix the indexing and offset for the 2322 f/w download so that it
correctly puts the different code segments where they belong.

Move VERIFY_CHECKSUM to be the 'else' clause to 2322 f/w downloads-
the EXECUTE_FIRMWARE command for 2322 and 24XX cards will tell you
if the f/w checksum is incorrect and VERIFY_CHECKSUM only works for
RISC SRAM address < 64K so you can only do a VERIFY_CHECKSUM on the
first of the 3 f/w segments for the 2322.

Shorten the delay for the continuation mailbox commands- 1ms is
ridiculous (100us is more likely).

All of the more or less is really only for the 2322/6322 cards.
2006-08-14 05:42:46 +00:00
Matt Jacob
92fcaeee9b Remove reference to PTI cards. They haven't been functioning
or around for probably at least 5 years.
2006-08-05 04:21:20 +00:00
Matt Jacob
4177525533 Initialize 2300 request/response pointers in isp_reset- not in
isp_fibre_init.
2006-08-04 20:14:52 +00:00
Matt Jacob
799881e094 Some rearrangement of headers to minimize diffs with outside of
FreeBSD repository and to clean up the license header so as to
not pollute the license with file function.

Zero all mailbox structures prior to use (just in case). Change
the outgoing mailbox count for INIT_FIRMWARE to be correct.
2006-07-16 20:11:50 +00:00
Matt Jacob
ddf6c7dadd Add some missing braces.
Add MEMORY_BARRIER for the few scratch dma ops that were missing
them plus add a couple of hi 32 bit dma ops (we could probably
allow 64 bit scratch and request/response queue dma now).
2006-07-14 05:14:48 +00:00
Matt Jacob
6cc12d1bb6 What the heck - make the last (most recent) 2200 f/w also do
Hard Loop acquisition.
2006-07-03 20:56:48 +00:00
Matt Jacob
8a97c03a7a Do various fixes to support firmware loading for the 2322
(and by extension, the 2422).

One peculiar thing I've found with the 2322 is that if you
don't force it to do Hard LoopID acquisition, the firmware
crashes. This took a while to figure out.

While we're at it, fix various bugs having to do with NVRAM
reading and option setting with respect to pieces of NVRAM.
2006-07-03 08:24:09 +00:00
Matt Jacob
8c4e89e249 Redo some code based upon issues found by Coverity. 2006-04-21 18:46:35 +00:00
Matt Jacob
9cd7268e5a Some more gratuitous format and name changes.
Pull in some target mode changes from a private branch.
Pull in some more RELENG_4 compilation changes.

A lot of lines changed, but not much content change yet.
2006-04-21 18:30:01 +00:00
Matt Jacob
1dae40eb49 a) clean up some declaration stuff (i.e., make more modern with respect
to getting rid u_int for uint and so on).

b) Turn back on 64 bit DAC support. Cheeze it a bit in that we have two
DMA callback functions- one when we have bus_addr_t > 4 bits in width and
the other which should be normal. Even Cheezier in that we turn off setting
up DMA maps to be BUS_SPACE_MAXADDR if we're in ISP_TARGET_MODE. More work
on this in a week or so.

c) Tested under amd64 and 1MB DFLTPHYS, sparc64, i386 (PAE, but insufficient
memory to really test > 4GB). LINT check under amd64.

MFC after:	1 month
2006-02-15 00:31:48 +00:00
Matt Jacob
b7918ba53a Make sure we don't pick up a loopid that's larger than our
current portdb max (MAX_FC_TARG == 256) now that we support
2K Login f/w.

MFC after:	3 days
2006-02-02 09:02:16 +00:00
Matt Jacob
e526523707 First of several commits as this driver is dusted off and maybe brought
up to date.  Principle changes for this reelase is to support 2K Port Login
firmware. This allows us to support the 2322 (and 2422 4Gb) cards which only
come with the 2K Port Login firmware. The 2322 should now work- but we don't
have firmware sets for it in ispfw (as the change to load 2K Port Login f/w
hasn't been made- that f/w is so big it has to be loaded in more than one
chunk).

Other changes are the beginnings of cleaning up some long standing target
mode issues. The next changes here will incorporate a lot of bug fixes
from others.

Finally, some copyright cleanup and attempts to make the parts of the
driver that are FreeBSD specific start conforming more to FreeBSD style.

MFC after:	1 month
2006-01-23 06:23:37 +00:00
Matt Jacob
8e62a8ac99 Add an ioctl framework for doing FC task management functions from
a user space tool- useful for doing FC target mode certification.
2005-10-29 02:46:59 +00:00
Matt Jacob
f2e4186204 Don't set ZIO for 23XX for target mode (use fast posting instead).
Use the correct number of handles for multihandle returns.

Very, very, rarely on some SMP systems we've seen an 'unstable' type
in the response queue. I dunno whether or not it's a bug in our
handling, or whether there's a cache incoherency issue, but
try to guard against it.

MFC after:	2 weeks
2005-01-23 06:26:45 +00:00
Warner Losh
098ca2bda9 Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
Nate Lawson
51e2355882 Store the target handles in a separate list from normal commands. Add a
CTIO fast post routine to handle CTIO completions.

Submitted by:	mjacob
2004-05-24 07:02:25 +00:00
Matt Jacob
cc330eadff Add case to handle ISPCTL_GET_PDB.
MFC after:	1 week
2004-02-07 03:42:17 +00:00
Matt Jacob
e23df011da If we have ISP_ROLE_INITIATOR set, make sure that we clear ICBOPT_INI_DISABLE
from the fwoptions. Likewise, we *set* ICBOPT_INI_DISABLE if we don't have
initiator role.
2004-01-23 23:23:31 +00:00
Matt Jacob
28f0575cf1 On reset, make sure that we have some parameters set correctly. This
fixes a longstanding issue WRT resetting the chip after startup- it
would fail if we were connected as an F-port to a switch. If we
were connected as an F-port, we got assigned a hard loop ID of 255,
which is really a bogus loop id. Then when we turned around to
reset ourselves, the firmware would reject the ICB_INIT request
because the loop id was bogus. *sputter*

Minor fixlet from somebody in NetBSD with too much time on their
hands (dma -> DMA).
2003-09-13 01:55:44 +00:00
Matt Jacob
65ff1249a0 Revert previous commit. Violates Maintainer (O'Brien knows how to
reach me directly), but more importantly, breaks compiles on
non-FreeBSD platforms.
2003-08-25 17:58:23 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Matt Jacob
d8f9e010d2 Restore parentheses removed inappropriately in last commit. 2003-06-01 19:01:01 +00:00
Poul-Henning Kamp
a0fb4cf18d Remove unused variables
Add /* FALLTHROUGH */

Found by:       FlexeLint
2003-05-31 19:49:49 +00:00
Matt Jacob
7369ae168f Pick up some compilation warning fixes from NetBSD.
If we don't have ISP_FW_CRASH_DUMP defined, we have to do
a isp_reinit in the core code- not the platform code- so
fix the ISP_CONN_FATAL case.
2003-02-16 01:32:52 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Jens Schweikhardt
d64ada501a Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00