📄 scsivar.h
字号:
u_char : 8; /* Reserved. [2] */ u_char : 8; /* Reserved. [3] */ u_char : 8; /* Reserved. [4] */ u_char : 8; /* Reserved. [5] */ u_char : 8; /* Reserved. [6] */ u_char : 8; /* Reserved. [7] */ u_char resume : 1; /* Resume = 1, Pause = 0. [8] */ u_char : 7; /* Reserved. */ u_char link : 1; /* Link. [9] */ u_char flag : 1; /* Flag. */ u_char : 4; /* Reserved. */ u_char mbz2 : 2; /* Vendor Unique. */ u_char pad[12]; /* Pad. */ } pr; /* * CD-ROM: Read TOC Command. */ struct sz_read_toc_cm { u_char : 1; /* Reserved. [1] */ u_char msf : 1; /* Report address in MSF format. */ u_char : 3; /* Reserved. */ u_char lun : 3; /* Logical Unit Number. */ u_char : 8; /* Reserved. [2] */ u_char : 8; /* Reserved. [3] */ u_char : 8; /* Reserved. [4] */ u_char : 8; /* Reserved. [5] */ u_char starting_track; /* Reserved. [6] */ u_char alloc_len1; /* Allocation length (MSB). [7] */ u_char alloc_len0; /* Allocation length (LSB). [8] */ u_char link : 1; /* Link. [9] */ u_char flag : 1; /* Flag. */ u_char : 4; /* Reserved. */ u_char mbz2 : 2; /* Vendor Unique. */ u_char pad[12]; /* Pad. */ } toc; /* * CD-ROM: Read Sub-Channel Command. */ struct sz_read_subc_cm { u_char : 1; /* Reserved. [1] */ u_char msf : 1; /* Report address in MSF format. */ u_char : 3; /* Reserved. */ u_char lun : 3; /* Logical Unit Number. */ u_char : 6; /* Reserved. [2] */ u_char subQ : 1; /* Sub-Q Channel Data. */ u_char : 1; /* Reserved. */ u_char data_format; /* Reserved. [3] */ u_char : 8; /* Reserved. [4] */ u_char : 8; /* Reserved. [5] */ u_char track_number; /* Reserved. [6] */ u_char alloc_len1; /* Allocation length (MSB). [7] */ u_char alloc_len0; /* Allocation length (LSB). [8] */ u_char link : 1; /* Link. [9] */ u_char flag : 1; /* Flag. */ u_char : 4; /* Reserved. */ u_char mbz2 : 2; /* Vendor Unique. */ u_char pad[12]; /* Pad. */ } sch; /* * CD-ROM: Read Header Command/ */ struct sz_read_header_cm { u_char : 1; /* Reserved. [1] */ u_char msf : 1; /* Report address in MSF format. */ u_char : 3; /* 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 alloc_len1; /* Allocation Length MSB. [7] */ u_char alloc_len0; /* Allocation Length LSB. [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. */ } rh; /* * CD-ROM: Play Track Command. */ struct sz_play_track_cm { u_char : 5; /* Reserved. [1] */ u_char lun : 3; /* Logical Unit Number. */ u_char : 8; /* Reserved. [2] */ u_char : 8; /* Reserved. [3] */ u_char starting_track; /* Starting track. [4] */ u_char starting_index; /* Starting index. [5] */ u_char : 8; /* Reserved. [6] */ u_char : 8; /* Reserved. [7] */ u_char number_indexes; /* Number of indexes. [8] */ u_char link : 1; /* Link. [9] */ u_char flag : 1; /* Flag. */ u_char : 4; /* Reserved. */ u_char mbz2 : 2; /* Vendor Unique. */ u_char pad[12]; /* Pad. */ } pt; /* * CD-ROM: Playback Control/Status Command. */ struct sz_playback_cm { u_char : 5; /* Reserved. [1] */ u_char lun : 3; /* Logical Unit Number. */ u_char : 8; /* Reserved. [2] */ u_char : 8; /* Reserved. [3] */ u_char : 8; /* Reserved. [4] */ u_char : 8; /* Reserved. [5] */ u_char : 8; /* Reserved. [6] */ u_char alloc_len1; /* Allocation length (MSB). [7] */ u_char alloc_len0; /* Allocation length (LSB). [8] */ u_char link : 1; /* Link. [9] */ u_char flag : 1; /* Flag. */ u_char : 4; /* Reserved. */ u_char mbz2 : 2; /* Vendor Unique. */ u_char pad[12]; /* Pad. */ } pb; /* * CD-ROM: Set Address Format Command. */ struct sz_set_address_format_cm { u_char : 5; /* Reserved. [1] */ u_char lun : 3; /* Logical Unit Number. */ u_char : 8; /* Reserved. [2] */ u_char : 8; /* Reserved. [3] */ u_char : 8; /* Reserved. [4] */ u_char : 8; /* Reserved. [5] */ u_char : 8; /* Reserved. [6] */ u_char : 8; /* Reserved. [7] */ u_char lbamsf : 1; /* Address Format 0/1 = LBA/MSF [8] */ u_char : 7; /* Reserved. */ u_char link : 1; /* Link. [9] */ u_char flag : 1; /* Flag. */ u_char : 4; /* Reserved. */ u_char mbz2 : 2; /* Vendor Unique. */ u_char pad[12]; /* Pad. */ } saf; }cmd;};/* * Data Format Structure */struct sz_datfmt { union { /* * Extended Sense Data Format */ struct sz_exsns_dt { u_char errcode:4; /* Error Code */ u_char errclass:3; /* Error Class */ u_char valid:1; /* Valid */ u_char segnum; /* Segment Number */ u_char snskey:4; /* Sense Key */ u_char :1; /* Reserved */ u_char ili:1; /* Illegal Length Indicator */ u_char eom:1; /* End of Medium */ u_char filmrk:1; /* Filemark */ u_char infobyte3; /* Information Byte (MSB) */ u_char infobyte2; /* Information Byte */ u_char infobyte1; /* Information Byte */ u_char infobyte0; /* Information Byte (LSB) */ u_char asl; /* Additional Sense Length */ union { /* Additional sense bytes */ struct { /* TAPE specific bytes */ u_char ctlr; /* Controller internal error code */ u_char drv0; /* Drive error byte */ u_char drv1; /* Drive error byte */ u_char pad[9]; /* Pad */ } tz_asb; struct { /* DISK specific bytes */ u_char rb1[4]; /* Reserved bytes */ u_char asc; /* Additional Sense Code */ u_char rb2[5]; /* Reserved bytes */ u_char pad[2]; /* Pad */ } rz_asb; struct { /* CD-ROM specific bytes */ u_char rb1[4]; /* Reserved bytes */ u_char asc; /* Additional Sense Code */ u_char rb2; /* Reserved byte */ u_char frufld; /* Field Replacable Unit failed */ u_char bitp:3; /* Bit Pointer */ u_char bpv:1; /* Bit Pointer Valid */ u_char vu:2; /* Vendor Unique */ u_char cd:1; /* Command / Data */ u_char fpv:1; /* Field Pointer Valid */ u_char fpmsb; /* Field Pointer (MSB) */ u_char fplsb; /* Field Pointer (LSB) */ u_char pad[2]; /* Pad */ } cd_asb; } asb; u_char pad1[24]; }exsns; /* * READ BLOCK LIMITS Data */ struct sz_rd_blklim_dt { u_char :8; /* Reserved */ u_char maxreclen2; /* Maximum Record Length (MSB) */ u_char maxreclen1; /* Maximum Record Length */ u_char maxreclen0; /* Maximum Record Length (LSB) */ u_char minreclen1; /* Minimum Record Length (MSB) */ u_char minreclen0; /* Minimum Record Length (LSB) */ u_char pad[14]; /* Pad */ u_char pad1[24]; }rdblim; /* * DISK specific: * READ CAPACITY Data */ struct sz_rdcap_dt { u_char lbaddr3; /* Logical block Address (MSB) */ u_char lbaddr2; /* Logical block Address */ u_char lbaddr1; /* Logical block Address */ u_char lbaddr0; /* Logical block Address (LSB) */ u_char blklen3; /* Block Length (MSB) */ u_char blklen2; /* Block Length */ u_char blklen1; /* Block Length */ u_char blklen0; /* Block Length (LSB) */ u_char pad[12]; /* Pad */ u_char pad1[24]; }rdcap; /* * INQUIRY Data */ struct sz_inq_dt { u_char perfdt; /* Peripheral Deice Type */ u_char devtq:7; /* Device Type Qualifier */ u_char rmb:1; /* Removable Media Bit */ u_char version; /* Version */ u_char :8; /* Reserved */ u_char addlen; /* Additional Length */ u_char rsvd[3]; /* Reserved */ u_char vndrid[8]; /* Vendor ID (ASCII) */ u_char prodid[16]; /* Product ID (ASCII) */ u_char revlvl[4]; /* Revision level (ASCII) */ u_char revdata[8]; /* Revision data (ASCII) */ }inq; /* * MODE SENSE Data */ struct sz_modsns_dt { /* Parameter List Header */ u_char sdlen; /* Sense Data Length */ u_char mbz1:8; /* Must be Zero */ u_char speed:4; /* was mbz2 now speed */ u_char bufmode:3; /* Buffered Mode */ u_char wp:1; /* Write Protect */ u_char bdeclen; /* Block Descriptor Length */ /* Parameter List Block Descriptor */ u_char density; /* WAS mbz3 now density(tapes) */ u_char numofblk2; /* Number of Blocks (MSB) */ u_char numofblk1; /* Number of Blocks */ u_char numofblk0; /* Number of Blocks (LSB) */ u_char :8; /* Reserved */ u_char blklen2; /* Block Length (MSB) */ u_char blklen1; /* Block Length */ u_char blklen0; /* Block Length (LSB) */ u_char vulen; /* Vendor Unique Length */ u_char nof:2; /* Enable Fillers */ u_char mbz4:5; /* Must be Zero */ u_char vu7:1; /* Direct Track Access */ u_char pad[6]; /* Pad */ u_char pad1[24]; }modsns; /* * MODE SENSE Data for DISKS */ struct sz_rzmodsns_dt { /* Parameter List Header */ u_char sdlen; /* Sense Data Length */ u_char medtyp; /* Medium Type */ u_char : 7; /* Reserved */ u_char wp : 1; /* Write Protect */ u_char bdlen; /* Block Descriptor Length */ /* Parameter List Block Descriptor */ u_char dencode; /* Density Code */ u_char nblks2; /* Number of Blocks (MSB) */ u_char nblks1; /* Number of Blocks */ u_char nblks0; /* Number of Blocks (LSB) */ u_char : 8; /* Reserved */ u_char blklen2; /* Block Length (MSB) */ u_char blklen1; /* Block Length */ u_char blklen0; /* Block Length (LSB) */ /* Parameter List Page Data (32 bytes, one page only) */ u_char mspage[32]; /* Page header and data */ }rzmodsns; /* * RECEIVE DIAGNOSTIC RESULT Data */ struct sz_recdiag_dt { u_char ctlr_hd_rev; /* Controller hardware revision level */ u_char ctlr_fw_rev; /* Controller firmware revision level */ u_char ctlr_selftest; /* Controller selftest 0 = Passed */ /* 1 = Failed */ u_char drv_hw_rev; /* Drive hardware revision level */ u_char drv_fw_rev; /* Drive firmware revision level */ u_char drv_selftest; /* Drive selftest 0 = Passed */ /* xx = Failure Code */ /* TODO1: why no pad? */ }recdiag; }dat;};/* * Define Masks for SCSI Group Codes. */#define SCSI_GROUP_0 0x00 /* SCSI Group Code 0. */#define SCSI_GROUP_1 0x20 /* SCSI Group Code 1. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -