aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/aacraid/aacraid_cam.c
Commit message (Collapse)AuthorAgeFilesLines
* [aacraid] Port driver to big-endianLeandro Lupori2020-03-051-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port aacraid driver to big-endian (BE) hosts. The immediate goal of this change is to make it possible to use the aacraid driver on PowerPC64 machines that have Adaptec Series 8 SAS controllers. Adapters supported by this driver expect FIB contents in little-endian (LE) byte order. All FIBs have a fixed header part as well as a data part that depends on the command being issued to the controller. In this way, on BE hosts, the FIB header and all FIB data structures used in aacraid.c and aacraid_cam.c need to be converted to LE before being sent to the adapter and converted to BE when coming from it. The functions to convert each struct are on aacraid_endian.c. For little-endian (LE) targets, they are macros that expand to nothing. In some cases, when only a few fields of a large structure are used, the fields are converted inline, by the code using them. PR: 237463 Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D23887 Notes: svn path=/head/; revision=358684
* [aacraid] Prevent sense data from causing a buffer overflowLeandro Lupori2020-03-021-1/+1
| | | | | | | | | | | | This issue was observed on a PowerPC64 machine with an Adaptec RAID Controller with PCI device ID 0x028d, where sense data was causing a buffer overflow because of wrong max sense length logic. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D23667 Notes: svn path=/head/; revision=358550
* Remove ifdefs for FreeBSD 6, 7, 8 and 9. Assume we're past that.Warner Losh2019-12-061-21/+0
| | | | | | | Differential Revision: https://reviews.freebsd.org/D22539 Notes: svn path=/head/; revision=355464
* Make aacraid(4) working on ASR8805 & ASR8402 in particular. This patchMaxim Sobolev2019-05-221-11/+5
| | | | | | | | | | | | | | | | has been in the PR system for 5 months and then on reviews for another 5. Nobody came with any cases where it fails, while many people cried for it to be commited & merged. PR: 209468 Submitted by: Prasad B M <prasad.munirathnam@microsemi.com> Reported by: Steven Peterson <scp@mainstream.net> Approved by: scottl MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18408 Notes: svn path=/head/; revision=348091
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* aacraid: rework r315083 for a clean build with and without AACRAID_DEBUGAndriy Gapon2017-03-231-6/+2
| | | | | | | | | | | | r315083 essentially reverted r263954 which was made for a good reason, but didn't take into account AACRAID_DEBUG. Now both types of build should be clean. MFC after: 5 days No MFC to: stable/10 Notes: svn path=/head/; revision=315858
* aacraid: fix build with AACRAID_DEBUG=2Andriy Gapon2017-03-111-1/+5
| | | | | | | MFC after: 10 days Notes: svn path=/head/; revision=315083
* Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers2017-01-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are fixed-length strings. AFAICT the only place they're read is in sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated. However, the kernel doesn't null-terminate them. A bunch of copy-pasted code uses strncpy to write them, and doesn't guarantee null-termination. For at least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually overflows. You can see the result by doing "camcontrol negotiate da0 -v". This change null-terminates those fields everywhere they're set in the kernel. It also shortens a few strings to ensure they'll fit within the 16-character field. PR: 215474 Reported by: Coverity CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005 CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000 CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014 CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021 CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027 CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187 CID: 1010035 1010036 1010042 1010041 1010040 1010039 Reviewed by: imp, sephe, slm MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9037 Differential Revision: https://reviews.freebsd.org/D9038 Notes: svn path=/head/; revision=311305
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* aacraid(4): Fix some mostly trivial buffer overrunsConrad Meyer2016-04-261-3/+5
| | | | | | | | | | | | | strcpy(3) emits a trailing nul byte, trampling fields after the intended destination. Instead, use strncpy(3), intentionally leaving these fields not nul-terminated. Reported by: Coverity CIDs: 1031024, 1305463, 1305494, 1305545 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=298665
* Remove instances of variables that were set, but never used. gcc 4.9Warner Losh2014-03-301-4/+0
| | | | | | | warns about these by default. Notes: svn path=/head/; revision=263954
* Update aacraid to version 3.2.5.Achim Leubner2013-11-081-5/+25
| | | | | | | | | | | | Full MSI-X interrupt support added. Timeout and reset handling reworked, firmware flash update test added. Support for drives with 4KB block size added. Changes made to avoid exposure of phys. array components by default. Approved by: scottl (mentor), emaste (co-mentor) Notes: svn path=/head/; revision=257847
* Driver 'aacraid' added. Supports Adaptec by PMC RAID controller families ↵Achim Leubner2013-05-241-0/+1400
Series 6, 7, 8 and upcoming products. Older Adaptec RAID controller families are supported by the 'aac' driver. Approved by: scottl (mentor) Notes: svn path=/head/; revision=250963