Commit d2c53d83 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.61

parent 3a002fe4
......@@ -562,6 +562,11 @@ S: Mr. v. Boemellaan 39
S: NL-5237 KA 's-Hertogenbosch
S: The Netherlands
N: Savio Lam
E: lam836@cs.cuhk.hk
D: Author of the dialog utility, foundation
D: for Menuconfig's lxdialog.
N: Volker Lendecke
E: lendecke@namu01.gwdg.de
D: Kernel smbfs (to mount WfW, NT and OS/2 network drives.)
......@@ -857,6 +862,14 @@ D: Instigator, FHS standard
D: Keeper of the Jargon File and curator of the Retrocomputing Museum
D: Author, Emacs VC and GUD modes
N: William E. Roadcap
E: roadcapw@cfw.com
W: http://www.cfw.com/~roadcapw
D: Author of menu based configuration tool, Menuconfig.
S: 1407 Broad Street
S: Waynesboro, Va 22980
S: USA
N: Florian La Roche
E: rzsfl@rz.uni-sb.de
E: flla@stud.uni-sb.de
......@@ -1083,6 +1096,18 @@ S: 4130 Upson Hall
S: Ithaca NY 14850
S: USA
N: Greg Wettstein
E: greg@wind.rmcc.com
D: Filesystem valid flag for MINIX filesystem.
D: Minor kernel debugging.
D: Monitoring of development kernels for long-term stability.
D: Early implementations of Linux in a commercial environment.
S: Dr. Greg Wettstein, Ph.D.
S: Oncology Research Division Computing Facility
S: Roger Maris Cancer Center
S: 820 4th St. N.
S: Fargo, ND 58122
N: Marco van Wieringen
E: mvw@mercury.mcs.nl.mugnet.org
D: Author of acct and quota
......
......@@ -342,6 +342,21 @@ CONFIG_KERNEL_ELF
kernel in ELF by saying Y here and editing the variables CC
and LD in the toplevel Makefile.
Kernel support for A.OUT binaries
CONFIG_BINFMT_AOUT
A.OUT (Assembler.OUTput) format is a format for libraries and
executables used in the earliest versions of UNIX. Linux used this
format until it was replaced with the ELF format.
As more and more programs are converted to ELF, the use for A.OUT
will gradually diminish. If you disable this option it will reduce
your kernel by one page. This is not much and by itself does not
warrant removing support. However its removal is a good idea when
you wish to ensure that absolutely none of your programs will use
this older executable format. If you don't know what to answer at
this point then answer Y. You may answer M for module support and
later load the module when you find a program which needs a.out
format.
Processor type
CONFIG_M386
This is the processor type of your CPU. It is used for optimizing
......@@ -1117,6 +1132,11 @@ CONFIG_SLIP_COMPRESSED
sunsite.unc.edu:/pub/Linux/docs/HOWTO, explains how to configure
CSLIP. This won't enlarge your kernel.
Keepalive and linefill
CONFIG_SLIP_SMART
Adds additional capabilities to the SLIP driver to support the RELCOM
line fill and keepalive monitoring. Ideal on poor quality analogue lines.
PPP (point-to-point) support
CONFIG_PPP
PPP (Point to Point Protocol) is a newer and better SLIP. It serves
......
This diff is collapsed.
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 60
SUBLEVEL = 61
ARCH = i386
......
......@@ -34,7 +34,8 @@ unexport MOD_LIST_NAME
#
# Get things started.
#
first_rule: sub_dirs $(O_TARGET) $(L_TARGET)
first_rule: sub_dirs
$(MAKE) all_targets
#
# Common rules
......@@ -49,6 +50,11 @@ first_rule: sub_dirs $(O_TARGET) $(L_TARGET)
%.o: %.s
$(AS) $(ASFLAGS) $(EXTRA_CFLAGS) -o $@ $<
#
#
#
all_targets: $(O_TARGET) $(L_TARGET)
#
# Rule to compile a set of .o files into one .o file
#
......
......@@ -57,6 +57,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
fi
bool 'Networking support' CONFIG_NET
bool 'System V IPC' CONFIG_SYSVIPC
tristate 'Kernel support for a.out (ECOFF) binaries' CONFIG_BINFMT_AOUT
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
endmenu
......
......@@ -15,10 +15,10 @@ CONFIG_NATIVE=y
# CONFIG_ALPHA_AVANTI is not set
# CONFIG_ALPHA_JENSEN is not set
# CONFIG_ALPHA_NONAME is not set
CONFIG_ALPHA_CABRIOLET=y
# CONFIG_ALPHA_CABRIOLET is not set
# CONFIG_ALPHA_EB66 is not set
# CONFIG_ALPHA_EB66P is not set
# CONFIG_ALPHA_EB64P is not set
CONFIG_ALPHA_EB64P=y
# CONFIG_ALPHA_SRM is not set
CONFIG_PCI=y
CONFIG_ALPHA_APECS=y
......@@ -28,10 +28,11 @@ CONFIG_ALPHA_NEED_ROUNDING_EMULATION=y
CONFIG_PCI_OPTIMIZE=y
CONFIG_NET=y
CONFIG_SYSVIPC=y
CONFIG_BINFMT_AOUT=y
# CONFIG_BINFMT_ELF is not set
#
# block devices
# Block devices
#
CONFIG_BLK_DEV_FD=y
# CONFIG_BLK_DEV_RAM is not set
......@@ -42,7 +43,9 @@ CONFIG_ST506=y
#
# CONFIG_BLK_DEV_HD is not set
CONFIG_BLK_DEV_IDE=y
# CONFIG_BLK_DEV_IDEATAPI is not set
# CONFIG_BLK_DEV_IDECD is not set
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_BLK_DEV_CMD640 is not set
# CONFIG_BLK_DEV_TRITON is not set
# CONFIG_BLK_DEV_XD is not set
......@@ -65,6 +68,10 @@ CONFIG_INET=y
# CONFIG_TCP_NAGLE_OFF is not set
CONFIG_IP_NOSR=y
CONFIG_SKB_LARGE=y
#
#
#
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_AX25 is not set
......@@ -92,6 +99,7 @@ CONFIG_SCSI_CONSTANTS=y
#
# SCSI low-level drivers
#
# CONFIG_SCSI_ADVANSYS is not set
# CONFIG_SCSI_AHA152X is not set
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
......@@ -112,6 +120,7 @@ CONFIG_SCSI_NCR53C7xx=y
# CONFIG_SCSI_7000FASST is not set
# CONFIG_SCSI_EATA is not set
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_AM53C974 is not set
#
# Network device support
......@@ -149,17 +158,19 @@ CONFIG_DE4X5=y
# CONFIG_EXT_FS is not set
CONFIG_EXT2_FS=y
# CONFIG_XIA_FS is not set
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y
# CONFIG_VFAT_FS is not set
# CONFIG_UMSDOS_FS is not set
CONFIG_PROC_FS=y
# CONFIG_NFS_FS is not set
CONFIG_NFS_FS=y
# CONFIG_SMB_FS is not set
CONFIG_ISO9660_FS=y
# CONFIG_HPFS_FS is not set
# CONFIG_SYSV_FS is not set
#
# character devices
# Character devices
#
# CONFIG_CYCLADES is not set
# CONFIG_STALDRV is not set
......
......@@ -5,7 +5,7 @@
* modules.
*/
#include <linux/config.h>
#include <linux/string.h>
#include <linux/module.h>
# include <asm/io.h>
# include <asm/hwrpb.h>
......
......@@ -23,15 +23,16 @@
#
#
AS86 =$(CROSS_COMPILE)as86 -0 -a
AS386 =$(CROSS_COMPILE)as86 -3
LD86 =$(CROSS_COMPILE)ld86 -0
ifdef CONFIG_KERNEL_ELF
LD=$(CROSS_COMPILE)ld -m elf_i386
CPP=$(CC) -E -D__ELF__
OBJDUMP =$(CROSS_COMPILE)objdump
ENCAPS=$(CROSS_COMPILE)encaps
AS86 =$(CROSS_COMPILE)as86 -0 -a
AS386 =$(CROSS_COMPILE)as86 -3
LD86 =$(CROSS_COMPILE)ld86 -0
OBJDUMP_FLAGS=-k -q
ZLDFLAGS=-e startup_32
LDFLAGS=-e stext
......@@ -51,15 +52,19 @@ endif
CFLAGS := $(CFLAGS) -pipe
ifdef CONFIG_M386
CFLAGS := $(CFLAGS) -m386
CFLAGS := $(CFLAGS) -m386 -DCPU=386
endif
ifdef CONFIG_M486
CFLAGS := $(CFLAGS) -m486
CFLAGS := $(CFLAGS) -m486 -DCPU=486
endif
ifdef CONFIG_M586
CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2
CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586
endif
ifdef CONFIG_M686
CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686
endif
ifdef SMP
......
......@@ -24,6 +24,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
bool ' PCI bridge optimization (experimental)' CONFIG_PCI_OPTIMIZE
fi
bool 'System V IPC' CONFIG_SYSVIPC
tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
if [ "$CONFIG_BINFMT_ELF" = "y" ]; then
bool 'Compile kernel as ELF - if your GCC is ELF-GCC' CONFIG_KERNEL_ELF
......@@ -31,7 +32,8 @@ fi
choice 'Processor type' \
"386 CONFIG_M386 \
486 CONFIG_M486 \
Pentium CONFIG_M586" Pentium
Pentium CONFIG_M586 \
PPro CONFIG_M686" Pentium
endmenu
source drivers/block/Config.in
......
......@@ -18,11 +18,13 @@ CONFIG_NET=y
CONFIG_PCI=y
CONFIG_PCI_OPTIMIZE=y
CONFIG_SYSVIPC=y
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_ELF=y
CONFIG_KERNEL_ELF=y
# CONFIG_M386 is not set
# CONFIG_M486 is not set
CONFIG_M586=y
# CONFIG_M686 is not set
#
# Block devices
......@@ -38,8 +40,10 @@ CONFIG_ST506=y
CONFIG_BLK_DEV_IDE=y
CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDETAPE is not set
CONFIG_BLK_DEV_RZ1000=y
CONFIG_BLK_DEV_CMD640=y
# CONFIG_BLK_DEV_TRITON is not set
# CONFIG_IDE_CHIPSETS is not set
# CONFIG_BLK_DEV_XD is not set
#
......
......@@ -7,6 +7,7 @@ static struct symbol_table arch_symbol_table = {
/* platform dependent support */
#ifdef __SMP__
X(apic_reg), /* Needed internally for the I386 inlines */
X(cpu_data),
#endif
#include <linux/symtab_end.h>
};
......
......@@ -36,6 +36,7 @@ if [ "$CONFIG_CPU_R3000" = "y" -o \
fi
define_bool CONFIG_BINFMT_ELF y
define_bool CONFIG_BINFMT_AOUT y
bool 'Compile the kernel into the ELF object format' CONFIG_ELF_KERNEL
if [ "$CONFIG_ELF_KERNEL" = "y" ]; then
bool 'Is your ELF compiler an extra compiler' CONFIG_EXTRA_ELF_COMPILER
......
......@@ -21,6 +21,7 @@ CONFIG_CPU_R4X00=y
# CONFIG_CPU_R10000 is not set
CONFIG_TLB_SHUTDOWN=y
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_AOUT=y
# CONFIG_ELF_KERNEL is not set
CONFIG_CPU_LITTLE_ENDIAN=y
# CONFIG_NET is not set
......
......@@ -39,6 +39,7 @@ tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
if [ "$CONFIG_BINFMT_ELF" = "y" ]; then
bool 'Compile kernel as ELF - if your GCC is ELF-GCC' CONFIG_KERNEL_ELF y
fi
tristate 'Kernel support for A.OUT binaries' CONFIG_BINFMT_AOUT y
#bool 'Use -mpentium flag for Pentium-specific optimizations' CONFIG_M586 n
#if [ "$CONFIG_M586" = "n" ]; then
#bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
......
......@@ -17,6 +17,7 @@ define_bool CONFIG_SUN_CONSOLE y
bool 'Networking support' CONFIG_NET
bool 'System V IPC' CONFIG_SYSVIPC
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for A.OUT binaries' CONFIG_BINFMT_AOUT
endmenu
source drivers/block/Config.in
......
......@@ -13,6 +13,7 @@ CONFIG_SUN_CONSOLE=y
CONFIG_NET=y
CONFIG_SYSVIPC=y
# CONFIG_BINFMT_ELF is not set
CONFIG_BINFMT_AOUT=y
#
# block devices
......
......@@ -18,9 +18,19 @@ if [ "$CONFIG_ST506" = "y" ]; then
if [ "$CONFIG_BLK_DEV_IDE" = "y" ]; then
bool ' Include IDE/ATAPI CDROM support' CONFIG_BLK_DEV_IDECD
bool ' Include (ALPHA) IDE/ATAPI TAPE support' CONFIG_BLK_DEV_IDETAPE
bool ' Special CMD640 chipset support' CONFIG_BLK_DEV_CMD640
bool ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000
bool ' CMD640 chipset bugfix/support' CONFIG_BLK_DEV_CMD640
if [ "$CONFIG_PCI" = "y" ]; then
bool ' PCI Triton IDE Bus Master DMA support' CONFIG_BLK_DEV_TRITON
bool ' TRITON chipset DMA support' CONFIG_BLK_DEV_TRITON
fi
bool ' Other IDE chipset support' CONFIG_IDE_CHIPSETS
if [ "$CONFIG_IDE_CHIPSETS" = "y" ]; then
comment 'Note: most of these also require special kernel boot parameters'
bool ' DTC2278 chipset support' CONFIG_BLK_DEV_DTC2278
bool ' HT6560B chipset support' CONFIG_BLK_DEV_HT6560B
bool ' QD6580 chipset support' CONFIG_BLK_DEV_QD6580
bool ' UMC8672 chipset support' CONFIG_BLK_DEV_UMC8672
bool ' ALI14XX chipset support' CONFIG_BLK_DEV_ALI14XX
fi
fi
fi
......
......@@ -44,14 +44,38 @@ ifeq ($(CONFIG_BLK_DEV_IDE),y)
L_OBJS += ide.o
endif
ifeq ($(CONFIG_BLK_DEV_TRITON),y)
L_OBJS += triton.o
ifeq ($(CONFIG_BLK_DEV_RZ1000),y)
L_OBJS += rz1000.o
endif
ifeq ($(CONFIG_BLK_DEV_CMD640),y)
L_OBJS += cmd640.o
endif
ifeq ($(CONFIG_BLK_DEV_TRITON),y)
L_OBJS += triton.o
endif
ifeq ($(CONFIG_BLK_DEV_DTC2278),y)
L_OBJS += dtc2278.o
endif
ifeq ($(CONFIG_BLK_DEV_HT6560B),y)
L_OBJS += ht6560b.o
endif
ifeq ($(CONFIG_BLK_DEV_QD6580),y)
L_OBJS += qd6580.o
endif
ifeq ($(CONFIG_BLK_DEV_UMC8672),y)
L_OBJS += umc8672.o
endif
ifeq ($(CONFIG_BLK_DEV_ALI14XX),y)
L_OBJS += ali14xx.o
endif
ifeq ($(CONFIG_BLK_DEV_IDECD),y)
L_OBJS += ide-cd.o
endif
......
......@@ -13,7 +13,7 @@ See description later on below for handling BIG IDE drives with >1024 cyls.
Major features of ide.c & ide-cd.c:
NEW! - support for IDE ATAPI *tape* drives, courtesy of Gadi Oxman
(run MAKEDEV.ide to create the tape device entries in /dev/)
(re-run MAKEDEV.ide to create the tape device entries in /dev/)
NEW! - support for up to *four* IDE interfaces on one or more IRQs
NEW! - support for any mix of up to *eight* disk and/or cdrom drives
- support for reading IDE ATAPI cdrom drives (NEC,MITSUMI,VERTOS,SONY)
......@@ -31,28 +31,27 @@ NEW! (both are now probed for)
- can co-exist with hd.c controlling the first interface
- run-time selectable 32bit interface support (using hdparm-2.3)
NEW! - support for reliable operation of buggy RZ1000 interfaces
- PCI support is automatic
- PCI support is automatic when rz1000 support is configured
NEW! - support for reliable operation of buggy CMD-640 interfaces
- PCI support is automatic
- 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
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: ide1=ht6560
NEW! - experimental "fast" speed support for QD6580 interfaces
- use kernel command line option: ide0=qd6580
NEW! - experimental support for DTC-2278D interfaces
- use kernel command line option: ide1=dtc2278
- use kernel command line option: ide0=ht6560
NEW! - experimental support for various IDE chipsets
- use appropriate kernel command line option from list below
NEW! - support for drives with a stuck WRERR_STAT bit
NEW! - support for removeable devices, including door lock/unlock
NEW! - transparent support for DiskManager 6.0x and "Dynamic Disk Overlay"
- works with Linux fdisk, LILO, loadlin, bootln, etc..
NEW! - mostly transparent support for EZ-Drive
NEW! - mostly transparent support for EZ-Drive disk translation software
NEW! - to use LILO with EZ, install LILO on the linux partition
rather than on the master boot record, and then mark the
linux partition as "bootable" or "active" using fdisk.
(courtesy of Juha Laiho <jlaiho@ichaos.nullnet.fi>).
NEW! - auto-detect of disk translations by examining partition table
NEW! - ide-cd.c now compiles separate from ide.c
NEW! - Bus-Master DMA support for Intel PCI Triton chipset IDE interfaces
- for details, see comments at top of triton.c
......@@ -222,36 +221,48 @@ snyder@fnald0.fnal.gov
Summary of ide driver parameters for kernel "command line":
----------------------------------------------------------
"hdx=" is recognized for all "x" from "a" to "h", such as "hdc".
"idex=" is recognized for all "x" from "0" to "3", such as "ide1".
"hdx=noprobe" : drive may be present, but do not probe for it
"hdx=nowerr" : ignore the WRERR_STAT bit on this drive
"hdx=cdrom" : drive is present, and is a cdrom drive
"hdx=cyl,head,sect" : disk drive is present, with specified geometry
"hdx=autotune" : driver will attempt to tune interface speed
to the fastest PIO mode supported,
if possible for this drive only.
Not fully supported by all chipset types,
and quite likely to cause trouble with
older/odd IDE drives.
"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
and "ctl" is assumed to be "base"+0x206
"idex=base,ctl" : specify both base and ctl
"idex=base,ctl,irq" : specify base, ctl, and irq number
"idex=autotune" : driver will attempt to tune interface speed
to the fastest PIO mode supported,
for all drives on this interface.
Not fully supported by all chipset types,
and quite likely to cause trouble with
older/odd IDE drives.
"idex=noautotune" : driver will NOT attempt to tune interface speed
This is the default for most chipsets,
except the cmd640.
The following two are valid ONLY on ide0,
and the defaults for the base,ctl ports must not be altered.
"ide0=serialize" : do not overlap operations on ide0 and ide1.
"ide0=dtc2278" : probe/support DTC2278 interface
"ide0=ht6560b" : probe/support HT6560B interface
"ide0=cmd640_vlb" : *REQUIRED* for VLB cards with the CMD640 chip
(not for PCI -- automatically detected)
"ide0=qd6580" : probe/support qd6580 interface
"ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439, M1443, M1445)
"ide0=umc8672" : probe/support umc8672 chipsets
"hdx=" is recognized for all "x" from "a" to "h", such as "hdc".
"idex=" is recognized for all "x" from "0" to "3", such as "ide1".
"hdx=noprobe" : drive may be present, but do not probe for it
"hdx=nowerr" : ignore the WRERR_STAT bit on this drive
"hdx=cdrom" : drive is present, and is a cdrom drive
"hdx=cyl,head,sect" : disk drive is present, with specified geometry
"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
and "ctl" is assumed to be "base"+0x206
"idex=base,ctl" : specify both base and ctl
"idex=base,ctl,irq" : specify base, ctl, and irq number
The following two are valid ONLY on ide0 or ide1,
and the defaults for the base,ctl ports must not be altered.
"idex=serialize" : do not overlap operations on ide0 and ide1.
"idex=dtc2278" : enables use of DTC2278 secondary i/f
"idex=ht6560b" : enables use of HT6560B secondary i/f
"idex=cmd640_vlb" : required for VLB cards with the CMD640 chip
(not for PCI -- automatically detected)
This option is valid ONLY on ide0, and the defaults for the base,ctl ports
must not be altered.
"ide0=qd6580" : select "fast" interface speed on a qd6580 interface
Everything else is rejected with a "BAD OPTION" message.
================================================================================
......
/*
* linux/drivers/block/ali14xx.c Version 0.01 Feb 06, 1996
*
* Copyright (C) 1996 Linus Torvalds & author (see below)
*/
/*
* ALI M14xx chipset EIDE controller
*
* Adapted from code developed by derekn@vw.ece.cmu.edu. -ml
* Derek's notes follow:
*
* I think the code should be pretty understandable,
* but I'll be happy to (try to) answer questions.
*
* The critical part is in the setupDrive function. The initRegisters
* function doesn't seem to be necessary, but the DOS driver does it, so
* I threw it in.
*
* I've only tested this on my system, which only has one disk. I posted
* it to comp.sys.linux.hardware, so maybe some other people will try it
* out.
*
* Derek Noonburg (derekn@ece.cmu.edu)
* 95-sep-26
*/
#undef REALLY_SLOW_IO /* most systems can safely undef this */
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <asm/io.h>
#include "ide.h"
#define ALI_14xx_BUS_SPEED 40 /* PCI / VLB bus speed */
/* port addresses for auto-detection */
#define ALI_NUM_PORTS 4
static int ports[ALI_NUM_PORTS] = {0x074, 0x0f4, 0x034, 0x0e4};
/* register initialization data */
typedef struct { byte reg, data; } RegInitializer;
static RegInitializer initData[] = {
{0x01, 0x0f}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00},
{0x05, 0x00}, {0x06, 0x00}, {0x07, 0x2b}, {0x0a, 0x0f},
{0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00},
{0x29, 0x00}, {0x2a, 0x00}, {0x2f, 0x00}, {0x2b, 0x00},
{0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x30, 0x00},
{0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0xff},
{0x35, 0x03}, {0x00, 0x00}
};
/* default timing parameters for each PIO mode */
static struct { int time1, time2; } timeTab[4] = {
{600, 165}, /* PIO 0 */
{383, 125}, /* PIO 1 */
{240, 100}, /* PIO 2 */
{180, 80} /* PIO 3 */
};
/* timing parameter registers for each drive */
static struct { byte reg1, reg2, reg3, reg4; } regTab[4] = {
{0x03, 0x26, 0x04, 0x27}, /* drive 0 */
{0x05, 0x28, 0x06, 0x29}, /* drive 1 */
{0x2b, 0x30, 0x2c, 0x31}, /* drive 2 */
{0x2d, 0x32, 0x2e, 0x33}, /* drive 3 */
};
static int basePort = 0; /* base port address */
static int regPort = 0; /* port for register number */
static int dataPort = 0; /* port for register data */
static byte regOn; /* output to base port to access registers */
static byte regOff; /* output to base port to close registers */
/*------------------------------------------------------------------------*/
/*
* Read a controller register.
*/
static inline byte inReg (byte reg)
{
outb_p(reg, regPort);
return inb(dataPort);
}
/*
* Write a controller register.
*/
static void outReg (byte data, byte reg)
{
outb_p(reg, regPort);
outb_p(data, dataPort);
}
/*
* Set PIO mode for the specified drive.
* This function computes timing parameters
* and sets controller registers accordingly.
*/
static void ali14xx_tune_drive (ide_drive_t *drive, byte pio)
{
int driveNum;
int time1, time2, time1a;
byte param1, param2, param3, param4;
struct hd_driveid *id = drive->id;
unsigned long flags;
if (pio == 255) { /* auto-tune */
pio = id->tPIO;
if ((id->field_valid & 0x02) && (id->eide_pio_modes & 0x01))
pio = 3;
}
/* 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;
if (pio != 3) {
param3 += 8;
param4 += 8;
}
printk("%s: PIO mode%d, t1=%dns, t2=%dns, cycles = %d+%d, %d+%d\n",
drive->name, pio, time1, time2, param1, param2, param3, param4);
/* stuff timing parameters into controller registers */
driveNum = (HWIF(drive)->index << 1) + drive->select.b.unit;
save_flags(flags);
cli();
outb_p(regOn, basePort);
outReg(param1, regTab[driveNum].reg1);
outReg(param2, regTab[driveNum].reg2);
outReg(param3, regTab[driveNum].reg3);
outReg(param4, regTab[driveNum].reg4);
outb_p(regOff, basePort);
restore_flags(flags);
}
/*
* Auto-detect the IDE controller port.
*/
static int findPort (void)
{
int i;
byte t;
unsigned long flags;
save_flags(flags);
cli();
for (i = 0; i < ALI_NUM_PORTS; ++i) {
basePort = ports[i];
regOff = inb(basePort);
for (regOn = 0x30; regOn <= 0x33; ++regOn) {
outb_p(regOn, basePort);
if (inb(basePort) == regOn) {
regPort = basePort + 4;
dataPort = basePort + 8;
t = inReg(0) & 0xf0;
outb_p(regOff, basePort);
restore_flags(flags);
if (t != 0x50)
return 0;
return 1; /* success */
}
}
outb_p(regOff, basePort);
}
restore_flags(flags);
return 0;
}
/*
* Initialize controller registers with default values.
*/
static int initRegisters (void) {
RegInitializer *p;
byte t;
unsigned long flags;
save_flags(flags);
cli();
outb_p(regOn, basePort);
for (p = initData; p->reg != 0; ++p)
outReg(p->data, p->reg);
outb_p(0x01, regPort);
t = inb(regPort) & 0x01;
outb_p(regOff, basePort);
restore_flags(flags);
return t;
}
void init_ali14xx (void)
{
/* auto-detect IDE controller port */
if (!findPort()) {
printk("ali14xx: not found\n");
return;
}
printk("ali14xx: base= 0x%03x, regOn = 0x%02x\n", basePort, regOn);
ide_hwifs[0].chipset = ide_ali14xx;
ide_hwifs[1].chipset = ide_ali14xx;
ide_hwifs[0].tuneproc = &ali14xx_tune_drive;
ide_hwifs[1].tuneproc = &ali14xx_tune_drive;
/* initialize controller registers */
if (!initRegisters()) {
printk("ali14xx: Chip initialization failed\n");
return;
}
}
This diff is collapsed.
/*
* linux/drivers/block/dtc2278.c Version 0.01 Feb 06, 1996
*
* Copyright (C) 1996 Linus Torvalds & author (see below)
*/
#undef REALLY_SLOW_IO /* most systems can safely undef this */
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <asm/io.h>
#include "ide.h"
/*
* From: andy@cercle.cts.com (Dyan Wile)
*
* Below is a patch for DTC-2278 - alike software-programmable controllers
* The code enables the secondary IDE controller and the PIO4 (3?) timings on
* the primary (EIDE). You may probably have to enable the 32-bit support to
* get the full speed. You better get the disk interrupts disabled ( hdparm -u0
* /dev/hd.. ) for the drives connected to the EIDE interface. (I get my
* filesystem corrupted with -u1, but under heavy disk load only :-)
*
* From: mlord@bnr.ca -- this chipset is now forced to use the "serialize" feature,
* which hopefully will make it more reliable to use.. maybe it has the same bugs
* as the CMD640B and RZ1000 ??
*/
static void sub22 (char b, char c)
{
int i;
for(i = 0; i < 3; ++i) {
inb(0x3f6);
outb_p(b,0xb0);
inb(0x3f6);
outb_p(c,0xb4);
inb(0x3f6);
if(inb(0xb4) == c) {
outb_p(7,0xb0);
inb(0x3f6);
return; /* success */
}
}
}
static void tune_dtc2278 (ide_drive_t *drive, byte pio_mode)
{
unsigned long flags;
if (pio_mode != 255) { /* auto-tune not yet supported here */
if (pio_mode >= 3) {
save_flags(flags);
cli();
/*
* This enables PIO mode4 (3?) on the first interface
*/
sub22(1,0xc3);
sub22(0,0xa0);
restore_flags(flags);
} else {
/* we don't know how to set it back again.. */
}
}
}
void init_dtc2278 (void)
{
unsigned long flags;
save_flags(flags);
cli();
/*
* This enables the second interface
*/
outb_p(4,0xb0);
inb(0x3f6);
outb_p(0x20,0xb4);
inb(0x3f6);
restore_flags(flags);
ide_hwifs[0].serialized = 1;
ide_hwifs[0].chipset = ide_dtc2278;
ide_hwifs[1].chipset = ide_dtc2278;
ide_hwifs[0].tuneproc = &tune_dtc2278;
}
......@@ -3682,7 +3682,7 @@ static char get_fdc_version(void)
case 0x0:
output_byte(FD_SAVE);
r = result();
if (r != 17) {
if (r != 16) {
printk("FDC %d init: SAVE: unexpected return of %d bytes.\n", fdc, r);
return FDC_UNKNOWN;
}
......
......@@ -14,6 +14,8 @@
* /dev/hda *must* have a "DOS" type 0x51 partition in the first slot (hda1).
*
* More flexible handling of extended partitions - aeb, 950831
*
* Check partition table on IDE disks for common CHS translations
*/
#include <linux/config.h>
......@@ -198,7 +200,7 @@ static int msdos_partition(struct gendisk *hd, kdev_t dev, unsigned long first_s
unsigned char *data;
int mask = (1 << hd->minor_shift) - 1;
#ifdef CONFIG_BLK_DEV_IDE
int tested_for_dm6 = 0;
int tested_for_xlate = 0;
read_mbr:
#endif
......@@ -221,12 +223,12 @@ static int msdos_partition(struct gendisk *hd, kdev_t dev, unsigned long first_s
p = (struct partition *) (0x1be + data);
#ifdef CONFIG_BLK_DEV_IDE
/*
* Check for Disk Manager v6.0x (or EZ-DRIVE) with geometry translation
*/
if (!tested_for_dm6++) { /* only check for DM6 *once* */
if (!tested_for_xlate++) { /* Do this only once per disk */
/*
* Look for various forms of IDE disk geometry translation
*/
extern int ide_xlate_1024(kdev_t, int, const char *);
/* check for various "disk managers" which do strange things */
unsigned int sig = *(unsigned short *)(data + 2);
if (p->sys_ind == EZD_PARTITION) {
/*
* The remainder of the disk must be accessed using
......@@ -256,20 +258,33 @@ static int msdos_partition(struct gendisk *hd, kdev_t dev, unsigned long first_s
brelse(bh);
goto read_mbr; /* start over with new MBR */
}
} else {
/* look for DM6 signature in MBR, courtesy of OnTrack */
unsigned int sig = *(unsigned short *)(data + 2);
if (sig <= 0x1ae
&& *(unsigned short *)(data + sig) == 0x55AA
} else if (sig <= 0x1ae && *(unsigned short *)(data + sig) == 0x55AA
&& (1 & *(unsigned char *)(data + sig + 2)) )
{
(void) ide_xlate_1024 (dev, 0, " [DM6:MBR]");
} else {
/* look for DM6 AUX partition type in slot 1 */
if (p->sys_ind == DM6_AUX1PARTITION
|| p->sys_ind == DM6_AUX3PARTITION)
{
(void)ide_xlate_1024(dev, 0, " [DM6:AUX]");
{
/*
* DM6 signature in MBR, courtesy of OnTrack
*/
(void) ide_xlate_1024 (dev, 0, " [DM6:MBR]");
} else if (p->sys_ind == DM6_AUX1PARTITION || p->sys_ind == DM6_AUX3PARTITION) {
/*
* DM6 on other than the first (boot) drive
*/
(void) ide_xlate_1024(dev, 0, " [DM6:AUX]");
} else {
/*
* Examine the partition table for common translations.
* This is necessary for drives for situations where
* the translated geometry is unavailable from the BIOS.
*/
for (i = 0; i < 4 ; i++) {
struct partition *q = &p[i];
if (NR_SECTS(q) && q->sector == 1 && q->end_sector == 63) {
unsigned int heads = q->end_head + 1;
if (heads == 32 || heads == 64 || heads == 128) {
(void) ide_xlate_1024(dev, heads, " [PTBL]");
break;
}
}
}
}
......
/*
* linux/drivers/block/ht6580.c Version 0.01 Feb 06, 1996
*
* Copyright (C) 1995-1996 Linus Torvalds & author (see below)
*/
#undef REALLY_SLOW_IO /* most systems can safely undef this */
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <asm/io.h>
#include "ide.h"
/*
* This routine handles interface switching for the peculiar hardware design
* on the F.G.I./Holtek HT-6560B VLB IDE interface.
* The HT-6560B can only enable one IDE port at a time, and requires a
* silly sequence (below) whenever we switch between primary and secondary.
*
* This stuff is courtesy of malafoss@snakemail.hut.fi
*
* At least one user has reported that this code can confuse the floppy
* controller and/or driver -- perhaps this should be changed to use
* a read-modify-write sequence, so as not to disturb other bits in the reg?
*/
/*
* We don't know what all of the bits are for, but we *do* know about these:
* bit5 (0x20): "1" selects slower speed (?)
* bit0 (0x01): "1" selects second interface
*/
static byte qd6560b_selects [2][MAX_DRIVES] = {{0x3c,0x3c}, {0x3d,0x3d}};
static void qd6560b_selectproc (ide_drive_t *drive) /* called from ide.c */
{
static byte current_select = 0;
byte drive_select = qd6560b_selects[HWIF(drive)->index][drive->select.b.unit];
if (drive_select != current_select) {
byte t;
unsigned long flags;
save_flags (flags);
cli();
current_select = drive_select;
(void) inb(0x3e6);
(void) inb(0x3e6);
(void) inb(0x3e6);
/*
* Note: input bits are reversed to output bits!!
*/
t = inb(0x3e6) ^ 0x3f;
t &= (~0x21);
t |= (current_select & 0x21);
outb(t,0x3e6);
restore_flags (flags);
}
}
/*
* Autodetection and initialization of ht6560b
*/
int try_to_init_ht6560b(void)
{
byte orig_value;
int i;
/* Autodetect ht6560b */
if ((orig_value=inb(0x3e6)) == 0xff)
return 0;
for (i=3;i>0;i--) {
outb(0x00,0x3e6);
if (!( (~inb(0x3e6)) & 0x3f )) {
outb(orig_value,0x3e6);
return 0;
}
}
outb(0x00,0x3e6);
if ((~inb(0x3e6))& 0x3f) {
outb(orig_value,0x3e6);
return 0;
}
/*
* Ht6560b autodetected:
* reverse input bits to output bits
* initialize bit1 to 0
*/
outb((orig_value ^ 0x3f) & 0xfd,0x3e6);
printk("ht6560b: detected and initialized\n");
return 1;
}
static void tune_ht6560b (ide_drive_t *drive, byte pio)
{
unsigned int hwif, unit;
if (pio == 255) { /* auto-tune */
if (drive->media != ide_disk) {
pio = 0; /* cdroms don't like our fast mode */
} else {
struct hd_driveid *id = drive->id;
pio = id->tPIO;
if ((id->field_valid & 0x02) && (id->eide_pio_modes & 0x01))
pio = 3;
}
}
hwif = HWIF(drive)->index;
unit = drive->select.b.unit;
if (pio < 3)
qd6560b_selects[hwif][unit] |= 0x20;
else
qd6560b_selects[hwif][unit] &= ~0x20;
}
void init_ht6560b (void)
{
if (check_region(0x3e6,1)) {
printk("\nht6560b: PORT 0x3e6 ALREADY IN USE\n");
} else {
if (try_to_init_ht6560b()) {
request_region(0x3e6, 1, "ht6560b");
ide_hwifs[0].chipset = ide_ht6560b;
ide_hwifs[1].chipset = ide_ht6560b;
ide_hwifs[0].selectproc = &qd6560b_selectproc;
ide_hwifs[1].selectproc = &qd6560b_selectproc;
ide_hwifs[0].tuneproc = &tune_ht6560b;
ide_hwifs[1].tuneproc = &tune_ht6560b;
ide_hwifs[0].serialized = 1;
}
}
}
This diff is collapsed.
......@@ -34,24 +34,6 @@
#ifndef FAKE_FDISK_FOR_EZDRIVE /* 1 to help linux fdisk with EZDRIVE */
#define FAKE_FDISK_FOR_EZDRIVE 1 /* 0 to reduce kernel size */
#endif
#ifndef SUPPORT_RZ1000 /* 1 to support RZ1000 chipset */
#define SUPPORT_RZ1000 1 /* 0 to reduce kernel size */
#endif
#ifndef SUPPORT_UMC8672 /* 1 to support UMC8672 chipset */
#define SUPPORT_UMC8672 1 /* 0 to reduce kernel size */
#endif
#ifndef SUPPORT_HT6560B /* 1 to support HT6560B chipset */
#define SUPPORT_HT6560B 1 /* 0 to reduce kernel size */
#endif
#ifndef SUPPORT_QD6580 /* 1 to support QD6580 chipset */
#define SUPPORT_QD6580 1 /* 0 to reduce kernel size */
#endif
#ifndef SUPPORT_DTC2278 /* 1 to support DTC2278 chipset */
#define SUPPORT_DTC2278 1 /* 0 to reduce kernel size */
#ifndef SET_DTC2278_MODE4
#define SET_DTC2278_MODE4 0 /* 1 to init primary i/f for PIO mode4 */
#endif
#endif
#ifndef FANCY_STATUS_DUMPS /* 1 for human-readable drive errors */
#define FANCY_STATUS_DUMPS 1 /* 0 to reduce kernel size */
#endif
......@@ -293,7 +275,8 @@ typedef union {
unsigned set_geometry : 1; /* respecify drive geometry */
unsigned recalibrate : 1; /* seek to cyl 0 */
unsigned set_multmode : 1; /* set multmode count */
unsigned reserved : 5; /* unused */
unsigned set_pio : 1; /* set pio mode */
unsigned reserved : 4; /* unused */
} b;
} special_t;
......@@ -310,26 +293,26 @@ typedef union {
typedef struct ide_drive_s {
special_t special; /* special action flags */
#if FAKE_FDISK_FOR_EZDRIVE
unsigned ezdrive : 1; /* flag: partitioned with ezdrive */
#endif /* FAKE_FDISK_FOR_EZDRIVE */
unsigned present : 1; /* drive is physically present */
unsigned noprobe : 1; /* from: hdx=noprobe */
unsigned keep_settings : 1; /* restore settings after drive reset */
unsigned busy : 1; /* currently doing revalidate_disk() */
unsigned vlb_32bit : 1; /* use 32bit in/out for data */
unsigned vlb_sync : 1; /* needed for some 32bit chip sets */
unsigned removeable : 1; /* 1 if need to do check_media_change */
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 autotune : 2; /* 1=autotune, 2=noautotune, 0=default */
#if FAKE_FDISK_FOR_EZDRIVE
unsigned remap_0_to_1 : 1; /* flag: partitioned with ezdrive */
#endif /* FAKE_FDISK_FOR_EZDRIVE */
ide_media_t media; /* disk, cdrom, tape */
select_t select; /* basic drive/head select reg value */
void *hwif; /* actually (ide_hwif_t *) */
byte ctl; /* "normal" value for IDE_CONTROL_REG */
byte ready_stat; /* min status value for drive ready */
byte mult_count; /* current multiple sector setting */
byte mult_req; /* requested multiple sector setting */
byte chipset; /* interface chipset access method */
byte pio_req; /* requested multiple sector 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 */
byte usage; /* current "open()" count for drive */
......@@ -339,27 +322,16 @@ typedef struct ide_drive_s {
byte bios_sect; /* BIOS/fdisk/LILO sectors per track */
unsigned short bios_cyl; /* BIOS/fdisk/LILO number of cyls */
unsigned short cyl; /* "real" number of cyls */
void *hwif; /* actually (ide_hwif_t *) */
struct wait_queue *wqueue; /* used to wait for drive in open() */
struct hd_driveid *id; /* drive model identification info */
struct hd_struct *part; /* drive partition table */
char name[4]; /* drive name, such as "hda" */
#ifdef CONFIG_BLK_DEV_IDECD
struct cdrom_info cdrom_info; /* from ide-cd.c */
struct cdrom_info cdrom_info; /* for ide-cd.c */
#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;
#ifdef CONFIG_BLK_DEV_IDETAPE
idetape_tape_t tape; /* for ide-tape.c */
#endif /* CONFIG_BLK_DEV_IDETAPE */
} ide_drive_t;
......@@ -378,6 +350,35 @@ typedef struct ide_drive_s {
typedef enum {ide_dma_read = 0, ide_dma_write = 1, ide_dma_abort = 2, ide_dma_check = 3} ide_dma_action_t;
typedef int (ide_dmaproc_t)(ide_dma_action_t, ide_drive_t *);
/*
* An ide_tuneproc_t() is used to set the speed of an IDE interface
* to a particular PIO mode. The "byte" parameter is used
* to select the PIO mode by number (0,1,2,3,4,5), and a value of 255
* indicates that the interface driver should "auto-tune" the PIO mode
* according to the drive capabilities in drive->id;
*
* Not all interface types support tuning, and not all of those
* support all possible PIO settings. They may silently ignore
* or round values as they see fit.
*/
typedef void (ide_tuneproc_t)(ide_drive_t *, byte);
/*
* This is used to provide HT6560B interface support.
* It will probably also be used by the DC4030VL driver.
*/
typedef void (ide_selectproc_t) (ide_drive_t *);
/*
* hwif_chipset_t is used to keep track of the specific hardware
* chipset used by each IDE interface, if known.
*/
typedef enum { ide_unknown, ide_generic, ide_triton,
ide_cmd640, ide_dtc2278, ide_ali14xx,
ide_qd6580, ide_umc8672, ide_ht6560b }
hwif_chipset_t;
typedef struct hwif_s {
struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
void *hwgroup; /* actually (ide_hwgroup_t *) */
......@@ -385,13 +386,18 @@ typedef struct hwif_s {
unsigned short ctl_port; /* usually io_base+0x206 */
ide_drive_t drives[MAX_DRIVES]; /* drive info */
struct gendisk *gd; /* gendisk structure */
ide_tuneproc_t *tuneproc; /* routine to tune PIO mode for drives */
#ifdef CONFIG_BLK_DEV_HT6560B
ide_selectproc_t *selectproc; /* tweaks hardware to select drive */
#endif /* CONFIG_BLK_DEV_HT6560B */
ide_dmaproc_t *dmaproc; /* dma read/write/abort routine */
unsigned long *dmatable; /* dma physical region descriptor table */
unsigned short dma_base; /* base addr for dma ports (triton) */
byte irq; /* our irq number */
byte major; /* our major number */
byte select; /* pri/sec hwif select for ht6560b */
char name[5]; /* name of interface, eg. "ide0" */
byte index; /* 0 for ide0; 1 for ide1; ... */
hwif_chipset_t chipset; /* sub-module for tuning.. */
unsigned noprobe : 1; /* don't probe for this interface */
unsigned present : 1; /* this interface exists */
unsigned serialized : 1; /* valid only for ide_hwifs[0] */
......@@ -422,6 +428,19 @@ typedef struct hwgroup_s {
unsigned long poll_timeout; /* timeout value during long polls */
} ide_hwgroup_t;
/*
* ide_hwifs[] is the master data structure used to keep track
* of just about everything in ide.c. Whenever possible, routines
* 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[];
#endif
/*
* One final include file, which references some of the data/defns from above
*/
......@@ -480,9 +499,22 @@ void ide_fixstring (byte *s, const int bytecount, const int byteswap);
int ide_wait_stat (ide_drive_t *drive, byte good, byte bad, unsigned long timeout);
/*
* This is called from genhd.c to correct DiskManager/EZ-Drive geometries
* This routine is called from the partition-table code in genhd.c
* to "convert" a drive to a logical geometry with fewer than 1024 cyls.
*
* The second parameter, "xparm", determines exactly how the translation
* will be handled:
* 0 = convert to CHS with fewer than 1024 cyls
* using the same method as Ontrack DiskManager.
* 1 = same as "0", plus offset everything by 63 sectors.
* -1 = similar to "0", plus redirect sector 0 to sector 1.
* >1 = convert to a CHS geometry with "xparm" heads.
*
* Returns 0 if the translation was not possible, if the device was not
* an IDE disk drive, or if a geometry was "forced" on the commandline.
* Returns 1 if the geometry translation was successful.
*/
int ide_xlate_1024(kdev_t, int, const char *);
int ide_xlate_1024 (kdev_t, int, const char *);
/*
* Start a reset operation for an IDE interface.
......
/*
* linux/drivers/block/qd6580.c Version 0.01 Feb 06, 1996
*
* Copyright (C) 1996 Linus Torvalds & author (see below)
*/
/*
* QDI QD6580 EIDE controller fast support by Colten Edwards.
* No net access, but (maybe) can be reached at pje120@cs.usask.ca
*/
#undef REALLY_SLOW_IO /* most systems can safely undef this */
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <asm/io.h>
#include "ide.h"
/*
* Register 0xb3 looks like:
* 0x4f is fast mode3 ?
* 0x3f is medium mode2 ?
* 0x2f is slower mode1 ?
* 0x1f is slower yet mode0 ?
* 0x0f ??? ???
*
* Don't know whether this sets BOTH drives, or just the first drive.
* Don't know if there is a separate setting for the second drive.
*
* Feel free to patch this if you have one of these beasts
* and can work out the answers!
*
* I/O ports are 0xb0 0xb2 and 0xb3
*/
static void tune_qd6580 (ide_drive_t *drive, byte pio)
{
unsigned long flags;
if (pio == 255) { /* auto-tune */
struct hd_driveid *id = drive->id;
pio = id->tPIO;
if ((id->field_valid & 0x02) && (id->eide_pio_modes & 0x03))
pio = 3;
}
pio++; /* is this correct? */
save_flags(flags);
cli();
outb_p(0x8d,0xb0);
outb_p(0x0 ,0xb2);
outb_p((pio<<4)|0x0f,0xb3);
inb(0x3f6);
restore_flags(flags);
}
void init_qd6580 (void)
{
ide_hwifs[0].chipset = ide_qd6580;
ide_hwifs[0].tuneproc = &tune_qd6580;
}
/*
* linux/drivers/block/rz1000.c Version 0.02 Feb 08, 1996
*
* Copyright (C) 1995-1996 Linus Torvalds & author (see below)
*/
/*
* Principal Author/Maintainer: mlord@bnr.ca (Mark Lord)
*
* This file provides support for disabling the buggy read-ahead
* mode of the RZ1000 IDE chipset, commonly used on Intel motherboards.
*/
#undef REALLY_SLOW_IO /* most systems can safely undef this */
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <asm/io.h>
#include <linux/bios32.h>
#include <linux/pci.h>
#include "ide.h"
static void ide_pci_access_error (int rc)
{
printk("ide: pcibios access failed - %s\n", pcibios_strerror(rc));
}
void init_rz1000 (byte bus, byte fn)
{
int rc;
unsigned short reg;
printk("ide: buggy RZ1000 interface: ");
if ((rc = pcibios_read_config_word (bus, fn, PCI_COMMAND, &reg))) {
ide_pci_access_error (rc);
} else if (!(reg & 1)) {
printk("not enabled\n");
} else {
if ((rc = pcibios_read_config_word(bus, fn, 0x40, &reg))
|| (rc = pcibios_write_config_word(bus, fn, 0x40, reg & 0xdfff)))
{
extern int ide_disallow_unmask;
ide_disallow_unmask = 1;
ide_hwifs[0].serialized = 1;
ide_pci_access_error (rc);
printk("serialized, disabled unmasking\n");
} else
printk("disabled read-ahead\n");
}
}
/*
* linux/drivers/block/triton.c Version 1.05 Jan 11, 1996
* linux/drivers/block/triton.c Version 1.06 Feb 6, 1996
*
* Copyright (c) 1995-1996 Mark Lord
* May be copied or modified under the terms of the GNU General Public License
......@@ -319,7 +319,7 @@ static void init_triton_dma (ide_hwif_t *hwif, unsigned short base)
if (check_region(base, 8)) {
printk(" -- ERROR, PORTS ALREADY IN USE");
} else {
request_region(base, 8, hwif->name);
request_region(base, 8, "triton DMA");
hwif->dma_base = base;
if (!dmatable) {
/*
......@@ -364,7 +364,6 @@ void ide_init_triton (byte bus, byte fn)
int dma_enabled = 0;
unsigned short bmiba, pcicmd;
unsigned int timings;
extern ide_hwif_t ide_hwifs[];
printk("ide: Triton BM-IDE on PCI bus %d function %d\n", bus, fn);
/*
......@@ -409,12 +408,14 @@ void ide_init_triton (byte bus, byte fn)
time = timings & 0xffff;
if ((timings & 0x8000) == 0) /* interface enabled? */
continue;
hwif->chipset = ide_triton;
if (dma_enabled)
init_triton_dma(hwif, bmiba);
} else if (hwif->io_base == 0x170) {
time = timings >> 16;
if ((timings & 0x8000) == 0) /* interface enabled? */
continue;
hwif->chipset = ide_triton;
if (dma_enabled)
init_triton_dma(hwif, bmiba + 8);
} else
......
/*
* linux/drivers/block/umc8672.c Version 0.01 Nov 16, 1995
* linux/drivers/block/umc8672.c Version 0.02 Feb 06, 1996
*
* Copyright (C) 1995 Linus Torvalds & author (see below)
* Copyright (C) 1995-1996 Linus Torvalds & author (see below)
*/
/*
......@@ -13,6 +13,8 @@
* Version 0.01 Initial version, hacked out of ide.c,
* and #include'd rather than compiled separately.
* This will get cleaned up in a subsequent release.
*
* Version 0.02 now configs/compiles separate from ide.c -ml
*/
/*
......@@ -32,77 +34,122 @@
* the results from the DOS speed test programm supplied from UMC. 11 is the
* highest speed (about PIO mode 3)
*/
#undef REALLY_SLOW_IO /* most systems can safely undef this */
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <asm/io.h>
#include "ide.h"
/*
* The speeds will eventually become selectable using hdparm via ioctl's,
* but for now they are coded here:
*/
#define UMC_DRIVE0 11 /* DOS messured drive Speeds */
#define UMC_DRIVE1 11 /* 0 - 11 allowed */
#define UMC_DRIVE2 11 /* 11 = Highest Speed */
#define UMC_DRIVE3 11 /* In case of crash reduce speed */
#define UMC_DRIVE0 1 /* DOS measured drive speeds */
#define UMC_DRIVE1 1 /* 0 to 11 allowed */
#define UMC_DRIVE2 1 /* 11 = Fastest Speed */
#define UMC_DRIVE3 1 /* In case of crash reduce speed */
static byte current_speeds[4] = {UMC_DRIVE0, UMC_DRIVE1, UMC_DRIVE2, UMC_DRIVE3};
static const byte pio_to_umc [5] = {0,3,6,10,11}; /* rough guesses */
/* 0 1 2 3 4 5 6 7 8 9 10 11 */
static const byte speedtab [3][12] = {
{0xf, 0xb, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 },
{0x3, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 },
{0xff,0xcb,0xc0,0x58,0x36,0x33,0x23,0x22,0x21,0x11,0x10,0x0}};
void out_umc (char port,char wert)
static void out_umc (char port,char wert)
{
outb_p (port,0x108);
outb_p (wert,0x109);
}
byte in_umc (char port)
static byte in_umc (char port)
{
outb_p (port,0x108);
return inb_p (0x109);
}
void init_umc8672(void)
static void umc_set_speeds (byte speeds[])
{
int i,tmp;
int speed [4];
/* 0 1 2 3 4 5 6 7 8 9 10 11 */
char speedtab [3][12] = {
{0xf ,0xb ,0x2 ,0x2 ,0x2 ,0x1 ,0x1 ,0x1 ,0x1 ,0x1 ,0x1 ,0x1 },
{0x3 ,0x2 ,0x2 ,0x2 ,0x2 ,0x2 ,0x1 ,0x1 ,0x1 ,0x1 ,0x1 ,0x1 },
{0xff,0xcb,0xc0,0x58,0x36,0x33,0x23,0x22,0x21,0x11,0x10,0x0}};
int i, tmp;
unsigned long flags;
save_flags(flags);
cli ();
outb_p (0x5A,0x108); /* enable umc */
if (in_umc (0xd5) != 0xa0)
{
sti ();
printk ("UMC8672 not found\n");
return;
}
speed[0] = UMC_DRIVE0;
speed[1] = UMC_DRIVE1;
speed[2] = UMC_DRIVE2;
speed[3] = UMC_DRIVE3;
for (i = 0;i < 4;i++)
{
if ((speed[i] < 0) || (speed[i] > 11))
{
sti ();
printk ("UMC 8672 drive speed out of range. Drive %d Speed %d\n",
i, speed[i]);
printk ("UMC support aborted\n");
return;
}
}
out_umc (0xd7,(speedtab[0][speed[2]] | (speedtab[0][speed[3]]<<4)));
out_umc (0xd6,(speedtab[0][speed[0]] | (speedtab[0][speed[1]]<<4)));
out_umc (0xd7,(speedtab[0][speeds[2]] | (speedtab[0][speeds[3]]<<4)));
out_umc (0xd6,(speedtab[0][speeds[0]] | (speedtab[0][speeds[1]]<<4)));
tmp = 0;
for (i = 3; i >= 0; i--)
{
tmp = (tmp << 2) | speedtab[1][speed[i]];
tmp = (tmp << 2) | speedtab[1][speeds[i]];
}
out_umc (0xdc,tmp);
for (i = 0;i < 4; i++)
{
out_umc (0xd0+i,speedtab[2][speed[i]]);
out_umc (0xd8+i,speedtab[2][speed[i]]);
out_umc (0xd0+i,speedtab[2][speeds[i]]);
out_umc (0xd8+i,speedtab[2][speeds[i]]);
}
outb_p (0xa5,0x108); /* disable umc */
sti ();
printk ("Speeds for UMC8672 \n");
for (i = 0;i < 4;i++)
printk ("Drive %d speed %d\n",i,speed[i]);
restore_flags(flags);
printk ("umc8672: drive speeds [0 to 11]: %d %d %d %d\n",
speeds[0], speeds[1], speeds[2], speeds[4]);
}
static void tune_umc (ide_drive_t *drive, byte pio)
{
if (pio == 255) { /* auto-tune */
struct hd_driveid *id = drive->id;
pio = id->tPIO;
if (id->field_valid & 0x02) {
if (id->eide_pio_modes & 0x01)
pio = 3;
if (id->eide_pio_modes & 0x02)
pio = 4;
}
}
if (pio > 4)
pio = 4;
current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio];
umc_set_speeds (current_speeds);
}
void init_umc8672 (void) /* called from ide.c */
{
unsigned long flags;
if (check_region(0x108, 2)) {
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 ();
printk ("umc8672: not found\n");
return;
}
outb_p (0xa5,0x108); /* disable umc */
restore_flags(flags);
umc_set_speeds (current_speeds);
request_region(0x108, 2, "umc8672");
ide_hwifs[0].chipset = ide_umc8672;
ide_hwifs[1].chipset = ide_umc8672;
ide_hwifs[0].tuneproc = &tune_umc;
ide_hwifs[1].tuneproc = &tune_umc;
}
......@@ -84,13 +84,17 @@ You can choose from two options:
the vertical synchronization pulse (mode 1) or horizontal
synchronization pulse (mode 2). Mode 1 should work with most
monitors, but the VESA spec allows mode 2, so it's included for
completeness.
completeness. You may set this blanking interval in minutes by
echoing the escape sequence 'ESC[9;interval]' to the terminal.
By default this interval is set to 10 minutes.
If you use one of these modes, you can also set a second interval
by echoing the escape sequence ESC[10;interval] to the terminal.
by echoing the escape sequence 'ESC[14;interval]' to the terminal.
The monitor will be turned off completely (mode 3) after being in
suspend mode for the specified interval. The interval defaults to
60 minutes. An interval of 0 disables this feature.
suspend mode for the specified interval. An interval of 0 disables
this feature which is the default.
Both intervals may be set within the range of 0..60 minutes.
(2) Setting vesa_blanking_mode to 3.
If your monitor locally has an Off_Mode timer then you should not
......@@ -108,6 +112,8 @@ sends the signal to enter Standby mode, you have the chance to interfere
before the monitor powers down. Do not set a too short period, if you love
your hardware :-)) .
By default vesa_blanking_mode is set to 0, thus not using any power saving
features.
*/
#define seq_port_reg (0x3c4) /* Sequencer register select port */
......
......@@ -5,6 +5,7 @@ tristate 'Dummy net driver support' CONFIG_DUMMY
tristate 'SLIP (serial line) support' CONFIG_SLIP
if [ "$CONFIG_SLIP" != "n" ]; then
bool ' CSLIP compressed headers' CONFIG_SLIP_COMPRESSED
bool ' Keepalive and linefill' CONFIG_SLIP_SMART
fi
tristate 'PPP (point-to-point) support' CONFIG_PPP
if [ ! "$CONFIG_PPP" = "n" ]; then
......
......@@ -47,6 +47,7 @@
#include <linux/skbuff.h>
#include <net/sock.h>
#define LOOPBACK_MTU (PAGE_SIZE*7/8)
static int loopback_xmit(struct sk_buff *skb, struct device *dev)
{
......@@ -99,6 +100,9 @@ static int loopback_xmit(struct sk_buff *skb, struct device *dev)
skb->dev=dev;
save_flags(flags);
cli();
#ifndef LOOPBACK_MUST_CHECKSUM
skb->ip_summed = CHECKSUM_UNNECESSARY;
#endif
netif_rx(skb);
if(unlock)
skb_device_unlock(skb);
......@@ -127,14 +131,8 @@ static int loopback_open(struct device *dev)
int loopback_init(struct device *dev)
{
int i;
#if LINUS_EVER_SOLVES_THE_LARGE_ATOMIC_BUFFER_ISSUE
dev->mtu = 7900; /* MTU */
#else
/*
* If Alpha uses 8K pages then I guess 7K would be good for it.
*/
dev->mtu = 2000; /* Kept under 1 page */
#endif
dev->mtu = LOOPBACK_MTU;
dev->tbusy = 0;
dev->hard_start_xmit = loopback_xmit;
dev->open = NULL;
......
......@@ -46,7 +46,10 @@
* With MODULE-loading ``insmod'', user can
* issue parameter: slip_maxdev=1024
* (Or how much he/she wants.. Default is 256)
*
* * Stanislav Voronyi : Slip line checking, with ideas taken
* from multislip BSDI driver which was written
* by Igor Chechik, RELCOM Corp. Only algorithms
* have been ported to Linux SLIP driver.
*/
#define SL_CHECK_TRANSMIT
......@@ -81,9 +84,9 @@
#endif
#ifdef MODULE
#define SLIP_VERSION "0.8.3-NET3.019-NEWTTY-MODULAR"
#define SLIP_VERSION "0.8.4-NET3.019-NEWTTY-MODULAR"
#else
#define SLIP_VERSION "0.8.3-NET3.019-NEWTTY"
#define SLIP_VERSION "0.8.4-NET3.019-NEWTTY"
#endif
......@@ -103,7 +106,10 @@ static void slip_unesc(struct slip *sl, unsigned char c);
static int slip_esc6(unsigned char *p, unsigned char *d, int len);
static void slip_unesc6(struct slip *sl, unsigned char c);
#endif
#ifdef CONFIG_SLIP_SMART
static void sl_keepalive(unsigned long sls);
static void sl_outfill(unsigned long sls);
#endif
/* Find a free SLIP channel, and link in this `tty' line. */
static inline struct slip *
......@@ -442,6 +448,8 @@ sl_encaps(struct slip *sl, unsigned char *icp, int len)
#endif
sl->xleft = count - actual;
sl->xhead = sl->xbuff + actual;
/* VSV */
clear_bit(SLF_OUTWAIT, &sl->flags); /* reset outfill flag */
}
/*
......@@ -457,13 +465,13 @@ static void slip_write_wakeup(struct tty_struct *tty)
if (!sl || sl->magic != SLIP_MAGIC || !sl->dev->start) {
return;
}
if (sl->xleft <= 0) {
/* Now serial buffer is almost free & we can start
* transmission of another packet */
sl->tx_packets++;
tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
sl_unlock(sl);
if (test_bit(0, (void *) &sl->dev->tbusy)) /* add by VSV */
sl_unlock(sl);
mark_bh(NET_BH);
return;
}
......@@ -620,7 +628,16 @@ sl_open(struct device *dev)
sl->xbits = 0;
#endif
sl->flags &= (1 << SLF_INUSE); /* Clear ESCAPE & ERROR flags */
#ifdef CONFIG_SLIP_SMART
sl->keepalive=0; /* no keepalive by default = VSV */
init_timer(&sl->keepalive_timer); /* initialize timer_list struct */
sl->keepalive_timer.data=(unsigned long)sl;
sl->keepalive_timer.function=sl_keepalive;
sl->outfill=0; /* & outfill too */
init_timer(&sl->outfill_timer);
sl->outfill_timer.data=(unsigned long)sl;
sl->outfill_timer.function=sl_outfill;
#endif
/* Needed because address '0' is special */
if (dev->pa_addr == 0) {
dev->pa_addr=ntohl(0xC0A80001);
......@@ -873,6 +890,10 @@ slip_unesc(struct slip *sl, unsigned char s)
switch(s) {
case END:
/* drop keeptest bit = VSV */
if (test_bit(SLF_KEEPTEST, &sl->flags))
clear_bit(SLF_KEEPTEST, &sl->flags);
if (!clear_bit(SLF_ERROR, &sl->flags) && (sl->rcount > 2)) {
sl_bump(sl);
}
......@@ -954,6 +975,10 @@ slip_unesc6(struct slip *sl, unsigned char s)
unsigned char c;
if (s == 0x70) {
/* drop keeptest bit = VSV */
if (test_bit(SLF_KEEPTEST, &sl->flags))
clear_bit(SLF_KEEPTEST, &sl->flags);
if (!clear_bit(SLF_ERROR, &sl->flags) && (sl->rcount > 2)) {
sl_bump(sl);
}
......@@ -1086,6 +1111,60 @@ slip_ioctl(struct tty_struct *tty, void *file, int cmd, void *arg)
return -EINVAL;
#endif
#ifdef CONFIG_SLIP_SMART
/* VSV changes start here */
case SIOCSKEEPALIVE:
if (sl->keepalive)
del_timer (&sl->keepalive_timer);
err = verify_area(VERIFY_READ, arg, sizeof(int));
if (err) {
return -err;
}
tmp = get_user((int *)arg);
if (tmp > 255) /* max for unchar */
return -EINVAL;
if ((sl->keepalive = (unchar) tmp) != 0) {
sl->keepalive_timer.expires=jiffies+sl->keepalive*HZ;
add_timer(&sl->keepalive_timer);
set_bit(SLF_KEEPTEST, &sl->flags);
}
return 0;
case SIOCGKEEPALIVE:
err = verify_area(VERIFY_WRITE, arg, sizeof(int));
if (err) {
return -err;
}
put_user(sl->keepalive, (int *)arg);
return 0;
case SIOCSOUTFILL:
if (sl->outfill)
(void)del_timer (&sl->outfill_timer);
err = verify_area(VERIFY_READ, arg, sizeof(int));
if (err) {
return -err;
}
tmp = get_user((int *)arg);
if (tmp > 255) /* max for unchar */
return -EINVAL;
if ((sl->outfill = (unchar) tmp) != 0){
sl->outfill_timer.expires=jiffies+sl->outfill*HZ;
add_timer(&sl->outfill_timer);
set_bit(SLF_OUTWAIT, &sl->flags);
}
return 0;
case SIOCGOUTFILL:
err = verify_area(VERIFY_WRITE, arg, sizeof(int));
if (err) {
return -err;
}
put_user(sl->outfill, (int *)arg);
return 0;
/* VSV changes end */
#endif
/* Allow stty to read, but not set, the serial port */
case TCGETS:
case TCGETA:
......@@ -1108,8 +1187,7 @@ static int sl_open_dev(struct device *dev)
#ifdef MODULE
static int slip_init_ctrl_dev(void)
#else /* !MODULE */
int
slip_init_ctrl_dev(struct device *dummy)
int slip_init_ctrl_dev(struct device *dummy)
#endif /* !MODULE */
{
int status;
......@@ -1120,19 +1198,23 @@ slip_init_ctrl_dev(struct device *dummy)
#ifdef CONFIG_SLIP_MODE_SLIP6
" (6 bit encapsulation enabled)"
#endif
"\n",
".\n",
SLIP_VERSION, slip_maxdev );
#if defined(SL_INCLUDE_CSLIP) && !defined(MODULE)
printk("CSLIP: code copyright 1989 Regents of the University of California\n");
printk("CSLIP: code copyright 1989 Regents of the University of California.\n");
#endif
#ifdef CONFIG_AX25
printk("AX25: KISS encapsulation enabled\n");
printk("AX25: KISS encapsulation enabled.\n");
#endif
#ifdef CONFIG_SLIP_SMART
printk("SLIP linefill/keepalive option.\n");
#endif
slip_ctrls = (slip_ctrl_t **) kmalloc(sizeof(void*)*slip_maxdev, GFP_KERNEL);
if (slip_ctrls == NULL) {
printk("SLIP: Can't allocate slip_ctrls[] array! Uaargh! (-> No SLIP available)\n");
return -ENOMEM;
if (slip_ctrls == NULL)
{
printk("SLIP: Can't allocate slip_ctrls[] array! Uaargh! (-> No SLIP available)\n");
return -ENOMEM;
}
/* Clear the pointer array, we allocate devices when we need them */
......@@ -1153,7 +1235,7 @@ slip_init_ctrl_dev(struct device *dummy)
sl_ldisc.receive_room = slip_receive_room;
sl_ldisc.write_wakeup = slip_write_wakeup;
if ((status = tty_register_ldisc(N_SLIP, &sl_ldisc)) != 0) {
printk("SLIP: can't register line discipline (err = %d)\n", status);
printk("SLIP: can't register line discipline (err = %d)\n", status);
}
......@@ -1242,18 +1324,95 @@ cleanup_module(void)
{
int i;
if (slip_ctrls != NULL) {
for (i = 0; i < slip_maxdev; i++) {
if (slip_ctrls[i] != NULL) {
unregister_netdev(&(slip_ctrls[i]->dev));
kfree(slip_ctrls[i]);
}
}
kfree(slip_ctrls);
slip_ctrls = NULL;
if (slip_ctrls != NULL)
{
for (i = 0; i < slip_maxdev; i++)
{
if (slip_ctrls[i] != NULL)
{
unregister_netdev(&(slip_ctrls[i]->dev));
kfree(slip_ctrls[i]);
}
}
kfree(slip_ctrls);
slip_ctrls = NULL;
}
if ((i = tty_register_ldisc(N_SLIP, NULL))) {
printk("SLIP: can't unregister line discipline (err = %d)\n", i);
if ((i = tty_register_ldisc(N_SLIP, NULL)))
{
printk("SLIP: can't unregister line discipline (err = %d)\n", i);
}
}
#endif /* MODULE */
#ifdef CONFIG_SLIP_SMART
/*
* This is start of the code for multislip style line checking
* added by Stanislav Voronyi. All changes before marked VSV
*/
static void sl_outfill(unsigned long sls)
{
struct slip *sl=(struct slip *)sls;
if(sls==NULL)
return;
if(sl->outfill)
{
if( test_bit(SLF_OUTWAIT, &sl->flags) )
{
/* no packets was transmited, do outfill */
#ifdef CONFIG_SLIP_MODE_SLIP6
unsigned char s = (sl->mode & SL_MODE_SLIP6)?0x70:END;
#else
unsigned char s = END;
#endif
/* put END into tty queue. Is it right ??? */
if (!test_bit(0, (void *) &sl->dev->tbusy))
{
/* if device busy no outfill */
sl->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
sl->tty->driver.write(sl->tty, 0, &s, 1);
}
}
else
set_bit(SLF_OUTWAIT, &sl->flags);
(void)del_timer(&sl->outfill_timer);
sl->outfill_timer.expires=jiffies+sl->outfill*HZ;
add_timer(&sl->outfill_timer);
}
else
del_timer(&sl->outfill_timer);
}
static void sl_keepalive(unsigned long sls)
{
struct slip *sl=(struct slip *)sls;
if(sls==NULL)
return;
if( sl->keepalive)
{
if(test_bit(SLF_KEEPTEST, &sl->flags))
{
/* keepalive still high :(, we must hangup */
(void)del_timer(&sl->keepalive_timer);
if( sl->outfill ) /* outfill timer must be deleted too */
(void)del_timer(&sl->outfill_timer);
printk("%s: no packets received during keepalive timeout, hangup.\n", sl->dev->name);
tty_hangup(sl->tty); /* this must hangup tty & close slip */
/* I think we need not something else */
return;
}
else
set_bit(SLF_KEEPTEST, &sl->flags);
(void)del_timer(&sl->keepalive_timer);
sl->keepalive_timer.expires=jiffies+sl->keepalive*HZ;
add_timer(&sl->keepalive_timer);
}
else
(void)del_timer(&sl->keepalive_timer);
}
#endif
......@@ -12,6 +12,8 @@
* Alan Cox : Added SL_SLIP_LOTS
* Dmitry Gorodchanin : A lot of changes in the 'struct slip'
* Dmitry Gorodchanin : Added CSLIP statistics.
* Stanislav Voronyi : Make line checking as created by
* Igor Chechik, RELCOM Corp.
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
*/
......@@ -87,6 +89,8 @@ struct slip {
#define SLF_INUSE 0 /* Channel in use */
#define SLF_ESCAPE 1 /* ESC received */
#define SLF_ERROR 2 /* Parity, etc. error */
#define SLF_KEEPTEST 4 /* Keepalive test flag */
#define SLF_OUTWAIT 8 /* is outpacket was flag */
unsigned char mode; /* SLIP mode */
#define SL_MODE_SLIP 0
......@@ -95,6 +99,12 @@ struct slip {
#define SL_MODE_CSLIP6 (SL_MODE_SLIP6|SL_MODE_CSLIP)
#define SL_MODE_AX25 4
#define SL_MODE_ADAPTIVE 8
#ifdef CONFIG_SLIP_SMART
unsigned char outfill; /* # of sec betwen outfill packet */
unsigned char keepalive; /* keepalive seconds */
struct timer_list outfill_timer;
struct timer_list keepalive_timer;
#endif
};
......
......@@ -68,6 +68,8 @@
* the high level code.
*/
#include "g_NCR5380.h"
#if (NDEBUG & NDEBUG_LISTS)
#define LIST(x,y) {printk("LINE:%d Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); if ((x)==(y)) udelay(5); }
#define REMOVE(w,x,y,z) {printk("LINE:%d Removing: %p->%p %p->%p \n", __LINE__, (void*)(w), (void*)(x), (void*)(y), (void*)(z)); if ((x)==(y)) udelay(5); }
......
......@@ -109,6 +109,7 @@
#include <asm/system.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <asm/io.h>
#include <linux/blk.h>
#include "scsi.h"
#include "hosts.h"
......
......@@ -678,7 +678,7 @@ ask_parameters (void)
ask_int_choice (B (OPT_GUS), "GUS_BASE",
"I/O base for Gravis UltraSound (GUS)",
"I/O base for GUS",
FMT_HEX,
0x220,
"210, 220, 230, 240, 250 or 260");
......
......@@ -52,7 +52,7 @@ endif
ifeq ($(CONFIG_FAT_FS),y)
SUB_DIRS += fat
else
ifeq ($(CONFIG_MSDOS_FS),m)
ifeq ($(CONFIG_FAT_FS),m)
MOD_SUB_DIRS += fat
endif
endif
......@@ -149,4 +149,12 @@ else
endif
endif
ifeq ($(CONFIG_BINFMT_AOUT),y)
BINFMTS += binfmt_aout.o
else
ifeq ($(CONFIG_BINFMT_AOUT),m)
M_OBJS += binfmt_aout.o
endif
endif
include $(TOPDIR)/Rules.make
This diff is collapsed.
......@@ -33,11 +33,6 @@
#include <linux/config.h>
#include <linux/unistd.h>
typedef int (*sysfun_p)(int, ...);
extern sysfun_p sys_call_table[];
#define SYS(name) (sys_call_table[__NR_##name])
#define DLINFO_ITEMS 12
#include <linux/elf.h>
......@@ -47,13 +42,7 @@ static int load_elf_library(int fd);
static int elf_core_dump(long signr, struct pt_regs * regs);
extern int dump_fpu (elf_fpregset_t *);
/*
* Please do not change the default core dump format to ELF when most people
* do not have a gdb capable of interpreting ELF core files. Once a gdb has
* been released that understands ELF, *THEN* switch the core dump format.
*/
struct linux_binfmt elf_format = {
static struct linux_binfmt elf_format = {
#ifndef MODULE
NULL, NULL, load_elf_binary, load_elf_library, elf_core_dump
#else
......@@ -61,6 +50,18 @@ struct linux_binfmt elf_format = {
#endif
};
static void set_brk(unsigned long start, unsigned long end)
{
start = PAGE_ALIGN(start);
end = PAGE_ALIGN(end);
if (end <= start)
return;
do_mmap(NULL, start, end - start,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_FIXED | MAP_PRIVATE, 0);
}
/* We need to explicitly zero any fractional pages
after the data section (i.e. bss). This would
contain the junk from the file that should not
......@@ -268,7 +269,7 @@ static unsigned int load_elf_interp(struct elfhdr * interp_elf_ex,
/* Now use mmap to map the library into memory. */
SYS(close)(elf_exec_fileno);
sys_close(elf_exec_fileno);
if(error < 0 && error > -1024) {
kfree(elf_phdata);
return 0xffffffff;
......@@ -615,7 +616,7 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
kfree(elf_phdata);
if(interpreter_type != INTERPRETER_AOUT) SYS(close)(elf_exec_fileno);
if(interpreter_type != INTERPRETER_AOUT) sys_close(elf_exec_fileno);
current->personality = (ibcs2_interpreter ? PER_SVR4 : PER_LINUX);
if (current->exec_domain && current->exec_domain->use_count)
......@@ -655,10 +656,9 @@ do_load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
current->mm->end_data = end_data;
current->mm->start_stack = bprm->p;
/* Calling sys_brk effectively mmaps the pages that we need for the bss and break
/* Calling set_brk effectively mmaps the pages that we need for the bss and break
sections */
current->mm->brk = (elf_bss + 0xfff) & 0xfffff000;
SYS(brk)((elf_brk + 0xfff) & 0xfffff000);
set_brk(elf_bss, elf_brk);
padzero(elf_bss);
......@@ -1221,6 +1221,10 @@ static int elf_core_dump(long signr, struct pt_regs * regs)
return has_dumped;
}
int init_elf_binfmt(void) {
return register_binfmt(&elf_format);
}
#ifdef MODULE
int init_module(void) {
......@@ -1228,7 +1232,7 @@ int init_module(void) {
* N.B. We *rely* on the table being the right size with the
* right number of free slots...
*/
return register_binfmt(&elf_format);
return init_elf_binfmt();
}
......
......@@ -35,9 +35,10 @@
#include <asm/segment.h>
#include <asm/io.h>
#define NR_SIZES 4
static char buffersize_index[9] = {-1, 0, 1, -1, 2, -1, -1, -1, 3};
static short int bufferindex_size[NR_SIZES] = {512, 1024, 2048, 4096};
#define NR_SIZES 5
static char buffersize_index[17] =
{-1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 4};
static short int bufferindex_size[NR_SIZES] = {512, 1024, 2048, 4096, 8192};
#define BUFSIZE_INDEX(X) ((int) buffersize_index[(X)>>9])
#define MAX_BUF_PER_PAGE (PAGE_SIZE / 512)
......@@ -99,7 +100,7 @@ static union bdflush_param{
trim back the buffers */
} b_un;
unsigned int data[N_PARAM];
} bdf_prm = {{25, 500, 64, 256, 15, 30*HZ, 5*HZ, 1884, 2}};
} bdf_prm = {{60, 500, 64, 256, 15, 30*HZ, 5*HZ, 1884, 2}};
/* The lav constant is set for 1 minute, as long as the update process runs
every 5 seconds. If you change the frequency of update, the time
......@@ -502,9 +503,12 @@ void set_blocksize(kdev_t dev, int size)
if (!blksize_size[MAJOR(dev)])
return;
if (size > PAGE_SIZE)
size = 0;
switch(size) {
default: panic("Invalid blocksize passed to set_blocksize");
case 512: case 1024: case 2048: case 4096:;
case 512: case 1024: case 2048: case 4096: case 8192: ;
}
if (blksize_size[MAJOR(dev)][MINOR(dev)] == 0 && size == BLOCK_SIZE) {
......
This diff is collapsed.
/*
* linux/fs/msdos/buffer.c
* linux/fs/fat/buffer.c
*
*
*/
......
/*
* linux/fs/msdos/cache.c
* linux/fs/fat/cache.c
*
* Written 1992,1993 by Werner Almesberger
*/
......
/*
* linux/fs/msdos/dir.c
* MS-DOS directory handling functions
* linux/fs/fat/dir.c
*
* directory handling functions for fat-based filesystems
*
* Written 1992,1993 by Werner Almesberger
*
......
/*
* linux/fs/fat/fatfs_syms.c
*
* Exported kernel symbols for the low-level FAT-based fs support.
*
*/
#include <linux/module.h>
#include <linux/msdos_fs.h>
......@@ -5,6 +11,8 @@
#include "msbuffer.h"
#include "tables.h"
extern struct file_operations fat_dir_operations;
static struct symbol_table fat_syms = {
#include <linux/symtab_begin.h>
X(fat_a2alias),
......
/*
* linux/fs/msdos/file.c
* linux/fs/fat/file.c
*
* Written 1992,1993 by Werner Almesberger
*
* MS-DOS regular file handling primitives
* regular file handling primitives for fat-based filesystems
*/
#include <linux/sched.h>
......
/*
* linux/fs/msdos/inode.c
* linux/fs/fat/inode.c
*
* Written 1992,1993 by Werner Almesberger
* VFAT extensions by Gordon Chaffee, merged with msdos fs by Henrik Storner
......
/*
* linux/fs/msdos/misc.c
* linux/fs/fat/misc.c
*
* Written 1992,1993 by Werner Almesberger
*/
......
/*
* fs/msdos/mmap.c
* linux/fs/fat/mmap.c
*
* Written by Jacques Gelinas (jacques@solucorp.qc.ca)
* Inspired by fs/nfs/mmap.c (Jon Tombs 15 Aug 1993)
*
* msdos mmap handling
* mmap handling for fat-based filesystems
*/
#include <linux/stat.h>
......
/*
* linux/fs/msdos/tables.c
* linux/fs/fat/tables.c
*
* ASCII / Unicode translation tables for VFAT filename handling.
* By Gordon Chaffee.
*
* Note: This file is used by all fat-based filesystems.
*/
#include <linux/kernel.h>
......
......@@ -25,6 +25,7 @@
#include <linux/major.h>
extern void device_setup(void);
extern void binfmt_setup(void);
#ifdef CONFIG_ROOT_NFS
extern int nfs_root_init(char *nfsname, char *nfsaddrs);
......@@ -43,6 +44,8 @@ asmlinkage int sys_setup(void)
device_setup();
binfmt_setup();
#ifdef CONFIG_EXT_FS
init_ext_fs();
#endif
......@@ -59,6 +62,10 @@ asmlinkage int sys_setup(void)
init_minix_fs();
#endif
#ifdef CONFIG_UMSDOS_FS
init_umsdos_fs();
#endif
#ifdef CONFIG_FAT_FS
init_fat_fs();
#endif
......@@ -71,10 +78,6 @@ asmlinkage int sys_setup(void)
init_vfat_fs();
#endif
#ifdef CONFIG_UMSDOS_FS
init_umsdos_fs();
#endif
#ifdef CONFIG_PROC_FS
init_proc_fs();
#endif
......
......@@ -55,6 +55,10 @@
* above, mandatory locks requires lots of changes elsewhere and I am
* reluctant to start something so drastic for so little gain.
* Andy Walker (andy@keo.kvaerner.no), June 09, 1995
*
* Removed some race conditions in flock_lock_file(), marked other possible
* races. Just grep for FIXME to see them.
* Dmitry Gorodchanin (begemot@bgm.rosprint.net), Feb 09, 1996.
*/
#include <asm/segment.h>
......@@ -66,6 +70,7 @@
#include <linux/stat.h>
#include <linux/fcntl.h>
#define OFFSET_MAX ((off_t)0x7fffffff) /* FIXME: move elsewhere? */
static int flock_make_lock(struct file *filp, struct file_lock *fl,
......@@ -88,10 +93,60 @@ static int locks_overlap(struct file_lock *fl1, struct file_lock *fl2);
static struct file_lock *locks_alloc_lock(struct file_lock *fl);
static void locks_insert_lock(struct file_lock **pos, struct file_lock *fl);
static void locks_delete_lock(struct file_lock **fl, unsigned int wait);
static void locks_insert_block(struct file_lock **block, struct file_lock *fl);
static struct file_lock *file_lock_table = NULL;
/* Free lock not inserted in any queue */
static inline void locks_free_lock(struct file_lock **fl)
{
kfree(*fl);
*fl = NULL; /* Just in case */
}
/* Add lock fl to the blocked list pointed to by block.
* We search to the end of the existing list and insert the the new
* struct. This ensures processes will be woken up in the order they
* blocked.
* NOTE: nowhere does the documentation insist that processes be woken
* up in this order, but it seems like the reasonable thing to do.
* If the blocked list gets long then this search could get expensive,
* in which case we could consider waking the processes up in reverse
* order, or making the blocked list a doubly linked circular list.
*
* This functions are called only from one place (flock_lock_file)
* so they are inlined now. -- Dmitry Gorodchanin 02/09/96.
*/
static inline void locks_insert_block(struct file_lock **block,
struct file_lock *fl)
{
struct file_lock *bfl;
while ((bfl = *block) != NULL) {
block = &bfl->fl_block;
}
*block = fl;
fl->fl_block = NULL;
return;
}
static inline void locks_delete_block(struct file_lock **block,
struct file_lock *fl)
{
struct file_lock *bfl;
while ((bfl = *block) != NULL) {
if (bfl == fl) {
*block = fl->fl_block;
fl->fl_block = NULL;
return;
}
block = &bfl->fl_block;
}
}
/* flock() system call entry point. Apply a FLOCK style locks to
* an open file descriptor.
*/
......@@ -378,6 +433,11 @@ static int locks_overlap(struct file_lock *fl1, struct file_lock *fl2)
* The detection scheme is recursive... we may need a test to make it exit if the
* function gets stuck due to bad lock data. 4.4 BSD uses a maximum depth of 50
* for this.
*
* FIXME:
* IMHO this function is dangerous, deep recursion may result in kernel stack
* corruption. Perhaps we need to limit depth here.
* Dmitry Gorodchanin 09/02/96
*/
static int posix_locks_deadlock(struct task_struct *my_task,
struct task_struct *blocked_task)
......@@ -447,19 +507,33 @@ static int flock_lock_file(struct file *filp, struct file_lock *caller,
if (wait) {
if (current->signal & ~current->blocked) {
locks_delete_lock(&new_fl, 0);
/* Note: new_fl is not in any queue at this
* point. So we must use locks_free_lock()
* instead of locks_delete_lock()
* Dmitry Gorodchanin 09/02/96.
*/
locks_free_lock(&new_fl);
return (-ERESTARTSYS);
}
locks_insert_block(&fl->fl_block, new_fl);
interruptible_sleep_on(&new_fl->fl_wait);
wake_up(&new_fl->fl_wait);
if (current->signal & ~current->blocked) {
locks_delete_lock(&new_fl, 0);
/* If we are here, than we were awaken
* by signal, so new_fl is still in
* block queue of fl. We need remove
* new_fl and then free it.
* Dmitry Gorodchanin 09/02/96.
*/
locks_delete_block(&fl->fl_block, new_fl);
locks_free_lock(&new_fl);
return (-ERESTARTSYS);
}
goto repeat;
}
locks_delete_lock(&new_fl, 0);
locks_free_lock(&new_fl);
return (-EAGAIN);
}
locks_insert_lock(&filp->f_inode->i_flock, new_fl);
......@@ -516,8 +590,10 @@ static int posix_lock_file(struct file *filp, struct file_lock *caller,
/* First skip FLOCK locks and locks owned by other processes.
*/
while ((fl = *before) && ((fl->fl_flags == F_FLOCK) ||
(caller->fl_owner != fl->fl_owner)))
(caller->fl_owner != fl->fl_owner))) {
before = &fl->fl_next;
}
/* Process locks with this owner.
*/
......@@ -596,6 +672,18 @@ static int posix_lock_file(struct file *filp, struct file_lock *caller,
before = &(*before)->fl_next;
}
/* FIXME:
* Note: We may sleep in locks_alloc_lock(), so
* the 'before' pointer may be not valid any more.
* This can cause random kernel memory corruption.
* It seems the right way is to alloc two locks
* at the begining of this func, and then free them
* if they were not needed.
* Another way is to change GFP_KERNEL to GFP_ATOMIC
* in locks_alloc_lock() for this case.
*
* Dmitry Gorodchanin 09/02/96.
*/
if (!added) {
if (caller->fl_type == F_UNLCK)
return (0);
......@@ -691,9 +779,10 @@ static void locks_delete_lock(struct file_lock **fl_p, unsigned int wait)
if (fl->fl_prevlink != NULL)
fl->fl_prevlink->fl_nextlink = fl->fl_nextlink;
else
else {
file_lock_table = fl->fl_nextlink;
}
while ((bfl = fl->fl_block) != NULL) {
fl->fl_block = bfl->fl_block;
bfl->fl_block = NULL;
......@@ -707,27 +796,3 @@ static void locks_delete_lock(struct file_lock **fl_p, unsigned int wait)
return;
}
/* Add lock fl to the blocked list pointed to by block.
* We search to the end of the existing list and insert the the new
* struct. This ensures processes will be woken up in the order they
* blocked.
* NOTE: nowhere does the documentation insist that processes be woken
* up in this order, but it seems like the reasonable thing to do.
* If the blocked list gets long then this search could get expensive,
* in which case we could consider waking the processes up in reverse
* order, or making the blocked list a doubly linked circular list.
*/
static void locks_insert_block(struct file_lock **block, struct file_lock *fl)
{
struct file_lock *bfl;
while ((bfl = *block) != NULL)
block = &bfl->fl_block;
*block = fl;
fl->fl_block = NULL;
return;
}
/*
* linux/fs/msdos/msdosfs_syms.c
*
* Exported kernel symbols for the MS-DOS filesystem.
* These symbols are used by umsdos.
*/
#include <linux/module.h>
#include <linux/msdos_fs.h>
......
/*
* linux/fs/msdos/msdos.c
* linux/fs/msdos/namei.c
*
* Written 1992,1993 by Werner Almesberger
* Hidden files 1995 by Albert Cahalan <albert@ccs.neu.edu> <adc@coe.neu.edu>
......
......@@ -134,24 +134,24 @@ extern unsigned long prof_shift;
*/
static int read_profile(struct inode *inode, struct file *file, char *buf, int count)
{
unsigned long p = file->f_pos;
unsigned long p = file->f_pos;
int read;
char * pnt;
unsigned long sample_step = 1 << prof_shift;
if (count < 0)
return -EINVAL;
return -EINVAL;
if (p >= (prof_len+1)*sizeof(unsigned long))
return 0;
return 0;
if (count > (prof_len+1)*sizeof(unsigned long) - p)
count = (prof_len+1)*sizeof(unsigned long) - p;
read = 0;
count = (prof_len+1)*sizeof(unsigned long) - p;
read = 0;
while (p < sizeof(unsigned long) && count > 0) {
put_user(*((char *)(&sample_step)+p),buf);
while (p < sizeof(unsigned long) && count > 0) {
put_user(*((char *)(&sample_step)+p),buf);
buf++; p++; count--; read++;
}
pnt = (char *)prof_buffer + p - sizeof(unsigned long);
}
pnt = (char *)prof_buffer + p - sizeof(unsigned long);
memcpy_tofs(buf,(void *)pnt,count);
read += count;
file->f_pos += read;
......
This diff is collapsed.
/*
* linux/fs/msdos/vfat.c
* linux/fs/vfat/namei.c
*
* Written 1992,1993 by Werner Almesberger
*
......
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