ide: simplify reset callbacks

Drop the unused return value and make the callback optional.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: simplify set_inactive callbacks

Drop the unused return value and make the callback optional.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: simplify start_transfer callbacks

Drop the unused return value and make the callback optional.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: wrap start_dma callback

Make it optional and prepare for the next patches.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: eliminate set_unit callback

Move the value within the IDEDMA structure.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: add trigger_irq callback

The dma_status field of AHCIDevice is write-only.  The first step to
remove it is to trigger the IRQ with a different callback.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: fold add_status callback into set_inactive

It is now called only after the set_inactive callback.  Put the two together.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ahci: remove write-only dma_status field

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: move BM_STATUS bits to pci.c

They are not used by AHCI, and should not be even available there.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: move retry constants out of BM_STATUS_* namespace

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: start extracting ide_restart_dma out of bmdma_restart_dma

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: prepare to move restart to common code

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: introduce ide_register_restart_cb

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: do not use BMDMA in restart callback

Whenever an error stops the VM, ide_handle_rw_error does
"s->bus->dma->unit = s->unit".  So we can just use
idebus_active_if.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: pass IDEBus to the restart_cb

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: move restart callback to common code

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
ide: remove restart_cb callback

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>