📄 scsivar.h
字号:
#ifndef SCSIVAR_INCLUDE#define SCSIVAR_INCLUDE 1/* * 1/3/91 (ULTRIX) @(#)scsivar.h 4.5 *//************************************************************************ * * * Copyright (c) 1986, 1988 by * * Digital Equipment Corporation, Maynard, MA * * All rights reserved. * * * * This software is furnished under a license and may be used and * * copied only in accordance with the terms of such license and * * with the inclusion of the above copyright notice. This * * software or any other copies thereof may not be provided or * * otherwise made available to any other person. No title to and * * ownership of the software is hereby transferred. * * * * The information in this software is subject to change without * * notice and should not be construed as a commitment by Digital * * Equipment Corporation. * * * * Digital assumes no responsibility for the use or reliability * * of its software on equipment which is not supplied by Digital. * * * ************************************************************************//************************************************************************ * scsivar.h 06-Jun-88 * * Modification History * * 20-Nov-90 Robin Miller * o Added support for 10-byte READ/WRITE CDB's. * o Added SCSI Group definitions for use by sz_cdb_length() funtion. * o Removed all CD-ROM audio commands (conflict with psuedo commands). * * 16-Aug-90 Robin Miller * Added commands to support audio portion of CD-ROM's. * * 05-Jul-90 Bill Dallas * Got rid of some of the mbz fields and renamed * * 13-Nov-89 Janet L. Schank * Added the define DEFAULT_SCSIID which is used as the system's * default scsi id. * * 16-Jul-89 Fred Canter * Add sz_rzmodsns_dt to datfmt structure. So mode sense can * be used to get disk geometry. * * 14-Jul-89 Fred Canter * Merged Dynamic BBR and error log changes. * * 13-Jul-89 Fred Canter * Remove pf bit from mode sense command structure. Adding it * was an error. * * 23-Jun-89 John A. Gallant * Added read/write long structure definitions * * 24-May-89 Fred Canter * Added PF bit to mode select structure (for new rzdisk). * * 17-Dec-88 Fred Canter * Added pseudo commands to resolve the conflict between * SZ_UNLOAD and SZ_SSUNIT both being opcode 0x1b. * * 03-Nov-88 Alan Frechette * Added in support for disk maintainence. Added the commands * FORMAT UNIT, REASSIGN BLOCK, READ DEFECT DATA, and VERIFY DATA. * Changed values of the pseudo opcodes because they conflicted * with READ DEFECT DATA. * * 16-Oct-88 Fred Canter * Clean up comments. * * 28-Sep-88 Fred Canter * Clean up comments. * * 21-Aug-88 Fred Canter * Added new message definitions as part of message error handling. * * 16-Aug-88 Fred Canter * Merge 5380 and SII SCSI drivers. * * 08-Aug-88 Fred Canter * Add SZ_BUSY status code. * * 18-Jul-88 Fred Canter * Added extended message handling. * * 28-Jun-88 Fred Canter * Add new error code for improved ??command() error handling. * * 18-Jun-88 Fred Canter * Changed max request sense data length from 11 to 20 to * allow receiving all available sense data. * * 06-Jun-88 Fred Canter * Created this header file for scsi.c from stcvar.h. * ************************************************************************//* * Some commands are common to disks and tapes, some are not. * Disk unique commands begin with "d_", tape commands with "t_". * Common commands have no "_" before the name. */struct sz_cmdfmt { u_char opcode; /* SCSI comand opcode */ /* * Overlaid portion of commands */ union { /* * TEST UNIT READY Command * READ BLOCK LIMITS Command */ struct sz_tur_cm { u_char :5; /* Reserved */ u_char lun:3; /* Logical Unit Number */ u_char :8; /* Reserved */ u_char :8; /* Reserved */ u_char :8; /* Reserved */ u_char link:1; /* Link */ u_char flag:4; /* Flag */ u_char mbz:2; /* Must be Zero */ u_char pad[16]; /* Pad */ }tur; /* * REWIND Command */ struct sz_rewind_cm { u_char immed:1; /* Immediate */ u_char :4; /* Reserved */ u_char lun:3; /* Logical Unit Number */ u_char :8; /* Reserved */ u_char :8; /* Reserved */ u_char :8; /* Reserved */ u_char link:1; /* Link */ u_char flag:1; /* Flag */ u_char :4; /* Reserved */ u_char mbz:2; /* Must be Zero */ u_char pad[16]; /* Pad */ }rwd; /* * REQUEST SENSE Command * MODE SENSE Command * INQUIRY Command */ struct sz_sense_cm { u_char :5; /* Reserved */ u_char lun:3; /* Logical Unit Number */ u_char pgcode:6; /* Page code */ u_char pcf:2; /* PCF */ u_char :8; /* Reserved */ u_char alclen; /* Allocation Length */ u_char link:1; /* Link */ u_char flag:1; /* Flag */ u_char :4; /* Reserved */ u_char mbz:2; /* Must be Zero */ u_char pad[16]; /* Pad */ }sense; /* * TAPE specific: * READ Command * WRITE Command * RECOVER BUFFERED DATA Command */ struct sz_trw_cm { u_char fixed:1; /* Fixed */ u_char :4; /* Reserved */ u_char lun:3; /* Logical Unit Number */ u_char xferlen2; /* Transfer Length (MSB) */ u_char xferlen1; /* Transfer Length */ u_char xferlen0; /* Transfer Length (LSB) */ u_char link:1; /* Link */ u_char flag:1; /* Flag */ u_char :4; /* Reserved */ u_char mbz:2; /* Must be Zero */ u_char pad[16]; /* Pad */ }t_rw; /* * DISK specific: * READ Command * WRITE Command * RECOVER BUFFERED DATA Command * READ DEFECT DATA Command * FORMAT UNIT Command * REASSIGN BLOCK Command * VERIFY DATA Command */ struct sz_drw_cm { u_char lbaddr2:5; /* Logical Block Address (MSB) */ u_char lun:3; /* Logical Unit Number */ u_char lbaddr1; /* Logical Block Address */ u_char lbaddr0; /* Logical Block Address (LSB) */ u_char xferlen; /* Transfer Length (# of LBNs) */ u_char link:1; /* Link */ u_char flag:1; /* Flag */ u_char :4; /* Reserved */ u_char mbz:2; /* Must be Zero (VU) */ u_char pad[16]; /* Pad */ }d_rw; /* * Disk Read / Write 10-byte CDB. */ struct sz_drw10_cm { u_char reladr : 1; /* Relative Address bit [1] */ u_char : 4; /* Reserved */ u_char lun : 3; /* Logical Unit Number */ u_char lbaddr3; /* Logical Block Address [2] */ u_char lbaddr2; /* Logical Block Address [3] */ u_char lbaddr1; /* Logical Block Address [4] */ u_char lbaddr0; /* Logical Block Address [5] */ u_char : 8; /* Reserved [6] */ u_char xferlen1; /* Transfer Length [7] */ u_char xferlen0; /* Transfer Length [8] */ u_char link : 1; /* Link [9] */ u_char flag : 1; /* Flag */ u_char : 4; /* Reserved */ u_char mbz : 2; /* Must be Zero */ u_char pad[12]; /* Pad */ } d_rw10; struct sz_drdd_cm { u_char :5; /* Reserved */ u_char lun:3; /* Logical Unit Number */ u_char dlf:3; /* Defect List Format */ u_char g:1; /* Grown Defect List Bit */ u_char m:1; /* Manufacturers Defect List Bit */ u_char :3; /* Reserved */ u_char :8; /* Reserved */ u_char :8; /* Reserved */ u_char :8; /* Reserved */ u_char :8; /* Reserved */ u_char alclen1; /* Allocation Length */ u_char alclen0; /* Allocation Length */ u_char link:1; /* Link */ u_char flag:1; /* Flag */ u_char :4; /* Reserved */ u_char mbz:2; /* Must be Zero */ u_char pad[12]; /* Pad */ }d_rdd; struct sz_dfu_cm { u_char dlf:3; /* Defect List Format */ u_char cmplst:1; /* Complete List Bit */ u_char fmtdat:1; /* Format Data Bit */ u_char lun:3; /* Logical Unit Number */ u_char pattern; /* Format Data Pattern */ u_char interleave1; /* Interleave Factor */ u_char interleave0; /* Interleave Factor */ u_char control; /* Control Byte */ u_char pad[16]; /* Pad */ }d_fu; struct sz_drb_cm { u_char :5; /* Reserved */ u_char lun:3; /* Logical Unit Number */ u_char :8; /* Reserved */ u_char :8; /* Reserved */ u_char :8; /* Reserved */ u_char control; /* Control Byte */ u_char pad[16]; /* Pad */ }d_rb; struct sz_dvd_cm { u_char reladr:1; /* Relative Address bit */ u_char bytchk:1; /* Byte Check */ u_char :3; /* Reserved */ u_char lun:3; /* Logical Unit Number */ u_char lbaddr3; /* Logical Block Address */ u_char lbaddr2; /* Logical Block Address */ u_char lbaddr1; /* Logical Block Address */ u_char lbaddr0; /* Logical Block Address */ u_char :8; /* Reserved */ u_char verflen1; /* Verification Length */ u_char verflen0; /* Verification Length */ u_char link:1; /* Link */ u_char flag:1; /* Flag */ u_char :4; /* Reserved */ u_char mbz:2; /* Must be Zero */ u_char pad[12]; /* Pad */ }d_vd; /* * WRITE FILEMARKS Command */ struct sz_wfm_cm { u_char :5; /* Reserved */ u_char lun:3; /* Logical Unit Number */ u_char numoffmks2; /* Number of Filemarks (MSB) */ u_char numoffmks1; /* Number of Filemarks */ u_char numoffmks0; /* Number of Filemarks (LSB) */ u_char link:1; /* Link */ u_char flag:1; /* Flag */ u_char :4; /* Reserved */ u_char mbz:2; /* Must be Zero */ u_char pad[16]; /* Pad */ }wfm; /* * SPACE Command */ struct sz_space_cm { u_char code:2; /* Fixed */ u_char :3; /* Reserved */ u_char lun:3; /* Logical Unit Number */ u_char count2; /* Count (MSB) */ u_char count1; /* Count */ u_char count0; /* Count (LSB) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -