aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/aac
Commit message (Collapse)AuthorAgeFilesLines
* MFC r280347: Remove MAXBSIZE use from drivers where it has nothing to do.Alexander Motin2015-04-211-2/+2
| | | | | | | | In some cases limits are just not needed, in others -- DFLTPHYS is the right constant to use instead. Notes: svn path=/stable/9/; revision=281827
* MFC 266281:John Baldwin2014-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 Approved by: re (delphij) Notes: svn path=/stable/9/; revision=267076
* MFC: r260044Marius Strobl2014-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 Notes: svn path=/stable/9/; revision=264939
* MFC: r254005Marius Strobl2013-09-261-21/+7
| | | | | | | | | | | | | - Fix a bug in the MSI allocation logic so an MSI is also employed if a controller supports only a single message. I haven't seen such an adapter out in the wild, though, so this change likely is a NOP. While at it, further simplify the MSI allocation logic; there's no need to check the number of available messages on our own as pci_alloc_msi(9) will just fail if it can't provide us with the single message we want. - Nuke the unused softc of aacch(4). Notes: svn path=/stable/9/; revision=255876
* MFC: 254004Marius Strobl2013-08-092-40/+41
| | | | | | | | | | | | | | | | | | | As it turns out, MSIs are broken with 2820SA so introduce an AAC_FLAGS_NOMSI 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 at 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] Notes: svn path=/stable/9/; revision=254153
* MFC r249468:Alexander Motin2013-07-081-1/+1
| | | | | | | | | | | Stop abusing xpt_periph in random plases that really have no periph related to CCB, for example, bus scanning. NULL value is fine in such cases and it is correctly logged in debug messages as "noperiph". If at some point we need some real XPT periphs (alike to pmpX now), quite likely they will be per-bus, and not a single global instance as xpt_periph now. Notes: svn path=/stable/9/; revision=253037
* MFC: r242823Marius Strobl2013-06-181-1/+1
| | | | | | | Give panic format string to pacify clang warning. Notes: svn path=/stable/9/; revision=251944
* MFC: r251116Marius Strobl2013-06-183-6/+13
| | | | | | | | | Allow unmapped I/O via aacd(4). It shouldn't be too hard to add the same support for aacp(4), I'm lacking the necessary hardware for testing, though. Notes: svn path=/stable/9/; revision=251941
* Big MFC of the physbio changes necessary for unmapped I/O. These changesScott Long2013-06-181-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | have been in production at Netflix for several months with significant success. MFC r246713: Reform the busdma API so that new types may be added without modifying every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. MFC r249538: Some compilers issue a warning when wider integer is casted to narrow pointer. Supposedly shut down the warning by casting through uintptr_t. MFC r251479: Simplify the checking of flags for cam_periph_mapmem(). This gets rid of a lot of code redundancy and grossness at very minor expense. MFC r251837: MFC r251842: Add infrastructure for doing compatibility shims, as has been sorely needed for the last 10 years. Far too much of the internal API is exposed, and every small adjustment causes applications to stop working. To kick this off, bump the API version to 0x17 as should have been done with r246713, but add shims to compensate. Thanks to the shims, there should be no visible change in application behavior. Submitted by: kib, jeffr Approved by: kib Obtained from: Netflix Notes: svn path=/stable/9/; revision=251874
* MFC: r251115Marius Strobl2013-06-094-20/+3
| | | | | | | | - Remove pointless returns. - Make cm_data a void pointer and cm_flags unsigned as appropriate. Notes: svn path=/stable/9/; revision=251568
* MFC: r247570, r247591Marius Strobl2013-05-286-111/+110
| | | | | | | | | | | | | | | | | | | | | - Make tables, device ID strings etc const. This includes #ifdef'ing 0 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). Notes: svn path=/stable/9/; revision=251070
* MFC r227293 (by ed):Alexander Motin2013-04-052-2/+2
| | | | | | | | | Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. This means that their use is restricted to a single C file. Notes: svn path=/stable/9/; revision=249132
* MFC: r227309 (partial)Marius Strobl2013-03-091-1/+1
| | | | | | | | | | | Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 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. Notes: svn path=/stable/9/; revision=248085
* MFC r240923Ryan Stone2013-03-081-27/+48
| | | | | | | | | | | | | | | | | | | | | | Some aac(4) adapters will always report that a direct access device is offline in response to a INQUIRY command that does not retreive vital product data(I personally have observed the behaviour on an Adaptec 2405 and a 5805). Force the peripheral qualifier to "connected" so that upper layers correctly recognize that a disk is present. This bug was uncovered by r216236. Prior to that fix, aac(4) was accidentally clearing the peripheral qualifier for all inquiry commands. This fixes an issue where passthrough devices were not created for disks behind aac(4) controllers suffering from the bug. I have verified that if a disk is not present that we still properly detect that and not create the passthrough device. Sponsored by: Sandvine Incorporated MFC after: 1 week Notes: svn path=/stable/9/; revision=248063
* MFC r231589: Add a sysctl to report the firmware build number.Ed Maste2012-11-191-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. Notes: svn path=/stable/9/; revision=243286
* MFC r238601Sean Bruno2012-09-231-1/+3
| | | | | | | | | On BIO_ERROR, set bio_resid to stop losing data in the error case. Submitted by: Mark Johnston <markjdb@gmail.com> Notes: svn path=/stable/9/; revision=240876
* MFC r238201:Eitan Adler2012-09-021-3/+0
| | | | | | | | | | Remove variables which are initialized but never used thereafter reported by gcc46 warning Approved by: cperciva (implicit) Notes: svn path=/stable/9/; revision=240043
* MFC r232668:Ed Maste2012-03-161-1/+1
| | | | | | | Use bus_get_dma_tag() to inherit the PCI bus' 4G boundary constraint. Notes: svn path=/stable/9/; revision=233032
* MFC r226173, r227843, r227848 and r227908:Hans Petter Selasky2011-12-311-3/+1
| | | | | | | | | Use DEVMETHOD_END to mark end of device methods. Remove superfluous device methods. Add some missing __FBSBID() macros. Notes: svn path=/stable/9/; revision=229093
* Merge from r225950:Marius Strobl2011-10-291-9/+11
| | | | | | | | | | Set the sense residual properly. Reviewed by: ken Approved by: re (kib) Notes: svn path=/stable/9/; revision=226910
* Second-to-last commit implementing Capsicum capabilities in the FreeBSDRobert Watson2011-08-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kernel for FreeBSD 9.0: Add a new capability mask argument to fget(9) and friends, allowing system call code to declare what capabilities are required when an integer file descriptor is converted into an in-kernel struct file *. With options CAPABILITIES compiled into the kernel, this enforces capability protection; without, this change is effectively a no-op. Some cases require special handling, such as mmap(2), which must preserve information about the maximum rights at the time of mapping in the memory map so that they can later be enforced in mprotect(2) -- this is done by narrowing the rights in the existing max_protection field used for similar purposes with file permissions. In namei(9), we assert that the code is not reached from within capability mode, as we're not yet ready to enforce namespace capabilities there. This will follow in a later commit. Update two capability names: CAP_EVENT and CAP_KEVENT become CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they represent. Approved by: re (bz) Submitted by: jonathan Sponsored by: Google Inc Notes: svn path=/head/; revision=224778
* - Fix races on detach handling of AAC_IFFLAGS_* maskAttilio Rao2011-06-102-14/+16
| | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=222951
* We can pass a format string and args to panic(), so instead of usingEd Maste2011-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 Notes: svn path=/head/; revision=218280
* Include driver name in panic string, to make it easier to find these shouldEd Maste2011-02-031-4/+4
| | | | | | | the panic ever occur. Notes: svn path=/head/; revision=218208
* Revert part of r173264. Both aac_ioctl_sendfib and aac_ioctl_send_raw_srbEd Maste2011-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 Notes: svn path=/head/; revision=218207
* When masking direct and processor devices during an inquiry, properlyJohn Baldwin2010-12-061-1/+2
| | | | | | | | | | preserve the upper bits of the first data byte. Reviewed by: scottl MFC after: 1 week Notes: svn path=/head/; revision=216236
* Previously, the aac driver did not handle enclosure management AIFs,Ed Maste2010-09-294-0/+80
| | | | | | | | | | 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> Notes: svn path=/head/; revision=213272
* Use device_printf where possible, and otherwise at least include theEd Maste2010-09-163-7/+10
| | | | | | | | | driver name in printf strings. Reported by: Mark Johnston Notes: svn path=/head/; revision=212773
* Implement device unbusying via a cdevpriv destructor.Attilio Rao2010-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 Notes: svn path=/head/; revision=212756
* Fix bogus busying mechanism from cdevsw callbacks:Attilio Rao2010-09-152-12/+4
| | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=212661
* Add some enums and constants from Adaptec's latest driverEd Maste2010-09-151-1/+14
| | | | | | | (build 17911). Notes: svn path=/head/; revision=212628
* Avoid repeatedly spamming the console while a timed out command is waitingEd Maste2010-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 Notes: svn path=/head/; revision=212594
* Use enums in the aac_command_status_table rather than duplicating the sameEd Maste2010-04-131-36/+36
| | | | | | | | | values in two places. Suggested by: Garrett Cooper Notes: svn path=/head/; revision=206555
* Sync some minor items with the upstream driver. Should have no functionalEd Maste2010-04-134-4/+8
| | | | | | | change. Notes: svn path=/head/; revision=206540
* Whitespace cleanup, in advance of next sync with Adaptec's driver. NoEd Maste2010-04-137-102/+102
| | | | | | | functional change. Notes: svn path=/head/; revision=206534
* Make the code more readable and compiling on 64-bits arch differentAttilio Rao2010-03-151-5/+1
| | | | | | | | | | | | than amd64. Sponsored by: Sandvine Incorporated Submitted by: emaste MFC: 2 weeks X-MFC: r205160 Notes: svn path=/head/; revision=205167
* Checkin a facility for specifying a passthrough FIB from userland.Attilio Rao2010-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 Notes: svn path=/head/; revision=205160
* Minor diff reduction with Adaptec's driver: in aac_release_command() setEd Maste2010-02-232-3/+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. Notes: svn path=/head/; revision=204264
* Include command type in COMMAND TIMEOUT messages to aid in debugging.Ed Maste2010-02-171-2/+3
| | | | Notes: svn path=/head/; revision=204019
* Diff reduction with Adaptec's vendor driver.Ed Maste2010-02-144-15/+28
| | | | | | | | Driver version 2.1.9 chosen as that Adaptec version roughly corresponds with the current feature set merged to the in-tree driver. Notes: svn path=/head/; revision=203885
* Garbage collect Falcon/PPC support that has not been used in releasedEd Maste2010-02-124-128/+0
| | | | | | | products, based on discussion with Adaptec. Notes: svn path=/head/; revision=203801
* Remove extraneous semicolons, no functional changes.Martin Blapp2010-01-071-1/+1
| | | | | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week Notes: svn path=/head/; revision=201758
* - Try pre-allocating all FIBs upfront. Previously we tried pre-allocatingJung-uk Kim2009-12-083-10/+6
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=200251
* Rename aac_srb32 to aac_srb, to match Adaptec's vendor driver.Ed Maste2009-10-292-4/+4
| | | | Notes: svn path=/head/; revision=198617
* Rename aac_fast_intr to aac_filter to reflect its current use. EliminateEd Maste2009-10-292-12/+8
| | | | | | | | | | the fallback of using the filter as an interrupt handler, as it is no longer needed. Discussed with: scottl, jhb Notes: svn path=/head/; revision=198593
* Do first controller time sync after 1 minute, as in Adaptec's vendorEd Maste2009-10-281-1/+1
| | | | | | | driver. Notes: svn path=/head/; revision=198541
* Whitespace fixup: 8 spaces -> tabEd Maste2009-10-272-6/+6
| | | | Notes: svn path=/head/; revision=198525
* Whitespace tweak.Ed Maste2009-09-091-1/+1
| | | | | | | Submitted by: phk, via accidental commit in r196969. Notes: svn path=/head/; revision=197016
* Increase AAC_CMD_TIMEOUT from 30s to 120s to help avoid spuriousEd Maste2009-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. Notes: svn path=/head/; revision=197011
* Revert previous commit and add myself to the list of people who shouldPoul-Henning Kamp2009-09-081-1/+1
| | | | | | | know better than to commit with a cat in the area. Notes: svn path=/head/; revision=196970