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

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

unix.superglobalmegacorp.com

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