History log of /freebsd-current/sys/dev/isp/isp_freebsd.h
Revision Date Author Comments
# 10ed63fc 27-Oct-2023 Joerg Pulz <Joerg.Pulz@frm2.tum.de>

isp(4): Rework firmware handling/loading

Correctly identify the active firmware in flash on adapters with
primary and secondary firmware region in flash.
Correctly identify the active NVRAM on adapters with primary
and secondary NVRAM region in flash.

Loading ispfw(4) moved from isp_pci_attach() to isp_reset().
Drop the reference to ispfw(4) after using it so one can kldunload(8) it.
New isp_load_ram() function to load either ispfw(4) or flash firmware
into RISC's RAM.
New functions to read data from flash. The old ones will be removed later.
A bunch of new helper functions to identify and validate active flash
regions for firmware, auxiliary and NVRAM.
Overhaul ISP_FW_* macros and make use of it when comparing firmware
versions. We can handle firmware versions up to 255.255.255.

Firmware load priority slightly changed:
For 27xx and newer adapters:
- load ispfw(4) firmware
- request (active) flash firmware information
- compare version numbers of ispfw(4) and flash firmware
- load firmware with highest version into RISC's RAM
- if loading ispfw(4) is disabled or failed - load firmware from flash
- if everything else fails use MBOX_LOAD_FLASH_FIRMWARE as fallback

For 26xx and older adapters nothing changed:
- load ispfw(4) firmware and load it into RISC's RAM
- if loading ispfw(4) is disabled or failed use MBOX_EXEC_FIRMWARE
- for 26xx a preceding MBOX_LOAD_FLASH_FIRMWARE is used

New read only sysctl(8)'s:
dev.isp.N.fw_version_run: the firmware version actually running
dev.isp.N.fw_version_ispfw: the firmware version provided by ispfw(4)
dev.isp.N.fw_version_flash: the (active) firmware version in flash

While here:
- firmware attribute handling/parsing reworked
+ renamed defines from ISP2400_FW_ATTR_* to ISP_FW_ATTR_*
+ changed values to match new handling/parsing
+ added some more attributes
- enable FLT support on 26xx based adapters
- log level adjustments
- new function return status codes (some for now, some for later use)
- some minor style changes

Tested and approved to work on real hardware with:
- Qlogic ISP 2532 (QLogic QLE2560 8Gb FC Adapter)
- Qlogic ISP 2031 (QLogic QLE2662 16Gbit 2Port FC Adapter)
- Qlogic ISP 2722 (QLogic QLE2690 16Gb FC Adapter)
- Qlogic ISP 2812 (QLogic QLE2772 32Gbit 2Port FC Adapter)

PR: 273263
Reviewed by: mav
Pull Request: https://github.com/freebsd/freebsd-src/pull/877
MFC after: 1 month
Sponsored by: Technical University of Munich


# 71625ec9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# b760d2ec 26-Nov-2020 Alexander Motin <mav@FreeBSD.org>

More cleanup in response queue and reset code.


# a6222dd7 24-Nov-2020 Alexander Motin <mav@FreeBSD.org>

Remove more legacy of parallel SCSI.


# 384d27e0 24-Nov-2020 Alexander Motin <mav@FreeBSD.org>

Remove concept of mbox_sleep_ok.

It was broken by design and unused for years due to conflicts between
different threads, fighting for the same set of mailbox registers, not
designed for multiple requests at a time. So either request has to be
synchronous and spin under the lock, or it should be sent asynchronously
through the queues as Mailbox Command IOCB or some other way.

This removes any OS specifics from the wait code, so it can be inlined.


# c515717a 21-Nov-2020 Alexander Motin <mav@FreeBSD.org>

Remove remnants of execthrottle and maxalloc parameters.

The first was obsolete since 26xx, not used on 25xx and not needed on 24xx.
The second seems never worked on 24xx and up.


# b8e2395e 20-Nov-2020 Alexander Motin <mav@FreeBSD.org>

Increase queue depths from 1024/256 to 8192/1024 IOCBs.

Qlogic chips store S/G lists in the same queue as requests themselves. In
the worst case 1MB I/O may require up to 52 IOCBs, that means queue of 1024
IOCBs can store only 19 of such requests. The increase reduces chances of
overflow, while we should be able to afford additional 512KB of RAM per HBA.
The Linux driver uses comparable numbers.

While there, decouple ATIO queue size from response queue size. There is
no reason for them to be equal.


# f6854a0c 20-Nov-2020 Alexander Motin <mav@FreeBSD.org>

Cleanup DMA handling.

- Make isp_start() to set all the IOCB fields aside of S/G list, removing
extra information from isp_send_cmd(), now only doing S/G lists and sending.
- Turn DMA setup/free from being card and PCI-specific into OS-specific,
instead add new card-specific method for isp_send_cmd(). Previously this
function was a monster handling all the cards.
- Remove double error code translation.


# 1b760be4 19-Nov-2020 Alexander Motin <mav@FreeBSD.org>

Remove parallel SCSI and 1/2Gb FC support from isp(4).

This removes 288KB (36%) of the driver code and zillions of hacks and
workarounds, making single driver uniformly support several different
generations of hardware interfaces, not counting minor card variations.
After years of the hopeless fight, I don't think it worth to continue
support for hardware obsolete for 15-20 years. Instead much cleaner
now code should allow to move forward toward better locking, multiple
queues and other cool features.

All the remaining Qlogic cards starting from 4Gb 24xx to 32Gb 27xx use
the same hardware/firmware interface with minor incremental improvements,
so it seems to be a good new starting point. Except one PCI-X model all
all of them are PCIe and so still usable in modern systems.

Discussed with: ken, scottl, jpaetzel, imp
Relnotes: yes


# cf770ba3 17-Nov-2020 Alexander Motin <mav@FreeBSD.org>

Move ecmd memory allocation itto separate DMA tag.

Ecmd memory is not directly related to the request queue, only referenced
from it sometimes in target mode. Separate allocation should be easier
in case of fragmented memory and can be skipped when target is not built.

MFC after: 1 month


# 88364968 25-Oct-2020 Alexander Motin <mav@FreeBSD.org>

Introduce support of SCSI Command Priority.

SAM-3 specification introduced concept of Task Priority, that was renamed
to Command Priority in SAM-4, and supported by all modern SCSI transports.
It provides 15 levels of relative priorities: 1 - highest, 15 - lowest and
0 - default. SAT specification for SATA devices translates priorities 1-3
into NCQ high priority.

This change adds new "priority" field into empty spots of struct ccb_scsiio
and struct ccb_accept_tio of CAM and struct ctl_scsiio of CTL. Respective
support is added into iscsi(4), isp(4), mpr(4), mps(4) and ocs_fc(4) drivers
for both initiator and where applicable target roles. Minimal support was
added to CTL to receive the priority value from different frontends, pass it
between HA controllers and report in few places.

This patch does not add consumers of this functionality, so nothing should
really change yet, since the field is still set to 0 (default) on initiator
and not actively used on target. Those are to be implemented separately.

I've confirmed priority working on WD Red SATA disks connected via mpr(4)
and properly transferred to CTL target via iscsi(4), isp(4) and ocs_fc(4).

While there, added missing tag_action support to ocs_fc(4) initiator role.

MFC after: 1 month
Relnotes: yes
Sponsored by: iXsystems, Inc.


# 58aa35d4 03-Feb-2020 Warner Losh <imp@FreeBSD.org>

Remove sparc64 kernel support

Remove all sparc64 specific files
Remove all sparc64 ifdefs
Removee indireeect sparc64 ifdefs


# 718cf2cc 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

sys/dev: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.


# 7e31684e 24-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Unify initiator and target DMA setup and command sending.

The code is so alike that it is pointless to keep it separate.

MFC after: 2 weeks


# 961da638 23-Mar-2017 Alexander Motin <mav@FreeBSD.org>

isp field in struct isp_pcmd is also unused.

MFC after: 2 weeks


# 96ae113f 23-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Remove write-only crn field from struct isp_pcmd.

MFC after: 2 weeks


# 2d24b6af 22-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Cleanup response queue processing.

MFC after: 2 weeks


# 31c161a6 21-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Improve command timeout handling.

Let firmware do its best first, and if it can't, try software recovery.
I would remove software timeout handler completely, but found bunch of
complains on command timeout on sparc64 mailing list few years ago, so
better be safe in case of interrupt loss.

MFC after: 2 weeks


# 13d9c921 21-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Clean/unify some macro usage.

MFC after: 2 weeks


# 98339da1 20-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Remove some more dead code.

MFC after: 2 weeks


# 08826086 19-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Add initial support for multiple MSI-X vectors.

For 24xx and above use 2 vectors (default and response queue).
For 26xx and above use 3 vectors (default, response and ATIO queues).
Due to global lock interrupt hardlers never run simultaneously now, but
at least this allows to save one regitster read per interrupt.

MFC after: 2 weeks


# d10e4cd0 15-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Remove not very useful ATIO/INOT stats.

While there polish respective debug logging.

MFC after: 2 weeks


# 6327b0d2 14-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Remove tangled isp_mbox_continue() mechanism.

It was implemented to reduce context switches when uploading firmware to
card's RAM. But this mechanism is not used last 10 years since all mbox
operations are now polled, and it was never used for cards produced in
last 15 years. Newer cards can use DMA to upload firmware.

MFC after: 2 weeks


# a1fa0267 14-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Improvements around attach, reset and detach.

This change fixes DMA resource leak on driver unload. Also it removes
DMA resources allocation for hardcoded number of requests before fetching
the real number from firmware. Also it prepares ground for more flexible
IRQs allocation according to firmware capabilities.

MFC after: 2 weeks


# c44f58fc 12-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Remove strange config_intrhook_establish() magic.

Interrupts are enabled as part of chip reset just during driver attach.
Later "enabling" of already enabled interrupts is useless.

MFC after: 2 weeks


# ab23521a 12-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Try to slight untangle I/O and loop status handling.

MFC after: 2 weeks


# 229203af 12-Mar-2017 Alexander Motin <mav@FreeBSD.org>

Remove code for unsupported FreeBSD versions.

MFC after: 2 weeks


# 3f072d69 27-Feb-2017 Alexander Motin <mav@FreeBSD.org>

Send TERMINATE to firmware when aborting active ATIO.

MFC after: 2 weeks


# 2d4a5bcc 26-Feb-2017 Alexander Motin <mav@FreeBSD.org>

Return better error code in case of too long CDB.

Its more important for SPI HBAs, as they don't support CDBs above 12 bytes.
The new error code makes CAM to fall back to alternative commands.

MFC after: 2 weeks


# 8290ea90 21-Feb-2017 Alexander Motin <mav@FreeBSD.org>

Fix multiple problems around LUN disable under load.

- Move private data about ATIOs/INOTs from per-LUN to per-channel data.
This allows active commands to continue operation after LUN destruction.
This also simplifies lookup of the data by tag in some situations.
- Unify three restart_queue processing implementations.
- Complete all ATIOs from restart_queue on LUN disable.
- Delete ATIO private data when command completed or aborted, not depending
on the ATIO being requeued, that was ugly hack and could never happen. CAM
should always call ether XPT_CONT_TARGET_IO with status or XPT_ABORT.
- Implement XPT_ABORT for queued ATIOs/INOTs to allow CAM do graceful
shutdown, not depending on LUN disable, as it is done in ahd(4)/targ(4).
- Unify isp_endcmd() arguments to make it more usable in generic code.
- Remove never really used LUN state reference counter.

MFC after: 2 weeks


# 069f5ef9 20-Feb-2017 Alexander Motin <mav@FreeBSD.org>

Remove ancient __FreeBSD_version checks.

MFC after: 2 weeks


# 09ddc7ad 18-Feb-2017 Alexander Motin <mav@FreeBSD.org>

Move CTIO waitq from per-LUN to per-channel.

All resources lack of which may put CTIO into the queue are either
per-channel or potentially per-queue, but none of them are per-LUN.

This is a first step to fix live LUN disabling. Before this change
any CTIOs held in a queue in time of disabling were just leaked.

MFC after: 2 weeks


# 4ff970c4 12-Apr-2016 Alexander Motin <mav@FreeBSD.org>

Allocate separate DMA area for synchronous IOCB execution.

Usually IOCBs should be put on queue for asynchronous processing and should
not require additional DMA memory. But there are some cases like aborts and
resets that for external reasons has to be synchronous. Give those cases
separate 2*64 byte DMA area to decouple them from other DMA scratch area
users, using it for asynchronous requests.


# 7e53e7ac 09-Apr-2016 Alexander Motin <mav@FreeBSD.org>

Register symbolic port/node names in FC name server.

This is cosmetics that simplifies identification of new ports on FC switch.

It would be good to use target name from CTL here instead of hostname, but
it is not passed here through CAM now.

MFC after: 2 weeks


# 14849e2c 26-Dec-2015 Alexander Motin <mav@FreeBSD.org>

Split DMA buffers for request, response and ATIO queues.


# 7d191fdb 26-Dec-2015 Alexander Motin <mav@FreeBSD.org>

Use single DMA tag for scratch areas of all virtual ports.


# cd201b7b 04-Dec-2015 Alexander Motin <mav@FreeBSD.org>

Make 16Gig chips to use new queue pointer registers.

While 24xx-style ATIO and reply queue registers seems like still working,
request queue doesn't. So instead of that use registers from PCI BAR(4).


# e561aa79 26-Nov-2015 Alexander Motin <mav@FreeBSD.org>

One more round of port scanner rewrite.

- Make scan aborted by event restart immediately and infinitely.
- Improve handling of some loop events from firmware.
- Remove loop down timer, adding its functionality to scanner thread.
- Some more unification and simplification.


# e3a0bc58 23-Nov-2015 Alexander Motin <mav@FreeBSD.org>

Remove "disable" hint, which duplicates system-wide "disabled".


# 3e6deb33 23-Nov-2015 Alexander Motin <mav@FreeBSD.org>

Rip off target mode support for parallel SCSI QLogic adapters.

Hacks to enable target mode there complicated code, while didn't really
work. And for outdated hardware fixing it is not really interesting.

Initiator mode tested with Qlogic 1080 adapter is still working fine.


# 21daf914 14-Nov-2015 Alexander Motin <mav@FreeBSD.org>

Fix/improve CRN tracking.


# 277911a3 07-Nov-2015 Alexander Motin <mav@FreeBSD.org>

Rework r290504.


# c261189f 07-Nov-2015 Alexander Motin <mav@FreeBSD.org>

Make ISP_SLEEP() really sleep instead of spinning.

While there, simplify the wait logic.


# 6af11b82 24-Oct-2015 Alexander Motin <mav@FreeBSD.org>

Add PIM_EXTLUNS support to isp(4) driver.

Now 24xx and above chips support full 8-byte LUN address space.
Older FC chips may support up to 16K LUNs when firmware allows.
Tested in both initiator and target modes for 23xx, 24xx and 25xx.


# 385490cb 24-Oct-2015 Alexander Motin <mav@FreeBSD.org>

Remove ISP_INTERNAL_TARGET code.

We have CTL now, which is real and much more functional then this joke.


# c07b9e07 23-Oct-2015 Alexander Motin <mav@FreeBSD.org>

Disable full bus scan by CAM for FC adapters.

FC port database code already notifies CAM about all devices. Additional
full scan is just a waste of time, that by definition won't find anything
that is not present in port database.


# fb4a4356 08-Jan-2015 Kenneth D. Merry <ken@FreeBSD.org>

Fix Fibre Channel Command Reference Number handling in the isp(4) driver.

The Command Reference Number is used for precise delivery of
commands, and is part of the FC-Tape functionality set. (This is
only enabled for devices that support precise delivery of commands.)
It is an 8-bit unsigned number that increments from 1 to 255. The
commands sent by the initiator must be processed by the target in
CRN order if the CRN is non-zero.

There are certain scenarios where the Command Reference Number
sequence needs to be reset. When the target is power cycled, for
instance, the initiator needs to reset the CRN to 1. The initiator
will know this because it will see a LIP (when directly connected)
or get a logout/login event (when connected to a switch).

The isp(4) driver was not resetting the CRN when a target
went away and came back. When it saw the target again after a
power cycle, it would continue the CRN sequence where it left off.
The target would ignore the command because the CRN sequence is
supposed to be reset to 1 after a power cycle or other similar
event.

The symptom that the user would see is that there would be lots of
aborted INQUIRY commands after a tape library was power cycled, and
the library would fail to probe. The INQUIRY commands were being
ignored by the tape drive due to the CRN issue mentioned above.

isp_freebsd.c:
Add a new function, isp_fcp_reset_crn(). This will reset
all of the CRNs for a given port, or the CRNs for all LUNs
on a target.

Reset the CRNs for all targets on a port when we get a LIP,
loop reset, or loop down event.

Reset the CRN for a particular target when it arrives, is changed
or departs. This is less precise behavior than the
clearing behavior specified in the FCP-4 spec (which says
that it should be reset for PRLI, PRLO, PLOGI and LOGO),
but this is the level of information we have here. If this
is insufficient, then we will need to add more precise
notification from the lower level isp(4) code.

isp_freebsd.h:
Add a prototype for isp_fcp_reset_crn().

Sponsored by: Spectra Logic
MFC after: 1 week


# 315a4d6f 26-Nov-2014 Alexander Motin <mav@FreeBSD.org>

Some microoptimizations.

MFC after: 1 month


# b3a9e657 19-Nov-2014 Alexander Motin <mav@FreeBSD.org>

Fix build without INVARIANTS, broken by r274675.


# 2a0db815 18-Nov-2014 John Baldwin <jhb@FreeBSD.org>

Convert the refire_notify_ack timer from timeout(9) to callout(9).

Tested by: no one


# 1d0a1de2 17-Sep-2014 Will Andrews <will@FreeBSD.org>

Fix a kernel panic when unloading isp(4).

In the current implementation, the isp_kthread() threads never exit.

The target threads do have an exit mode from isp_attach(), but it is
not invoked from isp_detach().

Ensure isp_detach() notifies threads started for each channel, such
that they exit before their parent device softc detaches, and thus
before the module does. Otherwise, a page fault panic occurs later in:

sysctl_kern_proc
sysctl_out_proc
kern_proc_out
fill_kinfo_proc
fill_kinfo_thread
strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg));

For isp_kthread() (and isp(4) target threads), td->td_wmesg references
now-unmapped memory after the module has been unloaded. These threads
are typically msleep()ing at the time of unload, but they could also
attempt to execute now-unmapped code segments.

MFC after: 1 month
Sponsored by: Spectra Logic
MFSpectraBSD: r1070921 on 2014/06/22 13:01:17


# 07d925fa 10-Nov-2013 Alexander Motin <mav@FreeBSD.org>

Use relaxed (write-only) memory barriers when writing some of queue index
registers (for now on ISP2400+). We never read those registers back and
AFAIK their semantics does not require any immediate reaction on write.


# 123055f0 30-Oct-2013 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Adjust various SCSI drivers to handle either a 32-bit or 64-bit lun_id_t,
mostly by adjustments to debugging printf() format specifiers. For high
numbered LUNs, also switch to printing them in hex as per SAM-5.

MFC after: 2 weeks


# 523ea374 17-Oct-2013 Alexander Motin <mav@FreeBSD.org>

Optimize isp(4) to reduce CPU usage, especially in target mode:
- Remove two excessive and slow register reads from isp_intr(). Instead
of rereading value every time, assume that registers contain what we have
written there.
- Avoid sequential search through 4096 array elements when looking for
command tag. Use hash of lists to store active tags separately from free
ones and so greatly speedup the searches.

Reviewed by: mjacob


# 662daadd 21-Aug-2012 Matt Jacob <mjacob@FreeBSD.org>

Remove dependence on MAXPHYS.

MFC after: 1 month


# 94dff771 08-Aug-2012 Matt Jacob <mjacob@FreeBSD.org>

More rototilling with target mode in an attemp to get multiple
CCB at a time outstanding reliable. It's not there yet, but this
is the direction to go in so might as well commit. So far,
multiple at a time CCBs work (see ISP_INTERNAL_TARGET test mode),
but it fails if there are more downstream than the SIM wants
to handle and SRR is sort of confused when this happens, plus
it is not entirely quite clear what one does if a CCB/CTIO fails
and you have more in flight (that don't fail, say) and more queued
up at the SIM level that haven't been started yet.

Some of this is driven because there apparently is no flow control
to requeue XPT_CONTINUE_IO requests like there are for XPT_SCSI_IO
requests. It is also more driven in that the few target mode
periph drivers there are are not really set up for handling pushback-
heck most of them don't even check for errors (and what would they
really do with them anyway? It's the initiator's problem, really....).

The data transfer arithmetic has been worked over again to handle
multiple outstanding commands, so you have a notion of what's been
moved already as well as what's currently in flight. It turns that
this led to uncovering a REPORT_LUNS bug in the ISP_INTERNAL_TARGET
code which was sending back 24 bytes of rpl data instead of the
specified 16. What happened furthermore here is that sending back
16 bytes and reporting an overrun of 8 bytes made the initiator
(running FC-Tape aware f/w) mad enough to request, and keep
requesting, another FCP response (I guess it didn't like the answer
so kept asking for it again).

Sponsored by: Spectralogic
MFC after: 1 month


# 387d8239 28-Jul-2012 Matt Jacob <mjacob@FreeBSD.org>

-----------
MISC CHANGES

Add a new async event- ISP_TARGET_NOTIFY_ACK, that will guarantee
eventual delivery of a NOTIFY ACK. This is tons better than just
ignoring the return from isp_notify_ack and hoping for the best.

Clean up the lower level lun enable code to be a bit more sensible.

Fix a botch in isp_endcmd which was messing up the sense data.

Fix notify ack for SRR to use a sensible error code in the case
of a reject.

Clean up and make clear what kind of firmware we've loaded and
what capabilities it has.
-----------
FULL (252 byte) SENSE DATA

In CTIOs for the ISP, there's only a limimted amount of space
to load SENSE DATA for associated CHECK CONDITIONS (24 or 26
bytes). This makes it difficult to send full SENSE DATA that can
be up to 252 bytes.

Implement MODE 2 responses which have us build the FCP Response
in system memory which the ISP will put onto the wire directly.

On the initiator side, the same problem occurs in that a command
status response only has a limited amount of space for SENSE DATA.
This data is supplemented by status continuation responses that
the ISP pushes onto the response queue after the status response.
We now pull them all together so that full sense data can be
returned to the periph driver.

This is supported on 23XX, 24XX and 25XX cards.

This is also preparation for doing >16 byte CDBs.

-----------
FC TAPE

Implement full FC-TAPE on both initiator and target mode side. This
capability is driven by firmware loaded, board type, board NVRAM
settings, or hint configuration options to enable or disable. This
is supported for 23XX, 24XX and 25XX cards.

On the initiator side, we pretty much just have to generate a command
reference number for each command we send out. This is FCP-4 compliant
in that we do this per ITL nexus to generate the allowed 1 thru 255
CRN.

In order to support the target side of FC-TAPE, we now pay attention
to more of the PRLI word 3 parameters which will tell us whether
an initiator wants confirmed responses. While we're at it, we'll
pay attention to the initiator view too and report it.

On sending back CTIOs, we will notice whether the initiator wants
confirmed responses and we'll set up flags to do so.

If a response or data frame is lost the initiator sends us an SRR
(Sequence Retransmit Request) ELS which shows up as an SRR notify
and all outstanding CTIOs are nuked with SRR Received status. The
SRR notify contains the offset that the initiator wants us to restart
the data transfer from or to retransmit the response frame.

If the ISP driver still has the CCB around for which the data segment
or response applies, it will retransmit.

However, we typically don't know about a lost data frame until we
send the FCP Response and the initiator totes up counters for data
moved and notices missing segments. In this case we've already
completed the data CCBs already and sent themn back up to the periph
driver. Because there's no really clean mechanism yet in CAM to
handle this, a hack has been put into place to complete the CTIO
CCB with the CAM_MESSAGE_RECV status which will have a MODIFY DATA
POINTER extended message in it. The internal ISP target groks this
and ctl(8) will be modified to deal with this as well.

At any rate, the data is retransmitted and an an FCP response is
sent. The whole point here is to successfully complete a command
so that you don't have to depend on ULP (SCSI) to have to recover,
which in the case of tape is not really possible (hence the name
FC-TAPE).

Sponsored by: Spectralogic
MFC after: 1 month


# 9e7d423d 24-Jun-2012 Matt Jacob <mjacob@FreeBSD.org>

Clean up multi-id mode so it's driven by the f/w loaded,
not by some hint setting. Do more preparations for FC-Tape.
Clean up resource counting for 24XX or later chipsets so
we find out after EXEC_FIRMWARE what is actually supported.
Set target mode exchange count based upon whether or not
we are supporting simultaneous target/initiator mode. Clean
up some old (pre-24XX) xfwoption and zfwoption issues.

Sponsored by: Spectralogic
MFC after: 3 days


# ad0ab753 17-Jun-2012 Matt Jacob <mjacob@FreeBSD.org>

Prepare for FC-Tape support. This involved doing a lot of little cleanups
and crosschecks against firmware documentation. We now check and report
FC firmware attributes and at least are now prepared for the upper 48 bits
of f/w attributes (which are probably for the 8100 or later cards). This
involed changing how inbits and outbits are calculated for varios commands,
hopefully clearer and cleaner. This also caused me to clean up the actual
mailbox register usage. Finally, we are now unconditionally using a CRN
for initiator mode.

A longstanding issue with the 2400/2500 is that they do *not* support
a "Prefer PTP followed by loop", which explains why enabling that
caused the f/w to crash.

A slightly more invasive change is to let the firmware load entirely
drive whether multi_id support is enabled or not.

Sponsored by: Spectralogic
MFC after: 1 week


# e2873b76 01-Jun-2012 Matt Jacob <mjacob@FreeBSD.org>

Clean up and complete the incomplete deferred enable code.
Make the default role NONE if target mode is selected. This
allows ctl(8) to switch to/from target mode via knob settings.
If we default to role 'none', this causes a reset of the
24XX f/w which then causes initiators to wake up and notice
when we come online.

Reviewed by: kdm
MFC after: 2 weeks
Sponsored by: Spectralogic


# 10e777b0 21-Feb-2012 Kevin Lo <kevlo@FreeBSD.org>

Fix memset sizeof


# f6683e55 27-Dec-2011 Matt Jacob <mjacob@FreeBSD.org>

Fix target mode compilation issues that arose after a change
in the sense data structures.

MFC after: 1 week


# a0ec8e99 05-Nov-2011 Matt Jacob <mjacob@FreeBSD.org>

Implement the sysctl's for fibre channel that are listed in the man page.

MFC after: 3 days


# 50e66535 07-Oct-2011 Marius Strobl <marius@FreeBSD.org>

Sync with ahc(4)/ahd(4)/sym(4) etc:
Zero any sense not transferred by the device as the SCSI specification
mandates that any untransferred data should be assumed to be zero.

Reviewed by: ken


# 1cc052e8 03-Oct-2011 Kenneth D. Merry <ken@FreeBSD.org>

Add descriptor sense support to CAM, and honor sense residuals properly in
CAM.

Desriptor sense is a new sense data format that originated in SPC-3. Among
other things, it allows for an 8-byte info field, which is necessary to
pass back block numbers larger than 4 bytes.

This change adds a number of new functions to scsi_all.c (and therefore
libcam) that abstract out most access to sense data.

This includes a bump of CAM_VERSION, because the CCB ABI has changed.
Userland programs that use the CAM pass(4) driver will need to be
recompiled.

camcontrol.c: Change uses of scsi_extract_sense() to use
scsi_extract_sense_len().

Use scsi_get_sks() instead of accessing sense key specific
data directly.

scsi_modes: Update the control mode page to the latest version (SPC-4).

scsi_cmds.c,
scsi_target.c: Change references to struct scsi_sense_data to struct
scsi_sense_data_fixed. This should be changed to allow the
user to specify fixed or descriptor sense, and then use
scsi_set_sense_data() to build the sense data.

ps3cdrom.c: Use scsi_set_sense_data() instead of setting sense data
manually.

cam_periph.c: Use scsi_extract_sense_len() instead of using
scsi_extract_sense() or accessing sense data directly.

cam_ccb.h: Bump the CAM_VERSION from 0x15 to 0x16. The change of
struct scsi_sense_data from 32 to 252 bytes changes the
size of struct ccb_scsiio, but not the size of union ccb.
So the version must be bumped to prevent structure
mis-matches.

scsi_all.h: Lots of updated SCSI sense data and other structures.

Add function prototypes for the new sense data functions.

Take out the inline implementation of scsi_extract_sense().
It is now too large to put in a header file.

Add macros to calculate whether fields are present and
filled in fixed and descriptor sense data

scsi_all.c: In scsi_op_desc(), allow the user to pass in NULL inquiry
data, and we'll assume a direct access device in that case.

Changed the SCSI RESERVED sense key name and description
to COMPLETED, as it is now defined in the spec.

Change the error recovery action for a number of read errors
to prevent lots of retries when the drive has said that the
block isn't accessible. This speeds up reconstruction of
the block by any RAID software running on top of the drive
(e.g. ZFS).

In scsi_sense_desc(), allow for invalid sense key numbers.
This allows calling this routine without checking the input
values first.

Change scsi_error_action() to use scsi_extract_sense_len(),
and handle things when invalid asc/ascq values are
encountered.

Add a new routine, scsi_desc_iterate(), that will call the
supplied function for every descriptor in descriptor format
sense data.

Add scsi_set_sense_data(), and scsi_set_sense_data_va(),
which build descriptor and fixed format sense data. They
currently default to fixed format sense data.

Add a number of scsi_get_*() functions, which get different
types of sense data fields from either fixed or descriptor
format sense data, if the data is present.

Add a number of scsi_*_sbuf() functions, which print
formatted versions of various sense data fields. These
functions work for either fixed or descriptor sense.

Add a number of scsi_sense_*_sbuf() functions, which have a
standard calling interface and print the indicated field.
These functions take descriptors only.

Add scsi_sense_desc_sbuf(), which will print a formatted
version of the given sense descriptor.

Pull out a majority of the scsi_sense_sbuf() function and
put it into scsi_sense_only_sbuf(). This allows callers
that don't use struct ccb_scsiio to easily utilize the
printing routines. Revamp that function to handle
descriptor sense and use the new sense fetching and
printing routines.

Move scsi_extract_sense() into scsi_all.c, and implement it
in terms of the new function, scsi_extract_sense_len().
The _len() version takes a length (which should be the
sense length - residual) and can indicate which fields are
present and valid in the sense data.

Add a couple of new scsi_get_*() routines to get the sense
key, asc, and ascq only.

mly.c: Rename struct scsi_sense_data to struct
scsi_sense_data_fixed.

sbp_targ.c: Use the new sense fetching routines to get sense data
instead of accessing it directly.

sbp.c: Change the firewire/SCSI sense data transformation code to
use struct scsi_sense_data_fixed instead of struct
scsi_sense_data. This should be changed later to use
scsi_set_sense_data().

ciss.c: Calculate the sense residual properly. Use
scsi_get_sense_key() to fetch the sense key.

mps_sas.c,
mpt_cam.c: Set the sense residual properly.

iir.c: Use scsi_set_sense_data() instead of building sense data by
hand.

iscsi_subr.c: Use scsi_extract_sense_len() instead of grabbing sense data
directly.

umass.c: Use scsi_set_sense_data() to build sense data.

Grab the sense key using scsi_get_sense_key().

Calculate the sense residual properly.

isp_freebsd.h: Use scsi_get_*() routines to grab asc, ascq, and sense key
values.

Calculate and set the sense residual.

MFC after: 3 days
Sponsored by: Spectra Logic Corporation


# e95725cb 13-Aug-2011 Matt Jacob <mjacob@FreeBSD.org>

Most of these changes to isp are to allow for isp.ko unloading.
We also revive loop down freezes. We also externaliz within isp
isp_prt_endcmd so something outside the core module can print
something about a command completing. Also some work in progress to
assist in handling timed out commands better.

Partially Sponsored by: Panasas
Approved by: re (kib)
MFC after: 1 month


# de461933 12-Aug-2011 Matt Jacob <mjacob@FreeBSD.org>

Fixes zombie device and loop down timers so that they work more than
once. Use taskqueues to do the actual work.

Fix an offset line.

Fix isp_prt so that prints from just one buffer, which makes it
appear cleanly cleanly in logs on SMP systems.

Approved by: re (kib)
MFC after: 1 month


# 1d05c651 04-Mar-2011 Matt Jacob <mjacob@FreeBSD.org>

Flush both reads *and* writes to registers.

Obtained from: Miod Vallat in OpenBSD
MFC after: 1 week


# 898899d9 28-Feb-2011 Matt Jacob <mjacob@FreeBSD.org>

Sync FreeBSD ISP with mercurial tree. Minor changes having to do with
a macro for minima.


# 37bb79f1 14-Feb-2011 Marius Strobl <marius@FreeBSD.org>

- Use the correct DMA tag/map pair for synchronize the FC scratch area.
- Allocate coherent DMA memory for the request/response queue area and
and the FC scratch area.

These changes allow isp(4) to work properly on sparc64 with usage of the
IOMMU streaming buffers enabled.

Approved by: mjacob
MFC after: 2 weeks


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fbcd5da2 24-Apr-2010 Matt Jacob <mjacob@FreeBSD.org>

This is an MFC of 205236

Put gone device timer into a structure tag that can hold more than 32 seconds. Oops.

Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM
or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've
turned off autologin and find them, or rather don't, via camcontrol rescan.


# 59a8fbd2 05-Apr-2010 Matt Jacob <mjacob@FreeBSD.org>

This is an MFC of 205698

Clean up some printing stuff so that we can have a bit finer control
on debug output. Add a new platform function requirement to allow
for printing based upon the ITL nexus instead of the isp unit plus
channel, target and lun. This allows some printouts and error messages
from the core code to appear in the same format as the platform's
subsystem (in FreeBSD's case, CAM path).


# 670508b1 26-Mar-2010 Matt Jacob <mjacob@FreeBSD.org>

Clean up some printing stuff so that we can have a bit finer control
on debug output. Add a new platform function requirement to allow
for printing based upon the ITL nexus instead of the isp unit plus
channel, target and lun. This allows some printouts and error messages
from the core code to appear in the same format as the platform's
subsystem (in FreeBSD's case, CAM path).

MFC after: 1 week


# 4ecb1d4a 16-Mar-2010 Matt Jacob <mjacob@FreeBSD.org>

Put gone device timer into a structure tag that can hold more than 32 seconds. Oops.

Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM
or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've
turned off autologin and find them, or rather don't, via camcontrol rescan.

MFC after: 1 month


# 7733cf8f 11-Feb-2010 Matt Jacob <mjacob@FreeBSD.org>

MFC a number of changes from head for ISP (203478,203463,203444,202418,201758,
201408,201325,200089,198822,197373,197372,197214,196162). Since one of those
changes was a semicolon cleanup from somebody else, this touches a lot more.


# a01f5aeb 03-Dec-2009 Matt Jacob <mjacob@FreeBSD.org>

Fix cases where we've managed to get a Loop UP event prior to initializing
the loop down counter, as well as other things. This was brought to my
attention with a different fix, more for RELENG_7- this one covers the
multiple channel case.

PR: 140438
MFC after: 1 month


# 2df76c16 31-Jul-2009 Matt Jacob <mjacob@FreeBSD.org>

Add 8Gb support (isp_2500). Fix a fair number of configuration and
firmware loading bugs.

Target mode support has received some serious attention to make it
more usable and stable.

Some backward compatible additions to CAM have been made that make
target mode async events easier to deal with have also been put
into place.

Further refinement and better support for NP-IV (N-port Virtualization)
is now in place.

Code for release prior to RELENG_7 has been stripped away for code clarity.

Sponsored by: Copan Systems

Reviewed by: scottl, ken, jung-uk kim
Approved by: re


# 52c9ce25 10-Jul-2009 Scott Long <scottl@FreeBSD.org>

Separate the parallel scsi knowledge out of the core of the XPT, and
modularize it so that new transports can be created.

Add a transport for SATA

Add a periph+protocol layer for ATA

Add a driver for AHCI-compliant hardware.

Add a maxio field to CAM so that drivers can advertise their max
I/O capability. Modify various drivers so that they are insulated
from the value of MAXPHYS.

The new ATA/SATA code supports AHCI-compliant hardware, and will override
the classic ATA driver if it is loaded as a module at boot time or compiled
into the kernel. The stack now support NCQ (tagged queueing) for increased
performance on modern SATA drives. It also supports port multipliers.

ATA drives are accessed via 'ada' device nodes. ATAPI drives are
accessed via 'cd' device nodes. They can all be enumerated and manipulated
via camcontrol, just like SCSI drives. SCSI commands are not translated to
their ATA equivalents; ATA native commands are used throughout the entire
stack, including camcontrol. See the camcontrol manpage for further
details. Testing this code may require that you update your fstab, and
possibly modify your BIOS to enable AHCI functionality, if available.

This code is very experimental at the moment. The userland ABI/API has
changed, so applications will need to be recompiled. It may change
further in the near future. The 'ada' device name may also change as
more infrastructure is completed in this project. The goal is to
eventually put all CAM busses and devices until newbus, allowing for
interesting topology and management options.

Few functional changes will be seen with existing SCSI/SAS/FC drivers,
though the userland ABI has still changed. In the future, transports
specific modules for SAS and FC may appear in order to better support
the topologies and capabilities of these technologies.

The modularization of CAM and the addition of the ATA/SATA modules is
meant to break CAM out of the mold of being specific to SCSI, letting it
grow to be a framework for arbitrary transports and protocols. It also
allows drivers to be written to support discrete hardware without
jeopardizing the stability of non-related hardware. While only an AHCI
driver is provided now, a Silicon Image driver is also in the works.
Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware
is possible and encouraged. Help with new transports is also encouraged.

Submitted by: scottl, mav
Approved by: re


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 8553cd62 27-Aug-2007 Jung-uk Kim <jkim@FreeBSD.org>

Fix off-by-two errors.
Both WWNN and WWPN are 64-bit unsigned integers and they are prefixed
with "0x", which requires two more bytes each.

Submitted by: Danny Braniss (danny at cs dot huji dot ac dot il)
via Matthew Jacob (lydianconcepts at gmail dot com)
Approved by: re (bmah)
MFC after: 3 days


# 4607e8ee 02-Jul-2007 Matt Jacob <mjacob@FreeBSD.org>

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


# 0a70657f 05-May-2007 Matt Jacob <mjacob@FreeBSD.org>

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


# 9a1b0d43 01-Apr-2007 Matt Jacob <mjacob@FreeBSD.org>

Temporarily desupport simultaneous target and initiator mode.

When the linux port changes were imported which split the
target command list to be separate from the initiator command
list and the handle format changed to encode a type in the handle
the implications to the function isp_handle_index (which only
the NetBSD/OpenBSD/FreeBSD ports use) were overlooked.

The fault is twofold: first, the index into the DMA maps
in isp_pci is wrong because a target command handle with
the type bit left in place caused a bad index (and panic)
into dma map. Secondly, the assumption of the array
of DMA maps in either PCS or SBUS attachment structures is
that there is a linear mapping between handle index and
DMA map index. This can no longer be true if there are
overlapping index spaces for initiator mode and target
mode commands.

These changes bandaid around the problem by forcing us
to not have simultaneous dual roles and doing the appropriate
masking to make sure things are indexed correctly. A longer
term fix is being devloped.


# 9f9e9ae3 31-Mar-2007 Matt Jacob <mjacob@FreeBSD.org>

Fix compilation problem (add a const) for pre-7.0 compiles.


# 6a7d12e1 13-Mar-2007 Matt Jacob <mjacob@FreeBSD.org>

Move bus_space_tag and bus_space_handle register access
tokens into the common isp_osinfo structure instead of being
in bus specific structures. This allows us to implement
a SYNC_REG MEMORYBARRIER call (using bus_space_barrier)
and also reduce the amount of bus specific wrapper structure
usages in isp_pci && isp_sbus.

MFC after: 3 days


# 70273f90 11-Mar-2007 Matt Jacob <mjacob@FreeBSD.org>

Fix compilation issues found in RELENG_4 port and merge the
diffs back to -current to keep versions identical.


# 5f538376 23-Feb-2007 Matt Jacob <mjacob@FreeBSD.org>

Redo previous newbus related change to be kinder to
multi-release support.


# 33d54970 15-Feb-2007 Luigi Rizzo <luigi@FreeBSD.org>

Cleanup and document the implementation of firmware(9) based on
a version that i posted earlier on the -current mailing list,
and subsequent feedback received.

The core of the change is just in sys/firmware.h and kern/subr_firmware.c,
while other files are just adaptation of the clients to the ABI change
(const-ification of some parameters and hiding of internal info,
so this is fully compatible at the binary level).

In detail:
- reduce the amount of information exported to clients in struct firmware,
and constify the pointer;

- internally, document and simplify the implementation of the various
functions, and make sure error conditions are dealt with properly.

The diffs are large, but the code is really straightforward now (i hope).

Note also that there is a subtle issue with the implementation of
firmware_register(): currently, as in the previous version, we just
store a reference to the 'imagename' argument, but we should rather
copy it because there is no guarantee that this is a static string.
I realised this while testing this code, but i prefer to fix it in
a later commit -- there is no regression with respect to the past.

Note, too, that the version in RELENG_6 has various bugs including
missing locks around the module release calls, mishandling of modules
loaded by /boot/loader, and so on, so an MFC is absolutely necessary
there. I was just postponing it until this cleanup to avoid doing
things twice.

MFC after: 1 week


# f9734398 22-Jan-2007 Matt Jacob <mjacob@FreeBSD.org>

Clean up some of the various platform and release specific dma tag
stuff so it is centralized in isp_freebsd.h.

Take out PCI posting flushed in qla2100/2200 register reads except for
2100s.


# 6c81a0ae 19-Jan-2007 Matt Jacob <mjacob@FreeBSD.org>

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.


# d4c8377f 05-Jan-2007 Matt Jacob <mjacob@FreeBSD.org>

RELENG_6 compilation


# f7c631bc 14-Nov-2006 Matt Jacob <mjacob@FreeBSD.org>

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).


# 10365e5a 01-Nov-2006 Matt Jacob <mjacob@FreeBSD.org>

Add 4Gb (24XX) support and lay the foundation for a lot of new stuff.


# 9311717d 25-Sep-2006 Matt Jacob <mjacob@FreeBSD.org>

Begin the process of moving info to sysctl stuff for FreeBSD
by providing OIDs for WWNN/WWPN and Initiator ID.


# 8070de63 31-Aug-2006 Matt Jacob <mjacob@FreeBSD.org>

More ispfwfunc definitions funnies which break pre-7.0 builds.


# 9a5af410 09-Jul-2006 Matt Jacob <mjacob@FreeBSD.org>

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


# 9b58ff96 03-Jun-2006 Matt Jacob <mjacob@FreeBSD.org>

allow this to compile cleanly under RELENG_4


# 8f725bae 22-May-2006 Matt Jacob <mjacob@FreeBSD.org>

remove bzero/bcopy vestiges


# 452de53a 16-May-2006 Matt Jacob <mjacob@FreeBSD.org>

Move a define depending on __FreeBSD_versoin to after where it
would be defined.

Submitted by: Ruslan Ermilov


# c40da00c 16-May-2006 Poul-Henning Kamp <phk@FreeBSD.org>

Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.


# 9cd7268e 21-Apr-2006 Matt Jacob <mjacob@FreeBSD.org>

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.


# 1dae40eb 14-Feb-2006 Matt Jacob <mjacob@FreeBSD.org>

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


# 51effc8c 04-Feb-2006 Matt Jacob <mjacob@FreeBSD.org>

Actually, no, I had it wrong in 1.109. The arguments to bus_dma_create_tag
are bus_addr_t, not bus_size_t.

In any case, turn off DAC support entirely until it is revamped to actually
work *correctly* for 64 bit platforms (not using a PAE definition and for
both initiator and target mode).


# 53af7d22 02-Feb-2006 Matt Jacob <mjacob@FreeBSD.org>

Remove use of inlines and use the functions as a library.

Larger code space, possibly performance hit, but more portable.
Certainly less questionable use of inlining.

Suggested by: des


# 09ae127f 26-Jan-2006 Matt Jacob <mjacob@FreeBSD.org>

Hackamatic: turn off target mode on Sparc64 with KLD_MODULE- this triggers
a compiler error I have no idea what its about.

This should unbreak tinderbox for now.


# e5265237 22-Jan-2006 Matt Jacob <mjacob@FreeBSD.org>

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


# f4e98881 03-Dec-2005 Ruslan Ermilov <ru@FreeBSD.org>

Fix -Wundef.


# d4fcf3cb 28-May-2005 Yoshihiro Takahashi <nyan@FreeBSD.org>

Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64. The optimization is a trivial on recent machines.

Reviewed by: -arch (imp, marcel, dfr)


# 547725be 10-May-2005 Matt Jacob <mjacob@FreeBSD.org>

Refactor isp_prt declaration so that platform
requirements can stay in platform files.


# 098ca2bd 05-Jan-2005 Warner Losh <imp@FreeBSD.org>

Start each of the license/copyright comments with /*-, minor shuffle of lines


# 69767099 22-Sep-2004 Matt Jacob <mjacob@FreeBSD.org>

PAE support changes that included at least some minimal actual testing
with a kernel that booted.


# c98d7aa4 08-Feb-2004 Matt Jacob <mjacob@FreeBSD.org>

Remove condition variables and status associated with target mode
enabling. Instead, go to an interrupt/polled model.

MFC after: 6 days


# 2cd44270 06-Feb-2004 Matt Jacob <mjacob@FreeBSD.org>

add a count for inotifies as well as atios.

MFC after: 1 week


# 081a1c25 21-Oct-2003 Matt Jacob <mjacob@FreeBSD.org>

Turn off ISP_SMPLOCK- not to be turned on again.

Until we can have perfect knowledge that all callers above us think it's okay
for us to sleep, releasing *our* locks of course, we don't dare try and sleep.


# 4578084a 12-Sep-2003 Matt Jacob <mjacob@FreeBSD.org>

No time like the present to turn back on SMP locking.


# 6ce5711b 22-Sep-2002 Matt Jacob <mjacob@FreeBSD.org>

Remove ISP_DMA_ADDR_T define (see ispvar.h)
Add in commented out:

+/* #define ISP_DAC_SUPPORTED 1 */


# 99b57e40 06-Sep-2002 Matt Jacob <mjacob@FreeBSD.org>

Remove STRNCAT (==>strncat) usage. Apparently I never read the man
page correctly and it wasn't doing what I thought it was.

Noticed by: Brooks Davis <brooks@one-eyed-alien.net>


# 162e9893 02-Sep-2002 Matt Jacob <mjacob@FreeBSD.org>

Turn off usage of SMP style locking until we sort out CAM.


# a11af9c9 22-Aug-2002 Matt Jacob <mjacob@FreeBSD.org>

Define ISP_DMA_ADDR_T to be a bus_addr_t, not a u_int32_t.

This is in preparation to completing A64 PCI support.


# 72429e49 25-Jul-2002 Matt Jacob <mjacob@FreeBSD.org>

Make sure that if are in fact using 'full SMP', make the interrupt
flags include INTR_MPSAFE. Put the flags in a common place so that
both isp_sbus && isp_pci DTRT.

In isp_mbxdma setup, drop any locks prior to calling things like
bus_dmatag_create. This gets rid of these obnoxious WITNESS messages
about 'sleeping with locks held' blah blah blah blah blah.


# 73030e03 10-Jul-2002 Matt Jacob <mjacob@FreeBSD.org>

'Support' for ISP SBus cards.

This code does not imply that SBus cards work yet. They hang for me.
But I can't netboot the latest snapshot on my ultra1e, and things
hang at bus_setup_intr time.

Since I'm offline for a while, I thought I'd toss this in in case somebody
else who has a bit better luck wants to fart around with it. Please try
and wait until I get back to check things in.


# f1df0f59 08-Jul-2002 Matt Jacob <mjacob@FreeBSD.org>

Add 2002 to copyright.

Oops; I forgot for previous delta... If we're and FC or ULTRA2 or better
card, we can have a 1024 element request queue instead of 256.

MFC after: 1 week


# fdeb9f2f 08-Jul-2002 Matt Jacob <mjacob@FreeBSD.org>

Add get/set param ioctl support.

Remove sim queue freezes for resource shortages. I've had too many
strange race conditions where I freeze on a resource shortage but
never get unfrozen.

Consolidate the remaining sim queue freeze condition (for loopdown)
into an inline with debug messages that allows us to track problems
at ISP_LOGDEBUG0 level easier. Change a bunch of debug messages about
loop down/up conditions to ISP_LOGDEBUG0 level.

Remove dead isp_relsim code.

Change some internal flag stuff for efficiency.

Complain vociferously if we try and use our FC scratch area while it's
busy being used already (I mean, if we don't have solaris' ability
to sleep as an interrupt thread which would allow us to just use
a p/v semaphore, at least *say* when you've just borked yourself).

Add infrastructure to allow overrides of hard loopid && initiator
id from boot variables.

Fix the usual quota of silly bugs:

+ 'ktmature' needs to be per-instance. Argh.
+ When entering isp_watchdog, set intsok to zero, preserving
old value to restore later. It's not nice to try and sleep
from splsoftclock.
+ Fix tick overflow buglet in checking timeout value.

MFC after: 1 week


# 759981f4 15-Jun-2002 Matt Jacob <mjacob@FreeBSD.org>

Extend private adjunct to ATIO to have both tag lun, and extended state
(so we can, when things get lost, find out who currently is processing
on behalf of this open exchange. Invariably, when things are lost and
wedged, it's CAM).

Keep an atio resource counter locally.

MFC after: 1 week


# a30d4b32 26-Apr-2002 Mike Barcroft <mike@FreeBSD.org>

Move the new byte order function prototypes from <sys/param.h> to
<sys/endian.h>. This puts us in line with NetBSD and OpenBSD.


# 029f13c6 04-Apr-2002 Matt Jacob <mjacob@FreeBSD.org>

Fix bus dma segment count to be based off of MAXPHYS, not BUS_SPACE_MAXSIZE.
Grumble. I've seen better documented architectures out of Redmond.

Redo fabric evaluation to not use GET ALL NEXT (GA_NXT). Switches seem
to be trying to wriggle out of supporting this well. Instead, use
GID_FT to get a list of Port IDs and then use GPN_ID/GNN_ID to find the
port and node wwn. This should make working on fabrics a bit cleaner and
more stable.

This also caused some cleanup of SNS subcommand canonicalization so that
we can actually check for FS_ACC and FS_RJT, and if we get an FS_RJT,
print out the reason and explanation codes.

We'll keep the old GA_NXT method around if people want to uncomment a
controlling definition in ispvar.h.

This also had us clean up ISPASYNC_FABRICDEV to use a local lportdb argument
and to have the caller explicitly say that a device is at the end of the
fabric list.

MFC after: 1 week


# 1923f739 02-Apr-2002 Matt Jacob <mjacob@FreeBSD.org>

Redo stuff for sparc64- primarily fix bus dma implementation. The endian
stuff was right, but the busdma stuff was massively not right.

Didn't really test on ia64 or i386- don't have the former h/w and my
FreeBSD-current disk is unwell right now. Hope that this is okay.

MFC after: 1 week


# e51a25f8 19-Mar-2002 Alfred Perlstein <alfred@FreeBSD.org>

Remove __P.


# 75c1e828 04-Feb-2002 Matt Jacob <mjacob@FreeBSD.org>

+ A variety of 23XX changes:
disable MWI on 2300

based on function code, set an 'isp_port' for the 2312- it's a
separate instance, but the NVRAM is shared, and the second port's
NVRAM is at offset 256.

+ Enable RIO operation for LVD SCSI cards. This makes a *big* difference
as even under reasonable load we get batched completions of about 30
commands at a time on, say, an ISP1080.

+ Do 'continuation' mailbox commands- this allows us to specify a work
area within the softc and 'continue' repeated mailbox commands. This is
more or less on an ad hoc basis and is currently only used for firmware
loading (which f/w now loads substantially faster becuase the calling
thread is only woken when all the f/w words are loaded- not for each
one of the 40000 f/w words that gets loaded).

+ If we're about to return from isp_intr with a 'bogus interrupt' indication,
and we're not a 23XX card, check to see whether the semaphore register is
currently *2* (not *1* as it should be) and whether there's an async completion
sitting in outgoing mailbox0. This seems to capture cases of lost fast posting
and RIO interrupts that the 12160 && 1080 have been known to pump out under
extreme load (extreme, as in > 250 active commands).

+ FC_SCRATCH_ACQUIRE/FC_SCRATCH_RELEASE macros.

+ Endian correct swizzle/unswizzle of an ATIO2 that has a WWPN in it.

MFC after: 1 week


# 4fd13c1b 10-Dec-2001 Matt Jacob <mjacob@FreeBSD.org>

Major restructuring for swizzling to the request queue and unswizzling from
the response queue. Instead of the ad hoc ISP_SWIZZLE_REQUEST, we now have
a complete set of inline functions in isp_inline.h. Each platform is
responsible for providing just one of a set of ISP_IOX_{GET,PUT}{8,16,32}
macros.

The reason this needs to be done is that we need to have a single set of
functions that will work correctly on multiple architectures for both little
and big endian machines. It also needs to work correctly in the case that
we have the request or response queues in memory that has to be treated
specially (e.g., have ddi_dma_sync called on it for Solaris after we update
it or before we read from it). It also has to handle the SBus cards (for
platforms that have them) which, while on a Big Endian machine, do *not*
require *most* of the request/response queue entry fields to be swizzled
or unswizzled.

One thing that falls out of this is that we no longer build requests in the
request queue itself. Instead, we build the request locally (e.g., on the
stack) and then as part of the swizzling operation, copy it to the request
queue entry we've allocated. I thought long and hard about whether this was
too expensive a change to make as it in a lot of cases requires an extra
copy. On balance, the flexbility is worth it. With any luck, the entry that
we build locally stays in a processor writeback cache (after all, it's only
64 bytes) so that the cost of actually flushing it to the memory area that is
the shared queue with the PCI device is not all that expensive. We may examine
this again and try to get clever in the future to try and avoid copies.

Another change that falls out of this is that MEMORYBARRIER should be taken
a lot more seriously. The macro ISP_ADD_REQUEST does a MEMORYBARRIER on the
entry being added. But there had been many other places this had been missing.
It's now very important that it be done.

Additional changes:

Fix a longstanding buglet of sorts. When we get an entry via isp_getrqentry,
the iptr value that gets returned is the value we intend to eventually plug
into the ISP registers as the entry *one past* the last one we've written-
*not* the current entry we're updating. All along we've been calling sync
functions on the wrong index value. Argh. The 'fix' here is to rename all
'iptr' variables as 'nxti' to remember that this is the 'next' pointer-
not the current pointer.

Devote a single bit to mboxbsy- and set aside bits for output mbox registers
that we need to pick up- we can have at least one command which does not
have any defined output registers (MBOX_EXECUTE_FIRMWARE).

MFC after: 2 weeks


# 71793c0d 07-Oct-2001 Matt Jacob <mjacob@FreeBSD.org>

Some patches from Doug for ia64 support- the principle one being the
appropriate cache flush that provides MEMORY_BARRIER in between handoffs
between host && RISC processor for the shared memory request/response
queues.

Submitted by: dfr@nlsystems.com


# 53036e92 30-Sep-2001 Matt Jacob <mjacob@FreeBSD.org>

Begin to implement target mode that for Fibre Channel has a private
per-command component that we *don't* try and pass thru CAM. CAM just
is too risky and too much of a pain- structures get copied, but not
all info of interest can be considered safely transported thru all
consumers (including user space) from the incoming ATIO to the outgoing
CTIO- it's just much safer to have a buddy structure, identified by the
command's tag which *does* make it thru safely.

Pay attention to link speed and report 200MB/s xfer speed for a
23XX card in 2GPs mode.

MFC after: 1 week


# f6a3bcf8 04-Sep-2001 Matt Jacob <mjacob@FreeBSD.org>

I don't know what I was thinking- if I have two separate busses on on
SIM (as is true for the 1280 and the 12160), then I have to have separate
flags && status for *both* busses. *Whap*.

Implement condition variables for coordination with some target mode
events. It's nice to use these and not panic in obscure little places
in the kernel like 'propagate_priority' just because we went to sleep
holding a mutex, or some other absurd thing.

MFC after: 4 weeks


# 126ec864 31-Aug-2001 Matt Jacob <mjacob@FreeBSD.org>

Add 2 Gigabit Fibre Channel support (2300 && 2312 cards). This required
some reworking (and consequent cleanup) of the interrupt service code.

Also begin to start a cleanup of target mode support that will (eventually)
not require more inforamtion routed with the ATIO to come back with the
CTIO other than tag.

MFC after: 4 weeks


# 3910362a 24-Jul-2001 Matt Jacob <mjacob@FreeBSD.org>

Roll minor version. Remove ISP_SMPLOCK nonsense. We're using full locking,
and that's final.

MFC after: 1 week


# 6a23026c 05-Jun-2001 Matt Jacob <mjacob@FreeBSD.org>

Fix botch for state levels. Role minor release. Start adding code for a
'force logout' path.

MFC after: 4 weeks


# 5d571944 28-May-2001 Matt Jacob <mjacob@FreeBSD.org>

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


# 1209134a 04-Apr-2001 Matt Jacob <mjacob@FreeBSD.org>

Roll platform minor.

Change target mode state definitions to be aware of 'channel' (for the
dualbus 1280/12160 cards).


# f34fa851 28-Mar-2001 John Baldwin <jhb@FreeBSD.org>

Catch up to header include changes:
- <sys/mutex.h> now requires <sys/systm.h>
- <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>


# c9a6d60b 28-Feb-2001 Matt Jacob <mjacob@FreeBSD.org>

Go to a default port and default node wwn model. Eliminate isp_name
and isp_unit and just store the device_t, fer gosh sakes.... Include
sys/bus.h for use by isp_pci.c.


# 250bc0aa 10-Feb-2001 Matt Jacob <mjacob@FreeBSD.org>

Roll minor version. Remove ISP2100_FABRIC define (unneeded now).

Comment out usage of ISP_SMPLOCK- I have my doubts that this works sanely
as yet because CAM itself still needs Giant. I *was* dropping my lock
and grabbing Giant when doing the upcall for completion, but this is all
seems ridiculous until CAM is fixed.


# 9ed346ba 08-Feb-2001 Bosko Milekic <bmilekic@FreeBSD.org>

Change and clean the mutex lock interface.

mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)


# fe4a3254 15-Jan-2001 Matt Jacob <mjacob@FreeBSD.org>

Use the isp_lastmbxcmd tag to report timed out mailbox commands.

Arrrggghhhh! Very likely fix 22650 by remembering to, ahem, set
CAM_AUTOSNS_VALID when one has sense data.


# 27d1caa3 08-Jan-2001 Matt Jacob <mjacob@FreeBSD.org>

Up tsleep && poll time for mailbox commands from 2 to 10 seconds. Print
out the mailbox command opcode if the command times out.


# 4081cc88 05-Dec-2000 Matt Jacob <mjacob@FreeBSD.org>

Only call ISP_UNLOCK/ISP_LOCK if isp->isp_osinfo.intsok in USEC_SLEEP.
Add a test against isp->isp_osinfo.islocked prior to trying to see
whether --isp->isp_osinfo.islocked is zero to cause us to unlock
(non-SMPLOCK case).


# e5f2f488 02-Dec-2000 Matt Jacob <mjacob@FreeBSD.org>

Add USEC_SLEEP macro support. Change the location at which we define
ISP_LOCK/ISP_UNLOCK macros.


# 650789cb 24-Oct-2000 Matt Jacob <mjacob@FreeBSD.org>

Get rid of ridiculous ISP_PVS macro. Instead, just set an
ISP_SMPLOCK define based on the previous 5.4 major/minor release
define of PVS- because this allows us to turn it off easier.


# 35e0e5b3 20-Oct-2000 John Baldwin <jhb@FreeBSD.org>

Catch up to moving headers:
- machine/ipl.h -> sys/ipl.h
- machine/mutex.h -> sys/mutex.h


# e92fbe47 17-Oct-2000 Matt Jacob <mjacob@FreeBSD.org>

Roll minor revision- for once we'll use this because.... if revision >= 5.4,
compile time will build in mutex locks, otherwise the old locking (splcam/splx
with a recursion counter) will be compiled in.

We still depend on config_intr_hook to tell us when it's okay to call
msleep instead of polling. It'd be real nice if we could do this early
enough to not hang up a machine struggling with a bad Fibre Channel loop,
but that's still to come.


# e5d4e197 12-Oct-2000 Matt Jacob <mjacob@FreeBSD.org>

Make changes required by change in how default and usable node and port
WWNS are made and used.


# aa57fd6f 21-Sep-2000 Matt Jacob <mjacob@FreeBSD.org>

some copyright cleanups


# b6b6ad2f 27-Aug-2000 Matt Jacob <mjacob@FreeBSD.org>

various fixes


# 18ccaecd 01-Aug-2000 Matt Jacob <mjacob@FreeBSD.org>

Core version 2.0 cleanup/rewrite. Things get rearranged and changed
quite a bit so that all of the ports have a similar set of required
macros/definitions (and in similar places in the isp_<platform>.h
file).

Some new macros/functions added- Mailbox Acquire/Relase macros,
NANOTIME macros, SNPRINTf and STRNCAT. MemoryBarrier beomes
MEMORYBARRIER with much stronger types.


# 910fb4f6 18-Jul-2000 Matt Jacob <mjacob@FreeBSD.org>

The SERVICING_INTERRUPT isn't quite safe yet.


# df9d46b6 03-Jul-2000 Matt Jacob <mjacob@FreeBSD.org>

Add in isp_lock/isp_unlock inlines. Add in an islocked/intsok flag
to isp_osinfo substructure (all in prep for SMP). Define MBOX_WAIT_COMPLETE
and MBOX_NOTIFY_COMPLETE macros so that we can now (temp) use tsleep
to wait for mailbox completion. Requires us to guess whether we're
servicing an interrupt or not- will use intr_nesting_level.

Add local strncat function.


# cc287907 27-Jun-2000 Matt Jacob <mjacob@FreeBSD.org>

Clean up private storage so that we can use the spriv_field0 to
store a bitmask of whether we've set a value into ccb->ccb_h.status,
whether we're in the watchdog routine for this command now, whether
we've set a grace period for this command and whether this command is
actually done.

See comments of rev 1.45 of isp.c for more complete information.


# be44b164 17-Jun-2000 Matt Jacob <mjacob@FreeBSD.org>

Roll platform minor number. Force definition of SCSI_ISP_FABRIC
(we always support fabric now). Remove SCCLUN definition (we always
support SCCLUN now, if we load the f/w). Add typedef definition of an
external firmware fetch function.


# a200278c 08-May-2000 Matt Jacob <mjacob@FreeBSD.org>

roll platform minor


# 05914a3f 20-Apr-2000 Matt Jacob <mjacob@FreeBSD.org>

Add in the now required malloc.h include. I guess somebody
was busy hackin' w/o checking kernel compiles.


# 0b69cead 15-Mar-2000 Matt Jacob <mjacob@FreeBSD.org>

roll platform versions to 5.0


# 66dcc0e9 11-Feb-2000 Matt Jacob <mjacob@FreeBSD.org>

Turn back on fast posting- the code that turns it off (for 1020/1040) is
now in isp.c

Approved: jkh@freebsd.org


# 997f6ab3 21-Jan-2000 Matt Jacob <mjacob@FreeBSD.org>

There seems to be some problems, particularly on alpha, with
FAST POSTING enabled for parallel SCSI. Be sure about things
and disable it for now.


# 40b27503 03-Jan-2000 Matt Jacob <mjacob@FreeBSD.org>

Role platform minor revision. Add in some target mode only
private structure definitions.


# 22e1dc85 15-Dec-1999 Matt Jacob <mjacob@FreeBSD.org>

Add Dual LVD bus (1280) support


# 7e35bc40 02-Dec-1999 Matt Jacob <mjacob@FreeBSD.org>

roll platform minor


# 6db20c31 20-Nov-1999 Matt Jacob <mjacob@FreeBSD.org>

Add storage/access for a default WWN. A miscellaneous tweak or two.


# 67b6f02b 17-Oct-1999 Matt Jacob <mjacob@FreeBSD.org>

Roll platform major && minor (major now tracks FreeBSD major release).
Add in null SWIZZLE definitions. Add in CFGPRINTF define. Change default
debug level to refer to an external isp_debug variable. Remove inline
functions as they're now in isp_inline.h and include that file.


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 1a43c1fc 16-Aug-1999 Matt Jacob <mjacob@FreeBSD.org>

add in SIMQFRZ_TIMED && CMD_RQLATER defines


# 3692397b 05-Jul-1999 Matt Jacob <mjacob@FreeBSD.org>

add 2200 f/w; fix botched define


# b460c5c9 02-Jul-1999 Matt Jacob <mjacob@FreeBSD.org>

Merge defunct isp_freebsd_cam.h into this file. Do some appropriate
changes like rolling minor revision levels and defines where we now
do default WWN seeding in the platform files.


# bb430bf7 10-May-1999 Matt Jacob <mjacob@FreeBSD.org>

Clean up some sprintfs. Add in a SCSI_QFULL an XS_CHANNEL definition
for 2.X versions. Disable fast posting for FC.


# bc3dacd6 03-Apr-1999 Matt Jacob <mjacob@FreeBSD.org>

Fix for pre-CAM kernels (again). Turn back on fast posting.


# 4394c92f 25-Mar-1999 Matt Jacob <mjacob@FreeBSD.org>

Add in 1080 LVD support and some basis also for the 1240. The port database
printout is now enabled.


# 57c801f5 16-Mar-1999 Matt Jacob <mjacob@FreeBSD.org>

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).


# 289b93c0 08-Feb-1999 Matt Jacob <mjacob@FreeBSD.org>

roll internal release tag


# cbf57b47 30-Jan-1999 Matt Jacob <mjacob@FreeBSD.org>

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.


# bff85e29 10-Jan-1999 Matt Jacob <mjacob@FreeBSD.org>

Suggested by bde@freebsd.org- memcpy not necessarily good to use. D'oh- not in
the BSD DKI. Stop being lazy and finish the defines so MEMCPY becomes bzero
for FreeBSD.


# f28c2b3f 09-Jan-1999 Matt Jacob <mjacob@FreeBSD.org>

add MEMZERO portability defines


# c3055363 28-Dec-1998 Matt Jacob <mjacob@FreeBSD.org>

clarify headers;move uninit to outer layer;remove watchdog


# e9c26528 04-Dec-1998 Matt Jacob <mjacob@FreeBSD.org>

compilation fixes from Eklund


# 3dd37e438 17-Sep-1998 Matt Jacob <mjacob@FreeBSD.org>

(requested by gibbs) Remove the SCSI_CAM option (and rework the isp driver
that had depended on it for compilation within or without CAM to use
__FreeBSD_version instead).


# 4d65e73e 17-Sep-1998 Matt Jacob <mjacob@FreeBSD.org>

Roll revision, clean up a comment.


# 478f8a96 15-Sep-1998 Justin T. Gibbs <gibbs@FreeBSD.org>

Update QLogic ISP support for CAM. Add preliminary target mode support.

Submitted by: Matthew Jacob <mjacob@feral.com>


# f05ebe73 24-Apr-1998 Matt Jacob <mjacob@FreeBSD.org>

Oops- osreldate.h is not around like I thought it would be... hmmm.. quick fix to get around this


# 6054c3f6 22-Apr-1998 Matt Jacob <mjacob@FreeBSD.org>

Add support for the Qlogic ISP SCSI && FC/AL Adapters