summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp_pci.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-291-2/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Fix some incorrectly swapped fields in an ICB.mjacob2005-05-111-2/+2
| | | | | | Access a PCI register with correct width. Obtained from: Dmitry Valeryevich Trikoz
* Use BUS_PROBE_DEFAULT for pci probe return valueimp2005-03-051-1/+1
|
* Support the DELL OEM 2312 cards (1077,6312).mjacob2005-01-231-1/+12
| | | | | | Many thanks to Stormweb for making the h/w available for testing. MFC after: 2 days
* PAE support changes that included at least some minimal actual testingmjacob2004-09-231-14/+23
| | | | with a kernel that booted.
* Do the small amount of tweaking to support PAE for at least initiator mode.mjacob2004-09-071-1/+137
| | | | | | | | I was unable to test this as the PAE kernel crashed with a "cannot copy LDT" before coming up. When this gets a bit more testing, I'll fix the PAE conf file to allow isp devices. PR: 59728
* Store the target handles in a separate list from normal commands. Add anjl2004-05-241-0/+21
| | | | | | CTIO fast post routine to handle CTIO completions. Submitted by: mjacob
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-4/+4
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* If we're defined to have a default role for target mode, make itmjacob2004-02-071-5/+4
| | | | | | just ISP_ROLE_TARGET- not both. MFC after: 1 week
* Use __FBSDID().obrien2003-08-241-2/+4
| | | | Also some minor style cleanups.
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Mega busdma API commit.scottl2003-07-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs
* Back out M_* changes, per decision of the TRB.imp2003-02-191-3/+3
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-3/+3
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Make compiles (LINT and/or ISP_TARGET_MODE options) happier by making suremjacob2003-01-021-5/+7
| | | | | | printf type format args and actual args match. Reviewed by: Sam Leffler <sam@errno.com>
* This should enable 10160 support. As best as I can tell, the samemjacob2002-10-111-0/+17
| | | | | | | f/w as 12160 is used, and otherwise, this is just a single channel variant of the 10160. MFC after: 0 days
* Re-specify the bus space creation such that if we have ISP_DAC_SUPPORTEDmjacob2002-09-231-8/+12
| | | | | | | | | | | defined, we set the address space limitation to BUS_SPACE_UNRESTRICTED, otherwise to BUS_SPACE_MAXADDR_32BIT. If we have a 1240, ULTRA2 or better, or an FC card, the boundary limit is BUS_SPACE_UNRESTRICTED and segment limit is BUS_SPACE_MAXADDR_32BIT. The older 1020/1040 cards have boundary and segment limits of BUS_SPACE_MAXADDR_24BIT.
* Fix the incorrect parsing of the Risc2Host isr. For RIO_16,mjacob2002-08-171-1/+13
| | | | | | | | fast posting command completion, and fast post CTIO completion, the upper half of Risc2Host is a copy of mailbox #1- *not* mailbox #0. MFC after: 1 day
* Don't test against default_iid being zero as a test for whether wemjacob2002-07-251-1/+2
| | | | set something- iid 0 is valid.
* Make sure that if are in fact using 'full SMP', make the interruptmjacob2002-07-251-6/+9
| | | | | | | | | 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.
* 'Support' for ISP SBus cards.mjacob2002-07-111-8/+3
| | | | | | | | | | 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.
* Add override so that we can force set our hard loopdid.mjacob2002-07-081-0/+14
| | | | MFC after: 1 week
* Set all 23XX cards as 'touched' (we have trouble, unpredictably, aboutmjacob2002-06-161-241/+73
| | | | | | | | | | running ABOUT FIRMWARE with some that were started by BIOS downloads). Redo CTIO2 dma mapping- use continuation segments instead of multiple CTIO2s. Thanks to Veritas for sponsoring this work (in a different context). MFC after: 1 week
* Fix bus dma segment count to be based off of MAXPHYS, not BUS_SPACE_MAXSIZE.mjacob2002-04-041-11/+4
| | | | | | | | | | | | | | | | | | | | | | | 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
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-1/+1
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Redo stuff for sparc64- primarily fix bus dma implementation. The endianmjacob2002-04-021-133/+108
| | | | | | | | | 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
* 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.
OpenPOWER on IntegriCloud