aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/amr/amrvar.h
Commit message (Collapse)AuthorAgeFilesLines
* Essentially revert r239912. The amr_periodic function hadn't been armed inScott Long2012-08-311-1/+0
| | | | | | | | over 10 years and was dead code; the previous revision exposed it as such to CLANG. The solution is to cull the whole thing. Notes: svn path=/head/; revision=239939
* Use callout(9) rather than timeout(9). Note that the periodic timer inJohn Baldwin2012-08-301-1/+1
| | | | | | | | amr(4) is never started, so this should be even more of a NOP than normal. Notes: svn path=/head/; revision=239912
* Fix clang warning on empty statement.Matthew D Fleming2010-07-281-2/+2
| | | | | | | | Reviewed by: rdivacky, zml Approved by: zml (mentor) Notes: svn path=/head/; revision=210570
* Move the CAM passthrough code into a true module so that it doesn't have to beScott Long2008-11-031-7/+2
| | | | | | | | | compiled into the main AMR driver. It's code that is nice to have but not required for normal operation, and it is reported to cause problems for some people. Notes: svn path=/head/; revision=184573
* Many improvements that have been collected over time:Scott Long2008-01-241-16/+26
| | | | | | | | | - Improve error handling for load operations. - Fix a memory corruption bug when using certain linux management apps. - Allocate all commands up front to avoid OOM deadlocks later on. Notes: svn path=/head/; revision=175622
* Rewrite the DMA code paths from being an impenitrable maze of special casesScott Long2007-12-121-6/+18
| | | | | | | | to a much saner and simplier unified code path. Along the way, fix various CAM nits and bugs so that the passthrough works correctly for all cases. Notes: svn path=/head/; revision=174544
* Make amr_linux work as a module by avoiding calling amr_linux_ioctl_intDoug Ambrisko2006-05-031-2/+0
| | | | | | | | | | | from the amr_linux. This simplifies the amr_linux shim and puts the smarts into amr.c. I tested this with 2 amr controllers in one box. It seems to work okay with them. Notes: svn path=/head/; revision=158267
* After further review and discussion, partially revert the previous commit.Scott Long2006-04-081-1/+0
| | | | | | | | | | | | | The real problem was that ioctl handlers needed to call amr_wait_command() with the list lock held. This not only solves the completion race, it also prevents bounce buffer corruption that could arise from amr_start() being called without the proper locks held. Discussed with: ps MFC After: 3 days Notes: svn path=/head/; revision=157586
* Close a pesky race where after checking the BUSY flag in amr_wait_command,Paul Saab2006-04-081-0/+1
| | | | | | | | | | | the completion of the command can occur before tsleep is called and the command ends up blocking forever since the wakeup has already been called. Submitted by: ups Notes: svn path=/head/; revision=157585
* - Move the command setup from amr_start1 into the card specific submitPaul Saab2006-02-021-1/+1
| | | | | | | | | | routines. - Add or replace cpu_spinwait() with DELAY(1) to a few of the busy loops when reading from the controller to work around firmware bugs which can crash the controller. Notes: svn path=/head/; revision=155222
* Mega update to the LSI MegaRAID driver:Scott Long2005-12-141-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Implement a large set of ioctl shims so that the Linux management apps from LSI will work. This includes infrastructure to support adding, deleting and rescanning arrays at runtime. This is based on work from Doug Ambrosko, heavily augmented by LSI and Yahoo. 2. Implement full 64-bit DMA support. Systems with more than 4GB of RAM can now operate without the cost of bounce buffers. Cards that cannot do 64-bit DMA will automatically revert to using bounce buffers. This option can be forced off by setting the 'hw.amr.force_sg32" tunable in the loader. It should only be turned off for debugging purposes. This work was sponsored by Yahoo. 3. Streamline the command delivery and interrupt handler paths after much discussion with Dell and LSI. The logic now closely matches the intended design, making it both more robust and much faster. Certain i/o failures under heavy load should be fixed with this. 4. Optimize the locking. In the interrupt handler, the card can be checked for completed commands without any locks held, due to the handler being implicitely serialized and there being no need to look at any shared data. Only grab the lock to return the command structure to the free pool. A small optimization can still be made to collect all of the completions together and then free them together under a single lock. Items 3 and 4 significantly increase the performance of the driver. On an LSI 320-2X card, transactions per second went from 13,000 to 31,000 in my testing with these changes. However, these changes are still fairly experimental and shouldn't be merged to 6.x until there is more testing. Thanks to Doug Ambrosko, LSI, Dell, and Yahoo for contributing towards this. Notes: svn path=/head/; revision=153409
* Remove spl markers from AMR.Scott Long2005-11-061-27/+0
| | | | | | | MFC After: 3 days Notes: svn path=/head/; revision=152119
* Remove a stale __FreeBSD_version check.Scott Long2005-08-071-5/+3
| | | | Notes: svn path=/head/; revision=148841
* Add support for the LSI 320-2E PCI-Express controller. Fix a couple of bugsScott Long2005-01-231-0/+2
| | | | | | | | | in the ioctl handler. Update the LSI copyrights for these. Obtained from: LSI, Corp Notes: svn path=/head/; revision=140688
* Lock the AMR driver:Scott Long2005-01-161-4/+4
| | | | | | | | | | | | | - Introduce the amr_io_lock to control access to command queues, bio queues, and the hardware. - Eliminate the taskqueue and do all completion processing in the ithread. - Assign a static slot number to each command instead of doing a linear search for free slots each time a command is needed. - Modify the interrupt handler to more closely match what Linux does, for safety. Notes: svn path=/head/; revision=140340
* Free the shared devq last since CAM expects it to be there ifDoug White2005-01-101-0/+1
| | | | | | | | | | xpt_alloc_device() gets called, which can happen during detach in certain situations. Fixes module unload. MFC after: 3 days Notes: svn path=/head/; revision=139952
* Fix a number of bugs and significantly alter the command execution path toScott Long2004-12-051-0/+2
| | | | | | | | | | | | | properly support bounce buffers and resource shortages. This allows the driver to work properly and reliably with more than 4GB of RAM. Of the three data paths that exist in the driver, (block, CAM, ioctl), the ioctl path has not been well tested with these changes due to difficulty with finding an application that uses it that actually works. Sponsored by: The FreeBSD Foundation and FreeBSD Systems, Inc. Notes: svn path=/head/; revision=138422
* Use a separate flag when doing a kernel coredump when polling forPaul Saab2004-07-011-0/+1
| | | | | | | completion instead of abusing the interrupt enable flag. Notes: svn path=/head/; revision=131394
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-1/+1
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Change the disk(9) API in order to make device removal more robust.Poul-Henning Kamp2004-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the "struct disk" were owned by the device driver and this gave us problems when the device disappared and the users of that device were not immediately disappearing. Now the struct disk is allocate with a new call, disk_alloc() and owned by geom_disk and just abandonned by the device driver when disk_create() is called. Unfortunately, this results in a ton of "s/\./->/" changes to device drivers. Since I'm doing the sweep anyway, a couple of other API improvements have been carried out at the same time: The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to DISKFLAG_NEEDSGIANT A version number have been added to disk_create() so that we can detect, report and ignore binary drivers with old ABI in the future. Manual page update to follow shortly. Notes: svn path=/head/; revision=125975
* crashdump support.Paul Saab2003-10-101-0/+1
| | | | | | | Some bits by: Rajesh Prabhakaran <rajeshpr@lsil.com> Notes: svn path=/head/; revision=120988
* Use bioq_flush() to drain a bio queue with a specific error code.Poul-Henning Kamp2003-04-011-0/+1
| | | | | | | | | | | Retain the mistake of not updating the devstat API for now. Spell bioq_disksort() consistently with the remaining bioq_*(). #include <geom/geom_disk.h> where this is more appropriate. Notes: svn path=/head/; revision=112946
* Centralize the devstat handling for all GEOM disk device driversPoul-Henning Kamp2003-03-081-1/+0
| | | | | | | | | | | in geom_disk.c. As a side effect this makes a lot of #include <sys/devicestat.h> lines not needed and some biofinish() calls can be reduced to biodone() again. Notes: svn path=/head/; revision=111979
* NO_GEOM cleanup:Poul-Henning Kamp2003-02-241-1/+0
| | | | | | | | | Move to new "struct disk *" centered API". OK'ed by: emoore Notes: svn path=/head/; revision=111441
* Use the standard DISKFLAG_OPEN instead of implementing our own.Poul-Henning Kamp2003-02-221-2/+0
| | | | | | | Use noclose() instead now that our close method is empty. Notes: svn path=/head/; revision=111250
* (1) Problem: PANIC when loading/unloading driverEric Moore2002-12-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | as module. This also fix's issue kern/45713. Fix - polling was implemented incorrectly for adapter enquiry and adapter flush. (2) Problem: PANIC when unloading driver as module. Fix - device nodes are not destroyed for amr0, and amrd* when driver is unloaded (3) Problem: PANIC from loading driver when 3ware adapter present, error message "Warning "amrd is usurping twed's bmaj" Fix - put #idef freebsd version < 500000 for bmaj -1 -> amrd_cdevsw (4) Problem: warnings in driver when compiling with DAMR_DEBUG param enabled in Makefile Fix - fix the warnings so driver can compile when -Werror is present in Makefile. Approved by: jhb MFC: 7 days Notes: svn path=/head/; revision=107756
* amr.c,Eric Moore2002-10-301-3/+26
| | | | | | | | | | | | | | | | | | | | | | amr_cam.c, amrreg.h, amrvar.h: - added support for 12/16 byte cdb's, effecting CAM branch only ( non-disk support ) amrreg.h: - increased number of scatter gather elements from 16 to 26. amr_pci.c: - amr_pci_free(), incorrect bus tag meant for 'amr_mailbox_dmat' was being freed all: - copyright change requested by scottl Reviewed by: ps,scottl MFC after: 1 week Notes: svn path=/head/; revision=106225
* (1) added LSI Logic copyright, and legal line 3 in license, and stringEric Moore2002-10-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | changes for "LSILogic" (2) enabled non-disk support through CAM interface (3) HA_INQ (a) enabled tagged queuing (b) disable reset during driver loading (b) renamed BSDi string to LSI (4) disabled detecting disk devices during SCSI INQUIRY (5) changed dcdb single element sglist to send one entire buffer chunk (6) nsgelem not set in sglist (7) ap_data_transfer_length not set for dcdb (8) changed "struct thread" to "d_thread_t" for compatibliity { xxx_open, xxx_close, xxx_ioctl } (9) miscellaneous compatiblity fixes (10) bug fix for 0x0409/0x1000 card (11) added compiling amr_cam.c in sys/conf/files (12) added compiling amr_cam.c in sys/modules/amr/Makefile Reviewed by:ps MFC after:1 week 1 week Notes: svn path=/head/; revision=105419
* Make FreeBSD "struct disklabel" agnostic, step 311 of 723:Poul-Henning Kamp2002-09-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename diskerr() to disk_err() for naming consistency. Drop the by now entirely useless struct disklabel argument. Add a flag argument for new-line termination. Fix a couple of printf-format-casts to %j instead of %l. Correctly print the name of all bio commands. Move the function from subr_disklabel.c to subr_disk.c, and from <sys/disklabel.h> to <sys/disk.h>. Use the new disk_err() throughout, #include <sys/disk.h> as needed. Bump __FreeBSD_version for the sake of the aac disk drivers #ifdefs. Remove unused disklabel members of softc for aac, amr and mlx, which seem to originally have been intended for diskerr() use, but which only rotted and got Copy&Pasted at least two times to many. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=103675
* Staticise the amr devclass.Mike Smith2002-01-081-2/+0
| | | | Notes: svn path=/head/; revision=89055
* Update to C99, s/__FUNCTION__/__func__/,David E. O'Brien2001-12-101-3/+3
| | | | | | | also don't use ANSI string concatenation. Notes: svn path=/head/; revision=87599
* Major update to the AMI MegaRAID driver.Mike Smith2000-08-301-98/+194
| | | | | | | | | | | | | | | | | | | - New support for 40LD firmware found in Series 475 and 471 adapters. - Better support for 8LD firmware adapters - Ioctl passthrough interface for userland utilities. - Improved error handling and queueing. - Several bugfixes (including the 'still open' shutdown bug and closing some small race conditions). - Zone-style command allocator, reducing memory wasted under heavy load conditions. - CAM interface (disabled and not fully working) for SCSI passthrough access to non-disk devices Thanks to AMI for supplying a pile of new adapters and various other help in making this happen. Notes: svn path=/head/; revision=65245
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-3/+3
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-3/+3
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* Complete the bio/buf divorce for all code below devfs::strategyPoul-Henning Kamp2000-04-151-2/+2
| | | | | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS Notes: svn path=/head/; revision=59249
* Update to latest working version.Mike Smith2000-04-011-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add periodic status monitoring routine. Currently just detects lost commands, further functionality pending data from AMI. Add some new commands states; WEDGED (never coming back) and LATE (for when a command that wasmarked as WEDGED comes bacj, - Remove a number of redundant efforts to poll the card for completed commands. This is what interrupt handlers are for. - Limit the maximum number of outstanding I/O transactions. It seems that some controllers report more than they can really handle, and exceding this limit can cause the controller to lock up. - Don't use 'wait' mode for anything where the controller might not be able to generate interrupts. (Keep the 'wait' mode though sa it will become useful when we start taking userspace commands. - Use a similar atomic locking trategy to the Mylex driver to prevent some reentrancy problems. - Correctly calculate the block count for non-whoile-bloch transfers (actually illegal). - Use the dsik device's si_drv1 field instead of b_driver1 in the buf struct to pass the driver identifier arond. - Rewrite amr_start and amr_done() along the lines of the Mylex driver in order to improve robustnes. - Always force the PCI busmaster bit on. Notes: svn path=/head/; revision=58883
* Fix detection of the card-ready-for-command state. Use an ultimateMike Smith2000-03-231-2/+2
| | | | | | | | | | | | | timeout closer to the 1-second value that AMI use in their Linux driver, and mark the mailbox structures as volatile so that gcc doesn't over-optimise access to them. This should fix the "controller wedged" bug. Submitted by: Brian Dean <brdean@unx.sas.com> Notes: svn path=/head/; revision=58496
* Change the queueing model used by the controller to drastically reduceMike Smith1999-10-261-2/+2
| | | | | | | | | the time spent at splbio(). We now avoid it unless we are actually manipulating the command queues themselves. This doesn't improve performance noticeably, but should improve concurrency somewhat. Notes: svn path=/head/; revision=52543
* This is a driver for the AMI MegaRAID family of controllers. It all ofMike Smith1999-10-071-0/+216
the AMI PCI controllers using the 8LD firmware interface (40LD firmware will be supported as soon as I have hardware to test with). These controllers are rebadged by Dell as the PERC, as well as by HP and possibly other vendors. Notes: svn path=/head/; revision=51974