diff -urN linux/Documentation/Configure.help linux-2.2.3-mcd/Documentation/Configure.help --- linux/Documentation/Configure.help Mon Mar 8 18:14:35 1999 +++ linux-2.2.3-mcd/Documentation/Configure.help Mon Mar 22 09:45:20 1999 @@ -6503,9 +6503,6 @@ (PhotoCDs). There is a new driver (next question) which can do this. If you want that one, say N here. - If the driver doesn't work out of the box, you might want to have a - look at drivers/cdrom/mcd.h. - If you say Y here, you should also say Y or M to "ISO 9660 CDROM filesystem support" below, because that's the filesystem used on CDROMs. @@ -6514,6 +6511,32 @@ inserted in and removed from the running kernel whenever you want). The module will be called mcd.o. If you want to compile it as a module, say M here and read Documentation/modules.txt. + +IRQ channel for Mitsumi CD-ROM +CONFIG_MCD_IRQ + This allows you to specify default value of interrupt number used by + the driver. This setting can be overridden at boot time by passing "mcd=" + parameter to the kernel or module load time (if you compiled this as a + module). + +I/O base address for Mitsumi CD-ROM +CONFIG_MCD_BASE + This allows you to specify default value (in hex) of I/O base address + used by the driver. This setting can be overridden at boot time by + passing "mcd=" parameter to the kernel or module load time (if you + compiled this as a module). + +Number of times to retry a command +CONFIG_MCD_RETRY_ATTEMPTS + The value you set controls the number of times Mitsumi CD-ROM driver (mcd) + will retry a command before giving up. + Usually, it is safe to leave this parameter at its default value. + +Delay (in ticks = jiffies) for internal timeouts +CONFIG_MCD_STATUS_DELAY + The value you set controls various internal timeouts used by the driver. + Usually, it is safe to leave this parameter at its default value, though + you might want to increase this if you get lots of timeouts. Mitsumi [XA/MultiSession] support CONFIG_MCDX diff -urN linux/drivers/cdrom/Config.in linux-2.2.3-mcd/drivers/cdrom/Config.in --- linux/drivers/cdrom/Config.in Sun Dec 28 20:05:45 1997 +++ linux-2.2.3-mcd/drivers/cdrom/Config.in Mon Mar 22 09:48:39 1999 @@ -14,6 +14,12 @@ fi fi tristate 'Mitsumi (standard) [no XA/Multisession] CDROM support' CONFIG_MCD +if [ "$CONFIG_MCD" != "n" ]; then + int 'MCD IRQ' CONFIG_MCD_IRQ 11 + hex 'MCD I/O base (hex)' CONFIG_MCD_BASE 300 + int 'MCD status delay (ticks)' CONFIG_MCD_STATUS_DELAY 1000 + int 'MCD retry attempts' CONFIG_MCD_RETRY_ATTEMPTS 10 +fi tristate 'Mitsumi [XA/MultiSession] CDROM support' CONFIG_MCDX tristate 'Optics Storage DOLPHIN 8000AT CDROM support' CONFIG_OPTCD tristate 'Philips/LMS CM206 CDROM support' CONFIG_CM206 diff -urN linux/drivers/cdrom/mcd.c linux-2.2.3-mcd/drivers/cdrom/mcd.c --- linux/drivers/cdrom/mcd.c Wed Nov 4 20:09:43 1998 +++ linux-2.2.3-mcd/drivers/cdrom/mcd.c Mon Mar 22 09:53:58 1999 @@ -67,6 +67,7 @@ a CD. November 1997 -- ported to the Uniform CD-ROM driver by Erik Andersen. + March 1999 -- made mcd.h parameters CONFIG options (Tigran Aivazian). */ #include @@ -83,6 +84,7 @@ #include #include #include +#include /* #define REALLY_SLOW_IO */ #include @@ -155,8 +157,8 @@ int mitsumi_bug_93_wait = 0; #endif /* WORK_AROUND_MITSUMI_BUG_93 */ -static short mcd_port = MCD_BASE_ADDR; /* used as "mcd" by "insmod" */ -static int mcd_irq = MCD_INTR_NR; /* must directly follow mcd_port */ +static short mcd_port = CONFIG_MCD_BASE; /* used as "mcd" by "insmod" */ +static int mcd_irq = CONFIG_MCD_IRQ; /* must directly follow mcd_port */ MODULE_PARM(mcd, "1-2i"); static int McdTimeout, McdTries; @@ -273,11 +275,11 @@ { int st, retry; - for (retry = 0; retry < MCD_RETRY_ATTEMPTS; retry++) + for (retry = 0; retry < CONFIG_MCD_RETRY_ATTEMPTS; retry++) { outb(MCMD_GET_STATUS, MCDPORT(0)); /* send get-status cmd */ - st = getMcdStatus(MCD_STATUS_DELAY); + st = getMcdStatus(CONFIG_MCD_STATUS_DELAY); if (st != -1) break; } @@ -295,10 +297,10 @@ { int retry, st; - for (retry = 0; retry < MCD_RETRY_ATTEMPTS; retry++) + for (retry = 0; retry < CONFIG_MCD_RETRY_ATTEMPTS; retry++) { sendMcdCmd(MCMD_PLAY_READ, arg); - st = getMcdStatus(2 * MCD_STATUS_DELAY); + st = getMcdStatus(2 * CONFIG_MCD_STATUS_DELAY); if (st != -1) break; } @@ -316,7 +318,7 @@ /* all drives can at least stop! */ if (audioStatus == CDROM_AUDIO_PLAY) { outb(MCMD_STOP, MCDPORT(0)); - i = getMcdStatus(MCD_STATUS_DELAY); + i = getMcdStatus(CONFIG_MCD_STATUS_DELAY); } audioStatus = CDROM_AUDIO_NO_STATUS; @@ -327,7 +329,7 @@ * But nothing we can do about that in software! * So just read the status and forget it. - Jon. */ - i = getMcdStatus(MCD_STATUS_DELAY); + i = getMcdStatus(CONFIG_MCD_STATUS_DELAY); return 0; } else @@ -380,7 +382,7 @@ case CDROMSTOP: /* Spin down the drive */ outb(MCMD_STOP, MCDPORT(0)); - i = getMcdStatus(MCD_STATUS_DELAY); + i = getMcdStatus(CONFIG_MCD_STATUS_DELAY); /* should we do anything if it fails? */ @@ -392,7 +394,7 @@ return -EINVAL; outb(MCMD_STOP, MCDPORT(0)); - i = getMcdStatus(MCD_STATUS_DELAY); + i = getMcdStatus(CONFIG_MCD_STATUS_DELAY); if (GetQChannelInfo(&qInfo) < 0) { @@ -460,7 +462,7 @@ if (audioStatus == CDROM_AUDIO_PLAY) { outb(MCMD_STOP, MCDPORT(0)); - i = getMcdStatus(MCD_STATUS_DELAY); + i = getMcdStatus(CONFIG_MCD_STATUS_DELAY); audioStatus = CDROM_AUDIO_NO_STATUS; } @@ -561,7 +563,7 @@ outb(volctrl->channel1, MCDPORT(0)); outb(255, MCDPORT(0)); - i = getMcdStatus(MCD_STATUS_DELAY); + i = getMcdStatus(CONFIG_MCD_STATUS_DELAY); if (i < 0) return -EIO; @@ -706,13 +708,13 @@ printk(" (Read error)"); /* Bitch about the problem. */ /* Time to get fancy! If at 2x speed and 1 error, drop to 1x speed! */ - /* Interesting how it STAYS at MCD_RETRY_ATTEMPTS on first error! */ + /* Interesting how it STAYS at CONFIG_MCD_RETRY_ATTEMPTS on first error! */ /* But I find that rather HANDY!!! */ /* Neat! it REALLY WORKS on those LOW QUALITY CD's!!! Smile! :) */ /* AJK [06/17/95] */ /* Slap the CD down to single speed! */ - if (mcdDouble == 1 && McdTries == MCD_RETRY_ATTEMPTS && MCMD_DATA_READ == MCMD_2X_READ) + if (mcdDouble == 1 && McdTries == CONFIG_MCD_RETRY_ATTEMPTS && MCMD_DATA_READ == MCMD_2X_READ) { MCMD_DATA_READ = MCMD_PLAY_READ; /* Uhhh, Ummmm, muhuh-huh! */ mcd1xhold = SINGLE_HOLD_SECTORS; /* Hey Beavis! */ @@ -722,7 +724,7 @@ printk("\n"); mcd_invalidate_buffers(); #ifdef WARN_IF_READ_FAILURE - if (McdTries == MCD_RETRY_ATTEMPTS) + if (McdTries == CONFIG_MCD_RETRY_ATTEMPTS) printk("mcd: read of block %d failed\n", mcd_next_bn); #endif if (!McdTries--) @@ -737,7 +739,7 @@ } if (CURRENT_VALID) end_request(0); - McdTries = MCD_RETRY_ATTEMPTS; + McdTries = CONFIG_MCD_RETRY_ATTEMPTS; } } mcd_error = 0; @@ -746,7 +748,7 @@ /* Switch back to Double speed if enough GOOD sectors were read! */ /* Are we a double speed with a crappy CD?! */ - if (mcdDouble == 1 && McdTries == MCD_RETRY_ATTEMPTS && MCMD_DATA_READ == MCMD_PLAY_READ) + if (mcdDouble == 1 && McdTries == CONFIG_MCD_RETRY_ATTEMPTS && MCMD_DATA_READ == MCMD_PLAY_READ) { /* We ARE a double speed and we ARE bitching! */ if (mcd1xhold == 0) /* Okay, Like are we STILL at single speed? */ @@ -1102,7 +1104,7 @@ current->state = TASK_INTERRUPTIBLE; schedule_timeout(HZ); } - } while (((st & MST_READY) == 0) && count++ < MCD_RETRY_ATTEMPTS); + } while (((st & MST_READY) == 0) && count++ < CONFIG_MCD_RETRY_ATTEMPTS); if (updateToc() < 0) return -EIO; @@ -1457,14 +1459,14 @@ unsigned char notUsed; int retry; - for (retry = 0; retry < MCD_RETRY_ATTEMPTS; retry++) + for (retry = 0; retry < CONFIG_MCD_RETRY_ATTEMPTS; retry++) { outb(MCMD_GET_Q_CHANNEL, MCDPORT(0)); - if (getMcdStatus(MCD_STATUS_DELAY) != -1) + if (getMcdStatus(CONFIG_MCD_STATUS_DELAY) != -1) break; } - if (retry >= MCD_RETRY_ATTEMPTS) + if (retry >= CONFIG_MCD_RETRY_ATTEMPTS) return -1; if (getValue(&qp -> ctrl_addr) < 0) return -1; @@ -1512,14 +1514,14 @@ { int retry; - for (retry = 0; retry < MCD_RETRY_ATTEMPTS; retry++) + for (retry = 0; retry < CONFIG_MCD_RETRY_ATTEMPTS; retry++) { outb(MCMD_GET_DISK_INFO, MCDPORT(0)); - if (getMcdStatus(MCD_STATUS_DELAY) != -1) + if (getMcdStatus(CONFIG_MCD_STATUS_DELAY) != -1) break; } - if (retry >= MCD_RETRY_ATTEMPTS) + if (retry >= CONFIG_MCD_RETRY_ATTEMPTS) return -1; if (getValue(&DiskInfo.first) < 0) return -1; @@ -1568,26 +1570,26 @@ i = DiskInfo.last + 3; - for (retry = 0; retry < MCD_RETRY_ATTEMPTS; retry++) + for (retry = 0; retry < CONFIG_MCD_RETRY_ATTEMPTS; retry++) { outb(MCMD_STOP, MCDPORT(0)); - if (getMcdStatus(MCD_STATUS_DELAY) != -1) + if (getMcdStatus(CONFIG_MCD_STATUS_DELAY) != -1) break; } - if (retry >= MCD_RETRY_ATTEMPTS) + if (retry >= CONFIG_MCD_RETRY_ATTEMPTS) return -1; - for (retry = 0; retry < MCD_RETRY_ATTEMPTS; retry++) + for (retry = 0; retry < CONFIG_MCD_RETRY_ATTEMPTS; retry++) { outb(MCMD_SET_MODE, MCDPORT(0)); outb(0x05, MCDPORT(0)); /* mode: toc */ mcd_mode = 0x05; - if (getMcdStatus(MCD_STATUS_DELAY) != -1) + if (getMcdStatus(CONFIG_MCD_STATUS_DELAY) != -1) break; } - if (retry >= MCD_RETRY_ATTEMPTS) + if (retry >= CONFIG_MCD_RETRY_ATTEMPTS) return -1; for (limit = 300; limit > 0; limit--) @@ -1609,12 +1611,12 @@ Toc[DiskInfo.last + 1].diskTime = DiskInfo.diskLength; - for (retry = 0; retry < MCD_RETRY_ATTEMPTS; retry++) + for (retry = 0; retry < CONFIG_MCD_RETRY_ATTEMPTS; retry++) { outb(MCMD_SET_MODE, MCDPORT(0)); outb(0x01, MCDPORT(0)); mcd_mode = 1; - if (getMcdStatus(MCD_STATUS_DELAY) != -1) + if (getMcdStatus(CONFIG_MCD_STATUS_DELAY) != -1) break; } diff -urN linux/drivers/cdrom/mcd.h linux-2.2.3-mcd/drivers/cdrom/mcd.h --- linux/drivers/cdrom/mcd.h Tue Dec 2 19:41:44 1997 +++ linux-2.2.3-mcd/drivers/cdrom/mcd.h Mon Mar 22 09:46:46 1999 @@ -21,26 +21,6 @@ * */ -/* *** change this to set the I/O port address */ -#define MCD_BASE_ADDR 0x300 - -/* *** change this to set the interrupt number */ -#define MCD_INTR_NR 11 - -/* *** make the following line uncommented, if you're sure, - * *** all configuration is done */ - -/* #define I_WAS_HERE */ - - - - -/* Increase this if you get lots of timeouts */ -#define MCD_STATUS_DELAY 1000 - -/* number of times to retry a command before giving up */ -#define MCD_RETRY_ATTEMPTS 10 - /* port access macro */ #define MCDPORT(x) (mcd_port + (x)) @@ -121,8 +101,3 @@ struct msf trackTime; struct msf diskTime; }; - -#ifndef I_WAS_HERE -#warning You have not edited mcd.h -#warning Perhaps irq and i/o settings are wrong. -#endif