summaryrefslogtreecommitdiff
path: root/sys/dev/isp/isp_inline.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove use of inlines and use the functions as a library.Matt Jacob2006-02-021-1854/+0
| | | | | | | | | | Larger code space, possibly performance hit, but more portable. Certainly less questionable use of inlining. Suggested by: des Notes: svn path=/head/; revision=155228
* First of several commits as this driver is dusted off and maybe broughtMatt Jacob2006-01-231-3/+296
| | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=154704
* Fix some incorrectly swapped fields in an ICB.Matt Jacob2005-05-111-15/+35
| | | | | | | | | Access a PCI register with correct width. Obtained from: Dmitry Valeryevich Trikoz Notes: svn path=/head/; revision=146080
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139749
* Store the target handles in a separate list from normal commands. Add aNate Lawson2004-05-241-4/+61
| | | | | | | | | CTIO fast post routine to handle CTIO completions. Submitted by: mjacob Notes: svn path=/head/; revision=129643
* Some canonicalization function cleanups based upon some target modeMatt Jacob2003-09-131-13/+2
| | | | | | | structure cleanups. Notes: svn path=/head/; revision=120015
* Fix buglet in A64 CTIO3 structure copy.Matt Jacob2002-09-231-1/+1
| | | | Notes: svn path=/head/; revision=103821
* 'Support' for ISP SBus cards.Matt Jacob2002-07-111-0/+1
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=99756
* Force commit (last CVS comment was wrong).Matt Jacob2002-06-161-1/+0
| | | | | | | | Go back to *not* fully evaluating loop/fabric state if our role is ISP_ROLE_NONE. Notes: svn path=/head/; revision=98287
* Add ISP_FC_GETHINFO ioctl.Matt Jacob2002-06-161-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=98286
* Scale back # of luns supported for SCC to 16384- oops- top 3 bits are aMatt Jacob2002-04-161-0/+15
| | | | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=94867
* Send 32 bytes out for fc4_types... Interestingly enough the Solaris/SparcMatt Jacob2002-04-051-1/+1
| | | | | | | | | version worked fine, but Linux/Sparc && FreeBSD/Sparc choked. MFC after: 1 week Notes: svn path=/head/; revision=93849
* Fix bus dma segment count to be based off of MAXPHYS, not BUS_SPACE_MAXSIZE.Matt Jacob2002-04-041-7/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=93837
* + A variety of 23XX changes:Matt Jacob2002-02-041-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=90224
* Add missing move of relative offset for CTIO2 updates.Matt Jacob2002-01-111-0/+1
| | | | Notes: svn path=/head/; revision=89274
* Implement REDUCED INTERRUPT OPERATION usage form FC cards- this allows theMatt Jacob2002-01-031-1/+19
| | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=88855
* Explicitly decode GetAllNext SNS Response back *as*Matt Jacob2001-12-111-0/+55
| | | | | | | | | | a GetAllNext response. Otherwise, we won't unswizzle it correctly. This was found on linux/PPC. This mandated creating another inline: isp_get_gan_response. Notes: svn path=/head/; revision=87671
* Major restructuring for swizzling to the request queue and unswizzling fromMatt Jacob2001-12-111-0/+1048
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=87635
* Macroize request/response in/out queue pointer access.Matt Jacob2001-07-041-1/+1
| | | | Notes: svn path=/head/; revision=79240
* In order to save ourselves grief with the SUNPRO compiler underMatt Jacob2001-03-141-59/+21
| | | | | | | | | Solaris (which, for reasons unknown to me, chokes on u_int16_t as a typedef of unsigned short if used in a transitional (mixed K&R and ANSI) way), we'll go the extra mile and fully ANSIfy things. Notes: svn path=/head/; revision=74229
* Switch to using 16 bit handles instead of 32 bit handles.Matt Jacob2001-03-021-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a pretty invasive change, but there are three good reasons to do this: 1. We'll never have > 16 bits of handle. 2. We can (eventually) enable the RIO (Reduced Interrupt Operation) bits which return multiple completing 16 bit handles in mailbox registers. 3. The !)$*)$*~)@$*~)$* Qlogic target mode for parallel SCSI spec changed such that at_reserved (which was 32 bits) was split into two pieces- and one of which was a 16 bit handle id that functions like the at_rxid for Fibre Channel (a tag for the f/w to correlate CTIOs with a particular command). Since we had to muck with that and this changed the whole handler architecture, we might as well... Propagate new at_handle on through int ct_fwhandle. Follow implications of changing to 16 bit handles. These above changes at least get Qlogic 1040 cards working in target mode again. 1080/12160 cards don't work yet. In isp.c: Prepare for doing all loop management in outer layers. Notes: svn path=/head/; revision=73319
* Fix isp_print_qentry to print all four lines- it's been broken for months.Matt Jacob2001-03-021-2/+3
| | | | Notes: svn path=/head/; revision=73311
* Add isp_fc_runstate function- this function's purpose is to, in stages,Matt Jacob2001-02-111-0/+54
| | | | | | | | | | | and depending on role, make sure link is up, scan the fabric (if we're connected to a fabric), scan the local loop (if appropriate), merge the results into the local port database then, check once again to make sure we have f/w at FW_READY state and the the loopstate is LOOP_READY. Notes: svn path=/head/; revision=72352
* some copyright cleanupsMatt Jacob2000-09-211-5/+2
| | | | Notes: svn path=/head/; revision=66189
* various fixesMatt Jacob2000-08-271-4/+6
| | | | Notes: svn path=/head/; revision=65140
* Remove isp_prtstst (now in case statement in isp.c). RemoveMatt Jacob2000-08-011-116/+47
| | | | | | | | | | isp2100_fw_statename as an INLINE (now a function in isp.c). Remove isp2100_pdb_statename (unused). Redo all ISP_SCSI_XFER_T as XS_T types. Change all RQUEST_QUEUE_LEN/RESULT_QUEUE_LEN macros to take a parameter. Add isp_print_bytes function. Notes: svn path=/head/; revision=64091
* Fix completely stupid and idiotiuc sprintfs in isp_inline.h withMatt Jacob2000-07-041-36/+19
| | | | | | | with the STRNCAT function. Notes: svn path=/head/; revision=62499
* Add an isp_handle_index function- this is prepatory to loading more intoMatt Jacob2000-06-271-3/+15
| | | | | | | | | | the handle (i.e., generation number), so we will now need a function that will take a handle and return a flat index [ 0 .. maxhandles-1 ] for auxillary routines that need an index to get at buddy store values (like dma maps or xflist pointers). Notes: svn path=/head/; revision=62169
* tighten up printoutMatt Jacob2000-01-151-4/+2
| | | | Notes: svn path=/head/; revision=56002
* oop, use PRINTF not printf in MI codeMatt Jacob2000-01-041-1/+1
| | | | Notes: svn path=/head/; revision=55396
* add isp_print_qentry inline functionMatt Jacob2000-01-031-0/+23
| | | | Notes: svn path=/head/; revision=55365
* clean up sprintf and have buffer that won't overflowMatt Jacob1999-12-031-34/+66
| | | | Notes: svn path=/head/; revision=54058
* Add a isp_getrqentry inline function (that is, find the next availableMatt Jacob1999-11-211-0/+24
| | | | | | | request queue entry if any are left). Notes: svn path=/head/; revision=53488
* Add a file where inline functions for the Qlogic isp cards can go. This reducesMatt Jacob1999-10-171-0/+220
duplication in all the platform specific header files. Notes: svn path=/head/; revision=52342