4 #include <hw/ide/internal.h>
6 typedef struct BMDMAState
{
13 /* current transfer state */
15 uint32_t cur_prd_last
;
16 uint32_t cur_prd_addr
;
19 BlockDriverCompletionFunc
*dma_cb
;
22 MemoryRegion addr_ioport
;
23 MemoryRegion extra_io
;
27 /* Bit 0-2 and 7: BM status register
28 * Bit 3-6: bus->error_status */
29 uint8_t migration_compat_status
;
30 struct PCIIDEState
*pci_dev
;
33 typedef struct CMD646BAR
{
37 struct PCIIDEState
*pci_dev
;
40 typedef struct PCIIDEState
{
44 uint32_t secondary
; /* used only for cmd646 */
45 MemoryRegion bmdma_bar
;
46 CMD646BAR cmd646_bar
[2]; /* used only for cmd646 */
50 static inline IDEState
*bmdma_active_if(BMDMAState
*bmdma
)
52 assert(bmdma
->unit
!= (uint8_t)-1);
53 return bmdma
->bus
->ifs
+ bmdma
->unit
;
57 void bmdma_init(IDEBus
*bus
, BMDMAState
*bm
, PCIIDEState
*d
);
58 void bmdma_cmd_writeb(BMDMAState
*bm
, uint32_t val
);
59 extern MemoryRegionOps bmdma_addr_ioport_ops
;
60 void pci_ide_create_devs(PCIDevice
*dev
, DriveInfo
**hd_table
);
62 extern const VMStateDescription vmstate_ide_pci
;