8 typedef void (*ESPDMAMemoryReadWriteFunc
)(void *opaque
, uint8_t *buf
, int len
);
9 void esp_init(hwaddr espaddr
, int it_shift
,
10 ESPDMAMemoryReadWriteFunc dma_memory_read
,
11 ESPDMAMemoryReadWriteFunc dma_memory_write
,
12 void *dma_opaque
, qemu_irq irq
, qemu_irq
*reset
,
13 qemu_irq
*dma_enable
);
18 typedef struct ESPState ESPState
;
21 uint8_t rregs
[ESP_REGS
];
22 uint8_t wregs
[ESP_REGS
];
26 uint32_t ti_rptr
, ti_wptr
;
29 uint8_t ti_buf
[TI_BUFSZ
];
31 SCSIDevice
*current_dev
;
32 SCSIRequest
*current_req
;
33 uint8_t cmdbuf
[TI_BUFSZ
];
37 /* The amount of data left in the current DMA transfer. */
39 /* The size of the current DMA transfer. Zero if no transfer is in
47 ESPDMAMemoryReadWriteFunc dma_memory_read
;
48 ESPDMAMemoryReadWriteFunc dma_memory_write
;
50 void (*dma_cb
)(ESPState
*s
);
58 #define ESP_WBUSID 0x4
62 #define ESP_WSYNTP 0x6
63 #define ESP_RFLAGS 0x7
80 #define CMD_FLUSH 0x01
81 #define CMD_RESET 0x02
82 #define CMD_BUSRESET 0x03
85 #define CMD_MSGACC 0x12
88 #define CMD_RSTATN 0x1b
90 #define CMD_SELATN 0x42
91 #define CMD_SELATNS 0x43
92 #define CMD_ENSEL 0x44
93 #define CMD_DISSEL 0x45
101 #define STAT_PIO_MASK 0x06
106 #define STAT_INT 0x80
108 #define BUSID_DID 0x07
113 #define INTR_RST 0x80
118 #define CFG1_RESREPT 0x40
120 #define TCHI_FAS100A 0x4
121 #define TCHI_AM53C974 0x12
123 void esp_dma_enable(ESPState
*s
, int irq
, int level
);
124 void esp_request_cancelled(SCSIRequest
*req
);
125 void esp_command_complete(SCSIRequest
*req
, uint32_t status
, size_t resid
);
126 void esp_transfer_data(SCSIRequest
*req
, uint32_t len
);
127 void esp_hard_reset(ESPState
*s
);
128 uint64_t esp_reg_read(ESPState
*s
, uint32_t saddr
);
129 void esp_reg_write(ESPState
*s
, uint32_t saddr
, uint64_t val
);
130 extern const VMStateDescription vmstate_esp
;