#!/bin/sh
# DF-5118 trigger — dcons_crom detach leaves dcons_conf->dma_map dangling and
# dcons_paddr stale; re-attach never re-wires dcons_conf.
#
# REQUIRES: FireWire OHCI controller (guest has none -> exit 42).
# On hardware: devctl detach fw0-bus child / kldunload dcons_crom, then
# re-add/reload WITHOUT unloading dcons: dmamap_cb takes the
# "dcons_paddr is already set" early-return (dcons_crom.c:139-143) and
# dcons_conf->dma_tag stays NULL forever (sync silently disabled), while
# post_busreset keeps publishing the stale dcons_paddr (:120-121).
set -u
pciconf -l 2>/dev/null | grep -q 'class=0x0c0010' || {
	echo "DF-5118: no FireWire controller - untestable here"; exit 42; }
echo "on hardware: kldunload dcons_crom; kldload dcons_crom;"
echo "then sysctl/inspect dcons state - dma sync silently disabled,"
echo "dma_map dangling while dma_tag==NULL"
exit 42
