|
|
1.1 ! root 1: /* ! 2: * Common SCSI portions of Adaptec AHA154x driver ! 3: * ! 4: * $Log: scsiwork.h,v $ ! 5: * Revision 1.2 92/09/29 09:27:16 bin ! 6: * updated with kernel 63 src ! 7: * ! 8: * Revision 1.9 91/05/29 11:47:29 hal ! 9: * Add MSG_NOP. ! 10: * ! 11: * Revision 1.8 91/05/15 14:52:23 root ! 12: * Add READCAPLEN. ! 13: * ! 14: * Revision 1.7 91/04/20 01:36:46 root ! 15: * Add ScmdREZERO ! 16: * ! 17: * Revision 1.6 91/04/19 10:04:15 root ! 18: * Add MSG_IDENTIFY. ! 19: * ! 20: * Revision 1.5 91/04/17 02:21:18 root ! 21: * Add mode sense constants. ! 22: * ! 23: * Revision 1.4 91/04/10 14:11:41 root ! 24: * Add Information Transfer Phase masks. ! 25: * ! 26: * Revision 1.3 91/04/10 13:57:38 root ! 27: * Add constants such as message types - needed by ss.c ! 28: * ! 29: * Revision 1.2 91/03/14 16:51:29 root ! 30: * add Test Ready and Request Sense commands ! 31: * ! 32: * Revision 1.1 91/03/05 13:02:21 root ! 33: * As used to build initial aha154x driver ! 34: * ! 35: */ ! 36: #define MAX_SCSI_ID 8 ! 37: #define MAX_LUN 4 /* limited by minor device number */ ! 38: ! 39: /* ! 40: * drive_info contains the "per drive" flags ! 41: */ ! 42: extern char drive_info[MAX_SCSI_ID * MAX_LUN]; ! 43: #define D_DISK 0x01 /* disk-type device (random) */ ! 44: #define D_TAPE 0x02 /* tape-type device (sequential) */ ! 45: #define D_PRINTER 0x04 /* printer-type device */ ! 46: #define D_PROCESSOR 0x08 /* processor-type device */ ! 47: #define D_REMOVEABLE 0x10 /* media can be changed */ ! 48: #define D_WORM 0x20 /* WORM-type characteristics */ ! 49: ! 50: /* ! 51: * Per disk controller data. ! 52: * Only one host adapter; no more, no less. ! 53: */ ! 54: ! 55: struct scsi_work { ! 56: struct scsi_work *sw_actf; /* Link to first */ ! 57: struct scsi_work *sw_actl; /* Link to last */ ! 58: BUF *sw_bp; /* block request */ ! 59: long sw_bno; ! 60: char sw_drv; /* 000sssll s=SCSI_ID l=LUN */ ! 61: char sw_type; ! 62: char sw_retry; ! 63: }; ! 64: ! 65: typedef struct scsi_work scsi_work_t; ! 66: ! 67: #define ScmdTESTREADY 0x00 ! 68: #define ScmdREZERO 0x01 ! 69: #define ScmdREQUESTSENSE 0x03 ! 70: #define ScmdINQUIRY 0x12 ! 71: #define ScmdMODESENSE 0x1A ! 72: #define ScmdREADCAPACITY 0x25 ! 73: #define ScmdREADEXTENDED 0x28 ! 74: #define ScmdWRITEXTENDED 0x2A ! 75: ! 76: struct scsi_cmd { ! 77: long block, buffer; ! 78: short blklen, buflen; ! 79: char unit; /* 000sssll s=SCSI_ID l=LUN */ ! 80: char cmd; ! 81: }; ! 82: ! 83: typedef struct scsi_cmd scsi_cmd_t; ! 84: ! 85: #define G0CMDLEN 6 /* Group 0 commands are 6 bytes long */ ! 86: #define G1CMDLEN 10 /* Group 1 commands are 10 bytes long */ ! 87: #define SENSELEN 22 /* number of bytes returned w/ req sense */ ! 88: #define INQUIRYLEN 54 /* number of bytes returned w/ inquiry */ ! 89: #define MODESENSELEN 92 /* number of bytes returned w/ mode sense */ ! 90: #define READCAPLEN 8 /* number of bytes returned w/read capacity */ ! 91: ! 92: /* Message types */ ! 93: #define MSG_CMD_CMPLT 0x00 /* Command Complete */ ! 94: #define MSG_SAVE_DPTR 0x02 /* Save SCSI data pointer */ ! 95: #define MSG_RSTOR_DPTR 0x03 /* Restore SCSI pointers */ ! 96: #define MSG_DISCONNECT 0x04 /* Target is about to disconnect */ ! 97: #define MSG_ABORT 0x06 /* End the current SCSI bus cycle */ ! 98: #define MSG_NOP 0x08 /* no-op */ ! 99: #define MSG_DEV_RESET 0x0C /* Bus Device Reset */ ! 100: #define MSG_IDENTIFY 0x80 /* Identify, with no Disconnect */ ! 101: #define MSG_IDENT_DC 0xC0 /* Identify, with Disconnect allowed */ ! 102: ! 103: #define CS_GOOD 0x00 /* Command Status from the drive */ ! 104: #define CS_CHECK 0x02 ! 105: #define CS_BUSY 0x08 ! 106: #define CS_RESERVED 0x18 ! 107: ! 108: /* ! 109: * Information Transfer Phase masks - ! 110: * setting of RS_MESSAGE, RS_I_O, and RS_CTRL_DATA determines which of six ! 111: * possible info transfer phases is occurring. ! 112: */ ! 113: #define XP_MSG_IN (RS_MESSAGE | RS_I_O | RS_CTRL_DATA) ! 114: #define XP_MSG_OUT (RS_MESSAGE | RS_CTRL_DATA) ! 115: #define XP_STAT_IN ( RS_I_O | RS_CTRL_DATA) ! 116: #define XP_CMD_OUT ( RS_CTRL_DATA) ! 117: #define XP_DATA_IN ( RS_I_O ) ! 118: #define XP_DATA_OUT ( 0) ! 119: ! 120: #define VTOP2(a1, a2) vtop(a1,a2)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.