Commit 530861e1 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.0.11

parent bf1f706a
......@@ -26,7 +26,11 @@ http://slug.ctv.es/~alfredo/Cambios.html.
valtozasokrol, az alabbi cimen megtalaljak Nyitrai Tamas forditasat:
http://www.datanet.hu/generations/linux/newkernel.html.
Last updated: July 21, 1996.
For people who prefer Japanse (thanks to Mitsuhiro Kojima): Kono
bunshou no nihongo ban ha
http://jf.gee.kyoto-u.ac.jp/JF/v2.0/Changes-2.0.html ni arimasu.
Last updated: July 29, 1996.
Current Author: Chris Ricker (gt1355b@prism.gatech.edu).
Current Releases
......@@ -41,7 +45,7 @@ Current Releases
- Linux C++ Library 2.7.1.4
- Termcap 2.0.8
- Procps 1.01
- Gpm 1.09
- Gpm 1.10
- SysVinit 2.64
- Util-linux 2.5
- Mount 2.5k
......@@ -82,6 +86,11 @@ ftp://sunsite.unc.edu/pub/Linux/system/Linux-boot/lodlin16.tgz. If
you're using more unusual loaders like SysLinux or etherboot, the
latest versions are 1.3 and 2.0, respectively.
Ramdisk support does not work with the latest kernels if ramdisk=0
option is present. Many older distributions (mainly Slackware) have
this option in their lilo.config file. Comment it out and re-run lilo
if you need ramdisks.
The Linux C Library
===================
......@@ -123,14 +132,8 @@ the old libc). If you're feeling lazy, just comment out
in linux/fs/locks.c and recompile. If you're still running a.out,
there's an unofficial libc-4.7.6 release out to which you can upgrade
to fix this problem.
The Termcap Library
===================
The current Termcap release is 2.0.8. If you upgrade to this release
read the `README' file contained into the package to get some important
information about the `tgetent' function changes!
to fix this problem. Libc is available from
ftp://sunsite.unc.edu/pub/Linux/GCC/.
Procps utilities
================
......@@ -138,18 +141,17 @@ Procps utilities
Due to changes in the structure of the /proc filesystem, you need to
upgrade procps to the latest release, currently 1.01. Otherwise,
you'll get floating point errors with some ps commands or other similar
surprises.
surprises. Grab
ftp://sunsite.unc.edu/pub/Linux/system/Status/ps/procps-1.01.tgz.
Kernel Modules
==============
Almost all drivers in 2.0.x can be modules, and kerneld is now
incorporated into the kernel. To take advantage of this, you'll need
the latest version of the module support apps, currently 2.0.0. These
should be available at the same place you picked up your kernel
(ftp://ftp.funet.fi/pub/Linux/kernel/src/) or the home page,
http://www.pi.se/blox/modules/index.html. Note: If you try to load a
module and get a message like
the latest version of the module support apps. These are available at
http://www.pi.se/blox/modules/modules-2.0.0.tar.gz. Note: If you try to
load a module and get a message like
`gcc2_compiled, undefined Failed to load module! The symbols from
kernel 1.3.foo don't match 1.3.foo'
......@@ -190,7 +192,8 @@ ftp://sunsite.unc.edu/pub/Linux/system/Daemons/init/sysvinit-2.64.tar.gz.
If you're trying to run NCSA httpd, you might have problems with
pre-spawning daemons. Upgrade to the latest release (1.5.2), available
from http://hoohoo.ncsa.uiuc.edu/.
from http://hoohoo.ncsa.uiuc.edu/ or check out Apache
(http://www.apache.org/).
The new named pipe behavior also causes problems with Hylafax. If
you're running the hylafax daemon, it will just keep eating up CPU time
......@@ -223,7 +226,7 @@ Uugetty
Older uugettys will not allow use of a bidirectional serial line. To
fix this problem, upgrade to
ftp://sunsite.unc.edu/pub/Linux/system/Serial/getty_ps-2.0.7h.tar.gz.
ftp://sunsite.unc.edu/pub/Linux/system/Serial/getty_ps-2.0.7i.tar.gz.
Kbd
===
......@@ -253,7 +256,10 @@ the following as root:
ln -s /usr/lib/terminfo/l/linux /usr/lib/terminfo/c/console
Better yet, just get the latest official Linux termcap from
ftp://sunsite.unc.edu/pub/Linux/GCC/termcap-2.0.8.tar.gz
ftp://sunsite.unc.edu/pub/Linux/GCC/termcap-2.0.8.tar.gz. If you
upgrade to this release read the `README' file contained into the
package to get some important information about the `tgetent' function
changes!
Also, the console driver is now responsible for keeping track of
correspondence between character codes and glyph bitmaps. If you
......@@ -265,7 +271,7 @@ Hdparm
Hdparm has been upgraded to take advantage of the latest features of
the kernel drivers. The latest non-beta version can be found at
ftp://sunsite.unc.edu/pub/Linux/kernel/patches/diskdrives/hdparm-2.9.tar.gz.
ftp://sunsite.unc.edu/pub/Linux/kernel/patches/diskdrives/hdparm-3.0.tar.gz.
IP Accounting
=============
......@@ -307,9 +313,18 @@ ISDN support
============
The new kernels support ISDN. You'll need ISDN utils available from
ftp://ftp.franken.de/pub/isdn4linux/isdn4k-utils-2.0.0.tar.gz to try
ftp://ftp.franken.de/pub/isdn4linux/v2.0/isdn4k-utils-2.0.tar.gz to try
this.
Frame Relay
===========
Frame relay support for Linux is now available as well. Currently,
only Sangoma cards are supported, but the interface is such that others
will be as drivers become available. To use this, grab
ftp://ftp.invlogic.com/linux/frad-0.15.tgz and
ftp://ftp.invlogic.com/linux/routing.tgz.
Networking
==========
......@@ -369,30 +384,30 @@ like encrypted file systems and such. To use it, you'll need a
modified version of mount from
ftp://ftp.win.tue.nl/pub/linux/util/mount-2.5k.tar.gz; preliminary work
on encrypted file system support can be found in
ftp.funet.fi:/pub/OS/Linux/BETA/loop/des.1.tar.gz.
ftp.funet.fi:/pub/Linux/BETA/loop/des.1.tar.gz.
Multiple device
===============
Multiple device support (allowing you to group several partitions
into one logical device) has also been added. Check out
ftp://sweet-smoke.ufr-info-p7.ibp.fr/pub/Linux/md034.tar.gz to try this
ftp://sweet-smoke.ufr-info-p7.ibp.fr/pub/Linux/md035.tar.gz to try this
out.
Arp
===
Arp daemon support has been added. Check out
http://www.loran.com/~layes/arpd/index.html for more info and a copy of
arpd.
http://www.loran.com/~layes/arpd/index.html for more info and
http://www.loran.com/~layes/arpd/arpd-1.0.2.tar.gz for a copy of arpd.
Quota
=====
Quota support has also been added. You need to get quotas-1.55 from
ftp://ftp.funet.fi/pub/Linux/PEOPLE/Linus/subsystems/quota/all.tar.gz.
You may need to copy its mntent.h over to /usr/include/mntent.h to get
it to compile.
ftp://ftp.funet.fi/pub/Linux/kernel/src/subsystems/quota/all.tar.gz. You
may need to copy its mntent.h over to /usr/include/mntent.h to get it to
compile.
Process Accounting
==================
......@@ -401,13 +416,18 @@ Process Accounting
kernels. To use this feature, you'll need to get
ftp://iguana.hut.fi/pub/linux/Kernel/process_accounting/acct_1.3.73.tar.gz.
Bdflush
=======
Bdflush and Updated
===================
Bdflush has also been integrated into the new kernels, so those of
you using it on older systems no longer need to hunt for the patches to
implement it once you upgrade to 2.0.x. You do still need to run the
update daemon, however.
update daemon, however. You should probably upgrade to the latest
updated, currently
ftp://sunsite.unc.edu/pub/Linux/system/Daemons/updated-1.2.tar.gz. This
(and later) versions will not spawn a bdflush daemon, since that is now
done by the kernel (kflushd). If you upgrade, be sure to leave update
in your init scripts and remove bdflush.
APM support
===========
......@@ -426,7 +446,7 @@ ftp://tsx-11.mit.edu/pub/linux/BETA/ibcs2/ibcs-2.0-960610.tar.gz
For a version of Dosemu that works (well, at least as well as DOS
ever works ;-), get
ftp://tsx-11.mit.edu/pub/linux/ALPHA/dosemu/Development/dosemu-0.63.1.36.tgz
ftp://tsx-11.mit.edu/pub/linux/ALPHA/dosemu/Development/dosemu-0.63.1.55.tgz
or check out http://www.ednet.ns.ca/auto/rddc. Be sure to follow the
instructions in README.newkernels about patching your include files, or
it will not compile.
......@@ -449,7 +469,15 @@ ftp://sunsite.unc.edu/pub/Linux/system/Misc/fdutils-4.3.src.tar.gz.
In the future, fdformat might disappear entirely, so get used to
using superformat instead.
NCR 83c510 SCSI Driver
Cyclades Serial Driver
======================
The Cyclades driver has been changed so that the minor numbers start
at 0 instead of 32 (ie: ttyC0 should be major 19, minor 0 in the 2.0.x
kernels while it used to be major 19, minor 32 in the older kernels).
You can use mknod to manually fix this or use a newer version of MAKEDEV.
NCR 53c810 SCSI Driver
======================
Drivers for this card are now included in the standard linux source.
......@@ -471,7 +499,7 @@ instead of Perl.
using an old version of Perl, due to changes in libc. Upgrade to a
more current Perl to avoid any unpleasantness.
groff
Groff
=====
Those of you running Slackware may experience weirdness with man
......@@ -482,6 +510,14 @@ environmental variable LESSCHARSET. Another, and probably better,
solution is to edit the file /usr/lib/man.config and change all
`-Tlatin1' options to `-Tascii'.
E2fsprogs
=========
e2fsprogs 1.02 will work with the latest kernels, but it cannot be
compiled on them. If you need (or want) to compile your own copy,
you'll need to get the latest version, currently available at
ftp://tsx-11.mit.edu/pub/linux/packages/ext2fs/e2fsprogs-1.04.tar.gz.
How to know the version of the installed programs
*************************************************
......@@ -573,8 +609,8 @@ ftp://sunsite.unc.edu/pub/Linux/system/Status/ps/procps-1.01.tgz
Gpm mouse utilities
===================
ftp://iride.unipv.it/pub/gpm/gpm-1.09.tar.gz
ftp://sunsite.unc.edu/pub/Linux/system/Daemons/gpm-1.09.tar.gz
ftp://iride.unipv.it/pub/gpm/gpm-1.10.tar.gz
ftp://sunsite.unc.edu/pub/Linux/system/Daemons/gpm-1.10.tar.gz
SysVinit utilities
==================
......
......@@ -202,10 +202,9 @@ CONFIG_BLK_DEV_CMD640
"SiS" chipset. Unfortunately, it has a number of rather nasty
design flaws that can cause severe data corruption under many common
conditions. Say Y here to include code which tries to automatically
detect and correct the problems under Linux. This also provides
support for the enhanced features of the CMD640, for improved
support/operation under linux, including access to the secondary IDE
ports in some systems. This driver will work automatically in PCI
detect and correct the problems under Linux.
This option also enables access to the secondary IDE ports in some
CMD640 based systems. This driver will work automatically in PCI
based systems (most new systems have PCI slots). But if your system
uses VESA local bus (VLB) instead of PCI, you must also supply a
kernel boot parameter to enable the CMD640 bugfix/support:
......@@ -213,6 +212,13 @@ CONFIG_BLK_DEV_CMD640
Acculogic, and on the "CSA-6400E PCI to IDE controller" that some
people have. If unsure, say Y.
CMD640 enhanced support
CONFIG_BLK_DEV_CMD640_ENHANCED
This option includes support for setting/autotuning PIO modes
and prefetch on CMD640 IDE interfaces. If you have a CMD640 IDE
interface and your BIOS does not already do this for you, then say Y
here. Otherwise say N.
RZ1000 chipset bugfix/support
CONFIG_BLK_DEV_RZ1000
The PC-Technologies RZ1000 chip is used on many common 486 and
......@@ -3470,6 +3476,15 @@ CONFIG_SOFT_WATCHDOG
from the running kernel whenever you want). If you want to compile
it as a module, say M here and read Documentation/modules.txt.
Berkshire Products PC Watchdog card
CONFIG_PCWATCHDOG
This is the driver for the Berkshire Products PC Watchdog card. This card
simply watches your kernel to make sure it doesn't freeze, and if it does,
it resets your computer after a certain amount of time. This driver is
like the WDT501 driver but for different hardware. The PC watchdog cards
can be ordered from http://www.berkprod.com. Some example rc.local files
are available from ftp.bitgame.com.
Enhanced Real Time Clock Support
CONFIG_RTC
If you enable this option and create a character special file
......@@ -3824,7 +3839,7 @@ CONFIG_AP1000
# LocalWords: Bernd informatik rwth aachen uae affs multihosting bytecode java
# LocalWords: applets applet JDK ncsa cabi SNI Alphatronix readme LANs scarab
# LocalWords: winsock RNIS caltech OSPF honour Honouring Mbit Localtalk DEFRAG
# LocalWords: localtalk download Packetwin Baycom baycom interwork ascii JNT
# LocalWords: Camtec Berkshire
# LocalWords: Camtec proxying indyramp defragment defragmented UDP FAS FASXX
# LocalWords: FastSCSI SIO FDC qlogicfas QLogic qlogicisp setbaycom ife ee LJ
# LocalWords: ethz ch Travelmates ProAudioSpectrum ProAudio SoundMan SB SBPro
......
......@@ -351,7 +351,7 @@ If this still does not help,
aztGetQChannelInfo() repeated several times
aztGetToc()
aztGetQChannelInfo() repeated several times
a list of track informations
a list of track information
do_aztcd_request() }
azt_transfer() } repeated several times
azt_poll }
......
......@@ -45,8 +45,8 @@ Devices. Use the following script to generate the devices:
# mkdigidev [<number of devices>]
#
DIGI_MAJOR=22
DIGICU_MAJOR=23
DIGI_MAJOR=23
DIGICU_MAJOR=22
BOARDS=$1
......@@ -60,8 +60,8 @@ do
for c in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15;
do
name=`expr $boardnum \* 16 + $c`
mknod /dev/cud$name c $DIGIMAJOR $name
mknod /dev/ttyD$name c $DIGICUMAJOR $name
mknod /dev/cud$name c $DIGI_CUMAJOR $name
mknod /dev/ttyD$name c $DIGI_MAJOR $name
done
boardnum=`expr $boardnum + 1`
done
......@@ -97,7 +97,7 @@ make digi
+ digi)
+ major1=`Major ttyD` || continue
+ major2=`Major cud` || continue
+ for i in 0 1 2 3 4 5 6 7 # 8 9 10 11 12 13 14 15
+ for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ do
+ makedev ttyD$i c $major1 `expr 32 + $i` $tty
+ makedev cud$i c $major2 `expr 32 + $i` $dialout
......@@ -152,3 +152,4 @@ for this device. The driver does not currently recognise the board, nor
does it want to initialize it. At least not the EISA version.
Mike McLagan <mike.mclagan@linux.org> 5, April 1996.
ide.txt -- Information regarding the Enhanced IDE drive in Linux 2.0.x
ide.txt -- Information regarding the Enhanced IDE drive in Linux 2.0.xx
===============================================================================
Supported by:
Mark Lord <mlord@pobox.com> -- disks, interfaces, probing
......@@ -37,8 +37,8 @@ NEW! - support for reliable operation of buggy RZ1000 interfaces
NEW! - support for reliable operation of buggy CMD-640 interfaces
- PCI support is automatic when cmd640 support is configured
- for VLB, use kernel command line option: ide0=cmd640_vlb
- this support also enables the secondary i/f on most cards
- experimental interface timing parameter support
- this support also enables the secondary i/f when needed
- interface PIO timing & prefetch parameter support
NEW! - experimental support for UMC 8672 interfaces
NEW! - support for secondary interface on the FGI/Holtek HT-6560B VLB i/f
- use kernel command line option: ide0=ht6560
......@@ -62,7 +62,7 @@ NEW! - ide-cd.c now supports door locking and auto-loading.
and direct reads of audio data.
NEW! - experimental support for Promise DC4030VL caching interface card
NEW! - email thanks/problems to: peterd@pnd-pc.demon.co.uk
NEW! - the hdparm-2.7 package can be used to set PIO modes for some chipsets.
NEW! - the hdparm-3.1 package can be used to set PIO modes for some chipsets.
For work in progress, see the comments in ide.c, ide-cd.c, and triton.c.
......@@ -71,17 +71,28 @@ caching IDE cards, such as the DC4030VL, and early results are encouraging.
Look for this support to be added to the kernel soon.
*** IMPORTANT NOTICES (for kernel versions after 1.3.21)
*** IMPORTANT NOTICES: BUGGY IDE CHIPSETS CAN CORRUPT DATA!!
*** =================
*** PCI versions of the CMD640 and RZ1000 interfaces are now detected
*** automatically at startup when PCI BIOS support is configured.
*** Linux disables the "pre-fetch" or "read-ahead" modes of these interfaces
***
*** Linux disables the "prefetch" ("readahead") mode of the RZ1000
*** to prevent data corruption possible due to hardware design flaws.
*** Use of the "serialize" option is no longer necessary.
***
*** For the CMD640, linux disables "IRQ unmasking" (hdparm -u1) on any
*** drive for which the "prefetch" mode of the CMD640 is turned on.
*** If "prefetch" is disabled (hdparm -p8), then "IRQ unmasking" can be
*** used again.
***
*** For the CMD640, linux disables "32bit I/O" (hdparm -c1) on any drive
*** for which the "prefetch" mode of the CMD640 is turned off.
*** If "prefetch" is enabled (hdparm -p9), then "32bit I/O" can be
*** used again.
***
*** The CMD640 is also used on some Vesa Local Bus (VLB) cards, and is *NOT*
*** automatically detected by Linux. For safe, reliable operation with such
*** interfaces, one *MUST* use the "ide0=cmd640_vlb" kernel option.
***
*** Use of the "serialize" option is no longer necessary.
This is the multiple IDE interface driver, as evolved from hd.c.
......@@ -107,7 +118,7 @@ IRQ numbers being used by the interfaces (normally IRQ14 & IRQ15).
Interfaces beyond the first two are not normally probed for, but may be
specified using kernel "command line" options. For example,
ide3=0x168,0x36e,10 /* ioports 0x168-0x16f,0x36e, irq 11 */
ide3=0x168,0x36e,10 /* ioports 0x168-0x16f,0x36e, irq 10 */
Normally the irq number need not be specified, as ide.c will probe for it:
......@@ -245,6 +256,16 @@ Summary of ide driver parameters for kernel "command line":
and quite likely to cause trouble with
older/odd IDE drives.
"idebus=xx" : inform IDE driver of VESA/PCI bus speed in Mhz,
where "xx" is between 25 and 66 inclusive,
used when tuning chipset PIO modes.
For PCI bus, 25 is correct for a P75 system,
30 is correct for P90,P120,P180 systems,
and 33 is used for P100,P133,P166 systems.
If in doubt, use idebus=33 for PCI.
As for VLB, it is safest to not specify it.
Bigger values are safer than smaller ones.
"idex=noprobe" : do not attempt to access/use this interface
"idex=base" : probe for an interface at the addr specified,
where "base" is usually 0x1f0 or 0x170
......
......@@ -150,13 +150,13 @@ S: Maintained
EATA-DMA SCSI DRIVER
P: Michael Neuffer
M: mike@i-Connect.Net
L: linux-scsi@vger.rutgers.edu
L: linux-eata@i-connect.net, linux-scsi@vger.rutgers.edu
S: Maintained
EATA-PIO SCSI DRIVER
P: Michael Neuffer
M: mike@i-Connect.Net
L: linux-scsi@vger.rutgers.edu
L: linux-eata@i-connect.net, linux-scsi@vger.rutgers.edu
S: Maintained
FRAME RELAY DLCI/FRAD (Sangoma drivers too)
......
VERSION = 2
PATCHLEVEL = 0
SUBLEVEL = 10
SUBLEVEL = 11
ARCH = i386
......
......@@ -14,8 +14,12 @@ ifdef CONFIG_CROSSCOMPILE
# enable this for linking under OSF/1:
LINKFLAGS = -non_shared -T 0xfffffc0000310000 -N
else
# enable this for linking under Linux:
LINKFLAGS = -static -T arch/alpha/vmlinux.lds -N
elf=$(shell if $(LD) --help | grep elf64alpha >/dev/null; then echo yes; fi)
ifeq ($(elf),yes)
LINKFLAGS = -static -Ttext 0xfffffc0000310000 -N
else
LINKFLAGS = -static -T arch/alpha/vmlinux.lds -N
endif
# GNU gcc/cc1/as can use pipes instead of temporary files
CFLAGS := $(CFLAGS) -pipe
endif
......
......@@ -12,8 +12,12 @@ ifdef CONFIG_CROSSCOMPILE
# enable this for linking under OSF/1:
LINKFLAGS = -non_shared -T 0x20000000 -N
else
# enable this for linking under Linux:
LINKFLAGS = -static -T bootloader.lds -N
elf=$(shell if $(LD) --help | grep elf64alpha >/dev/null; then echo yes; fi)
ifeq ($(elf),yes)
LINKFLAGS = -static -Ttext 0x20000000 -N
else
LINKFLAGS = -static -T bootloader.lds -N
endif
endif
.S.s:
......@@ -22,13 +26,15 @@ endif
$(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $<
OBJECTS = head.o main.o
TARGETS = vmlinux.gz
TARGETS = vmlinux.gz tools/objstrip # also needed by aboot & milo
VMLINUX = $(TOPDIR)/vmlinux
OBJSTRIP = tools/objstrip
all: $(TARGETS)
@echo Ready to install kernel in $(shell pwd)/vmlinux.gz
# normally no need to build these:
rawboot: vmlinux.nh tools/lxboot tools/bootlx vmlinux
rawboot: vmlinux.nh tools/lxboot tools/bootlx
msb: tools/lxboot tools/bootlx vmlinux.nh
( cat tools/lxboot tools/bootlx vmlinux.nh ) > /dev/rz0a
......@@ -51,21 +57,33 @@ vmlinux.gz: vmlinux
#
# A raw binary without header. Used by raw boot.
#
vmlinux.nh: tools/build
tools/build -v $(TOPDIR)/vmlinux > vmlinux.nh
main.o: ksize.h
ksize.h: $(OBJSTRIP) vmlinux.nh
echo "#define KERNEL_SIZE `$(OBJSTRIP) -p vmlinux.nh /dev/null`" > $@
vmlinux.nh: $(VMLINUX) $(OBJSTRIP)
ifeq ($(elf),yes)
cp $(VMLINUX) vmlinux.stripped
strip vmlinux.stripped # work around ELF binutils bug...
$(OBJSTRIP) -v vmlinux.stripped vmlinux.nh
rm -f vmlinux.stripped
else
$(OBJSTRIP) -v $(VMLINUX) vmlinux.nh
endif
vmlinux: $(TOPDIR)/vmlinux
cp $(TOPDIR)/vmlinux vmlinux
strip vmlinux
tools/lxboot: tools/build
tools/build > tools/lxboot
tools/lxboot: $(OBJSTRIP) bootloader
$(OBJSTRIP) -p bootloader tools/lxboot
tools/bootlx: bootloader tools/build
tools/build -vb bootloader > tools/bootlx
tools/bootlx: bootloader $(OBJSTRIP)
$(OBJSTRIP) -vb bootloader tools/bootlx
tools/build: tools/build.c
$(HOSTCC) tools/build.c -o tools/build
$(OBJSTRIP): $(OBJSTRIP).c
$(HOSTCC) $(OBJSTRIP).c -o $(OBJSTRIP)
tools/mkbb: tools/mkbb.c
$(HOSTCC) tools/mkbb.c -o tools/mkbb
......@@ -74,11 +92,11 @@ bootloader: $(OBJECTS)
$(LD) $(LINKFLAGS) \
$(OBJECTS) \
$(LIBS) \
-o bootloader || \
-o bootloader && strip bootloader || \
(rm -f bootloader && exit 1)
clean:
rm -f $(TARGETS) bootloader bootimage vmlinux.nh tools/build \
rm -f $(TARGETS) bootloader bootimage vmlinux.nh \
tools/mkbb tools/bootlx tools/lxboot
dep:
......@@ -17,6 +17,8 @@
#include <stdarg.h>
#include "ksize.h"
extern int vsprintf(char *, const char *, va_list);
extern unsigned long switch_to_osf_pal(unsigned long nr,
struct pcb_struct * pcb_va, struct pcb_struct * pcb_pa,
......@@ -152,8 +154,6 @@ void pal_init(void)
flush_tlb_all();
}
extern int _end;
static inline long openboot(void)
{
char bootdev[256];
......@@ -173,7 +173,8 @@ static inline long close(long dev)
static inline long load(long dev, unsigned long addr, unsigned long count)
{
char bootfile[256];
long result;
extern char _end;
long result, boot_size = &_end - (char *) BOOT_ADDR;
result = dispatch(CCB_GET_ENV, ENV_BOOTED_FILE, bootfile, 255);
if (result < 0)
......@@ -181,8 +182,9 @@ static inline long load(long dev, unsigned long addr, unsigned long count)
result &= 255;
bootfile[result] = '\0';
if (result)
printk("Boot file specification (%s) not implemented\n", bootfile);
return dispatch(CCB_READ, dev, count, addr, BOOT_SIZE/512 + 1);
printk("Boot file specification (%s) not implemented\n",
bootfile);
return dispatch(CCB_READ, dev, count, addr, boot_size/512 + 1);
}
/*
......@@ -219,9 +221,9 @@ void start_kernel(void)
}
dev &= 0xffffffff;
printk("Loading vmlinux ...");
i = load(dev, START_ADDR, START_SIZE);
i = load(dev, START_ADDR, KERNEL_SIZE);
close(dev);
if (i != START_SIZE) {
if (i != KERNEL_SIZE) {
printk("Failed (%lx)\n", i);
return;
}
......
/*
* arch/alpha/boot/tools/build.c
*
* Build a bootable image from the vmlinux binary
*/
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <linux/a.out.h>
#include <asm/system.h>
#define MAXSECT 10
#define MAXBUF 8192
int verbose = 0;
int pad = 0;
char * program = "tools/build";
char buffer[MAXBUF];
unsigned long bootblock[64];
struct filehdr fhdr;
struct aouthdr ahdr;
struct scnhdr shdr[MAXSECT];
char * usage = "'build [-b] system > secondary' or 'build > primary'";
static void die(char * str)
{
fprintf(stderr,"%s: %s\n", program, str);
exit(1);
}
static int comp(struct scnhdr * a, struct scnhdr * b)
{
return a->s_vaddr - b->s_vaddr;
}
int main(int argc, char ** argv)
{
int fd, i;
unsigned long tmp, start;
unsigned long system_start, system_size;
char * infile = NULL;
system_start = START_ADDR;
system_size = START_SIZE;
if (argc) {
program = *(argv++);
argc--;
}
while (argc > 0) {
if (**argv == '-') {
while (*++*argv) {
switch (**argv) {
case 'b':
system_start = BOOT_ADDR;
system_size = BOOT_SIZE;
pad = 1;
break;
case 'v':
verbose++;
break;
default:
die(usage);
}
}
} else if (infile)
die(usage);
else
infile = *argv;
argv++;
argc--;
}
if (!infile) {
memcpy(bootblock, "Linux Test", 10);
bootblock[60] = BOOT_SIZE / 512; /* count */
bootblock[61] = 1; /* starting LBM */
bootblock[62] = 0; /* flags */
tmp = 0;
for (i = 0 ; i < 63 ; i++)
tmp += bootblock[i];
bootblock[63] = tmp;
if (write(1, (char *) bootblock, 512) != 512) {
perror("bbwrite");
exit(1);
}
return 0;
}
fd = open(infile, O_RDONLY);
if (fd < 0) {
perror(infile);
exit(1);
}
if (read(fd, &fhdr, sizeof(struct filehdr)) != sizeof(struct filehdr))
die("unable to read file header");
if (fhdr.f_nscns > MAXSECT)
die("Too many sections");
if (fhdr.f_opthdr != AOUTHSZ)
die("optional header doesn't look like a.out");
if (read(fd, &ahdr, sizeof(struct aouthdr)) != sizeof(struct aouthdr))
die("unable to read a.out header");
for (i = 0 ; i < fhdr.f_nscns ; i++) {
if (read(fd, i+shdr, sizeof(struct scnhdr)) != sizeof(struct scnhdr))
die("unable to read section header");
if (shdr[i].s_paddr != shdr[i].s_vaddr)
die("unable to handle different phys/virt addresses");
if (shdr[i].s_relptr)
die("Unable to handle relocation info");
if (verbose) {
fprintf(stderr, "section %d (%.8s):\t%lx - %lx (at %x)\n",
i, shdr[i].s_name,
shdr[i].s_vaddr,
shdr[i].s_vaddr + shdr[i].s_size,
shdr[i].s_scnptr);
}
}
qsort(shdr, fhdr.f_nscns, sizeof(shdr[1]), comp);
start = system_start;
for (i = 0 ; i < fhdr.f_nscns ; i++) {
unsigned long size, offset;
memset(buffer, 0, MAXBUF);
if (!strcmp(shdr[i].s_name, ".comment"))
continue;
if (shdr[i].s_vaddr != start)
die("Unordered or badly placed segments");
size = shdr[i].s_size;
start += size;
offset = shdr[i].s_scnptr;
if (lseek(fd, offset, SEEK_SET) != offset)
die("Unable to seek in in-file");
while (size > 0) {
unsigned long num = size;
if (num > MAXBUF)
num = MAXBUF;
if (offset)
if (read(fd, buffer, num) != num)
die("partial read");
if (write(1, buffer, num) != num)
die("partial write");
size -= num;
}
if (verbose) {
fprintf(stderr, "section %d (%.8s):\t%lx - %lx (at %x)\n",
i, shdr[i].s_name,
shdr[i].s_vaddr,
shdr[i].s_vaddr + shdr[i].s_size,
shdr[i].s_scnptr);
}
}
if (start > system_start + system_size) {
fprintf(stderr, "Boot image too large\n");
exit(1);
}
if (pad) {
unsigned long count = (system_start + system_size) - start;
memset(buffer, 0, MAXBUF);
while (count > 0) {
int i = MAXBUF;
if (i > count)
i = count;
i = write(1, buffer, i);
if (i <= 0) {
perror("pad write");
exit(1);
}
count -= i;
}
}
return 0;
}
/*
* arch/alpha/boot/tools/objstrip.c
*
* Strip the object file headers/trailers from an executable (ELF or ECOFF).
*
* Copyright (C) 1996 David Mosberger-Tang.
*/
/*
* Converts an ECOFF or ELF object file into a bootable file. The
* object file must be a OMAGIC file (i.e., data and bss follow immediatly
* behind the text). See DEC "Assembly Language Programmer's Guide"
* documentation for details. The SRM boot process is documented in
* the Alpha AXP Architecture Reference Manual, Second Edition by
* Richard L. Sites and Richard T. Witek.
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <linux/a.out.h>
#include <linux/coff.h>
#include <linux/param.h>
#include <linux/string.h>
#ifdef __ELF__
# include <asm/elf.h>
# include <linux/elf.h>
#endif
/* bootfile size must be multiple of BLOCK_SIZE: */
#define BLOCK_SIZE 512
const char * prog_name;
void
usage (void)
{
fprintf(stderr,
"usage: %s [-v] -p file primary\n"
" %s [-vb] file [secondary]\n", prog_name, prog_name);
exit(1);
}
int
main (int argc, char *argv[])
{
size_t nwritten, tocopy, n, mem_size, fil_size, pad = 0;
int fd, ofd, i, j, verbose = 0, primary = 0;
char buf[8192], *inname;
struct exec * aout; /* includes file & aout header */
long offset;
#ifdef __ELF__
struct elfhdr *elf;
struct elf_phdr *elf_phdr; /* program header */
unsigned long long e_entry;
#endif
prog_name = argv[0];
for (i = 1; i < argc && argv[i][0] == '-'; ++i) {
for (j = 1; argv[i][j]; ++j) {
switch (argv[i][j]) {
case 'v':
verbose = ~verbose;
break;
case 'b':
pad = BLOCK_SIZE;
break;
case 'p':
primary = 1; /* make primary bootblock */
break;
}
}
}
if (i >= argc) {
usage();
}
inname = argv[i++];
fd = open(inname, O_RDONLY);
if (fd == -1) {
perror("open");
exit(1);
}
ofd = 1;
if (i < argc) {
ofd = open(argv[i++], O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (fd == -1) {
perror("open");
exit(1);
}
}
if (primary) {
/* generate bootblock for primary loader */
unsigned long bb[64], sum = 0;
struct stat st;
off_t size;
int i;
if (ofd == 1) {
usage();
}
if (fstat(fd, &st) == -1) {
perror("fstat");
exit(1);
}
size = (st.st_size + BLOCK_SIZE - 1) & ~(BLOCK_SIZE - 1);
memset(bb, 0, sizeof(bb));
strcpy((char *) bb, "Linux SRM bootblock");
bb[60] = size / BLOCK_SIZE; /* count */
bb[61] = 1; /* starting sector # */
bb[62] = 0; /* flags---must be 0 */
for (i = 0; i < 63; ++i) {
sum += bb[i];
}
bb[63] = sum;
if (write(ofd, bb, sizeof(bb)) != sizeof(bb)) {
perror("boot-block write");
exit(1);
}
printf("%lu\n", size);
return 0;
}
/* read and inspect exec header: */
if (read(fd, buf, sizeof(buf)) < 0) {
perror("read");
exit(1);
}
#ifdef __ELF__
elf = (struct elfhdr *) buf;
if (elf->e_ident[0] == 0x7f && strncmp(elf->e_ident + 1, "ELF", 3) == 0) {
if (elf->e_type != ET_EXEC) {
fprintf(stderr, "%s: %s is not an ELF executable\n",
prog_name, inname);
exit(1);
}
if (!elf_check_arch(elf->e_machine)) {
fprintf(stderr, "%s: is not for this processor (e_machine=%d)\n",
prog_name, elf->e_machine);
exit(1);
}
if (elf->e_phnum != 1) {
fprintf(stderr,
"%s: %d program headers (forgot to link with -N?)\n",
prog_name, elf->e_phnum);
}
e_entry = elf->e_entry;
lseek(fd, elf->e_phoff, SEEK_SET);
if (read(fd, buf, sizeof(*elf_phdr)) != sizeof(*elf_phdr)) {
perror("read");
exit(1);
}
elf_phdr = (struct elf_phdr *) buf;
offset = elf_phdr->p_offset;
mem_size = elf_phdr->p_memsz;
fil_size = elf_phdr->p_filesz;
/* work around ELF bug: */
if (elf_phdr->p_vaddr < e_entry) {
unsigned long delta = e_entry - elf_phdr->p_vaddr;
offset += delta;
mem_size -= delta;
fil_size -= delta;
elf_phdr->p_vaddr += delta;
}
if (verbose) {
fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n",
prog_name, (long) elf_phdr->p_vaddr,
elf_phdr->p_vaddr + fil_size, offset);
}
} else
#endif
{
aout = (struct exec *) buf;
if (!(aout->fh.f_flags & COFF_F_EXEC)) {
fprintf(stderr, "%s: %s is not in executable format\n",
prog_name, inname);
exit(1);
}
if (aout->fh.f_opthdr != sizeof(aout->ah)) {
fprintf(stderr, "%s: %s has unexpected optional header size\n",
prog_name, inname);
exit(1);
}
if (N_MAGIC(*aout) != OMAGIC) {
fprintf(stderr, "%s: %s is not an OMAGIC file\n",
prog_name, inname);
exit(1);
}
offset = N_TXTOFF(*aout);
fil_size = aout->ah.tsize + aout->ah.dsize;
mem_size = fil_size + aout->ah.bsize;
if (verbose) {
fprintf(stderr, "%s: extracting %#016lx-%#016lx (at %lx)\n",
prog_name, aout->ah.text_start,
aout->ah.text_start + fil_size, offset);
}
}
if (lseek(fd, offset, SEEK_SET) != offset) {
perror("lseek");
exit(1);
}
if (verbose) {
fprintf(stderr, "%s: copying %lu byte from %s\n",
prog_name, (unsigned long) fil_size, inname);
}
tocopy = fil_size;
while (tocopy > 0) {
n = tocopy;
if (n > sizeof(buf)) {
n = sizeof(buf);
}
tocopy -= n;
if ((size_t) read(fd, buf, n) != n) {
perror("read");
exit(1);
}
do {
nwritten = write(ofd, buf, n);
if ((ssize_t) nwritten == -1) {
perror("write");
exit(1);
}
n -= nwritten;
} while (n > 0);
}
if (pad) {
mem_size = ((mem_size + pad - 1) / pad) * pad;
}
tocopy = mem_size - fil_size;
if (tocopy > 0) {
fprintf(stderr,
"%s: zero-filling bss and aligning to %lu with %lu bytes\n",
prog_name, pad, (unsigned long) tocopy);
memset(buf, 0x00, sizeof(buf));
do {
n = tocopy;
if (n > sizeof(buf)) {
n = sizeof(buf);
}
nwritten = write(ofd, buf, n);
if ((ssize_t) nwritten == -1) {
perror("write");
exit(1);
}
tocopy -= nwritten;
} while (tocopy > 0);
}
return 0;
}
......@@ -68,7 +68,7 @@ then
define_bool CONFIG_ALPHA_EV5 y
define_bool CONFIG_ALPHA_CIA y
else
# EV5 and newer supports all rounding modes in hw:
# EV45 and older do not support all rounding modes in hw:
define_bool CONFIG_ALPHA_NEED_ROUNDING_EMULATION y
fi
......
......@@ -41,7 +41,7 @@ CONFIG_TGA_CONSOLE=y
CONFIG_NET=y
CONFIG_SYSVIPC=y
CONFIG_BINFMT_AOUT=y
# CONFIG_BINFMT_ELF is not set
CONFIG_BINFMT_ELF=y
#
# Floppy, IDE, and other block devices
......
......@@ -8,6 +8,8 @@
#include <linux/string.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/user.h>
#include <linux/elfcore.h>
#include <asm/io.h>
#include <asm/hwrpb.h>
......@@ -24,6 +26,10 @@ extern void __remlu (void);
extern void __divqu (void);
extern void __remqu (void);
extern void dump_thread(struct pt_regs *, struct user *);
extern int dump_fpu(struct pt_regs *, elf_fpregset_t *);
static struct symbol_table arch_symbol_table = {
#include <linux/symtab_begin.h>
/* platform dependent support */
......@@ -62,11 +68,16 @@ static struct symbol_table arch_symbol_table = {
X(strstr),
X(strtok),
X(strchr),
X(hwrpb),
X(memcmp),
X(memmove),
X(__memcpy),
X(__constant_c_memset),
X(dump_thread),
X(dump_fpu),
X(hwrpb),
X(wrusp),
/*
* The following are special because they're not called
* explicitly (the C compiler or assembler generates them in
......
......@@ -25,6 +25,7 @@
#include <linux/major.h>
#include <linux/stat.h>
#include <linux/mman.h>
#include <linux/elfcore.h>
#include <asm/reg.h>
#include <asm/segment.h>
......@@ -207,6 +208,14 @@ void dump_thread(struct pt_regs * pt, struct user * dump)
memcpy((char *)dump->regs + EF_SIZE, sw->fp, 32 * 8);
}
int dump_fpu (struct pt_regs * regs, elf_fpregset_t *r)
{
/* switch stack follows right below pt_regs: */
struct switch_stack * sw = ((struct switch_stack *) regs) - 1;
memcpy(r, sw->fp, 32 * 8);
return 1;
}
/*
* sys_execve() executes a new program.
*
......
......@@ -128,4 +128,8 @@ char * bcopy(const char * src, char * dest, size_t n)
* gcc-2.7.1 and newer generate calls to memset and memcpy. So we
* need to define that here:
*/
asm (".weakext memcpy, __memcpy");
#ifdef __ELF__
asm (".weak memcpy; memcpy = __memcpy");
#else
asm (".weakext memcpy, __memcpy");
#endif
......@@ -103,4 +103,8 @@ end:
ret $31,($26),1 /* E1 */
.end __memset
.weakext memset, __memset
#ifdef __ELF__
.weak memset; memset = __memset
#else
.weakext memset, __memset
#endif
......@@ -44,8 +44,9 @@ CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_IDE_PCMCIA is not set
CONFIG_BLK_DEV_CMD640=y
# CONFIG_BLK_DEV_TRITON is not set
# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
CONFIG_BLK_DEV_RZ1000=y
# CONFIG_BLK_DEV_TRITON is not set
# CONFIG_IDE_CHIPSETS is not set
#
......@@ -55,6 +56,7 @@ CONFIG_BLK_DEV_RZ1000=y
# CONFIG_BLK_DEV_MD is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_XD is not set
# CONFIG_BLK_DEV_HD is not set
#
# Networking options
......
......@@ -332,7 +332,7 @@ void copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
/*
* fill in the fpu structure for a core dump..
*/
int dump_fpu (struct user_i387_struct* fpu)
int dump_fpu (struct pt_regs * regs, struct user_i387_struct* fpu)
{
int fpvalid;
......@@ -377,7 +377,7 @@ void dump_thread(struct pt_regs * regs, struct user * dump)
dump->regs = *regs;
dump->u_fpvalid = dump_fpu (&dump->i387);
dump->u_fpvalid = dump_fpu (regs, &dump->i387);
}
asmlinkage int sys_fork(struct pt_regs regs)
......
......@@ -173,9 +173,13 @@ DO_ERROR( 9, SIGFPE, "coprocessor segment overrun", coprocessor_segment_overrun
DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS, current)
DO_ERROR(11, SIGBUS, "segment not present", segment_not_present, current)
DO_ERROR(12, SIGBUS, "stack segment", stack_segment, current)
DO_ERROR(15, SIGSEGV, "reserved", reserved, current)
DO_ERROR(17, SIGSEGV, "alignment check", alignment_check, current)
asmlinkage void do_reserved(struct pt_regs * regs, long error_code)
{
printk("Uhhuh.. Reserved trap code, whazzup? (%ld)\n", error_code);
}
asmlinkage void do_general_protection(struct pt_regs * regs, long error_code)
{
if (regs->eflags & VM_MASK) {
......
......@@ -15,6 +15,9 @@ else
bool ' Include IDE/ATAPI TAPE support' CONFIG_BLK_DEV_IDETAPE
bool ' Support removable IDE interfaces (PCMCIA)' CONFIG_BLK_DEV_IDE_PCMCIA
bool ' CMD640 chipset bugfix/support' CONFIG_BLK_DEV_CMD640
if [ "$CONFIG_BLK_DEV_CMD640" = "y" ]; then
bool ' CMD640 enhanced support' CONFIG_BLK_DEV_CMD640_ENHANCED
fi
if [ "$CONFIG_PCI" = "y" ]; then
bool ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000
bool ' Intel 82371 PIIX (Triton I/II) DMA support' CONFIG_BLK_DEV_TRITON
......
......@@ -51,20 +51,6 @@
#include "ide.h"
#include "ide_modes.h"
/*
* This should be set to the system's local bus (PCI or VLB) speed,
* e.g., 33 for a 486DX33 or 486DX2/66. Legal values are anything
* from 25 to 50. Setting this too *low* will make the EIDE
* controller unable to communicate with the disks.
*
* The value is 50 by default -- this should work ok with any system.
* (Low values cause problems because it multiplies by bus speed
* to get cycles, and thus gets a too-small cycle count and tries to
* access the disks too fast. I tried this once under DOS and it locked
* up the system.) -- derekn@vw.ece.cmu.edu
*/
#define ALI_14xx_BUS_SPEED 50 /* PCI / VLB bus speed */
/* port addresses for auto-detection */
#define ALI_NUM_PORTS 4
static int ports[ALI_NUM_PORTS] = {0x074, 0x0f4, 0x034, 0x0e4};
......@@ -82,15 +68,7 @@ static RegInitializer initData[] = {
{0x35, 0x03}, {0x00, 0x00}
};
/* default timing parameters for each PIO mode */
#define ALI_MAX_PIO 4
static struct { int time1, time2; } timeTab[ALI_MAX_PIO+1] = {
{600, 165}, /* PIO 0 */
{383, 125}, /* PIO 1 */
{240, 100}, /* PIO 2 */
{180, 80}, /* PIO 3 */
{120, 70} /* PIO 4 */
};
/* timing parameter registers for each drive */
static struct { byte reg1, reg2, reg3, reg4; } regTab[4] = {
......@@ -134,26 +112,19 @@ static void outReg (byte data, byte reg)
static void ali14xx_tune_drive (ide_drive_t *drive, byte pio)
{
int driveNum;
int time1, time2, time1a;
int time1, time2;
byte param1, param2, param3, param4;
struct hd_driveid *id = drive->id;
unsigned long flags;
ide_pio_data_t d;
int bus_speed = ide_system_bus_speed();
if (pio == 255)
pio = ide_get_best_pio_mode(drive);
if (pio > ALI_MAX_PIO)
pio = ALI_MAX_PIO;
pio = ide_get_best_pio_mode(drive, pio, ALI_MAX_PIO, &d);
/* calculate timing, according to PIO mode */
time1 = timeTab[pio].time1;
time2 = timeTab[pio].time2;
if (pio >= 3) {
time1a = (id->capability & 0x08) ? id->eide_pio_iordy : id->eide_pio;
if (time1a != 0 && time1a < time1)
time1 = time1a;
}
param3 = param1 = (time2 * ALI_14xx_BUS_SPEED + 999) / 1000;
param4 = param2 = (time1 * ALI_14xx_BUS_SPEED + 999) / 1000 - param1;
time1 = d.cycle_time;
time2 = ide_pio_timings[pio].active_time;
param3 = param1 = (time2 * bus_speed + 999) / 1000;
param4 = param2 = (time1 * bus_speed + 999) / 1000 - param1;
if (pio < 3) {
param3 += 8;
param4 += 8;
......
This diff is collapsed.
......@@ -71,8 +71,7 @@ static void tune_dtc2278 (ide_drive_t *drive, byte pio)
{
unsigned long flags;
if (pio == 255)
pio = ide_get_best_pio_mode(drive);
pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
if (pio >= 3) {
save_flags(flags);
......@@ -122,6 +121,8 @@ void init_dtc2278 (void)
ide_hwifs[0].chipset = ide_dtc2278;
ide_hwifs[1].chipset = ide_dtc2278;
ide_hwifs[0].tuneproc = &tune_dtc2278;
ide_hwifs[0].no_unmask = 1;
ide_hwifs[1].no_unmask = 1;
ide_hwifs[0].drives[0].no_unmask = 1;
ide_hwifs[0].drives[1].no_unmask = 1;
ide_hwifs[1].drives[0].no_unmask = 1;
ide_hwifs[1].drives[1].no_unmask = 1;
}
......@@ -1231,7 +1231,6 @@ static void fdc_specify(void)
/*DPRINT("FIFO enabled\n");*/
}
#ifndef __sparc__
switch (raw_cmd->rate & 0x03) {
case 3:
dtr = 1000;
......@@ -1286,7 +1285,6 @@ static void fdc_specify(void)
output_byte(FDCS->spec1 = spec1);
output_byte(FDCS->spec2 = spec2);
}
#endif
} /* fdc_specify */
/* Set the FDC's data transfer rate on behalf of the specified drive.
......
......@@ -201,10 +201,8 @@ static void tune_ht6560b (ide_drive_t *drive, byte pio)
if (drive->media != ide_disk)
pio = 0; /* some cdroms don't like fast modes (?) */
else
pio = ide_get_best_pio_mode (drive);
pio = ide_get_best_pio_mode(drive, pio, 5, NULL);
}
if (pio > 5)
pio = 5;
unit = drive->select.b.unit;
hwif = HWIF(drive)->index;
ht6560b_timings[hwif][unit] = pio_to_timings[pio];
......
......@@ -105,6 +105,7 @@
* special help from Jeff Lightfoot
* <jeffml@netcom.com>
* 3.15a July 9, 1996 -- Improved Sanyo 3 CD changer identification
* 3.16 Jul 28, 1996 -- Fix from Gadi to reduce kernel stack usage for ioctl.
*
* 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.
......@@ -2308,7 +2309,7 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode,
int stat, lba;
struct atapi_toc *toc;
struct cdrom_read_audio ra;
char buf[CD_FRAMESIZE_RAW];
char *buf;
/* Make sure the TOC is up to date. */
stat = cdrom_read_toc (drive, NULL);
......@@ -2342,17 +2343,23 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode,
if (lba < 0 || lba >= toc->capacity)
return -EINVAL;
buf = (char *) kmalloc (CD_FRAMESIZE_RAW, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
while (ra.nframes > 0) {
stat = cdrom_read_block (drive, 1, lba, buf,
CD_FRAMESIZE_RAW, NULL);
if (stat) return stat;
if (stat) break;
memcpy_tofs (ra.buf, buf, CD_FRAMESIZE_RAW);
ra.buf += CD_FRAMESIZE_RAW;
--ra.nframes;
++lba;
}
return 0;
kfree (buf);
return stat;
}
case CDROMREADMODE1:
......@@ -2360,7 +2367,7 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode,
struct cdrom_msf msf;
int blocksize, format, stat, lba;
struct atapi_toc *toc;
char buf[CD_FRAMESIZE_RAW0];
char *buf;
if (cmd == CDROMREADMODE1) {
blocksize = CD_FRAMESIZE;
......@@ -2388,12 +2395,17 @@ int ide_cdrom_ioctl (ide_drive_t *drive, struct inode *inode,
if (lba < 0 || lba >= toc->capacity)
return -EINVAL;
buf = (char *) kmalloc (CD_FRAMESIZE_RAW0, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
stat = cdrom_read_block (drive, format, lba, buf, blocksize,
NULL);
if (stat) return stat;
if (stat == 0)
memcpy_tofs ((char *)arg, buf, blocksize);
memcpy_tofs ((char *)arg, buf, blocksize);
return 0;
kfree (buf);
return stat;
}
case CDROM_GET_UPC: {
......
This diff is collapsed.
......@@ -41,6 +41,13 @@
#define FANCY_STATUS_DUMPS 1 /* 0 to reduce kernel size */
#endif
#ifdef CONFIG_BLK_DEV_CMD640
#if 1
void cmd640_dump_regs (void);
#define CMD640_DUMP_REGS cmd640_dump_regs() /* for debugging cmd640 chipset */
#endif
#endif /* CONFIG_BLK_DEV_CMD640 */
#if defined(CONFIG_BLK_DEV_IDECD) || defined(CONFIG_BLK_DEV_IDETAPE)
#define CONFIG_BLK_DEV_IDEATAPI 1
#endif
......@@ -291,7 +298,7 @@ typedef union {
unsigned set_geometry : 1; /* respecify drive geometry */
unsigned recalibrate : 1; /* seek to cyl 0 */
unsigned set_multmode : 1; /* set multmode count */
unsigned set_pio : 1; /* set pio mode */
unsigned set_tune : 1; /* tune interface for drive */
unsigned reserved : 4; /* unused */
} b;
} special_t;
......@@ -317,6 +324,8 @@ typedef struct ide_drive_s {
unsigned using_dma : 1; /* disk is using dma for read/write */
unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */
unsigned unmask : 1; /* flag: okay to unmask other irqs */
unsigned no_unmask : 1; /* disallow setting unmask bit */
unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */
unsigned nobios : 1; /* flag: do not probe bios for drive */
unsigned autotune : 2; /* 1=autotune, 2=noautotune, 0=default */
#if FAKE_FDISK_FOR_EZDRIVE
......@@ -328,7 +337,7 @@ typedef struct ide_drive_s {
byte ready_stat; /* min status value for drive ready */
byte mult_count; /* current multiple sector setting */
byte mult_req; /* requested multiple sector setting */
byte pio_req; /* requested drive pio setting */
byte tune_req; /* requested drive tuning setting */
byte io_32bit; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */
byte bad_wstat; /* used for ignoring WRERR_STAT */
byte sect0; /* offset of first sector for DM6:DDO */
......@@ -422,7 +431,6 @@ typedef struct hwif_s {
unsigned noprobe : 1; /* don't probe for this interface */
unsigned present : 1; /* this interface exists */
unsigned serialized : 1; /* serialized operation with mate hwif */
unsigned no_unmask : 1; /* disallow setting unmask bits */
unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */
#ifdef CONFIG_BLK_DEV_PROMISE
unsigned is_promise2: 1; /* 2nd i/f on promise DC4030 */
......@@ -461,11 +469,10 @@ typedef struct hwgroup_s {
* should be using pointers to a drive (ide_drive_t *) or
* pointers to a hwif (ide_hwif_t *), rather than indexing this
* structure directly (the allocation/layout may change!).
*
*/
#ifdef _IDE_C
ide_hwif_t ide_hwifs[MAX_HWIFS]; /* master data repository */
#else
extern ide_hwif_t ide_hwifs[];
#ifndef _IDE_C
extern ide_hwif_t ide_hwifs[]; /* master data repository */
#endif
/*
......@@ -598,6 +605,14 @@ int ide_do_drive_cmd (ide_drive_t *drive, struct request *rq, ide_action_t actio
*/
void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err);
/*
* ide_system_bus_speed() returns what we think is the system VESA/PCI
* bus speed (in Mhz). This is used for calculating interface PIO timings.
* The default is 40 for known PCI systems, 50 otherwise.
* The "idebus=xx" parameter can be used to override this value.
*/
int ide_system_bus_speed (void);
/*
* ide_multwrite() transfers a block of up to mcount sectors of data
* to a drive as part of a disk multwrite operation.
......
......@@ -15,13 +15,43 @@
#if defined(CONFIG_BLK_DEV_CMD640) || defined(CONFIG_IDE_CHIPSETS)
/*
* Standard (generic) timings for PIO modes, from ATA2 specification.
* These timings are for access to the IDE data port register *only*.
* Some drives may specify a mode, while also specifying a different
* value for cycle_time (from drive identification data).
*/
typedef struct ide_pio_timings_s {
int setup_time; /* Address setup (ns) minimum */
int active_time; /* Active pulse (ns) minimum */
int cycle_time; /* Cycle time (ns) minimum = (setup + active + recovery) */
} ide_pio_timings_t;
typedef struct ide_pio_data_s {
byte pio_mode;
byte use_iordy;
byte overridden;
byte blacklisted;
unsigned int cycle_time;
} ide_pio_data_t;
#ifndef _IDE_C
int ide_scan_pio_blacklist (char *model);
unsigned int ide_get_best_pio_mode (ide_drive_t *drive);
byte ide_get_best_pio_mode (ide_drive_t *drive, byte mode_wanted, byte max_mode, ide_pio_data_t *d);
extern const ide_pio_timings_t ide_pio_timings[6];
#else /* _IDE_C */
const ide_pio_timings_t ide_pio_timings[6] = {
{ 70, 165, 600 }, /* PIO Mode 0 */
{ 50, 125, 383 }, /* PIO Mode 1 */
{ 30, 100, 240 }, /* PIO Mode 2 */
{ 30, 80, 180 }, /* PIO Mode 3 with IORDY */
{ 25, 70, 120 }, /* PIO Mode 4 with IORDY */
{ 20, 50, 100 } /* PIO Mode 5 with IORDY (nonstandard) */
};
/*
* Black list. Some drives incorrectly report their maximal PIO mode,
* at least in respect to CMD640. Here we keep info on some known drives.
......@@ -31,6 +61,7 @@ static struct ide_pio_info {
int pio;
} ide_pio_blacklist [] = {
/* { "Conner Peripherals 1275MB - CFS1275A", 4 }, */
{ "Conner Peripherals 540MB - CFS540A", 3 },
{ "WDC AC2700", 3 },
{ "WDC AC2540", 3 },
......@@ -38,6 +69,7 @@ static struct ide_pio_info {
{ "WDC AC2340", 3 },
{ "WDC AC2250", 0 },
{ "WDC AC2200", 0 },
{ "WDC AC21200", 4 },
{ "WDC AC2120", 0 },
{ "WDC AC2850", 3 },
{ "WDC AC1270", 3 },
......@@ -46,7 +78,6 @@ static struct ide_pio_info {
{ "WDC AC280", 0 },
/* { "WDC AC21000", 4 }, */
{ "WDC AC31000", 3 },
/* { "WDC AC21200", 4 }, */
{ "WDC AC31200", 3 },
/* { "WDC AC31600", 4 }, */
......@@ -112,31 +143,80 @@ int ide_scan_pio_blacklist (char *model)
}
/*
* This routine returns the recommended PIO mode for a given drive,
* This routine returns the recommended PIO settings for a given drive,
* based on the drive->id information and the ide_pio_blacklist[].
* This is used by most chipset support modules when "auto-tuning".
*/
unsigned int ide_get_best_pio_mode (ide_drive_t *drive)
/*
* Drive PIO mode auto selection
*/
byte ide_get_best_pio_mode (ide_drive_t *drive, byte mode_wanted, byte max_mode, ide_pio_data_t *d)
{
unsigned int pio = 0;
struct hd_driveid *id = drive->id;
if (id != NULL) {
if (HWIF(drive)->chipset != ide_cmd640 && !strcmp("QUANTUM FIREBALL1080A", id->model))
pio = 4;
else
pio = ide_scan_pio_blacklist(id->model);
if (pio == -1) {
pio = (id->tPIO < 2) ? id->tPIO : 2;
if (id->field_valid & 2) {
byte modes = id->eide_pio_modes;
if (modes & 4) pio = 5;
else if (modes & 2) pio = 4;
else if (modes & 1) pio = 3;
int pio_mode;
int cycle_time = 0;
int use_iordy = 0;
struct hd_driveid* id = drive->id;
int overridden = 0;
int blacklisted = 0;
if (mode_wanted != 255) {
pio_mode = mode_wanted;
} else if (!drive->id) {
pio_mode = 0;
} else if ((pio_mode = ide_scan_pio_blacklist(id->model)) != -1) {
overridden = 1;
blacklisted = 1;
use_iordy = (pio_mode > 2);
} else {
pio_mode = id->tPIO;
if (pio_mode > 2) { /* 2 is maximum allowed tPIO value */
pio_mode = 2;
overridden = 1;
}
if (id->field_valid & 2) { /* drive implements ATA2? */
if (id->capability & 8) { /* drive supports use_iordy? */
use_iordy = 1;
cycle_time = id->eide_pio_iordy;
if (id->eide_pio_modes & 7) {
overridden = 0;
if (id->eide_pio_modes & 4)
pio_mode = 5;
else if (id->eide_pio_modes & 2)
pio_mode = 4;
else
pio_mode = 3;
}
} else {
cycle_time = id->eide_pio;
}
}
/*
* Conservative "downgrade" for all pre-ATA2 drives
*/
if (pio_mode && pio_mode < 4) {
pio_mode--;
overridden = 1;
#if 0
use_iordy = (pio_mode > 2);
#endif
if (cycle_time && cycle_time < ide_pio_timings[pio_mode].cycle_time)
cycle_time = 0; /* use standard timing */
}
}
if (pio_mode > max_mode) {
pio_mode = max_mode;
cycle_time = 0;
}
if (d) {
d->pio_mode = pio_mode;
d->cycle_time = cycle_time ? cycle_time : ide_pio_timings[pio_mode].cycle_time;
d->use_iordy = use_iordy;
d->overridden = overridden;
d->blacklisted = blacklisted;
}
return pio;
return pio_mode;
}
#endif /* _IDE_C */
......
......@@ -47,10 +47,7 @@ static void tune_qd6580 (ide_drive_t *drive, byte pio)
{
unsigned long flags;
if (pio == 255)
pio = ide_get_best_pio_mode (drive);
if (pio > 3)
pio = 3;
pio = ide_get_best_pio_mode(drive, pio, 3, NULL);
save_flags(flags);
cli();
......
......@@ -45,8 +45,10 @@ void init_rz1000 (byte bus, byte fn)
if ((rc = pcibios_read_config_word(bus, fn, 0x40, &reg))
|| (rc = pcibios_write_config_word(bus, fn, 0x40, reg & 0xdfff)))
{
ide_hwifs[0].no_unmask = 1;
ide_hwifs[1].no_unmask = 1;
ide_hwifs[0].drives[0].no_unmask = 1;
ide_hwifs[0].drives[1].no_unmask = 1;
ide_hwifs[1].drives[0].no_unmask = 1;
ide_hwifs[1].drives[1].no_unmask = 1;
ide_hwifs[0].serialized = 1;
ide_hwifs[1].serialized = 1;
ide_pci_access_error (rc);
......
/*
* linux/drivers/block/umc8672.c Version 0.04 May 09, 1996
* linux/drivers/block/umc8672.c Version 0.05 Jul 31, 1996
*
* Copyright (C) 1995-1996 Linus Torvalds & author (see below)
*/
......@@ -16,6 +16,8 @@
*
* Version 0.02 now configs/compiles separate from ide.c -ml
* Version 0.03 enhanced auto-tune, fix display bug
* Version 0.05 replace sti() with restore_flags() -ml
* add detection of possible race condition -ml
*/
/*
......@@ -81,10 +83,7 @@ static byte in_umc (char port)
static void umc_set_speeds (byte speeds[])
{
int i, tmp;
unsigned long flags;
save_flags(flags);
cli ();
outb_p (0x5A,0x108); /* enable umc */
out_umc (0xd7,(speedtab[0][speeds[2]] | (speedtab[0][speeds[3]]<<4)));
......@@ -101,7 +100,6 @@ static void umc_set_speeds (byte speeds[])
out_umc (0xd8+i,speedtab[2][speeds[i]]);
}
outb_p (0xa5,0x108); /* disable umc */
restore_flags(flags);
printk ("umc8672: drive speeds [0 to 11]: %d %d %d %d\n",
speeds[0], speeds[1], speeds[2], speeds[3]);
......@@ -109,36 +107,44 @@ static void umc_set_speeds (byte speeds[])
static void tune_umc (ide_drive_t *drive, byte pio)
{
if (pio == 255)
pio = ide_get_best_pio_mode(drive);
if (pio > 4)
pio = 4;
unsigned long flags;
ide_hwgroup_t *hwgroup = ide_hwifs[HWIF(drive)->index^1].hwgroup;
current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio];
umc_set_speeds (current_speeds);
pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", drive->name, pio, pio_to_umc[pio]);
save_flags(flags);
cli();
if (hwgroup && hwgroup->handler != NULL) {
printk("umc8672: other interface is busy: exiting tune_umc()\n");
} else {
current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio];
umc_set_speeds (current_speeds);
}
restore_flags(flags);
}
void init_umc8672 (void) /* called from ide.c */
{
unsigned long flags;
save_flags(flags);
cli ();
if (check_region(0x108, 2)) {
restore_flags(flags);
printk("\numc8672: PORTS 0x108-0x109 ALREADY IN USE\n");
return;
}
save_flags(flags);
cli ();
outb_p (0x5A,0x108); /* enable umc */
if (in_umc (0xd5) != 0xa0)
{
sti ();
restore_flags(flags);
printk ("umc8672: not found\n");
return;
}
outb_p (0xa5,0x108); /* disable umc */
restore_flags(flags);
umc_set_speeds (current_speeds);
restore_flags(flags);
request_region(0x108, 2, "umc8672");
ide_hwifs[0].chipset = ide_umc8672;
......
......@@ -66,6 +66,7 @@ if [ "$CONFIG_WATCHDOG" != "n" ]; then
else
tristate ' Software Watchdog' CONFIG_SOFT_WATCHDOG
fi
tristate ' Berkshire Products PC Watchdog' CONFIG_PCWATCHDOG
fi
bool 'Enhanced Real Time Clock Support' CONFIG_RTC
endmenu
......@@ -40,6 +40,10 @@ endif
ifeq ($(CONFIG_DIGI),y)
L_OBJS += pcxx.o
else
ifeq ($(CONFIG_DIGI),m)
M_OBJS += pcxx.o
endif
endif
ifeq ($(CONFIG_CYCLADES),y)
......@@ -190,6 +194,16 @@ else
endif
endif
ifeq ($(CONFIG_PCWATCHDOG),y)
M = y
L_OBJS += pcwd.o
else
ifeq ($(CONFIG_PCWATCHDOG),m)
M_OBJS += pcwd.o
MM = m
endif
endif
ifeq ($(CONFIG_BAYCOM),y)
L_OBJS += baycom.o
else
......
static char rcsid[] =
"$Revision: 1.36.3.7 $$Date: 1996/04/19 21:06:18 $";
"$Revision: 1.36.3.7A $$Date: 1996/07/27 10:25:50 $";
/*
* linux/drivers/char/cyclades.c
*
......@@ -2250,6 +2250,13 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
(unsigned long *) arg);
break;
case TIOCSSOFTCAR:
error = verify_area(VERIFY_READ, (void *) arg
,sizeof(unsigned long *));
if (error) {
ret_val = error;
break;
}
arg = get_fs_long((unsigned long *) arg);
tty->termios->c_cflag =
((tty->termios->c_cflag & ~CLOCAL) |
......@@ -2275,6 +2282,12 @@ cy_ioctl(struct tty_struct *tty, struct file * file,
(struct serial_struct *) arg);
break;
case TIOCSSERIAL:
error = verify_area(VERIFY_READ, (void *) arg
,sizeof(struct serial_struct));
if (error){
ret_val = error;
break;
}
ret_val = set_serial_info(info,
(struct serial_struct *) arg);
break;
......@@ -2646,6 +2659,8 @@ cy_open(struct tty_struct *tty, struct file * filp)
return retval;
}
MOD_INC_USE_COUNT;
retval = block_til_ready(tty, filp, info);
if (retval) {
#ifdef SERIAL_DEBUG_OPEN
......@@ -2661,7 +2676,6 @@ cy_open(struct tty_struct *tty, struct file * filp)
#ifdef SERIAL_DEBUG_OPEN
printk("cy_open done\n");/**/
#endif
MOD_INC_USE_COUNT;
return 0;
} /* cy_open */
......
......@@ -401,6 +401,9 @@ int chr_dev_init(void)
#if CONFIG_QIC02_TAPE
qic02_tape_init();
#endif
#ifdef CONFIG_PCWATCHDOG
pcwatchdog_init();
#endif
#if CONFIG_ISDN
isdn_init();
#endif
......
/*
* PC Watchdog Driver
* by Ken Hollis (khollis@bitgate.com)
*
* Permission granted from Simon Machell (73244.1270@compuserve.com)
* Written for the Linux Kernel, and GPLed by Ken Hollis
*
* 960107 Added request_region routines, modulized the whole thing.
* 960108 Fixed end-of-file pointer (Thanks to Dan Hollis), added
* WD_TIMEOUT define.
* 960216 Added eof marker on the file, and changed verbose messages.
* 960716 Made functional and cosmetic changes to the source for
* inclusion in Linux 2.0.x kernels, thanks to Alan Cox.
* 960717 Removed read/seek routines, replaced with ioctl. Also, added
* check_region command due to Alan's suggestion.
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/timer.h>
#include <linux/kernel.h>
#include <linux/wait.h>
#include <linux/string.h>
#include <linux/malloc.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/miscdevice.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/pcwd.h>
#include <asm/io.h>
#define WD_VER "0.41 (07/17/96)"
#define WD_MINOR 130 /* Minor device number */
#define WD_TIMEOUT 3 /* 1 1/2 seconds for a timeout */
#define WD_TIMERRESET_PORT1 0x270 /* Reset port - first choice */
#define WD_TIMERRESET_PORT2 0x370 /* Reset port - second choice */
#define WD_CTLSTAT_PORT1 0x271 /* Control port - first choice */
#define WD_CTLSTAT_PORT2 0x371 /* Control port - second choice */
#define WD_PORT_EXTENT 2 /* Takes up two addresses */
#define WD_WDRST 0x01 /* Previously reset state */
#define WD_T110 0x02 /* Temperature overheat sense */
#define WD_HRTBT 0x04 /* Heartbeat sense */
#define WD_RLY2 0x08 /* External relay triggered */
#define WD_SRLY2 0x80 /* Software external relay triggered */
static int current_ctlport, current_readport;
static int is_open, is_eof;
int pcwd_checkcard(void)
{
int card_dat, prev_card_dat, found = 0, count = 0, done = 0;
/* As suggested by Alan Cox */
if (check_region(current_ctlport, WD_PORT_EXTENT)) {
printk("pcwd: Port 0x%x unavailable.\n", current_ctlport);
return 0;
}
card_dat = 0x00;
prev_card_dat = 0x00;
prev_card_dat = inb(current_readport);
while(count < WD_TIMEOUT) {
#ifdef DEBUG
printk("pcwd: Run #%d on port 0x%03x\n", count, current_readport);
#endif
/* Read the raw card data from the port, and strip off the
first 4 bits */
card_dat = inb_p(current_readport);
card_dat &= 0x000F;
/* Sleep 1/2 second (or 500000 microseconds :) */
udelay(500000L);
done = 0;
/* 0x0F usually means that no card data is present, or the card
is not installed on this port. If 0x0F is present here, it's
normally safe to assume there's no card at that base address. */
if (card_dat == 0x0F) {
count++;
done = 1;
#ifdef DEBUG
printk("pcwd: I show nothing on this port.\n");
#endif
}
/* If there's a heart beat in both instances, then this means we
found our card. This also means that either the card was
previously reset, or the computer was power-cycled. */
if ((card_dat & WD_HRTBT) && (prev_card_dat & WD_HRTBT) &&
(!done)) {
found = 1;
done = 1;
#ifdef DEBUG
printk("pcwd: I show alternate heart beats. Card detected.\n");
#endif
break;
}
/* If the card data is exactly the same as the previous card data,
it's safe to assume that we should check again. The manual says
that the heart beat will change every second (or the bit will
toggle), and this can be used to see if the card is there. If
the card was powered up with a cold boot, then the card will
not start blinking until 2.5 minutes after a reboot, so this
bit will stay at 1. */
if ((card_dat == prev_card_dat) && (!done)) {
count++;
#ifdef DEBUG
printk("pcwd: The card data is exactly the same (possibility).\n");
#endif
done = 1;
}
/* If the card data is toggling any bits, this means that the heart
beat was detected, or something else about the card is set. */
if ((card_dat != prev_card_dat) && (!done)) {
done = 1;
found = 1;
#ifdef DEBUG
printk("pcwd: I show alternate heart beats. Card detected.\n");
#endif
break;
}
/* Otherwise something else strange happened. */
if (!done)
count++;
}
return((found) ? 1 : 0);
}
void pcwd_showprevstate(void)
{
int card_status = 0x0000;
card_status = inb(current_readport);
if (card_status & WD_WDRST)
printk("pcwd: Previous reboot was caused by the card.\n");
if (card_status & WD_T110)
printk("pcwd: CPU overheat sense\n");
}
static int pcwd_return_data(void)
{
return(inb(current_readport));
}
static int pcwd_write(struct inode *inode, struct file *file, const char *data,
int len)
{
int wdrst_stat;
if (!is_open)
return -EIO;
#ifdef DEBUG
printk("pcwd: write request\n");
#endif
wdrst_stat = inb_p(current_readport);
wdrst_stat &= 0x0F;
wdrst_stat |= WD_WDRST;
outb_p(wdrst_stat, current_ctlport);
return(1);
}
static int pcwd_ioctl(struct tty_struct *tty, struct file *file,
unsigned int cmd, unsigned long arg)
{
int i, cdat, rv;
switch(cmd) {
default:
return -ENOIOCTLCMD;
case PCWD_GETSTAT:
i = verify_area(VERIFY_WRITE, (void*) arg, sizeof(int));
if (i)
return i;
else {
cdat = pcwd_return_data();
rv = 0;
if (cdat & WD_WDRST)
rv |= 0x01;
if (cdat & WD_T110)
rv |= 0x02;
put_user(rv, (int *) arg);
return 0;
}
break;
case PCWD_PING:
pcwd_write(NULL, NULL, NULL, 1); /* Is this legal? */
break;
}
return 0;
}
static int pcwd_open(struct inode *ino, struct file *filep)
{
#ifdef DEBUG
printk("pcwd: open request\n");
#endif
MOD_INC_USE_COUNT;
is_eof = 0;
return(0);
}
static void pcwd_close(struct inode *ino, struct file *filep)
{
#ifdef DEBUG
printk("pcwd: close request\n");
#endif
MOD_DEC_USE_COUNT;
}
struct file_operations pcwd_fops = {
NULL, /* Seek */
NULL, /* Read */
pcwd_write, /* Write */
NULL, /* Readdir */
NULL, /* Select */
pcwd_ioctl, /* IOctl */
NULL, /* MMAP */
pcwd_open, /* Open */
pcwd_close, /* Close */
NULL
};
static struct miscdevice pcwd_miscdev = {
WD_MINOR,
"pcwatchdog",
&pcwd_fops
};
#ifdef MODULE
int init_module(void)
#else
int pcwatchdog_init(void)
#endif
{
#ifdef DEBUG
printk("pcwd: Success.\n");
#endif
printk("pcwd: v%s Ken Hollis (khollis@bitgate.com)\n", WD_VER);
#ifdef DEBUG
printk("pcwd: About to perform card autosense loop.\n");
#endif
is_eof = 0;
is_open = 0;
current_ctlport = WD_TIMERRESET_PORT1;
current_readport = WD_CTLSTAT_PORT1;
if (!pcwd_checkcard()) {
#ifdef DEBUG
printk("pcwd: Trying port 0x370.\n");
#endif
current_ctlport = WD_TIMERRESET_PORT2;
current_readport = WD_CTLSTAT_PORT2;
if (!pcwd_checkcard()) {
printk("pcwd: No card detected.\n");
return(-EIO);
} else
printk("pcwd: Port available at 0x370.\n");
} else
printk("pcwd: Port available at 0x270.\n");
pcwd_showprevstate();
#ifdef DEBUG
printk("pcwd: Requesting region entry\n");
#endif
request_region(current_ctlport, WD_PORT_EXTENT, "PCWD (Berkshire)");
#ifdef DEBUG
printk("pcwd: character device creation.\n");
#endif
misc_register(&pcwd_miscdev);
return 0;
}
#ifdef MODULE
void cleanup_module(void)
{
misc_deregister(&pcwd_miscdev);
release_region(current_ctlport, 2);
#ifdef DEBUG
printk("pcwd: Cleanup successful.\n");
#endif
}
#endif
This diff is collapsed.
......@@ -297,6 +297,7 @@ void pcbit_fsm_event(struct pcbit_dev *dev, struct pcbit_chan *chan,
printk(KERN_DEBUG "fsm error: event %x on state %x\n",
event, chan->fsm_state);
restore_flags(flags);
return;
}
......
......@@ -491,7 +491,6 @@ static int send_pcb(struct device *dev, pcb_struct * pcb)
return TRUE;
break;
case ASF_PCB_NAK:
cli();
printk("%s: send_pcb got NAK\n", dev->name);
goto abort;
break;
......
......@@ -430,7 +430,7 @@ el3_start_xmit(struct sk_buff *skb, struct device *dev)
/* Transmitter timeout, serious problems. */
if (dev->tbusy) {
int tickssofar = jiffies - dev->trans_start;
if (tickssofar < 40)
if (tickssofar < 40*HZ/100)
return 1;
printk("%s: transmit timed out, Tx_status %2.2x status %4.4x "
"Tx FIFO room %d.\n",
......
......@@ -1002,6 +1002,7 @@ int aha1542_detect(Scsi_Host_Template * tpnt)
cli();
if (request_irq(irq_level,aha1542_intr_handle, 0, "aha1542", NULL)) {
printk("Unable to allocate IRQ for adaptec controller.\n");
restore_flags(flags);
goto unregister;
}
......@@ -1009,6 +1010,7 @@ int aha1542_detect(Scsi_Host_Template * tpnt)
if (request_dma(dma_chan,"aha1542")) {
printk("Unable to allocate DMA channel for Adaptec.\n");
free_irq(irq_level, NULL);
restore_flags(flags);
goto unregister;
}
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
* mike@i-Connect.Net *
* neuffer@mail.uni-mainz.de *
*********************************************************
* last change: 96/05/05 *
* last change: 96/06/26 *
********************************************************/
#ifndef _EATA_DMA_H
......@@ -17,7 +17,7 @@
#define VER_MAJOR 2
#define VER_MINOR 5
#define VER_SUB "8d"
#define VER_SUB "8g"
/************************************************************************
......@@ -25,7 +25,12 @@
************************************************************************/
#define CHECKPAL 0 /* EISA pal checking on/off */
#define NEWSTUFF 0 /* Some changes for ISA/EISA boards */
#define CHECK_BLINK 1 /* Switch Blink state check off, might *
* be nessessary for some MIPS machines*/
#define CRIPPLE_QUEUE 0 /* Only enable this if the interrupt
* controller on your motherboard is
* broken and you are experiencing
* massive interrupt losses */
/************************************************************************
* Debug options. *
......
......@@ -295,63 +295,66 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
}
if (pos > offset + length)
goto stop_output;
cmnd[0] = LOG_SENSE;
cmnd[1] = 0;
cmnd[2] = 0x32 + (3<<6);
cmnd[3] = 0;
cmnd[4] = 0;
cmnd[5] = 0;
cmnd[6] = 0;
cmnd[7] = 0x01;
cmnd[8] = 0x44;
cmnd[9] = 0;
scmd.cmd_len = 10;
/*
* Do the command and wait for it to finish.
*/
{
struct semaphore sem = MUTEX_LOCKED;
scmd.request.rq_status = RQ_SCSI_BUSY;
scmd.request.sem = &sem;
scsi_do_cmd (&scmd, cmnd, buff2, 0x144,
eata_scsi_done, 1 * HZ, 1);
down(&sem);
}
if(SD(HBA_ptr)->do_latency == FALSE) {
swap_statistics(buff2);
rhcs = (hst_cmd_stat *)(buff2 + 0x2c);
whcs = (hst_cmd_stat *)(buff2 + 0x8c);
for (x = 0; x <= 11; x++) {
SD(HBA_ptr)->reads[x] += rhcs->sizes[x];
SD(HBA_ptr)->writes[x] += whcs->sizes[x];
SD(HBA_ptr)->reads[12] += rhcs->sizes[x];
SD(HBA_ptr)->writes[12] += whcs->sizes[x];
}
size = sprintf(buffer + len, "Host<->Disk command statistics:\n"
" Reads: Writes:\n");
len += size;
pos = begin + len;
for (x = 0; x <= 10; x++) {
size = sprintf(buffer+len,"%5dk:%12u %12u\n", 1 << x,
SD(HBA_ptr)->reads[x],
SD(HBA_ptr)->writes[x]);
cmnd[0] = LOG_SENSE;
cmnd[1] = 0;
cmnd[2] = 0x32 + (3<<6);
cmnd[3] = 0;
cmnd[4] = 0;
cmnd[5] = 0;
cmnd[6] = 0;
cmnd[7] = 0x01;
cmnd[8] = 0x44;
cmnd[9] = 0;
scmd.cmd_len = 10;
/*
* Do the command and wait for it to finish.
*/
{
struct semaphore sem = MUTEX_LOCKED;
scmd.request.rq_status = RQ_SCSI_BUSY;
scmd.request.sem = &sem;
scsi_do_cmd (&scmd, cmnd, buff2, 0x144,
eata_scsi_done, 1 * HZ, 1);
down(&sem);
}
swap_statistics(buff2);
rhcs = (hst_cmd_stat *)(buff2 + 0x2c);
whcs = (hst_cmd_stat *)(buff2 + 0x8c);
for (x = 0; x <= 11; x++) {
SD(HBA_ptr)->reads[x] += rhcs->sizes[x];
SD(HBA_ptr)->writes[x] += whcs->sizes[x];
SD(HBA_ptr)->reads[12] += rhcs->sizes[x];
SD(HBA_ptr)->writes[12] += whcs->sizes[x];
}
size = sprintf(buffer + len, "Host<->Disk command statistics:\n"
" Reads: Writes:\n");
len += size;
pos = begin + len;
for (x = 0; x <= 10; x++) {
size = sprintf(buffer+len,"%5dk:%12u %12u\n", 1 << x,
SD(HBA_ptr)->reads[x],
SD(HBA_ptr)->writes[x]);
len += size;
pos = begin + len;
}
size = sprintf(buffer+len,">1024k:%12u %12u\n",
SD(HBA_ptr)->reads[11],
SD(HBA_ptr)->writes[11]);
len += size;
pos = begin + len;
size = sprintf(buffer+len,"Sum :%12u %12u\n",
SD(HBA_ptr)->reads[12],
SD(HBA_ptr)->writes[12]);
len += size;
pos = begin + len;
}
size = sprintf(buffer+len,">1024k:%12u %12u\n",
SD(HBA_ptr)->reads[11],
SD(HBA_ptr)->writes[11]);
len += size;
pos = begin + len;
size = sprintf(buffer+len,"Sum :%12u %12u\n",
SD(HBA_ptr)->reads[12],
SD(HBA_ptr)->writes[12]);
len += size;
pos = begin + len;
}
if (pos < offset) {
......@@ -362,9 +365,11 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
goto stop_output;
if(SD(HBA_ptr)->do_latency == TRUE) {
int factor = 1024/HZ;
size = sprintf(buffer + len, "Host Latency Command Statistics:\n"
"Current timer resolution: 10ms\n"
" Reads: Min:(ms) Max:(ms) Ave:(ms)\n");
"Current timer resolution: %2dms\n"
" Reads: Min:(ms) Max:(ms) Ave:(ms)\n",
factor);
len += size;
pos = begin + len;
for (x = 0; x <= 10; x++) {
......@@ -372,9 +377,9 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
1 << x,
SD(HBA_ptr)->reads_lat[x][0],
(SD(HBA_ptr)->reads_lat[x][1] == 0xffffffff)
? 0:(SD(HBA_ptr)->reads_lat[x][1] * 10),
SD(HBA_ptr)->reads_lat[x][2] * 10,
SD(HBA_ptr)->reads_lat[x][3] * 10 /
? 0:(SD(HBA_ptr)->reads_lat[x][1] * factor),
SD(HBA_ptr)->reads_lat[x][2] * factor,
SD(HBA_ptr)->reads_lat[x][3] * factor /
((SD(HBA_ptr)->reads_lat[x][0])
? SD(HBA_ptr)->reads_lat[x][0]:1));
len += size;
......@@ -383,9 +388,9 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
size = sprintf(buffer+len,">1024k:%12u %12u %12u %12u\n",
SD(HBA_ptr)->reads_lat[11][0],
(SD(HBA_ptr)->reads_lat[11][1] == 0xffffffff)
? 0:(SD(HBA_ptr)->reads_lat[11][1] * 10),
SD(HBA_ptr)->reads_lat[11][2] * 10,
SD(HBA_ptr)->reads_lat[11][3] * 10 /
? 0:(SD(HBA_ptr)->reads_lat[11][1] * factor),
SD(HBA_ptr)->reads_lat[11][2] * factor,
SD(HBA_ptr)->reads_lat[11][3] * factor /
((SD(HBA_ptr)->reads_lat[x][0])
? SD(HBA_ptr)->reads_lat[x][0]:1));
len += size;
......@@ -407,9 +412,9 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
1 << x,
SD(HBA_ptr)->writes_lat[x][0],
(SD(HBA_ptr)->writes_lat[x][1] == 0xffffffff)
? 0:(SD(HBA_ptr)->writes_lat[x][1] * 10),
SD(HBA_ptr)->writes_lat[x][2] * 10,
SD(HBA_ptr)->writes_lat[x][3] * 10 /
? 0:(SD(HBA_ptr)->writes_lat[x][1] * factor),
SD(HBA_ptr)->writes_lat[x][2] * factor,
SD(HBA_ptr)->writes_lat[x][3] * factor /
((SD(HBA_ptr)->writes_lat[x][0])
? SD(HBA_ptr)->writes_lat[x][0]:1));
len += size;
......@@ -418,9 +423,9 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
size = sprintf(buffer+len,">1024k:%12u %12u %12u %12u\n",
SD(HBA_ptr)->writes_lat[11][0],
(SD(HBA_ptr)->writes_lat[11][1] == 0xffffffff)
? 0:(SD(HBA_ptr)->writes_lat[x][1] * 10),
SD(HBA_ptr)->writes_lat[11][2] * 10,
SD(HBA_ptr)->writes_lat[11][3] * 10/
? 0:(SD(HBA_ptr)->writes_lat[x][1] * factor),
SD(HBA_ptr)->writes_lat[11][2] * factor,
SD(HBA_ptr)->writes_lat[11][3] * factor /
((SD(HBA_ptr)->writes_lat[x][0])
? SD(HBA_ptr)->writes_lat[x][0]:1));
len += size;
......
......@@ -5,7 +5,7 @@
* mike@i-Connect.Net *
* neuffer@mail.uni-mainz.de *
*********************************************************
* last change: 95/05/05 *
* last change: 96/05/16 *
********************************************************/
......@@ -90,10 +90,10 @@
#define CD(cmd) ((struct eata_ccb *)(cmd->host_scribble))
#define SD(host) ((hostdata *)&(host->hostdata))
#define DELAY(x) { __u32 i; ulong flags; \
#define DELAY(x) { ulong flags, i; \
save_flags(flags); sti(); \
i = jiffies + (x * HZ); \
while (jiffies < i) barrier(); \
while (jiffies < i); \
restore_flags(flags); }
/***********************************************
......@@ -130,6 +130,11 @@
#define EATA_COLD_BOOT_HBA 0x06 /* Only as a last resort */
#define EATA_FORCE_IO 0x07
#define HA_CTRLREG 0x206 /* control register for HBA */
#define HA_CTRL_DISINT 0x02 /* CTRLREG: disable interrupts */
#define HA_CTRL_RESCPU 0x04 /* CTRLREG: reset processor */
#define HA_CTRL_8HEADS 0x08 /* CTRLREG: set for drives with*
* >=8 heads (WD1003 rudimentary :-) */
#define HA_WCOMMAND 0x07 /* command register offset */
#define HA_WIFC 0x06 /* immediate command offset */
......@@ -350,10 +355,6 @@ typedef struct hstd {
__u32 reads_lat[12][4];
__u32 writes_lat[12][4];
__u32 all_lat[4];
/* state of Target (RESET,..) */
__u8 t_state[MAXCHANNEL][MAXTARGET];
/* timeouts on target */
__u32 t_timeout[MAXCHANNEL][MAXTARGET];
__u8 resetlevel[MAXCHANNEL];
__u32 last_ccb; /* Last used ccb */
__u32 cplen; /* size of CP in words */
......
......@@ -32,7 +32,7 @@
* Cambridge, MA 02139, USA. *
* *
************************************************************
* last change: 95/03/28 OS: Linux 1.3.80 *
* last change: 96/07/16 OS: Linux 2.0.8 *
************************************************************/
/* Look in eata_pio.h for configuration information */
......@@ -79,21 +79,6 @@ static unchar reg_IRQL[] =
static ulong int_counter = 0;
static ulong queue_counter = 0;
void hprint(const char *str)
{
char *hptr =(char *) 0x000b0000;
char *hptr2=(char *) 0x000b00a0;
char *hptr3=(char *) 0x000b0f00;
int z;
memmove(hptr,hptr2,24*80*2);
for (z=0; z<strlen(str); z++)
hptr3[z*2]=str[z];
for (; z<80; z++)
hptr3[z*2]=' ';
}
#include "eata_pio_proc.c"
#ifdef MODULE
......@@ -268,11 +253,17 @@ void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs * regs)
inline uint eata_pio_send_command(uint base, unchar command)
{
uint loop = R_LIMIT;
uint loop = HZ/2;
while (inb(base + HA_RSTATUS) & HA_SBUSY)
if (--loop == 0)
return(TRUE);
/* Enable interrupts for HBA. It is not the best way to do it at this
* place, but I hope that it doesn't interfere with the IDE driver
* initialization this way */
outb(HA_CTRL_8HEADS,base+HA_CTRLREG);
outb(command, base + HA_WCOMMAND);
return(FALSE);
......@@ -405,7 +396,7 @@ int eata_pio_queue(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
int eata_pio_abort(Scsi_Cmnd * cmd)
{
ulong flags;
uint loop = R_LIMIT;
uint loop = HZ;
save_flags(flags);
cli();
......@@ -452,14 +443,13 @@ int eata_pio_abort(Scsi_Cmnd * cmd)
int eata_pio_reset(Scsi_Cmnd * cmd, unsigned int dummy)
{
uint x, z, time, limit = 0;
uint x, time, limit = 0;
ulong flags;
unchar success = FALSE;
Scsi_Cmnd *sp;
save_flags(flags);
cli();
hprint("reset");
DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_reset called pid:%ld target:"
" %x lun: %x reason %x\n", cmd->pid, cmd->target,
cmd->lun, cmd->abort_reason));
......@@ -471,11 +461,6 @@ int eata_pio_reset(Scsi_Cmnd * cmd, unsigned int dummy)
return (SCSI_RESET_ERROR);
}
for (z = 0; z < MAXTARGET; z++) {
HD(cmd)->t_state[0][z] = RESET;
HD(cmd)->t_timeout[0][z] = NO_TIMEOUT;
}
/* force all slots to be free */
for (x = 0; x < cmd->host->can_queue; x++) {
......@@ -495,7 +480,7 @@ int eata_pio_reset(Scsi_Cmnd * cmd, unsigned int dummy)
}
/* hard reset the HBA */
outb((uint) cmd->host->base+HA_WCOMMAND, EATA_CMD_RESET);
outb(EATA_CMD_RESET, (uint) cmd->host->base+HA_WCOMMAND);
DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_reset: board reset done.\n"));
HD(cmd)->state = RESET;
......@@ -586,7 +571,7 @@ char * get_pio_board_data(ulong base, uint irq, uint id, ulong cplen, ushort cpp
int get_pio_conf_PIO(u32 base, struct get_conf *buf)
{
ulong loop = R_LIMIT;
ulong loop = HZ/2;
int z;
ushort *p;
......@@ -603,14 +588,14 @@ int get_pio_conf_PIO(u32 base, struct get_conf *buf)
printk(KERN_DEBUG "Issuing PIO READ CONFIG to HBA at %#x\n", base));
eata_pio_send_command(base, EATA_CMD_PIO_READ_CONFIG);
loop = R_LIMIT;
loop = HZ/2;
for (p = (ushort *) buf;
(long)p <= ((long)buf + (sizeof(struct get_conf) / 2)); p++) {
while (!(inb(base + HA_RSTATUS) & HA_SDRQ))
if (--loop == 0)
return (FALSE);
loop = R_LIMIT;
loop = HZ/2;
*p = inw(base + HA_RDATA);
}
if (!(inb(base + HA_RSTATUS) & HA_SERROR)) { /* Error ? */
......
......@@ -2,7 +2,7 @@
* Header file for eata_pio.c Linux EATA-PIO SCSI driver *
* (c) 1993-96 Michael Neuffer *
*********************************************************
* last change: 95/06/21 *
* last change: 96/05/05 *
********************************************************/
......
This diff is collapsed.
......@@ -22,6 +22,7 @@
#include <linux/genhd.h>
#include <linux/kernel.h>
#include <linux/blk.h>
#include <asm/unaligned.h>
#include "scsi.h"
#include "hosts.h"
#include "sd.h"
......@@ -121,7 +122,8 @@ static int partsize(struct buffer_head *bh, unsigned long capacity,
end_head * end_sector + end_sector;
/* This is the actual _sector_ number at the end */
logical_end = largest->start_sect + largest->nr_sects;
logical_end = get_unaligned(&largest->start_sect)
+ get_unaligned(&largest->nr_sects);
/* This is for >1023 cylinders */
ext_cyl= (logical_end-(end_head * end_sector + end_sector))
......
......@@ -276,7 +276,7 @@ static void sg_command_done(Scsi_Cmnd * SCpnt)
* wrong.
*/
memcpy(device->header.sense_buffer, SCpnt->sense_buffer, sizeof(SCpnt->sense_buffer));
device->header.result=SCpnt->result;
device->header.result = (SCpnt->sense_buffer[0] == 0 ? 0 : EIO);
/*
* Now wake up the process that is waiting for the
......
......@@ -485,11 +485,11 @@ void sr_photocd(struct inode *inode)
printk(KERN_WARNING"sr_photocd: ioctl error (TOSHIBA #1): 0x%x\n",rc);
break; /* if the first ioctl fails, we don't call the second one */
}
is_xa = (rec[0] == 0x20);
min = (unsigned long) rec[1]/16*10 + (unsigned long) rec[1]%16;
sec = (unsigned long) rec[2]/16*10 + (unsigned long) rec[2]%16;
frame = (unsigned long) rec[3]/16*10 + (unsigned long) rec[3]%16;
sector = min*CD_SECS*CD_FRAMES + sec*CD_FRAMES + frame;
is_xa = (rec[0] == 0x20) || sector;
if (sector) {
sector -= CD_BLOCK_OFFSET;
#ifdef DEBUG
......@@ -566,6 +566,9 @@ void sr_photocd(struct inode *inode)
break;
}
sector = rec[11] + (rec[10] << 8) + (rec[9] << 16) + (rec[8] << 24);
if (rec[6] <= 1) {
sector = 0; /* ignore sector offsets from first track */
}
is_xa = !!sector;
#ifdef DEBUG
if (sector)
......
......@@ -2552,7 +2552,7 @@ st_ioctl(struct inode * inode,struct file * file,
}
}
i = flush_buffer(inode, file, mtc.mt_op == MTSEEK ||
i = flush_buffer(inode, file, /* mtc.mt_op == MTSEEK || */
mtc.mt_op == MTREW || mtc.mt_op == MTOFFL ||
mtc.mt_op == MTRETEN || mtc.mt_op == MTEOM ||
mtc.mt_op == MTLOCK || mtc.mt_op == MTLOAD ||
......
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