Remove the mcd(4) driver for Mitsumi CD-ROM players.

This is a driver for a pre-ATAPI ISA CD-ROM adapter.  As noted in
the manpage, this driver is only useful as a backend to cdcontrol to
play audio CDs since it doesn't use DMA, so its data performance is
"abysmal" (and that was true in the mid 90's).
This commit is contained in:
John Baldwin 2016-08-15 20:38:02 +00:00
parent 79ef07d4c0
commit 061ae3c519
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=304187
11 changed files with 2 additions and 2327 deletions

View File

@ -38,6 +38,8 @@
# xargs -n1 | sort | uniq -d;
# done
# 20160815: Remove mcd(4)
OLD_FILES+=usr/share/man/man4/mcd.4.gz
# 20160703: POSIXify locales with variants
OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_COLLATE
OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_CTYPE

View File

@ -269,7 +269,6 @@ MAN= aac.4 \
mac_stub.4 \
mac_test.4 \
malo.4 \
mcd.4 \
md.4 \
mdio.4 \
me.4 \

View File

@ -1,165 +0,0 @@
.\"
.\" Copyright (c) 1994 Keith E. Walker
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD$
.\"
.Dd December 8, 1994
.Dt MCD 4
.Os
.Sh NAME
.Nm mcd
.Nd Mitsumi CD-ROM driver
.Sh SYNOPSIS
.Cd "device mcd"
.Pp
In
.Pa /boot/device.hints :
.Cd hint.mcd.0.at="isa"
.Cd hint.mcd.0.port="0x300"
.Cd hint.mcd.0.irq="10"
.Sh DESCRIPTION
The
.Nm
driver provides a data and audio interface to the Mitsumi-brand CD-ROM
player.
The CD-ROM player must be interfaced to the ISA bus through
one of the Mitsumi proprietary controller boards.
The controller
boards supported are the LU002S, LU005S, the FX001 and the quite
common FX001D.
.Pp
The
.Nm
driver responds to disk-specific
.Fn ioctl
commands, namely the
.Dv DIOCGPART
command.
Other disk-specific
.Fn ioctl
commands will return an error.
.Pp
The
.Nm
driver also responds to special CD-ROM
.Fn ioctl
commands.
These commands
control the CD-ROM player's audio features.
The commands are:
.Pp
.Bl -tag -width CDIOCREADSUBCHANNEL -compact -offset indent
.It CDIOCREADSUBCHANNEL
get sub-channel information on current status of disc playing
.It CDIOCREADTOCHEADER
get table of contents header
.It CDIOCREADTOCENTRYS
gets all of the table of contents
.It CDIOCPLAYTRACKS
begins audio playing at location specified
.It CDIOCPLAYBLOCKS
fails with error
.Er EINVAL
.It CDIOCPLAYMSF
begins audio playing at location specified
.It CDIOCRESUME
resumes playing a previously paused disc
.It CDIOCPAUSE
pauses a playing disc
.It CDIOCSTART
begins playing a disc
.It CDIOCSTOP
stops a previously playing disc
.It CDIOCEJECT
opens the disc tray (there is no support for a corresponding un-eject
command).
.It CDIOCRESET
stops any play and resets the Mitsumi controller board
.It CDIOCSETDEBUG
cause the kernel to print debug messages to the console about the
.Nm
driver
.It CDIOCCLRDEBUG
cause the kernel to quit printing debug messages about the
.Nm
driver
.El
.Pp
The
.Fn ioctl
commands defined above are the only ones that the
.Nm
driver supports.
There are other CD-ROM related
.Fn ioctl
commands (such as
.Dv CDIOCSETVOL
and
.Dv CDIOCSETSTERIO )
which are available
and may be supported by future versions of the driver.
.Sh FILES
.Bl -tag -width /dev/(r)mcd0a -compact
.It Pa /dev/(r)mcd0a
accesses
.Bx
partition on the disc.
Normally, there is only
one file system on a CD-ROM disc.
.It Pa /dev/(r)mcd0c
accesses raw device.
.El
.Sh NOTES
The character-mode devices for the
.Nm
driver should only be used for accessing the audio features of the
CD-ROM player as the performance on data is abysmal.
.Pp
The current version of the driver uses neither the DMA or IRQ
features of the interface board, although it has an interrupt handler
for any IRQ requests that are generated.
Until the DMA features are
supported, the only interrupts that the board generates are those that
are not supported by the driver anyway.
.Sh SEE ALSO
.In sys/cdio.h
.Sh HISTORY
An
.Nm
driver appeared in
.Fx 1.0 .
.Sh AUTHORS
.An -nosplit
The driver was written by
.An Holger Veit
(data part) and
.An Brian Moore
(audio part).
Changes were provided by
.An Gary Clark II ,
.An Andrew A. Chernov ,
and
.An Jordan K. Hubbard .

View File

@ -2412,15 +2412,10 @@ options SND_OLDSTEREO
# Miscellaneous hardware:
#
# scd: Sony CD-ROM using proprietary (non-ATAPI) interface
# mcd: Mitsumi CD-ROM using proprietary (non-ATAPI) interface
# bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board
# joy: joystick (including IO DATA PCJOY PC Card joystick)
# cmx: OmniKey CardMan 4040 pccard smartcard reader
# Mitsumi CD-ROM
device mcd
hint.mcd.0.at="isa"
hint.mcd.0.port="0x300"
# for the Sony CDU31/33A CDROM
device scd
hint.scd.0.at="isa"

View File

@ -2018,8 +2018,6 @@ dev/malo/if_malohal.c optional malo
dev/malo/if_malo_pci.c optional malo pci
dev/mc146818/mc146818.c optional mc146818
dev/mca/mca_bus.c optional mca
dev/mcd/mcd.c optional mcd isa nowerror
dev/mcd/mcd_isa.c optional mcd isa nowerror
dev/md/md.c optional md
dev/mdio/mdio_if.m optional miiproxy | mdio
dev/mdio/mdio.c optional miiproxy | mdio

File diff suppressed because it is too large Load Diff

View File

@ -1,202 +0,0 @@
/*
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
#include <sys/bio.h>
#include <sys/cdio.h>
#include <sys/bus.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <machine/bus.h>
#include <machine/resource.h>
#include <sys/rman.h>
#include <isa/isavar.h>
#include <dev/mcd/mcdreg.h>
#include <dev/mcd/mcdvar.h>
static int mcd_isa_probe (device_t);
static int mcd_isa_attach (device_t);
static int mcd_isa_detach (device_t);
static int mcd_alloc_resources (device_t);
static void mcd_release_resources (device_t);
static int
mcd_isa_probe (device_t dev)
{
struct mcd_softc * sc;
int error;
/* No pnp support */
if (isa_get_vendorid(dev))
return (ENXIO);
/* IO port must be configured. */
if (bus_get_resource_start(dev, SYS_RES_IOPORT, 0) == 0)
return (ENXIO);
sc = device_get_softc(dev);
sc->dev = dev;
sc->port_rid = 0;
sc->port_type = SYS_RES_IOPORT;
error = mcd_alloc_resources(dev);
if (error)
goto fail;
error = mcd_probe(sc);
if (error) {
device_printf(dev, "Probe failed.\n");
goto fail;
}
device_set_desc(dev, sc->data.name);
fail:
mcd_release_resources(dev);
return (error);
}
static int
mcd_isa_attach (device_t dev)
{
struct mcd_softc * sc;
int error;
sc = device_get_softc(dev);
error = 0;
sc->dev = dev;
sc->port_rid = 0;
sc->port_type = SYS_RES_IOPORT;
error = mcd_alloc_resources(dev);
if (error)
goto fail;
error = mcd_probe(sc);
if (error) {
device_printf(dev, "Re-Probe failed.\n");
goto fail;
}
error = mcd_attach(sc);
if (error) {
device_printf(dev, "Attach failed.\n");
goto fail;
}
return (0);
fail:
mcd_release_resources(dev);
return (error);
}
static int
mcd_isa_detach (device_t dev)
{
struct mcd_softc * sc;
int error;
sc = device_get_softc(dev);
error = 0;
destroy_dev(sc->mcd_dev_t);
mcd_release_resources(dev);
return (error);
}
static int
mcd_alloc_resources (device_t dev)
{
struct mcd_softc * sc;
int error;
sc = device_get_softc(dev);
error = 0;
mtx_init(&sc->mtx, "mcd", NULL, MTX_DEF);
if (sc->port_type) {
sc->port = bus_alloc_resource_any(dev, sc->port_type,
&sc->port_rid, RF_ACTIVE);
if (sc->port == NULL) {
device_printf(dev, "Unable to allocate PORT resource.\n");
error = ENOMEM;
goto bad;
}
}
if (sc->irq_type) {
sc->irq = bus_alloc_resource_any(dev, sc->irq_type,
&sc->irq_rid, RF_ACTIVE);
if (sc->irq == NULL) {
device_printf(dev, "Unable to allocate IRQ resource.\n");
error = ENOMEM;
goto bad;
}
}
if (sc->drq_type) {
sc->drq = bus_alloc_resource_any(dev, sc->drq_type,
&sc->drq_rid, RF_ACTIVE);
if (sc->drq == NULL) {
device_printf(dev, "Unable to allocate DRQ resource.\n");
error = ENOMEM;
goto bad;
}
}
bad:
return (error);
}
static void
mcd_release_resources (device_t dev)
{
struct mcd_softc * sc;
sc = device_get_softc(dev);
if (sc->irq_ih)
bus_teardown_intr(dev, sc->irq, sc->irq_ih);
if (sc->port)
bus_release_resource(dev, sc->port_type, sc->port_rid, sc->port);
if (sc->irq)
bus_release_resource(dev, sc->irq_type, sc->irq_rid, sc->irq);
if (sc->drq)
bus_release_resource(dev, sc->drq_type, sc->drq_rid, sc->drq);
mtx_destroy(&sc->mtx);
return;
}
static device_method_t mcd_isa_methods[] = {
DEVMETHOD(device_probe, mcd_isa_probe),
DEVMETHOD(device_attach, mcd_isa_attach),
DEVMETHOD(device_detach, mcd_isa_detach),
{ 0, 0 }
};
static driver_t mcd_isa_driver = {
"mcd",
mcd_isa_methods,
sizeof(struct mcd_softc)
};
static devclass_t mcd_devclass;
DRIVER_MODULE(mcd, isa, mcd_isa_driver, mcd_devclass, NULL, 0);

View File

@ -1,219 +0,0 @@
/*-
* Copyright 1993 by Holger Veit (data part)
* Copyright 1993 by Brian Moore (audio part)
* Changes Copyright 1993 by Gary Clark II
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This software was developed by Holger Veit and Brian Moore
* for use with "386BSD" and similar operating systems.
* "Similar operating systems" includes mainly non-profit oriented
* systems for research and education, including but not restricted to
* "NetBSD", "FreeBSD", "Mach" (by CMU).
* 4. Neither the name of the developer(s) nor the name "386BSD"
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPER(S) ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE DEVELOPER(S) BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This file contains definitions for some cdrom control commands
* and status codes. This info was "inherited" from the DOS MTMCDE.SYS
* driver, and is thus not complete (and may even be wrong). Some day
* the manufacturer or anyone else might provide better documentation,
* so this file (and the driver) will then have a better quality.
*
* $FreeBSD$
*/
#ifndef MCD_H
#define MCD_H
/* toc */
#define MCD_MAXTOCS 104 /* from the Linux driver */
#define MCD_LASTPLUS1 170 /* special toc entry */
typedef unsigned char bcd_t;
#define M_msf(msf) msf[0]
#define S_msf(msf) msf[1]
#define F_msf(msf) msf[2]
/* io lines used */
#define MCD_IO_BASE 0x300
#define MCD_REG_COMMAND 0
#define MCD_REG_STATUS 0
#define MCD_REG_RDATA 0
#define MCD_REG_RESET 1
#define MCD_REG_CTL2 2 /* XXX Is this right? */
#define MCD_REG_CONFIG 3
#define MCD_MASK_DMA 0x07 /* bits 2-0 = DMA channel */
#define MCD_MASK_IRQ 0x70 /* bits 6-4 = INT number */
/* 001 = int 2,9 */
/* 010 = int 3 */
/* 011 = int 5 */
/* 100 = int 10 */
/* 101 = int 11 */
/* flags */
#define MFL_DATA_NOT_AVAIL 0x02
#define MFL_STATUS_NOT_AVAIL 0x04
/* New Commands */
#define M_RESET 0x00
#define M_PICKLE 0x04
/* ports */
#define MCD_DATA 0
#define MCD_FLAGS 1
#define MCD_CTRL 2
#define CHANNEL 3 /* XXX ??? */
/* Status bits */
#define MCD_ST_DOOROPEN 0x80
#define MCD_ST_DSKIN 0x40
#define MCD_ST_DSKCHNG 0x20
#define MCD_ST_SPINNING 0x10
#define MCD_ST_AUDIODISK 0x08 /* Audio Disk is in */
#define MCD_ST_BUSY 0x04
#define MCD_ST_AUDIOBSY 0x02 /* Audio Disk is Playing */
#define MCD_ST_CMDCHECK 0x01 /* Command error */
/* commands known by the controller */
#define MCD_CMDRESET 0x00
#define MCD_CMDGETVOLINFO 0x10 /* gets mcd_volinfo */
#define MCD_CMDGETDISKINFO 0x11 /* gets mcd_disk information */
#define MCD_CMDGETQCHN 0x20 /* gets mcd_qchninfo */
#define MCD_CMDGETSENSE 0x30 /* gets sense info */
#define MCD_CMDGETSTAT 0x40 /* gets a byte of status */
#define MCD_CMDSETMODE 0x50 /* set transmission mode, needs byte */
#define MCD_MDBIT_TESTMODE 0x80 /* 0 = DATALENGTH setting is valid */
#define MCD_MDBIT_DATALENGTH 0x40 /* 0 = Read User Data Only */
/* 1 = Read Raw sectors (2352 bytes) */
#define MCDBLK 2048 /* for cooked mode */
#define MCDRBLK sizeof(struct mcd_rawsector) /* for raw mode */
#define MCD_MDBIT_ECCMODE 0x20 /* 0 = Use secondary correction */
/* 1 = Don't use secondary ECC */
#define MCD_MDBIT_SPINDOWN 0x08 /* 0 = Spin Up, 1 = Spin Down */
#define MCD_MDBIT_GET_TOC 0x04 /* 0 = Get UPC on next GETQCHAN */
/* 1 = Get TOC on GETQCHAN */
#define MCD_MDBIT_MUTEDATA 0x01 /* 1 = Don't play back Data as audio */
#define MCD_MD_RAW (MCD_MDBIT_DATALENGTH|MCD_MDBIT_ECCMODE|MCD_MDBIT_MUTEDATA)
#define MCD_MD_COOKED (MCD_MDBIT_MUTEDATA)
#define MCD_MD_TOC (MCD_MDBIT_GET_TOC|MCD_MDBIT_MUTEDATA)
#define MCD_CMDSTOPAUDIO 0x70
#define MCD_CMDSTOPAUDIOTIME 0x80
#define MCD_CMDGETVOLUME 0x8E /* gets mcd_volume */
#define MCD_CMDSETDRIVEMODE 0xA0 /* Set drive mode */
#define MCD_READUPC 0xA2 /* Get UPC info */
#define MCD_CMDSETVOLUME 0xAE /* sets mcd_volume */
#define MCD_CMDREAD1 0xB0 /* read n sectors */
#define MCD_CMDSINGLESPEEDREAD 0xC0 /* read from-to */
#define MCD_CMDSTARTAUDIOMSF 0xC1 /* read audio data */
#define MCD_CMDDOUBLESPEEDREAD 0xC1 /* Read lots of data from the drive */
#define MCD_CMDGETDRIVEMODE 0xC2 /* Get the drive mode */
#define MCD_CMDREAD 0xC3 /* Read data from the drive */
#define MCD_CMDSETINTERLEAVE 0xC8 /* Adjust the interleave */
#define MCD_CMDCONTINFO 0xDC /* Get controller info */
#define MCD_CMDSTOP 0xF0 /* Stop everything */
#define MCD_CMDEJECTDISK 0xF6
#define MCD_CMDCLOSETRAY 0xF8
#define MCD_CMDLOCKDRV 0xFE /* needs byte */
#define MCD_LK_UNLOCK 0x00
#define MCD_LK_LOCK 0x01
#define MCD_LK_TEST 0x02
/* DMA Enable Stuff */
#define MCD_DMA_IRQFLAGS 0x10 /* Set data0 for IRQ click */
#define MCD_DMA_PREIRQ 0x01 /* All of these are for */
#define MCD_DMA_POSTIRQ 0x02 /* MCD_DMA_IRQFLAG... */
#define MCD_DMA_ERRIRQ 0x04 /* */
#define MCD_DMA_TIMEOUT 0x08 /* Set data0 for DMA timeout */
#define MCD_DMA_UPCFLAG 0x04 /* 1 = Next command will be READUPC */
#define MCD_DMA_DMAMODE 0x02 /* 1 = Data uses DMA */
#define MCD_DMA_TRANSFERLENGTH 0x01 /* data0 = MSB, data1 = LSB of block length */
struct mcd_dma_mode {
u_char dma_mode;
u_char data0; /* If dma_mode & 0x10: Use IRQ settings */
u_char data1; /* Used if dma_mode & 0x01 */
} __packed;
struct mcd_volinfo {
bcd_t trk_low;
bcd_t trk_high;
bcd_t vol_msf[3];
bcd_t trk1_msf[3];
} __packed;
struct mcd_qchninfo {
u_char addr_type:4;
u_char control:4;
u_char trk_no;
u_char idx_no;
bcd_t trk_size_msf[3];
u_char :8;
bcd_t hd_pos_msf[3];
} __packed;
struct mcd_volume {
u_char v0l;
u_char v0rs;
u_char v0r;
u_char v0ls;
} __packed;
struct mcd_holdtime {
u_char units_of_ten_seconds;
/* If this is 0, the default (12) is used */
} __packed;
struct mcd_read1 {
bcd_t start_msf[3];
u_char nsec[3];
} __packed;
struct mcd_read2 {
bcd_t start_msf[3];
bcd_t end_msf[3];
} __packed;
struct mcd_rawsector {
u_char sync1[12];
u_char header[4];
u_char subheader1[4];
u_char subheader2[4];
u_char data[MCDBLK];
u_char ecc_bits[280];
} __packed;
#endif /* MCD_H */

View File

@ -1,71 +0,0 @@
/*
* $FreeBSD$
*/
struct mcd_mbx {
short retry;
short nblk;
int sz;
u_long skip;
struct bio * bp;
short count;
short mode;
};
struct mcd_data {
short type;
char * name;
short config;
short flags;
u_char read_command;
short status;
int blksize;
u_long disksize;
int partflags;
int openflags;
struct mcd_volinfo volinfo;
struct mcd_qchninfo toc[MCD_MAXTOCS];
short audio_status;
short curr_mode;
struct mcd_read2 lastpb;
short debug;
struct bio_queue_head head; /* head of bio queue */
struct mcd_mbx mbx;
};
struct mcd_softc {
device_t dev;
struct cdev *mcd_dev_t;
int debug;
struct resource * port;
int port_rid;
int port_type;
struct resource * irq;
int irq_rid;
int irq_type;
void * irq_ih;
struct resource * drq;
int drq_rid;
int drq_type;
struct mtx mtx;
struct callout timer;
int ch_state;
struct mcd_mbx * ch_mbxsave;
struct mcd_data data;
};
#define MCD_LOCK(_sc) mtx_lock(&_sc->mtx)
#define MCD_UNLOCK(_sc) mtx_unlock(&_sc->mtx)
#define MCD_ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED)
#define MCD_READ(_sc, _reg) bus_read_1(_sc->port, _reg)
#define MCD_WRITE(_sc, _reg, _val) bus_write_1(_sc->port, _reg, _val)
int mcd_probe (struct mcd_softc *);
int mcd_attach (struct mcd_softc *);

View File

@ -224,7 +224,6 @@ SUBDIR= \
mac_stub \
mac_test \
malo \
mcd \
md \
mdio \
mem \

View File

@ -1,9 +0,0 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../dev/mcd
KMOD= mcd
SRCS= mcd.c mcd_isa.c \
bus_if.h device_if.h isa_if.h
.include <bsd.kmod.mk>