summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac/aacvar.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thiseadler2013-11-301-1/+1
| | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva
* As it turns out, MSIs are broken with 2820SA so introduce an AAC_FLAGS_NOMSImarius2013-08-061-4/+4
| | | | | | | | | | | | | | | | | quirk and apply it to these controllers [1]. The same problem was reported for 2230S, in which case it wasn't actually clear whether the culprit is the controller or the mainboard, though. In order to be on the safe side, flag MSIs as being broken with the latter type of controller as well. Given that these are the only reports of MSI-related breakage with aac(4) so far and OSes like OpenSolaris unconditionally employ MSIs for all adapters of this family, however, it doesn't seem warranted to generally disable the use of MSIs in aac(4). While it, simplify the MSI allocation logic a bit; there's no need to check for the presence of the MSI capability on our own as pci_alloc_msi(9) will just fail when these kind of interrupts are not available. Reported and tested by: David Boyd [1] MFC after: 3 days
* Allow unmapped I/O via aacd(4). It shouldn't be too hard to add themarius2013-05-301-0/+2
| | | | | same support for aacp(4), I'm lacking the necessary hardware for testing, though.
* - Remove pointless returns.marius2013-05-301-3/+3
| | | | | | - Make cm_data a void pointer and cm_flags unsigned as appropriate. MFC after: 3 days
* - Make tables, device ID strings etc const. This includes #ifdef'ing 0marius2013-03-011-23/+22
| | | | | | | | | | | | | | | | | | | aac_command_status_table, which is actually unused since r111532. While at it, make aac_if a pointer to the now const interface tables instead of copying them over to the softc (this alone already reduces the size of aac.ko on amd64 by ~1 KiB). - Remove redundant softc members. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. - Remove redundant bzero(9)'ing of the softc. - Use pci_enable_busmaster(9) instead of duplicating it. - Remove redundant checking for PCIM_CMD_MEMEN (resource allocation will just fail). - Canonicalize the error messages in case of resource allocation failures. - Add support for using MSI instead of INTx, controllable via the tunable hw.aac.enable_msi (defaulting to on). MFC after: 1 month
* - Fix races on detach handling of AAC_IFFLAGS_* maskattilio2011-06-101-4/+3
| | | | | | | | | | | | - Fix races on setting AAC_AIFFLAGS_ALLOCFIBS - Remove some unused AAC_IFFLAGS_* bits. Please note that the kthread still makes a difference between the total mask and AAC_AIFFLAGS_ALLOCFIBS because more flags may be added in the future to aifflags. Sponsored by: Sandvine Incorporated Reported and reviewed by: emaste MFC after: 2 weeks
* We can pass a format string and args to panic(), so instead of usingemaste2011-02-041-14/+8
| | | | | | | | printf() to output some information before a panic, just include that information in the panic. Submitted by: bde Reviewed by: bde
* Include driver name in panic string, to make it easier to find these shouldemaste2011-02-031-4/+4
| | | | the panic ever occur.
* Previously, the aac driver did not handle enclosure management AIFs,emaste2010-09-291-0/+5
| | | | | | | which were raised during hot-swap events. Now such events trigger cam rescans, as is done in the mps driver. Submitted by: Mark Johnston <mjohnston at sandvine dot com>
* Fix bogus busying mechanism from cdevsw callbacks:attilio2010-09-151-2/+1
| | | | | | | | | | | | | | - D_TRACKCLOSE may be used there as d_close() are expected to match up d_open() calls - Replace the hand-crafted counter and flag with the device_busy()/device_unbusy() proper usage. Sponsored by: Sandvine Incorporated Reported by: Mark Johnston <mjohnston at sandvine dot com> Tested by: Mark Johnston Reviewed by: emaste MFC after: 10 days
* Whitespace cleanup, in advance of next sync with Adaptec's driver. Noemaste2010-04-131-10/+10
| | | | functional change.
* Diff reduction with Adaptec's vendor driver.emaste2010-02-141-0/+10
| | | | | Driver version 2.1.9 chosen as that Adaptec version roughly corresponds with the current feature set merged to the in-tree driver.
* Garbage collect Falcon/PPC support that has not been used in releasedemaste2010-02-121-1/+0
| | | | products, based on discussion with Adaptec.
* - Try pre-allocating all FIBs upfront. Previously we tried pre-allocatingjkim2009-12-081-7/+0
| | | | | | | | | | | 128 FIBs first and allocated more later if necessary. Remove now unused definitions from the header file[1]. - Force sequential bus scanning. It seems parallel scanning is in fact slower and causes more harm than good[1]. Adjust a comment to reflect that. PR: kern/141269 Submitted by: Alexander Sack (asack at niksun dot com)[1] Reviewed by: scottl
* Rename aac_fast_intr to aac_filter to reflect its current use. Eliminateemaste2009-10-291-1/+1
| | | | | | | the fallback of using the filter as an interrupt handler, as it is no longer needed. Discussed with: scottl, jhb
* Increase AAC_CMD_TIMEOUT from 30s to 120s to help avoid spuriousemaste2009-09-091-1/+1
| | | | | | "COMMAND 0x........ TIMEOUT AFTER .. SECONDS" messages. Any commands that get truly stuck will still trigger the warning and the hardware health check, just a little bit later.
* Sync with the official Adaptec vendor driver:attilio2009-02-211-17/+33
| | | | | | | | | | | | | | | | | | | | | [1] Add the support for the NARK controller which seems a variant of the i960Rx. [2] Split up memory regions and other resources in 2 different parts as long as NARK uses them separately (it is not clear to me why though as long as there are no more informations available on this controller). Please note that in all the other cases, the regions overlaps leaving the default behaviour for all the other controllers. [3] Implement a clock daemon responsible for maintain updated the wall clock time of the controller (run any 30 minutes)*. Submitted by: Adaptec (driver build 15317 [1, 2] and 15727 [3]) Reviewed by: emaste Tested by: emaste Sponsored by: Sandvine Incorporated * Please note that originally, in the Adaptec driver, the clock daemon is not implemented with callouts as in our in-tree driver.
* Add 64-bit array support for RAIDs > 2TB. This corresponds to ~ Adaptecemaste2008-03-251-1/+2
| | | | | | | | | | driver build 15317. Tested on: Adaptec 2230S, Firmware 4.2-0 (8205) ICP ICP5085BL, Firmware 5.2-0 (12814) Submitted by: Adaptec
* Diff reduction to Adaptec's driver (around build 15317): catch up with aemaste2008-03-241-16/+12
| | | | | | | change in debugging routines. The fwprintf macro in the AAC_DEBUG case (mapping to printf) isn't from the Adaptec driver.
* Allow simultaneous opens of the device for issuing commands to theemaste2007-12-071-7/+13
| | | | controller. This is merged from Adaptec driver build 11669.
* o break newbus api: add a new argument of type driver_filter_t topiso2007-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@
* Mega Update to the aac driver to support a whole new family of cards andscottl2005-10-081-8/+52
| | | | | | | | | | | | | | | | | | | | | the modified interface that they use. Changes include: - Register a different interrupt handler for the new interface. This one is INTR_MPSAFE, not INTR_FAST, and directly processes completions and AIFs. - Add an event registration and callback mechanism for the ioctl and CAM modules can know when a resource shortage clears. This condition was previously fatal in CAM due to programming oversights. - Fix locking to play better with newbus. - Provide access methods for talking to cards with the NEWCOMM interface. - Fix up the CAM module to be better suited for dealing with newer firmware on the PERC Si/Di series that requires talking to plain SCSI via aac. - Add a whole slew of new PCI Id's. Thanks to Adaptec for providing an initial version of this work and for answering countless questions about it. There are still some rough edges in this, but it works well enough to commit and test for now. Obtained from: Adaptec, Inc.
* Add support for the Adaptec RAID-On-Chip architecture. This in turnscottl2004-08-131-1/+3
| | | | | provides support for the Adaptec 2130S adapter. Thanks to Adaptec for providing hardware for this.
* Remove the AAC_LOCK macros. They no longer abstract anything and onlyscottl2004-08-121-12/+5
| | | | obfuscate the code. No functional differences.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-1/+1
| | | | Bump __FreeBSD_version accordingly.
* Collapse sync fib locking into normal i/o locking. The former didn'tscottl2004-06-021-7/+21
| | | | | | | | protect the registers so it was trivially possible for a sync command and i/o command to fight each other and confuse the controller. Make the sync fib alloc/release functions inline and remove the somewhat worthless AAC_SYNC_LOCK_FORCE flag. Thanks to Adil Katchi for helping me to track this down in RELENG_4.
* Turn down the queue size by 8 until I can figure out why the 512th commandscottl2004-05-301-1/+1
| | | | keeps on getting lost.
* Change the disk(9) API in order to make device removal more robust.phk2004-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.
* Do some small cleanups to comments and remove AACQ_COMPLETE definitions sincescottl2004-02-071-2/+1
| | | | the completion queue is long-gone.
* Remove the hack of lowering AAC_MAX_FIB now that the root cause of thescottl2004-02-071-1/+1
| | | | problem was found.
* Reduce AAC_MAX_FIBS to work around some yet-unidentified bugs in thescottl2004-02-071-1/+1
| | | | | | | | handling of resources shortages. The driver is now so fast that it can completely fill all 512 slots on the card, but for some reason only 511 slots are being allocated. Anything that tries to go into the 512th slot gets silently lost. Both bugs need to be fixed at a later date, but this should fix the reports of hangs in getblk and vinvalb.
* Take the plunge and make this driver be INTR_FAST. This re-arranges thescottl2004-01-301-0/+1
| | | | | | | | | interrupt handler so that no locks are needed, and schedules the command completion routine with a taskqueue_fast. This also corrects the locking in the command thread and removes the need for operation flags. Simple load tests show that this is now considerably faster than FreeBSD 4.x in the SMP case when multiple i/o tasks are running.
* Consistently use the BSD u_int and u_short instead of the SYSV uint andjhb2003-08-071-1/+1
| | | | | | | ushort. In most of these files, there was a mixture of both styles and this change just makes them self-consistent. Requested by: bde (kern_ktrace.c)
* Handle the EINPROGRESS case of bus_dmamap_load() for data buffers.scottl2003-07-091-0/+2
|
* Add a new quirk for cards that incorrectly interpret the amount of memoryscottl2003-07-091-0/+1
| | | | in the system. This might also have a small performance gain.
* Use bioq_flush() to drain a bio queue with a specific error code.phk2003-04-011-0/+2
| | | | | | | | 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.
* Begin support for 64-bit address support and workarounds for newer cards:scottl2003-03-261-9/+16
| | | | | | | | | | | | | | | | | - Add data structuress for doing 64-bit scatter/gather - Move busdma tag creations around so that only the parent is created in aac_pci.c. - Retrieve the capabilities word from the firmware before setting up command structures and tags. This allows the driver to decide whether to do 64-bit commands, and if work-arounds are needed for systems with >2GB of RAM. - Only enable the SCSI passthrough if it's enabled in the capabilities word in the firmware. This should fix problems with the 2120S and 2200S cards in systems with more than 2GB of RAM. Full 64-bit support is forthcoming. MFC-After: 1 week
* Centralize the devstat handling for all GEOM disk device driversphk2003-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.
* The aac driver has evolved enough over the last few months that it noscottl2003-03-011-51/+6
| | | | | longer resembles the 4.x version very much. Garbage collect the legacy bits.
* Bring aac out from under Giant:scottl2003-02-261-1/+5
| | | | | | | | | | | | | | - the mutex aac_io_lock protects the main codepaths which handle queues and hardware registers. Only one acquire/release is done in the top-half and the taskqueue. This mutex also applies to the userland command path and CAM data path. - Move the taskqueue to the new Giant-free version. - Register the disk device with DISKFLAG_NOGIANT so the top-half processing runs without Giant. - Move the dynamic command allocator to the worker thread to avoid locking issues with bus_dmamem_alloc(). This gives about 20% improvement in most of my benchmarks.
* Move to 'struct disk*' APIscottl2003-02-261-1/+0
| | | | Submitted by: phk
* The completion queue is no longer used, so nuke its associated codescottl2003-02-201-3/+0
| | | | and data structures.
* Fix a 64-bit bogon. The hardware command structure only has one 32 bitscottl2003-02-191-0/+1
| | | | | | | field for holding driver-dependant data. Instead of putting the pointer to the driver command struct in there, take advantage of these structs being a (virtually) contiguous array and just put the array index in the field.
* o Move the cleanup of the fib maps into aac_free_commands() so as toscottl2003-02-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | retain symetry with aac_alloc_commans(). Since aac_alloc_commands() allocates fib maps and places them onto the fib lists, aac_free_commands() should reverse those operations. o Combine two ifs with the same body with an ||. o Switch from uintptr_t to uint32_t for fib map load operations. The target is a uint32_t so using this type for the map load call avoids an extra cast. uintptr_t should only be used when you need an "int sized the same as the machine's poitner size" which is not the case here. o Removed the commented out M_WAITOK flag in the allocation in aac_alloc_commands(). The kernel will only block in the allocator if it can grow the size of the kernel. This usually results in a page-out which could involve this aac device. Thus, sleeping here could deadlock the machine. Assuming this operation is occurring outside of attach time, we have enough fibs to operate anyway, so waiting for fibs to free up is okay if not optimal. o In aac_alloc_commands(), if we cannot dmamem_alloc additional fib space, free the fib map. o In aac_alloc_commands(), if we cannot create per-command dmamaps, don't lose track of the fib map that is mapping all of the commands that we have already released into the free pool. Instead, just cut out of the loop and modify aac_free_commands to not attempt to free maps that have not been allocated. o Don't use a magic number when pre-allocating fibs. o Use PAGE_SIZE to allocate in page sized chunks instead of an architecture specific constant. Submitted by: gibbs
* Implement a new dynamic command allocator. FIBs are allocated in 1 pagescottl2003-02-101-9/+14
| | | | | | | | blocks now, which should eliminate problems with the driver failing to attach due to insufficient contiguous RAM. Allow the FIB pool to grow from the default of 128 to the max of 512 as demand grows. Also pad the adapter init struct to work around the 2120/2200 DMA bug now that there is no longer a FIB slab.
* Don't include aac_cam.h, since it was nuked in the last commit.scottl2003-02-061-0/+1
| | | | Deregister the shutdown eventhandler on unload.
* Various cleanups:scottl2003-02-051-4/+18
| | | | | | | | | | | - Move the command timeout check from a separate repeating timeout to the kthread since the kthread is already running periodically. - Move printing the hardware print buffer to the kthread. - Properly shut down the kernel thread on detach. - Detach the child array devices on detach. - Don't issue a controller halt command on detach. Doing so requires a PCI reset to wake the controller back up. The driver can now be unloaded as long as CAM support is not enabled.
* Make FreeBSD "struct disklabel" agnostic, step 311 of 723:phk2002-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.
* Constify a debug function arg that we pass __func__ to in order to pacifypeter2002-05-241-1/+1
| | | | gcc-3.1's 'const char *__func__;'
* Add a CAM interface to the aac driver. This is useful in case you shouldscottl2002-04-271-1/+10
| | | | | | | | | | | | | | | ever connect a SCSI Cdrom/Tape/Jukebox/Scanner/Printer/kitty-litter-scooper to your high-end RAID controller. The interface to the arrays is still via the block interface; this merely provides a way to circumvent the RAID functionality and access the SCSI buses directly. Note that for somewhat obvious reasons, hard drives are not exposed to the da driver through this interface, though you can still talk to them via the pass driver. Be the first on your block to low-level format unsuspecting drives that are part of an array! To enable this, add the 'aacp' device to your kernel config. MFC after: 3 days
OpenPOWER on IntegriCloud