diff options
-rw-r--r-- | drivers/Kconfig | 2 | ||||
-rw-r--r-- | drivers/cdrom/Kconfig | 213 | ||||
-rw-r--r-- | drivers/cdrom/Makefile | 10 | ||||
-rw-r--r-- | drivers/cdrom/aztcd.c | 2492 | ||||
-rw-r--r-- | drivers/cdrom/aztcd.h | 162 | ||||
-rw-r--r-- | drivers/cdrom/cdu31a.c | 3251 | ||||
-rw-r--r-- | drivers/cdrom/cdu31a.h | 411 | ||||
-rw-r--r-- | drivers/cdrom/cm206.c | 1594 | ||||
-rw-r--r-- | drivers/cdrom/cm206.h | 171 | ||||
-rw-r--r-- | drivers/cdrom/gscd.c | 1029 | ||||
-rw-r--r-- | drivers/cdrom/gscd.h | 108 | ||||
-rw-r--r-- | drivers/cdrom/isp16.c | 374 | ||||
-rw-r--r-- | drivers/cdrom/isp16.h | 72 | ||||
-rw-r--r-- | drivers/cdrom/mcdx.c | 1943 | ||||
-rw-r--r-- | drivers/cdrom/mcdx.h | 185 | ||||
-rw-r--r-- | drivers/cdrom/optcd.c | 2105 | ||||
-rw-r--r-- | drivers/cdrom/optcd.h | 52 | ||||
-rw-r--r-- | drivers/cdrom/sbpcd.c | 5966 | ||||
-rw-r--r-- | drivers/cdrom/sbpcd.h | 839 | ||||
-rw-r--r-- | drivers/cdrom/sjcd.c | 1815 | ||||
-rw-r--r-- | drivers/cdrom/sjcd.h | 181 | ||||
-rw-r--r-- | drivers/cdrom/sonycd535.c | 1689 | ||||
-rw-r--r-- | drivers/cdrom/sonycd535.h | 183 |
23 files changed, 0 insertions, 24847 deletions
diff --git a/drivers/Kconfig b/drivers/Kconfig index 050323fd79e..4e6487d461f 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -24,8 +24,6 @@ source "drivers/scsi/Kconfig" source "drivers/ata/Kconfig" -source "drivers/cdrom/Kconfig" - source "drivers/md/Kconfig" source "drivers/message/fusion/Kconfig" diff --git a/drivers/cdrom/Kconfig b/drivers/cdrom/Kconfig deleted file mode 100644 index 4b12e9031fb..00000000000 --- a/drivers/cdrom/Kconfig +++ /dev/null @@ -1,213 +0,0 @@ -# -# CDROM driver configuration -# - -menu "Old CD-ROM drivers (not SCSI, not IDE)" - depends on ISA && BLOCK - -config CD_NO_IDESCSI - bool "Support non-SCSI/IDE/ATAPI CDROM drives" - ---help--- - If you have a CD-ROM drive that is neither SCSI nor IDE/ATAPI, say Y - here, otherwise N. Read the CD-ROM-HOWTO, available from - <http://www.tldp.org/docs.html#howto>. - - Note that the answer to this question doesn't directly affect the - kernel: saying N will just cause the configurator to skip all - the questions about these CD-ROM drives. If you are unsure what you - have, say Y and find out whether you have one of the following - drives. - - For each of these drivers, a <file:Documentation/cdrom/{driver_name}> - exists. Especially in cases where you do not know exactly which kind - of drive you have you should read there. Most of these drivers use a - file drivers/cdrom/{driver_name}.h where you can define your - interface parameters and switch some internal goodies. - - To compile these CD-ROM drivers as a module, choose M instead of Y. - - If you want to use any of these CD-ROM drivers, you also have to - answer Y or M to "ISO 9660 CD-ROM file system support" below (this - answer will get "defaulted" for you if you enable any of the Linux - CD-ROM drivers). - -config AZTCD - tristate "Aztech/Orchid/Okano/Wearnes/TXC/CyDROM CDROM support" - depends on CD_NO_IDESCSI - ---help--- - This is your driver if you have an Aztech CDA268-01A, Orchid - CD-3110, Okano or Wearnes CDD110, Conrad TXC, or CyCD-ROM CR520 or - CR540 CD-ROM drive. This driver -- just like all these CD-ROM - drivers -- is NOT for CD-ROM drives with IDE/ATAPI interfaces, such - as Aztech CDA269-031SE. Please read the file - <file:Documentation/cdrom/aztcd>. - - If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM - file system support" below, because that's the file system used on - CD-ROMs. - - To compile this driver as a module, choose M here: the - module will be called aztcd. - -config GSCD - tristate "Goldstar R420 CDROM support" - depends on CD_NO_IDESCSI - ---help--- - If this is your CD-ROM drive, say Y here. As described in the file - <file:Documentation/cdrom/gscd>, you might have to change a setting - in the file <file:drivers/cdrom/gscd.h> before compiling the - kernel. Please read the file <file:Documentation/cdrom/gscd>. - - If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM - file system support" below, because that's the file system used on - CD-ROMs. - - To compile this driver as a module, choose M here: the - module will be called gscd. - -config SBPCD - tristate "Matsushita/Panasonic/Creative, Longshine, TEAC CDROM support" - depends on CD_NO_IDESCSI && BROKEN_ON_SMP - ---help--- - This driver supports most of the drives which use the Panasonic or - Sound Blaster interface. Please read the file - <file:Documentation/cdrom/sbpcd>. - - The Matsushita CR-521, CR-522, CR-523, CR-562, CR-563 drives - (sometimes labeled "Creative"), the Creative Labs CD200, the - Longshine LCS-7260, the "IBM External ISA CD-ROM" (in fact a CR-56x - model), the TEAC CD-55A fall under this category. Some other - "electrically compatible" drives (Vertos, Genoa, some Funai models) - are currently not supported; for the Sanyo H94A drive currently a - separate driver (asked later) is responsible. Most drives have a - uniquely shaped faceplate, with a caddyless motorized drawer, but - without external brand markings. The older CR-52x drives have a - caddy and manual loading/eject, but still no external markings. The - driver is able to do an extended auto-probing for interface - addresses and drive types; this can help to find facts in cases you - are not sure, but can consume some time during the boot process if - none of the supported drives gets found. Once your drive got found, - you should enter the reported parameters into - <file:drivers/cdrom/sbpcd.h> and set "DISTRIBUTION 0" there. - - This driver can support up to four CD-ROM controller cards, and each - card can support up to four CD-ROM drives; if you say Y here, you - will be asked how many controller cards you have. If compiled as a - module, only one controller card (but with up to four drives) is - usable. - - If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM - file system support" below, because that's the file system used on - CD-ROMs. - - To compile this driver as a module, choose M here: the - module will be called sbpcd. - -config MCDX - tristate "Mitsumi CDROM support" - depends on CD_NO_IDESCSI - ---help--- - Use this driver if you want to be able to use your Mitsumi LU-005, - FX-001 or FX-001D CD-ROM drive. - - Please read the file <file:Documentation/cdrom/mcdx>. - - If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM - file system support" below, because that's the file system used on - CD-ROMs. - - To compile this driver as a module, choose M here: the - module will be called mcdx. - -config OPTCD - tristate "Optics Storage DOLPHIN 8000AT CDROM support" - depends on CD_NO_IDESCSI - ---help--- - This is the driver for the 'DOLPHIN' drive with a 34-pin Sony - compatible interface. It also works with the Lasermate CR328A. If - you have one of those, say Y. This driver does not work for the - Optics Storage 8001 drive; use the IDE-ATAPI CD-ROM driver for that - one. Please read the file <file:Documentation/cdrom/optcd>. - - If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM - file system support" below, because that's the file system used on - CD-ROMs. - - To compile this driver as a module, choose M here: the - module will be called optcd. - -config CM206 - tristate "Philips/LMS CM206 CDROM support" - depends on CD_NO_IDESCSI && BROKEN_ON_SMP - ---help--- - If you have a Philips/LMS CD-ROM drive cm206 in combination with a - cm260 host adapter card, say Y here. Please also read the file - <file:Documentation/cdrom/cm206>. - - If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM - file system support" below, because that's the file system used on - CD-ROMs. - - To compile this driver as a module, choose M here: the - module will be called cm206. - -config SJCD - tristate "Sanyo CDR-H94A CDROM support" - depends on CD_NO_IDESCSI - help - If this is your CD-ROM drive, say Y here and read the file - <file:Documentation/cdrom/sjcd>. You should then also say Y or M to - "ISO 9660 CD-ROM file system support" below, because that's the - file system used on CD-ROMs. - - To compile this driver as a module, choose M here: the - module will be called sjcd. - -config ISP16_CDI - tristate "ISP16/MAD16/Mozart soft configurable cdrom interface support" - depends on CD_NO_IDESCSI - ---help--- - These are sound cards with built-in cdrom interfaces using the OPTi - 82C928 or 82C929 chips. Say Y here to have them detected and - possibly configured at boot time. In addition, You'll have to say Y - to a driver for the particular cdrom drive you have attached to the - card. Read <file:Documentation/cdrom/isp16> for details. - - To compile this driver as a module, choose M here: the - module will be called isp16. - -config CDU31A - tristate "Sony CDU31A/CDU33A CDROM support" - depends on CD_NO_IDESCSI && BROKEN_ON_SMP - ---help--- - These CD-ROM drives have a spring-pop-out caddyless drawer, and a - rectangular green LED centered beneath it. NOTE: these CD-ROM - drives will not be auto detected by the kernel at boot time; you - have to provide the interface address as an option to the kernel at - boot time as described in <file:Documentation/cdrom/cdu31a> or fill - in your parameters into <file:drivers/cdrom/cdu31a.c>. Try "man - bootparam" or see the documentation of your boot loader (lilo or - loadlin) about how to pass options to the kernel. - - If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM - file system support" below, because that's the file system used on - CD-ROMs. - - To compile this driver as a module, choose M here: the - module will be called cdu31a. - -config CDU535 - tristate "Sony CDU535 CDROM support" - depends on CD_NO_IDESCSI - ---help--- - This is the driver for the older Sony CDU-535 and CDU-531 CD-ROM - drives. Please read the file <file:Documentation/cdrom/sonycd535>. - - If you say Y here, you should also say Y or M to "ISO 9660 CD-ROM - file system support" below, because that's the file system used on - CD-ROMs. - - To compile this driver as a module, choose M here: the - module will be called sonycd535. - -endmenu diff --git a/drivers/cdrom/Makefile b/drivers/cdrom/Makefile index d1d1e5a4be7..774c180a4e1 100644 --- a/drivers/cdrom/Makefile +++ b/drivers/cdrom/Makefile @@ -10,14 +10,4 @@ obj-$(CONFIG_BLK_DEV_SR) += cdrom.o obj-$(CONFIG_PARIDE_PCD) += cdrom.o obj-$(CONFIG_CDROM_PKTCDVD) += cdrom.o -obj-$(CONFIG_AZTCD) += aztcd.o -obj-$(CONFIG_CDU31A) += cdu31a.o cdrom.o -obj-$(CONFIG_CM206) += cm206.o cdrom.o -obj-$(CONFIG_GSCD) += gscd.o -obj-$(CONFIG_ISP16_CDI) += isp16.o -obj-$(CONFIG_MCDX) += mcdx.o cdrom.o -obj-$(CONFIG_OPTCD) += optcd.o -obj-$(CONFIG_SBPCD) += sbpcd.o cdrom.o -obj-$(CONFIG_SJCD) += sjcd.o -obj-$(CONFIG_CDU535) += sonycd535.o obj-$(CONFIG_VIOCD) += viocd.o cdrom.o diff --git a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c deleted file mode 100644 index d7fbfaae244..00000000000 --- a/drivers/cdrom/aztcd.c +++ /dev/null @@ -1,2492 +0,0 @@ -#define AZT_VERSION "2.60" - -/* $Id: aztcd.c,v 2.60 1997/11/29 09:51:19 root Exp root $ - linux/drivers/block/aztcd.c - Aztech CD268 CDROM driver - - Copyright (C) 1994-98 Werner Zimmermann(Werner.Zimmermann@fht-esslingen.de) - - based on Mitsumi CDROM driver by Martin Hariss and preworks by - Eberhard Moenkeberg; contains contributions by Joe Nardone and Robby - Schirmer. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - HISTORY - V0.0 Adaption to Aztech CD268-01A Version 1.3 - Version is PRE_ALPHA, unresolved points: - 1. I use busy wait instead of timer wait in STEN_LOW,DTEN_LOW - thus driver causes CPU overhead and is very slow - 2. could not find a way to stop the drive, when it is - in data read mode, therefore I had to set - msf.end.min/sec/frame to 0:0:1 (in azt_poll); so only one - frame can be read in sequence, this is also the reason for - 3. getting 'timeout in state 4' messages, but nevertheless - it works - W.Zimmermann, Oct. 31, 1994 - V0.1 Version is ALPHA, problems #2 and #3 resolved. - W.Zimmermann, Nov. 3, 1994 - V0.2 Modification to some comments, debugging aids for partial test - with Borland C under DOS eliminated. Timer interrupt wait - STEN_LOW_WAIT additionally to busy wait for STEN_LOW implemented; - use it only for the 'slow' commands (ACMD_GET_Q_CHANNEL, ACMD_ - SEEK_TO_LEAD_IN), all other commands are so 'fast', that busy - waiting seems better to me than interrupt rescheduling. - Besides that, when used in the wrong place, STEN_LOW_WAIT causes - kernel panic. - In function aztPlay command ACMD_PLAY_AUDIO added, should make - audio functions work. The Aztech drive needs different commands - to read data tracks and play audio tracks. - W.Zimmermann, Nov. 8, 1994 - V0.3 Recognition of missing drive during boot up improved (speeded up). - W.Zimmermann, Nov. 13, 1994 - V0.35 Rewrote the control mechanism in azt_poll (formerly mcd_poll) - including removal of all 'goto' commands. :-); - J. Nardone, Nov. 14, 1994 - V0.4 Renamed variables and constants to 'azt' instead of 'mcd'; had - to make some "compatibility" defines in azt.h; please note, - that the source file was renamed to azt.c, the include file to - azt.h - Speeded up drive recognition during init (will be a little bit - slower than before if no drive is installed!); suggested by - Robby Schirmer. - read_count declared volatile and set to AZT_BUF_SIZ to make - drive faster (now 300kB/sec, was 60kB/sec before, measured - by 'time dd if=/dev/cdrom of=/dev/null bs=2048 count=4096'; - different AZT_BUF_SIZes were test, above 16 no further im- - provement seems to be possible; suggested by E.Moenkeberg. - W.Zimmermann, Nov. 18, 1994 - V0.42 Included getAztStatus command in GetQChannelInfo() to allow - reading Q-channel info on audio disks, if drive is stopped, - and some other bug fixes in the audio stuff, suggested by - Robby Schirmer. - Added more ioctls (reading data in mode 1 and mode 2). - Completely removed the old azt_poll() routine. - Detection of ORCHID CDS-3110 in aztcd_init implemented. - Additional debugging aids (see the readme file). - W.Zimmermann, Dec. 9, 1994 - V0.50 Autodetection of drives implemented. - W.Zimmermann, Dec. 12, 1994 - V0.52 Prepared for including in the standard kernel, renamed most - variables to contain 'azt', included autoconf.h - W.Zimmermann, Dec. 16, 1994 - V0.6 Version for being included in the standard Linux kernel. - Renamed source and header file to aztcd.c and aztcd.h - W.Zimmermann, Dec. 24, 1994 - V0.7 Changed VERIFY_READ to VERIFY_WRITE in aztcd_ioctl, case - CDROMREADMODE1 and CDROMREADMODE2; bug fix in the ioctl, - which causes kernel crashes when playing audio, changed - include-files (config.h instead of autoconf.h, removed - delay.h) - W.Zimmermann, Jan. 8, 1995 - V0.72 Some more modifications for adaption to the standard kernel. - W.Zimmermann, Jan. 16, 1995 - V0.80 aztcd is now part of the standard kernel since version 1.1.83. - Modified the SET_TIMER and CLEAR_TIMER macros to comply with - the new timer scheme. - W.Zimmermann, Jan. 21, 1995 - V0.90 Included CDROMVOLCTRL, but with my Aztech drive I can only turn - the channels on and off. If it works better with your drive, - please mail me. Also implemented ACMD_CLOSE for CDROMSTART. - W.Zimmermann, Jan. 24, 1995 - V1.00 Implemented close and lock tray commands. Patches supplied by - Frank Racis - Added support for loadable MODULEs, so aztcd can now also be - loaded by insmod and removed by rmmod during run time - Werner Zimmermann, Mar. 24, 95 - V1.10 Implemented soundcard configuration for Orchid CDS-3110 drives - connected to Soundwave32 cards. Release for LST 2.1. - (still experimental) - Werner Zimmermann, May 8, 95 - V1.20 Implemented limited support for DOSEMU0.60's cdrom.c. Now it works, but - sometimes DOSEMU may hang for 30 seconds or so. A fully functional ver- - sion needs an update of Dosemu0.60's cdrom.c, which will come with the - next revision of Dosemu. - Also Soundwave32 support now works. - Werner Zimmermann, May 22, 95 - V1.30 Auto-eject feature. Inspired by Franc Racis (racis@psu.edu) - Werner Zimmermann, July 4, 95 - V1.40 Started multisession support. Implementation copied from mcdx.c - by Heiko Schlittermann. Not tested yet. - Werner Zimmermann, July 15, 95 - V1.50 Implementation of ioctl CDROMRESET, continued multisession, began - XA, but still untested. Heavy modifications to drive status de- - tection. - Werner Zimmermann, July 25, 95 - V1.60 XA support now should work. Speeded up drive recognition in cases, - where no drive is installed. - Werner Zimmermann, August 8, 1995 - V1.70 Multisession support now is completed, but there is still not - enough testing done. If you can test it, please contact me. For - details please read Documentation/cdrom/aztcd - Werner Zimmermann, August 19, 1995 - V1.80 Modification to suit the new kernel boot procedure introduced - with kernel 1.3.33. Will definitely not work with older kernels. - Programming done by Linus himself. - Werner Zimmermann, October 11, 1995 - V1.90 Support for Conrad TXC drives, thank's to Jochen Kunz and Olaf Kaluza. - Werner Zimmermann, October 21, 1995 - V2.00 Changed #include "blk.h" to <linux/blk.h> as the directory - structure was changed. README.aztcd is now /usr/src/docu- - mentation/cdrom/aztcd - Werner Zimmermann, November 10, 95 - V2.10 Started to modify azt_poll to prevent reading beyond end of - tracks. - Werner Zimmermann, December 3, 95 - V2.20 Changed some comments - Werner Zimmermann, April 1, 96 - V2.30 Implemented support for CyCDROM CR520, CR940, Code for CR520 - delivered by H.Berger with preworks by E.Moenkeberg. - Werner Zimmermann, April 29, 96 - V2.40 Reorganized the placement of functions in the source code file - to reflect the layered approach; did not actually change code - Werner Zimmermann, May 1, 96 - V2.50 Heiko Eissfeldt suggested to remove some VERIFY_READs in - aztcd_ioctl; check_aztcd_media_change modified - Werner Zimmermann, May 16, 96 - V2.60 Implemented Auto-Probing; made changes for kernel's 2.1.xx blocksize - Adaption to linux kernel > 2.1.0 - Werner Zimmermann, Nov 29, 97 - - November 1999 -- Make kernel-parameter implementation work with 2.3.x - Removed init_module & cleanup_module in favor of - module_init & module_exit. - Torben Mathiasen <tmm@image.dk> -*/ - -#include <linux/blkdev.h> -#include "aztcd.h" - -#include <linux/module.h> -#include <linux/errno.h> -#include <linux/mm.h> -#include <linux/timer.h> -#include <linux/fs.h> -#include <linux/kernel.h> -#include <linux/cdrom.h> -#include <linux/ioport.h> -#include <linux/string.h> -#include <linux/major.h> - -#include <linux/init.h> - -#include <asm/system.h> -#include <asm/io.h> - -#include <asm/uaccess.h> - -/*########################################################################### - Defines - ########################################################################### -*/ - -#define MAJOR_NR AZTECH_CDROM_MAJOR -#define QUEUE (azt_queue) -#define CURRENT elv_next_request(azt_queue) -#define SET_TIMER(func, jifs) delay_timer.expires = jiffies + (jifs); \ - delay_timer.function = (void *) (func); \ - add_timer(&delay_timer); - -#define CLEAR_TIMER del_timer(&delay_timer); - -#define RETURNM(message,value) {printk("aztcd: Warning: %s failed\n",message);\ - return value;} -#define RETURN(message) {printk("aztcd: Warning: %s failed\n",message);\ - return;} - -/* Macros to switch the IDE-interface to the slave device and back to the master*/ -#define SWITCH_IDE_SLAVE outb_p(0xa0,azt_port+6); \ - outb_p(0x10,azt_port+6); \ - outb_p(0x00,azt_port+7); \ - outb_p(0x10,azt_port+6); -#define SWITCH_IDE_MASTER outb_p(0xa0,azt_port+6); - - -#if 0 -#define AZT_TEST -#define AZT_TEST1 /* <int-..> */ -#define AZT_TEST2 /* do_aztcd_request */ -#define AZT_TEST3 /* AZT_S_state */ -#define AZT_TEST4 /* QUICK_LOOP-counter */ -#define AZT_TEST5 /* port(1) state */ -#define AZT_DEBUG -#define AZT_DEBUG_MULTISESSION -#endif - -static struct request_queue *azt_queue; - -static int current_valid(void) -{ - return CURRENT && - rq_data_dir(CURRENT) == READ && - CURRENT->sector != -1; -} - -#define AFL_STATUSorDATA (AFL_STATUS | AFL_DATA) -#define AZT_BUF_SIZ 16 - -#define READ_TIMEOUT 3000 - -#define azt_port aztcd /*needed for the modutils */ - -/*########################################################################## - Type Definitions - ########################################################################## -*/ -enum azt_state_e { AZT_S_IDLE, /* 0 */ - AZT_S_START, /* 1 */ - AZT_S_MODE, /* 2 */ - AZT_S_READ, /* 3 */ - AZT_S_DATA, /* 4 */ - AZT_S_STOP, /* 5 */ - AZT_S_STOPPING /* 6 */ -}; -enum azt_read_modes { AZT_MODE_0, /*read mode for audio disks, not supported by Aztech firmware */ - AZT_MODE_1, /*read mode for normal CD-ROMs */ - AZT_MODE_2 /*read mode for XA CD-ROMs */ -}; - -/*########################################################################## - Global Variables - ########################################################################## -*/ -static int aztPresent = 0; - -static volatile int azt_transfer_is_active = 0; - -static char azt_buf[CD_FRAMESIZE_RAW * AZT_BUF_SIZ]; /*buffer for block size conversion */ -#if AZT_PRIVATE_IOCTLS -static char buf[CD_FRAMESIZE_RAW]; /*separate buffer for the ioctls */ -#endif - -static volatile int azt_buf_bn[AZT_BUF_SIZ], azt_next_bn; -static volatile int azt_buf_in, azt_buf_out = -1; -static volatile int azt_error = 0; -static int azt_open_count = 0; -static volatile enum azt_state_e azt_state = AZT_S_IDLE; -#ifdef AZT_TEST3 -static volatile enum azt_state_e azt_state_old = AZT_S_STOP; -static volatile int azt_st_old = 0; -#endif -static volatile enum azt_read_modes azt_read_mode = AZT_MODE_1; - -static int azt_mode = -1; -static volatile int azt_read_count = 1; - -static int azt_port = AZT_BASE_ADDR; - -module_param(azt_port, int, 0); - -static int azt_port_auto[16] = AZT_BASE_AUTO; - -static char azt_cont = 0; -static char azt_init_end = 0; -static char azt_auto_eject = AZT_AUTO_EJECT; - -static int AztTimeout, AztTries; -static DECLARE_WAIT_QUEUE_HEAD(azt_waitq); -static DEFINE_TIMER(delay_timer, NULL, 0, 0); - -static struct azt_DiskInfo DiskInfo; -static struct azt_Toc Toc[MAX_TRACKS]; -static struct azt_Play_msf azt_Play; - -static int aztAudioStatus = CDROM_AUDIO_NO_STATUS; -static char aztDiskChanged = 1; -static char aztTocUpToDate = 0; - -static unsigned char aztIndatum; -static unsigned long aztTimeOutCount; -static int aztCmd = 0; - -static DEFINE_SPINLOCK(aztSpin); - -/*########################################################################### - Function Prototypes - ########################################################################### -*/ -/* CDROM Drive Low Level I/O Functions */ -static void aztStatTimer(void); - -/* CDROM Drive Command Functions */ -static int aztGetDiskInfo(void); -#if AZT_MULTISESSION -static int aztGetMultiDiskInfo(void); -#endif -static int aztGetToc(int multi); - -/* Kernel Interface Functions */ -static int check_aztcd_media_change(struct gendisk *disk); -static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, - unsigned long arg); -static int aztcd_open(struct inode *ip, struct file *fp); -static int aztcd_release(struct inode *inode, struct file *file); - -static struct block_device_operations azt_fops = { - .owner = THIS_MODULE, - .open = aztcd_open, - .release = aztcd_release, - .ioctl = aztcd_ioctl, - .media_changed = check_aztcd_media_change, -}; - -/* Aztcd State Machine: Controls Drive Operating State */ -static void azt_poll(void); - -/* Miscellaneous support functions */ -static void azt_hsg2msf(long hsg, struct msf *msf); -static long azt_msf2hsg(struct msf *mp); -static void azt_bin2bcd(unsigned char *p); -static int azt_bcd2bin(unsigned char bcd); - -/*########################################################################## - CDROM Drive Low Level I/O Functions - ########################################################################## -*/ -/* Macros for the drive hardware interface handshake, these macros use - busy waiting */ -/* Wait for OP_OK = drive answers with AFL_OP_OK after receiving a command*/ -# define OP_OK op_ok() -static void op_ok(void) -{ - aztTimeOutCount = 0; - do { - aztIndatum = inb(DATA_PORT); - aztTimeOutCount++; - if (aztTimeOutCount >= AZT_TIMEOUT) { - printk("aztcd: Error Wait OP_OK\n"); - break; - } - } while (aztIndatum != AFL_OP_OK); -} - -/* Wait for PA_OK = drive answers with AFL_PA_OK after receiving parameters*/ -#if 0 -# define PA_OK pa_ok() -static void pa_ok(void) -{ - aztTimeOutCount = 0; - do { - aztIndatum = inb(DATA_PORT); - aztTimeOutCount++; - if (aztTimeOutCount >= AZT_TIMEOUT) { - printk("aztcd: Error Wait PA_OK\n"); - break; - } - } while (aztIndatum != AFL_PA_OK); -} -#endif - -/* Wait for STEN=Low = handshake signal 'AFL_.._OK available or command executed*/ -# define STEN_LOW sten_low() -static void sten_low(void) -{ - aztTimeOutCount = 0; - do { - aztIndatum = inb(STATUS_PORT); - aztTimeOutCount++; - if (aztTimeOutCount >= AZT_TIMEOUT) { - if (azt_init_end) - printk - ("aztcd: Error Wait STEN_LOW commands:%x\n", - aztCmd); - break; - } - } while (aztIndatum & AFL_STATUS); -} - -/* Wait for DTEN=Low = handshake signal 'Data available'*/ -# define DTEN_LOW dten_low() -static void dten_low(void) -{ - aztTimeOutCount = 0; - do { - aztIndatum = inb(STATUS_PORT); - aztTimeOutCount++; - if (aztTimeOutCount >= AZT_TIMEOUT) { - printk("aztcd: Error Wait DTEN_OK\n"); - break; - } - } while (aztIndatum & AFL_DATA); -} - -/* - * Macro for timer wait on STEN=Low, should only be used for 'slow' commands; - * may cause kernel panic when used in the wrong place -*/ -#define STEN_LOW_WAIT statusAzt() -static void statusAzt(void) -{ - AztTimeout = AZT_STATUS_DELAY; - SET_TIMER(aztStatTimer, HZ / 100); - sleep_on(&azt_waitq); - if (AztTimeout <= 0) - printk("aztcd: Error Wait STEN_LOW_WAIT command:%x\n", - aztCmd); - return; -} - -static void aztStatTimer(void) -{ - if (!(inb(STATUS_PORT) & AFL_STATUS)) { - wake_up(&azt_waitq); - return; - } - AztTimeout--; - if (AztTimeout <= 0) { - wake_up(&azt_waitq); - printk("aztcd: Error aztStatTimer: Timeout\n"); - return; - } - SET_TIMER(aztStatTimer, HZ / 100); -} - -/*########################################################################## - CDROM Drive Command Functions - ########################################################################## -*/ -/* - * Send a single command, return -1 on error, else 0 -*/ -static int aztSendCmd(int cmd) -{ - unsigned char data; - int retry; - -#ifdef AZT_DEBUG - printk("aztcd: Executing command %x\n", cmd); -#endif - - if ((azt_port == 0x1f0) || (azt_port == 0x170)) - SWITCH_IDE_SLAVE; /*switch IDE interface to slave configuration */ - - aztCmd = cmd; - outb(POLLED, MODE_PORT); - do { - if (inb(STATUS_PORT) & AFL_STATUS) - break; - inb(DATA_PORT); /* if status left from last command, read and */ - } while (1); /* discard it */ - do { - if (inb(STATUS_PORT) & AFL_DATA) - break; - inb(DATA_PORT); /* if data left from last command, read and */ - } while (1); /* discard it */ - for (retry = 0; retry < AZT_RETRY_ATTEMPTS; retry++) { - outb((unsigned char) cmd, CMD_PORT); - STEN_LOW; - data = inb(DATA_PORT); - if (data == AFL_OP_OK) { - return 0; - } /*OP_OK? */ - if (data == AFL_OP_ERR) { - STEN_LOW; - data = inb(DATA_PORT); - printk - ("### Error 1 aztcd: aztSendCmd %x Error Code %x\n", - cmd, data); - } - } - if (retry >= AZT_RETRY_ATTEMPTS) { - printk("### Error 2 aztcd: aztSendCmd %x \n", cmd); - azt_error = 0xA5; - } - RETURNM("aztSendCmd", -1); -} - -/* - * Send a play or read command to the drive, return -1 on error, else 0 -*/ -static int sendAztCmd(int cmd, struct azt_Play_msf *params) -{ - unsigned char data; - int retry; - -#ifdef AZT_DEBUG - printk("aztcd: play start=%02x:%02x:%02x end=%02x:%02x:%02x\n", - params->start.min, params->start.sec, params->start.frame, - params->end.min, params->end.sec, params->end.frame); -#endif - for (retry = 0; retry < AZT_RETRY_ATTEMPTS; retry++) { - aztSendCmd(cmd); - outb(params->start.min, CMD_PORT); - outb(params->start.sec, CMD_PORT); - outb(params->start.frame, CMD_PORT); - outb(params->end.min, CMD_PORT); - outb(params->end.sec, CMD_PORT); - outb(params->end.frame, CMD_PORT); - STEN_LOW; - data = inb(DATA_PORT); - if (data == AFL_PA_OK) { - return 0; - } /*PA_OK ? */ - if (data == AFL_PA_ERR) { - STEN_LOW; - data = inb(DATA_PORT); - printk - ("### Error 1 aztcd: sendAztCmd %x Error Code %x\n", - cmd, data); - } - } - if (retry >= AZT_RETRY_ATTEMPTS) { - printk("### Error 2 aztcd: sendAztCmd %x\n ", cmd); - azt_error = 0xA5; - } - RETURNM("sendAztCmd", -1); -} - -/* - * Send a seek command to the drive, return -1 on error, else 0 -*/ -static int aztSeek(struct azt_Play_msf *params) -{ - unsigned char data; - int retry; - -#ifdef AZT_DEBUG - printk("aztcd: aztSeek %02x:%02x:%02x\n", - params->start.min, params->start.sec, params->start.frame); -#endif - for (retry = 0; retry < AZT_RETRY_ATTEMPTS; retry++) { - aztSendCmd(ACMD_SEEK); - outb(params->start.min, CMD_PORT); - outb(params->start.sec, CMD_PORT); - outb(params->start.frame, CMD_PORT); - STEN_LOW; - data = inb(DATA_PORT); - if (data == AFL_PA_OK) { - return 0; - } /*PA_OK ? */ - if (data == AFL_PA_ERR) { - STEN_LOW; - data = inb(DATA_PORT); - printk("### Error 1 aztcd: aztSeek\n"); - } - } - if (retry >= AZT_RETRY_ATTEMPTS) { - printk("### Error 2 aztcd: aztSeek\n "); - azt_error = 0xA5; - } - RETURNM("aztSeek", -1); -} - -/* Send a Set Disk Type command - does not seem to work with Aztech drives, behavior is completely indepen- - dent on which mode is set ??? -*/ -static int aztSetDiskType(int type) -{ - unsigned char data; - int retry; - -#ifdef AZT_DEBUG - printk("aztcd: set disk type command: type= %i\n", type); -#endif - for (retry = 0; retry < AZT_RETRY_ATTEMPTS; retry++) { - aztSendCmd(ACMD_SET_DISK_TYPE); - outb(type, CMD_PORT); - STEN_LOW; - data = inb(DATA_PORT); - if (data == AFL_PA_OK) { /*PA_OK ? */ - azt_read_mode = type; - return 0; - } - if (data == AFL_PA_ERR) { - STEN_LOW; - data = inb(DATA_PORT); - printk - ("### Error 1 aztcd: aztSetDiskType %x Error Code %x\n", - type, data); - } - } - if (retry >= AZT_RETRY_ATTEMPTS) { - printk("### Error 2 aztcd: aztSetDiskType %x\n ", type); - azt_error = 0xA5; - } - RETURNM("aztSetDiskType", -1); -} - - -/* used in azt_poll to poll the status, e |