1 /* $Id: aztcd.h,v 0.80 1995/01/21 19:55:04 root Exp $ 2 * Definitions for a AztechCD268 CD-ROM interface 3 * Copyright (C) 1994, 1995 Werner Zimmermann 4 * 5 * based on Mitsumi CDROM driver by Martin Harriss 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * 21 * History: W.Zimmermann adaption to Aztech CD268-01A Version 1.3 22 * October 1994 Email: zimmerma@rz.fht-esslingen.de 23 */ 24 25 /* *** change this to set the I/O port address */ 26 #define AZT_BASE_ADDR 0x320 27 28 /* use incompatible ioctls for reading in raw and cooked mode */ 29 #define AZT_PRIVATE_IOCTLS 30 31 /* Increase this if you get lots of timeouts; if you get kernel panic, replace 32 STEN_LOW_WAIT by STEN_LOW in the source code */ 33 #define AZT_STATUS_DELAY 400 /*for timer wait, STEN_LOW_WAIT*/ 34 #define AZT_TIMEOUT 8000000 /*for busy wait STEN_LOW, DTEN_LOW*/ 35 #define AZT_FAST_TIMEOUT 10000 /*for reading the version string*/ 36 37 /* number of times to retry a command before giving up */ 38 #define AZT_RETRY_ATTEMPTS 3 39 40 /* port access macros */ 41 #define CMD_PORT azt_port 42 #define DATA_PORT azt_port 43 #define STATUS_PORT azt_port+1 44 #define MODE_PORT azt_port+2 45 46 /* status bits */ 47 #define AST_CMD_CHECK 0x80 /* command error */ 48 #define AST_DSK_CHG 0x20 /* disk removed or changed */ 49 #define AST_NOT_READY 0x02 /* no disk in the drive */ 50 #define AST_DOOR_OPEN 0x40 /* door is open */ 51 #define AST_MODE_BITS 0x1C /* Mode Bits */ 52 #define AST_INITIAL 0x0C /* initial, only valid ... */ 53 #define AST_BUSY 0x04 /* now playing, only valid 54 in combination with mode 55 bits */ 56 /* flag bits */ 57 #define AFL_DATA 0x02 /* data available if low */ 58 #define AFL_STATUS 0x04 /* status available if low */ 59 #define AFL_OP_OK 0x01 /* OP_OK command correct*/ 60 #define AFL_PA_OK 0x02 /* PA_OK parameter correct*/ 61 #define AFL_OP_ERR 0x05 /* error in command*/ 62 #define AFL_PA_ERR 0x06 /* error in parameters*/ 63 #define POLLED 0x04 /* polled mode */ 64 65 /* commands */ 66 #define ACMD_SOFT_RESET 0x10 /* reset drive */ 67 #define ACMD_PLAY_READ 0x20 /* read data track in cooked mode */ 68 #define ACMD_DATA_READ_RAW 0x21 /* reading in raw mode*/ 69 #define ACMD_SEEK_TO_LEADIN 0x31 /* seek to leadin track*/ 70 #define ACMD_GET_ERROR 0x40 /* get error code */ 71 #define ACMD_GET_STATUS 0x41 /* get status */ 72 #define ACMD_GET_Q_CHANNEL 0x50 /* read info from q channel */ 73 #define ACMD_EJECT 0x60 /* eject/open */ 74 #define ACMD_PAUSE 0x80 /* pause */ 75 #define ACMD_STOP 0x81 /* stop play */ 76 #define ACMD_PLAY_AUDIO 0x90 /* play audio track */ 77 #define ACMD_GET_VERSION 0xA0 /* get firmware version */ 78 #define ACMD_SET_MODE 0xA1 /* set drive mode */ 79 #define ACMD_SET_VOLUME 0xAE /* set audio level */ 80 81 #define SET_TIMER(func, jifs) \ 82 delay_timer.expires = jifs; \ 83 delay_timer.function = (void *) func; \ 84 add_timer(&delay_timer); 85 86 #define CLEAR_TIMER del_timer(&delay_timer) 87 88 #define MAX_TRACKS 104 89 90 struct msf { 91 unsigned char min; 92 unsigned char sec; 93 unsigned char frame; 94 }; 95 96 struct azt_Play_msf { 97 struct msf start; 98 struct msf end; 99 }; 100 101 struct azt_DiskInfo { 102 unsigned char first; 103 unsigned char last; 104 struct msf diskLength; 105 struct msf firstTrack; 106 }; 107 108 struct azt_Toc { 109 unsigned char ctrl_addr; 110 unsigned char track; 111 unsigned char pointIndex; 112 struct msf trackTime; 113 struct msf diskTime; 114 };