1.\" 2.\" SPDX-License-Identifer: BSD-3-Clause 3.\" 4.\" Copyright (c) 1995, 1996, 1997, 1998, 2000 5.\" Justin T. Gibbs. All rights reserved. 6.\" Copyright (c) 2002 7.\" Scott Long. All rights reserved. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 3. The name of the author may not be used to endorse or promote products 18.\" derived from this software without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30.\" 31.Dd September 29, 2025 32.Dt AHD 4 33.Os 34.Sh NAME 35.Nm ahd 36.Nd Adaptec PCI/PCI-X Ultra320 SCSI host adapter driver 37.Sh SYNOPSIS 38To compile this driver into the kernel, 39place the following lines in your 40kernel configuration file: 41.Bd -ragged -offset indent 42.Cd "device pci" 43.Cd "device scbus" 44.Cd "device ahd" 45.Pp 46To compile in debugging code: 47.Cd options AHD_DEBUG 48.Cd options AHD_DEBUG_OPTS=<bitmask of options> 49.Cd options AHD_REG_PRETTY_PRINT 50.Ed 51.Pp 52Alternatively, to load the driver as a 53module at boot time, place the following line in 54.Xr loader.conf 5 : 55.Bd -literal -offset indent 56ahd_load="YES" 57.Ed 58.Sh DESCRIPTION 59This driver provides access to the 60.Tn SCSI 61bus(es) connected to Adaptec 62.Tn AIC79xx 63host adapter chips. 64.Pp 65Driver features include support for narrow and wide busses, 66fast, ultra, ultra2, ultra160, and ultra320 synchronous transfers, 67packetized transfers, tagged queueing, 512 SCB's, and target mode. 68.Pp 69The 70.Dv AHD_DEBUG_OPTS 71option is used to control which diagnostic messages are printed to the 72console when 73.Dv AHD_DEBUG 74is enabled. 75Logically OR the following bits together: 76.Bl -column -offset indent Value Function 77.Em "Value Function" 780x0001 Show miscellaneous information 790x0002 Show sense data 800x0004 Show Serial EEPROM contents 810x0008 Show bus termination settings 820x0010 Show host memory usage 830x0020 Show SCSI protocol messages 840x0040 Show mode pointer of the chip register window 850x0080 Show selection timeouts 860x0100 Show FIFO usage messages 870x0200 Show Queue Full status 880x0400 Show SCB queue status 890x0800 Show inbound packet information 900x1000 Show S/G list information 910x2000 Enable extra diagnostic code in the firmware 92.El 93.Pp 94The 95.Dv AHD_REG_PRETTY_PRINT 96option compiles in support for human-readable bit definitions for each register 97that is printed by the debugging code. 98However, it also bloats the compiled 99size of the driver by approximately 215KB. 100.Pp 101Per target configuration performed in the 102.Tn SCSI-Select 103menu, accessible at boot, 104is honored by this driver. 105This includes synchronous/asynchronous transfers, 106maximum synchronous negotiation rate, 107wide transfers, 108disconnection, 109and the host adapter's 110.Tn SCSI 111ID. 112.Sh CONFIGURATION OPTIONS 113To statically configure one or more controllers to assume the target role: 114.Pp 115.Cd options AHD_TMODE_ENABLE <bitmask of units> 116.Bd -ragged -offset indent 117The value assigned to this option should be a bitmap of all units where target 118mode is desired. For example, a value of 0x25, would enable target mode on 119units 0, 2, and 5. A value of 0x8a enables it for units 1, 3, and 7. 120.Pp 121Note that controllers can be dynamically configured through a device hint 122documented below. 123 124.Ed 125.Sh BOOT OPTIONS 126The following options are switchable by setting values in 127.Pa /boot/device.hints . 128.Pp 129They are: 130.Bl -tag -width indent 131.It Va hint.ahd. Ns Ar N Ns Va .tmode_enable 132A hint to define whether the SCSI target mode is enabled (0 -- disabled, 1 -- enabled). 133.El 134.Sh HARDWARE 135The 136.Nm 137driver supports the following PCI/PCI-X parallel SCSI controllers: 138.Pp 139.Bl -bullet -compact 140.It 141Adaptec 142.Tn AIC7901 143host adapter chip 144.It 145Adaptec 146.Tn AIC7901A 147host adapter chip 148.It 149Adaptec 150.Tn AIC7902 151host adapter chip 152.It 153Adaptec 154.Tn 29320 155host adapter 156.It 157Adaptec 158.Tn 39320 159host adapter 160.It 161Many motherboards with on-board 162.Tn SCSI 163support 164.El 165.Sh SEE ALSO 166.Xr ahc 4 , 167.Xr cd 4 , 168.Xr da 4 , 169.Xr sa 4 , 170.Xr scsi 4 171.Sh HISTORY 172The 173.Nm 174driver first appeared in 175.Fx 4.7 . 176.Sh AUTHORS 177The 178.Nm 179driver, the 180.Tn AIC7xxx 181sequencer-code assembler, 182and the firmware running on the aic79xx chips was written by 183.An Justin T. Gibbs . 184This manual page is based on the 185.Xr ahc 4 186manual page. 187.Sh BUGS 188The current generation of 79xx chips do not support target mode in Ultra320 189mode. 190Target mode in general has not been well tested in this driver. 191