aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/isp
Commit message (Collapse)AuthorAgeFilesLines
* MFC r259860 (by mjacob):Dimitry Andric2014-03-192-3/+2
| | | | | | | | | | | | | Harvest one no longer used constant string. Remove another and place it into play in the normally ifdef protected zone it would be used int. Noticed by: dim Notes: svn path=/stable/9/; revision=263384
* MFC 254372:Kenneth D. Merry2013-08-271-0/+5
| | | | | | | | | | | | | | | | | | Export the maxio field in the CAM XPT_PATH_INQ CCB in the isp(4) driver. This tells consumers up the stack the maximum I/O size that the controller can handle. The I/O size is bounded by the number of scatter/gather segments the controller can handle and the page size. For an amd64 system, it works out to around 5MB. Reviewed by: mjacob Sponsored by: Spectra Logic Notes: svn path=/stable/9/; revision=254971
* 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
* MFC of 253330Matt Jacob2013-07-152-3/+14
| | | | | | | | | | | | | | | | When fiddling with options of which registers to copy out for a mailbox command and which registers to copy back in when the command completes, the bits being set need to not only specify what bits you want to add from the default from the table but also what bits you want *subtract* (mask) from the default from the table. A failing ISP2200 command pointed this out. Approved by: re Notes: svn path=/stable/9/; revision=253371
* MFC r249468:Alexander Motin2013-07-081-1/+2
| | | | | | | | | | | Stop abusing xpt_periph in random plases that really have no periph related to CCB, for example, bus scanning. NULL value is fine in such cases and it is correctly logged in debug messages as "noperiph". If at some point we need some real XPT periphs (alike to pmpX now), quite likely they will be per-bus, and not a single global instance as xpt_periph now. Notes: svn path=/stable/9/; revision=253037
* MFC: r247264Marius Strobl2013-06-181-1/+7
| | | | | | | | | Turn off fast posting for the ISP2100- I'd forgotten that it actually might have been enabled for them- now that we use all 32 bits of handle. Fast Posting doesn't pass the full 32 bits. Notes: svn path=/stable/9/; revision=251946
* MFC: r251373Marius Strobl2013-06-181-2/+2
| | | | | | | | Flag isp(4) as supporting unmapped I/O; all necessary conversion actually already has been done as part of r246713 (MFC'ed to stable/9 in r251874). Notes: svn path=/stable/9/; revision=251943
* Big MFC of the physbio changes necessary for unmapped I/O. These changesScott Long2013-06-182-101/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-122-6/+4
| | | | | | | 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-203-6/+8
| | | | Notes: svn path=/stable/9/; revision=240717
* MFC of 240580 and 240590- correct some comments.Matt Jacob2012-09-191-3/+3
| | | | Notes: svn path=/stable/9/; revision=240713
* MFC r240518:Eitan Adler2012-09-171-1/+1
| | | | | | | | | Correct double "the the" Approved by: cperciva (implicit) Notes: svn path=/stable/9/; revision=240579
* MFC of 239023Matt Jacob2012-09-021-33/+59
| | | | | | | Add detach logic to SBus variant. Notes: svn path=/stable/9/; revision=240025
* 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 238887- fix compilation on isp_sbus.cMatt Jacob2012-09-021-1/+1
| | | | Notes: svn path=/stable/9/; revision=240022
* MFC of 239330Matt Jacob2012-09-021-1/+18
| | | | | | | On lun disable, complete all INOTs and ATIOs with CAM_REQ_ABORTED. Notes: svn path=/stable/9/; revision=240019
* MFC of 239219Matt Jacob2012-09-021-1/+1
| | | | | | | Remove extraneous newline. Notes: svn path=/stable/9/; revision=240018
* MFC of 239218Matt Jacob2012-09-022-18/+33
| | | | | | | Fix an oops where we wiped out DMA maps... Notes: svn path=/stable/9/; revision=240017
* MFC of 239143Matt Jacob2012-09-022-581/+630
| | | | | | | More rototilling with target mode in an attemp to get multiple... Notes: svn path=/stable/9/; revision=240016
* MFC of 238859Matt Jacob2012-09-0211-1012/+1837
| | | | | | | Mega change for FC-Tape. Notes: svn path=/stable/9/; revision=240015
* MFC of 228914Matt Jacob2012-09-022-28/+35
| | | | | | | | Fix target mode compilation issues that arose after a change in the sense data structures. Notes: svn path=/stable/9/; revision=240014
* A belated MFC of 227126Matt Jacob2012-09-022-0/+9
| | | | | | | Implement the sysctl's for fibre channel that are listed in the man page. Notes: svn path=/stable/9/; revision=240013
* MFC of 237544Matt Jacob2012-09-021-2/+5
| | | | | | | Unbreak register tests for parallel SCSI. Notes: svn path=/stable/9/; revision=240012
* MFC of 237537Matt Jacob2012-09-026-54/+100
| | | | | | | 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-026-357/+446
| | | | | | | Prepare for FC-Tape support. Notes: svn path=/stable/9/; revision=240009
* Very belated MFC of 227548Matt Jacob2012-09-022-11/+58
| | | | | | | | | | 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: r238486Christian Brueffer2012-07-181-1/+1
| | | | | | | | | Fix typo in a message. Approved by: re (hrs) Notes: svn path=/stable/9/; revision=238586
* 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 of r236427Matt Jacob2012-06-174-68/+159
| | | | | | | | | | | | Clean up and complete the incomplete deferred enable code. Make the default role NONE if target mode is selected. This allows ctl(8) to switch to/from target mode via knob settings. If we default to role 'none', this causes a reset of the 24XX f/w which then causes initiators to wake up and notice when we come online. Notes: svn path=/stable/9/; revision=237208
* MFC r236379:Eitan Adler2012-06-062-0/+4
| | | | | | | | | | 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
* MFC: r231985Marius Strobl2012-02-251-1/+1
| | | | | | | Fix memset sizeof Notes: svn path=/stable/9/; revision=232140
* MFC r228461:Alexander Motin2012-01-121-11/+15
| | | | | | | | | | | | | | | | | Fix few bugs in isp(4) target mode support: - in destroy_lun_state() assert hold == 1 instead of 0, as it should receive hold taken by the create_lun_state() or get_lun_statep() before; - fix hold count leak inside rls_lun_statep() that also fired above assert; - in destroy_lun_state() use SIM bus number instead of SIM path id for ISP_GET_PC_ADDR(), as it was before r196008; - make isp_disable_lun() to set status in CCB; - make isp_target_mark_aborted() set status into the proper CCB. Reviewed by: mjacob Sponsored by: iXsystems, inc. Notes: svn path=/stable/9/; revision=230019
* MFC r227458, r226436:Eitan Adler2012-01-041-2/+2
| | | | | | | | | | | - change "is is" to "is" or "it is" - change "the the" to "the" - other typo fixes Approved by: lstewart Notes: svn path=/stable/9/; revision=229461
* MFC r226118:Marius Strobl2011-10-121-0/+1
| | | | | | | | | | | | Sync with ahc(4)/ahd(4)/sym(4) etc: Zero any sense not transferred by the device as the SCSI specification mandates that any untransferred data should be assumed to be zero. Reviewed by: ken Approved by: re (kib) Notes: svn path=/stable/9/; revision=226303
* MFC r225950:Kenneth D. Merry2011-10-061-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add descriptor sense support to CAM, and honor sense residuals properly in CAM. Desriptor sense is a new sense data format that originated in SPC-3. Among other things, it allows for an 8-byte info field, which is necessary to pass back block numbers larger than 4 bytes. This change adds a number of new functions to scsi_all.c (and therefore libcam) that abstract out most access to sense data. This includes a bump of CAM_VERSION, because the CCB ABI has changed. Userland programs that use the CAM pass(4) driver will need to be recompiled. camcontrol.c: Change uses of scsi_extract_sense() to use scsi_extract_sense_len(). Use scsi_get_sks() instead of accessing sense key specific data directly. scsi_modes: Update the control mode page to the latest version (SPC-4). scsi_cmds.c, scsi_target.c: Change references to struct scsi_sense_data to struct scsi_sense_data_fixed. This should be changed to allow the user to specify fixed or descriptor sense, and then use scsi_set_sense_data() to build the sense data. ps3cdrom.c: Use scsi_set_sense_data() instead of setting sense data manually. cam_periph.c: Use scsi_extract_sense_len() instead of using scsi_extract_sense() or accessing sense data directly. cam_ccb.h: Bump the CAM_VERSION from 0x15 to 0x16. The change of struct scsi_sense_data from 32 to 252 bytes changes the size of struct ccb_scsiio, but not the size of union ccb. So the version must be bumped to prevent structure mis-matches. scsi_all.h: Lots of updated SCSI sense data and other structures. Add function prototypes for the new sense data functions. Take out the inline implementation of scsi_extract_sense(). It is now too large to put in a header file. Add macros to calculate whether fields are present and filled in fixed and descriptor sense data scsi_all.c: In scsi_op_desc(), allow the user to pass in NULL inquiry data, and we'll assume a direct access device in that case. Changed the SCSI RESERVED sense key name and description to COMPLETED, as it is now defined in the spec. Change the error recovery action for a number of read errors to prevent lots of retries when the drive has said that the block isn't accessible. This speeds up reconstruction of the block by any RAID software running on top of the drive (e.g. ZFS). In scsi_sense_desc(), allow for invalid sense key numbers. This allows calling this routine without checking the input values first. Change scsi_error_action() to use scsi_extract_sense_len(), and handle things when invalid asc/ascq values are encountered. Add a new routine, scsi_desc_iterate(), that will call the supplied function for every descriptor in descriptor format sense data. Add scsi_set_sense_data(), and scsi_set_sense_data_va(), which build descriptor and fixed format sense data. They currently default to fixed format sense data. Add a number of scsi_get_*() functions, which get different types of sense data fields from either fixed or descriptor format sense data, if the data is present. Add a number of scsi_*_sbuf() functions, which print formatted versions of various sense data fields. These functions work for either fixed or descriptor sense. Add a number of scsi_sense_*_sbuf() functions, which have a standard calling interface and print the indicated field. These functions take descriptors only. Add scsi_sense_desc_sbuf(), which will print a formatted version of the given sense descriptor. Pull out a majority of the scsi_sense_sbuf() function and put it into scsi_sense_only_sbuf(). This allows callers that don't use struct ccb_scsiio to easily utilize the printing routines. Revamp that function to handle descriptor sense and use the new sense fetching and printing routines. Move scsi_extract_sense() into scsi_all.c, and implement it in terms of the new function, scsi_extract_sense_len(). The _len() version takes a length (which should be the sense length - residual) and can indicate which fields are present and valid in the sense data. Add a couple of new scsi_get_*() routines to get the sense key, asc, and ascq only. mly.c: Rename struct scsi_sense_data to struct scsi_sense_data_fixed. sbp_targ.c: Use the new sense fetching routines to get sense data instead of accessing it directly. sbp.c: Change the firewire/SCSI sense data transformation code to use struct scsi_sense_data_fixed instead of struct scsi_sense_data. This should be changed later to use scsi_set_sense_data(). ciss.c: Calculate the sense residual properly. Use scsi_get_sense_key() to fetch the sense key. mps_sas.c, mpt_cam.c: Set the sense residual properly. iir.c: Use scsi_set_sense_data() instead of building sense data by hand. iscsi_subr.c: Use scsi_extract_sense_len() instead of grabbing sense data directly. umass.c: Use scsi_set_sense_data() to build sense data. Grab the sense key using scsi_get_sense_key(). Calculate the sense residual properly. isp_freebsd.h: Use scsi_get_*() routines to grab asc, ascq, and sense key values. Calculate and set the sense residual. Approved by: re (kib) Sponsored by: Spectra Logic Corporation Notes: svn path=/stable/9/; revision=226067
* Most of these changes to isp are to allow for isp.ko unloading.Matt Jacob2011-08-135-59/+186
| | | | | | | | | | | | | | 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
* Fixes zombie device and loop down timers so that they work more thanMatt Jacob2011-08-122-6/+39
| | | | | | | | | | | | | | | once. Use taskqueues to do the actual work. Fix an offset line. Fix isp_prt so that prints from just one buffer, which makes it appear cleanly cleanly in logs on SMP systems. Approved by: re (kib) MFC after: 1 month Notes: svn path=/head/; revision=224804
* 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
* Flush both reads *and* writes to registers.Matt Jacob2011-03-051-1/+1
| | | | | | | | Obtained from: Miod Vallat in OpenBSD MFC after: 1 week Notes: svn path=/head/; revision=219282
* Sync FreeBSD ISP with mercurial tree. Minor changes having to do withMatt Jacob2011-02-284-6/+9
| | | | | | | a macro for minima. Notes: svn path=/head/; revision=219098
* - Use the correct DMA tag/map pair for synchronize the FC scratch area.Marius Strobl2011-02-147-49/+61
| | | | | | | | | | | | | | - 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
* Partially revert 208119. We were overwriting tunable settings.Matt Jacob2010-11-271-3/+0
| | | | | | | | Obtained from: Oleg Sharoyko MFC after: 1 week Notes: svn path=/head/; revision=215951
* Fix typos.Rebecca Cran2010-11-091-7/+7
| | | | | | | | PR: bin/148894 Submitted by: olgeni Notes: svn path=/head/; revision=215034
* Don't pass a buffer directly as a printflike format string.Matt Jacob2010-06-101-1/+1
| | | | | | | | Found by: clang MFC after: 1 month Notes: svn path=/head/; revision=208997
* Fix XPT_GET_TRAN_SETTING for FC which has been broken for while so thatMatt Jacob2010-06-071-2/+4
| | | | | | | | | | it will figure out the correct target to handle index and be able to find things like WWPN, etc. MFC after: 2 weeks Notes: svn path=/head/; revision=208895
* Be more specific about which CDB length we're going to use. Not really a likelyMatt Jacob2010-06-051-4/+14
| | | | | | | | | | | | bug but we might as well be clearer. Found with: Coverity Prevent(tm) CID: 3981 MFC after: 2 weeks Notes: svn path=/head/; revision=208849
* Make the internal target > SPC2 (so REPORT LUNS can be tested).Matt Jacob2010-06-051-2/+8
| | | | | | | | | | Give the NIL inquiry data real values other than just plain 0x7f in the first byte. MFC after: 2 weeks Notes: svn path=/head/; revision=208809
* I was getting panics in sleepq_add for the second sleep in isp_kthread.Matt Jacob2010-06-051-1/+3
| | | | | | | | | | I don't know why- but it occurred to me in looking at the second sleep is that all I want is a pause- not an actual sleep. So do that instead. MFC after: 2 weeks Notes: svn path=/head/; revision=208808
* Various minor and not so minor fixes suggested by Coverity.Matt Jacob2010-06-024-44/+52
| | | | | | | | | | 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