diff --git a/src/chipset/ali1543.c b/src/chipset/ali1543.c index 42395b4064..67f7844a10 100644 --- a/src/chipset/ali1543.c +++ b/src/chipset/ali1543.c @@ -1662,6 +1662,7 @@ ali1543_init(const device_t *info) usb_param.pci_conf = dev->usb_conf; usb_param.pci_dev = &dev->usb_slot; usb_param.do_smi_raise = ali5237_usb_raise_smi; + usb_param.do_smi_ocr_raise = NULL; usb_param.do_pci_irq = ali5237_usb_pci_irq; usb_param.priv = dev; dev->usb = device_add_params(&usb_device, &usb_param); diff --git a/src/chipset/intel_piix.c b/src/chipset/intel_piix.c index 89f82d9a5a..859cfc5b00 100644 --- a/src/chipset/intel_piix.c +++ b/src/chipset/intel_piix.c @@ -1570,6 +1570,7 @@ piix_init(const device_t *info) params.do_smi_raise = piix_smsc_usb_smi_raise; params.priv = dev; params.do_pci_irq = 0; + params.do_smi_ocr_raise = NULL; dev->bm[0] = device_add_inst(&sff8038i_device, 1); dev->bm[1] = device_add_inst(&sff8038i_device, 2); diff --git a/src/chipset/sis_5572_usb.c b/src/chipset/sis_5572_usb.c index 241cd0f9ff..c44ad15d14 100644 --- a/src/chipset/sis_5572_usb.c +++ b/src/chipset/sis_5572_usb.c @@ -302,6 +302,7 @@ sis_5572_usb_init(UNUSED(const device_t *info)) usb_param.pci_dev = dev->sis->sb_southbridge_slot; usb_param.priv = dev; usb_param.do_smi_raise = sis_5572_usb_smi_raise; + usb_param.do_smi_ocr_raise = NULL; usb_param.do_pci_irq = sis_5572_usb_pci_irq; dev->usb = device_add_params(&usb_device, &usb_param); ohci_register_usb(dev->usb); diff --git a/src/chipset/stpc.c b/src/chipset/stpc.c index db153bf005..6a9450ac94 100644 --- a/src/chipset/stpc.c +++ b/src/chipset/stpc.c @@ -920,7 +920,15 @@ stpc_init(const device_t *info) pci_add_card(PCI_ADD_NORTHBRIDGE, stpc_nb_read, stpc_nb_write, dev, &dev->nb_slot); pci_add_card(PCI_ADD_SOUTHBRIDGE, stpc_isab_read, stpc_isab_write, dev, &dev->sb_slot); if (dev->local == STPC_ATLAS) { - usb_params_t usb_params = { .pci_conf = dev->pci_conf[3], .pci_dev = &dev->usb_slot }; + usb_params_t usb_params = + { + .pci_conf = dev->pci_conf[3], + .pci_dev = &dev->usb_slot, + .priv = dev, + .do_smi_ocr_raise = NULL, + .do_smi_raise = NULL, + .do_pci_irq = NULL + }; pci_add_card(PCI_ADD_SOUTHBRIDGE_IDE, stpc_ide_read, stpc_ide_write, dev, &dev->ide_slot); dev->usb = device_add_params(&usb_device, &usb_params); diff --git a/src/include/86box/usb.h b/src/include/86box/usb.h index 52c37ba094..f48c4fd507 100644 --- a/src/include/86box/usb.h +++ b/src/include/86box/usb.h @@ -34,6 +34,8 @@ typedef struct usb_params_t { void* priv; /* The implementation. */ /* Raises SMI with also setting implementation-specific bits. */ void (*do_smi_raise)(void* priv); + /* Raises SMI with also setting implementation-specific bits (on OwnershipChangeRequest). */ + void (*do_smi_ocr_raise)(void* priv); /* Asserts PCI interrupt. */ void (*do_pci_irq)(void* priv, int level); } usb_params_t; diff --git a/src/usb/usb_ohci_bochs.c b/src/usb/usb_ohci_bochs.c index ea2eb0338d..b49b7cb44c 100644 --- a/src/usb/usb_ohci_bochs.c +++ b/src/usb/usb_ohci_bochs.c @@ -239,6 +239,7 @@ typedef struct { uint32_t ohci_mem_base; void (*do_smi_raise)(void *priv); + void (*do_smi_ocr_raise)(void *priv); void (*do_pci_irq)(void *priv, int level); void* card_priv; } bx_ohci_core_t; @@ -884,8 +885,10 @@ void usb_ohci_mem_write(uint32_t addr, uint32_t value, void* priv) hub->op_regs.HcCommandStatus.ocr = 1; hub->op_regs.HcInterruptStatus |= 0x40000000; if ((hub->op_regs.HcInterruptEnable & 0xC0000000) == 0xC0000000) { - pclog("Assert SMI#\n"); - if (hub->do_smi_raise && hub->card_priv) + ohci_log("Assert SMI#\n"); + if (hub->do_smi_ocr_raise && hub->card_priv) + hub->do_smi_ocr_raise(hub->card_priv); + else if (hub->do_smi_raise && hub->card_priv) hub->do_smi_raise(hub->card_priv); else smi_raise(); @@ -1665,6 +1668,7 @@ usb_ohci_init(UNUSED(const device_t *info)) hub->devfunc = usb_params->pci_dev; hub->pci_conf = usb_params->pci_conf; hub->do_smi_raise = usb_params->do_smi_raise; + hub->do_smi_ocr_raise = usb_params->do_smi_ocr_raise; hub->card_priv = usb_params->priv; hub->do_pci_irq = usb_params->do_pci_irq; }