Commit 4eeb9af8 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.46

parent ed63dd2d
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
contributed to the linux project. It is sorted by name, and contributed to the linux project. It is sorted by name, and
formatted in a format that allows for easy grepping and formatted in a format that allows for easy grepping and
beautification by scripts. The fields are: name (N), email (E), beautification by scripts. The fields are: name (N), email (E),
description (D) and snail-mail address (S). Thanks, web-address (W), description (D) and snail-mail address (S).
Thanks,
Linus Linus
---------- ----------
...@@ -286,7 +287,10 @@ D: Wrote Xenix FS (part of standard kernel since 0.99.15) ...@@ -286,7 +287,10 @@ D: Wrote Xenix FS (part of standard kernel since 0.99.15)
N: Rik Faith N: Rik Faith
E: faith@cs.unc.edu E: faith@cs.unc.edu
D: Future Domain TMC-16x0 SCSI driver E: r.faith@ieee.org
D: Author: Future Domain TMC-16x0 SCSI driver
D: Debugging: SCSI code; Cyclades serial driver; APM driver
D: Debugging: XFree86 Mach 32 server, accelerated server code
N: Juergen Fischer N: Juergen Fischer
E: fischer@server.et-inf.fho-emden.de E: fischer@server.et-inf.fho-emden.de
...@@ -420,6 +424,13 @@ S: Panoramastrasse 18 ...@@ -420,6 +424,13 @@ S: Panoramastrasse 18
S: D-69126 Heidelberg S: D-69126 Heidelberg
S: Germany S: Germany
N: Miguel de Icaza Amozurrutia
E: miguel@nuclecu.unam.mx
D: Linux/SPARC team, Midnight Commander maintainer
S: Avenida Copilco 162, 22-1003
S: Mexico, DF
S: Mexico
N: Ian Jackson N: Ian Jackson
E: iwj10@cus.cam.ac.uk E: iwj10@cus.cam.ac.uk
E: ijackson@nyx.cs.du.edu E: ijackson@nyx.cs.du.edu
...@@ -794,6 +805,18 @@ S: 816 Saratoga Avenue, Apartment M208 ...@@ -794,6 +805,18 @@ S: 816 Saratoga Avenue, Apartment M208
S: San Jose, California 95129 S: San Jose, California 95129
S: USA S: USA
N: Eric S. Raymond
E: esr@thyrsus.com
W: http://www.ccil.org/~esr/home.html
S: 22 South Warren Avenue
S: Malvern, PA 19355 USA
D: ncurses library co-maintainer
D: terminfo master file maintainer
D: Distributions HOWTO editor
D: Instigator, FHS standard
D: Keeper of the Jargon File and curator of the Retrocomputing Museum
D: Author, Emacs VC and GUD modes
N: Florian La Roche N: Florian La Roche
E: rzsfl@rz.uni-sb.de E: rzsfl@rz.uni-sb.de
E: flla@stud.uni-sb.de E: flla@stud.uni-sb.de
...@@ -803,8 +826,9 @@ S: 7000 Stuttgart 50 ...@@ -803,8 +826,9 @@ S: 7000 Stuttgart 50
S: Germany S: Germany
N: Stephen Rothwell N: Stephen Rothwell
E: sfr@pdact.pd.necisa.oz.au E: Stephen.Rothwell@nec.com.au
D: Boot/setup/build work for setup > 2K D: Boot/setup/build work for setup > 2K
D: Author, APM driver
S: 59 Bugden Avenue S: 59 Bugden Avenue
S: Gowrie ACT 2904 S: Gowrie ACT 2904
S: Australia S: Australia
...@@ -1099,3 +1123,21 @@ D: Miscellaneous kernel fixes ...@@ -1099,3 +1123,21 @@ D: Miscellaneous kernel fixes
S: 3078 Sulphur Spring Court S: 3078 Sulphur Spring Court
S: San Jose, California 95148 S: San Jose, California 95148
S: USA S: USA
N: Chih-Jen Chang
E: chihjenc@scf.usc.edu
E: chihjen@iis.sinica.edu.tw
D: IGMP(Internet Group Management Protocol) version 2
S: 3F, 65 Tajen street
S: Tamsui town, Taipei county,
S: Taiwan 251, Republic of China
N: Tsu-Sheng Tsao
E: tsusheng@scf.usc.edu
D: IGMP(Internet Group Management Protocol) version 2
S: 2F 14 ALY 31 LN 166 SEC 1 SHIH-PEI RD
S: Taipei
S: Taiwan 112, Republic of China
S: 24335 Delta Drive
S: Diamond Bar, CA 91765
S: USA
$Id: README.aztcd,v 2.0 1995/11/10 19:37:18 root Exp root $ $Id: README.aztcd,v 2.10 1995/12/03 11:55:14 root Exp root $
Readme-File /usr/src/Documentation/cdrom/aztcd Readme-File /usr/src/Documentation/cdrom/aztcd
for Aztech CD-ROM CDA268-01A, ORCHID CD-3110, for Aztech CD-ROM CDA268-01A, ORCHID CD-3110,
OKANO/WEARNES CDD110, Conrad TXC OKANO/WEARNES CDD110, Conrad TXC
...@@ -460,7 +460,7 @@ and also were very patient with the problems which occurred. ...@@ -460,7 +460,7 @@ and also were very patient with the problems which occurred.
Reinhard Max delivered the information for the CDROM-interface of the Reinhard Max delivered the information for the CDROM-interface of the
SoundWave32 soundcards. SoundWave32 soundcards.
Jochen Koch and Olaf Koluza delivered the information for supporting Conrad's TXC Jochen Koch and Olaf Kaluza delivered the information for supporting Conrad's TXC
drive. drive.
Anybody, who is interested in these items should have a look at 'ftp.gwdg.de', Anybody, who is interested in these items should have a look at 'ftp.gwdg.de',
......
...@@ -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: November 17, 1995} \date{Last revised: December 4, 1995}
\maketitle \maketitle
% %
\noindent \noindent
...@@ -77,12 +77,12 @@ an unreasonable effort. ...@@ -77,12 +77,12 @@ an unreasonable effort.
\section{Major numbers} \section{Major numbers}
\begin{devicelist} \begin{devicelist}
\major{ 0}{}{ }{Unnamed devices (NFS mounts, loopback devices)} \major{ 0}{}{ }{Unnamed devices (e.g. non-device mounts)}
\major{ 1}{}{char }{Memory devices} \major{ 1}{}{char }{Memory devices}
\major{ }{}{block}{RAM disk} \major{ }{}{block}{RAM disk}
\major{ 2}{}{char }{Reserved for PTY's $<$tytso@athena.mit.edu$>$} \major{ 2}{}{char }{Pseudo-TTY masters}
\major{ }{}{block}{Floppy disks} \major{ }{}{block}{Floppy disks}
\major{ 3}{}{char }{Reserved for PTY's $<$tytso@athena.mit.edu$>$} \major{ 3}{}{char }{Pseudo-TTY slaves}
\major{ }{}{block}{First MFM, RLL and IDE hard disk/CD-ROM interface} \major{ }{}{block}{First MFM, RLL and IDE hard disk/CD-ROM interface}
\major{ 4}{}{char }{TTY devices} \major{ 4}{}{char }{TTY devices}
\major{ 5}{}{char }{Alternate TTY devices} \major{ 5}{}{char }{Alternate TTY devices}
...@@ -142,7 +142,8 @@ an unreasonable effort. ...@@ -142,7 +142,8 @@ an unreasonable effort.
\major{ }{}{block}{Modular RAM disk} \major{ }{}{block}{Modular RAM disk}
\major{36}{}{char }{Netlink support} \major{36}{}{char }{Netlink support}
\major{ }{}{block}{MCA ESDI hard disk} \major{ }{}{block}{MCA ESDI hard disk}
\major{37}{--41}{}{Unallocated} \major{37}{}{char }{IDE tape}
\major{38}{--41}{}{Unallocated}
\major{42}{}{}{Demo/sample use} \major{42}{}{}{Demo/sample use}
\major{43}{--223}{}{Unallocated} \major{43}{--223}{}{Unallocated}
\major{224}{--239}{}{SEE NOTE} \major{224}{--239}{}{SEE NOTE}
...@@ -154,7 +155,7 @@ an unreasonable effort. ...@@ -154,7 +155,7 @@ an unreasonable effort.
\begin{devicelist} \begin{devicelist}
\major{0}{}{}{Unnamed devices (NFS mounts, loopback devices)} \major{0}{}{}{Unnamed devices (e.g. non-device mounts)}
\minor{0}{}{reserved as null device number} \minor{0}{}{reserved as null device number}
\end{devicelist} \end{devicelist}
...@@ -175,7 +176,24 @@ an unreasonable effort. ...@@ -175,7 +176,24 @@ an unreasonable effort.
\end{devicelist} \end{devicelist}
\begin{devicelist} \begin{devicelist}
\major{2}{}{char}{Reserved for PTY's $<$tytso@athena.mit.edu$>$} \major{2}{}{char}{Pseudo-TTY masters}
\minor{0}{/dev/ptyp0}{First PTY master}
\minor{1}{/dev/ptyp1}{Second PTY master}
\minordots
\minor{255}{/dev/ptyef}{256th PTY master}
\end{devicelist}
\noindent
Pseudo-TTY's are named as follows:
\begin{itemize}
\item Masters are {\file pty}, slaves are {\file tty};
\item the fourth letter is one of {\file pqrstuvwxyzabcde} indicating
the 1st through 16th series of 16 pseudo-ttys each, and
\item the fifth letter is one of {\file 0123456789abcdef} indicating
the position within the series.
\end{itemize}
\begin{devicelist}
\major{}{}{block}{Floppy disks} \major{}{}{block}{Floppy disks}
\minor{0}{/dev/fd0}{Controller 1, drive 1 autodetect} \minor{0}{/dev/fd0}{Controller 1, drive 1 autodetect}
\minor{1}{/dev/fd1}{Controller 1, drive 2 autodetect} \minor{1}{/dev/fd1}{Controller 1, drive 2 autodetect}
...@@ -235,7 +253,12 @@ letters {\file D}, {\file H}, or {\file E} for the 3.5" models have ...@@ -235,7 +253,12 @@ letters {\file D}, {\file H}, or {\file E} for the 3.5" models have
been deprecated, since the drive type is insignificant for these devices. been deprecated, since the drive type is insignificant for these devices.
\begin{devicelist} \begin{devicelist}
\major{3}{}{char}{Reserved for PTY's $<$tytso@athena.mit.edu$>$} \major{3}{}{char}{Pseudo-TTY slaves}
\minor{0}{/dev/ttyp0}{First PTY slave}
\minor{1}{/dev/ttyp1}{Second PTY slave}
\minordots
\minor{255}{/dev/ttyef}{256th PTY slave}
\\
\major{}{}{block}{First MFM, RLL and IDE hard disk/CD-ROM interface} \major{}{}{block}{First MFM, RLL and IDE hard disk/CD-ROM interface}
\minor{0}{/dev/hda}{Master: whole disk (or CD-ROM)} \minor{0}{/dev/hda}{Master: whole disk (or CD-ROM)}
\minor{64}{/dev/hdb}{Slave: whole disk (or CD-ROM)} \minor{64}{/dev/hdb}{Slave: whole disk (or CD-ROM)}
...@@ -271,14 +294,10 @@ been deprecated, since the drive type is insignificant for these devices. ...@@ -271,14 +294,10 @@ been deprecated, since the drive type is insignificant for these devices.
\end{devicelist} \end{devicelist}
\noindent \noindent
Pseudo-tty's are named as follows: For compatibility with previous versions of Linux, the first 64 PTYs
\begin{itemize} are replicated under this device number. This use will be obsolescent
\item Masters are {\file pty}, slaves are {\file tty}; with the release of Linux 1.4 and may be removed in a future version
\item the fourth letter is one of {\file pqrs} indicating of Linux.
the 1st, 2nd, 3rd, 4th series of 16 pseudo-ttys each, and
\item the fifth letter is one of {\file 0123456789abcdef} indicating
the position within the series.
\end{itemize}
\begin{devicelist} \begin{devicelist}
\major{ 5}{}{char }{Alternate TTY devices} \major{ 5}{}{char }{Alternate TTY devices}
...@@ -358,6 +377,10 @@ physical disks. ...@@ -358,6 +377,10 @@ physical disks.
\minor{5}{/dev/atarimouse}{Atari Mouse (68k)} \minor{5}{/dev/atarimouse}{Atari Mouse (68k)}
\minor{128}{/dev/beep}{Fancy beep device} \minor{128}{/dev/beep}{Fancy beep device}
\minor{129}{/dev/modreq}{Kernel module load request} \minor{129}{/dev/modreq}{Kernel module load request}
\minor{130}{/dev/watchdog}{Watchdog timer port}
\minor{131}{/dev/temperature}{Machine internal temperature}
\minor{132}{/dev/hwtrap}{Hardware fault trap}
\minor{133}{/dev/exttrp}{External device trap}
\end{devicelist} \end{devicelist}
\begin{devicelist} \begin{devicelist}
...@@ -730,16 +753,16 @@ major number 3). ...@@ -730,16 +753,16 @@ major number 3).
\begin{devicelist} \begin{devicelist}
\major{34}{}{char }{Z8530 HDLC driver} \major{34}{}{char }{Z8530 HDLC driver}
\minor{0}{/dev/sc1}{First Z8530, first port} \minor{0}{/dev/scc0}{First Z8530, first port}
\minor{1}{/dev/sc2}{First Z8530, second port} \minor{1}{/dev/scc1}{First Z8530, second port}
\minor{2}{/dev/sc3}{Second Z8530, first port} \minor{2}{/dev/scc2}{Second Z8530, first port}
\minor{3}{/dev/sc4}{Second Z8530, second port} \minor{3}{/dev/scc3}{Second Z8530, second port}
\minordots \minordots
\end{devicelist} \end{devicelist}
\noindent \noindent
The author has indicated that the device names will change in a In a previous version these files were named {\file /dev/sc1} for
subsequent version; {\file /dev/sc1} will become {\file /dev/scc0} etc. {\file /dev/scc0}, {\file /dev/sc2} for {\file /dev/scc1}, and so on.
\begin{devicelist} \begin{devicelist}
\major{ }{}{block}{Fourth IDE hard disk/CD-ROM interface} \major{ }{}{block}{Fourth IDE hard disk/CD-ROM interface}
...@@ -789,7 +812,16 @@ Partitions are handled the same way as for IDE disks (see major number ...@@ -789,7 +812,16 @@ Partitions are handled the same way as for IDE disks (see major number
3). 3).
\begin{devicelist} \begin{devicelist}
\major{37}{--41}{}{Unallocated} \major{37}{}{char }{IDE tape}
\minor{0}{/dev/ht0}{First IDE tape}
\minor{128}{/dev/nht0}{First IDE tape, no rewind-on-close}
\end{devicelist}
\noindent
Currently, only one IDE tape drive is supported.
\begin{devicelist}
\major{38}{--41}{}{Unallocated}
\end{devicelist} \end{devicelist}
\begin{devicelist} \begin{devicelist}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Maintained by H. Peter Anvin <Peter.Anvin@linux.org> Maintained by H. Peter Anvin <Peter.Anvin@linux.org>
Last revised: September 20, 1995 Last revised: December 4, 1995
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
...@@ -31,7 +31,7 @@ that semantically altered versions are not distributed without ...@@ -31,7 +31,7 @@ that semantically altered versions are not distributed without
permission of the author, assuming the author can be contacted without permission of the author, assuming the author can be contacted without
an unreasonable effort. an unreasonable effort.
0 Unnamed devices (NFS mounts, loopback devices) 0 Unnamed devices (e.g. non-device mounts)
0 = reserved as null device number 0 = reserved as null device number
1 char Memory devices 1 char Memory devices
...@@ -46,8 +46,20 @@ an unreasonable effort. ...@@ -46,8 +46,20 @@ an unreasonable effort.
9 = /dev/urandom Faster, less secure random number gen. 9 = /dev/urandom Faster, less secure random number gen.
block RAM disk block RAM disk
1 = /dev/ramdisk RAM disk 1 = /dev/ramdisk RAM disk
2 char Pseudo-TTY masters
0 = /dev/ptyp0 First PTY master
1 = /dev/ptyp1 Second PTY master
...
256 = /dev/ptyef 256th PTY master
2 char Reserved for PTY's <tytso@athena.mit.edu> Pseudo-tty's are named as follows:
* Masters are "pty", slaves are "tty";
* the fourth letter is one of pqrstuvwxyzabcde indicating
the 1st through 16th series of 16 pseudo-ttys each, and
* the fifth letter is one of 0123456789abcdef indicating
the position within the series.
block Floppy disks block Floppy disks
0 = /dev/fd0 First floppy disk autodetect 0 = /dev/fd0 First floppy disk autodetect
1 = /dev/fd1 Second floppy disk autodetect 1 = /dev/fd1 Second floppy disk autodetect
...@@ -100,7 +112,12 @@ an unreasonable effort. ...@@ -100,7 +112,12 @@ an unreasonable effort.
and E for the 3.5" models have been deprecated, since and E for the 3.5" models have been deprecated, since
the drive type is insignificant for these devices. the drive type is insignificant for these devices.
3 char Reserved for pty's <tytso@athena.mit.edu> 3 char Pseudo-TTY slaves
0 = /dev/ttyp0 First PTY slave
1 = /dev/ttyp1 Second PTY slave
...
256 = /dev/ttyef 256th PTY slave
block First MFM, RLL and IDE hard disk/CD-ROM interface block First MFM, RLL and IDE hard disk/CD-ROM interface
0 = /dev/hda Master: whole disk (or CD-ROM) 0 = /dev/hda Master: whole disk (or CD-ROM)
64 = /dev/hdb Slave: whole disk (or CD-ROM) 64 = /dev/hdb Slave: whole disk (or CD-ROM)
...@@ -133,12 +150,11 @@ an unreasonable effort. ...@@ -133,12 +150,11 @@ an unreasonable effort.
... ...
255 = /dev/ttysf 64th pseudo-tty slave 255 = /dev/ttysf 64th pseudo-tty slave
Pseudo-tty's are named as follows: For compatibility with previous versions of Linux, the
* Masters are "pty", slaves are "tty"; first 64 PTYs are replicated under this device
* the fourth letter is one of p, q, r, s indicating number. This use will be obsolescent with the release
the 1st, 2nd, 3rd, 4th series of 16 pseudo-ttys each, and of Linux 1.4 and may be removed in a future version of
* the fifth letter is one of 0123456789abcdef indicating Linux.
the position within the series.
5 char Alternate TTY devices 5 char Alternate TTY devices
0 = /dev/tty Current TTY device 0 = /dev/tty Current TTY device
...@@ -203,9 +219,10 @@ an unreasonable effort. ...@@ -203,9 +219,10 @@ an unreasonable effort.
5 = /dev/atarimouse Atari Mouse (68k) 5 = /dev/atarimouse Atari Mouse (68k)
128 = /dev/beep Fancy beep device 128 = /dev/beep Fancy beep device
129 = /dev/modreq Kernel module load request 129 = /dev/modreq Kernel module load request
130 = /dev/watchdog Watchdog timer port
The use of the suffix -mouse instead of -bm or -aux 131 = /dev/temperature Machine internal temperature
has also been used. 132 = /dev/hwtrap Hardware fault trap
133 = /dev/exttrp External device trap
11 block SCSI CD-ROM devices 11 block SCSI CD-ROM devices
0 = /dev/sr0 First SCSI CD-ROM 0 = /dev/sr0 First SCSI CD-ROM
...@@ -533,7 +550,13 @@ an unreasonable effort. ...@@ -533,7 +550,13 @@ an unreasonable effort.
Partitions are handled in the same way as IDE disks Partitions are handled in the same way as IDE disks
(see major number 3). (see major number 3).
37-41 UNALLOCATED 37 char IDE tape
0 = /dev/ht0 First IDE tape
128 = /dev/nht0 First IDE tape, no rewind-on-close
Currently, only one IDE tape drive is supported.
38-41 UNALLOCATED
42 Demo/sample use 42 Demo/sample use
......
...@@ -58,8 +58,15 @@ Where do I discuss these drivers? ...@@ -58,8 +58,15 @@ Where do I discuss these drivers?
BOINGY - the linux-arcnet@807-city.on.ca mailing list is now so unstable BOINGY - the linux-arcnet@807-city.on.ca mailing list is now so unstable
that I can't recommend people even bother with it. I no longer have an that I can't recommend people even bother with it. I no longer have an
account on 807-CITY (though they still graciously forward my mail to me) so account on 807-CITY (though they still graciously forward my mail to me) so
there's not much I can do. If there's sufficient interest (e-mail me!) I there's not much I can do.
will set one up at my new address, Foxnet.
However, Tomasz Motylewski has been so kind as to set up a new and improved
mailing list; subscribe by sending a message with the BODY "subscribe
linux-arcnet YOUR REAL NAME" to listserv@tichy.ch.uj.edu.pl. Then, to
submit messages to the list, mail to linux-arcnet@tichy.ch.uj.edu.pl.
There are mailing list archives at:
http://tichy.ch.uj.edu.pl/lists/linux-arcnet
Send all bug (or success) reports to me, then, not the list, since (as I Send all bug (or success) reports to me, then, not the list, since (as I
mentioned) the list doesn't work. mentioned) the list doesn't work.
......
...@@ -50,6 +50,7 @@ an ftp site, where 'X.Y.ZZ' is the kernel version for the ioctl list. ...@@ -50,6 +50,7 @@ an ftp site, where 'X.Y.ZZ' is the kernel version for the ioctl list.
Magic Name Number Structure File Magic Name Number Structure File
=========================================================================== ===========================================================================
APM_BIOS_MAGIC 0x4101 struct apm_struct include/linux/apm_bios.h
CYCLADES_MAGIC 0x4359 struct cyclades_port include/linux/cyclades.h CYCLADES_MAGIC 0x4359 struct cyclades_port include/linux/cyclades.h
FASYNC_MAGIC 0x4601 struct fasync_struct include/linux/fs.h FASYNC_MAGIC 0x4601 struct fasync_struct include/linux/fs.h
PTY_MAGIC 0x5001 struct pty_struct drivers/char/pty.c PTY_MAGIC 0x5001 struct pty_struct drivers/char/pty.c
...@@ -73,6 +74,7 @@ Ioctl Include File Comments ...@@ -73,6 +74,7 @@ Ioctl Include File Comments
0x06 linux/lp.h 0x06 linux/lp.h
0x12 linux/fs.h 0x12 linux/fs.h
0x20 linux/cm206.h 0x20 linux/cm206.h
'A' linux/apm_bios.h
'C' linux/soundcard.h 'C' linux/soundcard.h
'K' linux/kd.h 'K' linux/kd.h
'M' linux/soundcard.h 'M' linux/soundcard.h
......
VERSION = 1 VERSION = 1
PATCHLEVEL = 3 PATCHLEVEL = 3
SUBLEVEL = 45 SUBLEVEL = 46
ARCH = i386 ARCH = i386
...@@ -171,9 +171,11 @@ symlinks: ...@@ -171,9 +171,11 @@ symlinks:
oldconfig: symlinks oldconfig: symlinks
$(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in $(CONFIG_SHELL) scripts/Configure -d arch/$(ARCH)/config.in
xconfig: symlinks xconfig: symlinks scripts/kconfig.tk
( cd scripts ; make kconfig.tk) wish -f scripts/kconfig.tk
./scripts/kconfig.tk
scripts/kconfig.tk:
$(MAKE) -C scripts kconfig.tk
config: symlinks config: symlinks
$(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in $(CONFIG_SHELL) scripts/Configure arch/$(ARCH)/config.in
...@@ -294,7 +296,8 @@ mrproper: clean ...@@ -294,7 +296,8 @@ mrproper: clean
rm -f $(TOPDIR)/include/linux/modules/* rm -f $(TOPDIR)/include/linux/modules/*
distclean: mrproper distclean: mrproper
rm -f core `find . -name '*.orig' -print` rm -f core `find . \( -name '*.orig' -o -name '*~' -o -name '*.bak' \
-o -name '#*#' -o -name '.*.orig' \) -print`
backup: mrproper backup: mrproper
......
...@@ -624,7 +624,7 @@ sys_call_table: ...@@ -624,7 +624,7 @@ sys_call_table:
.quad sys_ftruncate, do_entSys, sys_setgid, sys_sendto, sys_shutdown .quad sys_ftruncate, do_entSys, sys_setgid, sys_sendto, sys_shutdown
.quad sys_socketpair, sys_mkdir, sys_rmdir, sys_utimes, do_entSys .quad sys_socketpair, sys_mkdir, sys_rmdir, sys_utimes, do_entSys
.quad do_entSys, sys_getpeername, do_entSys, do_entSys, sys_getrlimit .quad do_entSys, sys_getpeername, do_entSys, do_entSys, sys_getrlimit
.quad sys_setrlimit, do_entSys, sys_setsid, do_entSys, do_entSys .quad sys_setrlimit, do_entSys, sys_setsid, sys_quotactl, do_entSys
/*150*/ .quad sys_getsockname, do_entSys, do_entSys, do_entSys, do_entSys /*150*/ .quad sys_getsockname, do_entSys, do_entSys, do_entSys, do_entSys
.quad do_entSys, sys_sigaction, do_entSys, do_entSys, osf_getdirentries .quad do_entSys, sys_sigaction, do_entSys, do_entSys, osf_getdirentries
.quad osf_statfs, osf_fstatfs, do_entSys, do_entSys, do_entSys .quad osf_statfs, osf_fstatfs, do_entSys, do_entSys, do_entSys
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/io.h> #include <asm/io.h>
extern int do_mount(kdev_t, const char *, char *, int, void *); extern int do_mount(kdev_t, const char *, const char *, char *, int, void *);
extern int do_pipe(int *); extern int do_pipe(int *);
extern struct file_operations * get_blkfops(unsigned int); extern struct file_operations * get_blkfops(unsigned int);
...@@ -308,7 +308,7 @@ static int osf_ufs_mount(char * dirname, struct ufs_args * args, int flags) ...@@ -308,7 +308,7 @@ static int osf_ufs_mount(char * dirname, struct ufs_args * args, int flags)
retval = getdev(tmp.devname, 0, &inode); retval = getdev(tmp.devname, 0, &inode);
if (retval) if (retval)
return retval; return retval;
retval = do_mount(inode->i_rdev, dirname, "ext2", flags, NULL); retval = do_mount(inode->i_rdev, tmp.devname, dirname, "ext2", flags, NULL);
if (retval) if (retval)
putdev(inode); putdev(inode);
iput(inode); iput(inode);
...@@ -328,7 +328,7 @@ static int osf_cdfs_mount(char * dirname, struct cdfs_args * args, int flags) ...@@ -328,7 +328,7 @@ static int osf_cdfs_mount(char * dirname, struct cdfs_args * args, int flags)
retval = getdev(tmp.devname, 1, &inode); retval = getdev(tmp.devname, 1, &inode);
if (retval) if (retval)
return retval; return retval;
retval = do_mount(inode->i_rdev, dirname, "iso9660", flags, NULL); retval = do_mount(inode->i_rdev, tmp.devname, dirname, "iso9660", flags, NULL);
if (retval) if (retval)
putdev(inode); putdev(inode);
iput(inode); iput(inode);
...@@ -348,7 +348,7 @@ static int osf_procfs_mount(char * dirname, struct procfs_args * args, int flags ...@@ -348,7 +348,7 @@ static int osf_procfs_mount(char * dirname, struct procfs_args * args, int flags
dev = get_unnamed_dev(); dev = get_unnamed_dev();
if (!dev) if (!dev)
return -ENODEV; return -ENODEV;
retval = do_mount(dev, dirname, "proc", flags, NULL); retval = do_mount(dev, "", dirname, "proc", flags, NULL);
if (retval) if (retval)
put_unnamed_dev(dev); put_unnamed_dev(dev);
return retval; return retval;
......
This diff is collapsed.
...@@ -56,7 +56,7 @@ fi ...@@ -56,7 +56,7 @@ fi
mainmenu_option next_comment mainmenu_option next_comment
comment 'CD-ROM drivers (not for SCSI or IDE/ATAPI drives)' comment 'CD-ROM drivers (not for SCSI or IDE/ATAPI drives)'
bool 'Support non-SCSI/IDE/ATAPI drives' CONFIG_CD_NO_IDESCSI bool 'Support non-SCSI/IDE/ATAPI CDROM drives' CONFIG_CD_NO_IDESCSI
if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
source drivers/cdrom/Config.in source drivers/cdrom/Config.in
fi fi
......
...@@ -31,7 +31,9 @@ CONFIG_ST506=y ...@@ -31,7 +31,9 @@ CONFIG_ST506=y
# #
# CONFIG_BLK_DEV_HD is not set # CONFIG_BLK_DEV_HD is not set
CONFIG_BLK_DEV_IDE=y CONFIG_BLK_DEV_IDE=y
CONFIG_BLK_DEV_IDEATAPI=y
CONFIG_BLK_DEV_IDECD=y CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_TRITON is not set # CONFIG_BLK_DEV_TRITON is not set
# CONFIG_BLK_DEV_XD is not set # CONFIG_BLK_DEV_XD is not set
...@@ -119,6 +121,11 @@ CONFIG_ISO9660_FS=y ...@@ -119,6 +121,11 @@ CONFIG_ISO9660_FS=y
# CONFIG_MS_BUSMOUSE is not set # CONFIG_MS_BUSMOUSE is not set
# CONFIG_ATIXL_BUSMOUSE is not set # CONFIG_ATIXL_BUSMOUSE is not set
# CONFIG_QIC02_TAPE is not set # CONFIG_QIC02_TAPE is not set
# CONFIG_APM is not set
# CONFIG_APM_IGNORE_USER_SUSPEND is not set
# CONFIG_APM_DO_ENABLE is not set
CONFIG_APM_CPU_IDLE=y
# CONFIG_APM_DISPLAY_BLANK is not set
# #
# Sound # Sound
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/tasks.h> #include <linux/tasks.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <linux/config.h>
#define CL_MAGIC_ADDR 0x90020 #define CL_MAGIC_ADDR 0x90020
#define CL_MAGIC 0xA33F #define CL_MAGIC 0xA33F
...@@ -382,7 +383,11 @@ ENTRY(idt) ...@@ -382,7 +383,11 @@ ENTRY(idt)
ALIGN ALIGN
.word 0 .word 0
gdt_descr: gdt_descr:
#ifdef CONFIG_APM
.word (11+2*NR_TASKS)*8-1
#else
.word (8+2*NR_TASKS)*8-1 .word (8+2*NR_TASKS)*8-1
#endif
.long 0xc0000000+SYMBOL_NAME(gdt) .long 0xc0000000+SYMBOL_NAME(gdt)
/* /*
...@@ -399,3 +404,8 @@ ENTRY(gdt) ...@@ -399,3 +404,8 @@ ENTRY(gdt)
.quad 0x0000000000000000 /* not used */ .quad 0x0000000000000000 /* not used */
.quad 0x0000000000000000 /* not used */ .quad 0x0000000000000000 /* not used */
.fill 2*NR_TASKS,8,0 /* space for LDT's and TSS's etc */ .fill 2*NR_TASKS,8,0 /* space for LDT's and TSS's etc */
#ifdef CONFIG_APM
.quad 0x00c09a0000000000 /* APM CS code */
.quad 0x00809a0000000000 /* APM CS 16 code (16 bit) */
.quad 0x00c0920000000000 /* APM DS data */
#endif
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include <linux/ldt.h> #include <linux/ldt.h>
#include <linux/user.h> #include <linux/user.h>
#include <linux/a.out.h> #include <linux/a.out.h>
#include <linux/interrupt.h>
#include <linux/config.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -29,8 +31,15 @@ ...@@ -29,8 +31,15 @@
asmlinkage void ret_from_sys_call(void) __asm__("ret_from_sys_call"); asmlinkage void ret_from_sys_call(void) __asm__("ret_from_sys_call");
#ifdef CONFIG_APM
extern int apm_do_idle(void);
extern void apm_do_busy(void);
#endif
static int hlt_counter=0; static int hlt_counter=0;
#define HARD_IDLE_TIMEOUT (HZ / 3)
void disable_hlt(void) void disable_hlt(void)
{ {
hlt_counter++; hlt_counter++;
...@@ -41,11 +50,41 @@ void enable_hlt(void) ...@@ -41,11 +50,41 @@ void enable_hlt(void)
hlt_counter--; hlt_counter--;
} }
static void hard_idle(void)
{
while (!need_resched) {
if (hlt_works_ok && !hlt_counter) {
#ifdef CONFIG_APM
/* If the APM BIOS is not enabled, or there
is an error calling the idle routine, we
should hlt if possible. We need to check
need_resched again because an interrupt
may have occured in apm_do_idle(). */
start_bh_atomic();
if (!apm_do_idle() && !need_resched)
__asm__("hlt");
end_bh_atomic();
#else
__asm__("hlt");
#endif
}
if (need_resched) break;
schedule();
}
#ifdef CONFIG_APM
apm_do_busy();
#endif
}
/* /*
* The idle loop on a i386.. * The idle loop on a i386..
*/ */
asmlinkage int sys_idle(void) asmlinkage int sys_idle(void)
{ {
#ifndef __SMP__
unsigned long start_idle = 0;
#endif
if (current->pid != 0) if (current->pid != 0)
{ {
/* printk("Wrong process idled\n"); SMP bug check */ /* printk("Wrong process idled\n"); SMP bug check */
...@@ -78,10 +117,17 @@ asmlinkage int sys_idle(void) ...@@ -78,10 +117,17 @@ asmlinkage int sys_idle(void)
for (;;) { for (;;) {
#ifdef __SMP__ #ifdef __SMP__
if (cpu_data[smp_processor_id()].hlt_works_ok && !hlt_counter && !need_resched) if (cpu_data[smp_processor_id()].hlt_works_ok && !hlt_counter && !need_resched)
#else
if (hlt_works_ok && !hlt_counter && !need_resched)
#endif
__asm__("hlt"); __asm__("hlt");
#else
if (!start_idle) start_idle = jiffies;
if (jiffies - start_idle > HARD_IDLE_TIMEOUT) {
hard_idle();
} else {
if (hlt_works_ok && !hlt_counter && !need_resched)
__asm__("hlt");
}
if (need_resched) start_idle = 0;
#endif
schedule(); schedule();
} }
} }
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/config.h> #include <linux/config.h>
#ifdef CONFIG_APM
#include <linux/apm_bios.h>
#endif
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -54,6 +57,9 @@ int EISA_bus = 0; ...@@ -54,6 +57,9 @@ int EISA_bus = 0;
*/ */
struct drive_info_struct { char dummy[32]; } drive_info; struct drive_info_struct { char dummy[32]; } drive_info;
struct screen_info screen_info; struct screen_info screen_info;
#ifdef CONFIG_APM
struct apm_bios_info apm_bios_info;
#endif
unsigned char aux_device_present; unsigned char aux_device_present;
extern int ramdisk_size; extern int ramdisk_size;
...@@ -67,6 +73,9 @@ extern char empty_zero_page[PAGE_SIZE]; ...@@ -67,6 +73,9 @@ extern char empty_zero_page[PAGE_SIZE];
*/ */
#define PARAM empty_zero_page #define PARAM empty_zero_page
#define EXT_MEM_K (*(unsigned short *) (PARAM+2)) #define EXT_MEM_K (*(unsigned short *) (PARAM+2))
#ifdef CONFIG_APM
#define APM_BIOS_INFO (*(struct apm_bios_info *) (PARAM+64))
#endif
#define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80)) #define DRIVE_INFO (*(struct drive_info_struct *) (PARAM+0x80))
#define SCREEN_INFO (*(struct screen_info *) (PARAM+0)) #define SCREEN_INFO (*(struct screen_info *) (PARAM+0))
#define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2)) #define MOUNT_ROOT_RDONLY (*(unsigned short *) (PARAM+0x1F2))
...@@ -95,6 +104,9 @@ void setup_arch(char **cmdline_p, ...@@ -95,6 +104,9 @@ void setup_arch(char **cmdline_p,
ROOT_DEV = to_kdev_t(ORIG_ROOT_DEV); ROOT_DEV = to_kdev_t(ORIG_ROOT_DEV);
drive_info = DRIVE_INFO; drive_info = DRIVE_INFO;
screen_info = SCREEN_INFO; screen_info = SCREEN_INFO;
#ifdef CONFIG_APM
apm_bios_info = APM_BIOS_INFO;
#endif
aux_device_present = AUX_DEVICE_INFO; aux_device_present = AUX_DEVICE_INFO;
memory_end = (1<<20) + (EXT_MEM_K<<10); memory_end = (1<<20) + (EXT_MEM_K<<10);
memory_end &= PAGE_MASK; memory_end &= PAGE_MASK;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/mc146818rtc.h> #include <linux/mc146818rtc.h>
#include <linux/timex.h> #include <linux/timex.h>
#include <linux/config.h>
#define TIMER_IRQ 0 #define TIMER_IRQ 0
...@@ -313,9 +314,8 @@ static inline unsigned long mktime(unsigned int year, unsigned int mon, ...@@ -313,9 +314,8 @@ static inline unsigned long mktime(unsigned int year, unsigned int mon,
)*60 + sec; /* finally seconds */ )*60 + sec; /* finally seconds */
} }
void time_init(void) unsigned long get_cmos_time(void)
{ {
void (*irq_handler)(int, struct pt_regs *);
unsigned int year, mon, day, hour, min, sec; unsigned int year, mon, day, hour, min, sec;
int i; int i;
...@@ -350,11 +350,21 @@ void time_init(void) ...@@ -350,11 +350,21 @@ void time_init(void)
} }
if ((year += 1900) < 1970) if ((year += 1900) < 1970)
year += 100; year += 100;
xtime.tv_sec = mktime(year, mon, day, hour, min, sec); return mktime(year, mon, day, hour, min, sec);
}
void time_init(void)
{
void (*irq_handler)(int, struct pt_regs *);
xtime.tv_sec = get_cmos_time();
xtime.tv_usec = 0; xtime.tv_usec = 0;
/* If we have the CPU hardware time counters, use them */ /* If we have the CPU hardware time counters, use them */
irq_handler = timer_interrupt; irq_handler = timer_interrupt;
#ifndef CONFIG_APM
/* Don't use them if a suspend/resume could
corrupt the timer value. This problem
needs more debugging. */
if (x86_capability & 16) { if (x86_capability & 16) {
irq_handler = pentium_timer_interrupt; irq_handler = pentium_timer_interrupt;
do_gettimeoffset = do_fast_gettimeoffset; do_gettimeoffset = do_fast_gettimeoffset;
...@@ -363,6 +373,7 @@ void time_init(void) ...@@ -363,6 +373,7 @@ void time_init(void)
:"=a" (((unsigned long *) &init_timer_cc)[0]), :"=a" (((unsigned long *) &init_timer_cc)[0]),
"=d" (((unsigned long *) &init_timer_cc)[1])); "=d" (((unsigned long *) &init_timer_cc)[1]));
} }
#endif
if (request_irq(TIMER_IRQ, irq_handler, 0, "timer") != 0) if (request_irq(TIMER_IRQ, irq_handler, 0, "timer") != 0)
panic("Could not allocate timer IRQ!"); panic("Could not allocate timer IRQ!");
} }
...@@ -623,4 +623,4 @@ sys_call_table: ...@@ -623,4 +623,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
...@@ -97,4 +97,4 @@ bptr: ori r0, r0, 0 ...@@ -97,4 +97,4 @@ bptr: ori r0, r0, 0
BEEF BEEF
BEEF BEEF
#endif #endif
_END: _END:
\ No newline at end of file
...@@ -15,7 +15,11 @@ if [ "$CONFIG_ST506" = "y" ]; then ...@@ -15,7 +15,11 @@ if [ "$CONFIG_ST506" = "y" ]; then
bool ' Use new IDE driver for primary/secondary i/f' CONFIG_BLK_DEV_IDE bool ' Use new IDE driver for primary/secondary i/f' CONFIG_BLK_DEV_IDE
fi fi
if [ "$CONFIG_BLK_DEV_IDE" = "y" ]; then if [ "$CONFIG_BLK_DEV_IDE" = "y" ]; then
bool ' Include support for IDE/ATAPI CDROMs' CONFIG_BLK_DEV_IDECD bool ' Include support for IDE/ATAPI CDROM or TAPE' CONFIG_BLK_DEV_IDEATAPI
if [ "$CONFIG_BLK_DEV_IDEATAPI" = "y" ]; then
bool ' Include support for IDE/ATAPI CDROM' CONFIG_BLK_DEV_IDECD
bool ' Include ALPHA support for IDE/ATAPI TAPE' CONFIG_BLK_DEV_IDETAPE
fi
if [ "$CONFIG_PCI" = "y" ]; then if [ "$CONFIG_PCI" = "y" ]; then
bool ' PCI Triton IDE Bus Master DMA support' CONFIG_BLK_DEV_TRITON bool ' PCI Triton IDE Bus Master DMA support' CONFIG_BLK_DEV_TRITON
fi fi
......
...@@ -27,3 +27,19 @@ makedevs hde 33 0 ...@@ -27,3 +27,19 @@ makedevs hde 33 0
makedevs hdf 33 64 makedevs hdf 33 64
makedevs hdg 34 0 makedevs hdg 34 0
makedevs hdh 34 64 makedevs hdh 34 64
# Create the ide-tape rewinding character device.
rm -f /dev/ht0
echo mknod /dev/ht0 c 37 0
mknod /dev/ht0 c 37 0
chown root:disk /dev/ht0
chmod 660 /dev/ht0
# Create the ide-tape non rewinding character device.
rm -f /dev/nht0
echo mknod /dev/nht0 c 37 128
mknod /dev/nht0 c 37 128
chown root:disk /dev/nht0
chmod 660 /dev/nht0
...@@ -44,6 +44,10 @@ ifeq ($(CONFIG_BLK_DEV_IDECD),y) ...@@ -44,6 +44,10 @@ ifeq ($(CONFIG_BLK_DEV_IDECD),y)
L_OBJS += ide-cd.o L_OBJS += ide-cd.o
endif endif
ifeq ($(CONFIG_BLK_DEV_IDETAPE),y)
L_OBJS += ide-tape.o
endif
ifeq ($(CONFIG_BLK_DEV_XD),y) ifeq ($(CONFIG_BLK_DEV_XD),y)
L_OBJS += xd.o L_OBJS += xd.o
endif endif
......
README.ide -- Information regarding ide.c and ide-cd.c (IDE driver in 1.3.x) README.ide -- Information regarding ide.c and ide-cd.c (IDE driver in 1.3.xx)
================================================================================ ================================================================================
Supported by: mlord@bnr.ca -- disks, interfaces, probing Supported by: mlord@bnr.ca -- disks, interfaces, probing
snyder@fnald0.fnal.gov -- cdroms, ATAPI, audio snyder@fnald0.fnal.gov -- cdroms, ATAPI, audio
......
/* /*
* linux/drivers/block/cmd640.c Version 0.01 Nov 16, 1995 * linux/drivers/block/cmd640.c Version 0.02 Nov 30, 1995
* *
* Copyright (C) 1995 Linus Torvalds & author (see below) * Copyright (C) 1995 Linus Torvalds & author (see below)
*/ */
...@@ -13,8 +13,56 @@ ...@@ -13,8 +13,56 @@
* Version 0.01 Initial version, hacked out of ide.c, * Version 0.01 Initial version, hacked out of ide.c,
* and #include'd rather than compiled separately. * and #include'd rather than compiled separately.
* This will get cleaned up in a subsequent release. * This will get cleaned up in a subsequent release.
*
* Version 0.02 Fixes for vlb initialization code, enable
* read-ahead for versions 'B' and 'C' of chip by
* default, some code cleanup.
*
*/ */
/*
* CMD640 specific registers definition.
*/
#define VID 0x00
#define DID 0x02
#define PCMD 0x04
#define PSTTS 0x06
#define REVID 0x08
#define PROGIF 0x09
#define SUBCL 0x0a
#define BASCL 0x0b
#define BaseA0 0x10
#define BaseA1 0x14
#define BaseA2 0x18
#define BaseA3 0x1c
#define INTLINE 0x3c
#define INPINE 0x3d
#define CFR 0x50
#define CFR_DEVREV 0x03
#define CFR_IDE01INTR 0x04
#define CFR_DEVID 0x18
#define CFR_AT_VESA_078h 0x20
#define CFR_DSA1 0x40
#define CFR_DSA0 0x80
#define CNTRL 0x51
#define CNTRL_DIS_RA0 0x40
#define CNTRL_DIS_RA1 0x80
#define CNTRL_ENA_2ND 0x08
#define CMDTIM 0x52
#define ARTTIM0 0x53
#define DRWTIM0 0x54
#define ARTTIM1 0x55
#define DRWTIM1 0x56
#define ARTTIM23 0x57
#define DIS_RA2 0x04
#define DIS_RA3 0x08
#define DRWTIM23 0x58
#define BRST 0x59
/* Interface to access cmd640x registers */ /* Interface to access cmd640x registers */
static void (*put_cmd640_reg)(int key, int reg_no, int val); static void (*put_cmd640_reg)(int key, int reg_no, int val);
static byte (*get_cmd640_reg)(int key, int reg_no); static byte (*get_cmd640_reg)(int key, int reg_no);
...@@ -24,6 +72,7 @@ static int bus_type = none; ...@@ -24,6 +72,7 @@ static int bus_type = none;
static int cmd640_chip_version; static int cmd640_chip_version;
static int cmd640_key; static int cmd640_key;
static byte is_cmd640[MAX_HWIFS]; static byte is_cmd640[MAX_HWIFS];
static int bus_speed; /* MHz */
/* /*
* For some unknown reasons pcibios functions which read and write registers * For some unknown reasons pcibios functions which read and write registers
...@@ -51,7 +100,7 @@ static byte get_cmd640_reg_pci1(int key, int reg_no) ...@@ -51,7 +100,7 @@ static byte get_cmd640_reg_pci1(int key, int reg_no)
save_flags(flags); save_flags(flags);
cli(); cli();
outl_p((reg_no & 0xfc) | key, 0xcf8); outl_p((reg_no & 0xfc) | key, 0xcf8);
b = inb(0xcfc + (reg_no & 3)); b = inb_p(0xcfc + (reg_no & 3));
restore_flags(flags); restore_flags(flags);
return b; return b;
} }
...@@ -78,7 +127,7 @@ static byte get_cmd640_reg_pci2(int key, int reg_no) ...@@ -78,7 +127,7 @@ static byte get_cmd640_reg_pci2(int key, int reg_no)
save_flags(flags); save_flags(flags);
cli(); cli();
outb_p(0x10, 0xcf8); outb_p(0x10, 0xcf8);
b = inb(key + reg_no); b = inb_p(key + reg_no);
outb_p(0, 0xcf8); outb_p(0, 0xcf8);
restore_flags(flags); restore_flags(flags);
return b; return b;
...@@ -92,8 +141,8 @@ static void put_cmd640_reg_vlb(int key, int reg_no, int val) ...@@ -92,8 +141,8 @@ static void put_cmd640_reg_vlb(int key, int reg_no, int val)
save_flags(flags); save_flags(flags);
cli(); cli();
outb(reg_no, key + 8); outb_p(reg_no, key + 8);
outb(val, key + 0xc); outb_p(val, key + 0xc);
restore_flags(flags); restore_flags(flags);
} }
...@@ -104,8 +153,8 @@ static byte get_cmd640_reg_vlb(int key, int reg_no) ...@@ -104,8 +153,8 @@ static byte get_cmd640_reg_vlb(int key, int reg_no)
save_flags(flags); save_flags(flags);
cli(); cli();
outb(reg_no, key + 8); outb_p(reg_no, key + 8);
b = inb(key + 0xc); b = inb_p(key + 0xc);
restore_flags(flags); restore_flags(flags);
return b; return b;
} }
...@@ -164,12 +213,12 @@ static int probe_for_cmd640_pci2(void) ...@@ -164,12 +213,12 @@ static int probe_for_cmd640_pci2(void)
static int probe_for_cmd640_vlb(void) { static int probe_for_cmd640_vlb(void) {
byte b; byte b;
outb(0x50, 0x178); outb(CFR, 0x178);
b = inb(0x17c); b = inb(0x17c);
if (b == 0xff || b == 0 || (b & 0x20)) { if (b == 0xff || b == 0 || (b & CFR_AT_VESA_078h)) {
outb(0x50, 0xc78); outb(CFR, 0x78);
b = inb(0x7c); b = inb(0x7c);
if (b == 0xff || b == 0 || !(b & 0x20)) if (b == 0xff || b == 0 || !(b & CFR_AT_VESA_078h))
return 0; return 0;
cmd640_key = 0x70; cmd640_key = 0x70;
} else { } else {
...@@ -186,7 +235,10 @@ static int probe_for_cmd640_vlb(void) { ...@@ -186,7 +235,10 @@ static int probe_for_cmd640_vlb(void) {
int ide_probe_for_cmd640x(void) int ide_probe_for_cmd640x(void)
{ {
int i; int i;
int second_port;
int read_ahead;
byte b;
for (i = 0; i < MAX_HWIFS; i++) for (i = 0; i < MAX_HWIFS; i++)
is_cmd640[i] = 0; is_cmd640[i] = 0;
...@@ -217,19 +269,60 @@ int ide_probe_for_cmd640x(void) ...@@ -217,19 +269,60 @@ int ide_probe_for_cmd640x(void)
* Documented magic. * Documented magic.
*/ */
cmd640_chip_version = get_cmd640_reg(cmd640_key, 0x50) & 3; cmd640_chip_version = get_cmd640_reg(cmd640_key, CFR) & CFR_DEVREV;
if (cmd640_chip_version == 0) { if (cmd640_chip_version == 0) {
printk ("ide: wrong CMD640 version -- 0\n"); printk ("ide: wrong CMD640 version -- 0\n");
return 0; return 0;
} }
put_cmd640_reg(cmd640_key, 0x51, get_cmd640_reg(cmd640_key, 0x51) | 0xc8); /*
put_cmd640_reg(cmd640_key, 0x57, 0); * Do not initialize secondary controller for vlbus
put_cmd640_reg(cmd640_key, 0x57, get_cmd640_reg(cmd640_key, 0x57) | 0x0c); */
second_port = (bus_type != vlb);
/*
* Set the maximum allowed bus speed (it is safest until we
* find how detect bus speed)
* Normally PCI bus runs at 33MHz, but often works overclocked to 40
*/
bus_speed = (bus_type == vlb) ? 50 : 40;
#if 0 /* don't know if this is reliable yet */
/*
* Enable readahead for versions above 'A'
*/
read_ahead = (cmd640_chip_version > 1);
#else
read_ahead = 0;
#endif
/*
* Setup Control Register
*/
b = get_cmd640_reg(cmd640_key, CNTRL);
if (second_port)
b |= CNTRL_ENA_2ND;
else
b &= ~CNTRL_ENA_2ND;
if (read_ahead)
b &= ~(CNTRL_DIS_RA0 | CNTRL_DIS_RA1);
else
b |= (CNTRL_DIS_RA0 | CNTRL_DIS_RA1);
put_cmd640_reg(cmd640_key, CNTRL, b);
/*
* Initialize 2nd IDE port, if required
*/
if (second_port) {
/* We reset timings, and setup read-ahead */
b = read_ahead ? 0 : (DIS_RA2 | DIS_RA3);
put_cmd640_reg(cmd640_key, ARTTIM23, b);
put_cmd640_reg(cmd640_key, DRWTIM23, 0);
}
serialized = 1; serialized = 1;
printk("ide: buggy CMD640 interface at "); printk("ide: buggy CMD640%c interface at ",
'A' - 1 + cmd640_chip_version);
switch (bus_type) { switch (bus_type) {
case vlb : case vlb :
printk("local bus, port 0x%x", cmd640_key); printk("local bus, port 0x%x", cmd640_key);
...@@ -247,17 +340,17 @@ int ide_probe_for_cmd640x(void) ...@@ -247,17 +340,17 @@ int ide_probe_for_cmd640x(void)
/* /*
* Reset interface timings * Reset interface timings
*/ */
put_cmd640_reg(cmd640_key, CMDTIM, 0);
put_cmd640_reg(cmd640_key, 0x58, 0); printk("\n ... serialized, %s read-ahead, secondary interface %s\n",
put_cmd640_reg(cmd640_key, 0x52, 0); read_ahead ? "enabled" : "disabled",
second_port ? "enabled" : "disabled");
printk("\n ... serialized, disabled read-ahead, secondary interface enabled\n");
return 1; return 1;
} }
static int as_clocks(int a) { static int as_clocks(int a) {
switch (a & 0xf0) { switch (a & 0xc0) {
case 0 : return 4; case 0 : return 4;
case 0x40 : return 2; case 0x40 : return 2;
case 0x80 : return 3; case 0x80 : return 3;
...@@ -274,42 +367,39 @@ static void cmd640_set_timing(int if_num, int dr_num, int r1, int r2) { ...@@ -274,42 +367,39 @@ static void cmd640_set_timing(int if_num, int dr_num, int r1, int r2) {
int b_reg; int b_reg;
byte b; byte b;
int r52; int r52;
static int a = 0;
b_reg = if_num ? 0x57 : dr_num ? 0x55 : 0x53; b_reg = if_num ? ARTTIM23 : dr_num ? ARTTIM1 : ARTTIM0;
if (if_num == 0) { if (if_num == 0) {
put_cmd640_reg(cmd640_key, b_reg, r1); put_cmd640_reg(cmd640_key, b_reg, r1);
put_cmd640_reg(cmd640_key, b_reg + 1, r2); put_cmd640_reg(cmd640_key, b_reg + 1, r2);
} else { } else {
b = get_cmd640_reg(cmd640_key, b_reg); b = get_cmd640_reg(cmd640_key, b_reg);
if ((b&1) == 0) { if (a == 0 || as_clocks(b) < as_clocks(r1))
put_cmd640_reg(cmd640_key, b_reg, r1); put_cmd640_reg(cmd640_key, b_reg, (b & 0xc0) | r1);
} else {
if (as_clocks(b) < as_clocks(r1)) if (a == 0) {
put_cmd640_reg(cmd640_key, b_reg, r1);
}
b = get_cmd640_reg(cmd640_key, b_reg + 1);
if (b == 0) {
put_cmd640_reg(cmd640_key, b_reg + 1, r2); put_cmd640_reg(cmd640_key, b_reg + 1, r2);
} else { } else {
r52 = (b&0xf) < (r2&0xf) ? (r2&0xf) : (b&0xf); b = get_cmd640_reg(cmd640_key, b_reg + 1);
r52 = (b&0x0f) < (r2&0x0f) ? (r2&0x0f) : (b&0x0f);
r52 |= (b&0xf0) < (r2&0xf0) ? (r2&0xf0) : (b&0xf0); r52 |= (b&0xf0) < (r2&0xf0) ? (r2&0xf0) : (b&0xf0);
put_cmd640_reg(cmd640_key, b_reg+1, r52); put_cmd640_reg(cmd640_key, b_reg+1, r52);
} }
a = 1;
} }
b = get_cmd640_reg(cmd640_key, 0x52); b = get_cmd640_reg(cmd640_key, CMDTIM);
if (b == 0) { if (b == 0) {
put_cmd640_reg(cmd640_key, 0x52, r2); put_cmd640_reg(cmd640_key, CMDTIM, r2);
} else { } else {
r52 = (b&0xf) < (r2&0xf) ? (r2&0xf) : (b&0xf); r52 = (b&0x0f) < (r2&0x0f) ? (r2&0x0f) : (b&0x0f);
r52 |= (b&0xf0) < (r2&0xf0) ? (r2&0xf0) : (b&0xf0); r52 |= (b&0xf0) < (r2&0xf0) ? (r2&0xf0) : (b&0xf0);
put_cmd640_reg(cmd640_key, 0x52, r52); put_cmd640_reg(cmd640_key, CMDTIM, r52);
} }
} }
static int bus_speed = 33; /* MHz */
struct pio_timing { struct pio_timing {
int mc_time; /* Minimal cycle time (ns) */ int mc_time; /* Minimal cycle time (ns) */
int av_time; /* Address valid to DIOR-/DIOW- setup (ns) */ int av_time; /* Address valid to DIOR-/DIOW- setup (ns) */
...@@ -385,10 +475,10 @@ static void set_pio_mode(int if_num, int drv_num, int mode_num) { ...@@ -385,10 +475,10 @@ static void set_pio_mode(int if_num, int drv_num, int mode_num) {
int i; int i;
p_base = if_num ? 0x170 : 0x1f0; p_base = if_num ? 0x170 : 0x1f0;
outb(3, p_base + 1); outb_p(3, p_base + 1);
outb(mode_num | 8, p_base + 2); outb_p(mode_num | 8, p_base + 2);
outb((drv_num | 0xa) << 4, p_base + 6); outb_p((drv_num | 0xa) << 4, p_base + 6);
outb(0xef, p_base + 7); outb_p(0xef, p_base + 7);
for (i = 0; (i < 100) && (inb (p_base + 7) & 0x80); i++) for (i = 0; (i < 100) && (inb (p_base + 7) & 0x80); i++)
delay_10ms(); delay_10ms();
} }
...@@ -442,3 +532,4 @@ void cmd640_tune_drive(ide_drive_t* drive) { ...@@ -442,3 +532,4 @@ void cmd640_tune_drive(ide_drive_t* drive) {
cmd640_set_timing(interface_number, drive_number, r1, r2); cmd640_set_timing(interface_number, drive_number, r1, r2);
printk ("Mode and Timing set to PIO%d (0x%x 0x%x)\n", max_pio, r1, r2); printk ("Mode and Timing set to PIO%d (0x%x 0x%x)\n", max_pio, r1, r2);
} }
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
* 3.03 Oct 27, 1995 -- Some Creative drives have an id of just `CD'. * 3.03 Oct 27, 1995 -- Some Creative drives have an id of just `CD'.
* `DCI-2S10' drives are broken too. * `DCI-2S10' drives are broken too.
* 3.04 Nov 20, 1995 -- So are Vertros drives. * 3.04 Nov 20, 1995 -- So are Vertros drives.
* 3.05 Dec 1, 1995 -- Changes to go with overhaul of ide.c and ide-tape.c
* *
* NOTE: Direct audio reads will only work on some types of drive. * NOTE: Direct audio reads will only work on some types of drive.
* So far, i've received reports of success for Sony and Toshiba drives. * So far, i've received reports of success for Sony and Toshiba drives.
...@@ -202,7 +203,7 @@ void cdrom_in_bytes (ide_drive_t *drive, void *buffer, uint bytecount) ...@@ -202,7 +203,7 @@ void cdrom_in_bytes (ide_drive_t *drive, void *buffer, uint bytecount)
ide_input_data (drive, buffer, bytecount / 4); ide_input_data (drive, buffer, bytecount / 4);
if ((bytecount & 0x03) >= 2) if ((bytecount & 0x03) >= 2)
{ {
insw (IDE_DATA_REG, buffer + (bytecount & ~0x03), 1); insw (IDE_DATA_REG, ((byte *)buffer) + (bytecount & ~0x03), 1);
} }
} }
...@@ -214,7 +215,7 @@ void cdrom_out_bytes (ide_drive_t *drive, void *buffer, uint bytecount) ...@@ -214,7 +215,7 @@ void cdrom_out_bytes (ide_drive_t *drive, void *buffer, uint bytecount)
ide_output_data (drive, buffer, bytecount / 4); ide_output_data (drive, buffer, bytecount / 4);
if ((bytecount & 0x03) >= 2) if ((bytecount & 0x03) >= 2)
{ {
outsw (IDE_DATA_REG, buffer + (bytecount & ~0x03), 1); outsw (IDE_DATA_REG, ((byte *)buffer) + (bytecount & ~0x03), 1);
} }
} }
...@@ -501,27 +502,8 @@ static void cdrom_queue_request_sense (ide_drive_t *drive, ...@@ -501,27 +502,8 @@ static void cdrom_queue_request_sense (ide_drive_t *drive,
{ {
struct request *rq; struct request *rq;
struct packet_command *pc; struct packet_command *pc;
unsigned long flags;
int len; int len;
int major = HWIF(drive)->major;
save_flags (flags);
cli (); /* safety */
rq = HWGROUP(drive)->rq;
/* If we're processing a request, put it back on the request queue. */
if (rq != NULL)
{
restore_request (rq);
rq->next = blk_dev[major].current_request;
blk_dev[major].current_request = rq;
HWGROUP(drive)->rq = NULL;
}
restore_flags (flags);
/* If the request didn't explicitly specify where to put the sense data, /* If the request didn't explicitly specify where to put the sense data,
use the statically allocated structure. */ use the statically allocated structure. */
if (reqbuf == NULL) if (reqbuf == NULL)
...@@ -544,29 +526,15 @@ static void cdrom_queue_request_sense (ide_drive_t *drive, ...@@ -544,29 +526,15 @@ static void cdrom_queue_request_sense (ide_drive_t *drive,
pc->buffer = (char *)reqbuf; pc->buffer = (char *)reqbuf;
pc->buflen = len; pc->buflen = len;
pc->sense_data = (struct atapi_request_sense *)failed_command; pc->sense_data = (struct atapi_request_sense *)failed_command;
/* stuff the sense request in front of our current request */
rq = &HWIF(drive)->request_sense_request; rq = &HWIF(drive)->request_sense_request;
rq->rq_status = RQ_ACTIVE; ide_init_drive_cmd (rq);
rq->rq_dev = MKDEV (major, (drive->select.b.unit) << PARTN_BITS);
rq->cmd = REQUEST_SENSE_COMMAND; rq->cmd = REQUEST_SENSE_COMMAND;
rq->errors = 0;
rq->sector = 0;
rq->nr_sectors = 0;
rq->current_nr_sectors = 0;
rq->buffer = (char *)pc; rq->buffer = (char *)pc;
rq->sem = sem; rq->sem = sem;
rq->bh = NULL; (void) ide_do_drive_cmd (drive, rq, ide_preempt);
rq->bhtail = NULL;
rq->next = NULL;
save_flags (flags);
cli (); /* safety */
/* Stick it onto the front of the queue. */
rq->next = blk_dev[major].current_request;
blk_dev[major].current_request = rq;
restore_flags (flags);
} }
...@@ -638,8 +606,8 @@ static int cdrom_decode_status (ide_drive_t *drive, int good_stat, int *stat_ret ...@@ -638,8 +606,8 @@ static int cdrom_decode_status (ide_drive_t *drive, int good_stat, int *stat_ret
struct packet_command *pc = (struct packet_command *)rq->buffer; struct packet_command *pc = (struct packet_command *)rq->buffer;
pc->stat = 1; pc->stat = 1;
cdrom_end_request (1, drive); cdrom_end_request (1, drive);
if (ide_error (drive, "request sense failure", stat)) ide_error (drive, "request sense failure", stat);
return 1; return 1;
} }
else if (cmd == PACKET_COMMAND) else if (cmd == PACKET_COMMAND)
...@@ -734,8 +702,8 @@ static int cdrom_decode_status (ide_drive_t *drive, int good_stat, int *stat_ret ...@@ -734,8 +702,8 @@ static int cdrom_decode_status (ide_drive_t *drive, int good_stat, int *stat_ret
/* If there were other errors, go to the default handler. */ /* If there were other errors, go to the default handler. */
else if ((err & ~ABRT_ERR) != 0) else if ((err & ~ABRT_ERR) != 0)
{ {
if (ide_error (drive, "cdrom_decode_status", stat)) ide_error (drive, "cdrom_decode_status", stat);
return 1; return 1;
} }
/* Else, abort if we've racked up too many retries. */ /* Else, abort if we've racked up too many retries. */
...@@ -752,7 +720,6 @@ static int cdrom_decode_status (ide_drive_t *drive, int good_stat, int *stat_ret ...@@ -752,7 +720,6 @@ static int cdrom_decode_status (ide_drive_t *drive, int good_stat, int *stat_ret
} }
/* Retry, or handle the next request. */ /* Retry, or handle the next request. */
IDE_DO_REQUEST;
return 1; return 1;
} }
...@@ -781,7 +748,7 @@ static int cdrom_start_packet_command (ide_drive_t *drive, int xferlen, ...@@ -781,7 +748,7 @@ static int cdrom_start_packet_command (ide_drive_t *drive, int xferlen,
if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt)
{ {
ide_set_handler (drive, handler); ide_set_handler (drive, handler, WAIT_CMD);
OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); /* packet command */ OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); /* packet command */
} }
else else
...@@ -819,7 +786,7 @@ static int cdrom_transfer_packet_command (ide_drive_t *drive, ...@@ -819,7 +786,7 @@ static int cdrom_transfer_packet_command (ide_drive_t *drive,
} }
/* Arm the interrupt handler. */ /* Arm the interrupt handler. */
ide_set_handler (drive, handler); ide_set_handler (drive, handler, WAIT_CMD);
/* Send the command to the device. */ /* Send the command to the device. */
cdrom_out_bytes (drive, cmd_buf, cmd_len); cdrom_out_bytes (drive, cmd_buf, cmd_len);
...@@ -925,7 +892,6 @@ int cdrom_read_check_ireason (ide_drive_t *drive, int len, int ireason) ...@@ -925,7 +892,6 @@ int cdrom_read_check_ireason (ide_drive_t *drive, int len, int ireason)
} }
cdrom_end_request (0, drive); cdrom_end_request (0, drive);
IDE_DO_REQUEST;
return -1; return -1;
} }
...@@ -961,7 +927,6 @@ static void cdrom_read_intr (ide_drive_t *drive) ...@@ -961,7 +927,6 @@ static void cdrom_read_intr (ide_drive_t *drive)
else else
cdrom_end_request (1, drive); cdrom_end_request (1, drive);
IDE_DO_REQUEST;
return; return;
} }
...@@ -976,7 +941,6 @@ static void cdrom_read_intr (ide_drive_t *drive) ...@@ -976,7 +941,6 @@ static void cdrom_read_intr (ide_drive_t *drive)
drive->name, len); drive->name, len);
printk (" This drive is not supported by this version of the driver\n"); printk (" This drive is not supported by this version of the driver\n");
cdrom_end_request (0, drive); cdrom_end_request (0, drive);
IDE_DO_REQUEST;
return; return;
} }
...@@ -1040,7 +1004,7 @@ static void cdrom_read_intr (ide_drive_t *drive) ...@@ -1040,7 +1004,7 @@ static void cdrom_read_intr (ide_drive_t *drive)
/* Done moving data! /* Done moving data!
Wait for another interrupt. */ Wait for another interrupt. */
ide_set_handler (drive, &cdrom_read_intr); ide_set_handler (drive, &cdrom_read_intr, WAIT_CMD);
} }
...@@ -1138,7 +1102,6 @@ static void cdrom_start_read_continuation (ide_drive_t *drive) ...@@ -1138,7 +1102,6 @@ static void cdrom_start_read_continuation (ide_drive_t *drive)
printk ("%s: cdrom_start_read_continuation: buffer botch (%ld)\n", printk ("%s: cdrom_start_read_continuation: buffer botch (%ld)\n",
drive->name, rq->current_nr_sectors); drive->name, rq->current_nr_sectors);
cdrom_end_request (0, drive); cdrom_end_request (0, drive);
IDE_DO_REQUEST;
return; return;
} }
...@@ -1252,7 +1215,6 @@ static void cdrom_pc_intr (ide_drive_t *drive) ...@@ -1252,7 +1215,6 @@ static void cdrom_pc_intr (ide_drive_t *drive)
pc->stat = 1; pc->stat = 1;
cdrom_end_request (1, drive); cdrom_end_request (1, drive);
} }
IDE_DO_REQUEST;
return; return;
} }
...@@ -1327,7 +1289,7 @@ static void cdrom_pc_intr (ide_drive_t *drive) ...@@ -1327,7 +1289,7 @@ static void cdrom_pc_intr (ide_drive_t *drive)
} }
/* Now we wait for another interrupt. */ /* Now we wait for another interrupt. */
ide_set_handler (drive, &cdrom_pc_intr); ide_set_handler (drive, &cdrom_pc_intr, WAIT_CMD);
} }
...@@ -1367,40 +1329,6 @@ void cdrom_sleep (int time) ...@@ -1367,40 +1329,6 @@ void cdrom_sleep (int time)
schedule (); schedule ();
} }
static
void cdrom_queue_request (ide_drive_t *drive, struct request *req)
{
unsigned long flags;
struct request **p, **pfirst;
int major = HWIF(drive)->major;
struct semaphore sem = MUTEX_LOCKED;
req->rq_dev = MKDEV (major, (drive->select.b.unit) << PARTN_BITS);
req->rq_status = RQ_ACTIVE;
req->sem = &sem;
req->errors = 0;
req->next = NULL;
save_flags (flags);
cli ();
p = &blk_dev[major].current_request;
pfirst = p;
while ((*p) != NULL)
{
p = &((*p)->next);
}
*p = req;
if (p == pfirst)
blk_dev[major].request_fn ();
down (&sem);
restore_flags (flags);
}
static static
int cdrom_queue_packet_command (ide_drive_t *drive, struct packet_command *pc) int cdrom_queue_packet_command (ide_drive_t *drive, struct packet_command *pc)
{ {
...@@ -1416,15 +1344,10 @@ int cdrom_queue_packet_command (ide_drive_t *drive, struct packet_command *pc) ...@@ -1416,15 +1344,10 @@ int cdrom_queue_packet_command (ide_drive_t *drive, struct packet_command *pc)
/* Start of retry loop. */ /* Start of retry loop. */
do { do {
ide_init_drive_cmd (&req);
req.cmd = PACKET_COMMAND; req.cmd = PACKET_COMMAND;
req.sector = 0;
req.nr_sectors = 0;
req.current_nr_sectors = 0;
req.buffer = (char *)pc; req.buffer = (char *)pc;
req.bh = NULL; (void) ide_do_drive_cmd (drive, &req, ide_wait);
req.bhtail = NULL;
cdrom_queue_request (drive, &req);
if (pc->stat != 0) if (pc->stat != 0)
{ {
...@@ -1491,8 +1414,8 @@ void ide_do_rw_cdrom (ide_drive_t *drive, unsigned long block) ...@@ -1491,8 +1414,8 @@ void ide_do_rw_cdrom (ide_drive_t *drive, unsigned long block)
else if (rq -> cmd == RESET_DRIVE_COMMAND) else if (rq -> cmd == RESET_DRIVE_COMMAND)
{ {
cdrom_end_request (1, drive); cdrom_end_request (1, drive);
if (ide_do_reset (drive)) ide_do_reset (drive);
return; return;
} }
else if (rq -> cmd != READ) else if (rq -> cmd != READ)
...@@ -2434,10 +2357,9 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode, ...@@ -2434,10 +2357,9 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode,
case CDROMRESET: case CDROMRESET:
{ {
struct request req; struct request req;
memset (&req, 0, sizeof (req)); ide_init_drive_cmd (&req);
req.cmd = RESET_DRIVE_COMMAND; req.cmd = RESET_DRIVE_COMMAND;
cdrom_queue_request (drive, &req); return ide_do_drive_cmd (drive, &req, ide_wait);
return 0;
} }
#endif #endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -152,6 +152,10 @@ typedef unsigned char byte; /* used everywhere */ ...@@ -152,6 +152,10 @@ typedef unsigned char byte; /* used everywhere */
#define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */ #define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */
#define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */ #define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */
#ifdef CONFIG_BLK_DEV_IDETAPE
#include "ide-tape.h"
#endif /* CONFIG_BLK_DEV_IDETAPE */
#ifdef CONFIG_BLK_DEV_IDECD #ifdef CONFIG_BLK_DEV_IDECD
struct atapi_request_sense { struct atapi_request_sense {
...@@ -234,7 +238,8 @@ struct cdrom_info { ...@@ -234,7 +238,8 @@ struct cdrom_info {
/* /*
* Now for the data we need to maintain per-drive: ide_drive_t * Now for the data we need to maintain per-drive: ide_drive_t
*/ */
typedef enum {disk, cdrom} media_t;
typedef enum {ide_disk, ide_cdrom, ide_tape} ide_media_t;
typedef union { typedef union {
unsigned all : 8; /* all of the bits together */ unsigned all : 8; /* all of the bits together */
...@@ -271,7 +276,7 @@ typedef struct ide_drive_s { ...@@ -271,7 +276,7 @@ typedef struct ide_drive_s {
unsigned removeable : 1; /* 1 if need to do check_media_change */ unsigned removeable : 1; /* 1 if need to do check_media_change */
unsigned using_dma : 1; /* disk is using dma for read/write */ unsigned using_dma : 1; /* disk is using dma for read/write */
unsigned unmask : 1; /* flag: okay to unmask other irqs */ unsigned unmask : 1; /* flag: okay to unmask other irqs */
media_t media; /* disk, cdrom, tape */ ide_media_t media; /* disk, cdrom, tape */
select_t select; /* basic drive/head select reg value */ select_t select; /* basic drive/head select reg value */
void *hwif; /* actually (ide_hwif_t *) */ void *hwif; /* actually (ide_hwif_t *) */
byte ctl; /* "normal" value for IDE_CONTROL_REG */ byte ctl; /* "normal" value for IDE_CONTROL_REG */
...@@ -295,6 +300,22 @@ typedef struct ide_drive_s { ...@@ -295,6 +300,22 @@ typedef struct ide_drive_s {
#ifdef CONFIG_BLK_DEV_IDECD #ifdef CONFIG_BLK_DEV_IDECD
struct cdrom_info cdrom_info; /* from ide-cd.c */ struct cdrom_info cdrom_info; /* from ide-cd.c */
#endif /* CONFIG_BLK_DEV_IDECD */ #endif /* CONFIG_BLK_DEV_IDECD */
#ifdef CONFIG_BLK_DEV_IDETAPE /* ide-tape specific data */
/*
* Most of our global data which we need to save even as we leave the
* driver due to an interrupt or a timer event is stored here.
*
* Additional global variables which provide the link between the
* character device interface to this structure are defined in
* ide-tape.c
*/
idetape_tape_t tape;
#endif /* CONFIG_BLK_DEV_IDETAPE */
} ide_drive_t; } ide_drive_t;
/* /*
...@@ -348,10 +369,7 @@ typedef struct hwgroup_s { ...@@ -348,10 +369,7 @@ typedef struct hwgroup_s {
struct request *rq; /* current request */ struct request *rq; /* current request */
struct timer_list timer; /* failsafe timer */ struct timer_list timer; /* failsafe timer */
struct request wrq; /* local copy of current write rq */ struct request wrq; /* local copy of current write rq */
unsigned long reset_timeout; /* timeout value during ide resets */ unsigned long poll_timeout; /* timeout value during long polls */
#ifdef CONFIG_BLK_DEV_IDECD
int doing_atapi_reset;
#endif /* CONFIG_BLK_DEV_IDECD */
} ide_hwgroup_t; } ide_hwgroup_t;
/* /*
...@@ -367,16 +385,6 @@ void ide_set_recovery_timer (ide_hwif_t *); ...@@ -367,16 +385,6 @@ void ide_set_recovery_timer (ide_hwif_t *);
#define SET_RECOVERY_TIMER(drive) #define SET_RECOVERY_TIMER(drive)
#endif #endif
/*
* The main (re-)entry point for handling a new request is IDE_DO_REQUEST.
* Note that IDE_DO_REQUEST should *only* ever be invoked from an interrupt
* handler. All others, such as a timer expiry handler, should call
* do_hwgroup_request() instead (currently local to ide.c).
*/
void ide_do_request (ide_hwgroup_t *);
#define IDE_DO_REQUEST { SET_RECOVERY_TIMER(HWIF(drive)); ide_do_request(HWGROUP(drive)); }
/* /*
* This is used for (nearly) all data transfers from the IDE interface * This is used for (nearly) all data transfers from the IDE interface
*/ */
...@@ -391,7 +399,7 @@ void ide_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount); ...@@ -391,7 +399,7 @@ void ide_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount);
* This is used on exit from the driver, to designate the next irq handler * This is used on exit from the driver, to designate the next irq handler
* and also to start the safety timer. * and also to start the safety timer.
*/ */
void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler); void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigned int timeout);
/* /*
* Error reporting, in human readable form (luxurious, but a memory hog). * Error reporting, in human readable form (luxurious, but a memory hog).
...@@ -400,18 +408,15 @@ byte ide_dump_status (ide_drive_t *drive, const char *msg, byte stat); ...@@ -400,18 +408,15 @@ byte ide_dump_status (ide_drive_t *drive, const char *msg, byte stat);
/* /*
* ide_error() takes action based on the error returned by the controller. * ide_error() takes action based on the error returned by the controller.
* * The calling function must return afterwards, to restart the request.
* Returns 1 if an ide reset operation has been initiated, in which case
* the caller MUST simply return from the driver (through however many levels).
* Returns 0 otherwise.
*/ */
int ide_error (ide_drive_t *drive, const char *msg, byte stat); void ide_error (ide_drive_t *drive, const char *msg, byte stat);
/* /*
* This routine busy-waits for the drive status to be not "busy". * This routine busy-waits for the drive status to be not "busy".
* It then checks the status for all of the "good" bits and none * It then checks the status for all of the "good" bits and none
* of the "bad" bits, and if all is okay it returns 0. All other * of the "bad" bits, and if all is okay it returns 0. All other
* cases return 1 after invoking ide_error() * cases return 1 after invoking ide_error() -- caller should return.
* *
*/ */
int ide_wait_stat (ide_drive_t *drive, byte good, byte bad, unsigned long timeout); int ide_wait_stat (ide_drive_t *drive, byte good, byte bad, unsigned long timeout);
...@@ -423,31 +428,51 @@ int ide_xlate_1024(kdev_t, int, const char *); ...@@ -423,31 +428,51 @@ int ide_xlate_1024(kdev_t, int, const char *);
/* /*
* Start a reset operation for an IDE interface. * Start a reset operation for an IDE interface.
* Returns 0 if the reset operation is still in progress, * The caller should return immediately after invoking this.
* in which case the drive MUST return, to await completion.
* Returns 1 if the reset is complete (success or failure).
*/ */
int ide_do_reset (ide_drive_t *); void ide_do_reset (ide_drive_t *);
/* /*
* ide_alloc(): memory allocation for use *only* during driver initialization. * This function is intended to be used prior to invoking ide_do_drive_cmd().
* If "within_area" is non-zero, the memory will be allocated such that
* it lies entirely within a "within_area" sized area (eg. 4096). This is
* needed for DMA stuff. "within_area" must be a power of two (not validated).
* All allocations are longword aligned.
*/ */
void *ide_alloc (unsigned long bytecount, unsigned long within_area); void ide_init_drive_cmd (struct request *rq);
/* /*
* This function issues a specific IDE drive command onto the * "action" parameter type for ide_do_drive_cmd() below.
* tail of the request queue, and waits for it to be completed.
* If arg is NULL, it goes through all the motions,
* but without actually sending a command to the drive.
*
* The value of arg is passed to the internal handler as rq->buffer.
*/ */
int ide_do_drive_cmd(kdev_t rdev, char *args); typedef enum
{ide_wait, /* insert rq at end of list, and wait for it */
ide_next, /* insert rq immediately after current request */
ide_preempt} /* insert rq in front of current request */
ide_action_t;
/*
* This function issues a special IDE device request
* onto the request queue.
*
* If action is ide_wait, then then rq is queued at the end of
* the request queue, and the function sleeps until it has been
* processed. This is for use when invoked from an ioctl handler.
*
* If action is ide_preempt, then the rq is queued at the head of
* the request queue, displacing the currently-being-processed
* request and this function returns immediately without waiting
* for the new rq to be completed. This is VERY DANGEROUS, and is
* intended for careful use by the ATAPI tape/cdrom driver code.
*
* If action is ide_next, then the rq is queued immediately after
* the currently-being-processed-request (if any), and the function
* returns without waiting for the new rq to be completed. As above,
* This is VERY DANGEROUS, and is intended for careful use by the
* ATAPI tape/cdrom driver code.
*/
int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t action);
/*
* Clean up after success/failure of an explicit drive cmd.
* stat/err are used only when (HWGROUP(drive)->rq->cmd == IDE_DRIVE_CMD).
*/
void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err);
#ifdef CONFIG_BLK_DEV_IDECD #ifdef CONFIG_BLK_DEV_IDECD
/* /*
...@@ -461,6 +486,57 @@ void ide_cdrom_release (struct inode *, struct file *, ide_drive_t *); ...@@ -461,6 +486,57 @@ void ide_cdrom_release (struct inode *, struct file *, ide_drive_t *);
void ide_cdrom_setup (ide_drive_t *); void ide_cdrom_setup (ide_drive_t *);
#endif /* CONFIG_BLK_DEV_IDECD */ #endif /* CONFIG_BLK_DEV_IDECD */
#ifdef CONFIG_BLK_DEV_IDETAPE
/*
* Functions in ide-tape.c which are invoked from ide.c:
*/
/*
* idetape_identify_device is called during device probing stage to
* probe for an ide atapi tape drive and to initialize global variables
* in ide-tape.c which provide the link between the character device
* and the correspoding block device.
*
* Returns 1 if an ide tape was detected and is supported.
* Returns 0 otherwise.
*/
int idetape_identify_device (ide_drive_t *drive,struct hd_driveid *id);
/*
* idetape_setup is called a bit later than idetape_identify_device,
* during the search for disk partitions, to initialize various tape
* state variables in ide_drive_t *drive.
*/
void idetape_setup (ide_drive_t *drive);
/*
* idetape_do_request is our request function. It is called by ide.c
* to process a new request.
*/
void idetape_do_request (ide_drive_t *drive, struct request *rq, unsigned long block);
/*
* Block device interface functions.
*/
int idetape_blkdev_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
int idetape_blkdev_open (struct inode *inode, struct file *filp, ide_drive_t *drive);
void idetape_blkdev_release (struct inode *inode, struct file *filp, ide_drive_t *drive);
/*
* idetape_register_chrdev initializes the character device interface to
* the ide tape drive.
*/
void idetape_register_chrdev (void);
#endif /* CONFIG_BLK_DEV_IDETAPE */
#ifdef CONFIG_BLK_DEV_TRITON #ifdef CONFIG_BLK_DEV_TRITON
void ide_init_triton (byte, byte); void ide_init_triton (byte, byte);
#endif /* CONFIG_BLK_DEV_TRITON */ #endif /* CONFIG_BLK_DEV_TRITON */
......
...@@ -232,20 +232,24 @@ void set_device_ro(kdev_t dev,int flag) ...@@ -232,20 +232,24 @@ void set_device_ro(kdev_t dev,int flag)
static inline void drive_stat_acct(int cmd, unsigned long nr_sectors, short disk_index) static inline void drive_stat_acct(int cmd, unsigned long nr_sectors, short disk_index)
{ {
kstat.dk_drive[disk_index]++; kstat.dk_drive[disk_index]++;
if (cmd == READ || cmd == READA) { if (cmd == READ) {
kstat.dk_drive_rio[disk_index]++; kstat.dk_drive_rio[disk_index]++;
kstat.dk_drive_rblk[disk_index] += nr_sectors; kstat.dk_drive_rblk[disk_index] += nr_sectors;
} }
else if (cmd == WRITE || cmd == WRITEA) { else if (cmd == WRITE) {
kstat.dk_drive_wio[disk_index]++; kstat.dk_drive_wio[disk_index]++;
kstat.dk_drive_wblk[disk_index] += nr_sectors; kstat.dk_drive_wblk[disk_index] += nr_sectors;
} } else
printk("drive_stat_acct: cmd not R/W?\n");
} }
/* /*
* add-request adds a request to the linked list. * add-request adds a request to the linked list.
* It disables interrupts so that it can muck with the * It disables interrupts so that it can muck with the
* request-lists in peace. * request-lists in peace.
*
* By this point, req->cmd is always either READ/WRITE, never READA/WRITEA,
* which is important for drive_stat_acct() above.
*/ */
static void add_request(struct blk_dev_struct * dev, struct request * req) static void add_request(struct blk_dev_struct * dev, struct request * req)
{ {
...@@ -302,21 +306,6 @@ static void make_request(int major,int rw, struct buffer_head * bh) ...@@ -302,21 +306,6 @@ static void make_request(int major,int rw, struct buffer_head * bh)
struct request * req; struct request * req;
int rw_ahead, max_req; int rw_ahead, max_req;
/* WRITEA/READA is special case - it is not really needed, so if the */
/* buffer is locked, we just forget about it, else it's a normal read */
rw_ahead = (rw == READA || rw == WRITEA);
if (rw_ahead) {
if (buffer_locked(bh))
return;
if (rw == READA)
rw = READ;
else
rw = WRITE;
}
if (rw!=READ && rw!=WRITE) {
printk("Bad block dev command, must be R/W/RA/WA\n");
return;
}
count = bh->b_size >> 9; count = bh->b_size >> 9;
sector = bh->b_blocknr * count; sector = bh->b_blocknr * count;
if (blk_size[major]) if (blk_size[major])
...@@ -330,21 +319,46 @@ static void make_request(int major,int rw, struct buffer_head * bh) ...@@ -330,21 +319,46 @@ static void make_request(int major,int rw, struct buffer_head * bh)
return; return;
/* Maybe the above fixes it, and maybe it doesn't boot. Life is interesting */ /* Maybe the above fixes it, and maybe it doesn't boot. Life is interesting */
lock_buffer(bh); lock_buffer(bh);
if ((rw == WRITE && !buffer_dirty(bh)) || (rw == READ && buffer_uptodate(bh))) {
unlock_buffer(bh);
return;
}
/* we don't allow the write-requests to fill up the queue completely: rw_ahead = 0; /* normal case; gets changed below for READA/WRITEA */
* we want some room for reads: they take precedence. The last third switch (rw) {
* of the requests are only for reads. case READA:
*/ rw_ahead = 1;
max_req = (rw == READ) ? NR_REQUEST : ((NR_REQUEST*2)/3); rw = READ; /* drop into READ */
case READ:
if (buffer_uptodate(bh)) {
unlock_buffer(bh); /* Hmmph! Already have it */
return;
}
kstat.pgpgin++;
max_req = NR_REQUEST; /* reads take precedence */
break;
case WRITEA:
rw_ahead = 1;
rw = WRITE; /* drop into WRITE */
case WRITE:
if (!buffer_dirty(bh)) {
unlock_buffer(bh); /* Hmmph! Nothing to write */
return;
}
/* We don't allow the write-requests to fill up the
* queue completely: we want some room for reads,
* as they take precedence. The last third of the
* requests are only for reads.
*/
kstat.pgpgout++;
max_req = (NR_REQUEST * 2) / 3;
break;
default:
printk("make_request: bad block dev cmd, must be R/W/RA/WA\n");
unlock_buffer(bh);
return;
}
/* look for a free request. */ /* look for a free request. */
cli(); cli();
/* The scsi disk drivers and the IDE driver completely remove the request /* The scsi disk and cdrom drivers completely remove the request
* from the queue when they start processing an entry. For this reason * from the queue when they start processing an entry. For this reason
* it is safe to continue to add links to the top entry for those devices. * it is safe to continue to add links to the top entry for those devices.
*/ */
...@@ -357,11 +371,7 @@ static void make_request(int major,int rw, struct buffer_head * bh) ...@@ -357,11 +371,7 @@ static void make_request(int major,int rw, struct buffer_head * bh)
|| major == IDE3_MAJOR) || major == IDE3_MAJOR)
&& (req = blk_dev[major].current_request)) && (req = blk_dev[major].current_request))
{ {
#ifdef CONFIG_BLK_DEV_HD if (major != SCSI_DISK_MAJOR && major != SCSI_CDROM_MAJOR)
if (major == HD_MAJOR || major == FLOPPY_MAJOR)
#else
if (major == FLOPPY_MAJOR)
#endif CONFIG_BLK_DEV_HD
req = req->next; req = req->next;
while (req) { while (req) {
if (req->rq_dev == bh->b_dev && if (req->rq_dev == bh->b_dev &&
...@@ -438,12 +448,18 @@ void ll_rw_page(int rw, kdev_t dev, unsigned long page, char * buffer) ...@@ -438,12 +448,18 @@ void ll_rw_page(int rw, kdev_t dev, unsigned long page, char * buffer)
kdevname(dev), sector); kdevname(dev), sector);
return; return;
} }
if (rw!=READ && rw!=WRITE) switch (rw) {
panic("Bad block dev command, must be R/W"); case READ:
if (rw == WRITE && is_read_only(dev)) { break;
printk("Can't page to read-only device %s\n", case WRITE:
kdevname(dev)); if (is_read_only(dev)) {
return; printk("Can't page to read-only device %s\n",
kdevname(dev));
return;
}
break;
default:
panic("ll_rw_page: bad block dev cmd, must be R/W");
} }
req = get_request_wait(NR_REQUEST, dev); req = get_request_wait(NR_REQUEST, dev);
/* fill up the request-info, and add it to the queue */ /* fill up the request-info, and add it to the queue */
...@@ -524,10 +540,6 @@ void ll_rw_block(int rw, int nr, struct buffer_head * bh[]) ...@@ -524,10 +540,6 @@ void ll_rw_block(int rw, int nr, struct buffer_head * bh[])
if (bh[i]) { if (bh[i]) {
set_bit(BH_Req, &bh[i]->b_state); set_bit(BH_Req, &bh[i]->b_state);
make_request(major, rw, bh[i]); make_request(major, rw, bh[i]);
if (rw == READ || rw == READA)
kstat.pgpgin++;
else
kstat.pgpgout++;
} }
} }
unplug_device(dev); unplug_device(dev);
...@@ -555,17 +567,19 @@ void ll_rw_swap_file(int rw, kdev_t dev, unsigned int *b, int nb, char *buf) ...@@ -555,17 +567,19 @@ void ll_rw_swap_file(int rw, kdev_t dev, unsigned int *b, int nb, char *buf)
printk("ll_rw_swap_file: trying to swap nonexistent block-device\n"); printk("ll_rw_swap_file: trying to swap nonexistent block-device\n");
return; return;
} }
switch (rw) {
if (rw != READ && rw != WRITE) { case READ:
printk("ll_rw_swap: bad block dev command, must be R/W"); break;
return; case WRITE:
} if (is_read_only(dev)) {
if (rw == WRITE && is_read_only(dev)) { printk("Can't swap to read-only device %s\n",
printk("Can't swap to read-only device %s\n", kdevname(dev));
kdevname(dev)); return;
return; }
break;
default:
panic("ll_rw_swap: bad block dev cmd, must be R/W");
} }
buffersize = PAGE_SIZE / nb; buffersize = PAGE_SIZE / nb;
for (j=0, i=0; i<nb;) for (j=0, i=0; i<nb;)
......
/* /*
* linux/drivers/block/triton.c Version 1.03 Nov 16, 1995 * linux/drivers/block/triton.c Version 1.04 Dec 1, 1995
* *
* Copyright (c) 1995 Mark Lord * Copyright (c) 1995 Mark Lord
* May be copied or modified under the terms of the GNU General Public License * May be copied or modified under the terms of the GNU General Public License
...@@ -73,6 +73,13 @@ ...@@ -73,6 +73,13 @@
* *
* If you have any drive models to add, email your results to: mlord@bnr.ca * If you have any drive models to add, email your results to: mlord@bnr.ca
* Keep an eye on /var/adm/messages for "DMA disabled" messages. * Keep an eye on /var/adm/messages for "DMA disabled" messages.
*
* Some people have reported trouble with Intel Zappa motherboards.
* This can be fixed by upgrading the AMI BIOS to version 1.00.04.BS0,
* available from ftp://ftp.intel.com/pub/bios/10004bs0.exe
* (thanks to Glen Morrell <glen@spin.Stanford.edu> for researching this).
*
* And, yes, Intel Zappa boards really *do* use the Triton IDE ports.
*/ */
#define _TRITON_C #define _TRITON_C
#include <linux/config.h> #include <linux/config.h>
...@@ -141,14 +148,12 @@ static void dma_intr (ide_drive_t *drive) ...@@ -141,14 +148,12 @@ static void dma_intr (ide_drive_t *drive)
i -= rq->current_nr_sectors; i -= rq->current_nr_sectors;
ide_end_request(1, HWGROUP(drive)); ide_end_request(1, HWGROUP(drive));
} }
IDE_DO_REQUEST;
return; return;
} }
printk("%s: bad DMA status: 0x%02x\n", drive->name, dma_stat); printk("%s: bad DMA status: 0x%02x\n", drive->name, dma_stat);
} }
sti(); sti();
if (!ide_error(drive, "dma_intr", stat)) ide_error(drive, "dma_intr", stat);
IDE_DO_REQUEST;
} }
/* /*
...@@ -269,7 +274,7 @@ static int triton_dmaproc (ide_dma_action_t func, ide_drive_t *drive) ...@@ -269,7 +274,7 @@ static int triton_dmaproc (ide_dma_action_t func, ide_drive_t *drive)
outl(virt_to_bus (HWIF(drive)->dmatable), dma_base + 4); /* PRD table */ outl(virt_to_bus (HWIF(drive)->dmatable), dma_base + 4); /* PRD table */
outb(reading, dma_base); /* specify r/w */ outb(reading, dma_base); /* specify r/w */
outb(0x26, dma_base+2); /* clear status bits */ outb(0x26, dma_base+2); /* clear status bits */
ide_set_handler (drive, &dma_intr); /* issue cmd to drive */ ide_set_handler (drive, &dma_intr, WAIT_CMD); /* issue cmd to drive */
OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG); OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG);
outb(inb(dma_base)|1, dma_base); /* begin DMA */ outb(inb(dma_base)|1, dma_base); /* begin DMA */
return 0; return 0;
...@@ -307,7 +312,7 @@ void ide_init_triton (byte bus, byte fn) ...@@ -307,7 +312,7 @@ void ide_init_triton (byte bus, byte fn)
int rc = 0, h; int rc = 0, h;
unsigned short bmiba, pcicmd; unsigned short bmiba, pcicmd;
unsigned int timings; unsigned int timings;
unsigned char *dmatable = NULL; unsigned long dmatable = 0;
extern ide_hwif_t ide_hwifs[]; extern ide_hwif_t ide_hwifs[];
/* /*
...@@ -331,7 +336,7 @@ void ide_init_triton (byte bus, byte fn) ...@@ -331,7 +336,7 @@ void ide_init_triton (byte bus, byte fn)
if ((rc = pcibios_read_config_dword(bus, fn, 0x40, &timings))) if ((rc = pcibios_read_config_dword(bus, fn, 0x40, &timings)))
goto quit; goto quit;
if (!(timings & 0x80008000)) { if (!(timings & 0x80008000)) {
printk("ide: Triton IDE ports are not enabled\n"); printk("ide: neither Triton IDE port is enabled\n");
goto quit; goto quit;
} }
printk("ide: Triton BM-IDE on PCI bus %d function %d\n", bus, fn); printk("ide: Triton BM-IDE on PCI bus %d function %d\n", bus, fn);
...@@ -363,15 +368,15 @@ void ide_init_triton (byte bus, byte fn) ...@@ -363,15 +368,15 @@ void ide_init_triton (byte bus, byte fn)
} else { } else {
request_region(base, 8, hwif->name); request_region(base, 8, hwif->name);
hwif->dma_base = base; hwif->dma_base = base;
if (dmatable == NULL) { if (!dmatable) {
/* /*
* Since we know we are on a PCI bus, we could * Since we know we are on a PCI bus, we could
* actually use __get_free_pages() here instead * actually use __get_free_pages() here instead
* of __get_dma_pages() -- no ISA limitations. * of __get_dma_pages() -- no ISA limitations.
*/ */
dmatable = (void *) __get_dma_pages(GFP_KERNEL, 0); dmatable = __get_dma_pages(GFP_KERNEL, 0);
} }
if (dmatable != NULL) { if (dmatable) {
hwif->dmatable = (unsigned long *) dmatable; hwif->dmatable = (unsigned long *) dmatable;
dmatable += (PRD_ENTRIES * PRD_BYTES); dmatable += (PRD_ENTRIES * PRD_BYTES);
outl(virt_to_bus(hwif->dmatable), base + 4); outl(virt_to_bus(hwif->dmatable), base + 4);
......
#define AZT_VERSION "2.0" #define AZT_VERSION "2.1"
/* $Id: aztcd.c,v 2.0 1995/11/10 19:33:41 root Exp root $ /* $Id: aztcd.c,v 2.10 1995/12/03 11:55:09 root Exp root $
linux/drivers/block/aztcd.c - AztechCD268 CDROM driver linux/drivers/block/aztcd.c - AztechCD268 CDROM driver
Copyright (C) 1994,1995 Werner Zimmermann (zimmerma@rz.fht-esslingen.de) Copyright (C) 1994,1995 Werner Zimmermann (zimmerma@rz.fht-esslingen.de)
...@@ -134,13 +134,15 @@ ...@@ -134,13 +134,15 @@
with kernel 1.3.33. Will definitely not work with older kernels. with kernel 1.3.33. Will definitely not work with older kernels.
Programming done by Linus himself. Programming done by Linus himself.
Werner Zimmermann, October 11, 1995 Werner Zimmermann, October 11, 1995
V1.90 Support for Conrad TXC drives, thank's to Jochen Koch and Olaf Koluza. V1.90 Support for Conrad TXC drives, thank's to Jochen Koch and Olaf Kaluza.
Werner Zimmermann, October 21, 1995 Werner Zimmermann, October 21, 1995
V2.00 Changed #include "blk.h" to <linux/blk.h> as the directory V2.00 Changed #include "blk.h" to <linux/blk.h> as the directory
structure was changed. README.aztcd is now /usr/src/docu- structure was changed. README.aztcd is now /usr/src/docu-
mentation/cdrom/aztcd mentation/cdrom/aztcd
Werner Zimmermann, November 10, 95 Werner Zimmermann, November 10, 95
V2.10 Started to modify azt_poll to prevent reading beyond end of
tracks.
Werner Zimmermann, December 3, 95
NOTE: NOTE:
Points marked with ??? are questionable ! Points marked with ??? are questionable !
*/ */
...@@ -258,6 +260,7 @@ static void azt_invalidate_buffers(void); ...@@ -258,6 +260,7 @@ static void azt_invalidate_buffers(void);
static void do_aztcd_request(void); static void do_aztcd_request(void);
static void azt_hsg2msf(long hsg, struct msf *msf); static void azt_hsg2msf(long hsg, struct msf *msf);
static void azt_bin2bcd(unsigned char *p); static void azt_bin2bcd(unsigned char *p);
static long azt_msf2hsg(struct msf *mp);
static int azt_bcd2bin(unsigned char bcd); static int azt_bcd2bin(unsigned char bcd);
static int aztStatus(void); static int aztStatus(void);
static int getAztStatus(void); static int getAztStatus(void);
...@@ -604,10 +607,6 @@ static int aztPlay(struct azt_Play_msf *arg) ...@@ -604,10 +607,6 @@ static int aztPlay(struct azt_Play_msf *arg)
} }
long azt_msf2hsg(struct msf *mp)
{ return azt_bcd2bin(mp -> frame) + azt_bcd2bin(mp -> sec) * 75
+ azt_bcd2bin(mp -> min) * 4500 - CD_BLOCK_OFFSET;
}
static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg) static int aztcd_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg)
{ int i, st; { int i, st;
...@@ -1180,11 +1179,28 @@ static void azt_poll(void) ...@@ -1180,11 +1179,28 @@ static void azt_poll(void)
if (CURRENT_VALID) { if (CURRENT_VALID) {
struct azt_Play_msf msf; struct azt_Play_msf msf;
int i;
azt_next_bn = CURRENT -> sector / 4; azt_next_bn = CURRENT -> sector / 4;
azt_hsg2msf(azt_next_bn, &msf.start); azt_hsg2msf(azt_next_bn, &msf.start);
azt_read_count=AZT_BUF_SIZ; /*??? fast, because we read ahead*/ i = 0;
/* azt_read_count= CURRENT->nr_sectors; slow /* find out in which track we are */
*/ while (azt_msf2hsg(&msf.start)>azt_msf2hsg(&Toc[++i].trackTime)) {};
if (azt_msf2hsg(&msf.start)<azt_msf2hsg(&Toc[i].trackTime)-AZT_BUF_SIZ)
{ azt_read_count=AZT_BUF_SIZ; /*fast, because we read ahead*/
/*azt_read_count=CURRENT->nr_sectors; slow, no read ahead*/
}
else /* don't read beyond end of track */
#if AZT_MULTISESSION
{ azt_read_count=(azt_msf2hsg(&Toc[i].trackTime)/4)*4-azt_msf2hsg(&msf.start);
if (azt_read_count < 0) azt_read_count=0;
if (azt_read_count > AZT_BUF_SIZ) azt_read_count=AZT_BUF_SIZ;
printk("aztcd: warning - trying to read beyond end of track\n");
/* printk("%i %i %li %li\n",i,azt_read_count,azt_msf2hsg(&msf.start),azt_msf2hsg(&Toc[i].trackTime));
*/ }
#else
{ azt_read_count=AZT_BUF_SIZ;
}
#endif
msf.end.min = 0; msf.end.min = 0;
msf.end.sec = 0; msf.end.sec = 0;
msf.end.frame = azt_read_count ;/*Mitsumi here reads 0xffffff sectors*/ msf.end.frame = azt_read_count ;/*Mitsumi here reads 0xffffff sectors*/
...@@ -1629,26 +1645,26 @@ int aztcd_init(void) ...@@ -1629,26 +1645,26 @@ int aztcd_init(void)
else max_count=count; else max_count=count;
printk("aztcd: FirmwareVersion="); printk("aztcd: FirmwareVersion=");
for (count=1;count<max_count;count++) printk("%c",result[count]); for (count=1;count<max_count;count++) printk("%c",result[count]);
printk("<<<\n"); printk("<<>> ");
if ((result[1]=='A')&&(result[2]=='Z')&&(result[3]=='T')) if ((result[1]=='A')&&(result[2]=='Z')&&(result[3]=='T'))
{ printk("aztcd: AZTECH drive detected\n"); /*AZTECH*/ { printk("AZTECH drive detected\n"); /*AZTECH*/
} }
else if ((result[2]=='C')&&(result[3]=='D')&&(result[4]=='D')) else if ((result[2]=='C')&&(result[3]=='D')&&(result[4]=='D'))
{ printk("aztcd: ORCHID or WEARNES drive detected\n"); /*ORCHID or WEARNES*/ { printk("ORCHID or WEARNES drive detected\n"); /*ORCHID or WEARNES*/
} }
else if ((result[1]==0x03)&&(result[2]=='5')) else if ((result[1]==0x03)&&(result[2]=='5'))
{ printk("aztcd: TXC drive detected\n"); /*Conrad TXC*/ { printk("TXC drive detected\n"); /*Conrad TXC*/
} }
else /*OTHERS or none*/ else /*OTHERS or none*/
{ printk("aztcd: : unknown drive or firmware version detected\n"); { printk("\nunknown drive or firmware version detected\n");
printk(" azt may not run stable, if you want to try anyhow,\n"); printk("aztcd may not run stable, if you want to try anyhow,\n");
printk(" boot with: aztcd=<BaseAddress>,0x79\n"); printk("boot with: aztcd=<BaseAddress>,0x79\n");
if ((azt_cont!=0x79)) if ((azt_cont!=0x79))
{ printk("aztcd: FirmwareVersion="); { printk("aztcd: FirmwareVersion=");
for (count=1;count<5;count++) printk("%c",result[count]); for (count=1;count<5;count++) printk("%c",result[count]);
printk("\n"); printk("<<>> ");
printk("aztcd: Aborted\n"); printk("Aborted\n");
return -EIO; return -EIO;
} }
} }
...@@ -1666,8 +1682,8 @@ int aztcd_init(void) ...@@ -1666,8 +1682,8 @@ int aztcd_init(void)
azt_invalidate_buffers(); azt_invalidate_buffers();
aztPresent = 1; aztPresent = 1;
aztCloseDoor(); aztCloseDoor();
printk("aztcd: End Init\n"); /* printk("aztcd: End Init\n");
return (0); */ return (0);
} }
...@@ -1687,6 +1703,10 @@ static void azt_hsg2msf(long hsg, struct msf *msf) ...@@ -1687,6 +1703,10 @@ static void azt_hsg2msf(long hsg, struct msf *msf)
azt_bin2bcd(&msf -> frame); azt_bin2bcd(&msf -> frame);
} }
static long azt_msf2hsg(struct msf *mp)
{ return azt_bcd2bin(mp -> frame) + azt_bcd2bin(mp -> sec) * 75
+ azt_bcd2bin(mp -> min) * 4500 - CD_BLOCK_OFFSET;
}
static void azt_bin2bcd(unsigned char *p) static void azt_bin2bcd(unsigned char *p)
{ int u, t; { int u, t;
...@@ -1700,8 +1720,6 @@ static int azt_bcd2bin(unsigned char bcd) ...@@ -1700,8 +1720,6 @@ static int azt_bcd2bin(unsigned char bcd)
{ return (bcd >> 4) * 10 + (bcd & 0xF); { return (bcd >> 4) * 10 + (bcd & 0xF);
} }
/* /*
* Read a value from the drive. Should return quickly, so a busy wait * Read a value from the drive. Should return quickly, so a busy wait
* is used to avoid excessive rescheduling. The read command itself must * is used to avoid excessive rescheduling. The read command itself must
...@@ -2047,7 +2065,7 @@ static int aztGetToc(int multi) ...@@ -2047,7 +2065,7 @@ static int aztGetToc(int multi)
} }
Toc[DiskInfo.last + 1].diskTime = DiskInfo.diskLength; Toc[DiskInfo.last + 1].diskTime = DiskInfo.diskLength;
Toc[DiskInfo.last].trackTime = DiskInfo.diskLength;
#ifdef AZT_DEBUG_MULTISESSION #ifdef AZT_DEBUG_MULTISESSION
printk("aztcd: exiting aztGetToc\n"); printk("aztcd: exiting aztGetToc\n");
......
...@@ -29,3 +29,10 @@ if [ "$CONFIG_QIC02_TAPE" = "y" ]; then ...@@ -29,3 +29,10 @@ if [ "$CONFIG_QIC02_TAPE" = "y" ]; then
comment '>>> Which is available from ftp://ftp.funet.fi/pub/OS/Linux/BETA/QIC-02/' comment '>>> Which is available from ftp://ftp.funet.fi/pub/OS/Linux/BETA/QIC-02/'
fi fi
fi fi
bool 'Advanced Power Management BIOS support' CONFIG_APM
if [ "$CONFIG_APM" = "y" ]; then
bool ' Ignore USER SUSPEND' CONFIG_APM_IGNORE_USER_SUSPEND
bool ' Enable PM at boot time' CONFIG_APM_DO_ENABLE
bool ' Make CPU Idle calls when idle' CONFIG_APM_CPU_IDLE
bool ' Enable console blanking using APM' CONFIG_APM_DISPLAY_BLANK
fi
...@@ -19,6 +19,7 @@ M_OBJS := ...@@ -19,6 +19,7 @@ M_OBJS :=
L_OBJS := tty_io.o n_tty.o console.o keyboard.o serial.o \ L_OBJS := tty_io.o n_tty.o console.o keyboard.o serial.o \
tty_ioctl.o pty.o vt.o mem.o vc_screen.o random.o \ tty_ioctl.o pty.o vt.o mem.o vc_screen.o random.o \
defkeymap.o consolemap.o selection.o defkeymap.o consolemap.o selection.o
SYMTAB_OBJS :=
ifeq ($(CONFIG_CYCLADES),y) ifeq ($(CONFIG_CYCLADES),y)
L_OBJS += cyclades.o L_OBJS += cyclades.o
...@@ -96,6 +97,11 @@ ifdef CONFIG_QIC02_TAPE ...@@ -96,6 +97,11 @@ ifdef CONFIG_QIC02_TAPE
L_OBJS += tpqic02.o L_OBJS += tpqic02.o
endif endif
ifdef CONFIG_APM
L_OBJS += apm_bios.o
SYMTAB_OBJS += apm_bios.o
endif
ifdef M ifdef M
L_OBJS += mouse.o L_OBJS += mouse.o
else else
......
This diff is collapsed.
...@@ -93,6 +93,9 @@ ...@@ -93,6 +93,9 @@
#include <linux/major.h> #include <linux/major.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#ifdef CONFIG_APM
#include <linux/apm_bios.h>
#endif
#include <asm/io.h> #include <asm/io.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -2076,6 +2079,11 @@ void do_blank_screen(int nopowersave) ...@@ -2076,6 +2079,11 @@ void do_blank_screen(int nopowersave)
{ {
int currcons; int currcons;
#ifdef CONFIG_APM
if (apm_display_blank())
return;
#endif
if (console_blanked) if (console_blanked)
return; return;
...@@ -2111,6 +2119,11 @@ void do_unblank_screen(void) ...@@ -2111,6 +2119,11 @@ void do_unblank_screen(void)
int resetorg; int resetorg;
long offset; long offset;
#ifdef CONFIG_APM
if (apm_display_unblank())
return;
#endif
if (!console_blanked) if (!console_blanked)
return; return;
if (!vc_cons_allocated(fg_console)) { if (!vc_cons_allocated(fg_console)) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -131,7 +131,7 @@ slhc_init(int rslots, int tslots) ...@@ -131,7 +131,7 @@ slhc_init(int rslots, int tslots)
kfree((unsigned char *)comp); kfree((unsigned char *)comp);
return NULL; return NULL;
} }
memset(comp->tstate, 0, rslots * sizeof(struct cstate)); memset(comp->tstate, 0, tslots * sizeof(struct cstate));
comp->tslot_limit = tslots - 1; comp->tslot_limit = tslots - 1;
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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