summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/ispvar.h
Commit message (Collapse)AuthorAgeFilesLines
* Add 8Gb support (isp_2500). Fix a fair number of configuration andmjacob2009-08-011-217/+309
| | | | | | | | | | | | | | | | | | | | | 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
* Recover from some major omissions/problems with the 24XX port.mjacob2007-07-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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
* MFP4: a) Some constification from NetBSD (gcc 4.1.2)mjacob2007-03-221-4/+6
| | | | | | | b) Split default param fetching/setting into scsi and fibre functions and retry the fibre fetch more than once. MFC after: 1 week
* Fix some stupid copyright mistakes that have been there for quite some time.mjacob2007-03-101-24/+26
|
* MFP4: Move default setting to the end of isp_reset instead of themjacob2007-01-201-11/+11
| | | | | | | | | | 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.
* Make ISPCTL_PLOGX find a handle to log into the management servermjacob2006-12-051-3/+8
| | | | | | with- not hope for the best. Change some things which were gated off of 24XX to be gated off of 2K login support. Convert some isp_prt calls to xpt_print calls.
* Make the SAN login/logout stuff more common between different chipsetsmjacob2006-11-181-1/+2
| | | | | | 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.
* Push things closer to path failover by implementing loop down andmjacob2006-11-141-5/+38
| | | | | | | | | | | | | | | | | | | | | | | | | 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).
* Add 4Gb (24XX) support and lay the foundation for a lot of new stuff.mjacob2006-11-021-77/+162
|
* The macro IS_23XX should not mistakenly include 24XX cards.mjacob2006-08-141-1/+2
|
* Do various fixes to support firmware loading for the 2322mjacob2006-07-031-7/+11
| | | | | | | | | | | (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.
* Fix longstanding bug where exec throttle is 16 bits- not 8.mjacob2006-05-221-1/+1
|
* a) clean up some declaration stuff (i.e., make more modern with respectmjacob2006-02-151-158/+134
| | | | | | | | | | | | | | | 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
* Remove use of inlines and use the functions as a library.mjacob2006-02-021-3/+1
| | | | | | | Larger code space, possibly performance hit, but more portable. Certainly less questionable use of inlining. Suggested by: des
* First of several commits as this driver is dusted off and maybe broughtmjacob2006-01-231-20/+22
| | | | | | | | | | | | | | | | | | 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
* Refactor isp_prt declaration so that platformmjacob2005-05-111-5/+7
| | | | requirements can stay in platform files.
* Prefer <sys/cdefs.h>'s __printflike() macro to the recently addedstefanf2005-03-071-5/+1
| | | | | | __GNUCLIKE_ATTRIBUTE_PRINTF. Approved by: mjacob
* netchild's mega-patch to isolate compiler dependencies into a centraljoerg2005-03-021-1/+4
| | | | | | | | | | | | | | | | place. This moves the dependency on GCC's and other compiler's features into the central sys/cdefs.h file, while the individual source files can then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42. By now, GCC and ICC (the Intel compiler) have been actively tested on IA32 platforms by netchild. Extension to other compilers is supposed to be possible, of course. Submitted by: netchild Reviewed by: various developers on arch@, some time ago
* Roll minor number.mjacob2005-01-231-1/+1
| | | | MFC after: 2 weeks
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Store the target handles in a separate list from normal commands. Add anjl2004-05-241-1/+8
| | | | | | CTIO fast post routine to handle CTIO completions. Submitted by: mjacob
* These are changes to allow to use the Intel C/C++ compiler (lang/icc)trhodes2004-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to build the kernel. It doesn't affect the operation if gcc. Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as icc v8 may define __GNUC__ some parts may look strange but are necessary. Additional changes: - in_cksum.[ch]: * use a generic C version instead of the assembly version in the !gcc case (ASM code breaks with the optimizations icc does) -> no bad checksums with an icc compiled kernel Help from: andre, grehan, das Stolen from: alpha version via ppc version The entire checksum code should IMHO be replaced with the DragonFly version (because it isn't guaranteed future revisions of gcc will include similar optimizations) as in: ---snip--- Revision Changes Path 1.12 +1 -0 src/sys/conf/files.i386 1.4 +142 -558 src/sys/i386/i386/in_cksum.c 1.5 +33 -69 src/sys/i386/include/in_cksum.h 1.5 +2 -0 src/sys/netinet/igmp.c 1.6 +0 -1 src/sys/netinet/in.h 1.6 +2 -0 src/sys/netinet/ip_icmp.c 1.4 +3 -4 src/contrib/ipfilter/ip_compat.h 1.3 +1 -2 src/sbin/natd/icmp.c 1.4 +0 -1 src/sbin/natd/natd.c 1.48 +1 -0 src/sys/conf/files 1.2 +0 -1 src/sys/conf/files.amd64 1.13 +0 -1 src/sys/conf/files.i386 1.5 +0 -1 src/sys/conf/files.pc98 1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c 1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h 1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c 1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c 1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c 1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c 1.6 +1 -2 src/sys/netinet/igmp.c 1.4 +158 -116 src/sys/netinet/in_cksum.c 1.6 +1 -1 src/sys/netinet/ip_gre.c 1.7 +1 -2 src/sys/netinet/ip_icmp.c 1.10 +1 -1 src/sys/netinet/ip_input.c 1.10 +1 -2 src/sys/netinet/ip_output.c 1.13 +1 -2 src/sys/netinet/tcp_input.c 1.9 +1 -2 src/sys/netinet/tcp_output.c 1.10 +1 -1 src/sys/netinet/tcp_subr.c 1.10 +1 -1 src/sys/netinet/tcp_syncache.c 1.9 +1 -2 src/sys/netinet/udp_usrreq.c 1.5 +1 -2 src/sys/netinet6/ipsec.c 1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c 1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c 1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c and finally remove sys/i386/i386 in_cksum.c sys/i386/include in_cksum.h ---snip--- - endian.h: * DTRT in C++ mode - quad.h: * we don't use gcc v1 anymore, remove support for it Suggested by: bde (long ago) - assym.h: * avoid zero-length arrays (remove dependency on a gcc specific feature) This change changes the contents of the object file, but as it's only used to generate some values for a header, and the generator knows how to handle this, there's no impact in the gcc case. Explained by: bde Submitted by: Marius Strobl <marius@alchemy.franken.de> - aicasm.c: * minor change to teach it about the way icc spells "-nostdinc" Not approved by: gibbs (no reply to my mail) - bump __FreeBSD_version (lang/icc needs to know about the changes) Incarnations of this patch survive gcc compiles since a loooong time, I use it on my desktop. An icc compiled kernel works since Nov. 2003 (exceptions: snd_* if used as modules), it survives a build of the entire ports collection with icc. Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>. Reviewed by: -arch Submitted by: netchild
* Change role defines so that they better match class 3 service parameters.mjacob2004-02-071-3/+4
| | | | | | Add ISPCTL_GET_PDB isp_control operation. MFC after: 1 week
* NetBSD'er with time on their hands (dma->DMA)mjacob2003-09-131-1/+1
|
* This should enable 10160 support. As best as I can tell, the samemjacob2002-10-111-3/+6
| | | | | | | f/w as 12160 is used, and otherwise, this is just a single channel variant of the 10160. MFC after: 0 days
* Remove ISP_DMA_ADDR_T definition.mjacob2002-09-231-10/+17
| | | | | | | | Instead, based upon whether ISP_DAC_SUPPORTED is defined, typedef isp_dma_addr_t appropriately. If ISP_DAC_SUPPORTRED is defined, the DMA_WD2/DMA_WD3 macros do something useful, else they define to '0'.
* Remove STRNCAT (==>strncat) usage. Apparently I never read the manmjacob2002-09-061-1/+0
| | | | | | page correctly and it wasn't doing what I thought it was. Noticed by: Brooks Davis <brooks@one-eyed-alien.net>
* Add ISPASYNC_FW_DUMPED async event.mjacob2002-08-171-0/+3
| | | | add ISP_FW_NEWER_THAN macro- makes the code easier to read.
* Roll minor version. Add ISPASYNC_FW_RESTARTED async event. Addmjacob2002-06-161-4/+11
| | | | | | DEFAULT_FRAMESIZE && DEFAULT_EXEC_THROTTLE references. MFC after: 1 week
* Fix bus dma segment count to be based off of MAXPHYS, not BUS_SPACE_MAXSIZE.mjacob2002-04-041-3/+11
| | | | | | | | | | | | | | | | | | | | | | | 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
* Redo stuff for sparc64- primarily fix bus dma implementation. The endianmjacob2002-04-021-0/+4
| | | | | | | | | 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
* Limit fabric search to a default 256 entries. This will all go awaymjacob2002-03-211-1/+3
| | | | | | | | | | | | | | | | | | | soon because it's just getting harder and harder to find switches that correctly implement the GET ALL NEXT subcommands for the SNS protocol. Latch up result out pointer and set a busy flag when we're looking at the response queue. This allows for a cleaner way to make sure we don't get multiple CPUs trying to read the same response queue entries. Change how isp_handle_other_response returns values (clarity). Make PORT UNAVAILABLE the same as PORT LOGOUT (force a LIP). Do some formatting changes. MFC after: 0 days
* Add in support firmware crash dumps. Change CFG options to splitmjacob2002-02-171-2/+13
| | | | | | WWN into WWNN and WWPN. MFC after: 1 week
* + A variety of 23XX changes:mjacob2002-02-041-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+10
| | | | | | | | | | | | | | | | | 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-21/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Implement a call to get the actual link data rate (if 23XX) so we canmjacob2001-10-011-1/+3
| | | | | | set whether it's a 2Gps or 1Gps link. MFC after: 1 week
* Add some more firmware revision macros. Add firmware attributes fieldmjacob2001-09-031-1/+7
| | | | | to fcparam structure. MFC after: 4 weeks
* Add 2 Gigabit Fibre Channel support (2300 && 2312 cards). This requiredmjacob2001-08-311-17/+42
| | | | | | | | | | 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
* Fix a spelling error in a comment.mjacob2001-08-161-1/+1
|
* Redo how we manage SCSI device settings- have a 3rd flags (nvram) that recordsmjacob2001-07-301-9/+13
| | | | | | | | | either what's in NVRAM or what the safe defaults would be if we lack NVRAM. Then we rename cur_XXXX to actv_XXXX (these are the currently active settings) and the dev_XXX settings to goal_XXXX (these are the settings which we want cur_XXXX to converge to). Roll core minor.
* Firmware crashes handled in platform specific code (isp_async call).mjacob2001-07-041-3/+5
| | | | Fix longstanding silly buglet that left a hole in the debug log defines.
* Fix botch for state levels. Role minor release. Start adding code for amjacob2001-06-051-6/+7
| | | | | | 'force logout' path. MFC after: 4 weeks
* Spring MegaChange #1.mjacob2001-05-281-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---- 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
* In order to save ourselves grief with the SUNPRO compiler undermjacob2001-03-141-19/+19
| | | | | | 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.
* More 32 to 16 bit handle stuff. Roll core minor version.mjacob2001-03-041-2/+2
|
* Fix a longstanding bug- we had the sense of what bit 14mjacob2001-02-231-1/+9
| | | | | | | | | | | | | | | 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.
* Eliminate ISP2100_FABRIC- we always allow for fabric now. Add anmjacob2001-02-111-19/+86
| | | | | | | | | isp_iid_set/isp_iid for fibre channel- this is because we now fake a port database entry for ourselves. Add the additional loop states between LOOP_PDB_RCVD and LOOP_READY. Change and comment on a wad of Fibre Channel isp_control functions. Change and comment on some of the ISPASYNC Fibre Channel events.
* Add was_fabric_dev/fabric_dev tags to our local FC database structuremjacob2001-01-151-9/+45
| | | | | | | | | | | | | (so we can see rapidly whether something was a fabric device but is now gone). Add a tag which says what role this adapter should take. It can take on the value of None, Target, Initiator or Both. None is useful for warm failover purposes. Remove the ISP_CFG_NOINIT silliness since a role of "None" does this. Add a isp_lastmbxcmd tag to store the opcode for the last mailbox command used.
* ISPASYNC_PDB_CHANGED -> ISPASYNC_LOGGED_INOUT.mjacob2001-01-091-4/+3
|
OpenPOWER on IntegriCloud