summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp_pci.c
Commit message (Collapse)AuthorAgeFilesLines
* More for f/w crash dumps (bug fixing and adding ioctl entry pointsmjacob2002-02-181-0/+19
| | | | | | and hints to enable for specific units) MFC after: 1 week
* Hints for WWN are now WWNN and/or WWPN.mjacob2002-02-171-2/+2
| | | | MFC after: 1 week
* + A variety of 23XX changes:mjacob2002-02-041-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Major restructuring for swizzling to the request queue and unswizzling frommjacob2001-12-111-156/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Whups- remember to zero the isr pointer arg.mjacob2001-10-061-1/+3
|
* Respect QLogic's errata- read BIU_ISR even on the 2300mjacob2001-10-061-0/+2
| | | | | | | | | to see if there's an interrupt (avoids PCI parity errors which can occur on the 2312 if you access some registers from the host at the same time the RISC on the 2312 is C accessing them). MFC after: 1 day
* If we're on an interrupt stack, mark things so that we don't trymjacob2001-09-041-10/+11
| | | | | | | | | | and cv_wait for mailbox commands to complete if we start them from here. Fix residuals for target mode such that we only check the residual and set it in the CTIO if this is the last CTIO (when we're sending status). MFC after: 4 weeks
* Add 2 Gigabit Fibre Channel support (2300 && 2312 cards). This requiredmjacob2001-08-311-63/+206
| | | | | | | | | | 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
* Some possibly helpful casts.mjacob2001-07-041-3/+3
|
* Fix warnings:peter2001-06-151-1/+1
| | | | | | 554: passing arg 4 of `resource_string_value' from incompatible pointer type 576: passing arg 4 of `resource_string_value' from incompatible pointer type 593: passing arg 4 of `resource_string_value' from incompatible pointer type
* Spring MegaChange #1.mjacob2001-05-281-33/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---- 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
* Complete some Ansification. Check to make sure, in tdma_mk, that we won'tmjacob2001-04-041-17/+37
| | | | | | | | | | | | | | | | | overflow the request queue. The reason we want to do this is that we now push out completed CTIOs as we complete them- this gets the QLogic working on them quicker. So we need to know whether we can put the entire burrito out before we start. We now support conjoint status with data for the last CTIO for both Fibre Channel and SCSI. Leave the old code in place in case we need to go back (minor 3 line ifdef). Ultra-ultra important- *don't* set rq->req_seg_count for non-data target mode requests in isp_pci_dmasetup. D'oh- this is actually the tag value area for a CTIO. What *was* I thinking? Boy howdy does both aic7xxx and sym get awfully unhappy when on reconnect you give them a constant '1' for a tag value.
* For parallel SCSI, let us now do status with the final CTIO. For the 1080,mjacob2001-03-211-1/+4
| | | | | | | | | | | I was hanging after sending a xfer CTIO and a status CTIO for a non-discon INQUIRY- the xfer CTIO was returned as completed OK, but the status CTIO was dropped on the floor. All the fields looked good. I don't know why it got dropped. But allowing status to go back with data xfer seemed to work. I also noticed that with a non-disconnecting command that the firmware handle in the ATIO is zero- this leads me to believe that the f/w really can only handle one CTIO at a time in the discon case, and it had no idea what to do with the second (status) CTIO.
* more 32 to 16 bit handle conversionsmjacob2001-03-041-2/+2
|
* Switch to using 16 bit handles instead of 32 bit handles.mjacob2001-03-021-31/+36
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Turn on interrupt-entropy harvesting for all/any mass storage devicesmarkm2001-03-011-2/+2
| | | | | | | I could find. I have no doubt missed a couple. Interrupt entropy harvesting is still conditional on the kern.random.sys.harvest_interrupt sysctl.
* Eliminate the use of the getenv_int stuff we'd been using (with a bitmapmjacob2001-03-011-88/+110
| | | | | | | | | | | | | | | | | | | | | | | | | for selecting unit). Instead, use the resource hints mechanism. One unfortunate situation here is that there is no resource_quad_value function- which is what I needed for WWN boot time replacement. Worse- you can't store the hint as just plain hint.isp.0.nodewwn="0x50000000aaaa0001" because this gets interpreted as an int- incorrectly because it can't be converted to an int. I can't even get this as a string. To work around this particular case for nodewwn && portwwn setting, this rather grotesque form will be used: hint.isp.0.nodewwn="w50000000aaaa0001" hint.isp.0.portwwn="w50000000aaaa0002" At the same time, if we have no hinted WWN, set the default WWN (which, btw, gets overridden if the card has valid NVRAM, which is usual) to 0x400000007F000009ull (which translates to NAA == IPv4, 127.0.0.9). Eliminate more printf's and replace them either with device_printf or isp_prt calls.
* Shuffle around how we do isp_disable management- make sure we return 0 somjacob2001-02-111-21/+25
| | | | | | | | | the unit number doesn't get reused. Make sure that if we've compiled for ISP_TARGET_MODE we set the default role to be ISP_ROLE_INITIATOR|ISP_ROLE_TARGET. Do some misc other cleanups.
* Set default adapter role.mjacob2001-01-151-0/+1
|
* add missing length argumentmjacob2001-01-091-1/+1
|
* Set up to do a local interrupt fielding before calling common code-mjacob2000-12-291-8/+27
| | | | allows us to grab lock as we should.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-6/+3
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Remove more printfs and use either isp_prt or device_printf. Remembermjacob2000-12-051-34/+37
| | | | to set ISP_LOGINFO if bootverbose is set.
* Whoops! Forgot to commit this when I committed the other (turnin on locks)mjacob2000-10-251-13/+26
| | | | change. Sorry about that.
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* some copyright cleanupsmjacob2000-09-211-3/+2
|
* Per msmith's request, don't attach to Qlogic 12160 id'd cards that havemjacob2000-09-071-0/+8
| | | | a certain SubVendorID.
* * Completely rewrite the alpha busspace to hide the implementation fromdfr2000-08-281-9/+0
| | | | | | | | | | | | the drivers. * Remove legacy inx/outx support from chipset and replace with macros which call busspace. * Rework pci config accesses to route through the pcib device instead of calling a MD function directly. With these changes it is possible to cleanly support machines which have more than one independantly numbered PCI busses. As a bonus, the new busspace implementation should be measurably faster than the old one.
* remove clause 3 licencemjacob2000-08-271-7/+1
|
* Part of major rewrite for core version 2.0- clarification ofmjacob2000-08-011-99/+106
| | | | | mdvec structure, removal of printf/CFGPRINTF in place of isp_prt calls. Parameterization of RQUEST_QUEUE_LEN/RESULT_QUEUE_LEN.
* Keep interrupts blocked for all of isp_pci_attach. Redo DMA routinesmjacob2000-07-181-78/+161
| | | | for target mode for cleanliness and accuracy.
* Change startup locking. Use new isp_handle_index functionmjacob2000-07-041-20/+16
| | | | for indexing off of handles to get dma maps.
* Clean up firmware load issues and remove darn near all config options.mjacob2000-06-181-95/+43
| | | | | | | | | | | | | | | | | | Force alphas to prefer mem mapping as the default. Basically, we have a pointer to a function which we can call which will return us a pointer to firmware for the card we have. We call this function (if it's non-NULL) with the address of our mdvec f/w pointer. The way this works is that if ispfw (as a module or a static) is loaded, it initializes the pointer in isp_pci, so we can call into to it to fetch a pointer to a f/w set. If ispfw is MOD_UNLOADed, it's retained a pointer to our mdvec f/w pointers, which then get zeroed out so we don't have any references to data that's now gone from kernel memory. Removing the f/w saves ~360KBytes. Alas, there is no autounload mechanism that works for is here.
* Clean up defines for correct 12160/1080 exclusion. Final 4.0.mjacob2000-02-291-3/+3
| | | | approved: JKH
* If the CDB length is greater than 12 for parallel SCSI, ispscsicmd hasmjacob2000-02-151-1/+5
| | | | | | | made the initial queue entry a EXTENDED CMD queue entry, so we have to go straight to continuation segments for any data segments. approved: jkh
* Add in 12160 (Ultra3) support. Redo things to use the newbus code.mjacob2000-02-111-141/+196
| | | | | | Approved: jkh@freebsd.org PR: 16141
* Remove compile warning not seen when compiling with target mode enabled.mjacob2000-01-151-0/+2
|
* Redo FC target mode dma routine to try and generate an extra CTIOmjacob2000-01-151-107/+232
| | | | | in the not so odd case of Moving Data *AND* Sending Status in last CTIO *AND* status is a CHECK CONDITION *AND* we have Sense Data to send.
* Add in an isp_tdebug environment variable. Clean up some debuggingmjacob2000-01-041-10/+65
| | | | printouts for clarity.
* Support target mode operations. This involves having some variantmjacob2000-01-031-45/+350
| | | | | | dma mapping callback routines to select from as target mode entries are handled a fair bit differently from normal initiator mode entries.
* Add Dual LVD bus (1280) supportmjacob1999-12-161-12/+41
|
* Fix dmasetup functions to have 16 bit queue indices. Get the chip revisionmjacob1999-11-211-28/+40
| | | | | | out of the PCI CLASS reg and store it in the softc. Use the getenv_quad function to get a WWN override from the environment. Look for a config value for same. Make slightly less lame the wwn seed construction.
* Remove calls to alpha_register_pci_scsi(). After Mike's recent bootgallatin1999-11-051-6/+0
| | | | | | changes, it no longer exists and is preventing alpha kernels from building. reviewed by: msmith
* Organize things to cope with the (possible) lack of downloadablemjacob1999-10-301-11/+27
| | | | firmware a bit better.
* Add in inclusion of machine/md_var.h (so alpha_scsi_bus_register or whatmjacob1999-10-171-22/+59
| | | | | | | have you is prototyped). Removed code versions in md struct- not used any more. Allocate transfer dma maps and xflist stuff in mbxdmasetup based upon isp->isp_maxcmds. Allow for multiple calls to mbxdmasetup (for isp_reset cases).
* remove unnecessary includesmjacob1999-10-111-3/+0
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Cast pointers to uintptr_t instead of casting them to u_long, and/or vicebde1999-08-241-2/+2
| | | | versa. Cosmetic.
* Set some correct return values. Prefer I/O map all the time unless configuredmjacob1999-08-161-13/+20
| | | | otherwise.
* Properly set the alignment argument to bus_dma_tag_create(). If wegibbs1999-08-161-2/+2
| | | | don't care about the alignment, set it to 1, meaning single byte alignment.
OpenPOWER on IntegriCloud