Annotation of Net2/scsi/scsi_cd.h, revision 1.1.1.2

1.1       root        1: /*
                      2:  * Written by Julian Elischer ([email protected])
                      3:  * for TRW Financial Systems.
                      4:  *
                      5:  * TRW Financial Systems, in accordance with their agreement with Carnegie
                      6:  * Mellon University, makes this software available to CMU to distribute
                      7:  * or use in any manner that they see fit as long as this message is kept with 
                      8:  * the software. For this reason TFS also grants any other persons or
                      9:  * organisations permission to use or modify this software.
                     10:  *
                     11:  * TFS supplies this software to be publicly redistributed
                     12:  * on the understanding that TFS is not responsible for the correct
                     13:  * functioning of this software in any circumstances.
                     14:  *
1.1.1.2 ! root       15:  *     scsi_cd.h,v 1.2 1993/05/20 03:46:28 cgd Exp
1.1       root       16:  */
                     17: 
                     18: /*
                     19:  * Ported to run under 386BSD by Julian Elischer ([email protected]) Sept 1992
                     20:  */
                     21: 
                     22: /*
                     23:  * SCSI command format
                     24:  */
                     25: 
                     26: struct scsi_read_capacity_cd
                     27: {
                     28:        u_char  op_code;
                     29:        u_char  :5;
                     30:        u_char  lun:3;
                     31:        u_char  addr_3; /* Most Significant */
                     32:        u_char  addr_2;
                     33:        u_char  addr_1;
                     34:        u_char  addr_0; /* Least Significant */
                     35:        u_char  unused[3];
                     36:        u_char  link:1;
                     37:        u_char  flag:1;
                     38:        u_char  :6;     
                     39: };
                     40: 
                     41: struct scsi_pause
                     42: {
                     43:        u_char  op_code;
                     44:        u_char  :5;
                     45:        u_char  lun:3;
                     46:        u_char  unused[6];
                     47:        u_char  resume:1;
                     48:        u_char  :7;
                     49:        u_char  link:1;
                     50:        u_char  flag:1;
                     51:        u_char  :6;
                     52: };
                     53: #define        PA_PAUSE        1
                     54: #define PA_RESUME      0
                     55: 
                     56: struct scsi_play_msf
                     57: {
                     58:        u_char  op_code;
                     59:        u_char  :5;
                     60:        u_char  lun:3;
                     61:        u_char  unused;
                     62:        u_char  start_m;
                     63:        u_char  start_s;
                     64:        u_char  start_f;
                     65:        u_char  end_m;
                     66:        u_char  end_s;
                     67:        u_char  end_f;
                     68:        u_char  link:1;
                     69:        u_char  flag:1;
                     70:        u_char  :6;
                     71: };
                     72: 
                     73: struct scsi_play_track
                     74: {
                     75:        u_char  op_code;
                     76:        u_char  :5;
                     77:        u_char  lun:3;
                     78:        u_char  unused[2];
                     79:        u_char  start_track;
                     80:        u_char  start_index;
                     81:        u_char  unused1;
                     82:        u_char  end_track;
                     83:        u_char  end_index;
                     84:        u_char  link:1;
                     85:        u_char  flag:1;
                     86:        u_char  :6;
                     87: };
                     88: 
                     89: struct scsi_play
                     90: {
                     91:        u_char  op_code;
                     92:        u_char  reladdr:1;
                     93:        u_char  :4;
                     94:        u_char  lun:3;
                     95:        u_char  blk_addr[4];
                     96:        u_char  unused;
                     97:        u_char  xfer_len[2];
                     98:        u_char  link:1;
                     99:        u_char  flag:1;
                    100:        u_char  :6;
                    101: };
                    102: 
                    103: struct scsi_play_big   
                    104: {
                    105:        u_char  op_code;
                    106:        u_char  reladdr:1;
                    107:        u_char  :4;
                    108:        u_char  lun:3;
                    109:        u_char  blk_addr[4];
                    110:        u_char  xfer_len[4];
                    111:        u_char  unused;
                    112:        u_char  link:1;
                    113:        u_char  flag:1;
                    114:        u_char  :6;
                    115: };
                    116: 
                    117: struct scsi_play_rel_big
                    118: {
                    119:        u_char  op_code;
                    120:        u_char  reladdr:1;
                    121:        u_char  :4;
                    122:        u_char  lun:3;
                    123:        u_char  blk_addr[4];
                    124:        u_char  xfer_len[4];
                    125:        u_char  track;
                    126:        u_char  link:1;
                    127:        u_char  flag:1;
                    128:        u_char  :6;
                    129: };
                    130: 
                    131: struct scsi_read_header
                    132: {
                    133:        u_char  op_code;
                    134:        u_char  :1;
                    135:        u_char  msf:1;
                    136:        u_char  :3;
                    137:        u_char  lun:3;
                    138:        u_char  blk_addr[4];
                    139:        u_char  unused;
                    140:        u_char  data_len[2];
                    141:        u_char  link:1;
                    142:        u_char  flag:1;
                    143:        u_char  :6;
                    144: };
                    145: 
                    146: struct scsi_read_subchannel
                    147: {
                    148:        u_char  op_code;
                    149:        u_char  :1;
                    150:        u_char  msf:1;
                    151:        u_char  :3;
                    152:        u_char  lun:3;
                    153:        u_char  :6;
                    154:        u_char  subQ:1;
                    155:        u_char  :1;
                    156:        u_char  subchan_format;
                    157:        u_char  unused[2];
                    158:        u_char  track;
                    159:        u_char  data_len[2];
                    160:        u_char  link:1;
                    161:        u_char  flag:1;
                    162:        u_char  :6;
                    163: };
                    164: 
                    165: struct scsi_read_toc
                    166: {
                    167:        u_char  op_code;
                    168:        u_char  :1;
                    169:        u_char  msf:1;
                    170:        u_char  :3;
                    171:        u_char  lun:3;
                    172:        u_char  unused[4];
                    173:        u_char  from_track;
                    174:        u_char  data_len[2];
                    175:        u_char  link:1;
                    176:        u_char  flag:1;
                    177:        u_char  :6;
                    178: };
                    179: ;
                    180: 
                    181: struct scsi_read_cd_capacity
                    182: {
                    183:        u_char  op_code;
                    184:        u_char  :5;
                    185:        u_char  lun:3;
                    186:        u_char  addr_3; /* Most Significant */
                    187:        u_char  addr_2;
                    188:        u_char  addr_1;
                    189:        u_char  addr_0; /* Least Significant */
                    190:        u_char  unused[3];
                    191:        u_char  link:1;
                    192:        u_char  flag:1;
                    193:        u_char  :6;     
                    194: };
                    195: 
                    196: /*
                    197:  * Opcodes
                    198:  */
                    199: 
                    200: #define READ_CD_CAPACITY       0x25    /* slightly different from disk */
                    201: #define READ_SUBCHANNEL                0x42    /* cdrom read Subchannel */
                    202: #define READ_TOC               0x43    /* cdrom read TOC */
                    203: #define READ_HEADER            0x44    /* cdrom read header */
                    204: #define PLAY                   0x45    /* cdrom play  'play audio' mode */
                    205: #define PLAY_MSF               0x47    /* cdrom play Min,Sec,Frames mode */
                    206: #define PLAY_TRACK             0x48    /* cdrom play track/index mode */
                    207: #define PLAY_TRACK_REL         0x49    /* cdrom play track/index mode */
                    208: #define PAUSE                  0x4b    /* cdrom pause in 'play audio' mode */
                    209: #define PLAY_BIG               0xa5    /* cdrom pause in 'play audio' mode */
                    210: #define PLAY_TRACK_REL_BIG     0xa9    /* cdrom play track/index mode */
                    211: 
                    212: 
                    213: struct cd_inquiry_data /* in case there is some special info */
                    214: {
                    215:        u_char  device_type:5;
                    216:        u_char  device_qualifier:3;
                    217:        u_char  dev_qual2:7;
                    218:        u_char  removable:1;
                    219:        u_char  ansii_version:3;
                    220:        u_char  :5;
                    221:        u_char  response_format;
                    222:        u_char  additional_length;
                    223:        u_char  unused[2];
                    224:        u_char  :3;
                    225:        u_char  can_link:1;
                    226:        u_char  can_sync:1;
                    227:        u_char  :3;
                    228:        char    vendor[8];
                    229:        char    product[16];
                    230:        char    revision[4];
                    231:        u_char  extra[8];
                    232: };
                    233: 
                    234: struct scsi_read_cd_cap_data
                    235: {
                    236:        u_char  addr_3; /* Most significant */
                    237:        u_char  addr_2;
                    238:        u_char  addr_1;
                    239:        u_char  addr_0; /* Least significant */
                    240:        u_char  length_3;       /* Most significant */
                    241:        u_char  length_2;
                    242:        u_char  length_1;
                    243:        u_char  length_0;       /* Least significant */
                    244: };
                    245: 
                    246: union  cd_pages
                    247: {
                    248: #define        AUDIO_PAGE      0x0e
                    249:        struct  audio_page
                    250:        {
                    251:                u_char  page_code:6;
                    252:                u_char  :1;
                    253:                u_char  ps:1;
                    254:                u_char  param_len;
                    255:                u_char  :1;
                    256:                u_char  sotc:1;
                    257:                u_char  immed:1;
                    258:                u_char  :5;
                    259:                u_char  unused[2];
                    260:                u_char  format_lba:4;
                    261:                u_char  :3;
                    262:                u_char  apr_valid:1;
                    263:                u_char  lb_per_sec[2];
                    264:                struct  port_control
                    265:                {
                    266:                        u_char  channels:4;
                    267: #define        CHANNEL_0 1
                    268: #define        CHANNEL_1 2
                    269: #define        CHANNEL_2 4
                    270: #define        CHANNEL_3 8
                    271: #define        LEFT_CHANNEL    CHANNEL_0
                    272: #define        RIGHT_CHANNEL   CHANNEL_1
                    273:                        u_char  :4;
                    274:                        u_char  volume;
                    275:                } port[4];
                    276: #define        LEFT_PORT       0
                    277: #define        RIGHT_PORT      1
                    278:        }audio;
                    279: };
                    280: 
                    281: struct cd_mode_data
                    282: {
                    283:        struct scsi_mode_header header;
                    284:        struct blk_desc blk_desc;
                    285:        union cd_pages page;
                    286: };
                    287: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.