|
|
1.1 ! root 1: /* ! 2: * HISTORY ! 3: * $Log: scsi_all.h,v $ ! 4: * Revision 1.1 1993/03/21 18:12:52 cgd ! 5: * after 0.2.2 "stable" patches applied ! 6: * ! 7: * Revision 1.2 1992/11/20 23:07:13 julian ! 8: * add a definition for device type T_NODEVICE ! 9: * ! 10: * Revision 1.1 1992/09/26 22:14:02 julian ! 11: * Initial revision ! 12: * ! 13: * ! 14: * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE ! 15: * -------------------- ----- ---------------------- ! 16: * CURRENT PATCH LEVEL: 1 00098 ! 17: * -------------------- ----- ---------------------- ! 18: * ! 19: * 16 Feb 93 Julian Elischer ADDED for SCSI system ! 20: * ! 21: */ ! 22: ! 23: /* ! 24: * SCSI general interface description ! 25: */ ! 26: ! 27: ! 28: /* ! 29: * Largely written by Julian Elischer ([email protected]) ! 30: * for TRW Financial Systems. ! 31: * ! 32: * TRW Financial Systems, in accordance with their agreement with Carnegie ! 33: * Mellon University, makes this software available to CMU to distribute ! 34: * or use in any manner that they see fit as long as this message is kept with ! 35: * the software. For this reason TFS also grants any other persons or ! 36: * organisations permission to use or modify this software. ! 37: * ! 38: * TFS supplies this software to be publicly redistributed ! 39: * on the understanding that TFS is not responsible for the correct ! 40: * functioning of this software in any circumstances. ! 41: * ! 42: */ ! 43: ! 44: /* ! 45: * Ported to run under 386BSD by Julian Elischer ([email protected]) Sept 1992 ! 46: */ ! 47: ! 48: /* ! 49: * SCSI command format ! 50: */ ! 51: ! 52: ! 53: struct scsi_generic ! 54: { ! 55: u_char opcode; ! 56: u_char bytes[11]; ! 57: }; ! 58: ! 59: struct scsi_test_unit_ready ! 60: { ! 61: u_char op_code; ! 62: u_char :5; ! 63: u_char lun:3; ! 64: u_char unused[3]; ! 65: u_char link:1; ! 66: u_char flag:4; ! 67: u_char :3; ! 68: }; ! 69: ! 70: struct scsi_send_diag ! 71: { ! 72: u_char op_code; ! 73: u_char uol:1; ! 74: u_char dol:1; ! 75: u_char selftest:1; ! 76: u_char :1; ! 77: u_char pf:1; ! 78: u_char lun:3; ! 79: u_char unused[1]; ! 80: u_char paramlen[2]; ! 81: u_char link:1; ! 82: u_char flag:4; ! 83: u_char :3; ! 84: }; ! 85: ! 86: struct scsi_sense ! 87: { ! 88: u_char op_code; ! 89: u_char :5; ! 90: u_char lun:3; ! 91: u_char unused[2]; ! 92: u_char length; ! 93: u_char link:1; ! 94: u_char flag:1; ! 95: u_char :6; ! 96: }; ! 97: ! 98: struct scsi_inquiry ! 99: { ! 100: u_char op_code; ! 101: u_char :5; ! 102: u_char lun:3; ! 103: u_char unused[2]; ! 104: u_char length; ! 105: u_char link:1; ! 106: u_char flag:1; ! 107: u_char :6; ! 108: }; ! 109: ! 110: struct scsi_mode_sense ! 111: { ! 112: u_char op_code; ! 113: u_char :3; ! 114: u_char dbd:1; ! 115: u_char rsvd:1; ! 116: u_char lun:3; ! 117: u_char page_code:6; ! 118: u_char page_ctrl:2; ! 119: u_char unused; ! 120: u_char length; ! 121: u_char link:1; ! 122: u_char flag:1; ! 123: u_char :6; ! 124: }; ! 125: ! 126: struct scsi_mode_sense_big ! 127: { ! 128: u_char op_code; ! 129: u_char :3; ! 130: u_char dbd:1; ! 131: u_char rsvd:1; ! 132: u_char lun:3; ! 133: u_char page_code:6; ! 134: u_char page_ctrl:2; ! 135: u_char unused[4]; ! 136: u_char length[2]; ! 137: u_char link:1; ! 138: u_char flag:1; ! 139: u_char :6; ! 140: }; ! 141: ! 142: struct scsi_mode_select ! 143: { ! 144: u_char op_code; ! 145: u_char sp:1; ! 146: u_char :3; ! 147: u_char pf:1; ! 148: u_char lun:3; ! 149: u_char unused[2]; ! 150: u_char length; ! 151: u_char link:1; ! 152: u_char flag:1; ! 153: u_char :6; ! 154: }; ! 155: ! 156: struct scsi_mode_select_big ! 157: { ! 158: u_char op_code; ! 159: u_char sp:1; ! 160: u_char :3; ! 161: u_char pf:1; ! 162: u_char lun:3; ! 163: u_char unused[5]; ! 164: u_char length[2]; ! 165: u_char link:1; ! 166: u_char flag:1; ! 167: u_char :6; ! 168: }; ! 169: ! 170: struct scsi_reserve ! 171: { ! 172: u_char op_code; ! 173: u_char :5; ! 174: u_char lun:3; ! 175: u_char unused[2]; ! 176: u_char length; ! 177: u_char link:1; ! 178: u_char flag:1; ! 179: u_char :6; ! 180: }; ! 181: ! 182: struct scsi_release ! 183: { ! 184: u_char op_code; ! 185: u_char :5; ! 186: u_char lun:3; ! 187: u_char unused[2]; ! 188: u_char length; ! 189: u_char link:1; ! 190: u_char flag:1; ! 191: u_char :6; ! 192: }; ! 193: ! 194: struct scsi_prevent ! 195: { ! 196: u_char op_code; ! 197: u_char :5; ! 198: u_char lun:3; ! 199: u_char unused[2]; ! 200: u_char prevent:1; ! 201: u_char :7; ! 202: u_char link:1; ! 203: u_char flag:1; ! 204: u_char :6; ! 205: }; ! 206: #define PR_PREVENT 1 ! 207: #define PR_ALLOW 0 ! 208: ! 209: /* ! 210: * Opcodes ! 211: */ ! 212: ! 213: #define TEST_UNIT_READY 0x00 ! 214: #define REQUEST_SENSE 0x03 ! 215: #define INQUIRY 0x12 ! 216: #define MODE_SELECT 0x15 ! 217: #define MODE_SENSE 0x1a ! 218: #define START_STOP 0x1b ! 219: #define RESERVE 0x16 ! 220: #define RELEASE 0x17 ! 221: #define PREVENT_ALLOW 0x1e ! 222: #define POSITION_TO_ELEMENT 0x2b ! 223: #define MODE_SENSE_BIG 0x54 ! 224: #define MODE_SELECT_BIG 0x55 ! 225: #define MOVE_MEDIUM 0xa5 ! 226: #define READ_ELEMENT_STATUS 0xb8 ! 227: ! 228: ! 229: /* ! 230: * sense data format ! 231: */ ! 232: #define T_DIRECT 0 ! 233: #define T_SEQUENTIAL 1 ! 234: #define T_PRINTER 2 ! 235: #define T_PROCESSOR 3 ! 236: #define T_WORM 4 ! 237: #define T_READONLY 5 ! 238: #define T_SCANNER 6 ! 239: #define T_OPTICAL 7 ! 240: #define T_NODEVICE 0x1F ! 241: ! 242: #define T_CHANGER 8 ! 243: #define T_COMM 9 ! 244: ! 245: #define T_REMOV 1 ! 246: #define T_FIXED 0 ! 247: ! 248: struct scsi_inquiry_data ! 249: { ! 250: u_char device_type:5; ! 251: u_char device_qualifier:3; ! 252: u_char dev_qual2:7; ! 253: u_char removable:1; ! 254: u_char ansii_version:3; ! 255: u_char :5; ! 256: u_char response_format; ! 257: u_char additional_length; ! 258: u_char unused[2]; ! 259: u_char :3; ! 260: u_char can_link:1; ! 261: u_char can_sync:1; ! 262: u_char :3; ! 263: char vendor[8]; ! 264: char product[16]; ! 265: char revision[4]; ! 266: u_char extra[8]; ! 267: }; ! 268: ! 269: ! 270: struct scsi_sense_data ! 271: { ! 272: u_char error_code:4; ! 273: u_char error_class:3; ! 274: u_char valid:1; ! 275: union ! 276: { ! 277: struct ! 278: { ! 279: u_char blockhi:5; ! 280: u_char vendor:3; ! 281: u_char blockmed; ! 282: u_char blocklow; ! 283: } unextended; ! 284: struct ! 285: { ! 286: u_char segment; ! 287: u_char sense_key:4; ! 288: u_char :1; ! 289: u_char ili:1; ! 290: u_char eom:1; ! 291: u_char filemark:1; ! 292: u_char info[4]; ! 293: u_char extra_len; ! 294: /* allocate enough room to hold new stuff ! 295: u_char cmd_spec_info[4]; ! 296: u_char add_sense_code; ! 297: u_char add_sense_code_qual; ! 298: u_char fru; ! 299: u_char sense_key_spec_1:7; ! 300: u_char sksv:1; ! 301: u_char sense_key_spec_2; ! 302: u_char sense_key_spec_3; ! 303: ( by increasing 16 to 26 below) */ ! 304: u_char extra_bytes[26]; ! 305: } extended; ! 306: }ext; ! 307: }; ! 308: struct scsi_sense_data_new ! 309: { ! 310: u_char error_code:7; ! 311: u_char valid:1; ! 312: union ! 313: { ! 314: struct ! 315: { ! 316: u_char blockhi:5; ! 317: u_char vendor:3; ! 318: u_char blockmed; ! 319: u_char blocklow; ! 320: } unextended; ! 321: struct ! 322: { ! 323: u_char segment; ! 324: u_char sense_key:4; ! 325: u_char :1; ! 326: u_char ili:1; ! 327: u_char eom:1; ! 328: u_char filemark:1; ! 329: u_char info[4]; ! 330: u_char extra_len; ! 331: u_char cmd_spec_info[4]; ! 332: u_char add_sense_code; ! 333: u_char add_sense_code_qual; ! 334: u_char fru; ! 335: u_char sense_key_spec_1:7; ! 336: u_char sksv:1; ! 337: u_char sense_key_spec_2; ! 338: u_char sense_key_spec_3; ! 339: u_char extra_bytes[16]; ! 340: } extended; ! 341: }ext; ! 342: }; ! 343: ! 344: struct blk_desc ! 345: { ! 346: u_char density; ! 347: u_char nblocks[3]; ! 348: u_char reserved; ! 349: u_char blklen[3]; ! 350: }; ! 351: ! 352: struct scsi_mode_header ! 353: { ! 354: u_char data_length; /* Sense data length */ ! 355: u_char medium_type; ! 356: u_char dev_spec; ! 357: u_char blk_desc_len; ! 358: }; ! 359: ! 360: struct scsi_mode_header_big ! 361: { ! 362: u_char data_length[2]; /* Sense data length */ ! 363: u_char medium_type; ! 364: u_char dev_spec; ! 365: u_char unused[2]; ! 366: u_char blk_desc_len[2]; ! 367: }; ! 368: ! 369: ! 370: /* ! 371: * Status Byte ! 372: */ ! 373: #define SCSI_OK 0x00 ! 374: #define SCSI_CHECK 0x02 ! 375: #define SCSI_BUSY 0x08 ! 376: #define SCSI_INTERM 0x10
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.