scdreg.h revision 143063
17332Sjkh/*- 27332Sjkh * Copyright (c) 1995 Mikael Hybsch 37332Sjkh * All rights reserved. 47332Sjkh * 57332Sjkh * Redistribution and use in source and binary forms, with or without 67332Sjkh * modification, are permitted provided that the following conditions 77332Sjkh * are met: 87332Sjkh * 1. Redistributions of source code must retain the above copyright 97332Sjkh * notice, this list of conditions and the following disclaimer 107332Sjkh * in this position and unchanged. 117332Sjkh * 2. Redistributions in binary form must reproduce the above copyright 127332Sjkh * notice, this list of conditions and the following disclaimer in the 137332Sjkh * documentation and/or other materials provided with the distribution. 147332Sjkh * 3. The name of the author may not be used to endorse or promote products 1513765Smpp * derived from this software without specific prior written permission 167332Sjkh * 177332Sjkh * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 187332Sjkh * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 197332Sjkh * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 207332Sjkh * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 217332Sjkh * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 227332Sjkh * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 237332Sjkh * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 247332Sjkh * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 257332Sjkh * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 267332Sjkh * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 277332Sjkh * 2850477Speter * $FreeBSD: head/sys/dev/scd/scdreg.h 143063 2005-03-02 21:33:29Z joerg $ 297332Sjkh * 307332Sjkh */ 317332Sjkh 327332Sjkh#ifndef SCD_H 337332Sjkh#define SCD_H 347332Sjkh 357332Sjkhtypedef unsigned char bcd_t; 367332Sjkh#define M_msf(msf) msf[0] 377332Sjkh#define S_msf(msf) msf[1] 387332Sjkh#define F_msf(msf) msf[2] 397332Sjkh 407332Sjkh#define OREG_COMMAND 0 417332Sjkh#define OREG_WPARAMS 1 427332Sjkh#define OREG_CONTROL 3 437332Sjkh#define CBIT_ATTENTION_CLEAR 0x01 447332Sjkh#define CBIT_RESULT_READY_CLEAR 0x02 457332Sjkh#define CBIT_DATA_READY_CLEAR 0x04 467332Sjkh#define CBIT_RPARAM_CLEAR 0x40 477332Sjkh#define CBIT_RESET_DRIVE 0x80 487332Sjkh 497332Sjkh#define IREG_STATUS 0 507332Sjkh#define SBIT_ATTENTION 0x01 517332Sjkh#define SBIT_RESULT_READY 0x02 527332Sjkh#define SBIT_DATA_READY 0x04 537332Sjkh#define SBIT_BUSY 0x80 547332Sjkh 557332Sjkh#define IREG_RESULT 1 567332Sjkh#define IREG_DATA 2 577332Sjkh#define IREG_FSTATUS 3 587332Sjkh#define FBIT_WPARAM_READY 0x01 597332Sjkh 607332Sjkh#define CMD_GET_DRIVE_CONFIG 0x00 617332Sjkh#define CMD_SET_DRIVE_PARAM 0x10 627332Sjkh#define CMD_GET_SUBCHANNEL_DATA 0x21 637332Sjkh#define CMD_GET_TOC 0x24 647332Sjkh#define CMD_READ_TOC 0x30 657332Sjkh#define CMD_READ 0x34 667332Sjkh#define CMD_PLAY_AUDIO 0x40 677332Sjkh#define CMD_STOP_AUDIO 0x41 687332Sjkh#define CMD_EJECT 0x50 697332Sjkh#define CMD_SPIN_UP 0x51 707332Sjkh#define CMD_SPIN_DOWN 0x52 717332Sjkh 727332Sjkh#define ERR_CD_NOT_LOADED 0x20 737332Sjkh#define ERR_NO_CD_INSIDE 0x21 747332Sjkh#define ERR_NOT_SPINNING 0x22 757332Sjkh#define ERR_FATAL_READ_ERROR1 0x53 767332Sjkh#define ERR_FATAL_READ_ERROR2 0x57 777332Sjkh 787332Sjkh#define ATTEN_DRIVE_LOADED 0x80 797332Sjkh#define ATTEN_EJECT_PUSHED 0x81 807332Sjkh#define ATTEN_AUDIO_DONE 0x90 817332Sjkh#define ATTEN_SPIN_UP_DONE 0x24 827332Sjkh#define ATTEN_SPIN_DOWN 0x27 837332Sjkh#define ATTEN_EJECT_DONE 0x28 847332Sjkh 857332Sjkh 867332Sjkhstruct sony_drive_configuration { 877332Sjkh char vendor[8]; 887332Sjkh char product[16]; 897332Sjkh char revision[8]; 907332Sjkh u_short config; 91143063Sjoerg} __packed; 927332Sjkh 937332Sjkh/* Almost same as cd_sub_channel_position_data */ 947332Sjkhstruct sony_subchannel_position_data { 957332Sjkh u_char control:4; 967332Sjkh u_char addr_type:4; 977332Sjkh u_char track_number; 987332Sjkh u_char index_number; 997332Sjkh u_char rel_msf[3]; 1007332Sjkh u_char dummy; 1017332Sjkh u_char abs_msf[3]; 102143063Sjoerg} __packed; 1037332Sjkh 1047332Sjkhstruct sony_tracklist { 1057332Sjkh u_char adr :4; /* xcdplayer needs these two values */ 1067332Sjkh u_char ctl :4; 1077332Sjkh u_char track; 1087332Sjkh u_char start_msf[3]; 109143063Sjoerg} __packed; 1107332Sjkh 1117332Sjkh#define MAX_TRACKS 100 1127332Sjkh 1137332Sjkhstruct sony_toc { 1147332Sjkh u_char session_number; 1157332Sjkh 1167332Sjkh u_char :8; 1177332Sjkh u_char :8; 1187332Sjkh u_char first_track; 1197332Sjkh u_char :8; 1207332Sjkh u_char :8; 1217332Sjkh 1227332Sjkh u_char :8; 1237332Sjkh u_char :8; 1247332Sjkh u_char last_track; 1257332Sjkh u_char :8; 1267332Sjkh u_char :8; 1277332Sjkh 1287332Sjkh u_char :8; 1297332Sjkh u_char :8; 1307332Sjkh u_char lead_out_start_msf[3]; 1317332Sjkh 1327332Sjkh struct sony_tracklist tracks[MAX_TRACKS]; 1337332Sjkh 1347332Sjkh /* The rest is just to take space in case all data is returned */ 1357332Sjkh 1367332Sjkh u_char dummy[6*9]; 137143063Sjoerg} __packed; 1387332Sjkh 1397332Sjkh#endif /* SCD_H */ 140