summaryrefslogtreecommitdiff
path: root/sys/dev/amr/amr_cam.c
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite the DMA code paths from being an impenitrable maze of special casesScott Long2007-12-121-53/+38
| | | | | | | | 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
* Provide unqiue malloc types instead of using M_DEVBUF.Scott Long2007-12-021-6/+7
| | | | Notes: svn path=/head/; revision=174194
* Refactor completion handlers so that they can be combined into a singleScott Long2007-12-021-76/+29
| | | | | | | function. Add missing locking. Notes: svn path=/head/; revision=174193
* Make a pass at style.9 complianceScott Long2007-12-021-440/+477
| | | | Notes: svn path=/head/; revision=174186
* Turn the CAM passthroug interface to AMR back ON. Adjust theScott Long2007-11-281-79/+67
| | | | | | | | | | | | T_DIRECT filtering so that disk drives can be attached via the pass driver. Add CAM locking. Don't mark CAM commands as SG64 since the hardware isn't designed to deal with 64-bit passthru commands. Hopefully the bounce buffer changes that were done for the management/ioctl interface are robust enough to handle this deficiency for CAM as well. Notes: svn path=/head/; revision=174030
* Prepare for future integration between CAM and newbus. xpt_bus_registerScott Long2007-06-171-1/+1
| | | | | | | | | | 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-0/+1
| | | | | | | | | | | | | | 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
* 2nd and final commit that moves us to CAM_NEW_TRAN_CODEMatt Jacob2006-11-021-20/+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-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Mega update to the LSI MegaRAID driver:Scott Long2005-12-141-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-9/+0
| | | | | | | MFC After: 3 days Notes: svn path=/head/; revision=152119
* Complete the removal of __FreeBSD_version checks from the amr driver. TheScott Long2005-08-081-1/+1
| | | | | | | | driver had advanced enough over the years that direct sharing of code with FreeBSD 4.x was in no way possible anymore. Notes: svn path=/head/; revision=148850
* Remove some unused variables.Scott Long2005-02-091-2/+0
| | | | Notes: svn path=/head/; revision=141576
* Remove the messy locking dance around xpt_done()Scott Long2005-02-091-8/+0
| | | | Notes: svn path=/head/; revision=141567
* Lock the AMR driver:Scott Long2005-01-161-0/+16
| | | | | | | | | | | | | - 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-5/+10
| | | | | | | | | | 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
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139749
* Fix a number of bugs and significantly alter the command execution path toScott Long2004-12-051-3/+3
| | | | | | | | | | | | | 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 __FBSDID().David E. O'Brien2003-08-241-4/+5
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Merge common XPT_CALC_GEOMETRY functions into a single convenience function.Nate Lawson2003-06-141-16/+1
| | | | | | | | | | | | | | | | Devices below may experience a change in geometry. * Due to a bug, aic(4) never used extended geometry. Changes all drives >1G to now use extended translation. * sbp(4) drives exactly 1 GB in size now no longer use extended geometry. * umass(4) drives exactly 1 GB in size now no longer use extended geometry. For all other controllers in this commit, this should be a no-op. Looked over by: scottl Notes: svn path=/head/; revision=116351
* Use bioq_flush() to drain a bio queue with a specific error code.Poul-Henning Kamp2003-04-011-1/+0
| | | | | | | | | | | 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
* (1) Problem: PANIC when loading/unloading driverEric Moore2002-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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-31/+156
| | | | | | | | | | | | | | | | | | | | | | 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-24/+79
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Further use of M_ZERO.David Malone2000-11-181-2/+1
| | | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Approved by: msmith Notes: svn path=/head/; revision=68877
* Major update to the AMI MegaRAID driver.Mike Smith2000-08-301-0/+452
- 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