aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iir
Commit message (Collapse)AuthorAgeFilesLines
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-071-1/+1
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* Add descriptor sense support to CAM, and honor sense residuals properly inKenneth D. Merry2011-10-031-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. MFC after: 3 days Sponsored by: Spectra Logic Corporation Notes: svn path=/head/; revision=225950
* Get rid of #ident.Edward Tomasz Napierala2010-01-081-1/+0
| | | | Notes: svn path=/head/; revision=201821
* Remove unused iir_watchdog().Edward Tomasz Napierala2010-01-081-35/+0
| | | | | | | Reviewed by: scottl Notes: svn path=/head/; revision=201796
* Include <sys/sysctl.h>, to get the declarations of ostype andMarcel Moolenaar2009-12-021-2/+1
| | | | | | | osrelease. Remove the duplicate declarations from this file. Notes: svn path=/head/; revision=200045
* Revert previous commit and add myself to the list of people who shouldPoul-Henning Kamp2009-09-081-1/+0
| | | | | | | know better than to commit with a cat in the area. Notes: svn path=/head/; revision=196970
* Add necessary include.Poul-Henning Kamp2009-09-081-0/+1
| | | | Notes: svn path=/head/; revision=196969
* Remove unused VM includes.John Baldwin2009-06-032-7/+0
| | | | Notes: svn path=/head/; revision=193396
* We no longer need to use d_thread_t, migrate to struct thread *.Warner Losh2009-05-201-3/+3
| | | | Notes: svn path=/head/; revision=192450
* Compare the correct variable against NULL.Christian Brueffer2009-05-141-1/+1
| | | | | | | | | | Reviewed by: scottl Found with: Coverity Prevent(tm) CID: 821 MFC after: 2 weeks Notes: svn path=/head/; revision=192097
* Replace all calls to minor() with dev2unit().Ed Schouten2008-09-271-5/+5
| | | | | | | | | | | | | | | | | | 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
* Fix a buffer overflow in the processing of various SCSI commands. This likelyScott Long2008-01-091-26/+42
| | | | | | | | | | | fixes a an great number of weird problems that have been reported with this driver. PR: 119114 Submitted by: Jens Rehsack Notes: svn path=/head/; revision=175197
* Prepare for future integration between CAM and newbus. xpt_bus_registerScott Long2007-06-173-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 Giant from CAM. Drivers (SIMs) now register a mutex that CAM willScott Long2007-04-151-1/+2
| | | | | | | | | | | | | | 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
* 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
* Add MODULE_DEPENDS for cam, pci, mca, eisa and isa where needed.Matt Jacob2006-12-111-0/+2
| | | | | | | | PR: 106543 MFC after: 3 days Notes: svn path=/head/; revision=165102
* 2nd and final commit that moves us to CAM_NEW_TRAN_CODEMatt Jacob2006-11-021-21/+0
| | | | | | | | | as the default. Reviewed by multitudes. Notes: svn path=/head/; revision=163896
* The first of 3 major steps to move the CAM layer forward to usingMatt Jacob2006-10-311-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | the CAM_NEW_TRAN_CODE that has been in the tree for some years now. This first step consists solely of adding to or correcting CAM_NEW_TRAN_CODE pieces in the kernel source tree such that a both a GENERIC (at least on i386) and a LINT build with CAM_NEW_TRAN_CODE as an option will compile correctly and run (at least with some the h/w I have). After a short settle time, the other pieces (making CAM_NEW_TRAN_CODE the default and updating libcam and camcontrol) will be brought in. This will be an incompatible change in that the size of structures related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change in both size and content. However, basic system operation and basic system utilities work well enough with this change. Reviewed by: freebsd-scsi and specific stakeholders Notes: svn path=/head/; revision=163816
* Since DELAY() was moved, most <machine/clock.h> #includes have beenPoul-Henning Kamp2006-05-162-2/+0
| | | | | | | unnecessary. Notes: svn path=/head/; revision=158651
* Big update to the iir driver:Scott Long2006-03-013-170/+169
| | | | | | | | | | | | | | | | | | | | | | | | | - Don't use a common buffer in the softc to store per-command data. Reserve a buffer in the command itself. - Don't allocate DMA memory for the kernel command structures when all you really need is DMA memory for the scratch buffer embedded in them. Instead allocate a slab for the scratch buffers and divide it up as needed. - Call bus_dmamap_unload() at the completion of commands. - Preserve and clear the CAM CCB status flags at completion. - Reorder some low-level command operations to try to close races. - Limit the simq to 32 commands for now. There are some serious problems with the driver under load that are not well understood, so keeping the simq lower helps avoid this. It has been tested at a higher value, but this is a safe value that doesn't show much performance degredation. These changes allow the driver to work reliably with >4GB of memory on i386 and amd64, and also work around deadlocks seen under very high load in certain situations. The work-around is far from ideal, but without and documentation it is hard to know what the right fix is. MFC candidate Notes: svn path=/head/; revision=156139
* Convert iir inlines to ANSI C function declarations.Robert Watson2006-01-211-10/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=154648
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-292-4/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* Correct improper permissions on /dev/iir. The earlier permissionsColin Percival2005-05-061-2/+2
| | | | | | | | | of 0644 allowed for people to do Evil Things via ioctl(2). Security: FreeBSD-SA-05:06.iir Notes: svn path=/head/; revision=145947
* Use BUS_PROBE_DEFAULT for pci probe return valueWarner Losh2005-03-051-2/+2
| | | | Notes: svn path=/head/; revision=143160
* netchild's mega-patch to isolate compiler dependencies into a centralJoerg Wunsch2005-03-021-1/+5
| | | | | | | | | | | | | | | | | | | place. This moves the dependency on GCC's and other compiler's features into the central sys/cdefs.h file, while the individual source files can then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42. By now, GCC and ICC (the Intel compiler) have been actively tested on IA32 platforms by netchild. Extension to other compilers is supposed to be possible, of course. Submitted by: netchild Reviewed by: various developers on arch@, some time ago Notes: svn path=/head/; revision=143063
* Remove a dead vtophys() reference.Scott Long2005-01-311-6/+0
| | | | Notes: svn path=/head/; revision=141077
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-063-3/+3
| | | | Notes: svn path=/head/; revision=139749
* Panic if given a CAM_DATA_PHYS pointer from CAM instead of trying to handle it.Scott Long2004-09-031-14/+2
| | | | | | | | | It makes no sense in a PAE environment and is impossible to handle correctly. This case is also never used right now. This should make the iir(4) driver ready for PAE. Notes: svn path=/head/; revision=134692
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-162-11/+11
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Update from vendor. This also adds support for newer management tools.Scott Long2004-05-193-27/+16
| | | | | | | Submitted by: Achim Leubner Notes: svn path=/head/; revision=129449
* Fix the ioctl types for two ioctls. I'm not sure if the switch was myScott Long2004-03-201-2/+2
| | | | | | | | | | fault or the vendor's fault when I brought in rev 1.5. This allows the 'storcon' utility to work again. Sponsored by: freebsdsystems.com Notes: svn path=/head/; revision=127233
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-3/+3
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* These are changes to allow to use the Intel C/C++ compiler (lang/icc)Tom Rhodes2004-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to build the kernel. It doesn't affect the operation if gcc. Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as icc v8 may define __GNUC__ some parts may look strange but are necessary. Additional changes: - in_cksum.[ch]: * use a generic C version instead of the assembly version in the !gcc case (ASM code breaks with the optimizations icc does) -> no bad checksums with an icc compiled kernel Help from: andre, grehan, das Stolen from: alpha version via ppc version The entire checksum code should IMHO be replaced with the DragonFly version (because it isn't guaranteed future revisions of gcc will include similar optimizations) as in: ---snip--- Revision Changes Path 1.12 +1 -0 src/sys/conf/files.i386 1.4 +142 -558 src/sys/i386/i386/in_cksum.c 1.5 +33 -69 src/sys/i386/include/in_cksum.h 1.5 +2 -0 src/sys/netinet/igmp.c 1.6 +0 -1 src/sys/netinet/in.h 1.6 +2 -0 src/sys/netinet/ip_icmp.c 1.4 +3 -4 src/contrib/ipfilter/ip_compat.h 1.3 +1 -2 src/sbin/natd/icmp.c 1.4 +0 -1 src/sbin/natd/natd.c 1.48 +1 -0 src/sys/conf/files 1.2 +0 -1 src/sys/conf/files.amd64 1.13 +0 -1 src/sys/conf/files.i386 1.5 +0 -1 src/sys/conf/files.pc98 1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c 1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h 1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c 1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c 1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c 1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c 1.6 +1 -2 src/sys/netinet/igmp.c 1.4 +158 -116 src/sys/netinet/in_cksum.c 1.6 +1 -1 src/sys/netinet/ip_gre.c 1.7 +1 -2 src/sys/netinet/ip_icmp.c 1.10 +1 -1 src/sys/netinet/ip_input.c 1.10 +1 -2 src/sys/netinet/ip_output.c 1.13 +1 -2 src/sys/netinet/tcp_input.c 1.9 +1 -2 src/sys/netinet/tcp_output.c 1.10 +1 -1 src/sys/netinet/tcp_subr.c 1.10 +1 -1 src/sys/netinet/tcp_syncache.c 1.9 +1 -2 src/sys/netinet/udp_usrreq.c 1.5 +1 -2 src/sys/netinet6/ipsec.c 1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c 1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c 1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c and finally remove sys/i386/i386 in_cksum.c sys/i386/include in_cksum.h ---snip--- - endian.h: * DTRT in C++ mode - quad.h: * we don't use gcc v1 anymore, remove support for it Suggested by: bde (long ago) - assym.h: * avoid zero-length arrays (remove dependency on a gcc specific feature) This change changes the contents of the object file, but as it's only used to generate some values for a header, and the generator knows how to handle this, there's no impact in the gcc case. Explained by: bde Submitted by: Marius Strobl <marius@alchemy.franken.de> - aicasm.c: * minor change to teach it about the way icc spells "-nostdinc" Not approved by: gibbs (no reply to my mail) - bump __FreeBSD_version (lang/icc needs to know about the changes) Incarnations of this patch survive gcc compiles since a loooong time, I use it on my desktop. An icc compiled kernel works since Nov. 2003 (exceptions: snd_* if used as modules), it survives a build of the entire ports collection with icc. Parts of this commit contains suggestions or submissions from Marius Strobl <marius@alchemy.franken.de>. Reviewed by: -arch Submitted by: netchild Notes: svn path=/head/; revision=126891
* Device megapatch 4/6:Poul-Henning Kamp2004-02-211-0/+2
| | | | | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags. Notes: svn path=/head/; revision=126080
* Remove the static major assignment for iir(4).Scott Long2004-02-142-6/+1
| | | | | | | Submitted by: phk (partially) Notes: svn path=/head/; revision=125834
* Update email addresses, copyrights, and tweak the management interface.Scott Long2003-09-264-22/+47
| | | | | | | Submitted by: "Leubner, Achim" <Achim_Leubner@adaptec.com> Notes: svn path=/head/; revision=120477
* Use PCIR_BAR(x) instead of PCIR_MAPS.John Baldwin2003-09-021-1/+1
| | | | | | | | Glanced over by: imp, gibbs Tested by: i386 LINT Notes: svn path=/head/; revision=119690
* Use __FBSDID().David E. O'Brien2003-08-243-7/+9
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Prefer new location of pci include files (which have only been in theWarner Losh2003-08-221-3/+3
| | | | | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD. Notes: svn path=/head/; revision=119280
* Mega busdma API commit.Scott Long2003-07-012-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=117126
* Import latest changes from the vendor. This also is reported to fix theScott Long2003-04-254-38/+116
| | | | | | | | | | driver at long last! Many thanks to vaidas.damosevicius@if.lt for keeping this issue alive and pursuing Intel for a fix, Intel/ICP for working on the driver, and Sergey Osokin for bringing the original patches up to 5-CURRENT. Notes: svn path=/head/; revision=114001
* I deserve a big pointy hat for having missed all those referencesMaxime Henrion2003-04-101-2/+2
| | | | | | | to bus_dmasync_op_t in my last commit. Notes: svn path=/head/; revision=113350
* Including <sys/stdint.h> is (almost?) universally only to be able to usePoul-Henning Kamp2003-03-181-1/+0
| | | | | | | | %j in printfs, so put a newsted include in <sys/systm.h> where the printf prototype lives and save everybody else the trouble. Notes: svn path=/head/; revision=112367
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-03-031-14/+7
| | | | | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl) Notes: svn path=/head/; revision=111815
* Fix cdevsw initialization commit to follow canonical format.Poul-Henning Kamp2003-03-021-1/+1
| | | | Notes: svn path=/head/; revision=111745
* msgPoul-Henning Kamp2003-02-261-15/+0
| | | | Notes: svn path=/head/; revision=111573
* Remove S_IROTH from the make_dev() lines for iir-related devices. ThisRobert Watson2002-12-271-2/+2
| | | | | | | | | | | improves protection consistency with other storage devices (generally root:operator,660). This driver appears not to have an active maintainer. Submitted by: kris Notes: svn path=/head/; revision=108320
* Use [u]intmax_t and %j instead of long long and %ll to better fix warningsJohn Baldwin2002-11-071-2/+3
| | | | | | | | | I fixed earlier. Requested by: mux, jake Notes: svn path=/head/; revision=106591
* Use long long to print out a bus_addr_t again.John Baldwin2002-11-061-2/+2
| | | | Notes: svn path=/head/; revision=106537
* Be consistent about "static" functions: if the function is markedPoul-Henning Kamp2002-09-281-2/+2
| | | | | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512 Notes: svn path=/head/; revision=104094