aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/aic7xxx
Commit message (Collapse)AuthorAgeFilesLines
* ahc(4): Fix a warning on i386 compilationOlivier Certner2026-01-281-1/+1
| | | | | | Fixes: cd036e891a35 ("ahc_pci.c: If bus_dma...") MFC after: 3 days Sponsored by: The FreeBSD Foundation
* aic7xxx: Fix a couple of typos in device messagesGordon Bergling2025-10-292-5/+5
| | | | | | | | - s/Reseting/Resetting/ - s/staus/status/ - s/referrenced/referenced/ MFC after: 1 week
* style(9): white space after ; and around binary operatorsDavid E. O'Brien2025-10-162-4/+4
| | | | | | | in for() loops. Also, use 'while', where only the conditional test of 'for' was used. Reviewed by: sjg
* aic7xxx: use rounddown_pow_of_twoDoug Moore2024-06-241-1/+1
| | | | | | | Use the roundown_pow_of_two macro in place of an expression. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D45536
* powerof2: replace loops with fls or ilog2Doug Moore2024-06-121-2/+1
| | | | | | | | | In several places, a loop tests for powers of two, or iterates through powers of two. In those places, replace the loop with an invocation of fls or ilog2 without changing the meaning of the code. Reviewed by: alc, markj, kib, np, erj, avg (previous version) Differential Revision: https://reviews.freebsd.org/D45494
* ahc(4): Default to memory mapped IOHP van Braam2024-05-101-6/+6
| | | | | | | | | | | | | | When this driver was written it made sense to make this default to off, but these days almost all BIOSses will do the right thing. Furthermore non-mmio communication only works on Intel architectures. So lets default to allowing mmio, but not change the semantics of the AHC_ALLOW_MEMIO flag to not break existing installs. Also document the already existing hint.ahc.<unit>.allow_memio. Signed-off-by: HP van Braam <hp@tmm.cx> Reviewed by: imp (small style tweak) Pull Request: https://github.com/freebsd/freebsd-src/pull/1219
* aic7xxx: make target mode enable a device hintHP van Braam2024-05-042-2/+36
| | | | | | | | | | | | | | | | | | | | Previously it was only possible to enable target mode for these drivers by rebuilding the kernel with AHC_TMODE_ENABLE or AHD_TMODE_ENABLE and a bitmask of which units to statically enable for target mode. There is no space-savings in the driver by not having AHC_TMODE_ENABLE set, so in addition to the compile time option lets also introduce some tunables: hint.ahc.<unit>.tmode_enable=0/1 hint.ahd.<unit>.tmode_enable=0/1 For compatibility the old behavior is retained, but it can be overridden with tunables Signed-off-by: HP van Braam <hp@tmm.cx> Reviewed by: imp, mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1208
* aic7xxx: aicasm correct include fileHP van Braam2024-05-041-2/+5
| | | | | | | | | | | | | aicasm just puts the value of the "-i" passed include file in the generated file with quotes around it. This means that there are manual edits made to aic7xxx_reg_print.c and aic79xx_reg_print.c now we check to see if the value passed to '-i' starts with a '<', if it does don't output the quotes. Signed-off-by: HP van Braam <hp@tmm.cx> Reviewed by: imp (minor code simplification) Pull Request: https://github.com/freebsd/freebsd-src/pull/1209
* ahc(4)/ahd(4): target mode: cancel outstanding AIOs and INOTsHP van Braam2024-04-232-4/+22
| | | | | | | | | | | | | | When disabling a lun there can still be outstanding AIOs and INOTs, when this happens previously the lun would just fail to disable and trying to re-use the lun would break the card. isp(4) in target mode does the same thing when disabling a lun, in testing this allows re-starting of ctld(8) with connected initiators and allows initiators to gracefully resume afterwards. Signed-off-by: HP van Braam <hp@tmm.cx> Reviewed by: imp, mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1190
* ahc(4) clean up old Linux definesHP van Braam2024-04-2315-110/+2
| | | | | | | | | | | Linux removed theirs starting in 2018 in commit: "scsi: aic7xxx: Fix build using bare-metal toolchain" Also remove now-useless sys/cdefs.h includes Signed-off-by: HP van Braam <hp@tmm.cx> Reviewed by: imp, mav, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1189
* ahc(4)/ahd(4): fix target mode on ARMKyle Evans2024-04-212-28/+42
| | | | | | | | | | | | One of the comments in ahc_execute_scb() notes that the CAM direction is actually w.r.t. the initiator. As a consequence, all of our sync ops end up being wrong because the direction is flipped from that of the transfer. Fix it to do proper invalidation and avoid spewing random garbage out on the SCSI bus. Reported and tested by: HP van Braam <hp@tmm.cx> Reviewed by: imp, mav Differential Revision: https://reviews.freebsd.org/D44860
* ahc(4): resolve some minor nitsKyle Evans2024-04-212-2/+1
| | | | | | | | | | | | | | | In ahc_init(), qoutfifo is already assigned to effectively the same value a couple lines up, except in the first assignment it uses the proper definition; keep the more descriptive assignment. ahc_targetcmd_offset() gets the offset wrong entirely; as per the area of ahc_init() this diff also touches, targetcmds is laid out first in the shared map and it's followed by the qoutfifo. As a result, we'd generally be getting negative offsets here. We can't actually do a partial sync anyways, so there was no consequence to getting this wrong. Reviewed by: imp, mav Differential Revision: https://reviews.freebsd.org/D44859
* ahc/ahd: Fix target mode operationAlexander Motin2024-04-102-0/+6
| | | | | | | | After 5e63cdb457f9 the drivers didn't clear CAM_DIS_DISCONNECT in ah*_handle_target_cmd() when needed, only set it. Reported/tested by: HP van Braam <hp@tmm.cx> MFC after: 1 week
* aic7xxx: Fix two typos in source code commentsGordon Bergling2024-01-222-2/+2
| | | | | | - s/recevied/received/ MFC after: 3 days
* aic7xxx: Fix a typo in a kernel messageGordon Bergling2024-01-201-1/+1
| | | | | | - s/recevied/received/ MFC after: 5 days
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1614-20/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1625-50/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* aic7xxx: Fix two typos in source code commentsGordon Bergling2023-08-022-2/+2
| | | | | | - s/reslection/reselection/ MFC after: 3 days
* Mark usage function as __dead2 in programs where it does not returnAlfonso Gregory2023-07-071-1/+1
| | | | | | | | In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/735
* ddb: use _FLAGS command macros where appropriateMitchell Horne2022-07-051-1/+1
| | | | | | | | | | | | Some command definitions were forced to use DB_FUNC in order to specify their required flags, CS_OWN or CS_MORE. Use the new macros to simplify these. Reviewed by: markj, jhb MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35582
* aic7xxx: Fix a few common typo in source code commentsGordon Bergling2022-07-031-1/+1
| | | | | | | - s/irrespecitve/irrespective/ Obtained from: NetBSD MFC after: 3 days
* aic7xxx: Fix a few common typos in source code commentsGordon Bergling2022-07-034-4/+4
| | | | | | | - s/ingnore/ignore/ - s/ingnored/ignored/ MFC after: 3 days
* aic7xxx: Fix a few typos in comments and an error messageGordon Bergling2022-06-041-4/+4
| | | | | | | | | | - s/directrive/directive/ - s/specifiled/specified/ - s/Decend/Descend/ - s/tranversal/transversal/ Obtained from: NetBSD MFC after: 3 days
* aic79xx: Fix a typo in a source code commentGordon Bergling2022-06-041-1/+1
| | | | | | | - s/Disble/Disable/ Obtained from: NetBSD MFC after: 3days
* ahc/ahd: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-065-10/+3
|
* Fix "set but not used" in aic7xxx/aic79xx. The variables were deadScott Long2022-02-262-15/+0
| | | | code.
* ahc: Mark sysctls with CTLFLAG_MPSAFE.Alexander Motin2021-12-101-2/+2
| | | | MFC after: 2 weeks
* Fix a common typo in source code commentsGordon Bergling2021-08-291-1/+1
| | | | | | - s/concurently/concurrently/ MFC after: 3 days
* Fix a common typo in man pages and src commentsGordon Bergling2021-08-282-2/+2
| | | | | | - s/desciptor/descriptor/ MFC after: 5 days
* Fix some common typos in commentsGordon Bergling2021-08-081-1/+1
| | | | | | | | - s/configuraiton/configuration/ - s/specifed/specified/ - s/compatiblity/compatibility/ MFC after: 5 days
* aic7xxx: Fix re-building firmware with -fno-commonJessica Clarke2021-05-282-2/+2
| | | | | | | | | | | | | | | | | The generated C output for aicasm_scan.l defines yylineno already, so references to it from other files should use an extern declaration. The STAILQ_HEAD use in aicasm_symbol.h also provided an identifier, causing it to both define the struct type and define a variable of that struct type, causing any C file including the header to define the same variable. This variable is not used (and confusingly clashes with a field name just below) and was likely caused by confusion when switching between defining fields using similar type macros and defining the type itself. Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30525
* cam: clear on-stack CCBs in last few driversEdward Tomasz Napierala2021-05-212-0/+2
| | | | | | | | | | This changes ahc(4), ahd(4), hptiop(4), hptnr(4), hptrr(4), and ps3cdrom(4). Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D30305
* aic7xxx: clean up empty lines in .c and .h filesMateusz Guzik2020-09-0121-210/+56
| | | | Notes: svn path=/head/; revision=365105
* Remove unneeded dependency on liblBaptiste Daroussin2020-03-231-1/+0
| | | | Notes: svn path=/head/; revision=359240
* Remove support for FreeBSD 4-7.Warner Losh2020-02-264-84/+0
| | | | | | | | It's doubtful this driver would still work unchanged there. Compile tested only because I no longer have ahc/ahd devices. Notes: svn path=/head/; revision=358354
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-16/+16
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* aic7xxx(4): Fix unintended sign extension in ahd_inq()Conrad Meyer2020-01-301-1/+1
| | | | | | | | | | | | | | ahd_inb() returns type uint8_t. The shift left by untyped 24 implicitly promotes the result to type (signed) int. Then the binary OR with uint64_t values sign-extends the integer. If bit 31 of the read value happened to be set, the 64-bit result would have all upper 32 bits set to 1 due to OR. This is clearly not intended. Reported by: Coverity CID: 980473 (old one!) Notes: svn path=/head/; revision=357300
* Fix trivial whitespace issue that is tripping -Wmisleading-indentationBrandon Bergren2019-12-241-1/+1
| | | | | | | | | | | | in clang HEAD. There was an invisible space in the middle of the tabs, and that apprently was enough to throw off clang's column counting. Even if clang is "incorrect" here, it's still a style(9) violation. Notes: svn path=/head/; revision=356062
* Use callout_func_t instead of the deprecated timeout_t.John Baldwin2019-12-101-1/+1
| | | | | | | | Reviewed by: kib, imp Differential Revision: https://reviews.freebsd.org/D22752 Notes: svn path=/head/; revision=355601
* [aic7xxx] Use correct product name 29320LPE instead of non-existent 39320LPEOleksandr Tymoshenko2019-01-191-7/+7
| | | | | | | | | | | | | | The PCI id belongs to Adaptec 29320LPE controller. The same fix also was merged[1] to OpenBSD driver ~6 years ago. [1] https://github.com/openbsd/src/commit/f997b5 PR: 172133 Submitted by: henning.petersen@t-online.de MFC after: 1 week Notes: svn path=/head/; revision=343170
* Correct pseudo misspelling in sys/ commentsEd Maste2018-02-231-1/+1
| | | | | | | contrib code and #define in intel_ata.h unchanged. Notes: svn path=/head/; revision=329873
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2720-0/+40
| | | | | | | | | | | | | | | 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
* Include opt files in the kernel with "" instead of <>.Warner Losh2017-07-102-2/+2
| | | | Notes: svn path=/head/; revision=320860
* Fix LUN enabling on wildcard target, as done by CTL.Alexander Motin2017-02-262-2/+4
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=314308
* Remove EISA support from ahc driver. The AIC-7770 chip can be on ISA,Warner Losh2017-02-164-186/+8
| | | | | | | | | | | | VesaLocalBus or EISA. Internally, EISA and ISA are handled the same, with VL being handled slightly differently. To avoid too much code churn, retain the EISA name, despite it being used only for ISA bus. When it is on the ISA bus, weird gymnastics are required with EISA-space address accesses as well. Remove known models from the ahc man page. Remove ahc_eisa module. Notes: svn path=/head/; revision=313836
* Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)Alan Somers2017-01-042-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix improper use of "its".Bryan Drewery2016-11-081-1/+1
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=308457
* sys/dev: replace comma with semicolon when pertinent.Pedro F. Giffuni2016-08-091-1/+1
| | | | | | | | | | | | | Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone. Detected with devel/coccinelle following a hint from DragonFlyBSD. MFC after: 1 month Notes: svn path=/head/; revision=303891
* aic7xxx: minor spelling fixes.Pedro F. Giffuni2016-05-1014-63/+63
| | | | | | | | | Affects mostly comments but also a visible text string, Differential Revision: https://reviews.freebsd.org/D6270 Notes: svn path=/head/; revision=299375