aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/isp
Commit message (Collapse)AuthorAgeFilesLines
* Change uses of the struct ccb_hdr timeout_ch missed when isp(4) wasMarius Strobl2009-05-101-2/+3
| | | | | | | | | | | | adapted to MPSAFE cam(4) to a isp(4) specific callout structure. Thanks to Florian Smeets for providing access to a machine exhibiting this problem for debugging. Approved by: mjacob MFC after: 3 days Notes: svn path=/head/; revision=191979
* Don't try reading the SXP_PINS_DIFF on the 10160 and 12160 SCSIMarius Strobl2008-12-151-4/+17
| | | | | | | | | | | | | controllers. Reading this register, for which there are indications that it doesn't really exist, returns 0 on at least some 12160 and doing so on Sun Fire V880 causes a data access error exception. Reported and tested by: Beat Gaetzi Approved by: mjacob Obtained from: OpenBSD (modulo setting isp_lvdmode) Notes: svn path=/head/; revision=186140
* Replace all calls to minor() with dev2unit().Ed Schouten2008-09-271-1/+1
| | | | | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib Notes: svn path=/head/; revision=183397
* Add missing locking for SBus controllers.Scott Long2007-11-051-0/+5
| | | | Notes: svn path=/head/; revision=173359
* Rename the kthread_xxx (e.g. kthread_create()) callsJulian Elischer2007-10-201-2/+2
| | | | | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls. Notes: svn path=/head/; revision=172836
* Spelling fix for interupt -> interruptKevin Lo2007-10-121-2/+2
| | | | Notes: svn path=/head/; revision=172568
* Fix off-by-two errors.Jung-uk Kim2007-08-281-2/+2
| | | | | | | | | | | | | Both WWNN and WWPN are 64-bit unsigned integers and they are prefixed with "0x", which requires two more bytes each. Submitted by: Danny Braniss (danny at cs dot huji dot ac dot il) via Matthew Jacob (lydianconcepts at gmail dot com) Approved by: re (bmah) MFC after: 3 days Notes: svn path=/head/; revision=171997
* Export 4Gbps Fibre Channel link speed correctly with inquiry commands.Jung-uk Kim2007-08-231-9/+8
| | | | | | | | Approved by: re (kensmith) MFC after: 3 days Notes: svn path=/head/; revision=171936
* Get rid of a couple of Coverity found sign comparison errors.Matt Jacob2007-07-101-3/+3
| | | | | | | | Approved by: re (Ken) MFC after: 3 days Notes: svn path=/head/; revision=171337
* Be more conservative- turn off fast posting and RIO for 22XX cards.Matt Jacob2007-07-101-7/+2
| | | | | | | | Approved by: re (ken) MFC after: 3 days Notes: svn path=/head/; revision=171336
* Recover from some major omissions/problems with the 24XX port.Matt Jacob2007-07-024-21/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=171159
* 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
* If we're going to (for 23XX and 24XX cards) DMA firmware from theMatt Jacob2007-06-241-2/+2
| | | | | | | | | | | | | | request queues rather than shove it down a word at a time, we have to remember to put it into little endian format. Use the macros ISP_IOXPUT_{16,32} for this purpose. Otherwise, on sparc the firmware is loaded garbled and we get a (not surprisingly) firmware checksum failure and the card won't start and we don't attach it. Approved by: re (bruce) MFC after: 3 days Notes: svn path=/head/; revision=171014
* Prepare for future integration between CAM and newbus. xpt_bus_registerScott Long2007-06-171-2/+3
| | | | | | | | | | now takes a device_t to be the parent of the bus that is being created. Most SIMs have been updated with a reasonable argument, but a few exceptions just pass NULL for now. This argument isn't used yet and the newbus integration likely won't be ready until after 7.0-RELEASE. Notes: svn path=/head/; revision=170872
* Remove some ioctls that were ill-thought out. There is no userMatt Jacob2007-06-112-128/+14
| | | | | | | | | impact as no softwware using these ioctls was ever committed. Redo locking for ispioctl. Notes: svn path=/head/; revision=170570
* 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
* Quiet GCC 4.2 warning.Matt Jacob2007-06-081-1/+1
| | | | Notes: svn path=/head/; revision=170412
* Temp workaround for config_intrhook_establish running the hookMatt Jacob2007-05-131-0/+3
| | | | | | | right away. Notes: svn path=/head/; revision=169530
* Bad merge.Matt Jacob2007-05-111-1/+1
| | | | Notes: svn path=/head/; revision=169472
* Fix pointy-hat problem with BUS_DMA_ROOTARG macro that caused problems for ↵Matt Jacob2007-05-112-5/+5
| | | | | | | | | | | 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-056-502/+441
| | | | | | | | | | | 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
* Revert a driver API change to xpt_alloc_ccb that isn't necessary. Fix aScott Long2007-04-181-1/+1
| | | | | | | couple of associated error checks. Notes: svn path=/head/; revision=168831
* Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willScott Long2007-04-151-3/+4
| | | | | | | | | | | | | | use to synchornize and protect all data objects that are used for that SIM. Drivers that are not yet MPSAFE register Giant and operate as usual. RIght now, no drivers are MPSAFE, though a few will be changed in the coming week as this work settles down. The driver API has changed, so all CAM drivers will need to be recompiled. The userland API has not changed, so tools like camcontrol do not need to be recompiled. Notes: svn path=/head/; revision=168752
* Temporarily desupport simultaneous target and initiator mode.Matt Jacob2007-04-026-18/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix compilation problem (add a const) for pre-7.0 compiles.Matt Jacob2007-03-311-1/+1
| | | | Notes: svn path=/head/; revision=168160
* some minor error message cleanupsMatt Jacob2007-03-291-4/+4
| | | | Notes: svn path=/head/; revision=168030
* Don't derference a pointer before setting it.Matt Jacob2007-03-281-2/+2
| | | | | | | | | Very Pointy Dunce Cap T o: me. Submitted by: Marcel MFC after: 3 days Notes: svn path=/head/; revision=167992
* MFP4: a) Some constification from NetBSD (gcc 4.1.2)Matt Jacob2007-03-225-125/+142
| | | | | | | | | | 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
* Don't call isp_intr from isp_start- this seems to, in rare cases,Matt Jacob2007-03-141-7/+1
| | | | | | | | | | cause confusion with at least the 23XX chipsets where the output queue index pointer just gets a bit whacko. MFC after: 1 day Notes: svn path=/head/; revision=167521
* Move bus_space_tag and bus_space_handle register accessMatt Jacob2007-03-133-86/+79
| | | | | | | | | | | | | 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
* Restore optr if you trash it for 24XX target mode.Matt Jacob2007-03-131-0/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=167500
* Fix compilation issues found in RELENG_4 port and merge theMatt Jacob2007-03-124-11/+27
| | | | | | | 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-1013-255/+255
| | | | Notes: svn path=/head/; revision=167403
* Redo previous newbus related change to be kinder toMatt Jacob2007-02-233-2/+9
| | | | | | | multi-release support. Notes: svn path=/head/; revision=166935
* Don't attempt to load illegal hard loop addresses intoMatt Jacob2007-02-233-49/+31
| | | | | | | | | | | | | | | an ICB. This shows up on card restarts, and usually for 2200-2300 cards. What happens is that we start up, attempting to acquire a hard address. We end up instead being an F-port topology, which reports out a loop id of 0xff (or 0xffff for 2K Login f/w). Then, if we restart, we end up telling the card to go off an acquire this loop address, which the card then rejects. Bah. Compilation fixes from Solaris port. Notes: svn path=/head/; revision=166929
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-232-2/+2
| | | | | | | | | | | | | | | | 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
* Use the new xpt_rescan function to truly now have dynamicMatt Jacob2007-02-231-11/+34
| | | | | | | | | | | | | attachment of new devices that arrive (and we notice them via async Fibre Channel events). We've always had the right thing (of sorts) happen when devices go away- this is the corollary function that makes multipath failover actually work. MFC after: 2 weeks Notes: svn path=/head/; revision=166897
* 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
* Be a bit more restrictive about printing out 'bad' pdb entriesMatt Jacob2007-02-231-9/+11
| | | | | | | | during loop rescans. They're not bad so much as unstable, so don't print this stuff out unless ISP_LOGSANCFG is set. Notes: svn path=/head/; revision=166894
* Cleanup and document the implementation of firmware(9) based onLuigi Rizzo2007-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a version that i posted earlier on the -current mailing list, and subsequent feedback received. The core of the change is just in sys/firmware.h and kern/subr_firmware.c, while other files are just adaptation of the clients to the ABI change (const-ification of some parameters and hiding of internal info, so this is fully compatible at the binary level). In detail: - reduce the amount of information exported to clients in struct firmware, and constify the pointer; - internally, document and simplify the implementation of the various functions, and make sure error conditions are dealt with properly. The diffs are large, but the code is really straightforward now (i hope). Note also that there is a subtle issue with the implementation of firmware_register(): currently, as in the previous version, we just store a reference to the 'imagename' argument, but we should rather copy it because there is no guarantee that this is a static string. I realised this while testing this code, but i prefer to fix it in a later commit -- there is no regression with respect to the past. Note, too, that the version in RELENG_6 has various bugs including missing locks around the module release calls, mishandling of modules loaded by /boot/loader, and so on, so an MFC is absolutely necessary there. I was just postponing it until this cleanup to avoid doing things twice. MFC after: 1 week Notes: svn path=/head/; revision=166756
* 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-233-47/+36
| | | | | | | | | | 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
* Change the remainder of the drivers for DMA'ing devices enabled in theMarius Strobl2007-01-211-2/+14
| | | | | | | | | | | sparc64 GENERIC and the sound device drivers known working on sparc64 to use bus_get_dma_tag() to obtain the parent DMA tag so we can get rid of the sparc64_root_dma_tag kludge eventually. Except for ath(4), sk(4), stge(4) and ti(4) these changes are runtime tested (unless I booted up the wrong kernels again...). Notes: svn path=/head/; revision=166165
* Grumble- let a linux-ism slip in and had an llx whichMatt Jacob2007-01-201-9/+12
| | | | | | | then choked on a 64 bit platforms. Oops. Notes: svn path=/head/; revision=166127
* MFP4: Move default setting to the end of isp_reset instead of theMatt Jacob2007-01-207-93/+138
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=166120
* RELENG_6 compilationMatt Jacob2007-01-051-1/+1
| | | | Notes: svn path=/head/; revision=165818
* error print cleanup && turn off ints if RISC is pausedMatt Jacob2007-01-051-1/+2
| | | | Notes: svn path=/head/; revision=165817