Commit 001e3f20 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.55

parent 81e6c66d
...@@ -543,7 +543,7 @@ D: The Linux Support Team Erlangen ...@@ -543,7 +543,7 @@ D: The Linux Support Team Erlangen
N: Markus Kuhn N: Markus Kuhn
E: mskuhn@cip.informatik.uni-erlangen.de E: mskuhn@cip.informatik.uni-erlangen.de
W: http://wwwcip.informatik.uni-erlangen.de/user/mskuhn W: http://wwwcip.informatik.uni-erlangen.de/user/mskuhn
D: Unicode, time, standards D: Unicode, real-time, time, standards
S: Schlehenweg 9 S: Schlehenweg 9
S: D-91080 Uttenreuth S: D-91080 Uttenreuth
S: Germany S: Germany
...@@ -902,10 +902,10 @@ D: several improvements to system programs ...@@ -902,10 +902,10 @@ D: several improvements to system programs
S: Oldenburg, Germany S: Oldenburg, Germany
N: Darren Senn N: Darren Senn
E: sinster@scintilla.santa-clara.ca.us E: sinster@darkwater.com
D: Whatever I notice needs doing (so far: itimers, /proc) D: Whatever I notice needs doing (so far: itimers, /proc)
S: 620 Park View Drive #206 S: POB 64132
S: Santa Clara, California 95054 S: Sunnyvale, CA 94088-4132
S: USA S: USA
N: Rick Sladkey N: Rick Sladkey
......
# LAST EDIT: Thu Nov 30 22:39:07 1995 by Axel Boldt (boldt@math.ucsb.edu) # Maintained by Axel Boldt (boldt@math.ucsb.edu)
# #
# This version of the Linux kernel configuration help texts # This version of the Linux kernel configuration help texts
# corresponds to the kernel versions 1.3.x. Be aware that these # corresponds to the kernel versions 1.3.x. Be aware that these
...@@ -1685,151 +1685,115 @@ CONFIG_CD_NO_IDESCSI ...@@ -1685,151 +1685,115 @@ CONFIG_CD_NO_IDESCSI
will just cause this configure script to skip all the questions will just cause this configure script to skip all the questions
about these CDROM drives. If you are unsure what you have, say Y and about these CDROM drives. If you are unsure what you have, say Y and
find out whether you have one of the following drives. find out whether you have one of the following drives.
For each of these drivers, a file Documentation/cdrom/<driver_name>
exists. Especially in cases where you do not know exactly which kind
of drive you have you should read there.
Most of these drivers use a file include/linux/<driver_name>.h where
you can define your interface parameters and switch some internal
goodies.
All these CDROM drivers are also usable as a module (= code which can
be inserted in and removed from the running kernel whenever you want).
If you want to compile them as module, say M instead of Y and read
Documentation/modules.txt.
If you want to use any of these CDROM drivers, you also have to say
Y to "ISO9660 cdrom filesystem support" below (this answer will get
"defaulted" for you if you enable any of the Linux CDROM drivers).
Sony CDU31A/CDU33A CDROM driver support Sony CDU31A/CDU33A CDROM support
CONFIG_CDU31A CONFIG_CDU31A
These CDROM drives have a spring-pop-out caddyless drawer, and a These CDROM drives have a spring-pop-out caddyless drawer, and a
rectangular green LED centered beneath it. If you have one of these, rectangular green LED centered beneath it.
say Y here and also to "ISO9660 cdrom filesystem support" NOTE: these CDROM drives will not be auto detected by the kernel at
below. Read the CDROM-HOWTO, available via ftp (user: anonymous) boot time; you have to provide the interface address as an option to
from sunsite.unc.edu:/pub/Linux/docs/HOWTO. Also, read the kernel as described in Documentation/cdrom/cdu31a or fill in your
Documentation/cdrom/cdu31a. NOTE: this CDROM drive won't be parameters into linux/drivers/cdrom/cdu31a.c. See the documentation
auto detected by the kernel at boot time; you have to provide its of your boot loader (lilo or loadlin) about how to pass options to
specifications as an option to the kernel as described in the above the kernel. The lilo procedure is also explained in the SCSI-HOWTO.
README. See the documentation of your boot loader (lilo or loadlin)
about how to pass options to the kernel. The lilo procedure is also
explained in the SCSI-HOWTO. This driver is also available as a
module ( = code which can be inserted in and removed from the
running kernel whenever you want). If you want to compile it as a
module, say M here and read Documentation/modules.txt. If unsure,
say N.
Standard Mitsumi [no XA/Multisession] CDROM support Standard Mitsumi [no XA/Multisession] CDROM support
CONFIG_MCD CONFIG_MCD
This is a very common CDROM drive. In some models, the whole drive This is the older of the two drivers for the older Mitsumi models
chassis slides out for cd insertion. Later models use a motorized LU-005, FX-001 and FX-001D. This is not the right driver for the
tray type mechanism. If you have one of these CDROM drives, say Y FX-001DE and the triple or quad speed models (all these are IDE/ATAPI
here and also to "ISO9660 cdrom filesystem support" below. Read the, models).
available via ftp (user: anonymous) CDROM-HOWTO from With the old LU-005 model, the whole drive chassis slides out for
sunsite.unc.edu:/pub/Linux/docs/HOWTO. Note that this driver does cd insertion. The FX-xxx models use a motorized tray type mechanism.
not support XA or MultiSession CDs (PhotoCDs). There's a new Note that this driver does not support XA or MultiSession CDs (PhotoCDs).
experimental driver in the 1.3 kernels that can do this, but cannot There is a new driver (next question) which can do this. If you want
play your music CDs. If you want that one, say N here. If the driver that one, say N here.
doesn't work out of the box, you might want to have a look at If the driver doesn't work out of the box, you might want to have
linux/include/linux/mcd.h. If your Mitsumi CDROM drive is of type a look at linux/include/linux/mcd.h.
IDE/ATAPI, then you have to say N here and should have said Y to
"Support for IDE/ATAPI CDROMs" above. This driver is also available Mitsumi [XA/MultiSession] support
as a module ( = code which can be inserted in and removed from the
running kernel whenever you want). If you want to compile it as a
module, say M here and read Documentation/modules.txt. If unsure,
say N now.
Experimental Mitsumi [XA/MultiSession, no Audio] support
CONFIG_MCDX CONFIG_MCDX
Use this driver if you want to be able to read XA or MultiSession Use this driver if you want to be able to read XA or MultiSession
CDs (PhotoCDs) as well as ordinary CDs with your Mitsumi CDROM CDs (PhotoCDs) as well as ordinary CDs with your Mitsumi LU-005,
drive. In addition, this driver uses much less kernel memory than FX-001 or FX-001D CDROM drive. In addition, this driver uses much less
the old one, if that is a concern. However, you won't be able to kernel memory than the old one, if that is a concern. This driver is
play audio CDs. If you have two Mitsumi CDROM drives, you can use able to support more than one drive, but each drive needs a separate
the old driver for one and the new for the other; interface card.
Documentation/cdrom/mcdx explains how. If you want to compile this
as a module ( = code which can be inserted in and removed from the
running kernel whenever you want), say M here and read
Documentation/modules.txt.
Matsushita/Panasonic CDROM driver support Matsushita/Panasonic/Creative, Longshine, TEAC CDROM support
CONFIG_SBPCD CONFIG_SBPCD
The Creative Labs Soundblaster CD drives as well as Longshine and This driver supports most of the drives which use the Panasonic or
IBM External ISA also fall under this category. It has a uniquely SoundBlaster interface.
shaped faceplate, with a caddyless motorized drawer which makes it The Matsushita CR-521, CR-522, CR-523, CR-562, CR-563 drives (sometimes
recognizable, but has no external brand markings. Some Soundblaster labelled "Creative"), the CreativeLabs CD200, the Longshine LCS-7260,
drives have a caddy and manual loading/eject, but still no external the "IBM External ISA CDROM" (in fact a CR-56x model), the TEAC CD-55A
markings. If you have one of these, say Y here and also to "ISO9660 fall under this category. Some other "electrically compatible" drives
cdrom filesystem support" below. This driver can support up to four (Vertos, Genoa, some Funai models) are currently not supported; for the
CDROM controllers, each of which can support up to four CDROM Sanyo H94A drive currently a separate driver (asked later) is responsible.
drives; you will be asked how many controllers you have. Read Most drives have a uniquely shaped faceplate, with a caddyless motorized
Documentation/cdrom/sbpcd and include/linux/sbpcd.h in the kernel drawer, but without external brand markings. The older CR-52x drives have
source and the CDROM-HOWTO, available via ftp (user: anonymous) from a caddy and manual loading/eject, but still no external markings.
sunsite.unc.edu:/pub/Linux/docs/HOWTO. If unsure, say N. If you The driver is able to do an extended auto-probing for interface addresses
want to compile this as a module ( = code which can be inserted in and drive types; this can help to find facts in cases you are not sure,
and removed from the running kernel whenever you want), say M here but can consume some time during the boot process if none of the supported
and read Documentation/modules.txt. drives gets found.
Once your drive got found, you should enter the reported parameters into
Matsushita/Panasonic second CDROM controller support linux/include/linux/sbpcd.h and set "DISTRIBUTION 0" there.
This driver can support up to four CDROM interface cards, and each card
can support up to four CDROM drives; if you say Y here, you will be asked
how many controllers you have. If compiled as a module, only one interface
card (but with up to four drives) is usable.
Matsushita/Panasonic, ... second CDROM controller support
CONFIG_SBPCD2 CONFIG_SBPCD2
If you have two CDROM drives of this type that you want to use Say Y here only if you have two CDROM controller boards of this type
simultaneously under Linux, say Y here, otherwise N. (usually only if you have more than four drives). You should enter
the parameters for the second, third and fourth interface card into
linux/include/linux/sbpcd.h before compiling the new kernel.
Aztech/Orchid/Okano/Wearnes (non IDE) CDROM support Aztech/Orchid/Okano/Wearnes/TXC (non IDE) CDROM support
CONFIG_AZTCD CONFIG_AZTCD
If you have a CDA268-01A, ORCHID CD-3110, OKANO/WEARNES CDD110 or This is your driver if you have an Aztech CDA268-01A, Orchid CD-3110,
Conrad TXC CDROM drive, say Y here and also to "ISO9660 cdrom Okano or Wearnes CDD110 or a Conrad TXC CDROM drive.
filesystem support" below. This is NOT for CDROM drives with IDE This driver - just like all these CDROM drivers - is NOT for CDROM
interface, such as Aztech CDA269-031SE. (If you have one of those, drives with IDE/ATAPI interface, such as Aztech CDA269-031SE.
you should have said Y to the new IDE driver above.) You want to
read Documentation/cdrom/aztcd and include/linux/aztcd.h in the
kernel source and the CDROM-HOWTO, available via ftp (user:
anonymous) from sunsite.unc.edu:/pub/Linux/docs/HOWTO. If unsure,
say N. If you want to compile this as a module ( = code which can
be inserted in and removed from the running kernel whenever you
want), say M here and read Documentation/modules.txt.
Sony CDU535 CDROM driver support Sony CDU535 CDROM support
CONFIG_CDU535 CONFIG_CDU535
If you have a CDU-535 or CDU-531 CDROM drive (this is one of the This is the driver for the older Sony CDU-535 and CDU-531 CDROM drives.
older Sony drives with its own interface card), say Y here and also
to "ISO9660 cdrom filesystem support" below. You want to read
Documentation/cdrom/sonycd535 in the kernel source and the
CDROM-HOWTO, available via ftp (user: anonymous) from
sunsite.unc.edu:/pub/Linux/docs/HOWTO. If unsure, say N. If you
want to compile this as a module ( = code which can be inserted in
and removed from the running kernel whenever you want), say M here
and read Documentation/modules.txt.
Goldstar R420 CDROM support Goldstar R420 CDROM support
CONFIG_GSCD CONFIG_GSCD
If this is your CDROM drive, say Y here and also to "ISO9660 cdrom If this is your CDROM drive, say Y here.
filesystem support" below. You want to read Documentation/cdrom/gscd As described in linux/Documentation/cdrom/gscd, you might have to
in the kernel source and the CDROM-HOWTO, available via ftp (user: change a setting in the file include/linux/gscd.h before compiling
anonymous) from sunsite.unc.edu:/pub/Linux/docs/HOWTO. As described the kernel.
in the file gscd, you might have to change a setting in the file
include/linux/gscd.h before compiling the kernel. If unsure, say N.
If you want to compile this as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
say M here and read Documentation/modules.txt.
Philips/LMS CM206 CDROM support Philips/LMS CM206 CDROM support
CONFIG_CM206 CONFIG_CM206
If you have a Philips/LMS CDROM drive cm206 in combination with a If you have a Philips/LMS CDROM drive cm206 in combination with a
cm260 host adapter card, say Y here and also to "ISO9660 cdrom cm260 host adapter card, say Y here.
filesystem support" below. You want to read
Documentation/cdrom/cm206 in the kernel source and the CDROM-HOWTO,
available via ftp (user: anonymous) from
sunsite.unc.edu:/pub/Linux/docs/HOWTO. If unsure, say N. If you
want to compile this as a module ( = code which can be inserted in
and removed from the running kernel whenever you want), say M here
and read Documentation/modules.txt.
Experimental Optics Storage DOLPHIN 8000AT CDROM support Optics Storage DOLPHIN 8000AT CDROM support
CONFIG_OPTCD CONFIG_OPTCD
If this is your CDROM drive, say Y here and also to "ISO9660 cdrom If this is your CDROM drive, say Y here.
filesystem support" below. You want to read
Documentation/cdrom/optcd in the kernel source and the CDROM-HOWTO,
available via ftp (user: anonymous) from
sunsite.unc.edu:/pub/Linux/docs/HOWTO. If unsure, say N. If you
want to compile this as a module ( = code which can be inserted in
and removed from the running kernel whenever you want), say M here
and read Documentation/modules.txt.
Experimental Sanyo H94A CDROM support Sanyo H94A CDROM support
CONFIG_SJCD CONFIG_SJCD
If this is your CDROM drive, say Y here and also to "ISO9660 cdrom If this is your CDROM drive, say Y here.
filesystem support" below. You want to read
Documentation/cdrom/sjcd in the kernel source (this file includes
information about how to make the driver work together with an ISP16
soundcard) and the CDROM-HOWTO,
available via ftp (user: anonymous) from
sunsite.unc.edu:/pub/Linux/docs/HOWTO. If unsure, say N.
Standard (minix) fs support Standard (minix) fs support
CONFIG_MINIX_FS CONFIG_MINIX_FS
......
This README belongs to release 3.9 or newer of the SoundBlaster Pro This README belongs to release 4.1 or newer of the SoundBlaster Pro
(Matsushita, Kotobuki, Panasonic, CreativeLabs, Longshine and TEAC) (Matsushita, Kotobuki, Panasonic, CreativeLabs, Longshine and TEAC)
CD-ROM driver for Linux. CD-ROM driver for Linux.
...@@ -28,6 +28,9 @@ CR-574 is an IDE/ATAPI drive. ...@@ -28,6 +28,9 @@ CR-574 is an IDE/ATAPI drive.
The Longshine LCS-7260 is a double-speed drive which uses the "old" The Longshine LCS-7260 is a double-speed drive which uses the "old"
Matsushita command set. It is supported - with help by Serge Robyns. Matsushita command set. It is supported - with help by Serge Robyns.
Vertos ("Elitegroup Computer Systems", ECS) has a similar drive - support
has started; come in contact if you have such a "Vertos 100" or "ECS-AT"
drive.
There exists an "IBM External ISA CD-ROM Drive" which in fact is a CR-563 There exists an "IBM External ISA CD-ROM Drive" which in fact is a CR-563
with a special controller board. This drive is supported (the interface is with a special controller board. This drive is supported (the interface is
...@@ -36,10 +39,12 @@ an internal drive, and you can use it as an internal, too - f.e. plug it into ...@@ -36,10 +39,12 @@ an internal drive, and you can use it as an internal, too - f.e. plug it into
a soundcard). a soundcard).
CreativeLabs has a new drive "CD200" and a similar drive "CD200F". The latter CreativeLabs has a new drive "CD200" and a similar drive "CD200F". The latter
is made by Funai and sometimes named "E2550UA". Support is under construction is made by Funai and sometimes named "E2550UA", newer models may be named
- CD200F should work, CD200 is still giving problems. "MK4015". The CD200F drives should fully work.
Drive detection and playing audio should work. I need qualified feedback CD200 drives without "F" are still giving problems: drive detection and
about the bugs within the data functions or a drive (I never saw a CD200). playing audio should work, data access will result in errors. I need qualified
feedback about the bugs within the data functions or a drive (I never saw a
CD200).
The quad-speed TEAC CD-55A drive is supported, but still does not reach "full The quad-speed TEAC CD-55A drive is supported, but still does not reach "full
speed". The data rate already reaches 500 kB/sec if you set SBP_BUFFER_FRAMES speed". The data rate already reaches 500 kB/sec if you set SBP_BUFFER_FRAMES
...@@ -63,21 +68,21 @@ the IDE/ATAPI user questions disappear). ...@@ -63,21 +68,21 @@ the IDE/ATAPI user questions disappear).
This driver will work with the soundcard interfaces (SB Pro, SB 16, Galaxy, This driver will work with the soundcard interfaces (SB Pro, SB 16, Galaxy,
SoundFX, Mozart, ...) and with the "no-sound" cards (Panasonic CI-101P, SoundFX, Mozart, MAD16 ...) and with the "no-sound" cards (Panasonic CI-101P,
LaserMate, WDH-7001C, Longshine LCS-6853, TEAC ...). LaserMate, WDH-7001C, Longshine LCS-6853, TEAC ...).
It finally works now with the "configurable" interface "Sequoia S-1000", too, It works with the "configurable" interface "Sequoia S-1000", too, which is
which is found on the Spea Media FX and Ensonic Soundscape sound cards. You used on the Spea Media FX and Ensonic Soundscape sound cards. You have to
have to specify the type "SBPRO 2" and the true CDROM port address with it, specify the type "SBPRO 2" and the true CDROM port address with it, not the
not the "configuration port" address. "configuration port" address.
If you have a sound card which needs a "configuration driver" instead of If you have a sound card which needs a "configuration driver" instead of
jumpers for interface types and addresses (like Mozart cards) - those jumpers for interface types and addresses (like Mozart cards) - those
drivers get invoked before the DOS CDROM driver in your CONFIG.SYS, typical drivers get invoked before the DOS CDROM driver in your CONFIG.SYS, typical
names are "cdsetup.sys" and "mztinit.sys" -, let the sound driver do the names are "cdsetup.sys" and "mztinit.sys" -, let the sound driver do the
CDROM port configuration (the leading comments within CDROM port configuration (the leading comments in linux/drivers/sound/mad16.c
linux/drivers/sound/mad16.c are just for you!). Hannu Savolainen's mad16.c are just for you!). Hannu Savolainen's mad16.c code is able to set up my
code is able to set up my Mozart card - I simply had to add Mozart card - I simply had to add
#define MAD16_CONF 0x06 #define MAD16_CONF 0x06
#define MAD16_CDSEL 0x03 #define MAD16_CDSEL 0x03
to configure the CDROM interface for type "Panasonic" (LaserMate) and address to configure the CDROM interface for type "Panasonic" (LaserMate) and address
...@@ -133,8 +138,11 @@ different address and a second cable. ...@@ -133,8 +138,11 @@ different address and a second cable.
The driver supports reading of data from the CD and playing of audio tracks. The driver supports reading of data from the CD and playing of audio tracks.
The audio part should run with WorkMan, xcdplayer, with the "non-X11" products The audio part should run with WorkMan, xcdplayer, with the "non-X11" products
CDplayer and WorkBone - tell me if it is not compatible with other software. CDplayer and WorkBone - tell me if it is not compatible with other software.
The only accepted measure for correctness with the audio functions is the
"cdtester" utility (appended) - most audio player programmers seem to be
better musicians than programmers. ;-)
With the CR-562 and CR-563 drives, the reading of audio frames is possible. With the CR-56x and the CD200 drives, the reading of audio frames is possible.
This is implemented by an IOCTL function which reads READ_AUDIO frames of This is implemented by an IOCTL function which reads READ_AUDIO frames of
2352 bytes at once (configurable with the "READ_AUDIO" define, default is 0). 2352 bytes at once (configurable with the "READ_AUDIO" define, default is 0).
Reading the same frame a second time gives different data; the frame data Reading the same frame a second time gives different data; the frame data
...@@ -163,8 +171,8 @@ XA (PhotoCD) disks with "old" drives give only 50 kB/sec. ...@@ -163,8 +171,8 @@ XA (PhotoCD) disks with "old" drives give only 50 kB/sec.
This release consists of This release consists of
- this README file - this README file
- the driver file linux/drivers/block/sbpcd.c - the driver file linux/drivers/cdrom/sbpcd.c
- the stub files linux/drivers/block/sbpcd[234].c - the stub files linux/drivers/cdrom/sbpcd[234].c
- the header file linux/include/linux/sbpcd.h. - the header file linux/include/linux/sbpcd.h.
...@@ -185,9 +193,9 @@ To install: ...@@ -185,9 +193,9 @@ To install:
Most "compatible" sound cards (almost all "non-CreativeLabs" cards) Most "compatible" sound cards (almost all "non-CreativeLabs" cards)
need "SBPRO 0". need "SBPRO 0".
The "no-sound" board from OmniCd needs the "SBPRO 1" setup. The "no-sound" board from OmniCd needs the "SBPRO 1" setup.
All other "no-sound" boards need the "SBPRO 0" setup.
Possibly some TEAC "no-sound" boards need the "SBPRO 1" setup. Possibly some TEAC "no-sound" boards need the "SBPRO 1" setup.
The Spea Media FX sound card needs "SBPRO 2". All other "no-sound" boards need the "SBPRO 0" setup.
The Spea Media FX and Ensoniq SoundScape cards need "SBPRO 2".
sbpcd.c holds some examples in its auto-probe list. sbpcd.c holds some examples in its auto-probe list.
If you configure "SBPRO" wrong, the playing of audio CDs will work, If you configure "SBPRO" wrong, the playing of audio CDs will work,
but you will not be able to mount a data CD. but you will not be able to mount a data CD.
...@@ -200,10 +208,10 @@ To install: ...@@ -200,10 +208,10 @@ To install:
or or
sbpcd=0x320,LaserMate sbpcd=0x320,LaserMate
or or
sbpcd=0x330,SPEA sbpcd=0x338,SoundScape
This is especially useful if you install a fresh distribution. This is especially useful if you install a fresh distribution.
If the second parameter is a number, it gets taken as the type If the second parameter is a number, it gets taken as the type
setting; 0 is "LaserMate", 1 is "SoundBlaster". setting; 0 is "LaserMate", 1 is "SoundBlaster", 2 is "SoundScape".
So, for example So, for example
sbpcd=0x230,1 sbpcd=0x230,1
is equivalent to is equivalent to
...@@ -257,7 +265,7 @@ Using sbpcd as a "loadable module": ...@@ -257,7 +265,7 @@ Using sbpcd as a "loadable module":
If you do NOT select "Matsushita/Panasonic CDROM driver support" during the If you do NOT select "Matsushita/Panasonic CDROM driver support" during the
"make config" of your kernel, you can build the "loadable module" sbpcd.o. "make config" of your kernel, you can build the "loadable module" sbpcd.o.
Read /usr/src/linux/README.modules on this. Read /usr/src/linux/Documentation/modules.txt on this.
If sbpcd gets used as a module, the support of more than one interface If sbpcd gets used as a module, the support of more than one interface
card (i.e. drives 4...15) is disabled. card (i.e. drives 4...15) is disabled.
...@@ -266,6 +274,8 @@ You can specify interface address and type with the "insmod" command like: ...@@ -266,6 +274,8 @@ You can specify interface address and type with the "insmod" command like:
# insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x340,0 # insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x340,0
or or
# insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x230,1 # insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x230,1
or
# insmod /usr/src/linux/modules/sbpcd.o sbpcd=0x338,2
where the last number represents the SBPRO setting (no strings allowed here). where the last number represents the SBPRO setting (no strings allowed here).
...@@ -281,7 +291,7 @@ No DMA and no IRQ is used. ...@@ -281,7 +291,7 @@ No DMA and no IRQ is used.
To reduce or increase the amount of kernel messages, edit sbpcd.c and play To reduce or increase the amount of kernel messages, edit sbpcd.c and play
with the "DBG_xxx" switches (initialization of the variable "sbpcd_debug"). with the "DBG_xxx" switches (initialization of the variable "sbpcd_debug").
Don't forget to reflect what you do; enabling all DBG_xxx switches at once Don't forget to reflect what you do; enabling all DBG_xxx switches at once
may crash your system. may crash your system, and each message line is accompanied by a delay.
The driver uses the "variable BLOCK_SIZE" feature. To use it, you have to The driver uses the "variable BLOCK_SIZE" feature. To use it, you have to
specify "block=2048" as a mount option. Doing this will disable the direct specify "block=2048" as a mount option. Doing this will disable the direct
...@@ -518,9 +528,7 @@ drives are mostly telling there is no UPC/EAN code on disk or there is, but it ...@@ -518,9 +528,7 @@ drives are mostly telling there is no UPC/EAN code on disk or there is, but it
is an all-zero number. I guess now almost no CD holds such a number. is an all-zero number. I guess now almost no CD holds such a number.
Bug reports, comments, wishes, donations (technical information is a donation, Bug reports, comments, wishes, donations (technical information is a donation,
too :-) etc. to too :-) etc. to emoenke@gwdg.de.
emoenke@gwdg.de
or to my FIDO address: Eberhard Moenkeberg, 2:2437/210.27
SnailMail address, preferable for CD editors if they want to submit a free SnailMail address, preferable for CD editors if they want to submit a free
"cooperation" copy: "cooperation" copy:
......
...@@ -42,7 +42,7 @@ foo \kill}% ...@@ -42,7 +42,7 @@ foo \kill}%
% %
\title{{\bf Linux Allocated Devices}} \title{{\bf Linux Allocated Devices}}
\author{Maintained by H. Peter Anvin $<$hpa@storm.net$>$} \author{Maintained by H. Peter Anvin $<$hpa@storm.net$>$}
\date{Last revised: December 17, 1995} \date{Last revised: January 5, 1996}
\maketitle \maketitle
% %
\noindent \noindent
...@@ -149,7 +149,10 @@ an unreasonable effort. ...@@ -149,7 +149,10 @@ an unreasonable effort.
\major{39}{}{char }{Reserved for ncpfs $<$lendecke@namu01.gwdg.de$>$} \major{39}{}{char }{Reserved for ncpfs $<$lendecke@namu01.gwdg.de$>$}
\major{40}{--41}{}{Unallocated} \major{40}{--41}{}{Unallocated}
\major{42}{}{}{Demo/sample use} \major{42}{}{}{Demo/sample use}
\major{43}{--59}{}{Unallocated} \major{43}{}{char }{isdn4linux virtual modem}
\major{44}{}{char }{isdn4linux virtual modem -- alternate devices}
\major{45}{}{char }{isdn4linux ISDN BRI driver}
\major{46}{--59}{}{Unallocated}
\major{60}{--63}{}{Local/experimental use} \major{60}{--63}{}{Local/experimental use}
\major{64}{--119}{}{Unallocated} \major{64}{--119}{}{Unallocated}
\major{120}{--127}{}{Local/experimental use} \major{120}{--127}{}{Local/experimental use}
...@@ -673,9 +676,14 @@ disk (same as SCSI.) ...@@ -673,9 +676,14 @@ disk (same as SCSI.)
\major{29}{}{char }{Universal frame buffer} \major{29}{}{char }{Universal frame buffer}
\minor{0}{/dev/fb0current}{First frame buffer} \minor{0}{/dev/fb0current}{First frame buffer}
\minor{1}{/dev/fb0autodetect}{} \minor{1}{/dev/fb0autodetect}{}
\minor{24}{/dev/fb0user0}{}
\minordots \minordots
\minor{31}{/dev/fb0user7}{}
\minor{32}{/dev/fb1current}{Second frame buffer} \minor{32}{/dev/fb1current}{Second frame buffer}
\minor{33}{/dev/fb1autodetect}{} \minor{33}{/dev/fb1autodetect}{}
\minor{56}{/dev/fb1user0}{}
\minordots
\minor{63}{/dev/fb1user7}{}
\minordots \minordots
\end{devicelist} \end{devicelist}
...@@ -683,9 +691,11 @@ disk (same as SCSI.) ...@@ -683,9 +691,11 @@ disk (same as SCSI.)
The universal frame buffer device is currently supported only on The universal frame buffer device is currently supported only on
Linux/68k. The {\file current} device accesses the frame buffer at Linux/68k. The {\file current} device accesses the frame buffer at
current resolution; the {\file autodetect} one at bootup (default) current resolution; the {\file autodetect} one at bootup (default)
resolution. Minor numbers 2--31 within each frame buffer assignment resolution. Minor numbers 2--23 within each frame buffer assignment
are used for specific device-dependent resolutions. There appears to are used for specific device-dependent resolutions. There appears to
be no standard naming for these devices. be no standard naming for these devices. Finally, 24--31 within each
device are reserved for user-selected modes, usually entered at boot
time.
\begin{devicelist} \begin{devicelist}
\major{ }{}{block}{Aztech/Orchid/Okano/Wearnes CD-ROM} \major{ }{}{block}{Aztech/Orchid/Okano/Wearnes CD-ROM}
...@@ -868,7 +878,32 @@ driver with this number should not cause ill effects to the system ...@@ -868,7 +878,32 @@ driver with this number should not cause ill effects to the system
(bugs excepted.) (bugs excepted.)
\begin{devicelist} \begin{devicelist}
\major{43}{--59}{}{Unallocated} \major{43}{}{char }{isdn4linux virtual modem}
\minor{0}{/dev/ttyI0}{First virtual modem}
\minordots
\minor{15}{/dev/ttyI15}{16th virtual modem}
\end{devicelist}
\begin{devicelist}
\major{44}{}{char }{isdn4linux virtual modem -- alternate devices}
\minor{0}{/dev/cui0}{Callout device corresponding to {\file ttyI0}}
\minordots
\minor{15}{/dev/cui15}{Callout device corresponding to {\file ttyI15}}
\end{devicelist}
\begin{devicelist}
\major{45}{}{char }{isdn4linux ISDN BRI driver}
\minor{0}{/dev/isdn0}{First virtual B channel raw data}
\minordots
\minor{15}{/dev/isdn15}{16th virtual B channel raw data}
\minor{16}{/dev/isdnctrl0}{First channel control/debug}
\minordots
\minor{31}{/dev/isdnctrl15}{16th channel control/debug}
\minor{128}{/dev/isdninfo}{ISDN monitor interface}
\end{devicelist}
\begin{devicelist}
\major{46}{--59}{}{Unallocated}
\end{devicelist} \end{devicelist}
\begin{devicelist} \begin{devicelist}
...@@ -972,7 +1007,8 @@ point to the ``cooked'' devices ({\file /dev/st*} and {\file ...@@ -972,7 +1007,8 @@ point to the ``cooked'' devices ({\file /dev/st*} and {\file
({\file /dev/sg*}.) ({\file /dev/sg*}.)
{\file /dev/mouse} may point to a dialout (alternate) TTY device, a {\file /dev/mouse} may point to a dialout (alternate) TTY device, a
hardware mouse device, or a socket for a mouse driver program. hardware mouse device, or a socket for a mouse driver program
(e.g. {\file /dev/gpmdata}.)
\subsection{Sockets and pipes} \subsection{Sockets and pipes}
...@@ -982,6 +1018,7 @@ Common entries are: ...@@ -982,6 +1018,7 @@ Common entries are:
\begin{nodelist} \begin{nodelist}
\node{/dev/printer}{socket}{{\file lpd} local socket} \node{/dev/printer}{socket}{{\file lpd} local socket}
\node{/dev/log}{socket}{{\file syslog} local socket} \node{/dev/log}{socket}{{\file syslog} local socket}
\node{/dev/gpmdata}{socket}{{\file gpm} mouse multiplexer}
\end{nodelist} \end{nodelist}
\end{document} \end{document}
......
LINUX ALLOCATED DEVICES LINUX ALLOCATED DEVICES
Maintained by H. Peter Anvin <Peter.Anvin@linux.org> Maintained by H. Peter Anvin <hpa@storm.net>
Last revised: December 17, 1995 Last revised: January 5, 1996
This list is the successor to Rick Miller's Linux Device List, which This list is the successor to Rick Miller's Linux Device List, which
he stopped maintaining when he lost network access in 1993. It is a he stopped maintaining when he lost network access in 1993. It is a
...@@ -439,10 +439,14 @@ an unreasonable effort. ...@@ -439,10 +439,14 @@ an unreasonable effort.
29 char Universal frame buffer 29 char Universal frame buffer
0 = /dev/fb0current First frame buffer 0 = /dev/fb0current First frame buffer
1 = /dev/fb0autodetect 1 = /dev/fb0autodetect
... 24 = /dev/fb0user0
...
31 = /dev/fb0user7
32 = /dev/fb1current Second frame buffer 32 = /dev/fb1current Second frame buffer
33 = /dev/fb1autodetect 33 = /dev/fb1autodetect
56 = /dev/fb1user0
... ...
63 = /dev/fb1user7
block Aztech/Orchid/Okano/Wearnes CD-ROM block Aztech/Orchid/Okano/Wearnes CD-ROM
0 = /dev/aztcd Aztech CD-ROM 0 = /dev/aztcd Aztech CD-ROM
...@@ -450,9 +454,11 @@ an unreasonable effort. ...@@ -450,9 +454,11 @@ an unreasonable effort.
supported on Linux/68k. The "current" device accesses supported on Linux/68k. The "current" device accesses
the fame buffer at current resolution; the the fame buffer at current resolution; the
"autodetect" one at bootup (default) resolution. "autodetect" one at bootup (default) resolution.
Minor numbers 2-31 within each frame buffer assignment Minor numbers 2-23 within each frame buffer assignment
are used for specific device-dependent resolutions. are used for specific device-dependent resolutions.
There appears to be no standard naming for these devices. There appears to be no standard naming for these devices.
Finally, 2-31 within each device are reserved for
user-selected modes, usually entered at boot time.
30 char iBCS-2 compatibility devices 30 char iBCS-2 compatibility devices
0 = /dev/socksys Socket access 0 = /dev/socksys Socket access
...@@ -589,7 +595,26 @@ an unreasonable effort. ...@@ -589,7 +595,26 @@ an unreasonable effort.
removal of a driver with this number should not cause removal of a driver with this number should not cause
ill effects to the system (bugs excepted.) ill effects to the system (bugs excepted.)
43-59 UNALLOCATED 43 char isdn4linux virtual modem
0 = /dev/ttyI0 First virtual modem
...
15 = /dev/ttyI15 16th virtual modem
44 char isdn4linux virtual modem - alternate devices
0 = /dev/cui0 Callout device corresponding to ttyI0
...
15 = /dev/cui15 Callout device corresponding to ttyI15
45 char isdn4linux ISDN BRI driver
0 = /dev/isdn0 First virtual B channel raw data
...
15 = /dev/isdn15 16th virtual B channel raw data
16 = /dev/isdnctrl0 First channel control/debug
...
31 = /dev/isdnctrl15 16th channel control/debug
128 = /dev/isdninfo ISDN monitor interface
46-59 UNALLOCATED
60-63 LOCAL/EXPERIMENTAL USE 60-63 LOCAL/EXPERIMENTAL USE
Allocated for local/experimental use. For devices not Allocated for local/experimental use. For devices not
...@@ -670,7 +695,7 @@ For SCSI devices, /dev/tape and /dev/cdrom should point to the ...@@ -670,7 +695,7 @@ For SCSI devices, /dev/tape and /dev/cdrom should point to the
SCSI devices (/dev/sg*). SCSI devices (/dev/sg*).
/dev/mouse may point to a dialout (alternate) TTY device, a hardware /dev/mouse may point to a dialout (alternate) TTY device, a hardware
mouse device, or a socket for a mouse driver program. mouse device, or a socket for a mouse driver program (e.g. /dev/gpmdata).
Sockets and pipes Sockets and pipes
...@@ -678,3 +703,4 @@ Non-transient sockets and named pipes may exist in /dev. Common entries are: ...@@ -678,3 +703,4 @@ Non-transient sockets and named pipes may exist in /dev. Common entries are:
/dev/printer socket lpd local socket /dev/printer socket lpd local socket
/dev/log socket syslog local socket /dev/log socket syslog local socket
/dev/gpmdata socket gpm mouse multiplexer
VERSION = 1 VERSION = 1
PATCHLEVEL = 3 PATCHLEVEL = 3
SUBLEVEL = 54 SUBLEVEL = 55
ARCH = i386 ARCH = i386
...@@ -309,7 +309,7 @@ mrproper: clean ...@@ -309,7 +309,7 @@ mrproper: clean
distclean: mrproper distclean: mrproper
rm -f core `find . \( -name '*.orig' -o -name '*~' -o -name '*.bak' \ rm -f core `find . \( -name '*.orig' -o -name '*~' -o -name '*.bak' \
-o -name '#*#' -o -name '.*.orig' \) -print` -o -name '#*#' -o -name '.*.orig' \) -print` TAGS
backup: mrproper backup: mrproper
......
...@@ -110,9 +110,8 @@ CONFIGURING the kernel: ...@@ -110,9 +110,8 @@ CONFIGURING the kernel:
under some circumstances lead to problems: probing for a under some circumstances lead to problems: probing for a
nonexistent controller card may confuse your other controllers nonexistent controller card may confuse your other controllers
- compiling the kernel with "-m486" for a number of 486-specific - compiling the kernel with "-m486" for a number of 486-specific
will result in a kernel that still works on a 386: it may be will result in a kernel that does NOT work on a 386. The
slightly larger and possibly slower by an insignificant amount, kernel will detect this on bootup, and give up.
but it should not hurt performance.
- A kernel with math-emulation compiled in will still use the - A kernel with math-emulation compiled in will still use the
coprocessor if one is present: the math emulation will just coprocessor if one is present: the math emulation will just
never get used in that case. The kernel will be slightly larger, never get used in that case. The kernel will be slightly larger,
...@@ -137,7 +136,9 @@ COMPILING the kernel: ...@@ -137,7 +136,9 @@ COMPILING the kernel:
upgrade your compiler, remember to get the new binutils package too upgrade your compiler, remember to get the new binutils package too
(for as/ld/nm and company). Do not use gcc-2.6.0; it has a few serious (for as/ld/nm and company). Do not use gcc-2.6.0; it has a few serious
bugs. Some problems have been reported occasionally with 2.6.3 as well, bugs. Some problems have been reported occasionally with 2.6.3 as well,
so use that version at your own risk. so use that version at your own risk. Specifying "-fno-strength-reduce"
in the CFLAGS of the main Makefile may help to work around a known
bug in gcc.
- do a "make zImage" to create a compressed kernel image. If you want - do a "make zImage" to create a compressed kernel image. If you want
to make a bootdisk (without root filesystem or lilo), insert a floppy to make a bootdisk (without root filesystem or lilo), insert a floppy
......
#include <sys/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
......
...@@ -657,10 +657,18 @@ ENTRY(sys_call_table) ...@@ -657,10 +657,18 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_readv) /* 145 */ .long SYMBOL_NAME(sys_readv) /* 145 */
.long SYMBOL_NAME(sys_writev) .long SYMBOL_NAME(sys_writev)
.long SYMBOL_NAME(sys_getsid) .long SYMBOL_NAME(sys_getsid)
.long 0 .long SYMBOL_NAME(sys_fdatasync)
.long 0 .long 0
.long SYMBOL_NAME(sys_mlock) /* 150 */ .long SYMBOL_NAME(sys_mlock) /* 150 */
.long SYMBOL_NAME(sys_munlock) .long SYMBOL_NAME(sys_munlock)
.long SYMBOL_NAME(sys_mlockall) .long SYMBOL_NAME(sys_mlockall)
.long SYMBOL_NAME(sys_munlockall) .long SYMBOL_NAME(sys_munlockall)
.space (NR_syscalls-154)*4 .long SYMBOL_NAME(sys_sched_setparam)
.long SYMBOL_NAME(sys_sched_getparam) /* 155 */
.long SYMBOL_NAME(sys_sched_setscheduler)
.long SYMBOL_NAME(sys_sched_getscheduler)
.long SYMBOL_NAME(sys_sched_yield)
.long SYMBOL_NAME(sys_sched_get_priority_max)
.long SYMBOL_NAME(sys_sched_get_priority_min) /* 160 */
.long SYMBOL_NAME(sys_sched_rr_get_interval)
.space (NR_syscalls-162)*4
...@@ -624,4 +624,4 @@ sys_call_table: ...@@ -624,4 +624,4 @@ sys_call_table:
.globl floppy_track_buffer .globl floppy_track_buffer
floppy_track_buffer: floppy_track_buffer:
.space 512*2*38 /* Space for one entire cylinder! */ .space 512*2*38 /* Space for one entire cylinder! */
#endif #endif
\ No newline at end of file
...@@ -3633,7 +3633,8 @@ static char get_fdc_version(void) ...@@ -3633,7 +3633,8 @@ static char get_fdc_version(void)
return FDC_8272A; /* 8272a/765 don't know DUMPREGS */ return FDC_8272A; /* 8272a/765 don't know DUMPREGS */
} }
if (r != 10) { if (r != 10) {
printk("FDC init: DUMPREGS: unexpected return of %d bytes.\n", r); printk("FDC %d init: DUMPREGS: unexpected return of %d bytes.\n",
fdc, r);
return FDC_UNKNOWN; return FDC_UNKNOWN;
} }
output_byte(FD_VERSION); output_byte(FD_VERSION);
...@@ -3643,7 +3644,8 @@ static char get_fdc_version(void) ...@@ -3643,7 +3644,8 @@ static char get_fdc_version(void)
return FDC_82072; /* 82072 doesn't know VERSION */ return FDC_82072; /* 82072 doesn't know VERSION */
} }
if ((r != 1) || (reply_buffer[0] != 0x90)) { if ((r != 1) || (reply_buffer[0] != 0x90)) {
printk("FDC init: VERSION: unexpected return of %d bytes.\n", r); printk("FDC %d init: VERSION: unexpected return of %d bytes.\n",
fdc, r);
return FDC_UNKNOWN; return FDC_UNKNOWN;
} }
output_byte(FD_UNLOCK); output_byte(FD_UNLOCK);
...@@ -3653,13 +3655,15 @@ static char get_fdc_version(void) ...@@ -3653,13 +3655,15 @@ static char get_fdc_version(void)
return FDC_82077_ORIG; /* Pre-1991 82077 doesn't know LOCK/UNLOCK */ return FDC_82077_ORIG; /* Pre-1991 82077 doesn't know LOCK/UNLOCK */
} }
if ((r != 1) || (reply_buffer[0] != 0x00)) { if ((r != 1) || (reply_buffer[0] != 0x00)) {
printk("FDC init: UNLOCK: unexpected return of %d bytes.\n", r); printk("FDC %d init: UNLOCK: unexpected return of %d bytes.\n",
fdc, r);
return FDC_UNKNOWN; return FDC_UNKNOWN;
} }
output_byte(FD_PARTID); output_byte(FD_PARTID);
r = result(); r = result();
if (r != 1) { if (r != 1) {
printk("FDC init: PARTID: unexpected return of %d bytes.\n",r); printk("FDC %d init: PARTID: unexpected return of %d bytes.\n",
fdc, r);
return FDC_UNKNOWN; return FDC_UNKNOWN;
} }
if (reply_buffer[0] == 0x80) { if (reply_buffer[0] == 0x80) {
...@@ -3671,7 +3675,7 @@ static char get_fdc_version(void) ...@@ -3671,7 +3675,7 @@ static char get_fdc_version(void)
output_byte(FD_SAVE); output_byte(FD_SAVE);
r = result(); r = result();
if (r != 17) { if (r != 17) {
printk("FDC init: SAVE: unexpected return of %d bytes.\n",r); printk("FDC %d init: SAVE: unexpected return of %d bytes.\n",fdc,r);
return FDC_UNKNOWN; return FDC_UNKNOWN;
} }
if (!(reply_buffer[0] & 0x40)) { if (!(reply_buffer[0] & 0x40)) {
...@@ -3684,9 +3688,13 @@ static char get_fdc_version(void) ...@@ -3684,9 +3688,13 @@ static char get_fdc_version(void)
case 0x1: case 0x1:
printk("FDC %d is a 44pin 82078\n",fdc); printk("FDC %d is a 44pin 82078\n",fdc);
return FDC_82078; return FDC_82078;
case 0x3:
printk("FDC %d is a National Semiconductor PC87306\n",fdc);
return FDC_87306;
default: default:
printk("FDC %d init: PARTID returned an unknown ID: %d.\n", fdc, reply_buffer[0] >> 5); printk("FDC %d init: Unknown 82077 variant, PARTID = %d.\n",
return FDC_UNKNOWN; fdc, reply_buffer[0] >> 5);
return FDC_82077_UNKN;
} }
} /* get_fdc_version */ } /* get_fdc_version */
......
...@@ -371,7 +371,7 @@ void rd_load() ...@@ -371,7 +371,7 @@ void rd_load()
if (rd_prompt) { if (rd_prompt) {
printk(KERN_NOTICE printk(KERN_NOTICE
"VFS: Insert ramdisk floppy and press ENTER\n"); "VFS: Insert root floppy disk to be loaded into ramdisk and press ENTER\n");
wait_for_keypress(); wait_for_keypress();
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
tristate 'Sony CDU31A/CDU33A CDROM support' CONFIG_CDU31A tristate 'Sony CDU31A/CDU33A CDROM support' CONFIG_CDU31A
tristate 'Standard Mitsumi [no XA/Multisession] CDROM support' CONFIG_MCD tristate 'Standard Mitsumi [no XA/Multisession] CDROM support' CONFIG_MCD
tristate 'Experimental Mitsumi [XA/MultiSession] support' CONFIG_MCDX tristate 'Mitsumi [XA/MultiSession] CDROM support' CONFIG_MCDX
tristate 'Matsushita/Panasonic/Creative, Longshine, TEAC CDROM support' CONFIG_SBPCD tristate 'Matsushita/Panasonic/Creative, Longshine, TEAC CDROM support' CONFIG_SBPCD
if [ "$CONFIG_SBPCD" = "y" ]; then if [ "$CONFIG_SBPCD" = "y" ]; then
bool 'Matsushita/Panasonic, ... second CDROM controller support' CONFIG_SBPCD2 bool 'Matsushita/Panasonic, ... second CDROM controller support' CONFIG_SBPCD2
...@@ -18,5 +18,5 @@ tristate 'Aztech/Orchid/Okano/Wearnes/TXC (non IDE) CDROM support' CONFIG_AZTCD ...@@ -18,5 +18,5 @@ tristate 'Aztech/Orchid/Okano/Wearnes/TXC (non IDE) CDROM support' CONFIG_AZTCD
tristate 'Sony CDU535 CDROM support' CONFIG_CDU535 tristate 'Sony CDU535 CDROM support' CONFIG_CDU535
tristate 'Goldstar R420 CDROM support' CONFIG_GSCD tristate 'Goldstar R420 CDROM support' CONFIG_GSCD
tristate 'Philips/LMS CM206 CDROM support' CONFIG_CM206 tristate 'Philips/LMS CM206 CDROM support' CONFIG_CM206
tristate 'Experimental Optics Storage DOLPHIN 8000AT CDROM support' CONFIG_OPTCD tristate 'Optics Storage DOLPHIN 8000AT CDROM support' CONFIG_OPTCD
tristate 'Experimental Sanyo H94A CDROM support' CONFIG_SJCD tristate 'Sanyo H94A CDROM support' CONFIG_SJCD
...@@ -11,18 +11,12 @@ ...@@ -11,18 +11,12 @@
* Also for the TEAC CD-55A drive. * Also for the TEAC CD-55A drive.
* Not for Sanyo drives (but sjcd is there...). * Not for Sanyo drives (but sjcd is there...).
* Not for any other Funai drives than E2550UA (="CD200" with "F"). * Not for any other Funai drives than E2550UA (="CD200" with "F").
* * Not for Vertos drives yet.
* NOTE: This is release 4.0 */
*
* Copyright (C) 1993, 1994, 1995 Eberhard Moenkeberg <emoenke@gwdg.de> #define VERSION "v4.1 Eberhard Moenkeberg <emoenke@gwdg.de>"
*
* If you change this software, you should mail a .diff /* Copyright (C) 1993, 1994, 1995 Eberhard Moenkeberg <emoenke@gwdg.de>
* file with some description lines to emoenke@gwdg.de.
* I want to know about it.
*
* If you are the editor of a Linux CD, you should
* enable sbpcd.c within your boot floppy kernel and
* send me one of your CDs for free.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -33,6 +27,22 @@ ...@@ -33,6 +27,22 @@
* (for example /usr/src/linux/COPYING); if not, write to the Free * (for example /usr/src/linux/COPYING); if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* If you change this software, you should mail a .diff file with some
* description lines to emoenke@gwdg.de. I want to know about it.
*
* If you are the editor of a Linux CD, you should enable sbpcd.c within
* your boot floppy kernel and send me one of your CDs for free.
*
* If you would like to port the driver to an other operating system (f.e.
* FreeBSD or NetBSD) or use it as an information source, you shall not be
* restricted by the GPL under the following conditions:
* a) the source code of your work is freely available
* b) my part of the work gets mentioned at all places where your
* authorship gets mentioned
* c) I receive a copy of your code together with a full installation
* package of your operating system for free.
*
*
* VERSION HISTORY * VERSION HISTORY
* *
* 0.1 initial release, April/May 93, after mcd.c (Martin Harriss) * 0.1 initial release, April/May 93, after mcd.c (Martin Harriss)
...@@ -249,6 +259,11 @@ ...@@ -249,6 +259,11 @@
* Fulfilled "read audio" for CD200 drives, with help of Pete Heist * Fulfilled "read audio" for CD200 drives, with help of Pete Heist
* (heistp@rpi.edu). * (heistp@rpi.edu).
* *
* 4.1 Use loglevel KERN_INFO with printk().
* Added support for "Vertos 100" drive ("ECS-AT") - it is very similar
* to the Longshine LCS-7260. Give feedback if you can - I never saw
* such a drive, and I have no specs.
*
* TODO * TODO
* *
* disk change detection * disk change detection
...@@ -302,8 +317,6 @@ ...@@ -302,8 +317,6 @@
#include <linux/blk.h> #include <linux/blk.h>
#define VERSION "v4.0 Eberhard Moenkeberg <emoenke@gwdg.de>"
/*==========================================================================*/ /*==========================================================================*/
/* /*
* provisions for more than 1 driver issues * provisions for more than 1 driver issues
...@@ -465,9 +478,9 @@ static int sbpcd_chk_disk_change(kdev_t); ...@@ -465,9 +478,9 @@ static int sbpcd_chk_disk_change(kdev_t);
* (1<<DBG_AUD) "read audio" debugging * (1<<DBG_AUD) "read audio" debugging
* (1<<DBG_SEQ) Sequoia interface configuration trace * (1<<DBG_SEQ) Sequoia interface configuration trace
* (1<<DBG_LCS) Longshine LCS-7260 debugging trace * (1<<DBG_LCS) Longshine LCS-7260 debugging trace
* (1<<DBG_CD2) MKE CD200 debugging trace * (1<<DBG_CD2) MKE/Funai CD200 debugging trace
* (1<<DBG_TEA) TEAC CD-55A debugging trace * (1<<DBG_TEA) TEAC CD-55A debugging trace
* (1<<DBG_TE2) TEAC CD-55A debugging trace, 2nd level * (1<<DBG_ECS) ECS-AT (Vertos-100) debugging trace
* (1<<DBG_000) unnecessary information * (1<<DBG_000) unnecessary information
*/ */
#if DISTRIBUTION #if DISTRIBUTION
...@@ -536,6 +549,7 @@ static u_char family1[]="CR-56"; /* MKE CR-562, CR-563 */ ...@@ -536,6 +549,7 @@ static u_char family1[]="CR-56"; /* MKE CR-562, CR-563 */
static u_char family2[]="CD200"; /* MKE CD200, Funai CD200F */ static u_char family2[]="CD200"; /* MKE CD200, Funai CD200F */
static u_char familyL[]="LCS-7260"; /* Longshine LCS-7260 */ static u_char familyL[]="LCS-7260"; /* Longshine LCS-7260 */
static u_char familyT[]="CD-55"; /* TEAC CD-55A */ static u_char familyT[]="CD-55"; /* TEAC CD-55A */
static u_char familyV[]="ECS-AT"; /* ECS Vertos 100 */
static u_int recursion=0; /* internal testing only */ static u_int recursion=0; /* internal testing only */
static u_int fatal_err=0; /* internal testing only */ static u_int fatal_err=0; /* internal testing only */
...@@ -601,7 +615,7 @@ static struct { ...@@ -601,7 +615,7 @@ static struct {
u_char *aud_buf; /* Pointer to audio data buffer, u_char *aud_buf; /* Pointer to audio data buffer,
space allocated during sbpcd_init() */ space allocated during sbpcd_init() */
u_int sbp_audsiz; /* size of aud_buf (# of raw frames) */ u_int sbp_audsiz; /* size of aud_buf (# of raw frames) */
u_char drv_type; u_int drv_type;
u_char drv_options; u_char drv_options;
int status_bits; int status_bits;
u_char diskstate_flags; u_char diskstate_flags;
...@@ -707,9 +721,9 @@ static void msg(int level, const char *fmt, ...) ...@@ -707,9 +721,9 @@ static void msg(int level, const char *fmt, ...)
msgnum++; msgnum++;
if (msgnum>99) msgnum=0; if (msgnum>99) msgnum=0;
sprintf(buf, "%s-%d [%02d]: ", major_name, d, msgnum); sprintf(buf, KERN_INFO "%s-%d [%02d]: ", major_name, d, msgnum);
va_start(args, fmt); va_start(args, fmt);
vsprintf(&buf[15], fmt, args); vsprintf(&buf[18], fmt, args);
va_end(args); va_end(args);
printk(buf); printk(buf);
sbp_sleep(55); /* else messages get lost */ sbp_sleep(55); /* else messages get lost */
...@@ -1008,7 +1022,7 @@ static void EvaluateStatus(int st) ...@@ -1008,7 +1022,7 @@ static void EvaluateStatus(int st)
if (st&p_busy_old) D_S[d].status_bits |= p_busy_new; if (st&p_busy_old) D_S[d].status_bits |= p_busy_new;
if (st&p_disk_ok) D_S[d].status_bits |= p_disk_ok; if (st&p_disk_ok) D_S[d].status_bits |= p_disk_ok;
} }
else if (famL_drive) else if (famLV_drive)
{ {
D_S[d].status_bits |= p_success; D_S[d].status_bits |= p_success;
if (st&p_caddin_old) D_S[d].status_bits |= p_disk_ok|p_caddy_in; if (st&p_caddin_old) D_S[d].status_bits |= p_disk_ok|p_caddy_in;
...@@ -1052,7 +1066,6 @@ static int get_state_T(void) ...@@ -1052,7 +1066,6 @@ static int get_state_T(void)
static int cmd_out_T(void); static int cmd_out_T(void);
msg(DBG_TE2,"doing get_state_T...\n");
clr_cmdbuf(); clr_cmdbuf();
D_S[d].n_bytes=1; D_S[d].n_bytes=1;
drvcmd[0]=CMDT_STATUS; drvcmd[0]=CMDT_STATUS;
...@@ -1087,7 +1100,6 @@ static int get_state_T(void) ...@@ -1087,7 +1100,6 @@ static int get_state_T(void)
D_S[d].status_bits=p1_door_closed; D_S[d].status_bits=p1_door_closed;
D_S[d].open_count=0; D_S[d].open_count=0;
} }
msg(DBG_TE2,"get_state_T done (%02X)...\n", D_S[d].status_bits);
return (D_S[d].status_bits); return (D_S[d].status_bits);
} }
/*==========================================================================*/ /*==========================================================================*/
...@@ -1135,10 +1147,10 @@ static void cc_ReadStatus(void) ...@@ -1135,10 +1147,10 @@ static void cc_ReadStatus(void)
msg(DBG_STA,"giving cc_ReadStatus command\n"); msg(DBG_STA,"giving cc_ReadStatus command\n");
if (famT_drive) return; if (famT_drive) return;
SBPCD_CLI; SBPCD_CLI;
if (fam0L_drive) OUT(CDo_command,CMD0_STATUS); if (fam0LV_drive) OUT(CDo_command,CMD0_STATUS);
else if (fam1_drive) OUT(CDo_command,CMD1_STATUS); else if (fam1_drive) OUT(CDo_command,CMD1_STATUS);
else if (fam2_drive) OUT(CDo_command,CMD2_STATUS); else if (fam2_drive) OUT(CDo_command,CMD2_STATUS);
if (!fam0L_drive) for (i=0;i<6;i++) OUT(CDo_command,0); if (!fam0LV_drive) for (i=0;i<6;i++) OUT(CDo_command,0);
SBPCD_STI; SBPCD_STI;
} }
/*==========================================================================*/ /*==========================================================================*/
...@@ -1154,11 +1166,11 @@ static int cc_ReadError(void) ...@@ -1154,11 +1166,11 @@ static int cc_ReadError(void)
response_count=8; response_count=8;
flags_cmd_out=f_putcmd|f_ResponseStatus; flags_cmd_out=f_putcmd|f_ResponseStatus;
} }
else if (fam0L_drive) else if (fam0LV_drive)
{ {
drvcmd[0]=CMD0_READ_ERR; drvcmd[0]=CMD0_READ_ERR;
response_count=6; response_count=6;
if (famL_drive) if (famLV_drive)
flags_cmd_out=f_putcmd; flags_cmd_out=f_putcmd;
else else
flags_cmd_out=f_putcmd|f_getsta|f_ResponseStatus; flags_cmd_out=f_putcmd|f_getsta|f_ResponseStatus;
...@@ -1178,7 +1190,7 @@ static int cc_ReadError(void) ...@@ -1178,7 +1190,7 @@ static int cc_ReadError(void)
D_S[d].error_byte=0; D_S[d].error_byte=0;
msg(DBG_ERR,"cc_ReadError: cmd_out(CMDx_READ_ERR) returns %d (%02X)\n",i,i); msg(DBG_ERR,"cc_ReadError: cmd_out(CMDx_READ_ERR) returns %d (%02X)\n",i,i);
if (i<0) return (i); if (i<0) return (i);
if (fam0_drive) i=1; if (fam0V_drive) i=1;
else i=2; else i=2;
D_S[d].error_byte=infobuf[i]; D_S[d].error_byte=infobuf[i];
msg(DBG_ERR,"cc_ReadError: infobuf[%d] is %d (%02X)\n",i,D_S[d].error_byte,D_S[d].error_byte); msg(DBG_ERR,"cc_ReadError: infobuf[%d] is %d (%02X)\n",i,D_S[d].error_byte,D_S[d].error_byte);
...@@ -1376,15 +1388,18 @@ static int cc_Seek(u_int pos, char f_blk_msf) ...@@ -1376,15 +1388,18 @@ static int cc_Seek(u_int pos, char f_blk_msf)
clr_cmdbuf(); clr_cmdbuf();
if (f_blk_msf>1) return (-3); if (f_blk_msf>1) return (-3);
if (fam0_drive) if (fam0V_drive)
{ {
drvcmd[0]=CMD0_SEEK; drvcmd[0]=CMD0_SEEK;
if (f_blk_msf==1) pos=msf2blk(pos); if (f_blk_msf==1) pos=msf2blk(pos);
drvcmd[2]=(pos>>16)&0x00FF; drvcmd[2]=(pos>>16)&0x00FF;
drvcmd[3]=(pos>>8)&0x00FF; drvcmd[3]=(pos>>8)&0x00FF;
drvcmd[4]=pos&0x00FF; drvcmd[4]=pos&0x00FF;
flags_cmd_out = f_putcmd | f_respo2 | f_lopsta | f_getsta | if (fam0_drive)
flags_cmd_out = f_putcmd | f_respo2 | f_lopsta | f_getsta |
f_ResponseStatus | f_obey_p_check | f_bit1; f_ResponseStatus | f_obey_p_check | f_bit1;
else
flags_cmd_out = f_putcmd;
} }
else if (fam1L_drive) else if (fam1L_drive)
{ {
...@@ -1430,11 +1445,14 @@ static int cc_SpinUp(void) ...@@ -1430,11 +1445,14 @@ static int cc_SpinUp(void)
msg(DBG_SPI,"SpinUp.\n"); msg(DBG_SPI,"SpinUp.\n");
D_S[d].in_SpinUp = 1; D_S[d].in_SpinUp = 1;
clr_cmdbuf(); clr_cmdbuf();
if (fam0L_drive) if (fam0LV_drive)
{ {
drvcmd[0]=CMD0_SPINUP; drvcmd[0]=CMD0_SPINUP;
flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta| if (fam0L_drive)
f_ResponseStatus|f_obey_p_check|f_bit1; flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|
f_ResponseStatus|f_obey_p_check|f_bit1;
else
flags_cmd_out=f_putcmd;
} }
else if (fam1_drive) else if (fam1_drive)
{ {
...@@ -1482,6 +1500,11 @@ static int cc_SpinDown(void) ...@@ -1482,6 +1500,11 @@ static int cc_SpinDown(void)
drvcmd[1]=1; drvcmd[1]=1;
flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus|f_obey_p_check|f_bit1; flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus|f_obey_p_check|f_bit1;
} }
else if (famV_drive)
{
drvcmd[0]=CMDV_SPINDOWN;
flags_cmd_out=f_putcmd;
}
else if (famT_drive) else if (famT_drive)
{ {
drvcmd[0]=CMDT_TRAY_CTL; drvcmd[0]=CMDT_TRAY_CTL;
...@@ -1555,7 +1578,7 @@ static int cc_SetSpeed(u_char speed, u_char x1, u_char x2) ...@@ -1555,7 +1578,7 @@ static int cc_SetSpeed(u_char speed, u_char x1, u_char x2)
{ {
int i; int i;
if (fam0L_drive) return (-3); if (fam0LV_drive) return (-3);
clr_cmdbuf(); clr_cmdbuf();
response_count=0; response_count=0;
if (fam1_drive) if (fam1_drive)
...@@ -1604,6 +1627,8 @@ static int cc_SetVolume(void) ...@@ -1604,6 +1627,8 @@ static int cc_SetVolume(void)
volume1=value1=D_S[d].vol_ctrl1; volume1=value1=D_S[d].vol_ctrl1;
control0=value0=0; control0=value0=0;
if (famV_drive) return (0);
if (((D_S[d].drv_options&audio_mono)!=0)&&(D_S[d].drv_type>=drv_211)) if (((D_S[d].drv_options&audio_mono)!=0)&&(D_S[d].drv_type>=drv_211))
{ {
if ((volume0!=0)&&(volume1==0)) if ((volume0!=0)&&(volume1==0))
...@@ -1774,7 +1799,7 @@ static int cc_DriveReset(void) ...@@ -1774,7 +1799,7 @@ static int cc_DriveReset(void)
msg(DBG_RES,"cc_DriveReset called.\n"); msg(DBG_RES,"cc_DriveReset called.\n");
clr_cmdbuf(); clr_cmdbuf();
response_count=0; response_count=0;
if (fam0L_drive) OUT(CDo_reset,0x00); if (fam0LV_drive) OUT(CDo_reset,0x00);
else if (fam1_drive) else if (fam1_drive)
{ {
drvcmd[0]=CMD1_RESET; drvcmd[0]=CMD1_RESET;
...@@ -1795,7 +1820,7 @@ static int cc_DriveReset(void) ...@@ -1795,7 +1820,7 @@ static int cc_DriveReset(void)
OUT(CDo_command,CMDT_RESET); OUT(CDo_command,CMDT_RESET);
for (i=1;i<10;i++) OUT(CDo_command,0); for (i=1;i<10;i++) OUT(CDo_command,0);
} }
if (fam0L_drive) sbp_sleep(5*HZ); /* wait 5 seconds */ if (fam0LV_drive) sbp_sleep(5*HZ); /* wait 5 seconds */
else sbp_sleep(1*HZ); /* wait a second */ else sbp_sleep(1*HZ); /* wait a second */
#if 1 #if 1
if (famT_drive) if (famT_drive)
...@@ -1859,7 +1884,7 @@ static int cc_PlayAudio(int pos_audio_start,int pos_audio_end) ...@@ -1859,7 +1884,7 @@ static int cc_PlayAudio(int pos_audio_start,int pos_audio_end)
if (D_S[d].audio_state==audio_playing) return (-EINVAL); if (D_S[d].audio_state==audio_playing) return (-EINVAL);
clr_cmdbuf(); clr_cmdbuf();
response_count=0; response_count=0;
if (famL_drive) if (famLV_drive)
{ {
drvcmd[0]=CMDL_PLAY; drvcmd[0]=CMDL_PLAY;
i=msf2blk(pos_audio_start); i=msf2blk(pos_audio_start);
...@@ -1870,8 +1895,11 @@ static int cc_PlayAudio(int pos_audio_start,int pos_audio_end) ...@@ -1870,8 +1895,11 @@ static int cc_PlayAudio(int pos_audio_start,int pos_audio_end)
drvcmd[4]=(n>>16)&0x00FF; drvcmd[4]=(n>>16)&0x00FF;
drvcmd[5]=(n>>8)&0x00FF; drvcmd[5]=(n>>8)&0x00FF;
drvcmd[6]=n&0x00FF; drvcmd[6]=n&0x00FF;
if (famL_drive)
flags_cmd_out = f_putcmd | f_respo2 | f_lopsta | f_getsta | flags_cmd_out = f_putcmd | f_respo2 | f_lopsta | f_getsta |
f_ResponseStatus | f_obey_p_check | f_wait_if_busy; f_ResponseStatus | f_obey_p_check | f_wait_if_busy;
else
flags_cmd_out = f_putcmd;
} }
else else
{ {
...@@ -1928,13 +1956,15 @@ static int cc_Pause_Resume(int pau_res) ...@@ -1928,13 +1956,15 @@ static int cc_Pause_Resume(int pau_res)
if (pau_res!=1) drvcmd[2]=0x01; if (pau_res!=1) drvcmd[2]=0x01;
flags_cmd_out=f_putcmd|f_ResponseStatus; flags_cmd_out=f_putcmd|f_ResponseStatus;
} }
else if (fam0L_drive) else if (fam0LV_drive)
{ {
drvcmd[0]=CMD0_PAU_RES; drvcmd[0]=CMD0_PAU_RES;
if (pau_res!=1) drvcmd[1]=0x80; if (pau_res!=1) drvcmd[1]=0x80;
if (famL_drive) if (famL_drive)
flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus| flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus|
f_obey_p_check|f_bit1; f_obey_p_check|f_bit1;
else if (famV_drive)
flags_cmd_out=f_putcmd;
else else
flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus| flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus|
f_obey_p_check; f_obey_p_check;
...@@ -1970,11 +2000,14 @@ static int cc_LockDoor(char lock) ...@@ -1970,11 +2000,14 @@ static int cc_LockDoor(char lock)
if (lock==1) drvcmd[4]=0x01; if (lock==1) drvcmd[4]=0x01;
flags_cmd_out=f_putcmd|f_ResponseStatus; flags_cmd_out=f_putcmd|f_ResponseStatus;
} }
else if (famL_drive) else if (famLV_drive)
{ {
drvcmd[0]=CMDL_LOCK_CTL; drvcmd[0]=CMDL_LOCK_CTL;
if (lock==1) drvcmd[1]=0x01; if (lock==1) drvcmd[1]=0x01;
flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus|f_obey_p_check|f_bit1; if (famL_drive)
flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus|f_obey_p_check|f_bit1;
else
flags_cmd_out=f_putcmd;
} }
else if (famT_drive) else if (famT_drive)
{ {
...@@ -2056,11 +2089,14 @@ static int cc_CloseTray(void) ...@@ -2056,11 +2089,14 @@ static int cc_CloseTray(void)
drvcmd[4]=0x03; /* "insert" */ drvcmd[4]=0x03; /* "insert" */
flags_cmd_out=f_putcmd|f_ResponseStatus; flags_cmd_out=f_putcmd|f_ResponseStatus;
} }
else if (famL_drive) else if (famLV_drive)
{ {
drvcmd[0]=CMDL_TRAY_CTL; drvcmd[0]=CMDL_TRAY_CTL;
flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta| if (famLV_drive)
flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|
f_ResponseStatus|f_obey_p_check|f_bit1; f_ResponseStatus|f_obey_p_check|f_bit1;
else
flags_cmd_out=f_putcmd;
} }
else if (famT_drive) else if (famT_drive)
{ {
...@@ -2094,11 +2130,11 @@ static int cc_ReadSubQ(void) ...@@ -2094,11 +2130,11 @@ static int cc_ReadSubQ(void)
flags_cmd_out=f_putcmd; flags_cmd_out=f_putcmd;
response_count=10; response_count=10;
} }
else if (fam0L_drive) else if (fam0LV_drive)
{ {
drvcmd[0]=CMD0_READSUBQ; drvcmd[0]=CMD0_READSUBQ;
drvcmd[1]=0x02; drvcmd[1]=0x02;
if (famL_drive) if (famLV_drive)
flags_cmd_out=f_putcmd; flags_cmd_out=f_putcmd;
else else
flags_cmd_out=f_putcmd|f_getsta|f_ResponseStatus|f_obey_p_check; flags_cmd_out=f_putcmd|f_getsta|f_ResponseStatus|f_obey_p_check;
...@@ -2134,12 +2170,12 @@ static int cc_ReadSubQ(void) ...@@ -2134,12 +2170,12 @@ static int cc_ReadSubQ(void)
else D_S[d].SubQ_ctl_adr=swap_nibbles(infobuf[1]); else D_S[d].SubQ_ctl_adr=swap_nibbles(infobuf[1]);
D_S[d].SubQ_trk=byt2bcd(infobuf[2]); D_S[d].SubQ_trk=byt2bcd(infobuf[2]);
D_S[d].SubQ_pnt_idx=byt2bcd(infobuf[3]); D_S[d].SubQ_pnt_idx=byt2bcd(infobuf[3]);
if (fam0L_drive) i=5; if (fam0LV_drive) i=5;
else if (fam12_drive) i=4; else if (fam12_drive) i=4;
else if (famT_drive) i=8; else if (famT_drive) i=8;
D_S[d].SubQ_run_tot=make32(make16(0,infobuf[i]),make16(infobuf[i+1],infobuf[i+2])); /* msf-bin */ D_S[d].SubQ_run_tot=make32(make16(0,infobuf[i]),make16(infobuf[i+1],infobuf[i+2])); /* msf-bin */
i=7; i=7;
if (fam0L_drive) i=9; if (fam0LV_drive) i=9;
else if (fam12_drive) i=7; else if (fam12_drive) i=7;
else if (famT_drive) i=4; else if (famT_drive) i=4;
D_S[d].SubQ_run_trk=make32(make16(0,infobuf[i]),make16(infobuf[i+1],infobuf[i+2])); /* msf-bin */ D_S[d].SubQ_run_trk=make32(make16(0,infobuf[i]),make16(infobuf[i+1],infobuf[i+2])); /* msf-bin */
...@@ -2153,6 +2189,7 @@ static int cc_ModeSense(void) ...@@ -2153,6 +2189,7 @@ static int cc_ModeSense(void)
int i; int i;
if (fam2_drive) return (0); if (fam2_drive) return (0);
if (famV_drive) return (0);
D_S[d].diskstate_flags &= ~frame_size_bit; D_S[d].diskstate_flags &= ~frame_size_bit;
clr_cmdbuf(); clr_cmdbuf();
if (fam1_drive) if (fam1_drive)
...@@ -2201,6 +2238,7 @@ static int cc_ModeSelect(int framesize) ...@@ -2201,6 +2238,7 @@ static int cc_ModeSelect(int framesize)
int i; int i;
if (fam2_drive) return (0); if (fam2_drive) return (0);
if (famV_drive) return (0);
D_S[d].diskstate_flags &= ~frame_size_bit; D_S[d].diskstate_flags &= ~frame_size_bit;
clr_cmdbuf(); clr_cmdbuf();
D_S[d].frame_size=framesize; D_S[d].frame_size=framesize;
...@@ -2251,6 +2289,7 @@ static int cc_GetVolume(void) ...@@ -2251,6 +2289,7 @@ static int cc_GetVolume(void)
u_char chan1=1; u_char chan1=1;
u_char vol1=0; u_char vol1=0;
if (famV_drive) return (0);
D_S[d].diskstate_flags &= ~volume_bit; D_S[d].diskstate_flags &= ~volume_bit;
clr_cmdbuf(); clr_cmdbuf();
if (fam1_drive) if (fam1_drive)
...@@ -2381,7 +2420,7 @@ static int cc_ReadCapacity(void) ...@@ -2381,7 +2420,7 @@ static int cc_ReadCapacity(void)
int i, j; int i, j;
if (fam2_drive) return (0); /* some firmware lacks this command */ if (fam2_drive) return (0); /* some firmware lacks this command */
if (famL_drive) return (0); /* some firmware lacks this command */ if (famLV_drive) return (0); /* some firmware lacks this command */
if (famT_drive) return (0); /* done with cc_ReadTocDescr() */ if (famT_drive) return (0); /* done with cc_ReadTocDescr() */
D_S[d].diskstate_flags &= ~cd_size_bit; D_S[d].diskstate_flags &= ~cd_size_bit;
for (j=3;j>0;j--) for (j=3;j>0;j--)
...@@ -2435,11 +2474,11 @@ static int cc_ReadTocDescr(void) ...@@ -2435,11 +2474,11 @@ static int cc_ReadTocDescr(void)
response_count=6; response_count=6;
flags_cmd_out=f_putcmd|f_ResponseStatus|f_obey_p_check; flags_cmd_out=f_putcmd|f_ResponseStatus|f_obey_p_check;
} }
else if (fam0L_drive) else if (fam0LV_drive)
{ {
drvcmd[0]=CMD0_DISKINFO; drvcmd[0]=CMD0_DISKINFO;
response_count=6; response_count=6;
if(famL_drive) if(famLV_drive)
flags_cmd_out=f_putcmd; flags_cmd_out=f_putcmd;
else else
flags_cmd_out=f_putcmd|f_getsta|f_ResponseStatus|f_obey_p_check; flags_cmd_out=f_putcmd|f_getsta|f_ResponseStatus|f_obey_p_check;
...@@ -2467,7 +2506,7 @@ static int cc_ReadTocDescr(void) ...@@ -2467,7 +2506,7 @@ static int cc_ReadTocDescr(void)
} }
i=cmd_out(); i=cmd_out();
if (i<0) return (i); if (i<0) return (i);
if ((fam1_drive)||(fam2_drive)||(famL_drive)||(fam0_drive)) if ((fam1_drive)||(fam2_drive)||(fam0LV_drive))
D_S[d].xa_byte=infobuf[0]; D_S[d].xa_byte=infobuf[0];
if (fam2_drive) if (fam2_drive)
{ {
...@@ -2527,7 +2566,7 @@ static int cc_ReadTocDescr(void) ...@@ -2527,7 +2566,7 @@ static int cc_ReadTocDescr(void)
D_S[d].n_last_track=infobuf[2]; D_S[d].n_last_track=infobuf[2];
D_S[d].size_msf=make32(make16(0,infobuf[3]),make16(infobuf[4],infobuf[5])); D_S[d].size_msf=make32(make16(0,infobuf[3]),make16(infobuf[4],infobuf[5]));
D_S[d].size_blk=msf2blk(D_S[d].size_msf); D_S[d].size_blk=msf2blk(D_S[d].size_msf);
if (famL_drive) D_S[d].CDsize_frm=D_S[d].size_blk+1; if (famLV_drive) D_S[d].CDsize_frm=D_S[d].size_blk+1;
} }
D_S[d].diskstate_flags |= toc_bit; D_S[d].diskstate_flags |= toc_bit;
msg(DBG_TOC,"TocDesc: %02X %02X %02X %08X\n", msg(DBG_TOC,"TocDesc: %02X %02X %02X %08X\n",
...@@ -2559,16 +2598,16 @@ static int cc_ReadTocEntry(int num) ...@@ -2559,16 +2598,16 @@ static int cc_ReadTocEntry(int num)
response_count=5; response_count=5;
flags_cmd_out=f_putcmd; flags_cmd_out=f_putcmd;
} }
else if (fam0L_drive) else if (fam0LV_drive)
{ {
drvcmd[0]=CMD0_READTOC; drvcmd[0]=CMD0_READTOC;
drvcmd[1]=0x02; drvcmd[1]=0x02;
drvcmd[2]=num; drvcmd[2]=num;
response_count=8; response_count=8;
if(famL_drive) if (famLV_drive)
flags_cmd_out=f_putcmd; flags_cmd_out=f_putcmd;
else else
flags_cmd_out=f_putcmd|f_getsta|f_ResponseStatus|f_obey_p_check; flags_cmd_out=f_putcmd|f_getsta|f_ResponseStatus|f_obey_p_check;
} }
else if (famT_drive) else if (famT_drive)
{ {
...@@ -2581,29 +2620,34 @@ static int cc_ReadTocEntry(int num) ...@@ -2581,29 +2620,34 @@ static int cc_ReadTocEntry(int num)
} }
i=cmd_out(); i=cmd_out();
if (i<0) return (i); if (i<0) return (i);
if ((fam1_drive)||(famL_drive)||(fam0_drive)) if ((fam1_drive)||(fam0LV_drive))
{ {
D_S[d].TocEnt_nixbyte=infobuf[0]; D_S[d].TocEnt_nixbyte=infobuf[0];
i=1; i=1;
} }
else if (fam2_drive) i=0; else if (fam2_drive) i=0;
else if (famT_drive) else if (famT_drive) i=5;
{
i=5;
}
D_S[d].TocEnt_ctl_adr=swap_nibbles(infobuf[i++]); D_S[d].TocEnt_ctl_adr=swap_nibbles(infobuf[i++]);
if ((fam1_drive)||(famL_drive)||(fam0_drive)) if ((fam1_drive)||(fam0L_drive))
{ {
D_S[d].TocEnt_number=infobuf[i++]; D_S[d].TocEnt_number=infobuf[i++];
D_S[d].TocEnt_format=infobuf[i]; D_S[d].TocEnt_format=infobuf[i];
} }
else D_S[d].TocEnt_number=num; else
{
D_S[d].TocEnt_number=num;
D_S[d].TocEnt_format=0;
}
if (fam1_drive) i=4; if (fam1_drive) i=4;
else if (fam0L_drive) i=5; else if (fam0LV_drive) i=5;
else if (fam2_drive) i=2; else if (fam2_drive) i=2;
else if (famT_drive) i=9; else if (famT_drive) i=9;
D_S[d].TocEnt_address=make32(make16(0,infobuf[i]), D_S[d].TocEnt_address=make32(make16(0,infobuf[i]),
make16(infobuf[i+1],infobuf[i+2])); make16(infobuf[i+1],infobuf[i+2]));
for (i=0;i<response_count;i++)
sprintf(&msgbuf[i*3], " %02X", infobuf[i]);
msgbuf[i*3]=0;
msg(DBG_ECS,"TocEntry:%s\n", msgbuf);
msg(DBG_TOC,"TocEntry: %02X %02X %02X %02X %08X\n", msg(DBG_TOC,"TocEntry: %02X %02X %02X %02X %08X\n",
D_S[d].TocEnt_nixbyte, D_S[d].TocEnt_ctl_adr, D_S[d].TocEnt_nixbyte, D_S[d].TocEnt_ctl_adr,
D_S[d].TocEnt_number, D_S[d].TocEnt_format, D_S[d].TocEnt_number, D_S[d].TocEnt_format,
...@@ -2666,6 +2710,7 @@ static int cc_ReadUPC(void) ...@@ -2666,6 +2710,7 @@ static int cc_ReadUPC(void)
if (fam2_drive) return (0); /* not implemented yet */ if (fam2_drive) return (0); /* not implemented yet */
if (famT_drive) return (0); /* not implemented yet */ if (famT_drive) return (0); /* not implemented yet */
if (famV_drive) return (0); /* not implemented yet */
#if 1 #if 1
if (fam0_drive) return (0); /* but it should work */ if (fam0_drive) return (0); /* but it should work */
#endif 1 #endif 1
...@@ -2779,7 +2824,7 @@ static int cc_CheckMultiSession(void) ...@@ -2779,7 +2824,7 @@ static int cc_CheckMultiSession(void)
make16(infobuf[2],infobuf[3]))); make16(infobuf[2],infobuf[3])));
} }
} }
else if (famL_drive) else if (famLV_drive)
{ {
drvcmd[0]=CMDL_MULTISESS; drvcmd[0]=CMDL_MULTISESS;
drvcmd[1]=3; drvcmd[1]=3;
...@@ -2828,7 +2873,7 @@ static int cc_SubChanInfo(int frame, int count, u_char *buffer) ...@@ -2828,7 +2873,7 @@ static int cc_SubChanInfo(int frame, int count, u_char *buffer)
{ {
int i; int i;
if (fam0L_drive) return (-ENOSYS); /* drive firmware lacks it */ if (fam0LV_drive) return (-ENOSYS); /* drive firmware lacks it */
if (famT_drive) if (famT_drive)
{ {
return (-1); return (-1);
...@@ -2944,11 +2989,10 @@ static int check_version(void) ...@@ -2944,11 +2989,10 @@ static int check_version(void)
int i, j, l; int i, j, l;
int teac_possible=0; int teac_possible=0;
msg(DBG_INI,"check_version entered.\n"); msg(DBG_INI,"check_version: id=%d, d=%d.\n", D_S[d].drv_id, d);
msg(DBG_TE2,"check_version: id=%d, d=%d.\n", D_S[d].drv_id, d);
D_S[d].drv_type=0; D_S[d].drv_type=0;
/* check for CR-52x, CR-56x and LCS-7260 */ /* check for CR-52x, CR-56x, LCS-7260 and ECS-AT */
/* clear any pending error state */ /* clear any pending error state */
clr_cmdbuf(); clr_cmdbuf();
drvcmd[0]=CMD0_READ_ERR; /* same as CMD1_ and CMDL_ */ drvcmd[0]=CMD0_READ_ERR; /* same as CMD1_ and CMDL_ */
...@@ -2972,13 +3016,11 @@ static int check_version(void) ...@@ -2972,13 +3016,11 @@ static int check_version(void)
for (i=0;i<12;i++) for (i=0;i<12;i++)
sprintf(&msgbuf[i*3], " %02X", infobuf[i]); sprintf(&msgbuf[i*3], " %02X", infobuf[i]);
msgbuf[i*3]=0; msgbuf[i*3]=0;
msg(DBG_IDX,"infobuf =%s\n", msgbuf); msg(DBG_ECS,"infobuf =%s\n", msgbuf);
msg(DBG_000,"infobuf =%s\n", msgbuf);
for (i=0;i<12;i++) for (i=0;i<12;i++)
sprintf(&msgbuf[i*3], " %c ", infobuf[i]); sprintf(&msgbuf[i*3], " %c ", infobuf[i]);
msgbuf[i*3]=0; msgbuf[i*3]=0;
msg(DBG_IDX,"infobuf =%s\n", msgbuf); msg(DBG_ECS,"infobuf =%s\n", msgbuf);
msg(DBG_000,"infobuf =%s\n", msgbuf);
} }
for (i=0;i<4;i++) if (infobuf[i]!=family1[i]) break; for (i=0;i<4;i++) if (infobuf[i]!=family1[i]) break;
if (i==4) if (i==4)
...@@ -3019,6 +3061,18 @@ static int check_version(void) ...@@ -3019,6 +3061,18 @@ static int check_version(void)
} }
} }
if (!D_S[d].drv_type) if (!D_S[d].drv_type)
{
for (i=0;i<6;i++) if (infobuf[i]!=familyV[i]) break;
if (i==6)
{
for (j=0;j<6;j++)
D_S[d].drive_model[j]=infobuf[j];
D_S[d].drive_model[6]=0;
D_S[d].drv_type=drv_famV;
i+=2; /* 2 blanks before version */
}
}
if (!D_S[d].drv_type)
{ {
/* check for CD200 */ /* check for CD200 */
clr_cmdbuf(); clr_cmdbuf();
...@@ -3136,18 +3190,18 @@ static int check_version(void) ...@@ -3136,18 +3190,18 @@ static int check_version(void)
for (j=0;j<4;j++) D_S[d].firmware_version[j]=infobuf[i+j]; for (j=0;j<4;j++) D_S[d].firmware_version[j]=infobuf[i+j];
if (famL_drive) if (famL_drive)
{ {
u_char lcs_firm_e1[]="A E1"; u_char lcs_firm_e1[]="A E1";
u_char lcs_firm_f4[]="A4F4"; u_char lcs_firm_f4[]="A4F4";
for (j=0;j<4;j++) for (j=0;j<4;j++)
if (D_S[d].firmware_version[j]!=lcs_firm_e1[j]) break; if (D_S[d].firmware_version[j]!=lcs_firm_e1[j]) break;
if (j==4) D_S[d].drv_type=drv_e1; if (j==4) D_S[d].drv_type=drv_e1;
for (j=0;j<4;j++)
if (D_S[d].firmware_version[j]!=lcs_firm_f4[j]) break;
if (j==4) D_S[d].drv_type=drv_f4;
for (j=0;j<4;j++) if (D_S[d].drv_type==drv_famL) ask_mail();
if (D_S[d].firmware_version[j]!=lcs_firm_f4[j]) break;
if (j==4) D_S[d].drv_type=drv_f4;
if (D_S[d].drv_type==drv_famL) ask_mail();
} }
else if (famT_drive) else if (famT_drive)
{ {
...@@ -3168,7 +3222,7 @@ static int check_version(void) ...@@ -3168,7 +3222,7 @@ static int check_version(void)
D_S[d].firmware_version[3]='0'+(j&0x0f); D_S[d].firmware_version[3]='0'+(j&0x0f);
} }
} }
else /* CR-52x, CR-56x, CD200 */ else /* CR-52x, CR-56x, CD200, ECS-AT */
{ {
j = (D_S[d].firmware_version[0] & 0x0F) * 100 + j = (D_S[d].firmware_version[0] & 0x0F) * 100 +
(D_S[d].firmware_version[2] & 0x0F) *10 + (D_S[d].firmware_version[2] & 0x0F) *10 +
...@@ -3195,14 +3249,21 @@ static int check_version(void) ...@@ -3195,14 +3249,21 @@ static int check_version(void)
{ {
if (D_S[d].drive_model[5]=='F') if (D_S[d].drive_model[5]=='F')
{ {
if ((j!=1)&&(j!=35)&&(j!=200)&&(j!=210)) ask_mail(); /* unknown version at time */ if ((j!=1)&&(j!=35)&&(j!=200)&&(j!=210))
ask_mail(); /* unknown version at time */
} }
else else
{ {
msg(DBG_INF,"this CD200 drive is not fully supported yet - only audio will work.\n"); msg(DBG_INF,"this CD200 drive is not fully supported yet - only audio will work.\n");
if ((j!=101)&&(j!=35)) ask_mail(); /* unknown version at time */ if ((j!=101)&&(j!=35))
ask_mail(); /* unknown version at time */
} }
} }
else if (famV_drive)
{
if (j==100) D_S[d].drv_type=drv_at;
ask_mail(); /* hopefully we get some feedback by this */
}
} }
msg(DBG_LCS,"drive type %02X\n",D_S[d].drv_type); msg(DBG_LCS,"drive type %02X\n",D_S[d].drv_type);
msg(DBG_INI,"check_version done.\n"); msg(DBG_INI,"check_version done.\n");
...@@ -4049,6 +4110,7 @@ static int sbpcd_ioctl(struct inode *inode, struct file *file, u_int cmd, ...@@ -4049,6 +4110,7 @@ static int sbpcd_ioctl(struct inode *inode, struct file *file, u_int cmd,
msg(DBG_IOC,"ioctl: CDROMREADAUDIO entered.\n"); msg(DBG_IOC,"ioctl: CDROMREADAUDIO entered.\n");
if (fam0_drive) return (-EINVAL); if (fam0_drive) return (-EINVAL);
if (famL_drive) return (-EINVAL); if (famL_drive) return (-EINVAL);
if (famV_drive) return (-EINVAL);
if (famT_drive) return (-EINVAL); if (famT_drive) return (-EINVAL);
if (D_S[d].aud_buf==NULL) return (-EINVAL); if (D_S[d].aud_buf==NULL) return (-EINVAL);
i=verify_area(VERIFY_READ, (void *) arg, sizeof(struct cdrom_read_audio)); i=verify_area(VERIFY_READ, (void *) arg, sizeof(struct cdrom_read_audio));
...@@ -4412,17 +4474,29 @@ static void sbp_read_cmd(void) ...@@ -4412,17 +4474,29 @@ static void sbp_read_cmd(void)
flags_cmd_out = f_putcmd | f_respo2 | f_ResponseStatus | f_obey_p_check; flags_cmd_out = f_putcmd | f_respo2 | f_ResponseStatus | f_obey_p_check;
clr_cmdbuf(); clr_cmdbuf();
if (fam0L_drive) if (famV_drive)
{
drvcmd[0]=CMDV_READ;
lba2msf(block,&drvcmd[1]); /* msf-bcd format required */
bin2bcdx(&drvcmd[1]);
bin2bcdx(&drvcmd[2]);
bin2bcdx(&drvcmd[3]);
drvcmd[4]=D_S[d].sbp_read_frames>>8;
drvcmd[5]=D_S[d].sbp_read_frames&0xff;
drvcmd[6]=0x02; /* flag "msf-bcd" */
}
else if (fam0L_drive)
{ {
flags_cmd_out |= f_lopsta | f_getsta | f_bit1; flags_cmd_out |= f_lopsta | f_getsta | f_bit1;
if (D_S[d].xa_byte==0x20) if (D_S[d].xa_byte==0x20)
{ {
cmd_type=READ_M2; cmd_type=READ_M2;
drvcmd[0]=CMD0_READ_XA; /* "read XA frames", old drives */ drvcmd[0]=CMD0_READ_XA; /* "read XA frames", old drives */
drvcmd[1]=(block>>16)&0x000000ff; drvcmd[1]=(block>>16)&0x0ff;
drvcmd[2]=(block>>8)&0x000000ff; drvcmd[2]=(block>>8)&0x0ff;
drvcmd[3]=block&0x000000ff; drvcmd[3]=block&0x0ff;
drvcmd[5]=D_S[d].sbp_read_frames; drvcmd[4]=(D_S[d].sbp_read_frames>>8)&0x0ff;
drvcmd[5]=D_S[d].sbp_read_frames&0x0ff;
} }
else else
{ {
...@@ -4436,11 +4510,12 @@ static void sbp_read_cmd(void) ...@@ -4436,11 +4510,12 @@ static void sbp_read_cmd(void)
} }
else else
{ {
drvcmd[1]=(block>>16)&0x000000ff; drvcmd[1]=(block>>16)&0x0ff;
drvcmd[2]=(block>>8)&0x000000ff; drvcmd[2]=(block>>8)&0x0ff;
drvcmd[3]=block&0x000000ff; drvcmd[3]=block&0x0ff;
} }
drvcmd[5]=D_S[d].sbp_read_frames; drvcmd[4]=(D_S[d].sbp_read_frames>>8)&0x0ff;
drvcmd[5]=D_S[d].sbp_read_frames&0x0ff;
drvcmd[6]=(D_S[d].drv_type<drv_201)?0:2; /* flag "lba or msf-bcd format" */ drvcmd[6]=(D_S[d].drv_type<drv_201)?0:2; /* flag "lba or msf-bcd format" */
} }
} }
...@@ -4448,13 +4523,15 @@ static void sbp_read_cmd(void) ...@@ -4448,13 +4523,15 @@ static void sbp_read_cmd(void)
{ {
drvcmd[0]=CMD1_READ; drvcmd[0]=CMD1_READ;
lba2msf(block,&drvcmd[1]); /* msf-bin format required */ lba2msf(block,&drvcmd[1]); /* msf-bin format required */
drvcmd[6]=D_S[d].sbp_read_frames; drvcmd[5]=(D_S[d].sbp_read_frames>>8)&0x0ff;
drvcmd[6]=D_S[d].sbp_read_frames&0x0ff;
} }
else if (fam2_drive) else if (fam2_drive)
{ {
drvcmd[0]=CMD2_READ; drvcmd[0]=CMD2_READ;
lba2msf(block,&drvcmd[1]); /* msf-bin format required */ lba2msf(block,&drvcmd[1]); /* msf-bin format required */
drvcmd[5]=D_S[d].sbp_read_frames; drvcmd[4]=(D_S[d].sbp_read_frames>>8)&0x0ff;
drvcmd[5]=D_S[d].sbp_read_frames&0x0ff;
drvcmd[6]=0x02; drvcmd[6]=0x02;
} }
else if (famT_drive) else if (famT_drive)
...@@ -4475,7 +4552,7 @@ static void sbp_read_cmd(void) ...@@ -4475,7 +4552,7 @@ static void sbp_read_cmd(void)
#else #else
flags_cmd_out=f_putcmd; flags_cmd_out=f_putcmd;
response_count=0; response_count=0;
i=cmd_out(); /* immediate return here - read data "ourselves" */ i=cmd_out();
if (i<0) msg(DBG_INF,"error giving READ command: %0d\n", i); if (i<0) msg(DBG_INF,"error giving READ command: %0d\n", i);
#endif OLD #endif OLD
return; return;
...@@ -4509,7 +4586,6 @@ static int sbp_data(void) ...@@ -4509,7 +4586,6 @@ static int sbp_data(void)
if (D_S[d].f_multisession) max_latency=9*HZ; if (D_S[d].f_multisession) max_latency=9*HZ;
else max_latency=3*HZ; else max_latency=3*HZ;
#endif #endif
msg(DBG_TE2,"beginning to READ\n");
duration=jiffies; duration=jiffies;
for (frame=0;frame<D_S[d].sbp_read_frames&&!error_flag; frame++) for (frame=0;frame<D_S[d].sbp_read_frames&&!error_flag; frame++)
{ {
...@@ -4529,7 +4605,7 @@ static int sbp_data(void) ...@@ -4529,7 +4605,7 @@ static int sbp_data(void)
j=inb(CDi_status); j=inb(CDi_status);
if (!(j&s_not_data_ready)) break;; if (!(j&s_not_data_ready)) break;;
if (!(j&s_not_result_ready)) break; if (!(j&s_not_result_ready)) break;
if (fam0L_drive) if (j&s_attention) break; if (fam0LV_drive) if (j&s_attention) break;
} }
if (!(j&s_not_data_ready)) goto data_ready; if (!(j&s_not_data_ready)) goto data_ready;
if (try==0) if (try==0)
...@@ -4580,7 +4656,6 @@ static int sbp_data(void) ...@@ -4580,7 +4656,6 @@ static int sbp_data(void)
if (cmd_type==READ_M2) insb(CDi_data, xa_head_buf, CD_XA_HEAD); if (cmd_type==READ_M2) insb(CDi_data, xa_head_buf, CD_XA_HEAD);
insb(CDi_data, p, CD_FRAMESIZE); insb(CDi_data, p, CD_FRAMESIZE);
if (cmd_type==READ_M2) insb(CDi_data, xa_tail_buf, CD_XA_TAIL); if (cmd_type==READ_M2) insb(CDi_data, xa_tail_buf, CD_XA_TAIL);
if (famT_drive) msg(DBG_TE2, "================frame read=================.\n");
D_S[d].sbp_current++; D_S[d].sbp_current++;
if (sbpro_type==1) OUT(CDo_sel_i_d,0); if (sbpro_type==1) OUT(CDo_sel_i_d,0);
if (cmd_type==READ_M2) if (cmd_type==READ_M2)
...@@ -4599,7 +4674,7 @@ static int sbp_data(void) ...@@ -4599,7 +4674,7 @@ static int sbp_data(void)
} }
} }
duration=jiffies-duration; duration=jiffies-duration;
msg(DBG_TE2,"time to read %d frames: %d jiffies .\n",frame,duration); msg(DBG_TEA,"time to read %d frames: %d jiffies .\n",frame,duration);
if (famT_drive) if (famT_drive)
{ {
wait=8; wait=8;
...@@ -4635,7 +4710,7 @@ static int sbp_data(void) ...@@ -4635,7 +4710,7 @@ static int sbp_data(void)
#if 1 #if 1
for (j=0;j<l;j++) sprintf(&msgbuf[j*3], " %02X", infobuf[j]); for (j=0;j<l;j++) sprintf(&msgbuf[j*3], " %02X", infobuf[j]);
msgbuf[j*3]=0; msgbuf[j*3]=0;
msg(DBG_TE2,"sbp_data info response:%s\n", msgbuf); msg(DBG_TEA,"sbp_data info response:%s\n", msgbuf);
#endif #endif
if (infobuf[0]==0x02) if (infobuf[0]==0x02)
{ {
...@@ -4681,7 +4756,7 @@ static int sbp_data(void) ...@@ -4681,7 +4756,7 @@ static int sbp_data(void)
return (0); return (0);
} }
if (fam0L_drive) if (fam0LV_drive)
{ {
SBPCD_CLI; SBPCD_CLI;
i=maxtim_data; i=maxtim_data;
...@@ -4714,13 +4789,13 @@ static int sbp_data(void) ...@@ -4714,13 +4789,13 @@ static int sbp_data(void)
#endif 0 #endif 0
do do
{ {
if (fam0L_drive) cc_ReadStatus(); if (fam0LV_drive) cc_ReadStatus();
#if 1 #if 1
if (famT_drive) msg(DBG_TE2, "================before ResponseStatus=================.\n", i); if (famT_drive) msg(DBG_TEA, "================before ResponseStatus=================.\n", i);
#endif 1 #endif 1
i=ResponseStatus(); /* builds status_bits, returns orig. status (old) or faked p_success (new) */ i=ResponseStatus(); /* builds status_bits, returns orig. status (old) or faked p_success (new) */
#if 1 #if 1
if (famT_drive) msg(DBG_TE2, "================ResponseStatus: %d=================.\n", i); if (famT_drive) msg(DBG_TEA, "================ResponseStatus: %d=================.\n", i);
#endif 1 #endif 1
if (i<0) if (i<0)
{ {
...@@ -4728,7 +4803,7 @@ static int sbp_data(void) ...@@ -4728,7 +4803,7 @@ static int sbp_data(void)
return (0); return (0);
} }
} }
while ((fam0L_drive)&&(!st_check)&&(!(i&p_success))); while ((fam0LV_drive)&&(!st_check)&&(!(i&p_success)));
if (st_check) if (st_check)
{ {
i=cc_ReadError(); i=cc_ReadError();
...@@ -4747,9 +4822,6 @@ static int sbp_data(void) ...@@ -4747,9 +4822,6 @@ static int sbp_data(void)
D_S[d].sbp_first_frame = CURRENT -> sector / 4; D_S[d].sbp_first_frame = CURRENT -> sector / 4;
D_S[d].sbp_last_frame = D_S[d].sbp_first_frame + D_S[d].sbp_read_frames - 1; D_S[d].sbp_last_frame = D_S[d].sbp_first_frame + D_S[d].sbp_read_frames - 1;
sbp_transfer(); sbp_transfer();
#if 1
if (famT_drive) msg(DBG_TE2, "================sbp_transfer() done=================.\n");
#endif 1
return (1); return (1);
} }
/*==========================================================================*/ /*==========================================================================*/
...@@ -4787,10 +4859,10 @@ static int sbpcd_open(struct inode *ip, struct file *fp) ...@@ -4787,10 +4859,10 @@ static int sbpcd_open(struct inode *ip, struct file *fp)
msg(DBG_INF,"sbpcd_open: ResponseStatus timed out (%d).\n",i); msg(DBG_INF,"sbpcd_open: ResponseStatus timed out (%d).\n",i);
return (-EIO); /* drive doesn't respond */ return (-EIO); /* drive doesn't respond */
} }
if (famT_drive) msg(DBG_TE2,"sbpcd_open: ResponseStatus=%02X\n", i); if (famT_drive) msg(DBG_TEA,"sbpcd_open: ResponseStatus=%02X\n", i);
if (!st_door_closed) if (!st_door_closed)
{ {
if (famT_drive) msg(DBG_TE2,"sbpcd_open: !st_door_closed.\n"); if (famT_drive) msg(DBG_TEA,"sbpcd_open: !st_door_closed.\n");
cc_CloseTray(); cc_CloseTray();
flags_cmd_out |= f_respo2; flags_cmd_out |= f_respo2;
cc_ReadStatus(); cc_ReadStatus();
...@@ -4799,13 +4871,13 @@ static int sbpcd_open(struct inode *ip, struct file *fp) ...@@ -4799,13 +4871,13 @@ static int sbpcd_open(struct inode *ip, struct file *fp)
if (!(famT_drive)) if (!(famT_drive))
if (!st_spinning) if (!st_spinning)
{ {
if (famT_drive) msg(DBG_TE2,"sbpcd_open: !st_spinning.\n"); if (famT_drive) msg(DBG_TEA,"sbpcd_open: !st_spinning.\n");
cc_SpinUp(); cc_SpinUp();
flags_cmd_out |= f_respo2; flags_cmd_out |= f_respo2;
cc_ReadStatus(); cc_ReadStatus();
i=ResponseStatus(); i=ResponseStatus();
} }
if (famT_drive) msg(DBG_TE2,"sbpcd_open: status %02X\n", D_S[d].status_bits); if (famT_drive) msg(DBG_TEA,"sbpcd_open: status %02X\n", D_S[d].status_bits);
if (!st_door_closed||!st_caddy_in) if (!st_door_closed||!st_caddy_in)
{ {
msg(DBG_INF, "sbpcd_open: no disk in drive.\n"); msg(DBG_INF, "sbpcd_open: no disk in drive.\n");
...@@ -4829,9 +4901,9 @@ static int sbpcd_open(struct inode *ip, struct file *fp) ...@@ -4829,9 +4901,9 @@ static int sbpcd_open(struct inode *ip, struct file *fp)
{ {
i=LockDoor(); i=LockDoor();
D_S[d].open_count=1; D_S[d].open_count=1;
if (famT_drive) msg(DBG_TE2,"sbpcd_open: before i=DiskInfo();.\n"); if (famT_drive) msg(DBG_TEA,"sbpcd_open: before i=DiskInfo();.\n");
i=DiskInfo(); i=DiskInfo();
if (famT_drive) msg(DBG_TE2,"sbpcd_open: after i=DiskInfo();.\n"); if (famT_drive) msg(DBG_TEA,"sbpcd_open: after i=DiskInfo();.\n");
if ((D_S[d].ored_ctl_adr&0x40)==0) if ((D_S[d].ored_ctl_adr&0x40)==0)
msg(DBG_INF,"CD contains no data tracks.\n"); msg(DBG_INF,"CD contains no data tracks.\n");
} }
...@@ -4970,9 +5042,17 @@ void sbpcd_setup(const char *s, int *p) ...@@ -4970,9 +5042,17 @@ void sbpcd_setup(const char *s, int *p)
*/ */
static int config_spea(void) static int config_spea(void)
{ {
int n_ports=0x10; /* 2:0x00, 8:0x10, 16:0x20, 32:0x30 */ /*
/* base address offset between configuration port and CDROM port */ * base address offset between configuration port and CDROM port,
int irq_number=0; /* off:0x00, 2:0x01, 7:0x03, 12:0x05, 15:0x07 */ * this probably defines the interface type
* 2 (type=??): 0x00
* 8 (type=LaserMate):0x10
* 16 (type=??):0x20
* 32 (type=??):0x30
*/
int n_ports=0x10;
int irq_number=0; /* off:0x00, 2/9:0x01, 7:0x03, 12:0x05, 15:0x07 */
int dma_channel=0; /* off: 0x00, 0:0x08, 1:0x18, 3:0x38, 5:0x58, 6:0x68 */ int dma_channel=0; /* off: 0x00, 0:0x08, 1:0x18, 3:0x38, 5:0x58, 6:0x68 */
int dack_polarity=0; /* L:0x00, H:0x80 */ int dack_polarity=0; /* L:0x00, H:0x80 */
int drq_polarity=0x40; /* L:0x00, H:0x40 */ int drq_polarity=0x40; /* L:0x00, H:0x40 */
...@@ -5221,8 +5301,8 @@ int SBPCD_INIT(void) ...@@ -5221,8 +5301,8 @@ int SBPCD_INIT(void)
} }
blksize_size[MAJOR_NR]=sbpcd_blocksizes; blksize_size[MAJOR_NR]=sbpcd_blocksizes;
init_done:
#ifndef MODULE #ifndef MODULE
init_done:
#if !(SBPCD_ISSUE-1) #if !(SBPCD_ISSUE-1)
#ifdef CONFIG_SBPCD2 #ifdef CONFIG_SBPCD2
sbpcd2_init(); sbpcd2_init();
......
...@@ -59,6 +59,7 @@ static int softdog_open(struct inode *inode, struct file *file) ...@@ -59,6 +59,7 @@ static int softdog_open(struct inode *inode, struct file *file)
*/ */
watchdog_ticktock.expires=jiffies+TIMER_MARGIN; watchdog_ticktock.expires=jiffies+TIMER_MARGIN;
add_timer(&watchdog_ticktock); add_timer(&watchdog_ticktock);
timer_alive++;
return 0; return 0;
} }
...@@ -111,5 +112,5 @@ void watchdog_init(void) ...@@ -111,5 +112,5 @@ void watchdog_init(void)
mouse_register(&softdog_mouse); mouse_register(&softdog_mouse);
init_timer(&watchdog_ticktock); init_timer(&watchdog_ticktock);
watchdog_ticktock.function=watchdog_fire; watchdog_ticktock.function=watchdog_fire;
printk("Software Watchdog Timer: 0.02\n"); printk("Software Watchdog Timer: 0.03\n");
} }
...@@ -1177,6 +1177,7 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip, ...@@ -1177,6 +1177,7 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip,
char chip_str[80]; char chip_str[80];
int script_len = 0, dsa_len = 0, size = 0, max_cmd_size = 0, int script_len = 0, dsa_len = 0, size = 0, max_cmd_size = 0,
schedule_size = 0, ok = 0; schedule_size = 0, ok = 0;
void *tmp;
options |= perm_options; options |= perm_options;
...@@ -1221,14 +1222,7 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip, ...@@ -1221,14 +1222,7 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip,
tpnt->sg_tablesize + tpnt->sg_tablesize +
3 /* Current startup / termination required per phase */ 3 /* Current startup / termination required per phase */
) * ) *
8 /* Each instruction is eight bytes */ 8 /* Each instruction is eight bytes */;
+ (sizeof(void *) - sizeof(u32)); /* to ensure proper alignment */
/* Note that alignment will be guaranteed, since we put the command
allocated at probe time after the fixed-up SCSI script, which
consists of 32 bit words, aligned on a 32 bit boundary. But
on a 64bit machine we need 8 byte alignment for hostdata->free, so
we add in another 4 bytes to take care of potential misalignment
*/
/* Allocate fixed part of hostdata, dynamic part to hold appropriate /* Allocate fixed part of hostdata, dynamic part to hold appropriate
SCSI SCRIPT(tm) plus a single, maximum-sized NCR53c7x0_cmd structure. SCSI SCRIPT(tm) plus a single, maximum-sized NCR53c7x0_cmd structure.
...@@ -1251,8 +1245,14 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip, ...@@ -1251,8 +1245,14 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip,
after all device driver initialization). after all device driver initialization).
*/ */
size = sizeof(struct NCR53c7x0_hostdata) + script_len + max_cmd_size + size = sizeof(struct NCR53c7x0_hostdata) + script_len +
schedule_size; /* Note that alignment will be guaranteed, since we put the command
allocated at probe time after the fixed-up SCSI script, which
consists of 32 bit words, aligned on a 32 bit boundary. But
on a 64bit machine we need 8 byte alignment for hostdata->free, so
we add in another 4 bytes to take care of potential misalignment
*/
(sizeof(void *) - sizeof(u32)) + max_cmd_size + schedule_size;
instance = scsi_register (tpnt, size); instance = scsi_register (tpnt, size);
if (!instance) if (!instance)
...@@ -1321,15 +1321,9 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip, ...@@ -1321,15 +1321,9 @@ normal_init (Scsi_Host_Template *tpnt, int board, int chip,
hostdata->max_cmd_size = max_cmd_size; hostdata->max_cmd_size = max_cmd_size;
hostdata->num_cmds = 1; hostdata->num_cmds = 1;
/* Initialize single command */ /* Initialize single command */
hostdata->free = (struct NCR53c7x0_cmd *) tmp = (hostdata->script + hostdata->script_count);
(hostdata->script + hostdata->script_count); hostdata->free = ROUNDUP(tmp, void *);
/* hostdata->free->real = tmp;
* FIXME: This is wrong. If we add max_cmd_size to hostdata->free
* once it's been rounded up, we end up going past the end of what
* we allocated.
*/
hostdata->free = ROUNDUP(hostdata->free, void *);
hostdata->free->real = (void *) hostdata->free;
hostdata->free->size = max_cmd_size; hostdata->free->size = max_cmd_size;
hostdata->free->free = NULL; hostdata->free->free = NULL;
hostdata->free->next = NULL; hostdata->free->next = NULL;
...@@ -2165,8 +2159,10 @@ abnormal_finished (struct NCR53c7x0_cmd *cmd, int result) { ...@@ -2165,8 +2159,10 @@ abnormal_finished (struct NCR53c7x0_cmd *cmd, int result) {
if (left < 0) if (left < 0)
printk ("scsi%d: loop detected in host running list for scsi pid %ld\n", printk ("scsi%d: loop detected in host running list for scsi pid %ld\n",
host->host_no, c->pid); host->host_no, c->pid);
else if (linux_search) else if (linux_search) {
*linux_prev = linux_search->next; *linux_prev = linux_search->next;
--hostdata->busy[c->target][c->lun];
}
/* Return the NCR command structure to the free list */ /* Return the NCR command structure to the free list */
cmd->next = hostdata->free; cmd->next = hostdata->free;
...@@ -2863,7 +2859,9 @@ NCR53c8x0_dstat_sir_intr (struct Scsi_Host *host, struct ...@@ -2863,7 +2859,9 @@ NCR53c8x0_dstat_sir_intr (struct Scsi_Host *host, struct
#endif #endif
#ifdef A_int_debug_panic #ifdef A_int_debug_panic
case A_int_debug_panic: case A_int_debug_panic:
panic("scsi%d : int_debug_panic received\n", host->host_no); printk("scsi%d : int_debug_panic received\n", host->host_no);
print_lots (host);
return SPECIFIC_INT_PANIC;
#endif #endif
#ifdef A_int_debug_saved #ifdef A_int_debug_saved
case A_int_debug_saved: case A_int_debug_saved:
...@@ -3376,15 +3374,16 @@ NCR53c8x0_soft_reset (struct Scsi_Host *host) { ...@@ -3376,15 +3374,16 @@ NCR53c8x0_soft_reset (struct Scsi_Host *host) {
NCR53c7x0_write8(STEST3_REG_800, STEST3_800_TE); NCR53c7x0_write8(STEST3_REG_800, STEST3_800_TE);
} }
/* /*
* Function static struct NCR53c7x0_cmd *allocate_cmd (Scsi_Cmnd *cmd) * Function static struct NCR53c7x0_cmd *allocate_cmd (Scsi_Cmnd *cmd)
* *
* Purpose : Return the first free NCR53c7x0_cmd structure (which are * Purpose : Return the first free NCR53c7x0_cmd structure (which are
* reused in a LIFO maner to minimize cache thrashing). * reused in a LIFO maner to minimize cache thrashing).
* *
* Side effects : If we don't have enough NCR53c7x0_cmd structures, * Side effects : If we haven't yet scheduled allocation of NCR53c7x0_cmd
* allocate more. Teach programmers not to drink and hack. * structures for this device, do so. Attempt to complete all scheduled
* allocations using kmalloc(), putting NCR53c7x0_cmd structures on
* the free list. Teach programmers not to drink and hack.
* *
* Inputs : cmd - SCSI command * Inputs : cmd - SCSI command
* *
...@@ -3409,20 +3408,28 @@ allocate_cmd (Scsi_Cmnd *cmd) { ...@@ -3409,20 +3408,28 @@ allocate_cmd (Scsi_Cmnd *cmd) {
cmd->target, cmd->lun, (hostdata->cmd_allocated[cmd->target] & cmd->target, cmd->lun, (hostdata->cmd_allocated[cmd->target] &
(1 << cmd->lun)) ? "allready allocated" : "not allocated"); (1 << cmd->lun)) ? "allready allocated" : "not allocated");
/* /*
* Under Linux 1.2.x, kmalloc() and friends are unavailable until after * If we have not yet reserved commands for this I_T_L nexus, and
* device driver initialization has happened. Calling kmalloc() * the device exists (as indicated by permanant Scsi_Cmnd structures
* during scsi device initialization will print a "cannot get free page" * being allocated under 1.3.x, or being outside of scan_scsis in
* message. To avoid too many of these, we'll forget about trying * 1.2.x), do so now.
* to allocate command structures until AFTER initialization.
*/ */
if (!(hostdata->cmd_allocated[cmd->target] & (1 << cmd->lun)) &&
#ifdef LINUX_1_2 #ifdef LINUX_1_2
if (!in_scan_scsis) !in_scan_scsis
#else
cmd->device && cmd->device->has_cmdblocks
#endif #endif
) {
if ((hostdata->extra_allocate + hostdata->num_cmds) < host->can_queue)
hostdata->extra_allocate += host->cmd_per_lun;
hostdata->cmd_allocated[cmd->target] |= (1 << cmd->lun);
}
for (; hostdata->extra_allocate > 0 ; --hostdata->extra_allocate, for (; hostdata->extra_allocate > 0 ; --hostdata->extra_allocate,
++hostdata->num_cmds) { ++hostdata->num_cmds) {
/* kmalloc() can allocate any size, but historically has returned /* historically, kmalloc has returned unaligned addresses; pad so we
unaligned addresses, so we need to allow for alignment */ have enough room to ROUNDUP */
size = hostdata->max_cmd_size + sizeof (void *); size = hostdata->max_cmd_size + sizeof (void *);
/* FIXME: for ISA bus '7xx chips, we need to or GFP_DMA in here */ /* FIXME: for ISA bus '7xx chips, we need to or GFP_DMA in here */
real = kmalloc (size, GFP_ATOMIC); real = kmalloc (size, GFP_ATOMIC);
...@@ -4445,30 +4452,10 @@ NCR53c7x0_intr (int irq, struct pt_regs * regs) { ...@@ -4445,30 +4452,10 @@ NCR53c7x0_intr (int irq, struct pt_regs * regs) {
host->host_no, tmp->pid, tmp->target, tmp->lun, tmp->result); host->host_no, tmp->pid, tmp->target, tmp->lun, tmp->result);
print_command (tmp->cmnd); print_command (tmp->cmnd);
} }
#if 0 #if 0
hostdata->options &= ~OPTION_DEBUG_INTR; hostdata->options &= ~OPTION_DEBUG_INTR;
#endif #endif
/*
* If we have not yet reserved commands for this I_T_L nexus, and the
* command completed successfully, reserve NCR53c7x0_cmd structures
* which will be allocated the next time we run the allocate
* routine.
*/
if (!(hostdata->cmd_allocated[tmp->target] &
(1 << tmp->lun)) &&
status_byte(tmp->result) == GOOD) {
if ((hostdata->extra_allocate + hostdata->num_cmds)
< host->can_queue) {
hostdata->extra_allocate +=
host->cmd_per_lun;
}
hostdata->cmd_allocated[tmp->target] |=
(1 << tmp->lun);
}
tmp->scsi_done(tmp); tmp->scsi_done(tmp);
goto restart; goto restart;
...@@ -5183,7 +5170,7 @@ intr_dma (struct Scsi_Host *host, struct NCR53c7x0_cmd *cmd) { ...@@ -5183,7 +5170,7 @@ intr_dma (struct Scsi_Host *host, struct NCR53c7x0_cmd *cmd) {
printk(KERN_ALERT "scsi%d : unexpected single step interrupt at\n" printk(KERN_ALERT "scsi%d : unexpected single step interrupt at\n"
" ", host->host_no); " ", host->host_no);
print_insn (host, dsp, KERN_ALERT "", 1); print_insn (host, dsp, KERN_ALERT "", 1);
printk(KERN_ALERT " mail drew@colorado.edu\n"); printk(KERN_ALERT " mail drew@PoohSticks.ORG\n");
FATAL (host); FATAL (host);
} }
} }
...@@ -5808,16 +5795,24 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) { ...@@ -5808,16 +5795,24 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) {
dsa[hostdata->dsa_msgout / sizeof(u32) + 1], dsa[hostdata->dsa_msgout / sizeof(u32) + 1],
bus_to_virt (dsa[hostdata->dsa_msgout / sizeof(u32) + 1])); bus_to_virt (dsa[hostdata->dsa_msgout / sizeof(u32) + 1]));
for (i = dsa[hostdata->dsa_msgout / sizeof(u32)], /*
ptr = bus_to_virt (dsa[hostdata->dsa_msgout / sizeof(u32) + 1]); * Only print messages if they're sane in length so we don't
i > 0 && !check_address ((unsigned long) ptr, 1); * blow the kernel printk buffer on something which won't buy us
ptr += len, i -= len) { * anything.
printk(" "); */
len = print_msg (ptr);
printk("\n"); if (dsa[hostdata->dsa_msgout / sizeof(u32)] <
if (!len) sizeof (hostdata->free->select))
break; for (i = dsa[hostdata->dsa_msgout / sizeof(u32)],
} ptr = bus_to_virt (dsa[hostdata->dsa_msgout / sizeof(u32) + 1]);
i > 0 && !check_address ((unsigned long) ptr, 1);
ptr += len, i -= len) {
printk(" ");
len = print_msg (ptr);
printk("\n");
if (!len)
break;
}
printk(" + %d : select_indirect = 0x%x\n", printk(" + %d : select_indirect = 0x%x\n",
hostdata->dsa_select, dsa[hostdata->dsa_select / sizeof(u32)]); hostdata->dsa_select, dsa[hostdata->dsa_select / sizeof(u32)]);
...@@ -5953,12 +5948,15 @@ print_lots (struct Scsi_Host *host) { ...@@ -5953,12 +5948,15 @@ print_lots (struct Scsi_Host *host) {
sbcl = NCR53c7x0_read8 (SBCL_REG); sbcl = NCR53c7x0_read8 (SBCL_REG);
printk ("scsi%d : DCMD|DBC=0x%x, DSA=0x%lx (virt 0x%p)\n" printk ("scsi%d : DCMD|DBC=0x%x, DNAD=0x%x (virt 0x%p)\n"
" DSA=0x%lx (virt 0x%p)\n"
" DSPS=0x%x, TEMP=0x%x (virt 0x%p), DMODE=0x%x\n" " DSPS=0x%x, TEMP=0x%x (virt 0x%p), DMODE=0x%x\n"
" SXFER=0x%x, SCNTL3=0x%x\n" " SXFER=0x%x, SCNTL3=0x%x\n"
" %s%s%sphase=%s, %d bytes in SCSI FIFO\n" " %s%s%sphase=%s, %d bytes in SCSI FIFO\n"
" STEST0=0x%x\n", " STEST0=0x%x\n",
host->host_no, dbc_dcmd, virt_to_bus(dsa), dsa, host->host_no, dbc_dcmd, NCR53c7x0_read32(DNAD_REG),
bus_to_virt(NCR53c7x0_read32(DNAD_REG)),
virt_to_bus(dsa), dsa,
NCR53c7x0_read32(DSPS_REG), NCR53c7x0_read32(TEMP_REG), NCR53c7x0_read32(DSPS_REG), NCR53c7x0_read32(TEMP_REG),
bus_to_virt (NCR53c7x0_read32(TEMP_REG)), bus_to_virt (NCR53c7x0_read32(TEMP_REG)),
(int) NCR53c7x0_read8(hostdata->dmode), (int) NCR53c7x0_read8(hostdata->dmode),
......
...@@ -67,7 +67,7 @@ extern int NCR53c7xx_release(struct Scsi_Host *); ...@@ -67,7 +67,7 @@ extern int NCR53c7xx_release(struct Scsi_Host *);
#endif #endif
#ifdef LINUX_1_2 #ifdef LINUX_1_2
#define NCR53c7xx {NULL, NULL, "NCR53c{7,8}xx (rel 14)", NCR53c7xx_detect,\ #define NCR53c7xx {NULL, NULL, "NCR53c{7,8}xx (rel 17)", NCR53c7xx_detect,\
NULL, /* info */ NULL, /* command, deprecated */ NULL, \ NULL, /* info */ NULL, /* command, deprecated */ NULL, \
NCR53c7xx_queue_command, NCR53c7xx_abort, NCR53c7xx_reset, \ NCR53c7xx_queue_command, NCR53c7xx_abort, NCR53c7xx_reset, \
NULL /* slave attach */, scsicam_bios_param, /* can queue */ 24, \ NULL /* slave attach */, scsicam_bios_param, /* can queue */ 24, \
...@@ -75,7 +75,7 @@ extern int NCR53c7xx_release(struct Scsi_Host *); ...@@ -75,7 +75,7 @@ extern int NCR53c7xx_release(struct Scsi_Host *);
/* present */ 0, /* unchecked isa dma */ 0, DISABLE_CLUSTERING} /* present */ 0, /* unchecked isa dma */ 0, DISABLE_CLUSTERING}
#else #else
#define NCR53c7xx {NULL, NULL, NULL, NULL, \ #define NCR53c7xx {NULL, NULL, NULL, NULL, \
"NCR53c{7,8}xx (rel 14)", NCR53c7xx_detect,\ "NCR53c{7,8}xx (rel 17)", NCR53c7xx_detect,\
NULL, /* info */ NULL, /* command, deprecated */ NULL, \ NULL, /* info */ NULL, /* command, deprecated */ NULL, \
NCR53c7xx_queue_command, NCR53c7xx_abort, NCR53c7xx_reset, \ NCR53c7xx_queue_command, NCR53c7xx_abort, NCR53c7xx_reset, \
NULL /* slave attach */, scsicam_bios_param, /* can queue */ 24, \ NULL /* slave attach */, scsicam_bios_param, /* can queue */ 24, \
...@@ -1447,8 +1447,6 @@ struct NCR53c7x0_hostdata { ...@@ -1447,8 +1447,6 @@ struct NCR53c7x0_hostdata {
volatile u16 initiate_wdtr; volatile u16 initiate_wdtr;
/* Bit fielded list of targets we've talked to. */ /* Bit fielded list of targets we've talked to. */
volatile u16 talked_to; volatile u16 talked_to;
/* Bit fielded list of targets that answered */
volatile u16 answered;
/* Array of bit-fielded lun lists that we need to request_sense */ /* Array of bit-fielded lun lists that we need to request_sense */
volatile unsigned char request_sense[16]; volatile unsigned char request_sense[16];
......
...@@ -1109,17 +1109,24 @@ selected: ...@@ -1109,17 +1109,24 @@ selected:
; a new value to a previously NULL head of the issue queue. ; a new value to a previously NULL head of the issue queue.
; ;
; 2. The NCR53c810 was selected or reselected by another device. ; 2. The NCR53c810 was selected or reselected by another device.
; ;
; 3. The bus was allready busy since we were selected or reselected
; before starting the command.
wait_reselect_failed: wait_reselect_failed:
#ifdef EVENTS #ifdef EVENTS
INT int_EVENT_RESELECT_FAILED INT int_EVENT_RESELECT_FAILED
#endif #endif
; Check selected bit.
MOVE SIST0 & 0x20 TO SFBR MOVE SIST0 & 0x20 TO SFBR
JUMP selected, IF 0x20 JUMP selected, IF 0x20
; Reading CTEST2 clears the SIG_P bit in the ISTAT register. ; Reading CTEST2 clears the SIG_P bit in the ISTAT register.
MOVE CTEST2 & 0x40 TO SFBR MOVE CTEST2 & 0x40 TO SFBR
JUMP schedule, IF 0x40 JUMP schedule, IF 0x40
; Check connected bit.
; FIXME: this needs to change if we support target mode
MOVE ISTAT & 0x08 TO SFBR
JUMP reselected, IF 0x08
; FIXME : Something bogus happened, and we shouldn't fail silently. ; FIXME : Something bogus happened, and we shouldn't fail silently.
#if 0 #if 0
JUMP schedule JUMP schedule
...@@ -1141,6 +1148,11 @@ select_failed: ...@@ -1141,6 +1148,11 @@ select_failed:
; Reading CTEST2 clears the SIG_P bit in the ISTAT register. ; Reading CTEST2 clears the SIG_P bit in the ISTAT register.
MOVE CTEST2 & 0x40 TO SFBR MOVE CTEST2 & 0x40 TO SFBR
JUMP select, IF 0x40 JUMP select, IF 0x40
; Check connected bit.
; FIXME: this needs to change if we support target mode
; FIXME: is this really necessary?
MOVE ISTAT & 0x08 TO SFBR
JUMP reselected, IF 0x08
; FIXME : Something bogus happened, and we shouldn't fail silently. ; FIXME : Something bogus happened, and we shouldn't fail silently.
#if 0 #if 0
JUMP schedule JUMP schedule
......
...@@ -168,7 +168,7 @@ at 0x00000005 : */ 0x78380000,0x00000000, ...@@ -168,7 +168,7 @@ at 0x00000005 : */ 0x78380000,0x00000000,
/* /*
CALL scratch_to_dsa CALL scratch_to_dsa
at 0x00000007 : */ 0x88080000,0x00000960, at 0x00000007 : */ 0x88080000,0x00000980,
/* /*
CALL select CALL select
...@@ -231,7 +231,7 @@ at 0x0000001c : */ 0x78380000,0x00000000, ...@@ -231,7 +231,7 @@ at 0x0000001c : */ 0x78380000,0x00000000,
/* /*
CALL scratch_to_dsa CALL scratch_to_dsa
at 0x0000001e : */ 0x88080000,0x00000960, at 0x0000001e : */ 0x88080000,0x00000980,
/* /*
JUMP reselected_check_next JUMP reselected_check_next
...@@ -506,7 +506,7 @@ ENTRY dsa_schedule ...@@ -506,7 +506,7 @@ ENTRY dsa_schedule
; ;
CALL dsa_to_scratch CALL dsa_to_scratch
at 0x0000005a : */ 0x88080000,0x00000918, at 0x0000005a : */ 0x88080000,0x00000938,
/* /*
MOVE SCRATCH0 + dsa_next TO SCRATCH0 MOVE SCRATCH0 + dsa_next TO SCRATCH0
...@@ -548,7 +548,7 @@ at 0x0000006b : */ 0xc0000004,0x00000000,0x00000000, ...@@ -548,7 +548,7 @@ at 0x0000006b : */ 0xc0000004,0x00000000,0x00000000,
; And update the head pointer. ; And update the head pointer.
CALL dsa_to_scratch CALL dsa_to_scratch
at 0x0000006e : */ 0x88080000,0x00000918, at 0x0000006e : */ 0x88080000,0x00000938,
/* /*
MOVE dmode_ncr_to_memory TO DMODE MOVE dmode_ncr_to_memory TO DMODE
...@@ -645,7 +645,7 @@ at 0x0000007f : */ 0x60000200,0x00000000, ...@@ -645,7 +645,7 @@ at 0x0000007f : */ 0x60000200,0x00000000,
SELECT ATN FROM dsa_select, select_failed SELECT ATN FROM dsa_select, select_failed
at 0x00000081 : */ 0x4300003c,0x00000794, at 0x00000081 : */ 0x4300003c,0x000007a4,
/* /*
JUMP select_msgout, WHEN MSG_OUT JUMP select_msgout, WHEN MSG_OUT
...@@ -813,7 +813,7 @@ ENTRY end_data_transfer ...@@ -813,7 +813,7 @@ ENTRY end_data_transfer
do_dataout: do_dataout:
CALL dsa_to_scratch CALL dsa_to_scratch
at 0x000000a3 : */ 0x88080000,0x00000918, at 0x000000a3 : */ 0x88080000,0x00000938,
/* /*
MOVE SCRATCH0 + dsa_dataout TO SCRATCH0 MOVE SCRATCH0 + dsa_dataout TO SCRATCH0
...@@ -858,7 +858,7 @@ at 0x000000b7 : */ 0x80080000,0x00000000, ...@@ -858,7 +858,7 @@ at 0x000000b7 : */ 0x80080000,0x00000000,
do_datain: do_datain:
CALL dsa_to_scratch CALL dsa_to_scratch
at 0x000000b9 : */ 0x88080000,0x00000918, at 0x000000b9 : */ 0x88080000,0x00000938,
/* /*
MOVE SCRATCH0 + dsa_datain TO SCRATCH0 MOVE SCRATCH0 + dsa_datain TO SCRATCH0
...@@ -1599,7 +1599,7 @@ at 0x000001a2 : */ 0x78380000,0x00000000, ...@@ -1599,7 +1599,7 @@ at 0x000001a2 : */ 0x78380000,0x00000000,
/* /*
CALL scratch_to_dsa CALL scratch_to_dsa
at 0x000001a4 : */ 0x88080000,0x00000960, at 0x000001a4 : */ 0x88080000,0x00000980,
/* /*
; Fix the update-next pointer so that the reconnect_dsa_head ; Fix the update-next pointer so that the reconnect_dsa_head
...@@ -1760,12 +1760,15 @@ at 0x000001d9 : */ 0x98080000,0x00010000, ...@@ -1760,12 +1760,15 @@ at 0x000001d9 : */ 0x98080000,0x00010000,
; a new value to a previously NULL head of the issue queue. ; a new value to a previously NULL head of the issue queue.
; ;
; 2. The NCR53c810 was selected or reselected by another device. ; 2. The NCR53c810 was selected or reselected by another device.
; ;
; 3. The bus was allready busy since we were selected or reselected
; before starting the command.
wait_reselect_failed: wait_reselect_failed:
; Check selected bit.
MOVE SIST0 & 0x20 TO SFBR MOVE SIST0 & 0x20 TO SFBR
at 0x000001db : */ 0x74422000,0x00000000, at 0x000001db : */ 0x74422000,0x00000000,
...@@ -1783,13 +1786,23 @@ at 0x000001df : */ 0x741a4000,0x00000000, ...@@ -1783,13 +1786,23 @@ at 0x000001df : */ 0x741a4000,0x00000000,
at 0x000001e1 : */ 0x800c0040,0x00000000, at 0x000001e1 : */ 0x800c0040,0x00000000,
/* /*
; Check connected bit.
; FIXME: this needs to change if we support target mode
MOVE ISTAT & 0x08 TO SFBR
at 0x000001e3 : */ 0x74140800,0x00000000,
/*
JUMP reselected, IF 0x08
at 0x000001e5 : */ 0x800c0008,0x0000065c,
/*
; FIXME : Something bogus happened, and we shouldn't fail silently. ; FIXME : Something bogus happened, and we shouldn't fail silently.
INT int_debug_panic INT int_debug_panic
at 0x000001e3 : */ 0x98080000,0x030b0000, at 0x000001e7 : */ 0x98080000,0x030b0000,
/* /*
...@@ -1801,26 +1814,37 @@ at 0x000001e3 : */ 0x98080000,0x030b0000, ...@@ -1801,26 +1814,37 @@ at 0x000001e3 : */ 0x98080000,0x030b0000,
; Otherwise, mask the selected and reselected bits off SIST0 ; Otherwise, mask the selected and reselected bits off SIST0
MOVE SIST0 & 0x30 TO SFBR MOVE SIST0 & 0x30 TO SFBR
at 0x000001e5 : */ 0x74423000,0x00000000, at 0x000001e9 : */ 0x74423000,0x00000000,
/* /*
JUMP selected, IF 0x20 JUMP selected, IF 0x20
at 0x000001e7 : */ 0x800c0020,0x00000764, at 0x000001eb : */ 0x800c0020,0x00000764,
/* /*
JUMP reselected, IF 0x10 JUMP reselected, IF 0x10
at 0x000001e9 : */ 0x800c0010,0x0000065c, at 0x000001ed : */ 0x800c0010,0x0000065c,
/* /*
; If SIGP is set, the user just gave us another command, and ; If SIGP is set, the user just gave us another command, and
; we should restart or return to the scheduler. ; we should restart or return to the scheduler.
; Reading CTEST2 clears the SIG_P bit in the ISTAT register. ; Reading CTEST2 clears the SIG_P bit in the ISTAT register.
MOVE CTEST2 & 0x40 TO SFBR MOVE CTEST2 & 0x40 TO SFBR
at 0x000001eb : */ 0x741a4000,0x00000000, at 0x000001ef : */ 0x741a4000,0x00000000,
/* /*
JUMP select, IF 0x40 JUMP select, IF 0x40
at 0x000001ed : */ 0x800c0040,0x000001fc, at 0x000001f1 : */ 0x800c0040,0x000001fc,
/*
; Check connected bit.
; FIXME: this needs to change if we support target mode
; FIXME: is this really necessary?
MOVE ISTAT & 0x08 TO SFBR
at 0x000001f3 : */ 0x74140800,0x00000000,
/*
JUMP reselected, IF 0x08
at 0x000001f5 : */ 0x800c0008,0x0000065c,
/* /*
; FIXME : Something bogus happened, and we shouldn't fail silently. ; FIXME : Something bogus happened, and we shouldn't fail silently.
...@@ -1828,7 +1852,7 @@ at 0x000001ed : */ 0x800c0040,0x000001fc, ...@@ -1828,7 +1852,7 @@ at 0x000001ed : */ 0x800c0040,0x000001fc,
INT int_debug_panic INT int_debug_panic
at 0x000001ef : */ 0x98080000,0x030b0000, at 0x000001f7 : */ 0x98080000,0x030b0000,
/* /*
...@@ -1853,11 +1877,11 @@ ENTRY test_1 ...@@ -1853,11 +1877,11 @@ ENTRY test_1
test_1: test_1:
MOVE MEMORY 4, test_src, test_dest MOVE MEMORY 4, test_src, test_dest
at 0x000001f1 : */ 0xc0000004,0x00000000,0x00000000, at 0x000001f9 : */ 0xc0000004,0x00000000,0x00000000,
/* /*
INT int_test_1 INT int_test_1
at 0x000001f4 : */ 0x98080000,0x04000000, at 0x000001fc : */ 0x98080000,0x04000000,
/* /*
; ;
...@@ -1868,61 +1892,61 @@ ENTRY test_2 ...@@ -1868,61 +1892,61 @@ ENTRY test_2
test_2: test_2:
CLEAR TARGET CLEAR TARGET
at 0x000001f6 : */ 0x60000200,0x00000000, at 0x000001fe : */ 0x60000200,0x00000000,
/* /*
SELECT ATN FROM 0, test_2_fail SELECT ATN FROM 0, test_2_fail
at 0x000001f8 : */ 0x43000000,0x00000830, at 0x00000200 : */ 0x43000000,0x00000850,
/* /*
JUMP test_2_msgout, WHEN MSG_OUT JUMP test_2_msgout, WHEN MSG_OUT
at 0x000001fa : */ 0x860b0000,0x000007f0, at 0x00000202 : */ 0x860b0000,0x00000810,
/* /*
ENTRY test_2_msgout ENTRY test_2_msgout
test_2_msgout: test_2_msgout:
MOVE FROM 8, WHEN MSG_OUT MOVE FROM 8, WHEN MSG_OUT
at 0x000001fc : */ 0x1e000000,0x00000008, at 0x00000204 : */ 0x1e000000,0x00000008,
/* /*
MOVE FROM 16, WHEN CMD MOVE FROM 16, WHEN CMD
at 0x000001fe : */ 0x1a000000,0x00000010, at 0x00000206 : */ 0x1a000000,0x00000010,
/* /*
MOVE FROM 24, WHEN DATA_IN MOVE FROM 24, WHEN DATA_IN
at 0x00000200 : */ 0x19000000,0x00000018, at 0x00000208 : */ 0x19000000,0x00000018,
/* /*
MOVE FROM 32, WHEN STATUS MOVE FROM 32, WHEN STATUS
at 0x00000202 : */ 0x1b000000,0x00000020, at 0x0000020a : */ 0x1b000000,0x00000020,
/* /*
MOVE FROM 40, WHEN MSG_IN MOVE FROM 40, WHEN MSG_IN
at 0x00000204 : */ 0x1f000000,0x00000028, at 0x0000020c : */ 0x1f000000,0x00000028,
/* /*
MOVE SCNTL2 & 0x7f TO SCNTL2 MOVE SCNTL2 & 0x7f TO SCNTL2
at 0x00000206 : */ 0x7c027f00,0x00000000, at 0x0000020e : */ 0x7c027f00,0x00000000,
/* /*
CLEAR ACK CLEAR ACK
at 0x00000208 : */ 0x60000040,0x00000000, at 0x00000210 : */ 0x60000040,0x00000000,
/* /*
WAIT DISCONNECT WAIT DISCONNECT
at 0x0000020a : */ 0x48000000,0x00000000, at 0x00000212 : */ 0x48000000,0x00000000,
/* /*
test_2_fail: test_2_fail:
INT int_test_2 INT int_test_2
at 0x0000020c : */ 0x98080000,0x04010000, at 0x00000214 : */ 0x98080000,0x04010000,
/* /*
ENTRY debug_break ENTRY debug_break
debug_break: debug_break:
INT int_debug_break INT int_debug_break
at 0x0000020e : */ 0x98080000,0x03000000, at 0x00000216 : */ 0x98080000,0x03000000,
/* /*
; ;
...@@ -1938,26 +1962,26 @@ ENTRY target_abort ...@@ -1938,26 +1962,26 @@ ENTRY target_abort
target_abort: target_abort:
SET TARGET SET TARGET
at 0x00000210 : */ 0x58000200,0x00000000, at 0x00000218 : */ 0x58000200,0x00000000,
/* /*
DISCONNECT DISCONNECT
at 0x00000212 : */ 0x48000000,0x00000000, at 0x0000021a : */ 0x48000000,0x00000000,
/* /*
CLEAR TARGET CLEAR TARGET
at 0x00000214 : */ 0x60000200,0x00000000, at 0x0000021c : */ 0x60000200,0x00000000,
/* /*
JUMP schedule JUMP schedule
at 0x00000216 : */ 0x80080000,0x00000000, at 0x0000021e : */ 0x80080000,0x00000000,
/* /*
ENTRY initiator_abort ENTRY initiator_abort
initiator_abort: initiator_abort:
SET ATN SET ATN
at 0x00000218 : */ 0x58000008,0x00000000, at 0x00000220 : */ 0x58000008,0x00000000,
/* /*
; ;
; The SCSI-I specification says that targets may go into MSG out at ; The SCSI-I specification says that targets may go into MSG out at
...@@ -1970,97 +1994,97 @@ at 0x00000218 : */ 0x58000008,0x00000000, ...@@ -1970,97 +1994,97 @@ at 0x00000218 : */ 0x58000008,0x00000000,
; arbitrary number of bytes. ; arbitrary number of bytes.
JUMP spew_cmd, WHEN CMD JUMP spew_cmd, WHEN CMD
at 0x0000021a : */ 0x820b0000,0x00000898, at 0x00000222 : */ 0x820b0000,0x000008b8,
/* /*
JUMP eat_msgin, WHEN MSG_IN JUMP eat_msgin, WHEN MSG_IN
at 0x0000021c : */ 0x870b0000,0x000008a8, at 0x00000224 : */ 0x870b0000,0x000008c8,
/* /*
JUMP eat_datain, WHEN DATA_IN JUMP eat_datain, WHEN DATA_IN
at 0x0000021e : */ 0x810b0000,0x000008d8, at 0x00000226 : */ 0x810b0000,0x000008f8,
/* /*
JUMP eat_status, WHEN STATUS JUMP eat_status, WHEN STATUS
at 0x00000220 : */ 0x830b0000,0x000008c0, at 0x00000228 : */ 0x830b0000,0x000008e0,
/* /*
JUMP spew_dataout, WHEN DATA_OUT JUMP spew_dataout, WHEN DATA_OUT
at 0x00000222 : */ 0x800b0000,0x000008f0, at 0x0000022a : */ 0x800b0000,0x00000910,
/* /*
JUMP sated JUMP sated
at 0x00000224 : */ 0x80080000,0x000008f8, at 0x0000022c : */ 0x80080000,0x00000918,
/* /*
spew_cmd: spew_cmd:
MOVE 1, NCR53c7xx_zero, WHEN CMD MOVE 1, NCR53c7xx_zero, WHEN CMD
at 0x00000226 : */ 0x0a000001,0x00000000, at 0x0000022e : */ 0x0a000001,0x00000000,
/* /*
JUMP sated JUMP sated
at 0x00000228 : */ 0x80080000,0x000008f8, at 0x00000230 : */ 0x80080000,0x00000918,
/* /*
eat_msgin: eat_msgin:
MOVE 1, NCR53c7xx_sink, WHEN MSG_IN MOVE 1, NCR53c7xx_sink, WHEN MSG_IN
at 0x0000022a : */ 0x0f000001,0x00000000, at 0x00000232 : */ 0x0f000001,0x00000000,
/* /*
JUMP eat_msgin, WHEN MSG_IN JUMP eat_msgin, WHEN MSG_IN
at 0x0000022c : */ 0x870b0000,0x000008a8, at 0x00000234 : */ 0x870b0000,0x000008c8,
/* /*
JUMP sated JUMP sated
at 0x0000022e : */ 0x80080000,0x000008f8, at 0x00000236 : */ 0x80080000,0x00000918,
/* /*
eat_status: eat_status:
MOVE 1, NCR53c7xx_sink, WHEN STATUS MOVE 1, NCR53c7xx_sink, WHEN STATUS
at 0x00000230 : */ 0x0b000001,0x00000000, at 0x00000238 : */ 0x0b000001,0x00000000,
/* /*
JUMP eat_status, WHEN STATUS JUMP eat_status, WHEN STATUS
at 0x00000232 : */ 0x830b0000,0x000008c0, at 0x0000023a : */ 0x830b0000,0x000008e0,
/* /*
JUMP sated JUMP sated
at 0x00000234 : */ 0x80080000,0x000008f8, at 0x0000023c : */ 0x80080000,0x00000918,
/* /*
eat_datain: eat_datain:
MOVE 1, NCR53c7xx_sink, WHEN DATA_IN MOVE 1, NCR53c7xx_sink, WHEN DATA_IN
at 0x00000236 : */ 0x09000001,0x00000000, at 0x0000023e : */ 0x09000001,0x00000000,
/* /*
JUMP eat_datain, WHEN DATA_IN JUMP eat_datain, WHEN DATA_IN
at 0x00000238 : */ 0x810b0000,0x000008d8, at 0x00000240 : */ 0x810b0000,0x000008f8,
/* /*
JUMP sated JUMP sated
at 0x0000023a : */ 0x80080000,0x000008f8, at 0x00000242 : */ 0x80080000,0x00000918,
/* /*
spew_dataout: spew_dataout:
MOVE 1, NCR53c7xx_zero, WHEN DATA_OUT MOVE 1, NCR53c7xx_zero, WHEN DATA_OUT
at 0x0000023c : */ 0x08000001,0x00000000, at 0x00000244 : */ 0x08000001,0x00000000,
/* /*
sated: sated:
MOVE SCNTL2 & 0x7f TO SCNTL2 MOVE SCNTL2 & 0x7f TO SCNTL2
at 0x0000023e : */ 0x7c027f00,0x00000000, at 0x00000246 : */ 0x7c027f00,0x00000000,
/* /*
MOVE 1, NCR53c7xx_msg_abort, WHEN MSG_OUT MOVE 1, NCR53c7xx_msg_abort, WHEN MSG_OUT
at 0x00000240 : */ 0x0e000001,0x00000000, at 0x00000248 : */ 0x0e000001,0x00000000,
/* /*
WAIT DISCONNECT WAIT DISCONNECT
at 0x00000242 : */ 0x48000000,0x00000000, at 0x0000024a : */ 0x48000000,0x00000000,
/* /*
INT int_norm_aborted INT int_norm_aborted
at 0x00000244 : */ 0x98080000,0x02040000, at 0x0000024c : */ 0x98080000,0x02040000,
/* /*
; ;
...@@ -2081,82 +2105,82 @@ at 0x00000244 : */ 0x98080000,0x02040000, ...@@ -2081,82 +2105,82 @@ at 0x00000244 : */ 0x98080000,0x02040000,
dsa_to_scratch: dsa_to_scratch:
MOVE DSA0 TO SFBR MOVE DSA0 TO SFBR
at 0x00000246 : */ 0x72100000,0x00000000, at 0x0000024e : */ 0x72100000,0x00000000,
/* /*
MOVE SFBR TO SCRATCH0 MOVE SFBR TO SCRATCH0
at 0x00000248 : */ 0x6a340000,0x00000000, at 0x00000250 : */ 0x6a340000,0x00000000,
/* /*
MOVE DSA1 TO SFBR MOVE DSA1 TO SFBR
at 0x0000024a : */ 0x72110000,0x00000000, at 0x00000252 : */ 0x72110000,0x00000000,
/* /*
MOVE SFBR TO SCRATCH1 MOVE SFBR TO SCRATCH1
at 0x0000024c : */ 0x6a350000,0x00000000, at 0x00000254 : */ 0x6a350000,0x00000000,
/* /*
MOVE DSA2 TO SFBR MOVE DSA2 TO SFBR
at 0x0000024e : */ 0x72120000,0x00000000, at 0x00000256 : */ 0x72120000,0x00000000,
/* /*
MOVE SFBR TO SCRATCH2 MOVE SFBR TO SCRATCH2
at 0x00000250 : */ 0x6a360000,0x00000000, at 0x00000258 : */ 0x6a360000,0x00000000,
/* /*
MOVE DSA3 TO SFBR MOVE DSA3 TO SFBR
at 0x00000252 : */ 0x72130000,0x00000000, at 0x0000025a : */ 0x72130000,0x00000000,
/* /*
MOVE SFBR TO SCRATCH3 MOVE SFBR TO SCRATCH3
at 0x00000254 : */ 0x6a370000,0x00000000, at 0x0000025c : */ 0x6a370000,0x00000000,
/* /*
RETURN RETURN
at 0x00000256 : */ 0x90080000,0x00000000, at 0x0000025e : */ 0x90080000,0x00000000,
/* /*
scratch_to_dsa: scratch_to_dsa:
MOVE SCRATCH0 TO SFBR MOVE SCRATCH0 TO SFBR
at 0x00000258 : */ 0x72340000,0x00000000, at 0x00000260 : */ 0x72340000,0x00000000,
/* /*
MOVE SFBR TO DSA0 MOVE SFBR TO DSA0
at 0x0000025a : */ 0x6a100000,0x00000000, at 0x00000262 : */ 0x6a100000,0x00000000,
/* /*
MOVE SCRATCH1 TO SFBR MOVE SCRATCH1 TO SFBR
at 0x0000025c : */ 0x72350000,0x00000000, at 0x00000264 : */ 0x72350000,0x00000000,
/* /*
MOVE SFBR TO DSA1 MOVE SFBR TO DSA1
at 0x0000025e : */ 0x6a110000,0x00000000, at 0x00000266 : */ 0x6a110000,0x00000000,
/* /*
MOVE SCRATCH2 TO SFBR MOVE SCRATCH2 TO SFBR
at 0x00000260 : */ 0x72360000,0x00000000, at 0x00000268 : */ 0x72360000,0x00000000,
/* /*
MOVE SFBR TO DSA2 MOVE SFBR TO DSA2
at 0x00000262 : */ 0x6a120000,0x00000000, at 0x0000026a : */ 0x6a120000,0x00000000,
/* /*
MOVE SCRATCH3 TO SFBR MOVE SCRATCH3 TO SFBR
at 0x00000264 : */ 0x72370000,0x00000000, at 0x0000026c : */ 0x72370000,0x00000000,
/* /*
MOVE SFBR TO DSA3 MOVE SFBR TO DSA3
at 0x00000266 : */ 0x6a130000,0x00000000, at 0x0000026e : */ 0x6a130000,0x00000000,
/* /*
RETURN RETURN
at 0x00000268 : */ 0x90080000,0x00000000, at 0x00000270 : */ 0x90080000,0x00000000,
}; };
#define A_NCR53c7xx_msg_abort 0x00000000 #define A_NCR53c7xx_msg_abort 0x00000000
u32 A_NCR53c7xx_msg_abort_used[] = { u32 A_NCR53c7xx_msg_abort_used[] = {
0x00000241, 0x00000249,
}; };
#define A_NCR53c7xx_msg_reject 0x00000000 #define A_NCR53c7xx_msg_reject 0x00000000
...@@ -2166,15 +2190,15 @@ u32 A_NCR53c7xx_msg_reject_used[] = { ...@@ -2166,15 +2190,15 @@ u32 A_NCR53c7xx_msg_reject_used[] = {
#define A_NCR53c7xx_sink 0x00000000 #define A_NCR53c7xx_sink 0x00000000
u32 A_NCR53c7xx_sink_used[] = { u32 A_NCR53c7xx_sink_used[] = {
0x0000022b, 0x00000233,
0x00000231, 0x00000239,
0x00000237, 0x0000023f,
}; };
#define A_NCR53c7xx_zero 0x00000000 #define A_NCR53c7xx_zero 0x00000000
u32 A_NCR53c7xx_zero_used[] = { u32 A_NCR53c7xx_zero_used[] = {
0x00000227, 0x0000022f,
0x0000023d, 0x00000245,
}; };
#define A_NOP_insn 0x00000000 #define A_NOP_insn 0x00000000
...@@ -2378,13 +2402,13 @@ u32 A_dsa_temp_target_used[] = { ...@@ -2378,13 +2402,13 @@ u32 A_dsa_temp_target_used[] = {
#define A_int_debug_break 0x03000000 #define A_int_debug_break 0x03000000
u32 A_int_debug_break_used[] = { u32 A_int_debug_break_used[] = {
0x0000020f, 0x00000217,
}; };
#define A_int_debug_panic 0x030b0000 #define A_int_debug_panic 0x030b0000
u32 A_int_debug_panic_used[] = { u32 A_int_debug_panic_used[] = {
0x000001e4, 0x000001e8,
0x000001f0, 0x000001f8,
}; };
#define A_int_err_check_condition 0x00030000 #define A_int_err_check_condition 0x00030000
...@@ -2442,7 +2466,7 @@ u32 A_int_msg_wdtr_used[] = { ...@@ -2442,7 +2466,7 @@ u32 A_int_msg_wdtr_used[] = {
#define A_int_norm_aborted 0x02040000 #define A_int_norm_aborted 0x02040000
u32 A_int_norm_aborted_used[] = { u32 A_int_norm_aborted_used[] = {
0x00000245, 0x0000024d,
}; };
#define A_int_norm_command_complete 0x02020000 #define A_int_norm_command_complete 0x02020000
...@@ -2467,12 +2491,12 @@ u32 A_int_norm_select_complete_used[] = { ...@@ -2467,12 +2491,12 @@ u32 A_int_norm_select_complete_used[] = {
#define A_int_test_1 0x04000000 #define A_int_test_1 0x04000000
u32 A_int_test_1_used[] = { u32 A_int_test_1_used[] = {
0x000001f5, 0x000001fd,
}; };
#define A_int_test_2 0x04010000 #define A_int_test_2 0x04010000
u32 A_int_test_2_used[] = { u32 A_int_test_2_used[] = {
0x0000020d, 0x00000215,
}; };
#define A_int_test_3 0x04020000 #define A_int_test_3 0x04020000
...@@ -2511,17 +2535,17 @@ u32 A_schedule_used[] = { ...@@ -2511,17 +2535,17 @@ u32 A_schedule_used[] = {
0x0000007e, 0x0000007e,
0x00000192, 0x00000192,
0x000001e2, 0x000001e2,
0x00000217, 0x0000021f,
}; };
#define A_test_dest 0x00000000 #define A_test_dest 0x00000000
u32 A_test_dest_used[] = { u32 A_test_dest_used[] = {
0x000001f3, 0x000001fb,
}; };
#define A_test_src 0x00000000 #define A_test_src 0x00000000
u32 A_test_src_used[] = { u32 A_test_src_used[] = {
0x000001f2, 0x000001fa,
}; };
#define Ent_accept_message 0x000005d4 #define Ent_accept_message 0x000005d4
...@@ -2530,7 +2554,7 @@ u32 A_test_src_used[] = { ...@@ -2530,7 +2554,7 @@ u32 A_test_src_used[] = {
#define Ent_command_complete_msgin 0x0000061c #define Ent_command_complete_msgin 0x0000061c
#define Ent_data_transfer 0x00000254 #define Ent_data_transfer 0x00000254
#define Ent_datain_to_jump 0x00000328 #define Ent_datain_to_jump 0x00000328
#define Ent_debug_break 0x00000838 #define Ent_debug_break 0x00000858
#define Ent_dsa_code_begin 0x00000000 #define Ent_dsa_code_begin 0x00000000
#define Ent_dsa_code_check_reselect 0x000000f8 #define Ent_dsa_code_check_reselect 0x000000f8
#define Ent_dsa_code_fix_jump 0x0000003c #define Ent_dsa_code_fix_jump 0x0000003c
...@@ -2541,7 +2565,7 @@ u32 A_test_src_used[] = { ...@@ -2541,7 +2565,7 @@ u32 A_test_src_used[] = {
#define Ent_dsa_schedule 0x00000168 #define Ent_dsa_schedule 0x00000168
#define Ent_dsa_zero 0x00000168 #define Ent_dsa_zero 0x00000168
#define Ent_end_data_transfer 0x0000028c #define Ent_end_data_transfer 0x0000028c
#define Ent_initiator_abort 0x00000860 #define Ent_initiator_abort 0x00000880
#define Ent_msg_in 0x00000404 #define Ent_msg_in 0x00000404
#define Ent_msg_in_restart 0x000003e4 #define Ent_msg_in_restart 0x000003e4
#define Ent_other_in 0x00000374 #define Ent_other_in 0x00000374
...@@ -2553,10 +2577,10 @@ u32 A_test_src_used[] = { ...@@ -2553,10 +2577,10 @@ u32 A_test_src_used[] = {
#define Ent_respond_message 0x000005ec #define Ent_respond_message 0x000005ec
#define Ent_select 0x000001fc #define Ent_select 0x000001fc
#define Ent_select_msgout 0x00000214 #define Ent_select_msgout 0x00000214
#define Ent_target_abort 0x00000840 #define Ent_target_abort 0x00000860
#define Ent_test_1 0x000007c4 #define Ent_test_1 0x000007e4
#define Ent_test_2 0x000007d8 #define Ent_test_2 0x000007f8
#define Ent_test_2_msgout 0x000007f0 #define Ent_test_2_msgout 0x00000810
#define Ent_wait_reselect 0x00000654 #define Ent_wait_reselect 0x00000654
u32 LABELPATCHES[] = { u32 LABELPATCHES[] = {
0x00000008, 0x00000008,
...@@ -2620,24 +2644,26 @@ u32 LABELPATCHES[] = { ...@@ -2620,24 +2644,26 @@ u32 LABELPATCHES[] = {
0x000001b8, 0x000001b8,
0x000001cf, 0x000001cf,
0x000001de, 0x000001de,
0x000001e8, 0x000001e6,
0x000001ea, 0x000001ec,
0x000001ee, 0x000001ee,
0x000001f9, 0x000001f2,
0x000001fb, 0x000001f6,
0x0000021b, 0x00000201,
0x0000021d, 0x00000203,
0x0000021f,
0x00000221,
0x00000223, 0x00000223,
0x00000225, 0x00000225,
0x00000227,
0x00000229, 0x00000229,
0x0000022b,
0x0000022d, 0x0000022d,
0x0000022f, 0x00000231,
0x00000233,
0x00000235, 0x00000235,
0x00000239, 0x00000237,
0x0000023b, 0x0000023b,
0x0000023d,
0x00000241,
0x00000243,
}; };
struct { struct {
...@@ -2646,6 +2672,6 @@ struct { ...@@ -2646,6 +2672,6 @@ struct {
} EXTERNAL_PATCHES[] = { } EXTERNAL_PATCHES[] = {
}; };
u32 INSTRUCTIONS = 297; u32 INSTRUCTIONS = 301;
u32 PATCHES = 79; u32 PATCHES = 81;
u32 EXTERNAL_PATCHES_LEN = 0; u32 EXTERNAL_PATCHES_LEN = 0;
...@@ -115,7 +115,7 @@ setup-linux: ...@@ -115,7 +115,7 @@ setup-linux:
sound.o: local.h $(FIXEDOBJS) sound.a sound.o: local.h $(FIXEDOBJS) sound.a
-rm -f sound.o -rm -f sound.o
$(LD) -dc -r -o sound.o $(FIXEDOBJS) sound.a $(LD) -r -o sound.o $(FIXEDOBJS) sound.a
modules: local.h sound.o modules: local.h sound.o
ln -fs `pwd`/sound.o $(TOPDIR)/modules/sound.o ln -fs `pwd`/sound.o $(TOPDIR)/modules/sound.o
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/pagemap.h> #include <linux/pagemap.h>
#include <linux/swapctl.h> #include <linux/swapctl.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/smp_lock.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/segment.h> #include <asm/segment.h>
...@@ -263,6 +264,21 @@ asmlinkage int sys_fsync(unsigned int fd) ...@@ -263,6 +264,21 @@ asmlinkage int sys_fsync(unsigned int fd)
return 0; return 0;
} }
asmlinkage int sys_fdatasync(unsigned int fd)
{
struct file * file;
struct inode * inode;
if (fd>=NR_OPEN || !(file=current->files->fd[fd]) || !(inode=file->f_inode))
return -EBADF;
if (!file->f_op || !file->f_op->fsync)
return -EINVAL;
/* this needs further work, at the moment it is identical to fsync() */
if (file->f_op->fsync(inode,file))
return -EIO;
return 0;
}
void invalidate_buffers(kdev_t dev) void invalidate_buffers(kdev_t dev)
{ {
int i; int i;
......
...@@ -41,7 +41,7 @@ void ext2_put_inode (struct inode * inode) ...@@ -41,7 +41,7 @@ void ext2_put_inode (struct inode * inode)
#define inode_bmap(inode, nr) ((inode)->u.ext2_i.i_data[(nr)]) #define inode_bmap(inode, nr) ((inode)->u.ext2_i.i_data[(nr)])
static int block_bmap (struct buffer_head * bh, int nr) static inline int block_bmap (struct buffer_head * bh, int nr)
{ {
int tmp; int tmp;
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#include <linux/fcntl.h> #include <linux/fcntl.h>
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/locks.h> #include <linux/locks.h>
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/system.h> #include <asm/system.h>
......
...@@ -131,7 +131,6 @@ struct proc_dir_entry proc_net = { ...@@ -131,7 +131,6 @@ struct proc_dir_entry proc_net = {
NULL, NULL NULL, NULL
}; };
#ifdef CONFIG_SCSI
struct proc_dir_entry proc_scsi = { struct proc_dir_entry proc_scsi = {
PROC_SCSI, 4, "scsi", PROC_SCSI, 4, "scsi",
S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0, S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0,
...@@ -139,7 +138,6 @@ struct proc_dir_entry proc_scsi = { ...@@ -139,7 +138,6 @@ struct proc_dir_entry proc_scsi = {
NULL, NULL, NULL, NULL,
NULL, &proc_root, NULL NULL, &proc_root, NULL
}; };
#endif
int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp) int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp)
{ {
......
#ifndef __ALPHA_MMU_CONTEXT_H
#define __ALPHA_MMU_CONTEXT_H
/*
* get a new mmu context..
*
* Copyright (C) 1996, Linus Torvalds
*/
#include <asm/pgtable.h>
/*
* The maximum ASN's the processor supports. On the EV4 this doesn't
* matter as the pal-code doesn't use the ASNs anyway, on the EV5
* EV5 this is 127.
*/
#define MAX_ASN 127
#define ASN_VERSION_SHIFT 32
#define ASN_VERSION_MASK ((~0UL) << ASN_VERSION_SHIFT)
#define ASN_FIRST_VERSION (1UL << ASN_VERSION_SHIFT)
/*
* NOTE! The way this is set up, the high bits of the "asn_cache" (and
* the "mm->context") are the ASN _version_ code. A version of 0 is
* always considered invalid, so to invalidate another process you only
* need to do "p->mm->context = 0".
*
* If we need more ASN's than the processor has, we invalidate the old
* user TLB's (tbiap()) and start a new ASN version. That will automatically
* force a new asn for any other processes the next time they want to
* run.
*/
extern inline void get_mmu_context(struct task_struct *p)
{
static unsigned long asn_cache = ASN_FIRST_VERSION;
struct mm_struct * mm = p->mm;
unsigned long asn = mm->context;
/* Check if our ASN is of an older version and thus invalid */
if ((asn_cache ^ asn) & ASN_VERSION_MASK) {
/* get a new asn of the current version */
asn = asn_cache++;
/* check if it's legal.. */
if ((asn & ~ASN_VERSION_MASK) > MAX_ASN) {
/* start a new version, invalidate all old asn's */
tbiap();
asn_cache = (asn_cache & ASN_VERSION_MASK) + ASN_FIRST_VERSION;
if (!asn_cache)
asn_cache = ASN_FIRST_VERSION;
asn = asn_cache++;
}
mm->context = asn; /* full version + asn */
p->tss.asn = asn & ~ASN_VERSION_MASK; /* just asn */
}
}
#endif
...@@ -39,7 +39,10 @@ static inline void invalidate_all(void) ...@@ -39,7 +39,10 @@ static inline void invalidate_all(void)
*/ */
static inline void invalidate_mm(struct mm_struct *mm) static inline void invalidate_mm(struct mm_struct *mm)
{ {
tbiap(); if (mm != current->mm)
mm->context = 0;
else
tbiap();
} }
/* /*
...@@ -53,7 +56,12 @@ static inline void invalidate_mm(struct mm_struct *mm) ...@@ -53,7 +56,12 @@ static inline void invalidate_mm(struct mm_struct *mm)
static inline void invalidate_page(struct vm_area_struct *vma, static inline void invalidate_page(struct vm_area_struct *vma,
unsigned long addr) unsigned long addr)
{ {
tbi(2 + ((vma->vm_flags & VM_EXEC) != 0), addr); struct mm_struct * mm = vma->vm_mm;
if (mm != current->mm)
mm->context = 0;
else
tbi(2 + ((vma->vm_flags & VM_EXEC) != 0), addr);
} }
/* /*
...@@ -63,7 +71,10 @@ static inline void invalidate_page(struct vm_area_struct *vma, ...@@ -63,7 +71,10 @@ static inline void invalidate_page(struct vm_area_struct *vma,
static inline void invalidate_range(struct mm_struct *mm, static inline void invalidate_range(struct mm_struct *mm,
unsigned long start, unsigned long end) unsigned long start, unsigned long end)
{ {
tbiap(); if (mm != current->mm)
mm->context = 0;
else
tbiap();
} }
/* Certain architectures need to do special things when pte's /* Certain architectures need to do special things when pte's
......
#ifndef __I386_MMU_CONTEXT_H
#define __I386_MMU_CONTEXT_H
/*
* get a new mmu context.. x86's don't know about contexts.
*/
#define get_mmu_context(x) do { } while (0)
#endif
...@@ -153,11 +153,20 @@ ...@@ -153,11 +153,20 @@
#define __NR_readv 145 #define __NR_readv 145
#define __NR_writev 146 #define __NR_writev 146
#define __NR_getsid 147 #define __NR_getsid 147
#define __NR_fdatasync 148
#define __NR_mlock 150 #define __NR_mlock 150
#define __NR_munlock 151 #define __NR_munlock 151
#define __NR_mlockall 152 #define __NR_mlockall 152
#define __NR_munlockall 153 #define __NR_munlockall 153
#define __NR_sched_setparam 154
#define __NR_sched_getparam 155
#define __NR_sched_setscheduler 156
#define __NR_sched_getscheduler 157
#define __NR_sched_yield 158
#define __NR_sched_get_priority_max 159
#define __NR_sched_get_priority_min 160
#define __NR_sched_rr_get_interval 161
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */ /* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
#define _syscall0(type,name) \ #define _syscall0(type,name) \
......
...@@ -100,14 +100,26 @@ ...@@ -100,14 +100,26 @@
/* FDC version return types */ /* FDC version return types */
#define FDC_NONE 0x00 #define FDC_NONE 0x00
#define FDC_UNKNOWN 0x10 #define FDC_UNKNOWN 0x10 /* DO NOT USE THIS TYPE EXCEPT IF IDENTIFICATION
FAILS EARLY */
#define FDC_8272A 0x20 /* Intel 8272a, NEC 765 */ #define FDC_8272A 0x20 /* Intel 8272a, NEC 765 */
#define FDC_765ED 0x30 /* Non-Intel 1MB-compatible FDC, can't detect */ #define FDC_765ED 0x30 /* Non-Intel 1MB-compatible FDC, can't detect */
#define FDC_82072 0x40 /* Intel 82072; 8272a + FIFO + DUMPREGS */ #define FDC_82072 0x40 /* Intel 82072; 8272a + FIFO + DUMPREGS */
#define FDC_82077_ORIG 0x50 /* Original version of 82077AA, sans LOCK */ #define FDC_82077_ORIG 0x50 /* Original version of 82077AA, sans LOCK */
#define FDC_82077 0x52 /* 82077AA-1 */ #define FDC_82077 0x52 /* 82077AA-1 */
#define FDC_82077_UNKN 0x53 /* Unknown 82077 variant */
#define FDC_82078 0x60 /* 44pin 82078 or 64pin 82078SL */ #define FDC_82078 0x60 /* 44pin 82078 or 64pin 82078SL */
#define FDC_82078_1 0x61 /* 82078-1 (2Mbps fdc) */ #define FDC_82078_1 0x61 /* 82078-1 (2Mbps fdc) */
#define FDC_87306 0x63 /* National Semiconductor PC 87306 */
/*
* Beware: the fdc type list is roughly sorted by increasing features.
* Presence of features is tested by comparing the FDC version id with the
* "oldest" version that has the needed feature.
* If during FDC detection, an obscure test fails late in the sequence, don't
* assign FDC_UNKNOWN. Else the FDC will be treated as a dumb 8272a, or worse.
* This is especially true if the tests are unneeded.
*/
#define FD_RESET_DELAY 20 #define FD_RESET_DELAY 20
#endif #endif
...@@ -12,16 +12,29 @@ static inline unsigned long page_address(struct page * page) ...@@ -12,16 +12,29 @@ static inline unsigned long page_address(struct page * page)
return PAGE_OFFSET + PAGE_SIZE*(page - mem_map); return PAGE_OFFSET + PAGE_SIZE*(page - mem_map);
} }
#define PAGE_HASH_SIZE 257 #define PAGE_HASH_BITS 10
#define PAGE_HASH_SIZE (1 << PAGE_HASH_BITS)
#define PAGE_AGE_VALUE 16 #define PAGE_AGE_VALUE 16
extern unsigned long page_cache_size; extern unsigned long page_cache_size;
extern struct page * page_hash_table[PAGE_HASH_SIZE]; extern struct page * page_hash_table[PAGE_HASH_SIZE];
/*
* We use a power-of-two hash table to avoid a modulus,
* and get a reasonable hash by knowing roughly how the
* inode pointer and offsets are distributed (ie, we
* roughly know which bits are "significant")
*/
static inline unsigned long _page_hashfn(struct inode * inode, unsigned long offset) static inline unsigned long _page_hashfn(struct inode * inode, unsigned long offset)
{ {
offset ^= (unsigned long) inode; #define i (((unsigned long) inode)/sizeof(unsigned long))
return offset % PAGE_HASH_SIZE; #define o (offset >> PAGE_SHIFT)
#define s(x) ((x)+((x)>>PAGE_HASH_BITS))
return s(i+o) & (PAGE_HASH_SIZE-1);
#undef i
#undef o
#undef s
} }
#define page_hash(inode,offset) page_hash_table[_page_hashfn(inode,offset)] #define page_hash(inode,offset) page_hash_table[_page_hashfn(inode,offset)]
......
...@@ -181,9 +181,9 @@ ...@@ -181,9 +181,9 @@
#define DBG_AUD 25 /* READ AUDIO debugging */ #define DBG_AUD 25 /* READ AUDIO debugging */
#define DBG_SEQ 26 /* Sequoia interface configuration trace */ #define DBG_SEQ 26 /* Sequoia interface configuration trace */
#define DBG_LCS 27 /* Longshine LCS-7260 debugging trace */ #define DBG_LCS 27 /* Longshine LCS-7260 debugging trace */
#define DBG_CD2 28 /* MKE CD200 debugging trace */ #define DBG_CD2 28 /* MKE/Funai CD200 debugging trace */
#define DBG_TEA 29 /* TEAC CD-55A debugging trace */ #define DBG_TEA 29 /* TEAC CD-55A debugging trace */
#define DBG_TE2 30 /* TEAC CD-55A 2nd debugging level */ #define DBG_ECS 30 /* ECS-AT (Vertos 100) debugging trace */
#define DBG_000 31 /* unnecessary information */ #define DBG_000 31 /* unnecessary information */
/*==========================================================================*/ /*==========================================================================*/
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
* LCS-7260 special status result bits: * LCS-7260 special status result bits:
*/ */
#define p_lcs_door_locked 0x02 #define p_lcs_door_locked 0x02
#define p_lcs_door_closed 0x01 #define p_lcs_door_closed 0x01 /* probably disk_in */
/* /*
* CR-52x special status result bits: * CR-52x special status result bits:
...@@ -270,6 +270,14 @@ ...@@ -270,6 +270,14 @@
#define pL_door_locked 0x02 #define pL_door_locked 0x02
#define pL_door_closed 0x01 #define pL_door_closed 0x01
#define pV_door_closed 0x40
#define pV_spinning 0x20
#define pV_check 0x10
#define pV_success 0x08
#define pV_busy 0x04
#define pV_door_locked 0x02
#define pV_disk_ok 0x01
#define p1_door_closed 0x80 #define p1_door_closed 0x80
#define p1_disk_in 0x40 #define p1_disk_in 0x40
#define p1_spinning 0x20 #define p1_spinning 0x20
...@@ -313,9 +321,9 @@ ...@@ -313,9 +321,9 @@
#define RESULT_READY ((inb(CDi_status)&s_not_result_ready)==0) #define RESULT_READY ((inb(CDi_status)&s_not_result_ready)==0)
/* /*
* drive types (firmware versions): * drive families and types (firmware versions):
*/ */
#define drv_fam0 0x08 /* CR-52x family */ #define drv_fam0 0x0100 /* CR-52x family */
#define drv_199 (drv_fam0+0x01) /* <200 */ #define drv_199 (drv_fam0+0x01) /* <200 */
#define drv_200 (drv_fam0+0x02) /* <201 */ #define drv_200 (drv_fam0+0x02) /* <201 */
#define drv_201 (drv_fam0+0x03) /* <210 */ #define drv_201 (drv_fam0+0x03) /* <210 */
...@@ -323,25 +331,35 @@ ...@@ -323,25 +331,35 @@
#define drv_211 (drv_fam0+0x05) /* <300 */ #define drv_211 (drv_fam0+0x05) /* <300 */
#define drv_300 (drv_fam0+0x06) /* >=300 */ #define drv_300 (drv_fam0+0x06) /* >=300 */
#define drv_famL 0x10 /* Longshine family */ #define drv_fam1 0x0200 /* CR-56x family */
#define drv_099 (drv_fam1+0x01) /* <100 */
#define drv_100 (drv_fam1+0x02) /* >=100, only 1.02 and 5.00 known */
#define drv_fam2 0x0400 /* CD200 family */
#define drv_famT 0x0800 /* TEAC CD-55A */
#define drv_famL 0x1000 /* Longshine family */
#define drv_260 (drv_famL+0x01) /* LCS-7260 */ #define drv_260 (drv_famL+0x01) /* LCS-7260 */
#define drv_e1 (drv_famL+0x01) /* LCS-7260, firmware "A E1" */ #define drv_e1 (drv_famL+0x01) /* LCS-7260, firmware "A E1" */
#define drv_f4 (drv_famL+0x02) /* LCS-7260, firmware "A4F4" */ #define drv_f4 (drv_famL+0x02) /* LCS-7260, firmware "A4F4" */
#define drv_fam1 0x20 /* CR-56x family */ #define drv_famV 0x2000 /* ECS-AT (vertos-100) family */
#define drv_099 (drv_fam1+0x01) /* <100 */ #define drv_at (drv_famV+0x01) /* ECS-AT, firmware "1.00" */
#define drv_100 (drv_fam1+0x02) /* >=100, only 5.00 known here */
#define drv_famT 0x40 /* TEAC CD-55A */
#define drv_fam2 0x80 /* CD200 family */
#define fam0_drive (D_S[d].drv_type&drv_fam0) #define fam0_drive (D_S[d].drv_type&drv_fam0)
#define famL_drive (D_S[d].drv_type&drv_famL) #define famL_drive (D_S[d].drv_type&drv_famL)
#define famV_drive (D_S[d].drv_type&drv_famV)
#define fam1_drive (D_S[d].drv_type&drv_fam1) #define fam1_drive (D_S[d].drv_type&drv_fam1)
#define fam2_drive (D_S[d].drv_type&drv_fam2) #define fam2_drive (D_S[d].drv_type&drv_fam2)
#define famT_drive (D_S[d].drv_type&drv_famT) #define famT_drive (D_S[d].drv_type&drv_famT)
#define fam0L_drive (D_S[d].drv_type&(drv_fam0|drv_famL)) #define fam0L_drive (D_S[d].drv_type&(drv_fam0|drv_famL))
#define fam0V_drive (D_S[d].drv_type&(drv_fam0|drv_famV))
#define famLV_drive (D_S[d].drv_type&(drv_famL|drv_famV))
#define fam0LV_drive (D_S[d].drv_type&(drv_fam0|drv_famL|drv_famV))
#define fam1L_drive (D_S[d].drv_type&(drv_fam1|drv_famL)) #define fam1L_drive (D_S[d].drv_type&(drv_fam1|drv_famL))
#define fam1V_drive (D_S[d].drv_type&(drv_fam1|drv_famV))
#define fam1LV_drive (D_S[d].drv_type&(drv_fam1|drv_famL|drv_famV))
#define fam01_drive (D_S[d].drv_type&(drv_fam0|drv_fam1)) #define fam01_drive (D_S[d].drv_type&(drv_fam0|drv_fam1))
#define fam12_drive (D_S[d].drv_type&(drv_fam1|drv_fam2)) #define fam12_drive (D_S[d].drv_type&(drv_fam1|drv_fam2))
#define fam2T_drive (D_S[d].drv_type&(drv_fam2|drv_famT)) #define fam2T_drive (D_S[d].drv_type&(drv_fam2|drv_famT))
...@@ -385,7 +403,6 @@ ...@@ -385,7 +403,6 @@
#define audx13 0x0d /* Audio play operation successfully completed */ #define audx13 0x0d /* Audio play operation successfully completed */
#define audx14 0x0e /* Audio play operation stopped due to error */ #define audx14 0x0e /* Audio play operation stopped due to error */
#define audx15 0x0f /* No current audio status to return */ #define audx15 0x0f /* No current audio status to return */
/* audio status (bcd) */ /* audio status (bcd) */
#define aud_11 0x11 /* Audio play operation in progress */ #define aud_11 0x11 /* Audio play operation in progress */
#define aud_12 0x12 /* Audio play operation paused */ #define aud_12 0x12 /* Audio play operation paused */
...@@ -393,7 +410,6 @@ ...@@ -393,7 +410,6 @@
#define aud_14 0x14 /* Audio play operation stopped due to error */ #define aud_14 0x14 /* Audio play operation stopped due to error */
#define aud_15 0x15 /* No current audio status to return */ #define aud_15 0x15 /* No current audio status to return */
/* /*
* highest allowed drive number (MINOR+1) * highest allowed drive number (MINOR+1)
*/ */
...@@ -414,10 +430,8 @@ ...@@ -414,10 +430,8 @@
#define MIXER_CD_Volume 0x28 /* internal SB Pro register address */ #define MIXER_CD_Volume 0x28 /* internal SB Pro register address */
/*==========================================================================*/ /*==========================================================================*/
/*
* Creative Labs Programmers did this: #define MAX_TRACKS 99
*/
#define MAX_TRACKS 120 /* why more than 99? */
/*==========================================================================*/ /*==========================================================================*/
/* /*
...@@ -596,6 +610,7 @@ Read XA Parameter: ...@@ -596,6 +610,7 @@ Read XA Parameter:
* CD200: CMD2_ * CD200: CMD2_
* LCS-7260: CMDL_ * LCS-7260: CMDL_
* TEAC CD-55A: CMDT_ * TEAC CD-55A: CMDT_
* ECS-AT: CMDV_
*/ */
#define CMD1_RESET 0x0a #define CMD1_RESET 0x0a
#define CMD2_RESET 0x01 #define CMD2_RESET 0x01
...@@ -605,14 +620,17 @@ Read XA Parameter: ...@@ -605,14 +620,17 @@ Read XA Parameter:
#define CMD2_LOCK_CTL 0x1e #define CMD2_LOCK_CTL 0x1e
#define CMDT_LOCK_CTL CMD2_LOCK_CTL #define CMDT_LOCK_CTL CMD2_LOCK_CTL
#define CMDL_LOCK_CTL 0x0e #define CMDL_LOCK_CTL 0x0e
#define CMDV_LOCK_CTL CMDL_LOCK_CTL
#define CMD1_TRAY_CTL 0x07 #define CMD1_TRAY_CTL 0x07
#define CMD2_TRAY_CTL 0x1b #define CMD2_TRAY_CTL 0x1b
#define CMDT_TRAY_CTL CMD2_TRAY_CTL #define CMDT_TRAY_CTL CMD2_TRAY_CTL
#define CMDL_TRAY_CTL 0x0d #define CMDL_TRAY_CTL 0x0d
#define CMDV_TRAY_CTL CMDL_TRAY_CTL
#define CMD1_MULTISESS 0x8d #define CMD1_MULTISESS 0x8d
#define CMDL_MULTISESS 0x8c #define CMDL_MULTISESS 0x8c
#define CMDV_MULTISESS CMDL_MULTISESS
#define CMD1_SUBCHANINF 0x11 #define CMD1_SUBCHANINF 0x11
#define CMD2_SUBCHANINF 0x?? #define CMD2_SUBCHANINF 0x??
...@@ -630,23 +648,27 @@ Read XA Parameter: ...@@ -630,23 +648,27 @@ Read XA Parameter:
#define CMD2_PATH_CHECK 0x??? #define CMD2_PATH_CHECK 0x???
#define CMDT_PATH_CHECK 0x??? #define CMDT_PATH_CHECK 0x???
#define CMDL_PATH_CHECK CMD0_PATH_CHECK #define CMDL_PATH_CHECK CMD0_PATH_CHECK
#define CMDV_PATH_CHECK CMD0_PATH_CHECK
#define CMD0_SEEK 0x01 #define CMD0_SEEK 0x01
#define CMD1_SEEK CMD0_SEEK #define CMD1_SEEK CMD0_SEEK
#define CMD2_SEEK 0x2b #define CMD2_SEEK 0x2b
#define CMDT_SEEK CMD2_SEEK #define CMDT_SEEK CMD2_SEEK
#define CMDL_SEEK CMD0_SEEK #define CMDL_SEEK CMD0_SEEK
#define CMDV_SEEK CMD0_SEEK
#define CMD0_READ 0x02 #define CMD0_READ 0x02
#define CMD1_READ 0x10 #define CMD1_READ 0x10
#define CMD2_READ 0x28 #define CMD2_READ 0x28
#define CMDT_READ CMD2_READ #define CMDT_READ CMD2_READ
#define CMDL_READ CMD0_READ #define CMDL_READ CMD0_READ
#define CMDV_READ CMD0_READ
#define CMD0_READ_XA 0x03 #define CMD0_READ_XA 0x03
#define CMD2_READ_XA 0xd4 #define CMD2_READ_XA 0xd4
#define CMD2_READ_XA2 0xd5 #define CMD2_READ_XA2 0xd5
#define CMDL_READ_XA CMD0_READ_XA /* really ?? */ #define CMDL_READ_XA CMD0_READ_XA /* really ?? */
#define CMDV_READ_XA CMD0_READ_XA
#define CMD0_READ_HEAD 0x04 #define CMD0_READ_HEAD 0x04
...@@ -654,11 +676,13 @@ Read XA Parameter: ...@@ -654,11 +676,13 @@ Read XA Parameter:
#define CMD1_SPINUP 0x02 #define CMD1_SPINUP 0x02
#define CMD2_SPINUP CMD2_TRAY_CTL #define CMD2_SPINUP CMD2_TRAY_CTL
#define CMDL_SPINUP CMD0_SPINUP #define CMDL_SPINUP CMD0_SPINUP
#define CMDV_SPINUP CMD0_SPINUP
#define CMD0_SPINDOWN 0x06 /* really??? */ #define CMD0_SPINDOWN 0x06 /* really??? */
#define CMD1_SPINDOWN 0x06 #define CMD1_SPINDOWN 0x06
#define CMD2_SPINDOWN CMD2_TRAY_CTL #define CMD2_SPINDOWN CMD2_TRAY_CTL
#define CMDL_SPINDOWN 0x0d #define CMDL_SPINDOWN 0x0d
#define CMDV_SPINDOWN CMD0_SPINDOWN
#define CMD0_DIAG 0x07 #define CMD0_DIAG 0x07
...@@ -666,6 +690,7 @@ Read XA Parameter: ...@@ -666,6 +690,7 @@ Read XA Parameter:
#define CMD1_READ_UPC 0x88 #define CMD1_READ_UPC 0x88
#define CMD2_READ_UPC 0x??? #define CMD2_READ_UPC 0x???
#define CMDL_READ_UPC CMD0_READ_UPC #define CMDL_READ_UPC CMD0_READ_UPC
#define CMDV_READ_UPC 0x8f
#define CMD0_READ_ISRC 0x09 #define CMD0_READ_ISRC 0x09
...@@ -673,6 +698,7 @@ Read XA Parameter: ...@@ -673,6 +698,7 @@ Read XA Parameter:
#define CMD1_PLAY 0x??? #define CMD1_PLAY 0x???
#define CMD2_PLAY 0x??? #define CMD2_PLAY 0x???
#define CMDL_PLAY CMD0_PLAY #define CMDL_PLAY CMD0_PLAY
#define CMDV_PLAY CMD0_PLAY
#define CMD0_PLAY_MSF 0x0b #define CMD0_PLAY_MSF 0x0b
#define CMD1_PLAY_MSF 0x0e #define CMD1_PLAY_MSF 0x0e
...@@ -688,6 +714,7 @@ Read XA Parameter: ...@@ -688,6 +714,7 @@ Read XA Parameter:
#define CMD2_STATUS 0x00 #define CMD2_STATUS 0x00
#define CMDT_STATUS CMD2_STATUS #define CMDT_STATUS CMD2_STATUS
#define CMDL_STATUS CMD0_STATUS #define CMDL_STATUS CMD0_STATUS
#define CMDV_STATUS CMD0_STATUS
#define CMD2_SEEK_LEADIN 0x00 #define CMD2_SEEK_LEADIN 0x00
#define CMD0_READ_ERR 0x82 #define CMD0_READ_ERR 0x82
...@@ -695,12 +722,14 @@ Read XA Parameter: ...@@ -695,12 +722,14 @@ Read XA Parameter:
#define CMD2_READ_ERR 0x03 #define CMD2_READ_ERR 0x03
#define CMDT_READ_ERR CMD2_READ_ERR /* get audio status */ #define CMDT_READ_ERR CMD2_READ_ERR /* get audio status */
#define CMDL_READ_ERR CMD0_READ_ERR #define CMDL_READ_ERR CMD0_READ_ERR
#define CMDV_READ_ERR CMD0_READ_ERR
#define CMD0_READ_VER 0x83 #define CMD0_READ_VER 0x83
#define CMD1_READ_VER CMD0_READ_VER #define CMD1_READ_VER CMD0_READ_VER
#define CMD2_READ_VER 0x12 #define CMD2_READ_VER 0x12
#define CMDT_READ_VER CMD2_READ_VER /* really ?? */ #define CMDT_READ_VER CMD2_READ_VER /* really ?? */
#define CMDL_READ_VER CMD0_READ_VER #define CMDL_READ_VER CMD0_READ_VER
#define CMDV_READ_VER CMD0_READ_VER
#define CMD0_SETMODE 0x84 #define CMD0_SETMODE 0x84
#define CMD1_SETMODE 0x09 #define CMD1_SETMODE 0x09
...@@ -728,6 +757,7 @@ Read XA Parameter: ...@@ -728,6 +757,7 @@ Read XA Parameter:
#define CMD2_READSUBQ 0x42 #define CMD2_READSUBQ 0x42
#define CMDT_READSUBQ CMD2_READSUBQ #define CMDT_READSUBQ CMD2_READSUBQ
#define CMDL_READSUBQ CMD0_READSUBQ #define CMDL_READSUBQ CMD0_READSUBQ
#define CMDV_READSUBQ CMD0_READSUBQ
#define CMD0_DISKCODE 0x8a #define CMD0_DISKCODE 0x8a
...@@ -736,22 +766,26 @@ Read XA Parameter: ...@@ -736,22 +766,26 @@ Read XA Parameter:
#define CMD2_DISKINFO 0x43 #define CMD2_DISKINFO 0x43
#define CMDT_DISKINFO CMD2_DISKINFO #define CMDT_DISKINFO CMD2_DISKINFO
#define CMDL_DISKINFO CMD0_DISKINFO #define CMDL_DISKINFO CMD0_DISKINFO
#define CMDV_DISKINFO CMD0_DISKINFO
#define CMD0_READTOC 0x8c #define CMD0_READTOC 0x8c
#define CMD1_READTOC CMD0_READTOC #define CMD1_READTOC CMD0_READTOC
#define CMD2_READTOC 0x??? #define CMD2_READTOC 0x???
#define CMDL_READTOC CMD0_READTOC #define CMDL_READTOC CMD0_READTOC
#define CMDV_READTOC CMD0_READTOC
#define CMD0_PAU_RES 0x8d #define CMD0_PAU_RES 0x8d
#define CMD1_PAU_RES 0x0d #define CMD1_PAU_RES 0x0d
#define CMD2_PAU_RES 0x4b #define CMD2_PAU_RES 0x4b
#define CMDT_PAUSE CMD2_PAU_RES #define CMDT_PAUSE CMD2_PAU_RES
#define CMDL_PAU_RES CMD0_PAU_RES #define CMDL_PAU_RES CMD0_PAU_RES
#define CMDV_PAUSE CMD0_PAU_RES
#define CMD0_PACKET 0x8e #define CMD0_PACKET 0x8e
#define CMD1_PACKET CMD0_PACKET #define CMD1_PACKET CMD0_PACKET
#define CMD2_PACKET 0x??? #define CMD2_PACKET 0x???
#define CMDL_PACKET CMD0_PACKET #define CMDL_PACKET CMD0_PACKET
#define CMDV_PACKET 0x???
/*==========================================================================*/ /*==========================================================================*/
/*==========================================================================*/ /*==========================================================================*/
......
...@@ -92,6 +92,10 @@ extern int nr_running, nr_tasks; ...@@ -92,6 +92,10 @@ extern int nr_running, nr_tasks;
#define SCHED_FIFO 1 #define SCHED_FIFO 1
#define SCHED_RR 2 #define SCHED_RR 2
struct sched_param {
int sched_priority;
};
#ifndef NULL #ifndef NULL
#define NULL ((void *) 0) #define NULL ((void *) 0)
#endif #endif
...@@ -195,7 +199,7 @@ struct task_struct { ...@@ -195,7 +199,7 @@ struct task_struct {
struct wait_queue *wait_chldexit; /* for wait4() */ struct wait_queue *wait_chldexit; /* for wait4() */
unsigned short uid,euid,suid,fsuid; unsigned short uid,euid,suid,fsuid;
unsigned short gid,egid,sgid,fsgid; unsigned short gid,egid,sgid,fsgid;
unsigned long timeout, policy; unsigned long timeout, policy, rt_priority;
unsigned long it_real_value, it_prof_value, it_virt_value; unsigned long it_real_value, it_prof_value, it_virt_value;
unsigned long it_real_incr, it_prof_incr, it_virt_incr; unsigned long it_real_incr, it_prof_incr, it_virt_incr;
struct timer_list real_timer; struct timer_list real_timer;
...@@ -273,7 +277,7 @@ struct task_struct { ...@@ -273,7 +277,7 @@ struct task_struct {
/* suppl grps*/ {NOGROUP,}, \ /* suppl grps*/ {NOGROUP,}, \
/* proc links*/ &init_task,&init_task,NULL,NULL,NULL,NULL, \ /* proc links*/ &init_task,&init_task,NULL,NULL,NULL,NULL, \
/* uid etc */ 0,0,0,0,0,0,0,0, \ /* uid etc */ 0,0,0,0,0,0,0,0, \
/* timeout */ 0,SCHED_OTHER,0,0,0,0,0,0, \ /* timeout */ 0,SCHED_OTHER,0,0,0,0,0,0,0, \
/* timer */ { NULL, NULL, 0, 0, it_real_fn }, \ /* timer */ { NULL, NULL, 0, 0, it_real_fn }, \
/* utime */ 0,0,0,0,0, \ /* utime */ 0,0,0,0,0, \
/* flt */ 0,0,0,0,0,0, \ /* flt */ 0,0,0,0,0,0, \
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#ifdef __SMP__ #ifdef __SMP__
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/smp_lock.h>
extern void smp_message_pass(int target, int msg, unsigned long data, int wait); extern void smp_message_pass(int target, int msg, unsigned long data, int wait);
extern void smp_boot_cpus(void); /* Boot processor call to load the other CPU's */ extern void smp_boot_cpus(void); /* Boot processor call to load the other CPU's */
......
#ifndef __LINUX_SMPLOCK_H
#define __LINUX_SMPLOCK_H
#ifdef __SMP__
#include <asm/pgtable.h>
#include <asm/smp_lock.h>
#endif
#endif
#ifndef _LINUX_TIME_H #ifndef _LINUX_TIME_H
#define _LINUX_TIME_H #define _LINUX_TIME_H
struct timespec {
long tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
struct timeval { struct timeval {
int tv_sec; /* seconds */ int tv_sec; /* seconds */
int tv_usec; /* microseconds */ int tv_usec; /* microseconds */
...@@ -32,6 +37,11 @@ void do_settimeofday(struct timeval *tv); ...@@ -32,6 +37,11 @@ void do_settimeofday(struct timeval *tv);
#define ITIMER_VIRTUAL 1 #define ITIMER_VIRTUAL 1
#define ITIMER_PROF 2 #define ITIMER_PROF 2
struct itimerspec {
struct timespec it_interval; /* timer period */
struct timespec it_value; /* timer expiration */
};
struct itimerval { struct itimerval {
struct timeval it_interval; /* timer interval */ struct timeval it_interval; /* timer interval */
struct timeval it_value; /* current value */ struct timeval it_value; /* current value */
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/smp.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -38,6 +39,7 @@ ...@@ -38,6 +39,7 @@
#include <linux/ext2_fs.h> #include <linux/ext2_fs.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/pagemap.h>
extern unsigned char aux_device_present, kbd_read_mask; extern unsigned char aux_device_present, kbd_read_mask;
...@@ -222,6 +224,7 @@ struct symbol_table symbol_table = { ...@@ -222,6 +224,7 @@ struct symbol_table symbol_table = {
X(mem_map), X(mem_map),
X(remap_page_range), X(remap_page_range),
X(high_memory), X(high_memory),
X(update_vm_cache),
/* filesystem internal functions */ /* filesystem internal functions */
X(getname), X(getname),
...@@ -252,6 +255,8 @@ struct symbol_table symbol_table = { ...@@ -252,6 +255,8 @@ struct symbol_table symbol_table = {
X(dcache_add), X(dcache_add),
X(aout_core_dump), X(aout_core_dump),
X(add_blkdev_randomness), X(add_blkdev_randomness),
X(generic_file_read),
X(generic_readpage),
/* device registration */ /* device registration */
X(register_chrdev), X(register_chrdev),
...@@ -560,10 +565,7 @@ struct symbol_table symbol_table = { ...@@ -560,10 +565,7 @@ struct symbol_table symbol_table = {
X(proc_unregister), X(proc_unregister),
X(in_group_p), X(in_group_p),
X(generate_cluster), X(generate_cluster),
#ifdef CONFIG_SCSI
X(proc_scsi), X(proc_scsi),
X(proc_scsi_inode_operations),
#endif
X(proc_net_inode_operations), X(proc_net_inode_operations),
X(proc_net), X(proc_net),
#endif #endif
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/mmu_context.h>
#include <linux/timex.h> #include <linux/timex.h>
...@@ -206,7 +207,7 @@ static inline int goodness(struct task_struct * p, int this_cpu) ...@@ -206,7 +207,7 @@ static inline int goodness(struct task_struct * p, int this_cpu)
* into account). * into account).
*/ */
if (p->policy != SCHED_OTHER) if (p->policy != SCHED_OTHER)
return 1000 + p->priority; return 1000 + p->rt_priority;
/* /*
* Give the process a first-approximation goodness value * Give the process a first-approximation goodness value
...@@ -338,6 +339,7 @@ asmlinkage void schedule(void) ...@@ -338,6 +339,7 @@ asmlinkage void schedule(void)
timer.function = process_timeout; timer.function = process_timeout;
add_timer(&timer); add_timer(&timer);
} }
get_mmu_context(next);
switch_to(next); switch_to(next);
if (timeout) if (timeout)
del_timer(&timer); del_timer(&timer);
...@@ -936,6 +938,167 @@ asmlinkage int sys_nice(int increment) ...@@ -936,6 +938,167 @@ asmlinkage int sys_nice(int increment)
return 0; return 0;
} }
static struct task_struct *find_process_by_pid(pid_t pid) {
struct task_struct *p, *q;
if (pid == 0)
p = current;
else {
p = 0;
for_each_task(q) {
if (q && q->pid == pid) {
p = q;
break;
}
}
}
return p;
}
static int setscheduler(pid_t pid, int policy,
struct sched_param *param)
{
int error;
struct sched_param lp;
struct task_struct *p;
if (!param || pid < 0)
return -EINVAL;
error = verify_area(VERIFY_READ, param, sizeof(struct sched_param));
if (error)
return -EINVAL;
memcpy_fromfs(&lp, param, sizeof(struct sched_param));
p = find_process_by_pid(pid);
if (!p)
return -ESRCH;
if (policy < 0)
policy = p->policy;
else if (policy != SCHED_FIFO && policy != SCHED_RR &&
policy != SCHED_OTHER)
return -EINVAL;
/*
* Valid priorities for SCHED_FIFO and SCHED_RR are 1..99, valid
* priority for SCHED_OTHER is 0.
*/
if (lp.sched_priority < 0 || lp.sched_priority > 99)
return -EINVAL;
if ((policy == SCHED_OTHER) != (lp.sched_priority == 0))
return -EINVAL;
if ((policy == SCHED_FIFO || policy == SCHED_RR) && !suser())
return -EPERM;
if ((current->euid != p->euid) && (current->euid != p->uid) &&
!suser())
return -EPERM;
p->policy = policy;
p->rt_priority = lp.sched_priority;
schedule();
return 0;
}
asmlinkage int sys_sched_setscheduler(pid_t pid, int policy,
struct sched_param *param)
{
return setscheduler(pid, policy, param);
}
asmlinkage int sys_sched_setparam(pid_t pid, struct sched_param *param)
{
return setscheduler(pid, -1, param);
}
asmlinkage int sys_sched_getscheduler(pid_t pid)
{
struct task_struct *p;
if (pid < 0)
return -EINVAL;
p = find_process_by_pid(pid);
if (!p)
return -ESRCH;
return p->policy;
}
asmlinkage int sys_sched_getparam(pid_t pid, struct sched_param *param)
{
int error;
struct task_struct *p;
struct sched_param lp;
if (!param || pid < 0)
return -EINVAL;
error = verify_area(VERIFY_WRITE, param, sizeof(struct sched_param));
if (error)
return -EINVAL;
p = find_process_by_pid(pid);
if (!p)
return -ESRCH;
lp.sched_priority = p->rt_priority;
memcpy_tofs(param, &lp, sizeof(struct sched_param));
return 0;
}
asmlinkage int sys_sched_yield(void)
{
/* ... not yet implemented ... */
return -ENOSYS;
}
asmlinkage int sys_sched_get_priority_max(int policy)
{
switch (policy) {
case SCHED_FIFO:
case SCHED_RR:
return 99;
case SCHED_OTHER:
return 0;
}
return -EINVAL;
}
asmlinkage int sys_sched_get_priority_min(int policy)
{
switch (policy) {
case SCHED_FIFO:
case SCHED_RR:
return 1;
case SCHED_OTHER:
return 0;
}
return -EINVAL;
}
asmlinkage int sys_sched_rr_get_interval(pid_t pid, struct timespec *interval)
{
int error;
struct timespec t;
error = verify_area(VERIFY_WRITE, interval, sizeof(struct timespec));
if (error)
return -EINVAL;
t.tv_sec = 0;
t.tv_nsec = 0; /* <-- Linus, please fill correct value in here */
return -ENOSYS; /* and then delete this line. Thanks! */
memcpy_tofs(interval, &t, sizeof(struct timespec));
return 0;
}
static void show_task(int nr,struct task_struct * p) static void show_task(int nr,struct task_struct * p)
{ {
unsigned long free; unsigned long free;
......
...@@ -138,7 +138,6 @@ void update_vm_cache(struct inode * inode, unsigned long pos, const char * buf, ...@@ -138,7 +138,6 @@ void update_vm_cache(struct inode * inode, unsigned long pos, const char * buf,
if (page) { if (page) {
unsigned long addr; unsigned long addr;
page->count++;
if (!page->uptodate) if (!page->uptodate)
sleep_on(&page->wait); sleep_on(&page->wait);
addr = page_address(page); addr = page_address(page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment