mirror of
https://github.com/simh/simh.git
synced 2026-02-19 05:48:18 +00:00
3B2: Migrate 3b2_scsi to use updated sim_scsi, sim_disk and sim_tape
Started from pending 3b2-700 3b2_scsi.c and 3b2_scsi.h
This commit is contained in:
1077
3B2/3b2_scsi.c
1077
3B2/3b2_scsi.c
File diff suppressed because it is too large
Load Diff
185
3B2/3b2_scsi.h
185
3B2/3b2_scsi.h
@@ -1,6 +1,6 @@
|
||||
/* 3b2_scsi.h: AT&T 3B2 SCSI (CM195W) Host Adapter
|
||||
/* 3b2_scsi.h: CM195W SCSI Controller CIO Card
|
||||
|
||||
Copyright (c) 2020, Seth J. Morabito
|
||||
Copyright (c) 2020-2022, Seth J. Morabito
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
@@ -36,6 +36,7 @@
|
||||
/* CIO Opcodes */
|
||||
#define HA_BOOT 0x0a
|
||||
#define HA_READ_BLK 0x0b
|
||||
#define HA_WRITE_BLK 0x0c
|
||||
#define HA_CNTRL 0x20
|
||||
#define HA_VERS 0x40
|
||||
#define HA_DL_EEDT 0x42
|
||||
@@ -47,6 +48,7 @@
|
||||
#define HA_FORMAT 0x04
|
||||
#define HA_WRITE 0x0a
|
||||
#define HA_INQUIRY 0x12
|
||||
#define HA_MODESEL 0x15
|
||||
#define HA_MODESNS 0x1a
|
||||
#define HA_RDCPCTY 0x25
|
||||
#define HA_READ 0x08
|
||||
@@ -88,93 +90,116 @@
|
||||
#define HA_MAX_CMD 12
|
||||
#define INQUIRY_MAX 36
|
||||
|
||||
#define HA_STAT(ha_stat,cio_stat) { \
|
||||
ha_state.reply.ssb = (ha_stat); \
|
||||
ha_state.reply.status = (cio_stat); \
|
||||
#define HA_STAT(tc,ha_stat,cio_stat) { \
|
||||
ha_state.ts[tc].rep.ssb = (ha_stat); \
|
||||
ha_state.ts[tc].rep.status = (cio_stat); \
|
||||
}
|
||||
|
||||
/* Hardware Notes
|
||||
* ==============
|
||||
*
|
||||
* Disk Drives
|
||||
* -----------
|
||||
*
|
||||
* There are two emulated SCSI disk drives available.
|
||||
*
|
||||
* 1. 155 MB CDC Wren III (CDC 94161-9)
|
||||
* 2. 327 MB CDC Wren IV (CDC 94171-9)
|
||||
*
|
||||
* The CDC 94161-9 was also OEMed as the "AT&T KS23483,L3"
|
||||
* The CDC 94171-9 was also OEMed as the "AT&T KS23483,L25"
|
||||
*
|
||||
*
|
||||
* Tape Drive
|
||||
* ----------
|
||||
*
|
||||
* Wangtek 5125EN (AT&T Part number KS23417,L2)
|
||||
*
|
||||
* DC600A cartridge tape at 120MB (QIC-120 format)
|
||||
*
|
||||
*/
|
||||
|
||||
/* CDC Wren IV 327 MB Hard Disk (AT&T KS-23483,L3) */
|
||||
#define SD327_PQUAL 0x00
|
||||
#define SD327_SCSI 1
|
||||
#define SD327_BLK 512
|
||||
#define SD327_LBN 640396
|
||||
#define SD327_TEXT "Set CDC 327MB Disk Type"
|
||||
#define SD327_MANU "AT&T"
|
||||
#define SD327_DESC "KS23483"
|
||||
#define SD327_REV "0001" /* TODO: Find real rev */
|
||||
#define SD327_TPZ 9
|
||||
#define SD327_ASEC 3
|
||||
#define SD327_ATPZ 0
|
||||
#define SD327_ATPU 0
|
||||
#define SD327_SPT 46
|
||||
#define SD327_CYL 1549
|
||||
#define SD327_HEADS 9
|
||||
#define SD327_PREC 1200
|
||||
#define SD327_RWC 1200
|
||||
#define SD327_STEP 15
|
||||
#define SD327_LZ 1549
|
||||
#define SD327_RPM 3600
|
||||
|
||||
/* Wangtek 120MB cartridge tape (AT&T KS-23465) */
|
||||
/* Other SCSI hard disk types
|
||||
* ---------------------------
|
||||
*
|
||||
* These geometries are supported natively and automatically
|
||||
* by System V Release 3.2.3 UNIX.
|
||||
*
|
||||
* 1. CDC 94161-9 155 MB/148 MiB 512 B/s, 35 s/t, 9 head, 965 cyl
|
||||
* 2. AT&T KS23483 327 MB/312 MiB 512 B/s, 46 s/t, 9 head, 1547 cyl
|
||||
* (a.k.a CDC 94171-9)
|
||||
*
|
||||
* Also supported was a SCSI-to-ESDI bridge controller that used the
|
||||
* Emulex MD23/S2 SCSI-to-ESDI bridge. It allowed up to four ESDI
|
||||
* drives to be mapped as LUNs 0-3.
|
||||
*
|
||||
*/
|
||||
|
||||
/* AT&T 155 MB Hard Disk (35 sec/t, 9 hd, 964 cyl) */
|
||||
#define SD155_PQUAL 0x00
|
||||
#define SD155_SCSI 1
|
||||
#define SD155_BLK 512
|
||||
#define SD155_LBN 303660
|
||||
#define SD155_TEXT "Set 155MB Disk Type"
|
||||
#define SD155_MANU "AT&T"
|
||||
#define SD155_DESC "KS23483"
|
||||
#define SD155_REV "0000"
|
||||
|
||||
/* AT&T 300 MB Hard Disk (43 sec/t, 9 hd, 1514 cyl) */
|
||||
#define SD300_PQUAL 0x00
|
||||
#define SD300_SCSI 1
|
||||
#define SD300_BLK 512
|
||||
#define SD300_LBN 585937
|
||||
#define SD300_TEXT "Set 300MB Disk Type"
|
||||
#define SD300_MANU "AT&T"
|
||||
#define SD300_DESC "KS23483"
|
||||
#define SD300_REV "0000"
|
||||
|
||||
/* AT&T 327 MB Hard Disk (46 sec/t, 9 hd, 1547 cyl) */
|
||||
#define SD327_PQUAL 0x00
|
||||
#define SD327_SCSI 1
|
||||
#define SD327_BLK 512
|
||||
#define SD327_LBN 640458
|
||||
#define SD327_TEXT "Set 327MB Disk Type"
|
||||
#define SD327_MANU "AT&T"
|
||||
#define SD327_DESC "KS23483"
|
||||
#define SD327_REV "0000"
|
||||
|
||||
/* AT&T 630 MB Hard Disk (56 sec/t, 16 hd, 1447 cyl) */
|
||||
#define SD630_PQUAL 0x00
|
||||
#define SD630_SCSI 1
|
||||
#define SD630_BLK 512
|
||||
#define SD630_LBN 1296512
|
||||
#define SD630_TEXT "Set 630MB Disk Type"
|
||||
#define SD630_MANU "AT&T"
|
||||
#define SD630_DESC "KS23483"
|
||||
#define SD630_REV "0000"
|
||||
|
||||
/* Wangtek 120MB cartridge tape */
|
||||
#define ST120_PQUAL 0x00
|
||||
#define ST120_SCSI 1
|
||||
#define ST120_BLK 512
|
||||
#define ST120_LBN 266004
|
||||
#define ST120_LBN 1
|
||||
#define ST120_TEXT "Set Wangtek 120MB Tape Type"
|
||||
#define ST120_MANU "WANGTEK"
|
||||
#define ST120_DESC "KS23465"
|
||||
#define ST120_REV "CX17"
|
||||
#define ST120_DENS 5
|
||||
|
||||
#define HA_DISK(d) { DRV_SCSI( \
|
||||
SCSI_DISK, d##_PQUAL, d##_SCSI, FALSE, d##_BLK, \
|
||||
d##_LBN, d##_MANU, d##_DESC, d##_REV, #d, 0, \
|
||||
d##_TEXT) \
|
||||
}
|
||||
|
||||
#define HA_TAPE(d) { DRV_SCSI( \
|
||||
SCSI_TAPE, d##_PQUAL, d##_SCSI, TRUE, d##_BLK, \
|
||||
d##_LBN, d##_MANU, d##_DESC, d##_REV, #d, 0, \
|
||||
d##_TEXT) \
|
||||
}
|
||||
|
||||
#define HA_SIZE(d) d##_LBN
|
||||
|
||||
|
||||
/* Hardware Notes
|
||||
* ==============
|
||||
*
|
||||
* Disk Drive
|
||||
* ----------
|
||||
*
|
||||
* We emulate a 300-Megabyte Hard Disk, AT&T part number KS23483,L3.
|
||||
*
|
||||
* This is the same as a CDC/Imprimis Wren IV 94171-327
|
||||
*
|
||||
* 512 bytes per block
|
||||
* 1,520 cylinders
|
||||
* 2 alternate cylinders (1518 available)
|
||||
* 46 Sectors per Track
|
||||
* 3 Alternate Sectors per Track (43 available)
|
||||
* 9 tracks per cylinder (9 heads)
|
||||
*
|
||||
* Formatted Size: 587,466 blocks
|
||||
*
|
||||
*
|
||||
* Tape Drive
|
||||
* ----------
|
||||
*
|
||||
* Wangtek 5099EN (AT&T Part number KS23417,L2)
|
||||
*
|
||||
* DC600A cartridge tape
|
||||
*
|
||||
* 512 bytes per block
|
||||
* 9 tracks
|
||||
* 13,956 blocks per track
|
||||
*
|
||||
* Formatted Size: 125,604 blocks
|
||||
*
|
||||
*/
|
||||
|
||||
#define HA_JOB_QUICK 0
|
||||
#define HA_JOB_EXPRESS 1
|
||||
#define HA_JOB_FULL 2
|
||||
@@ -208,7 +233,6 @@ typedef struct {
|
||||
*/
|
||||
typedef struct {
|
||||
ha_jobtype type; /* Job type */
|
||||
t_bool pending; /* Pending or completed? */
|
||||
uint8 status; /* Result Status */
|
||||
uint8 op; /* Command Opcode */
|
||||
uint8 subdev; /* XXTTTLLL; T=Target, L=LUN */
|
||||
@@ -221,19 +245,24 @@ typedef struct {
|
||||
#define PUMP_SYSGEN 1
|
||||
#define PUMP_COMPLETE 2
|
||||
|
||||
/*
|
||||
* SCSI Target state
|
||||
*/
|
||||
typedef struct {
|
||||
t_bool pending; /* Service pending */
|
||||
ha_req req; /* SCSI job request */
|
||||
ha_resp rep; /* SCSI job reply */
|
||||
} ha_ts;
|
||||
|
||||
/*
|
||||
* General SCSI HA internal state.
|
||||
*/
|
||||
typedef struct {
|
||||
uint8 cid; /* Card Backsplane Slot # */
|
||||
uint8 slot; /* Card Backsplane Slot # */
|
||||
uint32 pump_state;
|
||||
uint32 haddr; /* Host address for read/write */
|
||||
uint32 hlen; /* Length for read or write */
|
||||
t_bool initialized; /* Card has been initialized */
|
||||
t_bool frq; /* Fast Request Queue enabled */
|
||||
uint8 edt[HA_EDT_LEN]; /* Equipped Device Table */
|
||||
ha_req request; /* Current job request */
|
||||
ha_resp reply; /* Current job reply */
|
||||
t_bool frq; /* Fast Request Queue enabled */
|
||||
uint8 edt[HA_EDT_LEN]; /* Equipped Device Table */
|
||||
ha_ts ts[8]; /* Target state */
|
||||
} HA_STATE;
|
||||
|
||||
t_stat ha_show_type(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
|
||||
@@ -245,12 +274,12 @@ t_stat ha_attach(UNIT *uptr, CONST char *cptr);
|
||||
t_stat ha_detach(UNIT *uptr);
|
||||
|
||||
void ha_fast_queue_check();
|
||||
void ha_sysgen(uint8 cid);
|
||||
void ha_express(uint8 cid);
|
||||
void ha_full(uint8 cid);
|
||||
void ha_sysgen(uint8 slot);
|
||||
void ha_express(uint8 slot);
|
||||
void ha_full(uint8 slot);
|
||||
|
||||
/* Fast Completion */
|
||||
|
||||
void ha_fcm_express();
|
||||
void ha_fcm_express(uint8 target);
|
||||
|
||||
#endif /* _3B2_SCSI_H_ */
|
||||
|
||||
Reference in New Issue
Block a user