1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Alas, poor matcd, I knew ye well.

It doesn't work.
It cannot be made to work.
Goodbye.

X-MFC after:	ASAP
This commit is contained in:
Scott Long 2002-10-04 06:06:04 +00:00
parent fd4f1dd9fa
commit 0910374b7f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104444
12 changed files with 1 additions and 4288 deletions

View File

@ -3,7 +3,7 @@
MAN= aic.4 alpm.4 amdpm.4 apm.4 ar.4 asc.4 asr.4 \
cs.4 cx.4 cy.4 \
dgb.4 el.4 en.4 ep.4 ex.4 fe.4 gsc.4 \
ie.4 io.4 le.4 linux.4 lnc.4 longrun.4 matcd.4 mcd.4 \
ie.4 io.4 le.4 linux.4 lnc.4 longrun.4 mcd.4 \
meteor.4 mse.4 npx.4 \
pcf.4 perfmon.4 pnp.4 pnpbios.4 \
ray.4 rdp.4 scd.4 \

View File

@ -1,394 +0,0 @@
.\"Matsushita(Panasonic) / Creative CD-ROM Driver (matcd)
.\"Authored by Frank Durda IV
.\"
.\"Program and Documentation are Copyright 1994, 1995 Frank Durda IV.
.\"All rights reserved.
.\" "FDIV" is a trademark of Frank Durda IV.
.\"
.\"
.\"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 positioned at the very beginning of this file without
.\" modification, all copyright strings, all related programming
.\" codes that display the copyright strings, this list of
.\" conditions and the following disclaimer.
.\"2. Redistributions in binary form must contain all copyright strings
.\" and related programming code that display the copyright strings.
.\"3. 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.
.\"4. All advertising materials mentioning features or use of this
.\" software must display the following acknowledgement:
.\" "The Matsushita/Panasonic CD-ROM driver was developed
.\" by Frank Durda IV for use with "FreeBSD" and similar
.\" operating systems."
.\" "Similar operating systems" includes mainly non-profit oriented
.\" systems for research and education, including but not restricted
.\" to "NetBSD", "386BSD", and "Mach" (by CMU). The wording of the
.\" acknowledgement (in electronic form or printed text) may not be
.\" changed without permission from the author.
.\"5. Absolutely no warranty of function, fitness or purpose is made
.\" by the author Frank Durda IV.
.\"6. Neither the name of the author nor the name "FreeBSD" may
.\" be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\" (The author can be reached at bsdmail@nemesis.lonestar.org)
.\"7. The product containing this software must meet all of these
.\" conditions even if it is unsupported, not a complete system
.\" and/or does not contain compiled code.
.\"8. These conditions will be in force for the full life of the
.\" copyright.
.\"9. If all the above conditions are met, modifications to other
.\" parts of this file may be freely made, although any person
.\" or persons making changes do not receive the right to add their
.\" name or names to the copyright strings and notices in this
.\" software. Persons making changes are encouraged to insert edit
.\" history in matcd.c and to put your name and details of the
.\" change there.
.\"10. You must have prior written permission from the author to
.\" deviate from these terms.
.\"
.\"Vendors who produce product(s) containing this code are encouraged
.\"(but not required) to provide copies of the finished product(s) to
.\"the author and to correspond with the author about development
.\"activity relating to this code. Donations of development hardware
.\"and/or software are also welcome. (This is one of the faster ways
.\"to get a driver developed for a device.)
.\"
.\" 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.
.\"
.\"--------------------------------------------------------------------------
.\"Dedicated to: My family and Max, my Golden Retriever
.\"-----No changes are allowed above this line-------------------------------
.\"
.\" Please note any documentation updates here including your name
.\" and the date.
.\"<2> Text brought in sync with changes made in versions 1(17) - 1(21)
.\" Frank Durda IV 4-Jul-95
.\"<3> Text brought in sync with changes made in versions 1(22) - 1(25)
.\" Frank Durda IV 24-Sep-95
.\"
.\" $FreeBSD$
.\"
.Dd September 24, 1995
.Dt MATCD 4 i386
.\"Synchronized to Version 1(25) of matcd.c
.Os
.Sh NAME
.Nm matcd
.Nd Matsushita (Panasonic) CD-ROM driver
.Sh SYNOPSIS
.Cd "device matcd 1"
.Pp
In
.Pa /boot/device.hints :
.Cd hint.matcd.0.at="isa"
.Sh DESCRIPTION
The
.Nm
driver controls the CR-562-x and CR-563-x CD-ROM drives made by
Matsushita-Kotobuki Electronics Industries, or Matsushita for short.
These CD-ROM drives have been sold under the Panasonic (which is a trade
name for Matsushita), Creative Labs (omniCD) and Reveal names, and have
been included in computers made by Tandy, AST, Packard Bell and many others.
.Pp
These drives connect to the PC ISA bus through a proprietary host interface.
This interface can exist as a stand-alone ISA card, or can be included on
a sound card.
.Sh DRIVER CONFIGURATION
The
.Nm
driver supports up to four host interfaces with up to four drives on each
interface. Audio activity may occur on all drives simultaneously. Data
read operations are limited to one drive per host interface at any instant.
.Pp
To support multiple host interfaces, it is necessary to modify the
entries in the kernel configuration file. Normally your system comes
with the file \fI/usr/src/sys/i386/conf/GENERIC\fR. You should make
a copy of this file and give it the name of your system.
You can then edit the new file to include devices you want the system
to support and delete the device entries that you don't want.
.Pp
In this file, you will find an entry like:
.Bd -literal -offset indent
device matcd 1
.Ed
.Pp
To support two host interfaces, change the file so it reads:
.Bd -literal -offset indent
device matcd 2
.Ed
.Pp
(If you want to support up to three or four host interfaces,
increase the number at the end of the line).
.Pp
Note that the kernel configuration does not need to be modified to support
up to four drives on a single host interface. It is also not necessary to
have four drives on a single interface before adding a second interface.
.Pp
By default,
.Nm
searches for the CD-ROM host interface adapters by using a table of known I/O
ports on Creative host adapters (see \fIoptions.h\fR). Although this
is very flexible, it can cause problems when your system has other devices
that are located at the I/O ports that
.Nm
is checking for CD-ROM host interfaces. In addition, checking multiple
locations can cause the boot process to take longer than it could.
.Pp
If you are having these problems, you can solve them by explicitly specifying
where the CD-ROM host interfaces are located. For example, by default most
SoundBlaster cards have the Matsushita CD-ROM host interface
located at I/O port 0x230. (This is 0x10 above the I/O port for the
audio section of the card.) If this is the case for your system, you could
change where the kernel looks for the hardware by entering a line in
.Pa /boot/device.hints .
For example, to change the I/O port for
.Nm
adapter zero to 0x340, you would put
.Pp
.Dl hint.matcd.0.port="0x340"
.Pp
in the file.
.Pp
With this change, the
.Nm
driver will only look at I/O port 0x340 for the first CD-ROM host interface
and will not disturb any other I/O ports.
.Pp
You can specify the I/O port for the second, third, and fourth
adapters in the same fashion:
.Pp
.Dl hint.matcd.0.port="0x230"
.Dl hint.matcd.1.port="0x340"
.Sh SUPPORTED HARDWARE
At this time, there are only two known drive models that work with the
.Nm
driver:
.Bl -item -width CR-123-X -compact -offset indent
.It
Matsushita CR-562-x
.It
Matsushita CR-563-x
.El
Most resellers leave these original markings on the drives since the label
also has the FCC, VDE, CSA and RU certification marks.
.Pp
Both of these drive models have motorized trays. There is also a custom
version of these drives that does not have the volume control or headphone
jack (seen on some Tandy computers), but this drive also works with
.Nm .
.Pp
The Matsushita CR-522-x and CR-523-x CD-ROM drive is not usable with
.Nm .
The CR-522 and CR-523 can also be identified from the front as it
requires a CD-caddy.
.Pp
Drives with IDE interfaces must use an IDE driver.
.Pp
The TEAC CD-55 4X CD-ROM drive also uses the Creative/Panasonic interface
but the TEAC drive is \fInot\fR compatible with the Matsushita CR-56x drives.
The TEAC drive cannot be used with
.Nm .
.Pp
The most common source of host interface adapters for the Panasonic drives
are found in products from Creative Labs, including SoundBlaster sound
cards. There are numerous models of SoundBlaster sound cards, and most
of the newer cards provide the appropriate interface, sometimes labeled as
the "Creative/Panasonic" interface.
.Pp
The following host interface adapters are known to work with the
.Nm
driver:
.Bl -tag -width LONGNAME -compact -offset indent
.It Creative
Sound Blaster Pro (SBPRO) (CT1330A)
.It Creative
Sound Blaster 16 (CT1730)
.It Creative
Sound Blaster 16 - cost-reduced (CT1740)
.It Creative
OmniCD upgrade kit adapter card - stand-alone CD (CT1810)
.It Creative
Sound Blaster 16 - 2-layer, cost-reduced (CT2230)
.It Creative
Sound Blaster 16 (Vibra16) - 2-layer, single-chip (CT2260)
.It Creative
Sound Blaster 16 Value (SB16) - 2-layer, cost-reduced (CT2770)
.It Creative
PhoneBlaster SB16 + Sierra 14.4K Voice/FAX/Data/Speakerphone modem combo (CT3100)
.It Reveal
(SC400)
.El
.Pp
Caution: Some of these sound boards can be optionally manufactured to not
include the Panasonic/Creative interface, so check the board before buying
solely based on model number.
.Pp
This is by no means a complete list as Creative Labs and other vendors
that produce sound cards with an identical Creative/Panasonic drive
interface release new versions of their adapters all the time.
.Pp
In addition to Creative Labs adapters, adapters that are compatible with
Media Vision, IBM and Lasermate adapters are also supported. However,
these adapters use a wide range of I/O port addresses, so the driver
must be reconfigured to locate these adapters.
.Pp
It is important to understand that some manufacturers have a different
host interface implementation. If you have a board that won't communicate
with the drives under MS-DOS using the genuine Creative Labs drivers, then
.Nm
may not work with that host adapter.
.Sh SUPPORTED OPERATIONS
The
.Nm
driver supports block and character access. Partition "a" returns
2048-byte User Data blocks from data CDs. Partition "c" returns the full
2352-byte Frames from any type of CD, including audio CDs. (Partition
"c" cannot be "mounted" with cd9660 or other filesystem emulators.)
No other partitions are supported.
.Pp
The
.Nm matcdl
devices work the same as the normal
.Nm
devices except that the drive trays are locked and
remain locked until all of the devs on that drive are closed.
.Pp
.Nm Matcd
accepts numerous
.Fn ioctl
commands, including disk and functions related to CD-ROM audio and tray
control features. The commands are:
.Pp
.Bl -tag -width CDIOCREADSUBCHANNELXXX -compact -offset indent
.It DIOCGDINFO
get disklabel.
.It DIOCGDPART
get partition.
.It DIOCWDINFO
set update disk.
.It DIOCSDINFO
set disklabel.
.It CDIOCREADSUBCHANNEL
get sub-channel information on current status of disc playing.
.It CDIOCREADTOCHEADER
reads table of contents summary.
.It CDIOCREADTOCENTRYS
reads length and other track information.
.It CDIOCPLAYTRACKS
plays audio starting at a track/index and stopping at a track/index.
.It CDIOCPLAYMSF
plays audio starting at a particular time offset.
.It CDIOCPAUSE
pauses a playing disc.
.It CDIOCRESUME
resumes playing a previously paused disc. Ignored if the drive is
already playing.
.It CDIOCSTOP
stops playing a disc.
.It CDIOCEJECT
opens the disc tray.
.It CDIOCCLOSE
closes the disc tray.
.It CDIOCPREVENT
blocks further attempts to open the drive door until all devices close
or a CDIOCALLOW ioctl is issued.
.It CDIOCALLOW
unlocks the drive door if it was locked. This ioctl is rejected if
any locking devices are open.
.It CDIOCGETVOL
returns the current volume settings of the drive.
.It CDIOCSETVOL
sets the volume settings of the drive.
.It CDIOCSETSTEREO
causes the left channel audio to be sent to the left channel output and the
right channel audio is sent to the right channel output. This is the
default state.
.It CDIOCSETMUTE
causes the audio output to be turned off. The drive continues to read
the audio on the disc and that audio is discarded until the audio is
turned back on.
.It CDIOCSETLEFT
causes the left channel audio to be sent to the left and right channel outputs.
.It CDIOCSETRIGHT
causes the right channel audio to be sent to the left and right channel
outputs.
.It CDIOCSETPATCH
causes the audio to be routed as specified in the provided bit maps.
.It CDIOCSETPITCH
changes the playback speed of the audio to increase or decrease
(as in Karaoke).
.It CDIOCCAPABILITY
report the capabilities of the drive and driver.
.El
.Pp
The
.Fn ioctl
commands defined above are the only ones that the
.Nm
driver supports.
.Sh FILES
.Bl -tag -width /dev/(r)matcd0a_/dev/(r)matcd0la -compact
.It Pa /dev/[r]matcd0a /dev/[r]matcd0la
is used to access 2048-byte blocks of data on a CD-ROM disc
that is recorded in the Mode 1 Form 1 format.
.It Pa /dev/[r]matcd0c /dev/[r]matcd0lc
is used to access 2352-byte frames on a CD-ROM disc
recorded in any format.
.It Pa /usr/src/sys/i386/isa/matcd/*
Source code and compilation options for
.Nm .
.El
.Pp
The file \fIoptions.h\fR contains all of the compilation options.
By default, the driver is configured to run on the current version of
.Fx .
.Sh NOTES
The Creative/Panasonic interface does not use interrupts or DMA
although the drives themselves are capable of using both.
.Pp
If the disc tray is opened while one or more partitions are open, further
I/O to all partitions on the drive will be rejected until all partitions
are closed.
.Pp
There must be a drive on each host interface that is addressed as
physical drive 0. If this isn't the case, the driver will be unable
to find the host interface or any of the connected drives.
.Pp
Drives on a second host interface start are considered logical
drives 4-7, 8-11 on the third interface and 12-15 on the fourth.
.Pp
The first drive on the second host interface is logical drive 4 regardless
of how many drives are present on the first host interface.
.Pp
Host interfaces are numbered in the order they are declared in the
kernel configuration file, or in the order they are found if the kernel
configuration file uses "?" for the port address. Host interface
numbers are always contiguous.
.Sh SEE ALSO
.Pa /usr/include/sys/cdio.h
.Sh AUTHORS
The driver and documentation was written by
.An Frank Durda IV .
.Pp
Program and Documentation are Copyright 1994, 1995,
All rights reserved.
.Sh HISTORY
The
.Nm
driver appeared in
.Fx 2.0.5 .

View File

@ -264,7 +264,6 @@ i386/isa/isa_compat.c optional isa compat_oldisa \
i386/isa/isa_dma.c optional isa
i386/isa/istallion.c optional stli nowerror
i386/isa/loran.c optional loran
i386/isa/matcd/matcd.c count matcd
i386/isa/mca_machdep.c optional mca
i386/isa/mcd.c count mcd
i386/isa/mse.c optional mse

View File

@ -242,7 +242,6 @@ i386/isa/isa_compat.c optional isa compat_oldisa \
warning "Old ISA driver compatibility shims present."
i386/isa/istallion.c optional stli nowerror
i386/isa/loran.c optional loran
i386/isa/matcd/matcd.c count matcd
i386/isa/mcd.c count mcd
i386/isa/npx.c optional npx
i386/isa/pcf.c optional pcf

View File

@ -63,7 +63,6 @@ chrdev name comments
43 vn vnode "disk" device (retired)
44 gp GPIB
45 scd Sony CDROM interface
46 matcd Matsushita/Panasonic/Creative(SB) CDROM interface
47 gsc Genius Scanner
48 cy Cyclades
49 ?? was ssc

View File

@ -508,7 +508,6 @@ device aacp # SCSI Passthrough interface (optional, CAM required)
#
# mcd: Mitsumi CD-ROM using proprietary (non-ATAPI) interface
# scd: Sony CD-ROM using proprietary (non-ATAPI) interface
# matcd: Matsushita/Panasonic CD-ROM using proprietary (non-ATAPI) interface
# wt: Wangtek and Archive QIC-02/QIC-36 tape drives
# ctx: Cortex-I frame grabber
# apm: Laptop Advanced Power Management (experimental)
@ -587,10 +586,6 @@ hint.mcd.0.irq="10"
device scd 1
hint.scd.0.at="isa"
hint.scd.0.port="0x230"
# for the SoundBlaster 16 multicd - up to 4 devices
device matcd 1
hint.matcd.0.at="isa"
hint.matcd.0.port="0x230"
device wt 1
hint.wt.0.at="isa"
hint.wt.0.port="0x300"

View File

@ -1,42 +0,0 @@
Things to do for the matcd driver 4-Jul-95
1. Someone wants to switch all drivers from disklabel and
its assorted mechanisms over to disk slicing and its mechanisms,
but I was unable to find any useful documentation on how to
implement the changes for a read-only, single-partition,
removable (ie, partition can change size) device.
So this will have to wait until after 2.1.
2. Support for reading R-W subcodes while playing audio. This would be
useful if you have any CD+G or CD+MIDI discs, but the demand for this
is pretty low, unless you like Karaoke. Someone will also have to
write a CD+G viewer for X. The code for the driver to add this is
pretty minor but there aren't any precedents on how to handle the
data transfer to the application.
3. Support for reading the ISBN and UPC labels. The ioctl structures
for these appear to be defined but no other driver seems to do this.
4. Multi-session support. There are two forms of this; what
Philips defined and what Kodak uses. This will be quite
complicated and will probably require changes in the filesystem
layer. The drive support for Kodak multi-session is known to work.
5. Multiple data tracks. My vision here was to add an ioctl
that caused a track offset to be inserted into block requests,
effectively shifting the base to the specified track. Very
easy to add but not a big deal since I have only two discs
in my collection that have multiple data tracks and I mastered
one of them.
6. A curses-based CD-Player app (ie, not X). I will probably do this
mainly for its value as a debugging tool. It was pretty annoying
not finding a single application that actually issued all the
defined ioctls, let alone any new ones.
If you feel the urge to work on one or more of these remaining items,
please contact the author first at bsdmail@nemesis.lonestar.org
to make sure the work hasn't already been done or started.
Frank Durda IV

View File

@ -1,514 +0,0 @@
/*audio.c--------------------------------------------------------------------
Matsushita(Panasonic) / Creative CD-ROM Driver (matcd)
Authored by Frank Durda IV
Copyright 1994, 1995 Frank Durda IV. All rights reserved.
"FDIV" is a trademark of Frank Durda IV.
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 positioned at the very beginning of this file without
modification, all copyright strings, all related programming
codes that display the copyright strings, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must contain all copyright strings
and related programming code that display the copyright strings.
3. 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.
4. All advertising materials mentioning features or use of this
software must display the following acknowledgement:
"The Matsushita/Panasonic CD-ROM driver was developed
by Frank Durda IV for use with "FreeBSD" and similar
operating systems."
"Similar operating systems" includes mainly non-profit oriented
systems for research and education, including but not restricted
to "NetBSD", "386BSD", and "Mach" (by CMU). The wording of the
acknowledgement (in electronic form or printed text) may not be
changed without permission from the author.
5. Absolutely no warranty of function, fitness or purpose is made
by the author Frank Durda IV.
6. Neither the name of the author nor the name "FreeBSD" may
be used to endorse or promote products derived from this software
without specific prior written permission.
(The author can be reached at bsdmail@nemesis.lonestar.org)
7. The product containing this software must meet all of these
conditions even if it is unsupported, not a complete system
and/or does not contain compiled code.
8. These conditions will be in force for the full life of the
copyright.
9. If all the above conditions are met, modifications to other
parts of this file may be freely made, although any person
or persons making changes do not receive the right to add their
name or names to the copyright strings and notices in this
software. Persons making changes are encouraged to insert edit
history in matcd.c and to put your name and details of the
change there.
10. You must have prior written permission from the author to
deviate from these terms.
Vendors who produce product(s) containing this code are encouraged
(but not required) to provide copies of the finished product(s) to
the author and to correspond with the author about development
activity relating to this code. Donations of development hardware
and/or software are also welcome. (This is one of the faster ways
to get a driver developed for a device.)
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.
-----No changes are allowed above this line------------------------------------
The following functions are related to the audio playback
capabilities of the drive. They can be omitted from the
finished driver using the FULLDRIVER conditional.
The full set of features the drive is capable of are currently
not implemented but will be added in upcoming releases.
-----------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
matcd_playtracks - Plays one or more audio tracks
-----------------------------------------------------------------------------*/
static int matcd_playtracks(int ldrive, int cdrive, int controller,
struct ioc_play_track *pt)
{
struct matcd_data *cd;
int start,end;
int i,port;
unsigned char cmd[MAXCMDSIZ];
cd=&matcd_data[ldrive];
port=cd->iobase;
if ((cd->flags & MATCDLABEL)==0)
return(EIO); /*Refuse after chg error*/
start=pt->start_track;
end=pt->end_track;
if (start < 1 || /*Starting track valid?*/
end < 1 || /*Ending track valid?*/
start > end || /*Start higher than end?*/
end > cd->volinfo.trk_high) /*End track higher than disc size?*/
return(ESPIPE); /*Track out of range*/
lockbus(controller, ldrive); /*<16>Request bus*/
i=matcd_setmode(ldrive, MODE_DA);/*Force drive into audio mode*/
unlockbus(controller, ldrive); /*<16>Release bus*/
if (i!=0) {
return(i); /*Not legal for this media?*/
}
zero_cmd(cmd);
cmd[0]=PLAYTRKS; /*Play Audio Track/Index*/
cmd[1]=start;
cmd[2]=pt->start_index;
cmd[3]=end;
cmd[4]=pt->end_index;
i=docmd(cmd,ldrive,cdrive,controller,port); /*Issue command*/
#ifdef DEBUGIOCTL
printf("matcd%d: Play track results %d \n",ldrive,i);
#endif /*DEBUGIOCTL*/
if (i==0) cd->status=CD_AS_PLAY_IN_PROGRESS; /*<14>*/
return(i);
}
/*-----------------------------------------------------------------------------
matcd_playmsf - Plays between a range of blocks
-----------------------------------------------------------------------------*/
static int matcd_playmsf(int ldrive, int cdrive, int controller,
struct ioc_play_msf *pt)
{
struct matcd_data *cd;
int i,port;
unsigned char cmd[MAXCMDSIZ];
cd=&matcd_data[ldrive];
port=cd->iobase;
#ifdef DEBUGIOCTL
printf("matcd%d: playmsf %2x %2x %2x -> %2x %2x %2x\n",
ldrive,pt->start_m, pt->start_s, pt->start_f, pt->end_m,
pt->end_s,pt->end_f);
#endif /*DEBUGIOCTL*/
if ((cd->flags & MATCDLABEL)==0)
return(EIO); /*Refuse after chg error*/
if ((cd->volinfo.vol_msf[0]==0 &&
cd->volinfo.vol_msf[1]<2) || /*Must be after 0'1"75F*/
msf_to_blk((char *)&pt->start_m) >
msf_to_blk((char *)&cd->volinfo.vol_msf)) {
#ifdef DEBUGIOCTL
printf("matcd%d: Invalid block combination\n",ldrive);
#endif /*DEBUGIOCTL*/
return(ESPIPE); /*Track out of range*/
}
lockbus(controller, ldrive); /*<16>Request bus*/
i=matcd_setmode(ldrive, MODE_DA);/*Force drive into audio mode*/
unlockbus(controller, ldrive); /*<16>Release bus*/
if (i!=0) {
return(i); /*Not legal for this media?*/
}
zero_cmd(cmd);
cmd[0]=PLAYBLOCKS; /*Play Audio Blocks*/
cmd[1]=pt->start_m;
cmd[2]=pt->start_s;
cmd[3]=pt->start_f;
cmd[4]=pt->end_m;
cmd[5]=pt->end_s;
cmd[6]=pt->end_f;
i=docmd(cmd,ldrive,cdrive,controller,port); /*Issue command*/
if (i==0) cd->status=CD_AS_PLAY_IN_PROGRESS; /*<14>*/
return(i);
}
/*-----------------------------------------------------------------------------
matcd_pause - Pause or Resume audio playback
-----------------------------------------------------------------------------*/
static int matcd_pause(int ldrive, int cdrive, int controller, int action)
{
struct matcd_data *cd;
int i,z,port;
unsigned char cmd[MAXCMDSIZ];
cd=&matcd_data[ldrive];
port=cd->iobase;
if ((cd->flags & MATCDLABEL)==0)
return(EIO); /*Refuse after chg error*/
zero_cmd(cmd);
cmd[0]=NOP; /*<14>Just find out whats going on*/
lockbus(controller, ldrive); /*<16>Request bus*/
matcd_slowcmd(port,ldrive,cdrive,cmd); /*<14>*/
i=waitforit(10*TICKRES,DTEN,port,"matpau"); /*<25>*/
z=get_stat(port,ldrive); /*<14>Read status byte*/
if ((z & MATCD_ST_ERROR)) { /*<14>Something went wrong*/
i=get_error(port, ldrive, cdrive); /*<14>*/
unlockbus(controller, ldrive); /*<16>Release bus*/
return(EIO); /*<14>*/
} /*<14>*/
unlockbus(controller, ldrive); /*<16>Release bus*/
if ((z & MATCD_ST_AUDIOBSY) == 0 && /*<14>If drive is idle*/
cd->status==CD_AS_PLAY_IN_PROGRESS) { /*<14>but was playing*/
cd->status=CD_AS_PLAY_COMPLETED; /*<14>then its done*/
return(0);
}
if (action) { /*<14>Set state for subq ioctl*/
#ifndef KRYTEN
if (cd->status==CD_AS_PLAY_IN_PROGRESS) {/*<14>Don't resume*/
return(0); /*<14>if already playing*/
} /*<14>Max Headroom sound occurs*/
#endif /*KRYTEN*/
cd->status=CD_AS_PLAY_IN_PROGRESS; /*<14>to read*/
} else { /*<14>There is no way to ask the*/
cd->status=CD_AS_PLAY_PAUSED;/*<14>drive if it is paused*/
} /*<14>*/
cmd[0]=PAUSE; /*Pause or Resume playing audio*/
cmd[1]=action;
i=docmd(cmd,ldrive,cdrive,controller,port); /*Issue command*/
#ifdef DEBUGIOCTL
printf("matcd%d: Pause / Resume results %d \n",ldrive,i);
#endif /*DEBUGIOCTL*/
return(i);
}
/*-----------------------------------------------------------------------------
matcd_stop - Stop audio playback
-----------------------------------------------------------------------------*/
static int matcd_stop(int ldrive, int cdrive, int controller)
{
struct matcd_data *cd;
int i,port;
unsigned char cmd[MAXCMDSIZ];
cd=&matcd_data[ldrive];
port=cd->iobase;
if ((cd->flags & MATCDLABEL)==0)
return(EIO); /*Refuse after chg error*/
zero_cmd(cmd);
cmd[0]=ABORT; /*Abort playing audio*/
i=docmd(cmd,ldrive,cdrive,controller,port); /*Issue command*/
#ifdef DEBUGIOCTL
printf("matcd%d: Abort results %d \n",ldrive,i);
#endif /*DEBUGIOCTL*/
cd->status=CD_AS_PLAY_COMPLETED;/*<14>the drive if it is paused*/
return(i);
}
/*-----------------------------------------------------------------------------
matcd_level - Read or set the audio levels
<12> New for Edit 12
-----------------------------------------------------------------------------*/
static int matcd_level(int ldrive, int cdrive, int controller,
struct ioc_vol * level, unsigned long action)
{
struct matcd_data *cd;
int i,z,port;
unsigned char c;
unsigned char cmd[MAXCMDSIZ];
unsigned char data[5];
cd=&matcd_data[ldrive];
port=cd->iobase;
zero_cmd(cmd);
if (action==CDIOCSETVOL) { /*We are setting new volume settings*/
/* Here we set the volume levels. Note that the same command
also sets the patching (routing) of audio, so we have to rely
on previously-stored settings to fill in these fields.
*/
cmd[0]=MODESELECT; /*Write drive settings*/
cmd[1]=AUDIOPARM; /*Audio/routing settings*/
/* Although the drive allows a left and right channel volume to be
specified separately, the drive refuses the settings if the
values are different.
*/
c=level->vol[0] | level->vol[1]; /*Or them together*/
cmd[4]=cd->volume[0]=c; /*Channel 0 (Left) volume*/
cmd[6]=cd->volume[1]=c; /*Channel 1 (Right) volume*/
cmd[3]=cd->patch[0]; /*Channel 0 (Left) patching*/
cmd[5]=cd->patch[1]; /*Channel 1 (Right) patching*/
i=docmd(cmd,ldrive,cdrive,controller,port);/*Issue cmd*/
#ifdef DEBUGIOCTL
printf("matcd%d: Volume set %d\n",ldrive,i);
#endif /*DEBUGIOCTL*/
return(i);
} else { /*Read existing settings*/
/* This code reads the settings for the drive back - note that
volume and patching are both returned so we have to keep
both internally.
*/
cmd[0]=MODESENSE; /*Read drive settings*/
cmd[1]=AUDIOPARM; /*Audio/routing settings*/
lockbus(controller, ldrive); /*<16>Request bus*/
matcd_slowcmd(port,ldrive,cdrive,cmd);
i=waitforit(10*TICKRES,DTEN,port,"matlvl"); /*<25>*/
matcd_pread(port, 5, data); /*Read data returned*/
z=get_stat(port,ldrive);/*Read status byte*/
unlockbus(controller, ldrive); /*<16>Release bus*/
#ifdef DEBUGIOCTL
printf("matcd%d: Data got was %x %x %x %x %x ",ldrive,
data[0],data[1],data[2], data[3],data[4]);
printf("status byte %x\n",z);
#endif /*DEBUGIOCTL*/
cd->volume[0]=level->vol[0]= /*Channel 0 (Left) volume*/
data[2];
cd->volume[1]=level->vol[1]= /*Channel 1 (Right) volume*/
data[4];
level->vol[2]=level->vol[3]=0; /*Channel 2 & 3 not avail*/
cd->patch[0]=data[1]; /*Channel 0 (Left) patching*/
cd->patch[1]=data[3]; /*Channel 1 (Right) patching*/
return(0);
}
}
/*-----------------------------------------------------------------------------
matcd_routing - Set the audio routing (patching)
<12> New for Edit 12
-----------------------------------------------------------------------------*/
static int matcd_route(int ldrive, int cdrive, int controller,
unsigned long command)
{
struct matcd_data *cd;
int i,port;
unsigned char l,r;
unsigned char cmd[MAXCMDSIZ];
cd=&matcd_data[ldrive];
port=cd->iobase;
zero_cmd(cmd);
switch (command) {
case CDIOCSETMUTE:
l=r=0;
break;
case CDIOCSETLEFT:
l=r=OUTLEFT;
break;
case CDIOCSETRIGHT:
l=r=OUTRIGHT;
break;
default:
case CDIOCSETSTEREO:
l=OUTLEFT;
r=OUTRIGHT;
break;
}
/* Here we set the volume levels. Note that the same command
also sets the patching (routing) of audio, so we have to rely
on previously-stored settings to fill in these fields.
*/
cmd[0]=MODESELECT; /*Write drive settings*/
cmd[1]=AUDIOPARM; /*Audio/routing settings*/
/* Although the drive allows a left and right channel volume to be
specified separately, the drive refuses the settings if the
values are different.
*/
cmd[4]=cd->volume[0]; /*Channel 0 (Left) volume*/
cmd[6]=cd->volume[1]; /*Channel 1 (Right) volume*/
cmd[3]=cd->patch[0]=l; /*Channel 0 (Left) patching*/
cmd[5]=cd->patch[1]=r; /*Channel 1 (Right) patching*/
i=docmd(cmd,ldrive,cdrive,controller,port);/*Issue cmd*/
#ifdef DEBUGIOCTL
printf("matcd%d: Routing set %d\n",ldrive,i);
#endif /*DEBUGIOCTL*/
return(i);
}
/*-----------------------------------------------------------------------------
matcd_patch - Set the audio routing (patching)
<12> New for Edit 12
-----------------------------------------------------------------------------*/
static int matcd_patch(int ldrive, int cdrive, int controller,
struct ioc_patch * routing)
{
struct matcd_data *cd;
int i,port;
unsigned char cmd[MAXCMDSIZ];
cd=&matcd_data[ldrive];
port=cd->iobase;
zero_cmd(cmd);
/* Here we set the volume levels. Note that the same command
also sets the patching (routing) of audio, so we have to rely
on previously-stored settings to fill in these fields.
*/
cmd[0]=MODESELECT; /*Write drive settings*/
cmd[1]=AUDIOPARM; /*Audio/routing settings*/
/* Although the drive allows a left and right channel volume to be
specified separately, the drive refuses the settings if the
values are different.
*/
cmd[4]=cd->volume[0]; /*Channel 0 (Left) volume*/
cmd[6]=cd->volume[1]; /*Channel 1 (Right) volume*/
cmd[3]=cd->patch[0]= /*Channel 0 (Left) patching*/
(routing->patch[0] & 0x03);
cmd[5]=cd->patch[1]= /*Channel 1 (Right) patching*/
(routing->patch[1] & 0x03);
i=docmd(cmd,ldrive,cdrive,controller,port);/*Issue cmd*/
#ifdef DEBUGIOCTL
printf("matcd%d: Routing set %d\n",ldrive,i);
#endif /*DEBUGIOCTL*/
return(i);
}
/*-----------------------------------------------------------------------------
matcd_pitch - Change audio playback rate
Apart from making things sound funny, the only
other application might be Karaoke. Ugh.
<12> New for Edit 12
-----------------------------------------------------------------------------*/
static int matcd_pitch(int ldrive, int cdrive, int controller,
struct ioc_pitch * speed)
{
struct matcd_data *cd;
short i;
int z,port;
unsigned char cmd[MAXCMDSIZ];
cd=&matcd_data[ldrive];
port=cd->iobase;
zero_cmd(cmd);
/* This function sets the audio playback rate. In SCSI devices this is
referred to as the logical block addresses per second parameter.
Uh huh. Sounds like they didn't want anyone to find it.
Anyway, a study found that no one else has implemented this ioctl
but the capability does exist in the SCSI standard so I am following
the SCSI scheme even though it really doesn't fit this drive well.
I define the parameter to this ioctl as -32767 to -1 being
"play slower", 0x0000 flat and 1 to 32767 being "play faster"
within the scale allowed by the device. The value is scaled to fit
the allowed by the device and any excess is treated as being
the positive or negative limit. No ioctl input value is considered
invalid.
This device has a +/- 13% playback pitch specified by a range
-130 to +130. The drive does a hard enforcement on this.
SCSI defines a 16 bit LBAS count, and a "multiplier" that
is either x1 or x(1/256). The Matsushita drive only provides
10 bits total for indicating pitch so the LSbits are discarded.
*/
cmd[0]=MODESELECT; /*Write drive settings*/
cmd[1]=SPEEDPARM; /*Audio speed settings*/
i=speed->speed>>7; /*Scale down to our usable range*/
if (i!=0) { /*Real pitch value*/
if (i < -130) i=-130; /*Force into range we support*/
else if (i > 130) i=130;
cmd[3]=((i>>8)&0x03) | 0x04; /*Get upper bits*/
cmd[4]=(i & 0xff); /*Set lower bits*/
}
z=docmd(cmd,ldrive,cdrive,controller,port);/*Issue cmd*/
#ifdef DEBUGIOCTL
printf("matcd%d: Pitch set %d\n",ldrive,i);
#endif /*DEBUGIOCTL*/
return(z);
}
/*End of audio.c*/

View File

@ -1,142 +0,0 @@
/*creative.h-------------------------------------------------------------------
Matsushita(Panasonic) / Creative CD-ROM Driver (matcd)
Authored by Frank Durda IV
Copyright 1994, 1995 Frank Durda IV. All rights reserved.
"FDIV" is a trademark of Frank Durda IV.
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 positioned at the very beginning of this file without
modification, all copyright strings, all related programming
codes that display the copyright strings, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must contain all copyright strings
and related programming code that display the copyright strings.
3. 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.
4. All advertising materials mentioning features or use of this
software must display the following acknowledgement:
"The Matsushita/Panasonic CD-ROM driver was developed
by Frank Durda IV for use with "FreeBSD" and similar
operating systems."
"Similar operating systems" includes mainly non-profit oriented
systems for research and education, including but not restricted
to "NetBSD", "386BSD", and "Mach" (by CMU). The wording of the
acknowledgement (in electronic form or printed text) may not be
changed without permission from the author.
5. Absolutely no warranty of function, fitness or purpose is made
by the author Frank Durda IV.
6. Neither the name of the author nor the name "FreeBSD" may
be used to endorse or promote products derived from this software
without specific prior written permission.
(The author can be reached at bsdmail@nemesis.lonestar.org)
7. The product containing this software must meet all of these
conditions even if it is unsupported, not a complete system
and/or does not contain compiled code.
8. These conditions will be in force for the full life of the
copyright.
9. If all the above conditions are met, modifications to other
parts of this file may be freely made, although any person
or persons making changes do not receive the right to add their
name or names to the copyright strings and notices in this
software. Persons making changes are encouraged to insert edit
history in matcd.c and to put your name and details of the
change there.
10. You must have prior written permission from the author to
deviate from these terms.
Vendors who produce product(s) containing this code are encouraged
(but not required) to provide copies of the finished product(s) to
the author and to correspond with the author about development
activity relating to this code. Donations of development hardware
and/or software are also welcome. (This is one of the faster ways
to get a driver developed for a device.)
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.
-----No changes are allowed above this line------------------------------------
See matcd.c for Edit History
These are the I/O port mapping offsets and bit assignments used
by Creative Labs in their implementation of the host interface for
the Matsushita CD-ROM drive. These may be different in the adapter
cards (including sound cards) made by other vendors.
It is unknown if the Creative interface is based on a reference design
provided by Matsushita (other interface vendors would similar or
identical if this was the case).
The drive is actually capable of some things that the Creative
interface doesn't implement, such as DMA and interrupts.
See matcd.h for defines related to the Matsushita drive itself.
*/
/* Creative Labs (and compatible) I/O port mapping offsets
*/
#define NUMPORTS 4 /*Four ports are decoded by the i/f*/
#define CMD 0 /*Write - commands*/
#define DATA 0 /*Read - data/status from drive*/
#ifdef PC98
#define PHASE 0x100 /*Write - switch between data/status*/
#define STATUS 0x100 /*Read - bus status */
#define RESET 0x200 /*Write - reset all attached drives*/
#define ALTDATA 0x200 /*<20>Read - data on non Creative bds.*/
#define SELECT 0x300 /*Write - drive select*/
#else /* !PC98 */
#define PHASE 1 /*Write - switch between data/status*/
#define STATUS 1 /*Read - bus status*/
#define RESET 2 /*Write - reset all attached drives*/
/*Any value written will reset*/
#define ALTDATA 2 /*<20>Read - data on non Creative bds.*/
#define SELECT 3 /*Write - drive select*/
#endif /*PC98*/
/* Creative PHASE port bit assignments
*/
#define PHASENA 1 /*Access data bytes instead of status*/
/* Creative STATUS port register bits
*/
#define DTEN 2 /*When low, in data xfer phase*/
#define STEN 4 /*When low, in status phase*/
#define TEST 1 /*Function is unknown*/
/* Creative drive SELECT port bit assignments
Note that in the Creative interface, DS0==Bit 1 and
DS1==Bit 0 (DS is Drive Select).
*/
#define CRDRIVE0 0x00
#define CRDRIVE1 0x02
#define CRDRIVE2 0x01
#define CRDRIVE3 0x03
/*End of creative.h*/

File diff suppressed because it is too large Load Diff

View File

@ -1,198 +0,0 @@
/*matcd.h---------------------------------------------------------------------
Matsushita(Panasonic) / Creative CD-ROM Driver (matcd)
Authored by Frank Durda IV
Copyright 1994, 1995 Frank Durda IV. All rights reserved.
"FDIV" is a trademark of Frank Durda IV.
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 positioned at the very beginning of this file without
modification, all copyright strings, all related programming
codes that display the copyright strings, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must contain all copyright strings
and related programming code that display the copyright strings.
3. 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.
4. All advertising materials mentioning features or use of this
software must display the following acknowledgement:
"The Matsushita/Panasonic CD-ROM driver was developed
by Frank Durda IV for use with "FreeBSD" and similar
operating systems."
"Similar operating systems" includes mainly non-profit oriented
systems for research and education, including but not restricted
to "NetBSD", "386BSD", and "Mach" (by CMU). The wording of the
acknowledgement (in electronic form or printed text) may not be
changed without permission from the author.
5. Absolutely no warranty of function, fitness or purpose is made
by the author Frank Durda IV.
6. Neither the name of the author nor the name "FreeBSD" may
be used to endorse or promote products derived from this software
without specific prior written permission.
(The author can be reached at bsdmail@nemesis.lonestar.org)
7. The product containing this software must meet all of these
conditions even if it is unsupported, not a complete system
and/or does not contain compiled code.
8. These conditions will be in force for the full life of the
copyright.
9. If all the above conditions are met, modifications to other
parts of this file may be freely made, although any person
or persons making changes do not receive the right to add their
name or names to the copyright strings and notices in this
software. Persons making changes are encouraged to insert edit
history in matcd.c and to put your name and details of the
change there.
10. You must have prior written permission from the author to
deviate from these terms.
Vendors who produce product(s) containing this code are encouraged
(but not required) to provide copies of the finished product(s) to
the author and to correspond with the author about development
activity relating to this code. Donations of development hardware
and/or software are also welcome. (This is one of the faster ways
to get a driver developed for a device.)
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.
-----No changes are allowed above this line------------------------------------
See matcd.c for Edit History information.
Matsushita CR562/CR563 Commands
This is not a complete list - just the ones this version uses
*/
#define NOP 0x05 /*No action - just return status*/
#define DOOROPEN 0x06 /*Open tray*/
#define DOORCLOSE 0x07 /*Close tray*/
#define ABORT 0x08 /*Abort command*/
#define MODESELECT 0x09 /*Set drive parameters*/
#define LOCK 0x0c /*Prevent/Allow medium removal*/
#define PAUSE 0x0d /*Pause/Resume playback*/
#define PLAYBLOCKS 0x0e /*Play audio - block to block*/
#define PLAYTRKS 0x0f /*Play audio - tracks & index*/
#define READ 0x10 /*Read data*/
#define READERROR 0x82 /*Read Error*/
#define READID 0x83 /*Read Drive Type & Firmware Info*/
#define MODESENSE 0x84 /*<12>Report drive settings*/
#define READSUBQ 0x87 /*<14>Read Q channel information*/
#define READDINFO 0x8b /*<13>Read TOC tracks & drive size*/
#define READTOC 0x8c /*<13>Read entry from TOC*/
#define BLOCKPARAM 0x00 /*Used with MODESELECT command*/
#define SPEEDPARM 0x03 /*<12>Adjust audio playback speed*/
#define AUDIOPARM 0x05 /*<12>Set/read audio levels & routing*/
#define RESUME 0x80 /*Used with PAUSE command*/
#define MAXCMDSIZ 12 /*Max command size with NULL*/
/* Possible data transfers for MODESELECT + BLOCKPARAM */
#define MODE_DATA 0x00 /*2048, 2340*/
#define MODE_DA 0x82 /*2352*/
#define MODE_USER 0x01 /*2048, 2052, 2336, 2340, 2352*/
#define MODE_UNKNOWN 0xff /*Uninitialized state*/
/*<12>The following mode is not implemented in the driver at this time*/
#define MODE_XA 0x81 /*2048, 2060, 2324, 2336, 2340, 2352*/
#define DEFVOL 0xff /*<12>Default drive volume level, 100%
volume. Based on drive action.*/
#define OUTLEFT 0x01 /*Output on Left*/
#define OUTRIGHT 0x02 /*Output on Right*/
/* Matsushita CR562/CR563 Status bits*/
#define MATCD_ST_DOOROPEN 0x80 /*Door is open right now*/
#define MATCD_ST_DSKIN 0x40 /*Disc in drive*/
#define MATCD_ST_SPIN 0x20 /*Disc is spinning*/
#define MATCD_ST_ERROR 0x10 /*Error on command*/
#define MATCD_ST_AUDIOBSY 0x08 /*Drive is playing audio*/
#define MATCD_ST_LOCK 0x04 /*<14>Drive is locked*/
#define MATCD_ST_X2 0x02 /*<14>Media is at double-speed*/
#define MATCD_ST_READY 0x01 /*<14>Drive is ready*/
#define MATCDAUDIOBSY MATCD_ST_AUDIOBSY
#define MATCDDSKCHNG MATCD_ST_DSKCHNG
#define MATCDDSKIN MATCD_ST_DSKIN
#define MATCDDOOROPEN MATCD_ST_DOOROPEN
/* Error codes returned from READERROR command.*/
#define NO_ERROR 0x00
#define RECV_RETRY 0x01
#define RECV_ECC 0x02
#define NOT_READY 0x03
#define TOC_ERROR 0x04
#define UNRECV_ERROR 0x05
#define SEEK_ERROR 0x06
#define TRACK_ERROR 0x07
#define RAM_ERROR 0x08
#define DIAG_ERROR 0x09
#define FOCUS_ERROR 0x0a
#define CLV_ERROR 0x0b
#define DATA_ERROR 0x0c
#define ADDRESS_ERROR 0x0d
#define CDB_ERROR 0x0e
#define END_ADDRESS 0x0f
#define MODE_ERROR 0x10
#define MEDIA_CHANGED 0x11
#define HARD_RESET 0x12
#define ROM_ERROR 0x13
#define CMD_ERROR 0x14
#define DISC_OUT 0x15
#define HARD_ERROR 0x16
#define ILLEGAL_REQ 0x17
/* Human-readable error messages - what a concept!*/
static unsigned char * matcderrors[]={"No error", /* 00 */
"Soft read error after retry", /* 01 */
"Soft read error after error-correction", /* 02 */
"Not ready", /* 03 */
"Unable to read TOC", /* 04 */
"Hard read error of data track",/* 05 */
"Seek did not complete", /* 06 */
"Tracking servo failure", /* 07 */
"Drive RAM failure", /* 08 */
"Drive self-test failed", /* 09 */
"Focusing servo failure", /* 0a */
"Spindle servo failure", /* 0b */
"Data path failure", /* 0c */
"Illegal logical block address",/* 0d */
"Illegal field in CDB", /* 0e */
"End of user encountered on this track", /* 0f */
"Illegal data mode for this track", /* 10 */
"Media changed", /* 11 */
"Power-on or drive reset occurred", /* 12 */
"Drive ROM failure", /* 13 */
"Illegal drive command received from host",/* 14 */
"Disc removed during operation",/* 15 */
"Drive Hardware error", /* 16 */
"Illegal request from host"}; /* 17 */
/*End of matcd.h*/

View File

@ -1,283 +0,0 @@
/*options.h--------------------------------------------------------------------
Matsushita(Panasonic) / Creative CD-ROM Driver (matcd)
Authored by Frank Durda IV
Copyright 1994, 1995 Frank Durda IV. All rights reserved.
"FDIV" is a trademark of Frank Durda IV.
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 positioned at the very beginning of this file without
modification, all copyright strings, all related programming
codes that display the copyright strings, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must contain all copyright strings
and related programming code that display the copyright strings.
3. 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.
4. All advertising materials mentioning features or use of this
software must display the following acknowledgement:
"The Matsushita/Panasonic CD-ROM driver was developed
by Frank Durda IV for use with "FreeBSD" and similar
operating systems."
"Similar operating systems" includes mainly non-profit oriented
systems for research and education, including but not restricted
to "NetBSD", "386BSD", and "Mach" (by CMU). The wording of the
acknowledgement (in electronic form or printed text) may not be
changed without permission from the author.
5. Absolutely no warranty of function, fitness or purpose is made
by the author Frank Durda IV.
6. Neither the name of the author nor the name "FreeBSD" may
be used to endorse or promote products derived from this software
without specific prior written permission.
(The author can be reached at bsdmail@nemesis.lonestar.org)
7. The product containing this software must meet all of these
conditions even if it is unsupported, not a complete system
and/or does not contain compiled code.
8. These conditions will be in force for the full life of the
copyright.
9. If all the above conditions are met, modifications to other
parts of this file may be freely made, although any person
or persons making changes do not receive the right to add their
name or names to the copyright strings and notices in this
software. Persons making changes are encouraged to insert edit
history in matcd.c and to put your name and details of the
change there.
10. You must have prior written permission from the author to
deviate from these terms.
Vendors who produce product(s) containing this code are encouraged
(but not required) to provide copies of the finished product(s) to
the author and to correspond with the author about development
activity relating to this code. Donations of development hardware
and/or software are also welcome. (This is one of the faster ways
to get a driver developed for a device.)
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.
-----No changes are allowed above this line------------------------------------
-----------------------------------------------------------------------------
Conditional compilation flags - change to suit your system
---------------------------------------------------------------------------*/
/* AUTOHUNT Adds extra code that allows the driver to search
for interface cards rather than having to hard-code
the locations in the kernel conf file.
Leaving AUTOHUNT enabled is the recommended setting.
*/
#define AUTOHUNT
/* NUMCTRLRS Configures support for between one and four
host interfaces, for up to 16 drives.
The number of entries in the kernel config
file is used by default, but this may be changed
to a specific value if desired.
Leaving NUMCTRLRS based on NMATCD is the
recommended setting.
*/
#if NMATCD >= 4
#define NUMCTRLRS 4 /*Limit driver to four host interfaces*/
#else /*NMATCD*/
#define NUMCTRLRS NMATCD
#endif /*NMATCD*/
/* FULLDRIVER If not set, the audio, non-data functions and
some error recovery functions are eliminated from
the compiled driver. The resulting driver will be
smaller and may help a kernel fit on a boot floppy.
Leaving FULLDRIVER enabled is the recommended setting.
*/
#ifndef BOOTMFS
#define FULLDRIVER
#endif /*BOOTMFS*/
/* RESETONBOOT causes the driver to reset the drive(s) to be
reset during probing. This causes any audio
playback to be aborted and the drives will close
their trays if they are open.
Leaving RESETONBOOT enabled is the recommended setting.
*/
#define RESETONBOOT
/*<15> LOCKDRIVE If enabled, when a drive is opened using a
<15> minor number greater than 127, the drive door is
<15> locked. The drive door remains locked until all
<23> partitions on the drive are closed. The EJECT,
<23> ALLOW and PREVENT ioctls are refused when this locking
<23> mechanism is active.
<15> The additional code size is small so enabling
<15> LOCKDRIVE is the recommended setting.
*/
#define LOCKDRIVE
/*<14> KRYTEN This enables a bug that someone might consider
<14> to be a feature. If KRYTEN is enabled and you are
<14> playing audio and you issue the resume-play ioctl,
<14> the audio will stutter, playing the same quarter
<14> of a second or so of audio several times before
<14> resuming normally. Resuming from a pause acts
<14> normally regardless of the setting of this flag.
<14> Leaving KRYTEN disabled is the recommended setting.
<14>*/
/*#define KRYTEN*/
/*---------------------------------------------------------------------------
This structure contains the hints for where we should look for the
host adapter. If you want to change where we search or reduce the
places we search to avoid confusing some other device, either
specify explicit addresses in the kernel config file (preferred)
or change this array.
If the kernel config file has multiple ? entries, the probe routines
will use this table multiple times and will eliminate each failed
entry that probe tries.
WARNING: The number of controller entries for this driver in config
must be less than or equal to the number of hints if hints are used.
If you add entries to the table, add them immediately before
the -1 end-of-table marker. The values already present are
the ones used by Creative Labs boards and those of a few
other vendors.
Each additional entry increases the boot time by four seconds,
and can increase the chance of accessing some other device.
Therefore, the list should be kept to a minimum. Once the
devices have been correctly located, the kernel should be
configured so that it looks only at the correct location from
that point on.
Be sure to search devices located below 0x3ff BEFORE scanning
higher locations. Some boards don't decode all I/O address lines,
so 0x230 and 0x630 appear identical.
---------------------------------------------------------------------------*/
#ifdef AUTOHUNT
static int port_hints[]={
#ifdef PC98
0x30d2,
0x30d0,
0x30d4,
0x30d6,
0x30d8,
0x30da,
0x30dc,
0x30de,
#else /* IBM-PC */
0x230, /*SB Pro & SB16*/
0x240, /*SB Pro & SB16*/
0x250, /*Creative omniCD standalone boards*/
0x260, /*Creative omniCD standalone boards*/
0x340, /*Laser Mate*/
0x360, /*Laser Mate*/
0x630, /*IBM*/
#if 0
/* These locations are alternate settings for LaserMate and IBM
boards, but they usually conflict with network and SCSI cards.
I recommend against probing these randomly.
*/
0x310, /*Laser Mate*/
0x320, /*Laser Mate*/
0x330, /*Laser Mate*/
0x350, /*Laser Mate*/
0x370, /*Laser Mate*/
0x650, /*IBM*/
0x670, /*IBM*/
0x690, /*IBM*/
#endif /*0*/
#endif /* PC98 */
-1}; /*use. Table MUST end with -1*/
#endif /*AUTOHUNT*/
/*---------------------------------------------------------------------------
Debugging flags - Turn these on only if you are looking at a
problem.
---------------------------------------------------------------------------*/
/* DEBUGOPEN If enabled, debug messages for open and close
operations.
*/
/*#define DEBUGOPEN*/
/* DEBUGIO If enabled, reports on calls to strategy, start
and other I/O related functions.
*/
/*#define DEBUGIO*/
/* DEBUGQUEUE If enabled, shows activity on disk request queues.
Warning - This debug is VERY VERY NOISY and will
loop endlessly if queues are not null terminated
as they should be.
*/
/*#define DEBUGQUEUE*/
/* DEBUGCMD If enabled, shows the actual commands being issued
to the CD-ROM drives.
*/
/*#define DEBUGCMD*/
/* DEBUGSLEEP If enabled, reports on timeouts, wakeups, dropped
threads, etc.
*/
/*#define DEBUGSLEEP*/
/* DEBUGIOCTL If enabled, reports on the various ioctl-related
calls and operations. You might have to enable
DEBUGCMD as well to get enough debugging information.
*/
/*#define DEBUGIOCTL*/
/* DEBUGPROBE If enabled, reports on the process of locating
adapters and drives. The debugging in matcdprobe()
and matcdattach() routines is enabled with this
flag.
*/
/*#define DEBUGPROBE*/
/*End of options.h*/