Commit Graph

96 Commits

Author SHA1 Message Date
Matt Jacob
d9c272f3ea Redo how we manage SCSI device settings- have a 3rd flags (nvram) that records
either what's in NVRAM or what the safe defaults would be if we lack NVRAM.
Then we rename cur_XXXX to actv_XXXX (these are the currently active settings)
and the dev_XXX settings to goal_XXXX (these are the settings which we want
cur_XXXX to converge to).

Roll core minor.
2001-07-30 00:59:32 +00:00
Matt Jacob
b91862efef Firmware crashes handled in platform specific code (isp_async call).
Fix longstanding silly buglet that left a hole in the debug log defines.
2001-07-04 18:46:50 +00:00
Matt Jacob
6a23026c6e Fix botch for state levels. Role minor release. Start adding code for a
'force logout' path.

MFC after:	4 weeks
2001-06-05 17:11:06 +00:00
Matt Jacob
5d57194434 Spring MegaChange #1.
----

Make a device for each ISP- really usable only with devfs and add an ioctl
entry point (this can be used to (re)set debug levels, reset the HBA,
rescan the fabric, issue lips, etc).

----

Add in a kernel thread for Fibre Channel cards. The purpose of this
thread is to be woken up to clean up after Fibre Channel events
block things.  Basically, any FC event that casts doubt on the
location or identify of FC devices blocks the queues. When, and
if, we get the PORT DATABASE CHANGED or NAME SERVER DATABASE CHANGED
async event, we activate the kthread which will then, in full thread
context, re-evaluate the local loop and/or the fabric. When it's
satisfied that things are stable, it can then release the blocked
queues and let commands flow again.

The prior mechanism was a lazy evaluation. That is, the next command
to come down the pipe after change events would pay the full price
for re-evaluation. And if this was done off of a softcall, it really
could hang up the system.

These changes brings the FreeBSD port more in line with the Solaris,
Linux and NetBSD ports. It also, more importantly, gets us being
more proactive about topology changes which could then be reflected
upwards to CAM so that the periph driver can be informed sooner
rather than later when things arrive or depart.

---

Add in the (correct) usage of locking macros- we now have lock transition
macros which allow us to transition from holding the CAM lock (Giant)
and grabbing the softc lock and vice versa. Switch over to having this
HBA do real locking. Some folks claim this won't be a win. They're right.
But you have to start somewhere, and this will begin to teach us how
to DTRT for HBAs, etc.

--

Start putting in prototype 2300 support.  Add back in LIP
and Loop Reset as async events that each platform will handle.
Add in another int_bogus instrumentation point.

Do some more substantial target mode cleanups.

MFC after:	8 weeks
2001-05-28 21:20:43 +00:00
Matt Jacob
e2ec5cf0f9 In order to save ourselves grief with the SUNPRO compiler under
Solaris (which, for reasons unknown to me, chokes on u_int16_t
as a typedef of unsigned short if used in a transitional (mixed K&R
and ANSI) way), we'll go the extra mile and fully ANSIfy things.
2001-03-14 04:11:56 +00:00
Matt Jacob
24d52eb7b5 More 32 to 16 bit handle stuff. Roll core minor version. 2001-03-04 18:42:23 +00:00
Matt Jacob
4102f2f6ef Fix a longstanding bug- we had the sense of what bit 14
for the ICB firmware options meant- *I* had taken it to
mean that if you set it, Node Name would be ignored and
derived from Port Name. Actually, it meant the opposite.
As a consequence- change ICBOPT_USE_PORTNAME to the
define ICBOPT_BOTH_WWNS- makes more sense.

Fix wrong input bitmap for MBOX_DUMP_RAM command. Call
ISP_DUMPREGS if we get a f/w crash. Add ISPCTL_RUN_MBOXCMD
control command (so outer layers can run a mailbox command
directly) and add a ISPASYNC_UNHANDLED_RESPONSE hook so
outer layers can understand response queue entries we
might not know about.
2001-02-23 05:35:50 +00:00
Matt Jacob
410b556714 Eliminate ISP2100_FABRIC- we always allow for fabric now. Add an
isp_iid_set/isp_iid for fibre channel- this is because we now
fake a port database entry for ourselves. Add the additional loop
states between LOOP_PDB_RCVD and LOOP_READY.

Change and comment on a wad of Fibre Channel isp_control functions.
Change and comment on some of the ISPASYNC Fibre Channel events.
2001-02-11 03:56:48 +00:00
Matt Jacob
7afb656f3f Add was_fabric_dev/fabric_dev tags to our local FC database structure
(so we can see rapidly whether something was a fabric device but is
now gone).

Add a tag which says what role this adapter should take. It can take
on the value of None, Target, Initiator or Both. None is useful for
warm failover purposes. Remove the ISP_CFG_NOINIT silliness since
a role of "None" does this.

Add a isp_lastmbxcmd tag to store the opcode for the last mailbox
command used.
2001-01-15 18:40:37 +00:00
Matt Jacob
3fc3cadde6 ISPASYNC_PDB_CHANGED -> ISPASYNC_LOGGED_INOUT. 2001-01-09 02:49:02 +00:00
Matt Jacob
e9423e211e Add in Bill Sommerfeld's -Wformat stuff. Add a ISP_CFG_NOINIT option
to keep from completing initialization when isp_init is called.
2000-12-29 19:17:18 +00:00
Matt Jacob
67afe757a2 Add interrupt instrumentation. Change ISP_CFG_NPORT config option to
a set of options that allows specific loop, loop-only, nport, nport-only
topology settings. Define a required macro for all platforms (USEC_SLEEP).
2000-12-02 18:06:03 +00:00
Matt Jacob
9cf43b9716 Change some default macro usages/definitions/requirements. 2000-10-12 23:47:03 +00:00
Matt Jacob
aa57fd6fa5 some copyright cleanups 2000-09-21 20:16:04 +00:00
Matt Jacob
b6b6ad2f23 various fixes 2000-08-27 23:38:44 +00:00
Matt Jacob
53cff3bb65 Rewrite for version 2.0. Some structural changes, but also
a substantial amount of commenting about what each platform
specific definitions are supposed to be.
2000-08-01 06:10:21 +00:00
Matt Jacob
c464389f4b Remove obsolete isp_dogactive tag. 2000-07-04 01:06:42 +00:00
Matt Jacob
e2adf86e4e Add 8 bits of volatile mailbox busy mask- this will be the bitmask of
output mailbox values we want to get back out of the chip once a mailbox
command is done. Add storage for the maximum number of output mailbox
registers to the softc.

Roll minor version number.
2000-06-27 19:17:39 +00:00
Matt Jacob
5e09512c51 Roll core minor version. Set ISP_MAX_LUNS to be off of new isp_maxluns
tag in softc.
2000-06-18 04:45:51 +00:00
Matt Jacob
686f419d48 Roll core minor version. Change our 'fabdev' tag to 'loggedin'. 2000-05-09 01:09:23 +00:00
Matt Jacob
d465588a93 Roll minor version. Increase size (and add defines for) topology storage. 2000-04-21 02:06:30 +00:00
Matt Jacob
83fbc5665e Add 12160 (Ultra3) defines. Add config option flag for forcing point-to-point
instead of FC-AL (2200 only).

Approved: jkh@freebsd.org
2000-02-11 19:25:01 +00:00
Matt Jacob
6b016bfd75 include public target mode functions 2000-01-15 01:47:10 +00:00
Matt Jacob
41593b2586 Roll minor revision number and add a more finalized list
of target mode related enums.
2000-01-03 22:13:40 +00:00
Matt Jacob
22e1dc858b Add Dual LVD bus (1280) support 1999-12-16 05:42:02 +00:00
Matt Jacob
80ae565585 Fix some includes for when we (eventually) get target mode working again.
Role the core version minor number. Change the arguments to the dma
setup function to use a u_int16_t for the output request loop pointer
(truly amazing that this hasn't blown up in anyones face so far). Do
some shuffling around of some items.
1999-11-21 03:12:58 +00:00
Matt Jacob
7e90346eec Roll core version number. Do some stylistic changes. Ensure that
the result queue length is never less than 64. Move (ick) temp port
database used for post-LIP merging off the kernel stack and put it
into the softc. Remove some target mode stuff which will come back
later in a different file. Change how the list of outstanding commands
are stored (now allocated at mailbox setup time to be just enough for
the max for a specific HBA which can vary). Keep a rotating seed of
the last index for this in the softc. Increase the count of active
commands from 10 to 16 bits.
1999-10-17 18:45:31 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Matt Jacob
0f747d722c Clarify lun limits for FC && SCSI. 1999-08-16 20:01:14 +00:00
Matt Jacob
3692397b0d add 2200 f/w; fix botched define 1999-07-05 20:42:08 +00:00
Matt Jacob
77d4e8361d Roll revision levels. Move DEFAULT_LOOPID definition to platform files.
Change some fcp parameter structures such that we can get the portid
(24 bit value), get both node and port WWN, know whether we're on a fabric
or not, note whether we've ever seen the loop up, and note the current
state of the loop.

Replace the isp_pdb_t structure in fcparams with a reduced cost structure
that maintains a static relationship to 'Target', but can have the actual
loop ID used change (in case, post LIP, we discover things have moved
around). This also retains portid and node/port WWNs.  This array gets
larger if we have fabric support compiled in.

Note special loop IDs that are invariate for this device- FL_PORT_ID
(0x7e) which tells us if there's a fabric controller present, FC_PORT_ID
and FC_SNS_ID (fabric controller port and fabric SNS server port). We don't
use the latter two for anything. IDs above FC_SNS_ID up through 255 are
available for mapping fabric devices to 'target' ids.

Add in a config define to set FC full duplex mode. Add in a define to
recognize the Qlogic 2200 boards. Add comments about ISPCTL commands.
Add and change some ISPASYNC enumes.
1999-07-02 22:46:31 +00:00
Matt Jacob
67eb623192 Bruce pointed out I was being silly with volatile.
Submitted by:	bde@freebsd.org
1999-06-24 16:34:00 +00:00
Matt Jacob
8259d0816f Roll core minor number. Re-layout a lot of SCSI fields to accomodate multiple
bus adapters.
1999-05-11 05:02:23 +00:00
Matt Jacob
12b36e2d97 Change f/w revision to major,minor,micro version. Add in ISP1040C definition. 1999-04-04 01:26:08 +00:00
Matt Jacob
4394c92f52 Add in 1080 LVD support and some basis also for the 1240. The port database
printout is now enabled.
1999-03-25 22:52:45 +00:00
Matt Jacob
57c801f5cf A wad of changes- prepping for 1080/1240 support (which caused a massive
thwank in register layout goop). A different mboxcmd approach. Some PDB change
infrastructure. Some better management of loopdown/loopup events (keep them
distinct from resource starvation for simq freeze/unfreeze actions).
1999-03-17 05:04:39 +00:00
Matt Jacob
10f20e4038 Roll internal release tag. Roll core version minor. Fix broken DPARM_DEFAULT
define. Add a new config flag param (ISP_CFG_NONVRAM) whose intent it is
to cause NVRAM to be ignored. Add ISPASYNC_LOOP_DOWN and ISPASYNC_LOOP_UP
isp_async enums.

Amazingly enough, I did all my scsi_sa work recently without realizing
that I had a broken isp card whose (unchangeable- it's an old old old
isp1020) NVRAM has sync mode enabled, but disconnect/reconnect disabled-
the ISP_CFG_NONVRAM is definitely warranted when you want to bloody well
ignore the NVRAM and set something sensible.
1999-02-09 01:11:35 +00:00
Matt Jacob
cbf57b472d Implement and use Fast Posting for both parallel && fibre. Redo a bit of
the startup code. Implement a call to outer framework function so that
asynchronous events can be handled (e.g., speed negotiation, target mode).

Roll internal release tags.
1999-01-30 07:29:00 +00:00
Matt Jacob
128101f362 up isp_fifo_threshold NVRAM storage to 3 bits (for future 128 bit) 1999-01-10 02:51:48 +00:00
Matt Jacob
c305536317 clarify headers;move uninit to outer layer;remove watchdog 1998-12-28 19:22:27 +00:00
Matt Jacob
9f8afea40b roll core version minor and wire a non-i386 default Loop ID to 113 1998-12-05 01:28:38 +00:00
Matt Jacob
a70ac9fd83 per bde (who is right about this) that an inlined fucntion with const
char * strings being returned defined in a header file included several
places but only used in one module, is, uh, silly.
1998-09-17 23:20:29 +00:00
Justin T. Gibbs
478f8a9685 Update QLogic ISP support for CAM. Add preliminary target mode support.
Submitted by:	Matthew Jacob <mjacob@feral.com>
1998-09-15 08:42:56 +00:00
Bruce Evans
a09bee1aa8 Fixed pedantic semantics errors (bitfields not of type int, signed int
or unsigned int (this doesn't change the struct layout, size or
alignment in any of the files changed in this commit, at least for
gcc on i386's.  Using bitfields of type u_char may affect size and
alignment but not packing)).
1998-06-08 09:47:47 +00:00
Bruce Evans
5a4c8619d8 Support compiling with `gcc -ansi'. Just use __inline instead of inline.
[__]inline is only used to bloat the code here.  It gives a separate copy
of all the strings for each time this header is included...

Fixed misuse of __P(()).
1998-05-01 18:10:50 +00:00
Matt Jacob
6054c3f6f2 Add support for the Qlogic ISP SCSI && FC/AL Adapters 1998-04-22 17:54:58 +00:00