AHD(4)

πŸ“¦
version 15.1 Β· 4 versions
, in freebsd 15.1, nixpkgs unstable

πŸ’… AHD(4) β€” Kernel Interfaces Manual πŸŽ€

okay so bestie, gather round, because we're talking about ahd(4) β€” the Adaptec PCI/PCI-X Ultra320 SCSI host adapter driver. yes it's a mouthful. no you don't have to memorise it. let's go ✨


🌸 NAME 🌸

ahd β€” the Adaptec PCI/PCI-X Ultra320 SCSI host adapter driver. that's it, that's the name, she's iconic πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

so like, if you wanna compile this driver into the kernel, you drop these lines into your kernel configuration file:

device pci
device scbus
device ahd

and if you're feeling extra and want the debugging code compiled in too:

options AHD_DEBUG
options AHD_DEBUG_OPTS=<bitmask of options>
options AHD_REG_PRETTY_PRINT

OR β€” and this is the low-effort slay route β€” you can just load the driver as a module at boot time by putting this line in loader.conf(5):

ahd_load="YES"

main character energy honestly 🫢


πŸ’– DESCRIPTION πŸ’–

This driver gives you access to the SCSI bus(es) that are connected to Adaptec AIC79xx host adapter chips. literally its whole job πŸ’…

Driver features include support for:

  • narrow and wide busses
  • fast, ultra, ultra2, ultra160, and ultra320 synchronous transfers
  • packetized transfers
  • tagged queueing
  • 512 SCB's
  • target mode

so many features. she's booked and busy πŸ”₯


🧚 the AHD_DEBUG_OPTS situation

The AHD_DEBUG_OPTS option is what controls which diagnostic messages get printed to the console when AHD_DEBUG is enabled. to pick your messages, logically OR the following bits together:

  • 0x0001 β€” Show miscellaneous information
  • 0x0002 β€” Show sense data
  • 0x0004 β€” Show Serial EEPROM contents
  • 0x0008 β€” Show bus termination settings
  • 0x0010 β€” Show host memory usage
  • 0x0020 β€” Show SCSI protocol messages
  • 0x0040 β€” Show mode pointer of the chip register window
  • 0x0080 β€” Show selection timeouts
  • 0x0100 β€” Show FIFO usage messages
  • 0x0200 β€” Show Queue Full status
  • 0x0400 β€” Show SCB queue status
  • 0x0800 β€” Show inbound packet information
  • 0x1000 β€” Show S/G list information
  • 0x2000 β€” Enable extra diagnostic code in the firmware

πŸŽ€ the AHD_REG_PRETTY_PRINT situation

The AHD_REG_PRETTY_PRINT option compiles in support for human-readable bit definitions for each register that the debugging code prints. gorgeous, readable, a dream 🌈

however. it also bloats the compiled size of the driver by approximately 215KB. so like… she's pretty but she's thicc 😭 pick your battles.


πŸ’œ per target configuration

Anything you set up per target in the SCSI-Select menu (accessible at boot) is honored by this driver. that includes:

  • synchronous/asynchronous transfers
  • maximum synchronous negotiation rate
  • wide transfers
  • disconnection
  • the host adapter's SCSI ID

✨ CONFIGURATION OPTIONS ✨

Wanna statically configure one or more controllers to assume the target role? okay bestie:

options AHD_TMODE_ENABLE <bitmask of units>

The value you assign to this option should be a bitmap of all units where you want target mode. for example:

  • a value of 0x25 would enable target mode on units 0, 2, and 5
  • a value of 0x8a enables it for units 1, 3, and 7
ngl the note here is important: controllers can also be dynamically configured through a device hint, which is documented below πŸ‘‡

🌟 BOOT OPTIONS 🌟

The following options are switchable by setting values in /boot/device.hints.

They are:

  • hint.ahd.N.tmode_enable β€” a hint to define whether the SCSI target mode is enabled (0 β€” disabled, 1 β€” enabled).

that's the whole list, she's short and sweet πŸ“


πŸ”₯ HARDWARE πŸ”₯

The ahd driver supports the following PCI/PCI-X parallel SCSI controllers:

  • Adaptec AIC7901 host adapter chip
  • Adaptec AIC7901A host adapter chip
  • Adaptec AIC7902 host adapter chip
  • Adaptec 29320 host adapter
  • Adaptec 39320 host adapter
  • Many motherboards with on-board SCSI support

if you own one of these, congrats, you're in the club πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

ahc(4), cd(4), da(4), sa(4), scsi(4)

go read those too, iykyk πŸ“š


πŸ¦„ HISTORY πŸ¦„

The ahd driver first appeared in FreeBSD 4.7. vintage. she's got lore πŸ’€


πŸ’ AUTHORS πŸ’

The ahd driver, the AIC7xxx sequencer-code assembler, and the firmware running on the aic79xx chips was written by Justin T. Gibbs. legend behavior fr fr πŸ™Œ

This manual page is based on the ahc(4) manual page. giving credit where credit is due πŸ’–


πŸ’€ BUGS πŸ’€

okay so, the serious stuff, no jokes here:

  • The current generation of 79xx chips do not support target mode in Ultra320 mode.
  • Target mode in general has not been well tested in this driver.
so if you're relying on target mode, bestie, be careful β€” it's not a well-tested path 😭

and that's the whole page!! mwah πŸ’‹ this was the AHD(4) page from the Kernel Interfaces Manual, and it's stamped Debian, dated September 29, 2025. go forth and SCSI responsibly πŸ¦‹βœ¨

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • nixpkgs unstable: source
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms