aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/isp/isp_pci.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge r254263:Scott Long2013-08-131-7/+5
| | | | | | | | | | | | | | | | | | | | | | Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Candidate for 9.2 Submitted by: jhb Reviewed by: jfv, marius, adrian, achim Notes: svn path=/stable/9/; revision=254306
* Big MFC of the physbio changes necessary for unmapped I/O. These changesScott Long2013-06-181-62/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | have been in production at Netflix for several months with significant success. MFC r246713: Reform the busdma API so that new types may be added without modifying every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. MFC r249538: Some compilers issue a warning when wider integer is casted to narrow pointer. Supposedly shut down the warning by casting through uintptr_t. MFC r251479: Simplify the checking of flags for cam_periph_mapmem(). This gets rid of a lot of code redundancy and grossness at very minor expense. MFC r251837: MFC r251842: Add infrastructure for doing compatibility shims, as has been sorely needed for the last 10 years. Far too much of the internal API is exposed, and every small adjustment causes applications to stop working. To kick this off, bump the API version to 0x17 as should have been done with r246713, but add shims to compensate. Thanks to the shims, there should be no visible change in application behavior. Submitted by: kib, jeffr Approved by: kib Obtained from: Netflix Notes: svn path=/stable/9/; revision=251874
* MFC 242479,242480: Force segments to 1 for mappingMatt Jacob2012-11-121-3/+2
| | | | | | | control spaces. Notes: svn path=/stable/9/; revision=242920
* MFC of 240219 - remove useless test.Matt Jacob2012-09-211-4/+2
| | | | Notes: svn path=/stable/9/; revision=240769
* MFC of 239502: Remove dependence on MAXPHYS.Matt Jacob2012-09-201-2/+7
| | | | Notes: svn path=/stable/9/; revision=240717
* MFC of 239010Matt Jacob2012-09-021-10/+12
| | | | | | | | Oops. We only do allocate room for extended commands and responses for 2300 cards are newer. Notes: svn path=/stable/9/; revision=240023
* MFC of 239218Matt Jacob2012-09-021-10/+12
| | | | | | | Fix an oops where we wiped out DMA maps... Notes: svn path=/stable/9/; revision=240017
* MFC of 238859Matt Jacob2012-09-021-13/+83
| | | | | | | Mega change for FC-Tape. Notes: svn path=/stable/9/; revision=240015
* MFC of 237537Matt Jacob2012-09-021-14/+8
| | | | | | | Clean up multi-id mode so it's driven by the f/w loaded,... Notes: svn path=/stable/9/; revision=240010
* MFC of 237210Matt Jacob2012-09-021-10/+5
| | | | | | | Prepare for FC-Tape support. Notes: svn path=/stable/9/; revision=240009
* Very belated MFC of 227548Matt Jacob2012-09-021-0/+2
| | | | | | | | | | Was chasing down a failure to load f/w on a 2400. It turns out that the card is actually broken, or needs a BIOS upgrade for 64 bit loads, but this uncovered a couple of misplaced opcode definitions and some missing continual mbox command cases, so might as well update them here. Notes: svn path=/stable/9/; revision=240008
* MFC of 237135Matt Jacob2012-06-171-0/+1
| | | | | | | | | If debug values were set, the default from tval floated down and triggered an attempt to set multiple virtual ports whether you wanted them or not. Notes: svn path=/stable/9/; revision=237209
* MFC r236379:Eitan Adler2012-06-061-0/+2
| | | | | | | | | | Adding missing dependancies for loading hptiop(4), hptmv(4) and isp(4) as modules. PR: kern/166239 Approved by: cperciva (implicit) Notes: svn path=/stable/9/; revision=236655
* Most of these changes to isp are to allow for isp.ko unloading.Matt Jacob2011-08-131-28/+52
| | | | | | | | | | | | | | We also revive loop down freezes. We also externaliz within isp isp_prt_endcmd so something outside the core module can print something about a command completing. Also some work in progress to assist in handling timed out commands better. Partially Sponsored by: Panasas Approved by: re (kib) MFC after: 1 month Notes: svn path=/head/; revision=224856
* Add support QLE220 card- an 2500 lookalike.Matt Jacob2011-03-101-0/+15
| | | | | | | | Obtained mostly from: Roman && Konstantin MFC after: 1 week Notes: svn path=/head/; revision=219471
* - Use the correct DMA tag/map pair for synchronize the FC scratch area.Marius Strobl2011-02-141-16/+16
| | | | | | | | | | | | | | - Allocate coherent DMA memory for the request/response queue area and and the FC scratch area. These changes allow isp(4) to work properly on sparc64 with usage of the IOMMU streaming buffers enabled. Approved by: mjacob MFC after: 2 weeks Notes: svn path=/head/; revision=218691
* Various minor and not so minor fixes suggested by Coverity.Matt Jacob2010-06-021-13/+13
| | | | | | | | | | In at least one case, it's amazing that target mode worked at all. Found by: Coverity. MFC after: 2 weeks Notes: svn path=/head/; revision=208761
* On sparc64 obtain the initiator ID from the Open Firmware device treeMarius Strobl2010-05-031-0/+9
| | | | | | | | | in order to match what the PROM built-in driver uses. Approved by: mjacob Notes: svn path=/head/; revision=207579
* Put gone device timer into a structure tag that can hold more than 32 ↵Matt Jacob2010-03-171-3/+3
| | | | | | | | | | | | | seconds. Oops. Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've turned off autologin and find them, or rather don't, via camcontrol rescan. MFC after: 1 month Notes: svn path=/head/; revision=205236
* Revamp the pieces of some of the stuff I forgot to do when shifting toMatt Jacob2010-02-271-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=204397
* Fix misallocation error in target mode.Matt Jacob2010-02-271-1/+1
| | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=204384
* Redo how commands handles are created and managed and implement sequenceMatt Jacob2010-02-031-4/+12
| | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=203444
* Add 8Gb support (isp_2500). Fix a fair number of configuration andMatt Jacob2009-08-011-1457/+488
| | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=196008
* Pointy hat to me. Committed with building.Matt Jacob2007-06-261-1/+1
| | | | | | | Approved by: re (ken, implicit) Notes: svn path=/head/; revision=171057
* Extension of previous commit- when we have 2k login firmware, we need toMatt Jacob2007-06-261-1/+7
| | | | | | | | | | | put out a ispreqt2e_t structure onto the request queue- not a ispreqt2_t structure. I forgot that the 23XX can use a t2 structure. Approved by: re (ken, implicitly) MFC after: 3 days Notes: svn path=/head/; revision=171051
* Yet another bug- when we have 2k login firmware, we needMatt Jacob2007-06-251-1/+7
| | | | | | | | | | | | to put out a ispreqt3e_t structure onto the request queue- not a ispreqt3_t structure. We weren't. This turns out only to really matter for big endian machines. Approved by: re (ken) MFC after: 3 days Notes: svn path=/head/; revision=171028
* Only try and set a segment lim size to 1 << 32 iff bus_size_t > 4.Matt Jacob2007-06-111-2/+6
| | | | Notes: svn path=/head/; revision=170563
* Fix pointy-hat problem with BUS_DMA_ROOTARG macro that caused problems for ↵Matt Jacob2007-05-111-3/+3
| | | | | | | | | | | sparc64. Candidate for immediate MFC. Noticed by: Everyone-maxim contacted. Notes: svn path=/head/; revision=169459
* Make this an MP safe driver but also still be multi-release.Matt Jacob2007-05-051-135/+99
| | | | | | | | | | | Seems to work on RELENG_4 through -current and also on sparc64 now. There may still be some issues with the auto attach/detach code to sort out. MFC after: 3 days Notes: svn path=/head/; revision=169292
* Temporarily desupport simultaneous target and initiator mode.Matt Jacob2007-04-021-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | When the linux port changes were imported which split the target command list to be separate from the initiator command list and the handle format changed to encode a type in the handle the implications to the function isp_handle_index (which only the NetBSD/OpenBSD/FreeBSD ports use) were overlooked. The fault is twofold: first, the index into the DMA maps in isp_pci is wrong because a target command handle with the type bit left in place caused a bad index (and panic) into dma map. Secondly, the assumption of the array of DMA maps in either PCS or SBUS attachment structures is that there is a linear mapping between handle index and DMA map index. This can no longer be true if there are overlapping index spaces for initiator mode and target mode commands. These changes bandaid around the problem by forcing us to not have simultaneous dual roles and doing the appropriate masking to make sure things are indexed correctly. A longer term fix is being devloped. Notes: svn path=/head/; revision=168240
* MFP4: a) Some constification from NetBSD (gcc 4.1.2)Matt Jacob2007-03-221-6/+1
| | | | | | | | | | b) Split default param fetching/setting into scsi and fibre functions and retry the fibre fetch more than once. MFC after: 1 week Notes: svn path=/head/; revision=167821
* Move bus_space_tag and bus_space_handle register accessMatt Jacob2007-03-131-78/+64
| | | | | | | | | | | | | tokens into the common isp_osinfo structure instead of being in bus specific structures. This allows us to implement a SYNC_REG MEMORYBARRIER call (using bus_space_barrier) and also reduce the amount of bus specific wrapper structure usages in isp_pci && isp_sbus. MFC after: 3 days Notes: svn path=/head/; revision=167501
* Fix compilation issues found in RELENG_4 port and merge theMatt Jacob2007-03-121-1/+3
| | | | | | | diffs back to -current to keep versions identical. Notes: svn path=/head/; revision=167473
* Fix some stupid copyright mistakes that have been there for quite some time.Matt Jacob2007-03-101-2/+0
| | | | Notes: svn path=/head/; revision=167403
* Redo previous newbus related change to be kinder toMatt Jacob2007-02-231-1/+2
| | | | | | | multi-release support. Notes: svn path=/head/; revision=166935
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+1
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* There is a problem in setting/getting 'options'- if we check thingsMatt Jacob2007-02-231-111/+133
| | | | | | | | | | | | | | early, we haven't set board type, so we can't correctly check for some options. Fix this by splitting option setting/getting into generic, pci and then later board specific, option setting/getting. This was noticed when setting 'iid' (or 'hard loop id') didn't work all of a sudden. Noticed by: Mike Drangula (thanks!) via Jung-uk Kim (thanks!) Notes: svn path=/head/; revision=166895
* add a missing piece for 2432Matt Jacob2007-02-101-0/+1
| | | | Notes: svn path=/head/; revision=166615
* Putative untested 2432 (PCI-E) support.Matt Jacob2007-02-101-1/+12
| | | | Notes: svn path=/head/; revision=166614
* Clean up some of the various platform and release specific dma tagMatt Jacob2007-01-231-25/+10
| | | | | | | | | | stuff so it is centralized in isp_freebsd.h. Take out PCI posting flushed in qla2100/2200 register reads except for 2100s. Notes: svn path=/head/; revision=166177
* error print cleanup && turn off ints if RISC is pausedMatt Jacob2007-01-051-1/+2
| | | | Notes: svn path=/head/; revision=165817
* Restore revision 1.126 that got accidentally nuked.Matt Jacob2006-12-181-0/+6
| | | | Notes: svn path=/head/; revision=165338
* Implement ISP_RESET0 for PCI and SBUS attachments- isp_reset hasMatt Jacob2006-12-161-7/+14
| | | | | | | | been modified to call ISP_RESET0 if it fails to do a reset. This gives us a chance to disable interrupts. Notes: svn path=/head/; revision=165269
* Remove dependency on ispfw and firmware as modules.Matt Jacob2006-12-101-4/+1
| | | | | | | | | | | | | | | | | | | | Either they're there early and the ispfw sets have registered themselves, or they're not. The module dependency stuff isn't quite what we want anyway. If the user doesn't want the load placed on system memory by loading the firmware, they don't specify it to be loaded (either by being linked in or via being a module to be loaded and then hooked in with firmware(9)). It doesn't then make sense to then override what they want by pulling it in anyway. This might be able to work if we were able to pull in just exactly what we needed for the card we have- but that's an optimization left for the future. Notes: svn path=/head/; revision=165061
* Make the SAN login/logout stuff more common between different chipsetsMatt Jacob2006-11-181-6/+0
| | | | | | | | | 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. Notes: svn path=/head/; revision=164370
* Disable code to set max read byte count on the 2400.Matt Jacob2006-11-171-0/+6
| | | | | | | | | | It caused a panic in writing the config register on a system. Turn it off until we take the time to understand it. Reported by and Testing by: Anton Notes: svn path=/head/; revision=164361
* Push things closer to path failover by implementing loop down andMatt Jacob2006-11-141-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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). Notes: svn path=/head/; revision=164272
* Add 4Gb (24XX) support and lay the foundation for a lot of new stuff.Matt Jacob2006-11-021-60/+458
| | | | Notes: svn path=/head/; revision=163899
* Restore multi-version cleanliness.Matt Jacob2006-09-031-3/+11
| | | | Notes: svn path=/head/; revision=161932
* add a newbus method for obtaining the bus's bus_dma_tag_t... This isJohn-Mark Gurney2006-09-031-2/+3
| | | | | | | | | | | | | | | | required by arches like sparc64 (not yet implemented) and sun4v where there are seperate IOMMU's for each PCI bus... For all other arches, it will end up returning NULL, which makes it a no-op... Convert a few drivers (the ones we've been working w/ on sun4v) to the new convection... Eventually all drivers will need to replace the parent tag of NULL, w/ bus_get_dma_tag(dev), though dev is usually different for each driver, and will require hand inspection... Reviewed by: scottl (earlier version) Notes: svn path=/head/; revision=161928