From b5a845846b76389371a803cd618c19c110b8cdef Mon Sep 17 00:00:00 2001 From: Laine Jones Date: Wed, 21 Oct 2026 23:30:52 -0600 Subject: [PATCH] SanaConform: second open uses DEVICE=; quirk stat note for other drivers The self-echo probe opened its second handle on "loopback.device" hard-coded, so with DEVICE= naming another driver the second open failed and read as that driver refusing a second opener. It now opens the device under test. The quirk-stat check printed "unexpected" for every driver other than sana2loop, though the comment above it says no records is the expected result there. It now says so when the driver returns no special stats at all. Found while running SanaConform against an X-Surf SANA-II driver (xsurfnet.device) in WinUAE: with the change it takes both opens and the probe passes. --- src/tools/sanaconform.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/sanaconform.c b/src/tools/sanaconform.c index b6dc7b5..8eb5bc6 100644 --- a/src/tools/sanaconform.c +++ b/src/tools/sanaconform.c @@ -397,7 +397,7 @@ int main(int argc, char **argv) * regardless of what the driver actually does. */ if (wio) wio->ios2_BufferManagement = tags; - if (wio && OpenDevice((STRPTR)"loopback.device", (LONG)unit, (struct IORequest *)wio, 0) == 0) { + if (wio && OpenDevice((STRPTR)device, (LONG)unit, (struct IORequest *)wio, 0) == 0) { /* Static (see stack_cookie's own comment), and sized for a FULL * maximum delivery, not just this probe's own tiny payload: the * queued CMD_READ below matches on packet type alone, so any @@ -496,7 +496,9 @@ int main(int argc, char **argv) (unsigned long)stats.recs[i].Count); found = TRUE; } - if (!found) + if (!found && stats.hdr.RecordCountSupplied == 0) + printf("sana2loop quirk stat: none (expected for drivers other than sana2loop)\n"); + else if (!found) printf("sana2loop quirk stat: no DMA-hook-offered record (unexpected -- this " "probe's own open above should have counted as one)\n"); }