summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/ispmbox.h
Commit message (Collapse)AuthorAgeFilesLines
* -----------mjacob2012-07-281-70/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Clean up multi-id mode so it's driven by the f/w loaded,mjacob2012-06-241-3/+18
| | | | | | | | | | | | 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
* Prepare for FC-Tape support. This involved doing a lot of little cleanupsmjacob2012-06-171-3/+10
| | | | | | | | | | | | | | | | | | | | 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
* Revamp the pieces of some of the stuff I forgot to do when shifting tomjacob2010-02-271-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | 32 bit handles. The RIO (reduced interrupt operation) and fast posting for the parallel SCSI cards were all 16 bit handles. Furthermore, target mode parallel SCSI only can have 16 bit handles. Use part of a supplied patch to switch over to using 32 bit handles. Be a bit more conservative here and only do this for parallel SCSI for the 12160 (Ultra3) cards. There were a lot of marginal Ultra2 cards, and, frankly, few are findable now for testing. Fix the target handle routine to only do 16 bit handles for parallel SCSI cards. This is okay because the upper sixteen bits of the new 32 bit handles is a sequence number to help protect against duplicate completions. This would be very unlikely to happen with parallel SCSI target mode, and wasn't present before, so we're no worse off than we used to be. While we're at it, finally split the async mailbox completion handlers into FC and parallel SCSI functions. This makes it much cleaner and easier to figure out what is or isn't a legal async mailbox completion code for different card classes. PR: kern/144250 Submitted partially by: Charles D MFC after: 1 week
* Redo how commands handles are created and managed and implement sequencemjacob2010-02-031-5/+0
| | | | | | | | | | | | numbers and handle types in rational way. This will better protect from (unwittingly) dealing with stale handles/commands. Fix the watchdog timeout code to better protect itself from mistakes. If we run an abort on a putatively timed out command, the command may in fact get completed, so check to make sure the command we're timing it out is still around. If the abort succeeds, btw, the command should get returned via a different path.
* (semiforced commit to add comment missed in last delta)mjacob2009-09-211-0/+1
| | | | | | | | | | Add a maximum response length for FCP RSPNS IUs. Clarify some of the FC option words for setting parameters and try and disable automatic PRLI when in target mode- this should correct some cases of N-port topologies with 23XX cards where we put out an illegal PRLI (in target mode only we're not supposed to put out a PRLI).
* Remove file unused in freebsd.mjacob2009-09-211-0/+26
|
* Add 8Gb support (isp_2500). Fix a fair number of configuration andmjacob2009-08-011-35/+1167
| | | | | | | | | | | | | | | | | | | | | 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
* Fix some stupid copyright mistakes that have been there for quite some time.mjacob2007-03-101-25/+26
|
* Don't attempt to load illegal hard loop addresses intomjacob2007-02-231-1/+1
| | | | | | | | | | | | an ICB. This shows up on card restarts, and usually for 2200-2300 cards. What happens is that we start up, attempting to acquire a hard address. We end up instead being an F-port topology, which reports out a loop id of 0xff (or 0xffff for 2K Login f/w). Then, if we restart, we end up telling the card to go off an acquire this loop address, which the card then rejects. Bah. Compilation fixes from Solaris port.
* Try an experiment with using DMA to load firmware into a 2200- VERIFYmjacob2006-12-171-1/+1
| | | | | | CHECKSUM fails. Oh well, but keep a couple of the changes. Avoid overflow in usec counters when waiting for mailbox completion.
* clarify a comment slightlymjacob2006-12-091-1/+1
|
* Make the SAN login/logout stuff more common between different chipsetsmjacob2006-11-181-0/+35
| | | | | | and provied an isp_control entry point so that the outer layers can do PLOGI/LOGO explicitly. Add MS IOCB support. This completes the cycle for base support for SMI-S.
* Increase the timeout for some SAN commands.mjacob2006-11-161-0/+26
| | | | | | | | | Only complain about FC Reponse errors if they're nonzero. Shorten some PortID printouts for local loop. Add an internal isp_xcmd_t data structure which we'll use for some CT-Passthru support as part of adding SMI-S.
* Add 4Gb (24XX) support and lay the foundation for a lot of new stuff.mjacob2006-11-021-128/+492
|
* Do various fixes to support firmware loading for the 2322mjacob2006-07-031-1/+3
| | | | | | | | | | | (and by extension, the 2422). One peculiar thing I've found with the 2322 is that if you don't force it to do Hard LoopID acquisition, the firmware crashes. This took a while to figure out. While we're at it, fix various bugs having to do with NVRAM reading and option setting with respect to pieces of NVRAM.
* Some more gratuitous format and name changes.mjacob2006-04-211-0/+4
| | | | | | | 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.
* a) clean up some declaration stuff (i.e., make more modern with respectmjacob2006-02-151-246/+246
| | | | | | | | | | | | | | | 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
* First of several commits as this driver is dusted off and maybe broughtmjacob2006-01-231-5/+36
| | | | | | | | | | | | | | | | | | 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
* Add an ioctl framework for doing FC task management functions frommjacob2005-10-291-0/+1
| | | | a user space tool- useful for doing FC target mode certification.
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* add MAKE_WWN_FROM_NODE_NAME macromjacob2004-01-231-0/+10
|
* Add an explanatory comment about what operational modes in xfwopt are.mjacob2003-03-251-1/+5
|
* Add MBOX_INIT_REQ_QUEUE_A64/MBOX_INIT_RES_QUEUE_A64 definitions.mjacob2002-09-231-0/+6
| | | | Define ispreq64_t to be the same as ispreqt3_t.
* Add ICBXOPT_ZIO definition.mjacob2002-08-171-0/+1
|
* Add MBOX_DRIVER_HEARTBEAT/MBOX_FW_HEARTBEAT/FC4_FC_SVC defines.mjacob2002-06-161-0/+4
| | | | MFC after: 1 week
* Scale back # of luns supported for SCC to 16384- oops- top 3 bits are amjacob2002-04-161-0/+6
| | | | | | | | | | | | lun address modifier of sorts. Only an HP XP-512 seems to have cared. Fix a few misplaced pointers for the new fabric goop, which has been demonstrated to work on newer Brocades and McData switches now. Put in commented out code which would run GFF_ID if the QLogic f/w allowed it. Don't whine about not being able to find a handle for a command if it was a command aborted (by us).
* Fix bus dma segment count to be based off of MAXPHYS, not BUS_SPACE_MAXSIZE.mjacob2002-04-041-12/+108
| | | | | | | | | | | | | | | | | | | | | | | 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
* Support for f/w crash dumps (2200 && 23XX).mjacob2002-02-171-1/+1
| | | | | | | | | | | | | If you want QLogic to look at a potential f/w problem for FC cards, you really have to provide them info in the format they expect. This involves dumping a lot of hardware registers (> 300 16 bit registers) and a lot of SRAM (> 128KB minimum). Thus all of this code is #ifdef protected which will become an option so that the memory allocation of where to dump the crash image is pretty expensive. It's worth it if you have a reproducible problem because they have some tools that can tell them, given the f/w version, the precise state of everything. MFC after: 1 week
* + A variety of 23XX changes:mjacob2002-02-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Implement REDUCED INTERRUPT OPERATION usage form FC cards- this allows themjacob2002-01-031-2/+4
| | | | | | | | | | | | | | | | | firmware to delay completion of commands so that it can attempt to batch a bunch of completions at once- either returning 16 bit handles in mailbox registers, or in a resposne queue entry that has a whole wad of 16 bit handles. Distinguish between 2300 and 2312 chipsets- if only because the revisions on the chips have different meanings. Add more instrumentation plus ISP_GET_STATS and ISP_CLR_STATS ioctls. Run up the maximum number of response queue entities we'll look at per interrupt. If we haven't set HBA role yet, always return success from isp_fc_runstate. MFC after: 2 weeks
* Major restructuring for swizzling to the request queue and unswizzling frommjacob2001-12-111-27/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Misunderstanding documentation caused me to try and set 1Gbps/2Gps/Automjacob2001-10-061-3/+3
| | | | | | connection speed for the 2300 in the wrong offset in the ICB. Oops. Respect some QLogic errat wrt PCI errors on certain shared host/RISC registers.
* Implement a call to get the actual link data rate (if 23XX) so we canmjacob2001-10-011-31/+39
| | | | | | set whether it's a 2Gps or 1Gps link. MFC after: 1 week
* Add 2 Gigabit Fibre Channel support (2300 && 2312 cards). This requiredmjacob2001-08-311-9/+36
| | | | | | | | | | 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
* Add MBOX_GET_PCI_PARAMS alias.mjacob2001-08-201-0/+1
| | | | MFC after: 2 weeks
* Add more MBOX and ASYNC event defines.mjacob2001-08-161-0/+4
| | | | MFC after: 2 weeks
* Add a bunch of additional defines for completion codes. Definemjacob2001-07-041-16/+75
| | | | | | | | | | some of the RIO (reduced interrupt operation) stuff. Add 64 bit data list (DSD type 1) and arbitrary data list (DSD type 2) data structure defines. Add macros that parameterize usage of the Request/Response in/out queue pointers. When we finish 2300 support, different registers will be accessed for the 2300.
* Add some target mode definitions and firmware (FC only) attribute definitions.mjacob2001-04-041-0/+13
|
* Fix a longstanding bug- we had the sense of what bit 14mjacob2001-02-231-1/+1
| | | | | | | | | | | | | | | 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.
* Add structure defining FC-AL position maps. The only tool that I know ofmjacob2001-02-111-0/+16
| | | | that really uses this is luxadm(8) under Solaris.
* Add some SNS "Register FC4 type" subcommand defines. Add some definesmjacob2001-01-091-1/+13
| | | | | that are pertinetnt for state flags on Qlogic 2X00 status completion entries.
* some copyright cleanupsmjacob2000-09-211-8/+2
|
* various fixesmjacob2000-08-271-9/+35
|
* Add in macros && masks so that mailbox command errors can bemjacob2000-08-011-0/+3
| | | | selectively printed/supressed in isp_mboxcmd.
* add MBOX_GET_RESOURCE_COUNT commandmjacob2000-06-181-0/+1
|
* Conrrect a macro with parenthesis.mjacob2000-05-091-1/+1
|
* Add in mailbox return codes for failed fabric logins (port_id_used,mjacob2000-02-291-0/+23
| | | | | | | | loop_id_used, etc...) Do a more precise structure for Get All Next name server responses. Approved: jkh
* Add in new async mbox defines for 2200- point to point stuff.mjacob2000-02-111-0/+23
| | | | | | | Add in definitions for the extended initialization control block (2200 only again). Approved: jkh@freebsd.org
* add clarifying tag define for FCmjacob2000-01-041-0/+1
|
OpenPOWER on IntegriCloud