[patch] more cdrom updates

Erik Andersen (andersee@debian.org)
Tue, 24 Mar 1998 04:43:42 -0700


Hi Linus,

Here are some more cdrom updates for 2.0.91. This patch includes some
fixes to the CDROM_SELECT_SPEED ioctl, documentation updates to go along
with the change, and Michael Chastain's config cdrom stuff. I am including
his patch here at his request because he is currently moving, and will be
off-line for a couple of weeks.

-Erik

--
Erik B. Andersen   Web:    http://www.inconnect.com/~andersen/ 
                   email:  andersee@debian.org
--This message was written using 73% post-consumer electrons--

[-----patch follows----------]

diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/Documentation/cdrom/cdrom-standard.tex linux/Documentation/cdrom/cdrom-standard.tex --- linux-pre-2.1.91-1.virgin/Documentation/cdrom/cdrom-standard.tex Wed Dec 31 12:34:15 1997 +++ linux/Documentation/cdrom/cdrom-standard.tex Tue Mar 24 03:31:58 1998 @@ -1,5 +1,5 @@ \documentclass{article} -\def\version{$Id: cdrom-standard.tex,v 1.9 1997/12/28 15:42:49 david Exp $} +\def\version{$Id: cdrom-standard.tex,v 1.91 1998/03/24 02:59:24 erik Exp $} \newcommand{\newsection}[1]{\newpage\section{#1}} \evensidemargin=0pt @@ -24,7 +24,7 @@ \title{A \linux\ \cdrom\ standard} \author{David van Leeuwen\\{\normalsize\tt david@ElseWare.cistron.nl} \\{\footnotesize updated by Erik Andersen {\tt(andersee@debian.org)}}} -\date{19 November 1997} +\date{24 March 1998} \maketitle @@ -302,8 +302,7 @@ The $mask$ flags can be used to mask out some of the capabilities listed in $ops\to capability$, if a specific drive doesn't support a feature of the driver. The value $speed$ specifies the maximum head-rate of the -drive, measured in units of normal audio speed (176\,kB/sec raw data or -150\,kB/sec file system data). The value $n_discs$ should reflect the +drive, measured in kB/sec. The value $n_discs$ should reflect the number of discs the drive can hold simultaneously, if it is designed as a juke-box, or otherwise~1. The parameters are declared $const$ because they describe properties of the drive, which don't change after @@ -441,14 +440,19 @@ This function specifies the speed at which data is read or audio is played back. The value of $speed$ specifies the head-speed of the -drive, measured in units of standard cdrom speed (176\,kB/sec raw data -or 150\,kB/sec file system data). So to request that a \cdrom\ drive +drive, measured in units of kB/sec. So to request that a \cdrom\ drive operate at 300\,kB/sec you would call the CDROM_SELECT_SPEED $ioctl$ -with $speed=2$. The special value `0' means `auto-selection', \ie, +with $speed=300$. The special value `0' means `auto-selection', \ie, maximum data-rate or real-time audio rate. If the drive doesn't have this `auto-selection' capability, the decision should be made on the current disc loaded and the return value should be positive. A negative -return value indicates an error. +return value indicates an error. NOTE: As a special case, values of +$speed$ which are less then 100 (but greater then 0), may be used +to request speeds measured in units of \cdrom\ audio speed (177\,kB/sec +raw data). With this usage, to request that a \cdrom\ drive operate at +354\,kB/sec you could call the CDROM_SELECT_SPEED $ioctl$ with $speed=2$. +This alternate interface is depricated, due to the limited speeds which +can be selected. As such, this usage may be removed from future kernels. \subsection{$Int\ select_disc(struct\ cdrom_device_info * cdi, int\ number)$} @@ -559,7 +563,7 @@ CDC_CLOSE_TRAY& can close tray by software control\cr CDC_OPEN_TRAY& can open tray\cr CDC_LOCK& can lock and unlock the door\cr -CDC_SELECT_SPEED& can select speed, in units of $\sim$150\,kB/s\cr +CDC_SELECT_SPEED& can select speed, in units of kB/sec\cr CDC_SELECT_DISC& drive is juke-box\cr CDC_MULTI_SESSION& can read sessions $>\rm1$\cr CDC_MCN& can read Medium Catalog Number\cr @@ -875,9 +879,8 @@ the current flags. \item[CDROM_CLEAR_OPTIONS] Clear options specified by $arg$. Returns the option flag register after modification. -\item[CDROM_SELECT_SPEED] Select head-rate speed of disc specified as - by $arg$ in units of standard cdrom speed (176\,kB/sec raw data or - 150\,kB/sec file system data). The value 0 means `auto-select', \ie, +\item[CDROM_SELECT_SPEED] Select head-rate speed of the drive specified + by $arg$ in units of kB/sec. The value 0 means `auto-select', \ie, play audio discs at real time and data disc at maximum speed. The value $arg$ is checked against the maximum head rate of the drive found in the $cdrom_dops$. diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/alpha/config.in linux/arch/alpha/config.in --- linux-pre-2.1.91-1.virgin/arch/alpha/config.in Mon Mar 23 19:45:29 1998 +++ linux/arch/alpha/config.in Tue Mar 24 02:37:05 1998 @@ -216,17 +216,6 @@ fi endmenu -# Conditionally compile in the Uniform CD-ROM driver -if [ "$CONFIG_BLK_DEV_IDECD" = "y" -o "$CONFIG_BLK_DEV_SR" = "y" -o "$CONFIG_SBPCD" = "y" -o "$CONFIG_MCD" = "y" -o "$CONFIG_CM206" = "y" -o "$CONFIG_CDU31A" = "y" ]; then - define_bool CONFIG_CDROM y -else - if [ "$CONFIG_BLK_DEV_IDECD" = "m" -o "$CONFIG_BLK_DEV_SR" = "m" -o "$CONFIG_SBPCD" = "m" -o "$CONFIG_MCD" = "m" -o "$CONFIG_CM206" = "m" -o "$CONFIG_CDU31A" = "m" ]; then - define_bool CONFIG_CDROM m - else - define_bool CONFIG_CDROM n - fi -fi - source fs/Config.in source fs/nls/Config.in diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/alpha/defconfig linux/arch/alpha/defconfig --- linux-pre-2.1.91-1.virgin/arch/alpha/defconfig Mon Mar 23 19:45:29 1998 +++ linux/arch/alpha/defconfig Tue Mar 24 02:37:05 1998 @@ -214,7 +214,6 @@ # CD-ROM drivers (not for SCSI or IDE/ATAPI drives) # # CONFIG_CD_NO_IDESCSI is not set -CONFIG_CDROM=y # # Filesystems diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/arm/config.in linux/arch/arm/config.in --- linux-pre-2.1.91-1.virgin/arch/arm/config.in Mon Mar 23 19:45:30 1998 +++ linux/arch/arm/config.in Tue Mar 24 02:37:05 1998 @@ -105,17 +105,6 @@ # fi # endmenu -# Conditionally compile in the Uniform CD-ROM driver -if [ "$CONFIG_BLK_DEV_IDECD" = "y" -o "$CONFIG_BLK_DEV_SR" = "y" ]; then - define_bool CONFIG_CDROM y -else - if [ "$CONFIG_BLK_DEV_IDECD" = "m" -o "$CONFIG_BLK_DEV_SR" = "m" ]; then - define_bool CONFIG_CDROM m - else - define_bool CONFIG_CDROM n - fi -fi - source fs/Config.in source fs/nls/Config.in diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/arm/defconfig linux/arch/arm/defconfig --- linux-pre-2.1.91-1.virgin/arch/arm/defconfig Mon Mar 23 19:45:30 1998 +++ linux/arch/arm/defconfig Tue Mar 24 02:37:05 1998 @@ -169,7 +169,6 @@ CONFIG_ETHER1=m CONFIG_ETHER3=m CONFIG_ETHERH=m -CONFIG_CDROM=y # # Filesystems diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/i386/config.in linux/arch/i386/config.in --- linux-pre-2.1.91-1.virgin/arch/i386/config.in Mon Mar 23 19:45:30 1998 +++ linux/arch/i386/config.in Tue Mar 24 02:37:05 1998 @@ -114,17 +114,6 @@ fi endmenu -# Conditionally compile in the Uniform CD-ROM driver -if [ "$CONFIG_BLK_DEV_IDECD" = "y" -o "$CONFIG_BLK_DEV_SR" = "y" -o "$CONFIG_SBPCD" = "y" -o "$CONFIG_MCD" = "y" -o "$CONFIG_MCDX" = "y" -o "$CONFIG_CM206" = "y" -o "$CONFIG_CDU31A" = "y" ]; then - define_bool CONFIG_CDROM y -else - if [ "$CONFIG_BLK_DEV_IDECD" = "m" -o "$CONFIG_BLK_DEV_SR" = "m" -o "$CONFIG_SBPCD" = "m" -o "$CONFIG_MCD" = "m" -o "$CONFIG_MCDX" = "m" -o "$CONFIG_CM206" = "m" -o "$CONFIG_CDU31A" = "m" ]; then - define_bool CONFIG_CDROM m - else - define_bool CONFIG_CDROM n - fi -fi - source fs/Config.in source fs/nls/Config.in diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/i386/defconfig linux/arch/i386/defconfig --- linux-pre-2.1.91-1.virgin/arch/i386/defconfig Mon Mar 23 19:45:30 1998 +++ linux/arch/i386/defconfig Tue Mar 24 02:37:05 1998 @@ -214,7 +214,6 @@ # CD-ROM drivers (not for SCSI or IDE/ATAPI drives) # # CONFIG_CD_NO_IDESCSI is not set -CONFIG_CDROM=y # # Filesystems diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/m68k/config.in linux/arch/m68k/config.in --- linux-pre-2.1.91-1.virgin/arch/m68k/config.in Tue Mar 24 04:26:22 1998 +++ linux/arch/m68k/config.in Tue Mar 24 02:37:05 1998 @@ -269,17 +269,6 @@ fi -# Conditionally compile in the Uniform CD-ROM driver -if [ "$CONFIG_BLK_DEV_IDECD" = "y" -o "$CONFIG_BLK_DEV_SR" = "y" ]; then - define_bool CONFIG_CDROM y -else - if [ "$CONFIG_BLK_DEV_IDECD" = "m" -o "$CONFIG_BLK_DEV_SR" = "m" ]; then - define_bool CONFIG_CDROM m - else - define_bool CONFIG_CDROM n - fi -fi - source fs/Config.in if [ "$CONFIG_VME" = "n" ]; then diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/ppc/config.in linux/arch/ppc/config.in --- linux-pre-2.1.91-1.virgin/arch/ppc/config.in Mon Mar 23 19:45:33 1998 +++ linux/arch/ppc/config.in Tue Mar 24 02:37:06 1998 @@ -149,17 +149,6 @@ fi endmenu -# Conditionally compile in the Uniform CD-ROM driver -if [ "$CONFIG_BLK_DEV_SR" = "y" -o "$CONFIG_SBPCD" = "y" -o "$CONFIG_MCD" = "y" -o "$CONFIG_CM206" = "y" -o "$CONFIG_CDU31A" = "y" ]; then - define_bool CONFIG_CDROM y -else - if [ "$CONFIG_BLK_DEV_SR" = "m" -o "$CONFIG_SBPCD" = "m" -o "$CONFIG_MCD" = "m" -o "$CONFIG_CM206" = "m" -o "$CONFIG_CDU31A" = "m" ]; then - define_bool CONFIG_CDROM m - else - define_bool CONFIG_CDROM n - fi -fi - source fs/Config.in source fs/nls/Config.in diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/sparc/config.in linux/arch/sparc/config.in --- linux-pre-2.1.91-1.virgin/arch/sparc/config.in Mon Mar 23 19:45:33 1998 +++ linux/arch/sparc/config.in Tue Mar 24 02:37:06 1998 @@ -159,17 +159,6 @@ endmenu fi -# Conditionally compile in the Uniform CD-ROM driver -if [ "$CONFIG_BLK_DEV_SR" = "y" ]; then - define_bool CONFIG_CDROM y -else - if [ "$CONFIG_BLK_DEV_SR" = "m" ]; then - define_bool CONFIG_CDROM m - else - define_bool CONFIG_CDROM n - fi -fi - source fs/Config.in source fs/nls/Config.in diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/sparc64/config.in linux/arch/sparc64/config.in --- linux-pre-2.1.91-1.virgin/arch/sparc64/config.in Mon Mar 23 19:45:33 1998 +++ linux/arch/sparc64/config.in Tue Mar 24 02:37:06 1998 @@ -218,17 +218,6 @@ endmenu fi -# Conditionally compile in the Uniform CD-ROM driver -if [ "$CONFIG_BLK_DEV_IDECD" = "y" -o "$CONFIG_BLK_DEV_SR" = "y" ]; then - define_bool CONFIG_CDROM y -else - if [ "$CONFIG_BLK_DEV_IDECD" = "m" -o "$CONFIG_BLK_DEV_SR" = "m" ]; then - define_bool CONFIG_CDROM m - else - define_bool CONFIG_CDROM n - fi -fi - source fs/Config.in source fs/nls/Config.in diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/arch/sparc64/defconfig linux/arch/sparc64/defconfig --- linux-pre-2.1.91-1.virgin/arch/sparc64/defconfig Mon Mar 23 19:45:33 1998 +++ linux/arch/sparc64/defconfig Tue Mar 24 02:37:06 1998 @@ -205,7 +205,6 @@ CONFIG_SUNQE=m CONFIG_MYRI_SBUS=m CONFIG_DE4X5=y -CONFIG_CDROM=y # # Filesystems diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c --- linux-pre-2.1.91-1.virgin/drivers/block/ide-cd.c Mon Mar 23 19:45:34 1998 +++ linux/drivers/block/ide-cd.c Tue Mar 24 04:14:12 1998 @@ -197,10 +197,13 @@ * inform me of where "Illegal mode for this track" * was never returned due to a comparison on data * types of limited range. + * 4.12 Mar 24, 1998 -- Changed to support the new behavior of the + * CDROM_SELECT_SPEED ioctl, as the old behavior + * was rather stupid and limited. * *************************************************************************/ -#define IDECD_VERSION "4.11" +#define IDECD_VERSION "4.12" #include <linux/module.h> #include <linux/types.h> @@ -1747,8 +1750,7 @@ } -/* Note that this takes speed in kbytes/second, so don't try requesting - silly speeds like 2 here. Common speeds include: +/* Note that this takes speed in kbytes/second. Common speeds include: 176 kbytes/second -- 1x 353 kbytes/second -- 2x 387 kbytes/second -- 2.2x @@ -1757,7 +1759,10 @@ 1400 kbytes/second -- 8x 2800 kbytes/second -- 16x ATAPI drives are free to select the speed you request or any slower - rate :-( Requesting too fast a speed will _not_ produce an error. */ + rate :-( Requesting a speed higher then the max speed will _not_ + produce an error (per the ATAPI spec). Some drives spew errors + when you request an unsupported speed though... Well behaved ones + simply select the supported speed closest to what you have requested. */ static int cdrom_select_speed (ide_drive_t *drive, int speed, struct atapi_request_sense *reqbuf) @@ -1766,9 +1771,9 @@ memset (&pc, 0, sizeof (pc)); pc.sense_data = reqbuf; - if (speed < 1) + if (speed == 0) speed = 0xffff; /* set to max */ - else + else if ( speed < 100 ) speed *= 177; /* Nx to kbytes/s */ pc.c[0] = SET_CD_SPEED; @@ -1776,10 +1781,14 @@ pc.c[2] = (speed >> 8) & 0xff; /* Read Drive speed in kbytes/second LSB */ pc.c[3] = speed & 0xff; - /* Write Drive speed in kbytes/second MSB */ - //pc.c[4] = (speed >> 8) & 0xff; - /* Write Drive speed in kbytes/second LSB */ - //pc.c[5] = speed & 0xff; + + if ( CDROM_CONFIG_FLAGS(drive)->cd_r || + CDROM_CONFIG_FLAGS(drive)->cd_rw ) { + /* Write Drive speed in kbytes/second MSB */ + pc.c[4] = (speed >> 8) & 0xff; + /* Write Drive speed in kbytes/second LSB */ + pc.c[5] = speed & 0xff; + } return cdrom_queue_packet_command (drive, &pc); } @@ -2485,7 +2494,7 @@ if (stat<0) return stat; - /* Now that that is done, update the speed fields */ + /* Now with that done, update the speed fields */ do { /* we seem to get stat=0x01,err=0x00 the first time (??) */ if (attempts-- <= 0) return 0; @@ -2495,15 +2504,15 @@ /* The ACER/AOpen 24X cdrom has the speed fields byte-swapped */ if (drive->id && !drive->id->model[0] && !strncmp(drive->id->fw_rev, "241N", 4)) { - CDROM_STATE_FLAGS (drive)->current_speed = - (((unsigned int)buf.cap.curspeed) + (176/2)) / 176; - CDROM_CONFIG_FLAGS (drive)->max_speed = - (((unsigned int)buf.cap.maxspeed) + (176/2)) / 176; + CDROM_STATE_FLAGS (drive)->current_speed = + (((unsigned int)buf.cap.curspeed) + (176/2)) / 176; + CDROM_CONFIG_FLAGS (drive)->max_speed = + (((unsigned int)buf.cap.maxspeed) + (176/2)) / 176; } else { - CDROM_STATE_FLAGS (drive)->current_speed = - (ntohs(buf.cap.curspeed) + (176/2)) / 176; - CDROM_CONFIG_FLAGS (drive)->max_speed = - (ntohs(buf.cap.maxspeed) + (176/2)) / 176; + CDROM_STATE_FLAGS (drive)->current_speed = + (ntohs(buf.cap.curspeed) + (176/2)) / 176; + CDROM_CONFIG_FLAGS (drive)->max_speed = + (ntohs(buf.cap.maxspeed) + (176/2)) / 176; } cdi->speed = CDROM_STATE_FLAGS (drive)->current_speed; return 0; diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c --- linux-pre-2.1.91-1.virgin/drivers/block/ll_rw_blk.c Mon Mar 23 19:45:34 1998 +++ linux/drivers/block/ll_rw_blk.c Tue Mar 24 02:37:06 1998 @@ -716,9 +716,6 @@ #ifdef CONFIG_BLK_DEV_LOOP loop_init(); #endif -#ifdef CONFIG_CDROM /* this must precede all CD-ROM drivers */ - cdrom_init(); -#endif CONFIG_CDROM #ifdef CONFIG_ISP16_CDI isp16_init(); #endif CONFIG_ISP16_CDI diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/drivers/cdrom/Makefile linux/drivers/cdrom/Makefile --- linux-pre-2.1.91-1.virgin/drivers/cdrom/Makefile Sun Dec 28 13:05:45 1997 +++ linux/drivers/cdrom/Makefile Tue Mar 24 02:37:06 1998 @@ -1,131 +1,66 @@ -# # Makefile for the kernel cdrom device drivers. # -# Note! Dependencies are done automagically by 'make dep', which also -# removes any old dependencies. DON'T put your own dependencies here -# unless it's something special (ie not a .c file). -# -# Note 2! The CFLAGS definition is now inherited from the -# parent makefile. -# +# 30 Jan 1998, Michael Elizabeth Chastain, <mailto:mec@shout.net> +# Rewritten to use lists instead of if-statements. + + + +# All of the (potential) objects that export symbols. +# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. + +export-objs := cdrom.o + + + +# Object file lists. + +obj-y := +obj-m := +obj-n := +obj- := + + + +# Each configuration option enables a list of files. + +obj-$(CONFIG_BLK_DEV_IDECD) += cdrom.o +obj-$(CONFIG_BLK_DEV_SR) += 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_MCD) += mcd.o cdrom.o +obj-$(CONFIG_MCDX) += mcdx.o cdrom.o +obj-$(CONFIG_OPTCD) += optcd.o +obj-$(CONFIG_SBPCD) += sbpcd.o cdrom.o +obj-$(CONFIG_SBPCD2) += sbpcd2.o cdrom.o +obj-$(CONFIG_SBPCD3) += sbpcd3.o cdrom.o +obj-$(CONFIG_SBPCD4) += sbpcd4.o cdrom.o +obj-$(CONFIG_SJCD) += sjcd.o +obj-$(CONFIG_CDU535) += sonycd535.o + + + +# Files that are both resident and modular: remove from modular. + +obj-m := $(filter-out $(obj-y), $(obj-m)) + + + +# Translate to Rules.make lists. + +L_TARGET := cdrom.a +MOD_LIST_NAME := CDROM_MODULES + +L_OBJS := $(sort $(filter-out $(export-objs), $(obj-y))) +LX_OBJS := $(sort $(filter $(export-objs), $(obj-y))) +M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m))) +MX_OBJS := $(sort $(filter $(export-objs), $(obj-m))) -# -# Note : at this point, these files are compiled on all systems. -# In the future, some of these should be built conditionally. -# -L_TARGET := cdrom.a -L_OBJS := -M_OBJS := -MOD_LIST_NAME := CDROM_MODULES - -ifeq ($(CONFIG_AZTCD),y) -L_OBJS += aztcd.o -else - ifeq ($(CONFIG_AZTCD),m) - M_OBJS += aztcd.o - endif -endif #CONFIG_AZTCD - -ifeq ($(CONFIG_CDU31A),y) -L_OBJS += cdu31a.o -else - ifeq ($(CONFIG_CDU31A),m) - M_OBJS += cdu31a.o - endif -endif #CONFIG_CDU31A - -ifeq ($(CONFIG_MCD),y) -L_OBJS += mcd.o -else - ifeq ($(CONFIG_MCD),m) - M_OBJS += mcd.o - endif -endif #CONFIG_MCD - -ifeq ($(CONFIG_MCDX),y) -L_OBJS += mcdx.o -else - ifeq ($(CONFIG_MCDX),m) - M_OBJS += mcdx.o - endif -endif #CONFIG_MCDX - -ifeq ($(CONFIG_SBPCD),y) -L_OBJS += sbpcd.o -else - ifeq ($(CONFIG_SBPCD),m) - M_OBJS += sbpcd.o - endif -endif #CONFIG_SBPCD - -ifeq ($(CONFIG_SBPCD2),y) -L_OBJS += sbpcd2.o -endif #CONFIG_SBPCD2 - -ifeq ($(CONFIG_SBPCD3),y) -L_OBJS += sbpcd3.o -endif #CONFIG_SBPCD3 - -ifeq ($(CONFIG_SBPCD4),y) -L_OBJS += sbpcd4.o -endif #CONFIG_SBPCD4 - -ifeq ($(CONFIG_CDU535),y) -L_OBJS += sonycd535.o -else - ifeq ($(CONFIG_CDU535),m) - M_OBJS += sonycd535.o - endif -endif #CONFIG_CDU535 - -ifeq ($(CONFIG_GSCD),y) -L_OBJS += gscd.o -else - ifeq ($(CONFIG_GSCD),m) - M_OBJS += gscd.o - endif -endif #CONFIG_GSCD - -ifeq ($(CONFIG_CM206),y) -L_OBJS += cm206.o -else - ifeq ($(CONFIG_CM206),m) - M_OBJS += cm206.o - endif -endif #CONFIG_CM206 - -ifeq ($(CONFIG_OPTCD),y) -L_OBJS += optcd.o -else - ifeq ($(CONFIG_OPTCD),m) - M_OBJS += optcd.o - endif -endif #CONFIG_OPTCD - -ifeq ($(CONFIG_SJCD),y) -L_OBJS += sjcd.o -else - ifeq ($(CONFIG_SJCD),m) - M_OBJS += sjcd.o - endif -endif #CONFIG_SJCD - -ifeq ($(CONFIG_ISP16_CDI),y) -L_OBJS += isp16.o -else - ifeq ($(CONFIG_ISP16_CDI),m) - M_OBJS += isp16.o - endif -endif #CONFIG_ISP16_CDI - -ifeq ($(CONFIG_CDROM),y) -LX_OBJS += cdrom.o -else - ifeq ($(CONFIG_CDROM),m) - MX_OBJS += cdrom.o - endif -endif #CONFIG_CDROM for the Uniform CD-ROM driver +# Hand off to Rules.make. include $(TOPDIR)/Rules.make diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/drivers/cdrom/cdrom.c linux/drivers/cdrom/cdrom.c --- linux-pre-2.1.91-1.virgin/drivers/cdrom/cdrom.c Sat Feb 28 09:19:37 1998 +++ linux/drivers/cdrom/cdrom.c Tue Mar 24 04:12:00 1998 @@ -168,11 +168,6 @@ NULL /* revalidate */ }; -void cdrom_init(void) { - if (!topCdromPtr) - printk(KERN_INFO "Uniform CD-ROM driver " REVISION "\n"); -} - /* This macro makes sure we don't have to check on cdrom_device_ops * existence in the run-time routines below. Change_capability is a * hack to have the capability flags defined const, while we can still @@ -205,6 +200,15 @@ /* default compatibility mode */ cdi->mc_flags = 0; cdo->n_minors = 0; + + { + static char banner_printed = 0; + if ( !banner_printed ) { + printk(KERN_INFO "Uniform CD-ROM driver " REVISION "\n"); + banner_printed = 1; + } + } + cdinfo(CD_REG_UNREG, "drive \"/dev/%s\" registered\n", cdi->name); cdi->next = topCdromPtr; topCdromPtr = cdi; @@ -682,8 +686,6 @@ cdinfo(CD_DO_IOCTL, "entering CDROM_SELECT_SPEED\n"); if (!(cdo->capability & ~cdi->mask & CDC_SELECT_SPEED)) return -ENOSYS; - if ((int)arg > cdi->speed ) - return -EINVAL; return cdo->select_speed(cdi, arg); } @@ -1031,7 +1033,6 @@ int init_module(void) { - cdrom_init(); #ifdef CONFIG_SYSCTL cdrom_sysctl_register(); #endif /* CONFIG_SYSCTL */ diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/drivers/scsi/sr_ioctl.c linux/drivers/scsi/sr_ioctl.c --- linux-pre-2.1.91-1.virgin/drivers/scsi/sr_ioctl.c Sat Feb 28 09:19:58 1998 +++ linux/drivers/scsi/sr_ioctl.c Tue Mar 24 03:47:20 1998 @@ -261,9 +261,9 @@ if (speed == 0) speed = 0xffff; /* set to max */ - else - speed *= 177; /* Nx to kbyte/s */ - + else if ( speed < 100 ) + speed *= 177; /* Nx to kbytes/s */ + memset(sr_cmd,0,12); sr_cmd[0] = 0xbb; /* SET CD SPEED */ sr_cmd[1] = (scsi_CDs[MINOR(cdi->dev)].device->lun) << 5; diff -u --recursive --new-file linux-pre-2.1.91-1.virgin/include/linux/blk.h linux/include/linux/blk.h --- linux-pre-2.1.91-1.virgin/include/linux/blk.h Sat Feb 28 09:20:21 1998 +++ linux/include/linux/blk.h Tue Mar 24 02:37:06 1998 @@ -45,75 +45,33 @@ #endif /* IDE_DRIVER */ #define SUBSECTOR(block) (CURRENT->current_nr_sectors > 0) -#ifdef CONFIG_CDROM -extern int cdrom_init(void); -#endif CONFIG_CDROM -#ifdef CONFIG_ISP16_CDI + +/* + * Initialization functions. + */ extern int isp16_init(void); -#endif CONFIG_ISP16_CDI -#ifdef CONFIG_CDU31A extern int cdu31a_init(void); -#endif CONFIG_CDU31A -#ifdef CONFIG_ATARI_ACSI extern int acsi_init(void); -#endif CONFIG_ATARI_ACSI -#ifdef CONFIG_MCD extern int mcd_init(void); -#endif CONFIG_MCD -#ifdef CONFIG_MCDX extern int mcdx_init(void); -#endif CONFIG_MCDX -#ifdef CONFIG_SBPCD extern int sbpcd_init(void); -#endif CONFIG_SBPCD -#ifdef CONFIG_AZTCD extern int aztcd_init(void); -#endif CONFIG_AZTCD -#ifdef CONFIG_CDU535 extern int sony535_init(void); -#endif CONFIG_CDU535 -#ifdef CONFIG_GSCD extern int gscd_init(void); -#endif CONFIG_GSCD -#ifdef CONFIG_CM206 extern int cm206_init(void); -#endif CONFIG_CM206 -#ifdef CONFIG_OPTCD extern int optcd_init(void); -#endif CONFIG_OPTCD -#ifdef CONFIG_SJCD extern int sjcd_init(void); -#endif CONFIG_SJCD -#ifdef CONFIG_CDI_INIT extern int cdi_init(void); -#endif CONFIG_CDI_INIT -#ifdef CONFIG_BLK_DEV_HD extern int hd_init(void); -#endif -#ifdef CONFIG_BLK_DEV_IDE extern int ide_init(void); -#endif -#ifdef CONFIG_BLK_DEV_XD extern int xd_init(void); -#endif -#ifdef CONFIG_BLK_DEV_LOOP extern int loop_init(void); -#endif -#ifdef CONFIG_BLK_DEV_MD extern int md_init(void); -#endif CONFIG_BLK_DEV_MD -#ifdef CONFIG_APBLOCK extern int ap_init(void); -#endif -#ifdef CONFIG_DDV extern int ddv_init(void); -#endif -#ifdef CONFIG_AMIGA_Z2RAM extern int z2_init(void); -#endif -#ifdef CONFIG_MAC_FLOPPY extern int swim3_init(void); -#endif +extern int ps2esdi_init(void); extern void set_device_ro(kdev_t dev,int flag); void add_blkdev_randomness(int major); @@ -134,9 +92,6 @@ extern int initrd_below_start_ok; /* 1 if it is not an error if initrd_start < memory_start */ void initrd_init(void); -#endif -#ifdef CONFIG_BLK_DEV_PS2 -extern int ps2esdi_init(void); #endif #define RO_IOCTLS(dev,where) \

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu