1996-03-19 06:05:15 +03:00
|
|
|
/* $NetBSD: scsi_cd.h,v 1.6 1996/03/19 03:05:15 mycroft Exp $ */
|
1994-06-29 10:39:25 +04:00
|
|
|
|
1993-03-21 21:04:42 +03:00
|
|
|
/*
|
|
|
|
* Written by Julian Elischer (julian@tfs.com)
|
|
|
|
* for TRW Financial Systems.
|
|
|
|
*
|
|
|
|
* TRW Financial Systems, in accordance with their agreement with Carnegie
|
|
|
|
* Mellon University, makes this software available to CMU to distribute
|
|
|
|
* or use in any manner that they see fit as long as this message is kept with
|
|
|
|
* the software. For this reason TFS also grants any other persons or
|
|
|
|
* organisations permission to use or modify this software.
|
|
|
|
*
|
|
|
|
* TFS supplies this software to be publicly redistributed
|
|
|
|
* on the understanding that TFS is not responsible for the correct
|
|
|
|
* functioning of this software in any circumstances.
|
|
|
|
*
|
1994-03-29 08:29:20 +04:00
|
|
|
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
|
1993-03-21 21:04:42 +03:00
|
|
|
*/
|
1994-03-29 08:29:20 +04:00
|
|
|
#ifndef _SCSI_SCSI_CD_H
|
|
|
|
#define _SCSI_SCSI_CD_H 1
|
1993-03-21 21:04:42 +03:00
|
|
|
|
|
|
|
/*
|
1994-03-29 08:29:20 +04:00
|
|
|
* Define two bits always in the same place in byte 2 (flag byte)
|
1993-03-21 21:04:42 +03:00
|
|
|
*/
|
1994-03-29 08:29:20 +04:00
|
|
|
#define CD_RELADDR 0x01
|
|
|
|
#define CD_MSF 0x02
|
1993-03-21 21:04:42 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* SCSI command format
|
|
|
|
*/
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_read_capacity_cd {
|
|
|
|
u_int8_t opcode;
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t byte2;
|
|
|
|
u_int8_t addr[4];
|
|
|
|
u_int8_t unused[3];
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_pause {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t opcode;
|
|
|
|
u_int8_t byte2;
|
|
|
|
u_int8_t unused[6];
|
|
|
|
u_int8_t resume;
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
#define PA_PAUSE 1
|
|
|
|
#define PA_RESUME 0
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_play_msf {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t opcode;
|
|
|
|
u_int8_t byte2;
|
|
|
|
u_int8_t unused;
|
|
|
|
u_int8_t start_m;
|
|
|
|
u_int8_t start_s;
|
|
|
|
u_int8_t start_f;
|
|
|
|
u_int8_t end_m;
|
|
|
|
u_int8_t end_s;
|
|
|
|
u_int8_t end_f;
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_play_track {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t opcode;
|
|
|
|
u_int8_t byte2;
|
|
|
|
u_int8_t unused[2];
|
|
|
|
u_int8_t start_track;
|
|
|
|
u_int8_t start_index;
|
|
|
|
u_int8_t unused1;
|
|
|
|
u_int8_t end_track;
|
|
|
|
u_int8_t end_index;
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_play {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t opcode;
|
|
|
|
u_int8_t byte2;
|
|
|
|
u_int8_t blk_addr[4];
|
|
|
|
u_int8_t unused;
|
|
|
|
u_int8_t xfer_len[2];
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_play_big {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t opcode;
|
|
|
|
u_int8_t byte2; /* same as above */
|
|
|
|
u_int8_t blk_addr[4];
|
|
|
|
u_int8_t xfer_len[4];
|
|
|
|
u_int8_t unused;
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_play_rel_big {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t opcode;
|
|
|
|
u_int8_t byte2; /* same as above */
|
|
|
|
u_int8_t blk_addr[4];
|
|
|
|
u_int8_t xfer_len[4];
|
|
|
|
u_int8_t track;
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_read_header {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t opcode;
|
|
|
|
u_int8_t byte2;
|
|
|
|
u_int8_t blk_addr[4];
|
|
|
|
u_int8_t unused;
|
|
|
|
u_int8_t data_len[2];
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_read_subchannel {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t opcode;
|
|
|
|
u_int8_t byte2;
|
|
|
|
u_int8_t byte3;
|
1994-03-29 08:29:20 +04:00
|
|
|
#define SRS_SUBQ 0x40
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t subchan_format;
|
|
|
|
u_int8_t unused[2];
|
|
|
|
u_int8_t track;
|
|
|
|
u_int8_t data_len[2];
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_read_toc {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t opcode;
|
|
|
|
u_int8_t byte2;
|
|
|
|
u_int8_t unused[4];
|
|
|
|
u_int8_t from_track;
|
|
|
|
u_int8_t data_len[2];
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
;
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_read_cd_capacity {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t opcode;
|
|
|
|
u_int8_t byte2;
|
|
|
|
u_int8_t addr[4];
|
|
|
|
u_int8_t unused[3];
|
|
|
|
u_int8_t control;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Opcodes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define READ_CD_CAPACITY 0x25 /* slightly different from disk */
|
|
|
|
#define READ_SUBCHANNEL 0x42 /* cdrom read Subchannel */
|
|
|
|
#define READ_TOC 0x43 /* cdrom read TOC */
|
|
|
|
#define READ_HEADER 0x44 /* cdrom read header */
|
|
|
|
#define PLAY 0x45 /* cdrom play 'play audio' mode */
|
|
|
|
#define PLAY_MSF 0x47 /* cdrom play Min,Sec,Frames mode */
|
|
|
|
#define PLAY_TRACK 0x48 /* cdrom play track/index mode */
|
|
|
|
#define PLAY_TRACK_REL 0x49 /* cdrom play track/index mode */
|
|
|
|
#define PAUSE 0x4b /* cdrom pause in 'play audio' mode */
|
|
|
|
#define PLAY_BIG 0xa5 /* cdrom pause in 'play audio' mode */
|
|
|
|
#define PLAY_TRACK_REL_BIG 0xa9 /* cdrom play track/index mode */
|
|
|
|
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_read_cd_cap_data {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t addr[4];
|
|
|
|
u_int8_t length[4];
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
union cd_pages {
|
|
|
|
struct audio_page {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t page_code;
|
1994-03-29 08:29:20 +04:00
|
|
|
#define CD_PAGE_CODE 0x3F
|
|
|
|
#define AUDIO_PAGE 0x0e
|
|
|
|
#define CD_PAGE_PS 0x80
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t param_len;
|
|
|
|
u_int8_t flags;
|
1994-03-29 08:29:20 +04:00
|
|
|
#define CD_PA_SOTC 0x02
|
|
|
|
#define CD_PA_IMMED 0x04
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t unused[2];
|
|
|
|
u_int8_t format_lba;
|
1994-03-29 08:29:20 +04:00
|
|
|
#define CD_PA_FORMAT_LBA 0x0F
|
|
|
|
#define CD_PA_APR_VALID 0x80
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t lb_per_sec[2];
|
1994-12-28 22:42:47 +03:00
|
|
|
struct port_control {
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t channels;
|
1994-03-29 08:29:20 +04:00
|
|
|
#define CHANNEL 0x0F
|
1993-03-21 21:04:42 +03:00
|
|
|
#define CHANNEL_0 1
|
|
|
|
#define CHANNEL_1 2
|
|
|
|
#define CHANNEL_2 4
|
|
|
|
#define CHANNEL_3 8
|
|
|
|
#define LEFT_CHANNEL CHANNEL_0
|
|
|
|
#define RIGHT_CHANNEL CHANNEL_1
|
1996-03-19 06:05:15 +03:00
|
|
|
u_int8_t volume;
|
1993-03-21 21:04:42 +03:00
|
|
|
} port[4];
|
|
|
|
#define LEFT_PORT 0
|
|
|
|
#define RIGHT_PORT 1
|
1994-12-28 22:42:47 +03:00
|
|
|
} audio;
|
1993-03-21 21:04:42 +03:00
|
|
|
};
|
|
|
|
|
1994-12-28 22:42:47 +03:00
|
|
|
struct cd_mode_data {
|
1993-03-21 21:04:42 +03:00
|
|
|
struct scsi_mode_header header;
|
1994-12-28 22:42:47 +03:00
|
|
|
struct scsi_blk_desc blk_desc;
|
1993-03-21 21:04:42 +03:00
|
|
|
union cd_pages page;
|
|
|
|
};
|
1994-03-29 08:29:20 +04:00
|
|
|
#endif /*_SCSI_SCSI_CD_H*/
|
1993-03-21 21:04:42 +03:00
|
|
|
|