Commit Graph

581 Commits

Author SHA1 Message Date
mjacob
9fc60c2d65 Restore revision 1.126 that got accidentally nuked. 2006-12-18 23:53:39 +00:00
mjacob
cfa4643f51 Add back some CAM_NEW_TRAN code to make backporting to RELENG_6 easier. 2006-12-18 23:50:30 +00:00
mjacob
5e73797115 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
mjacob
fd764f0424 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
mjacob
b2f314b812 Remove dependency on ispfw and firmware as modules.
Either they're there early and the ispfw sets have
registered themselves, or they're not.

The module dependency stuff isn't quite what we want
anyway. If the user doesn't want the load placed on
system memory by loading the firmware, they don't
specify it to be loaded (either by being linked in
or via being a module to be loaded and then hooked
in with firmware(9)). It doesn't then make sense to
then override what they want by pulling it in anyway.

This might be able to work if we were able to pull in
just exactly what we needed for the card we have- but
that's an optimization left for the future.
2006-12-10 03:41:48 +00:00
mjacob
7d4ff41e1b clarify a comment slightly 2006-12-09 01:33:55 +00:00
mjacob
d2d2e316d0 Find another spot where tagged command queueing got
accidentally nuked.
2006-12-09 01:30:05 +00:00
mjacob
644694d746 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
mjacob
126f5f8f47 Add a chip timeout to ENABLE/MODIFY/DISABLE lun calls.
MFC after:	1 month
2006-12-05 07:49:15 +00:00
mjacob
705d606604 Fix XPT_GET_TRANSPORT_SETTINGS to zero validity and flags-
this was causing us to not negotiate sync at all, or at
random.
2006-12-03 07:22:15 +00:00
mjacob
5af654c586 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
mjacob
18a68319cf Disable code to set max read byte count on the 2400.
It caused a panic in writing the config register on a system. Turn
it off until we take the time to understand it.

Reported by and Testing by: Anton
2006-11-17 17:32:45 +00:00
mjacob
73d710374d 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
mjacob
59460eb5d0 minor change to reduce some diff noise 2006-11-16 00:31:46 +00:00
mjacob
d01394099a 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
mjacob
120271c1a6 Add 4Gb (24XX) support and lay the foundation for a lot of new stuff. 2006-11-02 03:21:32 +00:00
mjacob
19b599de4a 2nd and final commit that moves us to CAM_NEW_TRAN_CODE
as the default.

Reviewed by multitudes.
2006-11-02 00:54:38 +00:00
mjacob
7e1db24f98 The first of 3 major steps to move the CAM layer forward to using
the CAM_NEW_TRAN_CODE that has been in the tree for some years now.

This first step consists solely of adding to or correcting
CAM_NEW_TRAN_CODE pieces in the kernel source tree such
that a both a GENERIC (at least on i386) and a LINT build
with CAM_NEW_TRAN_CODE as an option will compile correctly
and run (at least with some the h/w I have).

After a short settle time, the other pieces (making
CAM_NEW_TRAN_CODE the default and updating libcam
and camcontrol) will be brought in.

This will be an incompatible change in that the size of structures
related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change
in both size and content. However, basic system operation and
basic system utilities work well enough with this change.

Reviewed by:	freebsd-scsi and specific stakeholders
2006-10-31 05:53:29 +00:00
mjacob
232d5f7e05 Begin the process of moving info to sysctl stuff for FreeBSD
by providing OIDs for WWNN/WWPN and Initiator ID.
2006-09-26 04:59:52 +00:00
mjacob
639497743e Restore multi-version cleanliness. 2006-09-03 01:26:55 +00:00
jmg
c25fb06d92 add a newbus method for obtaining the bus's bus_dma_tag_t... This is
required by arches like sparc64 (not yet implemented) and sun4v where there
are seperate IOMMU's for each PCI bus...  For all other arches, it will
end up returning NULL, which makes it a no-op...

Convert a few drivers (the ones we've been working w/ on sun4v) to the
new convection...  Eventually all drivers will need to replace the parent
tag of NULL, w/ bus_get_dma_tag(dev), though dev is usually different for
each driver, and will require hand inspection...

Reviewed by:	scottl (earlier version)
2006-09-03 00:27:42 +00:00
mjacob
ccda04f5c0 More ispfwfunc definitions funnies which break pre-7.0 builds. 2006-09-01 05:03:42 +00:00
mjacob
0cc7c39787 Add missing pre-7.0 firmware pointer. Oops. 2006-09-01 04:57:14 +00:00
mjacob
4fd622b09a fix bug in 2322 receive sequencer f/w load 2006-09-01 04:18:17 +00:00
mjacob
40cc07237d Fix RELENG_4 code version- isp_roles wasn't getting initialized so
it ended up defaulting to ISP_ROLE_NONE. My testing hadn't caught it
because I was deliberatly setting role via ioctl.

Thanks to user Toni for lending me an alpha to test this on.

MFC after:	0 days
2006-08-21 00:46:10 +00:00
mjacob
44c8c2fc91 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
mjacob
04e08ae813 The register offset is within 4K, not 256 bytes, for some QLogic cards. 2006-08-14 05:36:26 +00:00
mjacob
a1c57a3996 The macro IS_23XX should not mistakenly include 24XX cards. 2006-08-14 05:35:41 +00:00
mjacob
b780aa911e 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
mjacob
9436db4dfd Increase local reserved (high && low) storage in each command
structure from 2 to 3 words.
2006-08-04 20:20:55 +00:00
mjacob
8d6267e01f Fix na_fcentry_t to not have a lun field. Fix indentation in handly
the notify structs. Fix messages in isp_got_msg_fc to print out the
loop id of the sender- not the wwpn which will be synthesized later,
if possible, in the outer layers. Put in debug printouts to pair
a notify ack to a notify so one can see the start/close of an
immediate notify event. Put in spsace for TASK MANAGEMENT response
flags (which we don't do yet).
2006-08-04 20:20:00 +00:00
mjacob
7a3e8ba54d Initialize 2300 request/response pointers in isp_reset- not in
isp_fibre_init.
2006-08-04 20:14:52 +00:00
mjacob
9594cc0141 Rename ioctl driven task management functions so they
don't collide with task management definitions on other
platforms.
2006-08-04 20:14:03 +00:00
mjacob
6e5be93865 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
mjacob
fef54567b2 Don't attach 2422's yet. It just confuses everyone. 2006-07-14 05:16:00 +00:00
mjacob
1e74e0a022 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
mjacob
d027516d89 Put in some missing target mode for 2KLOGIN f/w spots.
MFC after:	1 month
2006-07-10 22:40:21 +00:00
mjacob
34d639efec Clean up the ioctl to not process nonsense on SCSI isp cards.
MFC after:	1 month
2006-07-10 22:39:32 +00:00
mjacob
a6dea567ad Convert isp(4) and ispfw(4) to use firmware(9) to manage firmware
loading for the QLogic cards.

Because isp(4) exists before the root is mounted, it's not really
possible for us to use the kernel's linker to load modules directly
from disk- that's really too bad.

However, the this is still a net win in in that the firmware has
been split up on a per chip (and in some cases, functionality)
basis, so the amount of stuff loaded *can* be substantially less
than the 1.5MB of firmware images that ispfw now manages. That is,
each specific f/w set is now also built as a module. For example,
QLogic 2322 f/w is built as isp_2322.ko and Initiator/Target 1080
firmware is built as isp_1080_it.ko.

For compatibility purposes (i.e., to perturb folks the least), we
also still build all of the firmware as one ispfw.ko module.

This allows us to let 'ispfw_LOAD' keep on working in existing
loader.conf files. If you now want to strip this down to just
the firmware for your h/w, you can then change loader.conf to
load the f/w you specifically want.

We also still allow for ispfw to be statically built (e.g., for
PAE and sparc64).

Future changes will look at f/w unloading and also role switching
that then uses the kernel linker to load different ips f/w sets.
MFC after:	2 months
2006-07-09 17:50:20 +00:00
mjacob
c2e8dadb45 What the heck - make the last (most recent) 2200 f/w also do
Hard Loop acquisition.
2006-07-03 20:56:48 +00:00
mjacob
fa2514423b 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
mjacob
903090f356 allow this to compile cleanly under RELENG_4 2006-06-03 07:19:44 +00:00
mjacob
6162d5a7d4 Don't set CAM_DEV_QFRZN when we get an ABORT_TASK. Just
by itself, this makes no sense.
2006-05-30 17:43:04 +00:00
mjacob
eb7627de0c Add missing case for RQSTYPE_CTIO3- neede for 64 bit target mode. 2006-05-22 07:07:30 +00:00
mjacob
a069364a5c Remove bzero/bcopy vestiges
Be cognizant as to whether we're running 2KLogin f/w in target mode and
do the appropriate loopid load based upon that.

Do a first cut (seems to work, at least for amd64) at 64 bit target
mode for fibre channel cards. We could probably also do it for SPI
cards, but that's not supported right now.
2006-05-22 06:51:48 +00:00
mjacob
1472ff1bb9 Remove bzero/bcopy vestiges.
Be cognizant as to whether we're running 2KLogin f/w in target mode and
do the appropriate loopid load based upon that.
2006-05-22 06:49:49 +00:00
mjacob
6b989e186c remove bzero/bcopy vestiges 2006-05-22 06:48:40 +00:00
mjacob
a79d1e19be add TGT_ANY define 2006-05-22 06:47:42 +00:00
mjacob
a9ce430c0a Fix longstanding bug where exec throttle is 16 bits- not 8. 2006-05-22 06:47:20 +00:00
mjacob
cdcab648f3 Move a define depending on __FreeBSD_versoin to after where it
would be defined.

Submitted by:   Ruslan Ermilov
2006-05-16 16:31:58 +00:00