way of doing business- modulo some startup spasms and peculiarities
of the way kthreads are started (*after* configuration, weird) and
some strangeness with the freeze/thaw code, what now happens is
that any of Loop Down, LIP, Loop Reset or Port Datbase or Name
Server Database Changed ASYNC events cause the queues to freeze
for this channel. The arrival of a Loop UP is not relevant.
What *is* relevant is that the Port Datbase or Name Server Changed
async event indicate that it's okay to go and (re)evaluate the
state of the FC link and (re)probe local loop and fabric membership.
We have a kthread do this because it's *sooooo* much nicer to be
able to sleep while doing the 130-250 mailbox commands it'll take
to re-evaluate things.
When the state is well known again, we can unfreeze the channel
queues. Then, as commands start arriving, we simply can start them
or bounce them with XS_SELTIMEOUT (if the device in question has
gone away). Previously, we did lazy evaluation, which meant that
if a change occurred, we would wait until the very *next* command
to go rebuild stuff.
The reason this is not sensible is:
a) Even with sleeping, you can hang up your system because you might be
making some poor stat(2) call pay the price of re-evaluating the whole
fabric.
b) If we ever really want to get to dynamic attachment/detachment, we
should find out sooner, rather than later, where things get to.
Split off ispminphys_1020 from ispminphys- a 1020 has a 24 bit limit-
not anything newer.
Re-enable LIPs and Loop Resets as async events- this allows the outer
layer to set policy about them.
Roll platform major && minor. Remove bogus waitq (no longer used).
Remove callout entry in softc (no longer used). Define some shorthands
for channels. Clean up a variety of cruft left over from the
thorpej_scsipi changeover.
keeps us from stomping on ourselves.
Say we're in the middle of re-evaluating a loop (and sleeping) when a
command completes, or a timer refires, and this *other* thread decides
*it* wants to start re-evaluating the loop. Bad news.
We have to be a bit careful- if we can't acquire the MBOX semaphore at
interrupt level, we will simulate a host interface error. This is a bit
of a temp workaround. There's some work underway driven by a NetBSD
commercial user that will try and force most mailbox stuff into a
part A/part B interrupt driven model.
This is a completely rewritten scsipi_xfer execution engine, and the
associated changes to HBA drivers. Overview of changes & features:
- All xfers are queued in the mid-layer, rather than doing so in an
ad-hoc fashion in individual adapter drivers.
- Adapter/channel resource management in the mid-layer, avoids even trying
to start running an xfer if the adapter/channel doesn't have the resources.
- Better communication between the mid-layer and the adapters.
- Asynchronous event notification mechanism from adapter to mid-layer and
peripherals.
- Better peripheral queue management: freeze/thaw, sorted requeueing during
recovery, etc.
- Clean separation of peripherals, adapters, and adapter channels (no more
scsipi_link).
- Kernel thread for each scsipi_channel makes error recovery much easier
(no more dealing with interrupt context when recovering from an error).
- Mid-layer support for tagged queueing: commands can have the tag type
set explicitly, tag IDs are allocated in the mid-layer (thus eliminating
the need to use buggy tag ID allocation schemes in many adapter drivers).
- support for QUEUE FULL and CHECK CONDITION status in mid-layer; the command
will be requeued, or a REQUEST SENSE will be sent as appropriate.
Just before the merge syssrc has been tagged with thorpej_scsipi_beforemerge
to report the mailbox command that times out. Fix isp_unswizzle_sns_rsp
which for reasons *I* find obscurer just doesn't work correctly on sparc64
with words past 128. I have no idea why this *does* work on SparcLinux.
quite simply a question of the Qlogic being little endian and having
to have stuff swapped on big endian machines- it also has to do with the
fact that the SBus and PCI DMA layouts are wierd with respect to this.
At any rate, now finally fixed- works on Mac G4, tested it on a SS10
for sparc, checked on alpha to see if I've broken anything, and as
soon as I get another spare afternoon I'll finally install a sparc64
version which should just work (as it'll be like the Mac).
Also fix egregious bug where we would never decrement
the islocked recursion counter. I guess this means
that we don't recurse on this platform! All of this should
go away when we have real lock primitives to use in drivers.
onintstack to be real integers. Add ISP_ILOCK/ISP_IUNLOCK macros.
Fix the isp_lock/isp_unlock inlines to stop being so embarrassingly
in error. Why, or why, can't I have mutex_enter/mutex_exit, pretty please?
interace cleanups, some new common functions. The major impact that
will be noticeable right away is that if you boot with not Fibre connected
to the FC cards, you no longer hang indefinitely.
in new MBOX_WAIT_COMPLETE/MBOX_NOTIFY_COMPLETE macros (ready for SMPizing).
Define STRNCAT inline for our usage.
Stealing a bit of the xs_status flags to maintain command state that
is pertinent for the hBA- should really reserve them for private usage
in scsipiconf.h.
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
resource allocation.
- Insertion and removal of callouts is constant time, important as
this facility is used quite a lot in the kernel.
The old timeout()/untimeout() API has been removed from the kernel.
so we'll know when it's time to switch from 'slow' command mode to normal.
Change some settings for configuration printfs and debug levels. Redo the
internal ispscsicmd return definitions and let isp_cmd translate them as
approrpriate to NetBSD values. Remove the inline functions from here- they're
now in isp_inline.h. Put in the start of the correct SWIZZLE/UNSWIZZLE
functions.
until Matt Jacob has a change to update the driver for the latest
firmware, etc. since update device parameters seems to fail once the
system is really up and running, and eventually causes the controller
to wedge. This may be due to a firmware bug.
Per discussion with Matt.
(e.g., the 1240). Include the new 1080/1240 NVRAM layout reading code. Some
moderately significant mailbox changes were necessary also to accomodate a
second channel.
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.
for FC HB based upon a SCCLUN define (15 for normal- 255 out of a possible
65535 for SCCLUN). Propagate loopid as adapter_target.
Roll minor platform version. Roll core version number.
Update mailbox definitions with cleaner target mode structure definitions.
Clean up some ENDIAN stuff. Correct botched ISP2100_NVRAM_HARDLOOPID offset.