summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac/aac.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r280347: Remove MAXBSIZE use from drivers where it has nothing to do.mav2015-04-211-2/+2
| | | | | In some cases limits are just not needed, in others -- DFLTPHYS is the right constant to use instead.
* MFC 266281:jhb2014-06-041-0/+1
| | | | | | | | Clear the data buffer length field when freeing a command structure so that it doesn't leak through when the command structure is reused for a user command without a data buffer. PR: 189668
* MFC: r260044marius2014-04-251-1/+3
| | | | | | Free the MSI again on detach if allocated. Arguably, this code would be better off living in aac_pci.c, but it doesn't seem worth creating a aac_pci_detach() and it's also not the first PCI-specific bit in aac.c
* Allow unmapped I/O via aacd(4). It shouldn't be too hard to add themarius2013-05-301-6/+10
| | | | | same support for aacp(4), I'm lacking the necessary hardware for testing, though.
* - Remove pointless returns.marius2013-05-301-9/+0
| | | | | | - 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-36/+23
| | | | | | | | | | | | | | | | | | | 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
* Add a sysctl to report the firmware build number.emaste2012-02-131-0/+9
| | | | | | | Some older firmware versions have issues that can be worked around by avoiding certain operations. Add a sysctl dev.aac.#.firmware_build to make it easy for scripts or userland tools to detect the firmware version.
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-1/+1
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-1/+1
| | | | This means that their use is restricted to a single C file.
* - Fix races on detach handling of AAC_IFFLAGS_* maskattilio2011-06-101-10/+13
| | | | | | | | | | | | - 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
* Revert part of r173264. Both aac_ioctl_sendfib and aac_ioctl_send_raw_srbemaste2011-02-031-5/+1
| | | | | | | | | | make use of the aac_ioctl_event callback, if aac_alloc_command fails. This can end up in an infinite loop in the while loop in aac_release_command. Further investigation into the issue mentioned by Scott Long [1] will be necessary. [1] http://lists.freebsd.org/pipermail/freebsd-current/2007-October/078740.html
* Previously, the aac driver did not handle enclosure management AIFs,emaste2010-09-291-0/+22
| | | | | | | 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>
* Use device_printf where possible, and otherwise at least include theemaste2010-09-161-1/+1
| | | | | | driver name in printf strings. Reported by: Mark Johnston
* Implement device unbusying via a cdevpriv destructor.attilio2010-09-161-15/+18
| | | | | | | | Suggested by: jhb Tested by: Mark Johnston <mjohnston at sandvine dot com> Reviewed by: emaste, jhb MFC after: 10 days X-MFC: r212661
* Fix bogus busying mechanism from cdevsw callbacks:attilio2010-09-151-10/+3
| | | | | | | | | | | | | | - 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
* Avoid repeatedly spamming the console while a timed out command is waitingemaste2010-09-141-1/+6
| | | | | | | to complete. Instead, print one message after the timeout period expires, and one more when (if) the command eventually completes. MFC after: 1 month
* Sync some minor items with the upstream driver. Should have no functionalemaste2010-04-131-1/+1
| | | | change.
* Whitespace cleanup, in advance of next sync with Adaptec's driver. Noemaste2010-04-131-1/+1
| | | | functional change.
* Make the code more readable and compiling on 64-bits arch differentattilio2010-03-151-5/+1
| | | | | | | | | than amd64. Sponsored by: Sandvine Incorporated Submitted by: emaste MFC: 2 weeks X-MFC: r205160
* Checkin a facility for specifying a passthrough FIB from userland.attilio2010-03-141-1/+141
| | | | | | | | | | | | | | arcconf tool by Adaptec already seems to use for identifying the Serial Number of the devices. Some simple things (like FIB setup and bound checks) are retrieved from the Adaptec's driver, but this implementation is quite different because it does use the normal buffer dmat area for loading segments and not a special one (like the Adaptec's one does). Sponsored by: Sandvine Incorporated Discussed with: emaste, scottl Reviewed by: emaste, scottl MFC: 2 weeks
* Minor diff reduction with Adaptec's driver: in aac_release_command() setemaste2010-02-231-2/+1
| | | | | cm_queue to AAC_ADAP_NORM_CMD_QUEUE by default. In every place it was set, it was set to AAC_ADAP_NORM_CMD_QUEUE anyhow.
* Include command type in COMMAND TIMEOUT messages to aid in debugging.emaste2010-02-171-2/+3
|
* Diff reduction with Adaptec's vendor driver.emaste2010-02-141-8/+11
| | | | | 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-105/+0
| | | | products, based on discussion with Adaptec.
* Remove extraneous semicolons, no functional changes.mbr2010-01-071-1/+1
| | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week
* - Try pre-allocating all FIBs upfront. Previously we tried pre-allocatingjkim2009-12-081-1/+1
| | | | | | | | | | | 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-11/+7
| | | | | | | the fallback of using the filter as an interrupt handler, as it is no longer needed. Discussed with: scottl, jhb
* Do first controller time sync after 1 minute, as in Adaptec's vendoremaste2009-10-281-1/+1
| | | | driver.
* Whitespace fixup: 8 spaces -> tabemaste2009-10-271-2/+2
|
* Whitespace tweak.emaste2009-09-091-1/+1
| | | | Submitted by: phk, via accidental commit in r196969.
* Revert previous commit and add myself to the list of people who shouldphk2009-09-081-1/+1
| | | | know better than to commit with a cat in the area.
* Add necessary include.phk2009-09-081-1/+1
|
* Temporarily revert the new-bus locking for 8.0 release. It will bejhb2009-08-201-4/+4
| | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio
* Make the newbus subsystem Giant free by adding the new newbus sxlock.attilio2009-08-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
* We no longer need to use d_thread_t, migrate to struct thread *.imp2009-05-201-4/+4
|
* SVN rev 188743 modified aac_rx_get_fwstatus to use the AAC_RX_OMR0emaste2009-02-231-2/+4
| | | | | | | | | | | | | register instead of AAC_RX_FWSTATUS, as that is the way it's done in Adaptec's vendor driver and in the Linux drivers. (The same applies to aac_rkt_get_fwstatus as well.) However, a concern has been raised about the compatibility of this change and old hardware / firmware versions. In the absense of specific information, revert to the original behaviour if the firmware does not support the "New comm." interface. Users of old cards or firmware haven't reported the problems that are potentially solved by switching to OMR0.
* Sync with the official Adaptec vendor driver:attilio2009-02-211-81/+122
| | | | | | | | | | | | | | | | | | | | | [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.
* Use outbound message register 0 instead of mailbox 7 inemaste2009-02-181-2/+2
| | | | | | | aac_{rx,rkt}_get_fwstatus, as done in Adaptec's vendor driver as well as the Linux drivers. Submitted by: jkim, from Adaptec's driver
* Fix test for waiting AIFs in aac_poll(). This seems to solve theemaste2008-06-241-2/+7
| | | | | | | | problem where Adaptec's arcconf monitoring tool hangs after producing its expected output. Submitted by: Adaptec, via driver ver 15317 MFC after: 1 week
* Calling RequestSupplementAdapterInfo before RequestAdapterInfo appearsemaste2008-04-011-17/+17
| | | | | | | | | | | | | | | | | | | | | to trip a bug causing the latter to return a zeroed struct aac_adapter_info. This causes two issues. One is cosmetic only -- a verbose boot prints information about the controller, and shows all zero: aac0: Unknown processor 0MHz, 0MB memory (0MB cache, 0MB execution), unknown battery platform The second problem is that the firmware version information is stored away for aac_rev_check, for userland tools (like aaccli) to query via the FSACTL_MINIPORT_REV_CHECK and FSACTL_LNX_MINIPORT_REV_CHECK ioctls. When aaccli encounters this issue it prints Command Error: <The current AFAAPI.DLL is too old to work with the current controller software.> Move the RequestSupplementAdapterInfo call after RequestAdapterInfo, which seems to fix both problems.
* Implement FSACTL_LNX_GET_FEATURES and FSACTL_GET_FEATURES ioctls. RAIDemaste2008-03-281-0/+44
| | | | | | tools (e.g. arcconf) need this to be able to create arrays larger than 2TB. Submitted by: Adaptec, via driver build 15317
* Add \n to the end of a printf string and remove it from panic strings.emaste2008-03-261-6/+6
|
* Add 64-bit array support for RAIDs > 2TB. This corresponds to ~ Adaptecemaste2008-03-251-1/+8
| | | | | | | | | | driver build 15317. Tested on: Adaptec 2230S, Firmware 4.2-0 (8205) ICP ICP5085BL, Firmware 5.2-0 (12814) Submitted by: Adaptec
* Correct data direction flags in aac_bio_command() in theemaste2008-03-251-2/+2
| | | | | | !AAC_FLAGS_RAW_IO && AAC_FLAGS_SG_64BIT case. Submitted by: Adaptec
* Diff reduction to Adaptec's driver (around build 15317): catch up with aemaste2008-03-241-113/+97
| | | | | | | change in debugging routines. The fwprintf macro in the AAC_DEBUG case (mapping to printf) isn't from the Adaptec driver.
* Diff reduction to Adaptec driver build 15317 (refactoring and code shuffling):emaste2008-03-241-187/+206
| | | | | | | | - Resource allocation in aac_alloc (moved from from aac_init) - Interrupt setup in aac_setup_intr (from aac_attach) - Container probing in aac_get_container_info (from aac_startup and aac_handle_aif) - Firmware status check moved to aac_check_firmware from aac_init
* Restore creation of passthrough devices with newer controller firmware byemaste2008-03-201-2/+2
| | | | | | | | | | | putting the correct size in the fib header. Presumably the older firmware silently ignored a bad size field. (This change tested with a 3805 controller. Passthrough devices were created when running firmware build 12814, but not 15323 or later. With this change they're created for both old and new firmware versions.) Submitted by: Adaptec
* Add ioctls FSACTL_SEND_LARGE_FIB, FSACTL_SEND_RAW_SRB,emaste2008-03-201-8/+31
| | | | | | | | FSACTL_LNX_SEND_LARGE_FIB, and FSACTL_LNX_SEND_RAW_SRB, and correct size checks on FIBs passed in from userspace. Both changes were obtained from Adaptec's driver build 15317. Adaptec's commandline RAID tool arcconf uses these ioctls when creating a RAID-10 array (and probably other operations too).
* Change spelling and eliminate a typo in comments to reduce diffs withemaste2008-03-141-11/+11
| | | | | Adaptec's vendor driver. I have some fixes to bring in and this makes ongoing review of the FreeBSD-Adaptec driver diffs easier.
* Avoid holding the aac_io_lock over copyout.emaste2007-12-201-5/+6
| | | | Submitted by: Achim Leubner @ Adaptec.
OpenPOWER on IntegriCloud