OpenBSD patch set and source snapshot for HP Compaq nx6310 FireWire OHCI and SBP-2 storage support.
The target is OpenBSD 7.9/amd64 on HP Compaq nx6310-class hardware with the Texas Instruments PCIXX12 IEEE 1394 controller.
The HP Compaq nx6310 includes a small 4-pin IEEE 1394a FireWire port backed by the TI PCIXX12 OHCI controller.
OpenBSD 7.9 does not provide a working native FireWire storage path for this controller on the nx6310.
Without this patch, a FireWire SBP-2 disk can be physically connected but no usable sd(4) disk appears.
OpenBSD previously carried IEEE 1394 code under sys/dev/ieee1394, but that code was removed on 2005-03-05 with the CVS log message Clean up the tree from incomplete, unreliable and unsupported IEEE1394 code.
That historical code was a general FireWire subsystem attempt. Its documented design included OHCI and non-OHCI controller drivers, FireWire node devices, IP-over-FireWire, SBP-2 SCSI services, and a broader bus/service hierarchy.
Its own TODO list still called out unfinished work in transaction-label allocation, multi-host and hub reset behavior, topology maps, speed maps, bus-manager support, fwscsi/scsibus structure, handler/thread/callback cleanup, and SBP-2 code separation.
This patch set does not restore that removed subsystem.
It deliberately implements a much narrower path: the nx6310 TI PCIXX12 OHCI controller plus one tested SBP-2 storage path through OpenBSD scsibus(4) and sd(4).
The narrow scope is intentional. It keeps unsupported FireWire classes out of the kernel, avoids exposing raw FireWire userland access, and documents the remaining DMA limits instead of presenting this as a complete OpenBSD FireWire revival.
Reference material:
- OpenBSD CVS
sys/dev/ieee1394/Attic: https://cvsweb.openbsd.org/src/sys/dev/ieee1394/Attic/?sort=File - Historical implementation note: https://cvsweb.openbsd.org/checkout/src/sys/dev/ieee1394/Attic/IMPLEMENTATION?rev=1.2
- Historical TODO list: https://cvsweb.openbsd.org/checkout/src/sys/dev/ieee1394/Attic/TODO?rev=1.4
The unpatched system lacks the nx6310 FireWire storage path:
- No
fwohcidriver attachment for the TI PCIXX12 FireWire function. - No OHCI register mapping and interrupt handling for this controller.
- No FireWire self-ID collection.
- No remote configuration ROM probing.
- No SBP-2 target detection.
- No SBP-2 login, command ORB, status FIFO, or logout path.
- No OpenBSD
scsibus(4)attachment for a FireWire storage peer. - No
sd(4)disk for a compatible SBP-2 FireWire hard drive. - No validated read, write, cache-sync, or bus-reset recovery path for the tested disk.
In practice, the FireWire port exists electrically but is not useful for OpenBSD storage.
With the patched kernel, the system gains:
fwohciattachment for the nx6310 TI PCIXX12 FireWire controller.- OHCI MMIO mapping, PCI bus mastering, interrupt setup, soft reset, and link startup.
- Self-ID DMA buffer setup and peer node tracking.
- Local configuration ROM programming.
- Remote configuration ROM reads for SBP-2 target discovery.
- SBP-2 login and logout handling.
- SCSI command transport over SBP-2 command ORBs.
- 128 KiB runtime SBP data buffer using 60 KiB direct transfers plus a bounded SBP-2 indirect page table for larger requests.
- Rotating SBP command ORB slots to reduce stale-status aliasing during longer I/O sequences.
- Stale SBP status filtering when a completion packet refers to an earlier command ORB.
- Longer SBP login and command wait windows for slow bridge firmware.
- Replaced fixed async receive-ring and async transmit context sleeps in the normal SBP I/O path with bounded 10 microsecond register polling.
scsibus(4)attachment belowfwohci.sd(4)attachment for the tested FireWire SBP-2 disk.- READ(10), WRITE(10), INQUIRY, TEST UNIT READY, REQUEST SENSE, READ CAPACITY(10), and SYNCHRONIZE CACHE(10) coverage for the supported path.
- A writable
scsibus(4)is attached even when the FireWire disk is absent at boot, so the tested disk can attach later after a bus reset. - Task-queue based SBP reprobe after FireWire bus reset.
- Recovery after idle, unmounted cable disconnect and reconnect on the tested disk.
- Stale SBP
sd(4)child invalidation and forced detach after media loss, so a reconnected disk is reprobed through a fresh SBP login instead of reusing a stale mounted child.
The result is a practical OpenBSD FireWire storage path for the tested HP Compaq nx6310 hardware combination.
The implemented storage path keeps the conservative synchronous command model, uses a 128 KiB runtime SBP data buffer, uses a small SBP-2 indirect page table for transfers above the 60 KiB direct limit, and uses a bounded rotating ORB area for normal command traffic.
If the FireWire cable is removed while a filesystem is mounted and a write is active, the current behavior is a bounded I/O failure rather than transparent data preservation. The observed active-write disconnect returned Input/output error, did not panic the kernel, marked and detached the stale SBP SCSI child after reconnect, recovered the SBP login, reattached the tested disk, and required normal filesystem checking before reuse.
This patch does not expose a raw FireWire userland node, IP-over-1394, isochronous transfer APIs, or arbitrary physical memory access APIs.
The OHCI physical request filter is closed by default, closed after bus reset, closed on interrupt shutdown, and closed after SBP login, command, and logout operations.
The temporary SBP physical DMA window is opened only for the selected peer node after self-ID generation checks and is closed after the expected ORB/status exchange.
Async response parsing validates packet length, local destination node, peer source node, transaction label, and SBP status payload bounds before accepting a response.
This is still not a general untrusted-device FireWire security boundary. The OHCI physical upper-bound mechanism is coarse, the tested TI PCIXX12 controller can read that register back as zero after programming, and nx6310-class hardware should not be assumed to provide modern IOMMU isolation for FireWire DMA.
Read docs/SECURITY.md before using this patch on any system that contains sensitive data.
Validated host hardware:
- HP Compaq nx6310.
- Texas Instruments PCIXX12 IEEE 1394 OHCI controller.
- OpenBSD 7.9/amd64.
Validated FireWire device:
- LaCie d2 HDD 250GB.
- SBP-2 target reported through OpenBSD as
Maxtor 7, Y250P0, YAR4. - 4-pin IEEE 1394a FireWire connection.
Validation covered attachment at boot, attachment after booting without the FireWire disk, read checks, temporary filesystem write checks, cache synchronization, physical reconnection, and bus-reset recovery on the listed disk.
Post-reboot validation on the tested disk measured a 256 MiB raw read at about 27.3 MB/s, a temporary FFS write at about 18.6 MB/s, and a temporary FFS file read at about 25.1 MB/s.
Boot-without-peer hotplug, idle unmounted disconnect and reconnect, and active-write cable removal recovery were validated on the same driver line.
Post-reconnect validation after an active-write disconnect failed a 1280 MiB mounted write with Input/output error at about 6.8 MiB/s, detached the stale SBP child, reattached the disk after reconnect, repaired the expected FFS summary and bitmap inconsistencies with fsck, and returned the tested partition to a clean state.
The same validation left the tested FFS and MSDOS partitions clean under fsck -n or fsck_msdos -n after cleanup and temporary write checks.
Other FireWire storage devices are not tested.
Other FireWire device classes, including DV cameras, audio interfaces, scanners, target-disk hosts, IP-over-1394 devices, and isochronous devices, are not supported by this patch set.
A working installation should show the controller and SBP storage path in dmesg:
fwohci0 at pci...
scsibus... at fwohci0
sd... at scsibus...
attaching writable SBP scsibus
active bring-up probe complete; writable SBP scsibus is attached for hotplug probing
writable SBP target recovered after bus reset
SBP SCSI child marked stale after bus reset
detaching stale SBP SCSI child after hotplug
The FireWire disk should appear in:
sysctl hw.disknamesFor a fuller checklist, use docs/TESTING.md.
Read docs/APPLY.md before applying the patch to a real system.
cd /usr/src
patch -p1 < /path/to/openbsd-nx6310-firewire-sbp2/patches/0001-openbsd-nx6310-firewire-sbp2-combined.diffThe combined patch is the supported runtime installation patch.
The split patches under patches/review/ are review aids and include the standalone fwohci(4) manual page source for downstream packaging or source-tree review.
Create a custom amd64 kernel config using config/GENERIC.MP.NX6310FWSBP2.fragment, rebuild, install, reboot, then verify:
dmesg | egrep 'fwohci|sbp|scsibus|sd[0-9]|Maxtor|LaCie'
sysctl hw.disknamespatches/0001-openbsd-nx6310-firewire-sbp2-combined.diffis the canonical apply patch.patches/review/contains split review patches for registration, driver source, and manual page review.man/man4/fwohci.4is the standalone manual page source.src/contains the current source snapshot for the modified OpenBSD source files.config/GENERIC.MP.NX6310FWSBP2.fragmentcontains the required kernel config line.docs/APPLY.mddescribes installation.docs/TESTING.mddescribes runtime checks.docs/ROLLBACK.mddescribes recovery and rollback.docs/DESIGN.mdexplains the driver design.docs/SECURITY.mdexplains the supported security model and remaining DMA limits.docs/STATUS.mdlists supported and unsupported behavior.docs/RELEASE.mdsummarizes release scope, validation, and publication checks.tools/check-nx6310-firewire-sbp2.shperforms read-only status checks.
This is an HP Compaq nx6310 patch set for the TI PCIXX12 FireWire controller and the tested SBP-2 storage path.
It is not a general-purpose FireWire framework.
It is not a resurrection of OpenBSD's removed sys/dev/ieee1394 subsystem.
Do not apply it blindly to unrelated laptops or unrelated FireWire controllers.
Do not treat it as safe containment for malicious FireWire hardware.
Raw disk write testing can destroy data if the wrong disk is selected. Use a known disposable disk for validation.
The patch requires a custom kernel.
Repository-specific material is distributed under the ISC license.
Credit: itinfra7 from GitHub.
Modified OpenBSD source files retain their upstream copyright and license notices.