summaryrefslogtreecommitdiff
path: root/sys/dev/amr/amr.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-03-031-13/+5
| | | | | | | | | | | | | | | | 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
* Introduce a new taskqueue that runs completely free of Giant, and inScott Long2003-02-261-1/+1
| | | | | | | | | | turns runs its tasks free of Giant too. It is intended that as drivers become locked down, they will move out of the old, Giant-bound taskqueue and into this new one. The old taskqueue has been renamed to taskqueue_swi_giant, and the new one keeps the name taskqueue_swi. Notes: svn path=/head/; revision=111528
* NO_GEOM cleanup:Poul-Henning Kamp2003-02-241-1/+1
| | | | | | | | | Move to new "struct disk *" centered API". OK'ed by: emoore Notes: svn path=/head/; revision=111441
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-2/+2
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-2/+2
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Fix for DELL PERC firmware. Driver was hangingEric Moore2003-01-091-2/+16
| | | | | | | | | | | | during load time; this attributed to the mailbox busy byte not being set prior to issuing a polling command. Approved by: ps MFC: 7 days Notes: svn path=/head/; revision=109031
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/Jens Schweikhardt2002-12-301-1/+1
| | | | | | | Add FreeBSD Id tag where missing. Notes: svn path=/head/; revision=108470
* Problem: Hang while bootup on Perc2/SC.Eric Moore2002-12-131-2/+4
| | | | | | | | | | | Fix: Error handling wasn't implemented in newly implemented polling code for quartz controllers. Approved by: re@ Notes: svn path=/head/; revision=107827
* (1) Problem: PANIC when loading/unloading driverEric Moore2002-12-111-7/+72
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Incorrect typecast.Eric Moore2002-10-311-1/+1
| | | | Notes: svn path=/head/; revision=106252
* amr.c,Eric Moore2002-10-301-14/+103
| | | | | | | | | | | | | | | | | | | | | | 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-34/+40
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Be consistent about "static" functions: if the function is markedPoul-Henning Kamp2002-09-281-5/+5
| | | | | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512 Notes: svn path=/head/; revision=104094
* Fixed printf format errors in previous commit. %llu is no more suitableBruce Evans2002-03-181-2/+3
| | | | | | | | | | | than %u for printing signed 64-bit types. It fails on different machines, and has the wrong signdness. Fixed old printf format error on the same line. %u is not suitable for printing 32-bit types on all machines. Notes: svn path=/head/; revision=92610
* Formats that print the block number need to be changed from %u toWarner Losh2002-03-181-2/+2
| | | | | | | %llu due to recent changes in bio_pblkno's type. Notes: svn path=/head/; revision=92608
* Staticise the amr devclass.Mike Smith2002-01-081-2/+2
| | | | Notes: svn path=/head/; revision=89055
* - Change the taskqueue locking to protect the necessary parts of a taskJohn Baldwin2001-10-261-4/+0
| | | | | | | | | | | while it is on a queue with the queue lock and remove the per-task locks. - Remove TASK_DESTROY now that it is no longer needed. - Go back to inlining TASK_INIT now that it is short again. Inspired by: dfr Notes: svn path=/head/; revision=85560
* Add locking to taskqueues. There is one mutex per task, one mutex perJohn Baldwin2001-10-261-0/+4
| | | | | | | | | | | queue, and a mutex to protect the global list of taskqueues. The only visible change is that a TASK_DESTROY() macro has been added to mirror the TASK_INIT() macro to destroy a task before it is free'd. Submitted by: Andrew Reiter <awr@watson.org> Notes: svn path=/head/; revision=85521
* KSE Milestone 2Julian Elischer2001-09-121-3/+3
| | | | | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha Notes: svn path=/head/; revision=83366
* In case the driver runs on an HP NetRaid controller, attempt to properlyHellmuth Michaelis2001-03-281-3/+37
| | | | | | | | | | | | | | decode the BIOS and firmware version and announce the board as HP NetRaid. This has been tested with a NetRaid 3si controller, the BIOS/firmware printout should also work for other NetRaid controllers but the type detection for other NetRaids (such as the 1si) will not work due to the lack of hardware. Reviewed by: msmith Notes: svn path=/head/; revision=74936
* Send the remains (such as I have located) of "block major numbers" toPoul-Henning Kamp2001-03-261-1/+0
| | | | | | | the bit-bucket. Notes: svn path=/head/; revision=74810
* Remove some over-Mike Smith2000-11-281-4/+0
| | | | Notes: svn path=/head/; revision=69325
* MFS:Mike Smith2000-11-281-15/+30
| | | | | | | | | | | | | | | | Fix amr_map_command so that 40LD-specific commands get the scatter-gather list count in the right place. I don't understand why AMI did it like this, but now the AMI MegaManager can talk to the newer (1600 and later) controllers. Remove an unused variable. Include <machine/clock.h> when necessary. Tweak some debugging levels to make things more intelligible. Notes: svn path=/head/; revision=69319
* Don't test the return value from the actual command when determiningMike Smith2000-11-211-5/+0
| | | | | | | | success/failure for submission of the command. The caller will want to deal with this itself. Notes: svn path=/head/; revision=68990
* 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
* Remove unneeded #include <machine/clock.h>Poul-Henning Kamp2000-10-151-1/+0
| | | | Notes: svn path=/head/; revision=67164
* Whoops. The AMR_QUARTZ_GOFASTER option is meant to disable, not enableMike Smith2000-09-111-1/+1
| | | | | | | this check. It looks like it doesn't work on at least the 466 controllers. Notes: svn path=/head/; revision=65763
* Major update to the AMI MegaRAID driver.Mike Smith2000-08-301-865/+824
| | | | | | | | | | | | | | | | | | | - 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
* The AMI MegaRAID's internal memory map conflicts with scatter/gatherMike Smith2000-06-101-0/+9
| | | | | | | | | | | map physical addresses below 0x2000 (accoding to AMI). If we allocate our s/g tables and get an address below this point, leak the memory and try again. This should fix booting from these controllers. Notes: svn path=/head/; revision=61508
* Separate the struct bio related stuff out of <sys/buf.h> intoPoul-Henning Kamp2000-05-051-1/+1
| | | | | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter Notes: svn path=/head/; revision=60041
* Disable the returning of "wedged" commands; this is wrong and needs to beMike Smith2000-04-241-1/+8
| | | | | | | rethought. Notes: svn path=/head/; revision=59610
* Complete the bio/buf divorce for all code below devfs::strategyPoul-Henning Kamp2000-04-151-18/+18
| | | | | | | | | | | | | 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
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.Poul-Henning Kamp2000-04-021-1/+1
| | | | | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde. Notes: svn path=/head/; revision=58934
* Update to latest working version.Mike Smith2000-04-011-70/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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/+7
| | | | | | | | | | | | | 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
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newPoul-Henning Kamp2000-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful. Notes: svn path=/head/; revision=58345
* Increase the time we spend waiting for the controller to become ready toMike Smith2000-02-171-1/+1
| | | | | | | | | | | | | accept a new command; in high load cases it may be too busy for the old value. This loop needs something to tie it to real time, rather than just the CPU's ability to fetch from the L1 data cache, but this hack works for now. Approved by: jkh Notes: svn path=/head/; revision=57297
* Fix a printf format problem on the Alpha, where size_t == unsigned long,Peter Wemm1999-12-121-1/+1
| | | | | | | not unsigned int as on the x86. Notes: svn path=/head/; revision=54512
* Remove the 'ivars' arguement to device_add_child() andMatthew N. Dodd1999-12-031-1/+2
| | | | | | | | | | | | | | | | | | | device_add_child_ordered(). 'ivars' may now be set using the device_set_ivars() function. This makes it easier for us to change how arbitrary data structures are associated with a device_t. Eventually we won't be modifying device_t to add additional pointers for ivars, softc data etc. Despite my best efforts I've probably forgotten something so let me know if this breaks anything. I've been running with this change for months and its been quite involved actually isolating all the changes from the rest of the local changes in my tree. Reviewed by: peter, dfr Notes: svn path=/head/; revision=54073
* Don't print the chipset value; it's not useful.Mike Smith1999-11-021-2/+2
| | | | | | | | Now we know what some of the state values are, print the current array state. Notes: svn path=/head/; revision=52784
* Change the queueing model used by the controller to drastically reduceMike Smith1999-10-261-39/+47
| | | | | | | | | 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
* Use the physical block number, not the logical block number, for I/OMike Smith1999-10-221-3/+3
| | | | | | | | | | operations. The latter only works where the partion begins at the bottom of the disk. Whoops. Submitted by: Chris Csanady <cc@137.org> Notes: svn path=/head/; revision=52439
* This is a driver for the AMI MegaRAID family of controllers. It all ofMike Smith1999-10-071-0/+1498
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