2017-05-30 03:38:38 +02:00
|
|
|
/*
|
|
|
|
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
|
|
|
|
* running old operating systems and software designed for IBM
|
|
|
|
|
* PC systems and compatibles from 1981 through fairly recent
|
|
|
|
|
* system designs based on the PCI bus.
|
|
|
|
|
*
|
|
|
|
|
* Emulation of SCSI fixed and removable disks.
|
|
|
|
|
*
|
2018-10-26 04:47:21 +02:00
|
|
|
* Version: @(#)scsi_disk.h 1.0.7 2018/10/26
|
2017-05-30 03:38:38 +02:00
|
|
|
*
|
|
|
|
|
* Author: Miran Grca, <mgrca8@gmail.com>
|
2018-04-25 23:51:13 +02:00
|
|
|
* Copyright 2017,2018 Miran Grca.
|
2017-05-30 03:38:38 +02:00
|
|
|
*/
|
|
|
|
|
|
2017-09-30 16:56:38 -04:00
|
|
|
|
2017-05-27 03:53:32 +02:00
|
|
|
typedef struct {
|
2018-07-15 01:41:53 +02:00
|
|
|
mode_sense_pages_t ms_pages_saved;
|
2017-10-08 05:04:38 +02:00
|
|
|
|
2018-07-15 01:41:53 +02:00
|
|
|
hard_disk_t *drv;
|
2017-10-08 05:04:38 +02:00
|
|
|
|
2018-10-10 22:33:24 +02:00
|
|
|
uint8_t *temp_buffer,
|
|
|
|
|
pad[16], /* This is atapi_cdb in ATAPI-supporting devices,
|
|
|
|
|
and pad in SCSI-only devices. */
|
2018-07-15 01:41:53 +02:00
|
|
|
current_cdb[16],
|
|
|
|
|
sense[256];
|
2017-10-08 05:04:38 +02:00
|
|
|
|
2018-10-10 22:33:24 +02:00
|
|
|
uint8_t status, phase,
|
|
|
|
|
error, id,
|
|
|
|
|
pad0, pad1,
|
|
|
|
|
pad2, pad3;
|
2017-10-08 05:04:38 +02:00
|
|
|
|
2018-10-10 22:33:24 +02:00
|
|
|
uint16_t request_length, pad4;
|
2017-10-14 07:03:19 +02:00
|
|
|
|
2018-10-10 22:33:24 +02:00
|
|
|
int requested_blocks, packet_status,
|
|
|
|
|
total_length, do_page_save,
|
|
|
|
|
unit_attention;
|
2017-05-27 03:53:32 +02:00
|
|
|
|
2018-10-10 22:33:24 +02:00
|
|
|
uint32_t sector_pos, sector_len,
|
|
|
|
|
packet_len, pos;
|
2017-09-30 16:56:38 -04:00
|
|
|
|
2018-10-10 22:33:24 +02:00
|
|
|
int64_t callback;
|
2018-07-15 01:41:53 +02:00
|
|
|
} scsi_disk_t;
|
2017-09-30 16:56:38 -04:00
|
|
|
|
2017-05-27 03:53:32 +02:00
|
|
|
|
2018-07-15 01:41:53 +02:00
|
|
|
extern scsi_disk_t *scsi_disk[HDD_NUM];
|
2017-05-29 01:18:32 +02:00
|
|
|
|
2018-07-15 01:41:53 +02:00
|
|
|
|
|
|
|
|
extern void scsi_disk_hard_reset(void);
|
|
|
|
|
extern void scsi_disk_close(void);
|