hw/ide: Remove now unneded #include "hw/pci/pci.h" from hw/ide.h
[qemu/ar7.git] / include / hw / ide / pci.h
blob98ffa7dfcd60d06864b3be31ea079940f5c2490b
1 #ifndef HW_IDE_PCI_H
2 #define HW_IDE_PCI_H
4 #include "hw/ide/internal.h"
5 #include "hw/pci/pci.h"
7 #define BM_STATUS_DMAING 0x01
8 #define BM_STATUS_ERROR 0x02
9 #define BM_STATUS_INT 0x04
11 #define BM_CMD_START 0x01
12 #define BM_CMD_READ 0x08
14 typedef struct BMDMAState {
15 IDEDMA dma;
16 uint8_t cmd;
17 uint8_t status;
18 uint32_t addr;
20 IDEBus *bus;
21 /* current transfer state */
22 uint32_t cur_addr;
23 uint32_t cur_prd_last;
24 uint32_t cur_prd_addr;
25 uint32_t cur_prd_len;
26 BlockCompletionFunc *dma_cb;
27 MemoryRegion addr_ioport;
28 MemoryRegion extra_io;
29 qemu_irq irq;
31 /* Bit 0-2 and 7: BM status register
32 * Bit 3-6: bus->error_status */
33 uint8_t migration_compat_status;
34 uint8_t migration_retry_unit;
35 int64_t migration_retry_sector_num;
36 uint32_t migration_retry_nsector;
38 struct PCIIDEState *pci_dev;
39 } BMDMAState;
41 #define TYPE_PCI_IDE "pci-ide"
42 #define PCI_IDE(obj) OBJECT_CHECK(PCIIDEState, (obj), TYPE_PCI_IDE)
44 typedef struct PCIIDEState {
45 /*< private >*/
46 PCIDevice parent_obj;
47 /*< public >*/
49 IDEBus bus[2];
50 BMDMAState bmdma[2];
51 uint32_t secondary; /* used only for cmd646 */
52 MemoryRegion bmdma_bar;
53 MemoryRegion cmd_bar[2];
54 MemoryRegion data_bar[2];
55 } PCIIDEState;
57 static inline IDEState *bmdma_active_if(BMDMAState *bmdma)
59 assert(bmdma->bus->retry_unit != (uint8_t)-1);
60 return bmdma->bus->ifs + bmdma->bus->retry_unit;
63 void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d);
64 void bmdma_cmd_writeb(BMDMAState *bm, uint32_t val);
65 extern MemoryRegionOps bmdma_addr_ioport_ops;
66 void pci_ide_create_devs(PCIDevice *dev, DriveInfo **hd_table);
68 extern const VMStateDescription vmstate_ide_pci;
69 extern const MemoryRegionOps pci_ide_cmd_le_ops;
70 extern const MemoryRegionOps pci_ide_data_le_ops;
71 #endif