hw/usb/hcd-ohci: Implement frame number overflow event
According to the USB OHCI specification section 6.5.6 ("FrameNumberOverflow Event"), when bit 15 of the frame count changes (either from 1 to 0 or 0 to 1) a FrameNumberOverflow interrupt should be generated. This fixes usb-audio on mac99,via=pmu with MacOS 9. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3274 Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Tested-by: Elisey Konstantinov <elisey.konstantinov@gmail.com> Message-id: 20260212185425.2F854596A29@zero.eik.bme.hu [PMM: added brief comment, tweaked commit message] Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
BALATON Zoltan committed
Feb 18, 2026 at 18:40 UTC
1b33ed1689a1055e8c7c0faa91795b2a7e434e2e
1 file changed
+4
hw/usb/hcd-ohci.c
+4
@@ -1246,6 +1246,10 @@ static void ohci_frame_boundary(void *opaque)
1246
hcca.frame = cpu_to_le16(ohci->frame_number);
1247
/* When the HC updates frame number, set pad to 0. Ref OHCI Spec 4.4.1*/
1248
hcca.pad = 0;
1249
+ /* FrameNumberOverflow happens when bit 15 of frame number changes */
1250
+ if (ohci->frame_number == 0x8000 || ohci->frame_number == 0) {
1251
+ ohci_set_interrupt(ohci, OHCI_INTR_FNO);
1252
+ }
1253
1254
if (ohci->done_count == 0 && !(ohci->intr_status & OHCI_INTR_WD)) {
1255
if (!ohci->done) {