Commit 3539df60 authored by Linus Torvalds's avatar Linus Torvalds

Import pre2.0.4

parent 34b2a5d2
...@@ -29,6 +29,8 @@ Current Releases ...@@ -29,6 +29,8 @@ Current Releases
- Gpm 1.06 - Gpm 1.06
- SysVinit 2.60 - SysVinit 2.60
- Util-linux 2.5 - Util-linux 2.5
- Mtools 3.0
- Fdutils 4.3
Upgrade notes Upgrade notes
************* *************
...@@ -304,6 +306,31 @@ Please send info about any other packages that 1.3.x "broke" or about ...@@ -304,6 +306,31 @@ Please send info about any other packages that 1.3.x "broke" or about
any new features of 1.3.x that require extra or new packages for use to any new features of 1.3.x that require extra or new packages for use to
Chris Ricker (gt1355b@prism.gatech.edu). Chris Ricker (gt1355b@prism.gatech.edu).
Mtools and fdutils
==================
The floppy ioctl numbering scheme has changed in 1.3.x. For
backwards compatibility, the old numbering scheme was supported
throughout 1.3.x. A warning will be printed in 2.0.x when the old
numbers are used, and their use will be discontinued entirely in 2.1.x
In order to avoid trouble, you need to recompile any programs that
emit floppy ioctls. These include mtools and fdutils. You can get
mtools at:
ftp://ftp.imag.fr/pub/Linux/ZLIBC/mtools/mtools-3.0.src.tar.gz
ftp://sunsite.unc.edu/pub/Linux/utils/disk-management/mtools-3.0.src.tar.gz
ftp://tsx-11.mit.edu/pub/linux/sources/usr.bin/mtools-3.0.src.tar.gz
You can get fdutils at:
ftp://ftp.imag.fr/pub/Linux/ZLIBC/fdutils/fdutils-4.3.src.tar.gz
ftp://sunsite.unc.edu/pub/Linux/system/Misc/fdutils-4.3.src.tar.gz
ftp://tsx-11.mit.edu/pub/linux/sources/sbin/fdutils-4.3.src.tar.gz
In the future, the ioctl used by fdformat might be discontinued
altogether. Please use superformat (included in fdutils) instead.
How to know the version of the installed programs How to know the version of the installed programs
************************************************* *************************************************
...@@ -408,3 +435,16 @@ Util-linux ...@@ -408,3 +435,16 @@ Util-linux
ftp://sunsite.unc.edu/pub/Linux/system/Misc/util-linux-2.5.tar.gz ftp://sunsite.unc.edu/pub/Linux/system/Misc/util-linux-2.5.tar.gz
Mtools
======
ftp://ftp.imag.fr/pub/Linux/ZLIBC/mtools/mtools-3.0.src.tar.gz
ftp://sunsite.unc.edu/pub/Linux/utils/disk-management/mtools-3.0.src.tar.gz
ftp://tsx-11.mit.edu/pub/linux/sources/usr.bin/mtools-3.0.src.tar.gz
Fdutils
=======
ftp://ftp.imag.fr/pub/Linux/ZLIBC/fdutils/fdutils-4.3.src.tar.gz
ftp://sunsite.unc.edu/pub/Linux/system/Misc/fdutils-4.3.src.tar.gz
ftp://tsx-11.mit.edu/pub/linux/sources/sbin/fdutils-4.3.src.tar.gz
VERSION = 1 VERSION = 1
PATCHLEVEL = 99 PATCHLEVEL = 99
SUBLEVEL = 3 SUBLEVEL = 4
ARCH = i386 ARCH = i386
......
Linux kernel release 1.3.xx Linux kernel release 2.0.xx
These are the release notes for linux version 1.3. Read them carefully, These are the release notes for linux version 2.0. Read them carefully,
as they tell you what this is all about, explain how to install the as they tell you what this is all about, explain how to install the
kernel, and what to do if something goes wrong. kernel, and what to do if something goes wrong.
Linux version 1.3 is a DEVELOPMENT kernel, and not intended for general
public use. Different releases may have various and sometimes severe
bugs. It is *strongly* recommended that you back up the previous kernel
before installing any new 1.3.xx release.
If you need to use a proven and stable Linux kernel, please
use 1.0.9 or 1.2.13. All features found in the 1.3.xx releases
will be contained in 2.0 when the code base has stabilized again.
If you decide to use 1.3, it might be a good idea to follow the kernel
channel, available as newsgroup (under linux.dev.kernel) and as mailing
list. To subscribe to the latter, e-mail majordomo@vger.rutgers.edu,
and put in the body of the message "subscribe linux-kernel" or
"subscribe linux-kernel-digest" for a daily digest of the mailing list
(it is a high-traffic list). Note that getting subscribed or unsubscribed
sometimes takes days or even weeks.
WHAT IS LINUX? WHAT IS LINUX?
Linux is a Unix clone written from scratch by Linus Torvalds with Linux is a Unix clone written from scratch by Linus Torvalds with
...@@ -60,16 +43,16 @@ INSTALLING the kernel: ...@@ -60,16 +43,16 @@ INSTALLING the kernel:
- If you install the full sources, do a - If you install the full sources, do a
cd /usr/src cd /usr/src
gzip -cd linux-1.3.XX.tar.gz | tar xfv - gzip -cd linux-2.0.XX.tar.gz | tar xfv -
to get it all put in place. Replace "XX" with the version number of the to get it all put in place. Replace "XX" with the version number of the
latest kernel. latest kernel.
- You can also upgrade between 1.3.xx releases by patching. For a large - You can also upgrade between 2.0.xx releases by patching. Each
set of revisions, it is not worth the effort since the full set of patch that is released for 2.0.xx contains only bugfixes. No
patches is bigger than a new kernel distribution. Instead, get the new features will be added to the Linux kernel until the 2.1.xx
latest full source archive and install as above. Then, get all newer development effort begins. To install by patching, get all the
patch files, and do newer patch files and do
cd /usr/src cd /usr/src
gzip -cd patchXX.gz | patch -p0 gzip -cd patchXX.gz | patch -p0
...@@ -118,7 +101,6 @@ CONFIGURING the kernel: ...@@ -118,7 +101,6 @@ CONFIGURING the kernel:
"make menuconfig" Text based color menus, radiolists & dialogs. "make menuconfig" Text based color menus, radiolists & dialogs.
"make xconfig" X windows based configuration tool. "make xconfig" X windows based configuration tool.
NOTES on "make config": NOTES on "make config":
- having unnecessary drivers will make the kernel bigger, and can - having unnecessary drivers will make the kernel bigger, and can
under some circumstances lead to problems: probing for a under some circumstances lead to problems: probing for a
...@@ -166,7 +148,10 @@ COMPILING the kernel: ...@@ -166,7 +148,10 @@ COMPILING the kernel:
For some, this is on a floppy disk, in which case you can "cp For some, this is on a floppy disk, in which case you can "cp
/usr/src/linux/arch/i386/boot/zImage /dev/fd0" to make a bootable /usr/src/linux/arch/i386/boot/zImage /dev/fd0" to make a bootable
floppy. floppy. Note that as of Linux 2.0.0, a kernel copied to a 720k
double-density 3.5" floppy disk no longer boots. In this case,
it is highly recommended that you install LILO on your
double-density bootfloppy or switch to high-density floppies.
If you boot Linux from the hard drive, chances are you use LILO which If you boot Linux from the hard drive, chances are you use LILO which
uses the kernel image as specified in the file /etc/lilo.conf. The uses the kernel image as specified in the file /etc/lilo.conf. The
......
...@@ -78,7 +78,6 @@ priority = 8 ...@@ -78,7 +78,6 @@ priority = 8
signal = 12 signal = 12
blocked = 16 blocked = 16
flags = 20 flags = 20
errno = 24
dbgreg6 = 52 dbgreg6 = 52
dbgreg7 = 56 dbgreg7 = 56
exec_domain = 60 exec_domain = 60
...@@ -298,18 +297,12 @@ ENTRY(system_call) ...@@ -298,18 +297,12 @@ ENTRY(system_call)
movl SYMBOL_NAME(current_set),%ebx movl SYMBOL_NAME(current_set),%ebx
#endif #endif
andl $~CF_MASK,EFLAGS(%esp) # clear carry - assume no errors andl $~CF_MASK,EFLAGS(%esp) # clear carry - assume no errors
movl $0,errno(%ebx)
movl %db6,%edx movl %db6,%edx
movl %edx,dbgreg6(%ebx) # save current hardware debugging status movl %edx,dbgreg6(%ebx) # save current hardware debugging status
testb $0x20,flags(%ebx) # PF_TRACESYS testb $0x20,flags(%ebx) # PF_TRACESYS
jne 1f jne 1f
call *%eax call *%eax
movl %eax,EAX(%esp) # save the return value movl %eax,EAX(%esp) # save the return value
movl errno(%ebx),%edx
negl %edx
je ret_from_sys_call
movl %edx,EAX(%esp)
orl $(CF_MASK),EFLAGS(%esp) # set carry to indicate error
jmp ret_from_sys_call jmp ret_from_sys_call
ALIGN ALIGN
1: call SYMBOL_NAME(syscall_trace) 1: call SYMBOL_NAME(syscall_trace)
...@@ -322,12 +315,7 @@ ENTRY(system_call) ...@@ -322,12 +315,7 @@ ENTRY(system_call)
#else #else
movl SYMBOL_NAME(current_set),%eax movl SYMBOL_NAME(current_set),%eax
#endif #endif
movl errno(%eax),%edx call SYMBOL_NAME(syscall_trace)
negl %edx
je 1f
movl %edx,EAX(%esp)
orl $(CF_MASK),EFLAGS(%esp) # set carry to indicate error
1: call SYMBOL_NAME(syscall_trace)
ALIGN ALIGN
.globl ret_from_sys_call .globl ret_from_sys_call
......
...@@ -534,6 +534,7 @@ static int fd_eject(int drive) ...@@ -534,6 +534,7 @@ static int fd_eject(int drive)
udelay(500); udelay(500);
set_dor(0, ~0x80, 0); set_dor(0, ~0x80, 0);
udelay(500); udelay(500);
return 0;
} }
#else #else
#define fd_eject(x) -EINVAL #define fd_eject(x) -EINVAL
......
...@@ -224,15 +224,6 @@ ethif_probe(struct device *dev) ...@@ -224,15 +224,6 @@ ethif_probe(struct device *dev)
# define NEXT_DEV (&sdla0_dev) # define NEXT_DEV (&sdla0_dev)
#endif #endif
/* This must be AFTER the various FRADs so it initializes FIRST! */
#ifdef CONFIG_DLCI
extern int dlci_init(struct device *);
static struct device dlci_dev = { "dlci", 0, 0, 0, 0, 0, 0, 0, 0, 0, NEXT_DEV, dlci_init, };
# undef NEXT_DEV
# define NEXT_DEV (&dlci_dev)
#endif
#ifdef CONFIG_NETROM #ifdef CONFIG_NETROM
extern int nr_init(struct device *); extern int nr_init(struct device *);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* interfaces. Requires 'dlcicfg' program to create usable * interfaces. Requires 'dlcicfg' program to create usable
* interfaces, the initial one, 'dlci' is for IOCTL use only. * interfaces, the initial one, 'dlci' is for IOCTL use only.
* *
* Version: @(#)dlci.c 0.20 13 Apr 1996 * Version: @(#)dlci.c 0.25 13 May 1996
* *
* Author: Mike McLagan <mike.mclagan@linux.org> * Author: Mike McLagan <mike.mclagan@linux.org>
* *
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* returned from the FRAD, the packet is * returned from the FRAD, the packet is
* sent back to Linux for re-transmission * sent back to Linux for re-transmission
* *
* 0.25 Mike McLagan Converted to use SIOC IOCTL calls
*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version * as published by the Free Software Foundation; either version
...@@ -52,7 +54,7 @@ ...@@ -52,7 +54,7 @@
#include <net/sock.h> #include <net/sock.h>
static const char *devname = "dlci"; static const char *devname = "dlci";
static const char *version = "DLCI driver v0.20, 13 Apr 1996, mike.mclagan@linux.org"; static const char *version = "DLCI driver v0.25, 13 May 1996, mike.mclagan@linux.org";
static struct device *open_dev[CONFIG_DLCI_COUNT]; static struct device *open_dev[CONFIG_DLCI_COUNT];
...@@ -277,23 +279,156 @@ static int dlci_transmit(struct sk_buff *skb, struct device *dev) ...@@ -277,23 +279,156 @@ static int dlci_transmit(struct sk_buff *skb, struct device *dev)
return(ret); return(ret);
} }
int dlci_add(struct dlci_add *new) int dlci_config(struct device *dev, struct dlci_conf *conf, int get)
{ {
struct device *master, *slave; struct dlci_conf config;
struct dlci_local *dlp; struct dlci_local *dlp;
struct frad_local *flp; struct frad_local *flp;
struct dlci_add dlci; int err;
int err, i;
char buf[10]; dlp = dev->priv;
flp = dlp->slave->priv;
if (!get)
{
err = verify_area(VERIFY_READ, conf, sizeof(struct dlci_conf));
if (err)
return(err);
memcpy_fromfs(&config, conf, sizeof(struct dlci_conf));
if (config.flags & ~DLCI_VALID_FLAGS)
return(-EINVAL);
memcpy(&dlp->config, &config, sizeof(struct dlci_conf));
dlp->configured = 1;
}
err = (*flp->dlci_conf)(dlp->slave, dev, get);
if (err)
return(err);
if (get)
{
err = verify_area(VERIFY_WRITE, conf, sizeof(struct dlci_conf));
if (err)
return(err);
memcpy_tofs(conf, &dlp->config, sizeof(struct dlci_conf));
}
return(0);
}
int dlci_dev_ioctl(struct device *dev, struct ifreq *ifr, int cmd)
{
struct dlci_local *dlp;
int err, len;
if (!suser())
return(-EPERM);
dlp = dev->priv;
switch(cmd)
{
case DLCI_GET_SLAVE:
if (!*(short *)(dev->dev_addr))
return(-EINVAL);
len = strlen(dlp->slave->name) + 1;
err = verify_area(VERIFY_WRITE, ifr->ifr_slave, len);
if (err)
return err;
memcpy_tofs(ifr->ifr_slave, dlp->slave->name, len);
break;
case DLCI_GET_CONF:
case DLCI_SET_CONF:
if (!*(short *)(dev->dev_addr))
return(-EINVAL);
return(dlci_config(dev, (struct dlci_conf *) ifr->ifr_data, cmd == DLCI_GET_CONF));
break;
default:
return(-EOPNOTSUPP);
}
return(0);
}
static int dlci_change_mtu(struct device *dev, int new_mtu)
{
struct dlci_local *dlp;
dlp = dev->priv;
return((*dlp->slave->change_mtu)(dlp->slave, new_mtu));
}
static int dlci_open(struct device *dev)
{
struct dlci_local *dlp;
struct frad_local *flp;
int err;
dlp = dev->priv;
err = verify_area(VERIFY_WRITE, new, sizeof(*new)); if (!*(short *)(dev->dev_addr))
return(-EINVAL);
if (!dlp->slave->start)
return(-ENOTCONN);
dev->flags = 0;
dev->tbusy = 0;
dev->interrupt = 0;
dev->start = 1;
flp = dlp->slave->priv;
err = (*flp->activate)(dlp->slave, dev);
if (err) if (err)
return(err); return(err);
memcpy_fromfs(&dlci, new, sizeof(dlci)); return 0;
}
static int dlci_close(struct device *dev)
{
struct dlci_local *dlp;
struct frad_local *flp;
int err;
dlp = dev->priv;
flp = dlp->slave->priv;
err = (*flp->deactivate)(dlp->slave, dev);
dev->start = 0;
dev->tbusy = 1;
return 0;
}
static struct enet_statistics *dlci_get_stats(struct device *dev)
{
struct dlci_local *dlp;
dlp = dev->priv;
return(&dlp->stats);
}
int dlci_add(struct dlci_add *dlci)
{
struct device *master, *slave;
struct dlci_local *dlp;
struct frad_local *flp;
int err, i;
char buf[10];
/* validate slave device */ /* validate slave device */
slave = dev_get(dlci.devname); slave = dev_get(dlci->devname);
if (!slave) if (!slave)
return(-ENODEV); return(-ENODEV);
...@@ -303,8 +438,8 @@ int dlci_add(struct dlci_add *new) ...@@ -303,8 +438,8 @@ int dlci_add(struct dlci_add *new)
/* check for registration */ /* check for registration */
for (i=0;i<sizeof(basename) / sizeof(char *); i++) for (i=0;i<sizeof(basename) / sizeof(char *); i++)
if ((basename[i]) && if ((basename[i]) &&
(strncmp(dlci.devname, basename[i], strlen(basename[i])) == 0) && (strncmp(dlci->devname, basename[i], strlen(basename[i])) == 0) &&
(strlen(dlci.devname) > strlen(basename[i]))) (strlen(dlci->devname) > strlen(basename[i])))
break; break;
if (i == sizeof(basename) / sizeof(char *)) if (i == sizeof(basename) / sizeof(char *))
...@@ -346,7 +481,7 @@ int dlci_add(struct dlci_add *new) ...@@ -346,7 +481,7 @@ int dlci_add(struct dlci_add *new)
return(err); return(err);
} }
*(short *)(master->dev_addr) = dlci.dlci; *(short *)(master->dev_addr) = dlci->dlci;
dlp = (struct dlci_local *) master->priv; dlp = (struct dlci_local *) master->priv;
dlp->slave = slave; dlp->slave = slave;
...@@ -362,21 +497,24 @@ int dlci_add(struct dlci_add *new) ...@@ -362,21 +497,24 @@ int dlci_add(struct dlci_add *new)
return(err); return(err);
} }
memcpy_tofs(new->devname, buf, strlen(buf) + 1); strcpy(dlci->devname, buf);
open_dev[i] = master; open_dev[i] = master;
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
return(0); return(0);
} }
int dlci_del(struct device *master) int dlci_del(struct dlci_add *dlci)
{ {
struct dlci_local *dlp; struct dlci_local *dlp;
struct frad_local *flp; struct frad_local *flp;
struct device *slave; struct device *master, *slave;
int i, err; int i, err;
/* validate slave device */
master = dev_get(dlci->devname);
if (!master)
return(-ENODEV);
if (master->start) if (master->start)
return(-EBUSY); return(-EBUSY);
...@@ -406,157 +544,42 @@ int dlci_del(struct device *master) ...@@ -406,157 +544,42 @@ int dlci_del(struct device *master)
return(0); return(0);
} }
int dlci_config(struct device *dev, struct dlci_conf *conf, int get) int dlci_ioctl(unsigned int cmd, void *arg)
{ {
struct dlci_conf config;
struct dlci_local *dlp;
struct frad_local *flp;
int err; int err;
struct dlci_add add;
dlp = dev->priv; if (!suser())
return(-EPERM);
flp = dlp->slave->priv;
if (!get) err=verify_area(VERIFY_READ, arg, sizeof(struct dlci_add));
{
err = verify_area(VERIFY_READ, conf, sizeof(struct dlci_conf));
if (err) if (err)
return(err); return(err);
memcpy_fromfs(&config, conf, sizeof(struct dlci_conf)); memcpy_fromfs(&add, arg, sizeof(struct dlci_add));
if (config.flags & ~DLCI_VALID_FLAGS)
return(-EINVAL);
memcpy(&dlp->config, &config, sizeof(struct dlci_conf));
dlp->configured = 1;
}
err = (*flp->dlci_conf)(dlp->slave, dev, get);
if (err)
return(err);
if (get) switch (cmd)
{ {
err = verify_area(VERIFY_WRITE, conf, sizeof(struct dlci_conf)); case SIOCADDDLCI:
err = verify_area(VERIFY_WRITE, arg, sizeof(struct dlci_add));
if (err) if (err)
return(err); return(err);
memcpy_tofs(conf, &dlp->config, sizeof(struct dlci_conf)); err = dlci_add(&add);
}
return(0);
}
int dlci_ioctl(struct device *dev, struct ifreq *ifr, int cmd) if (!err)
{ memcpy_tofs(arg, &add, sizeof(struct dlci_add));
struct dlci_local *dlp;
if (!suser())
return(-EPERM);
dlp = dev->priv;
switch(cmd)
{
case DLCI_GET_SLAVE:
if (!*(short *)(dev->dev_addr))
return(-EINVAL);
strcpy(ifr->ifr_slave, dlp->slave->name);
break;
case DLCI_DEVADD:
/* can only add on the primary device */
if (*(short *)(dev->dev_addr))
return(-EINVAL);
return(dlci_add((struct dlci_add *) ifr->ifr_data));
break;
case DLCI_DEVDEL:
/* can't delete the primary device */
if (!*(short *)(dev->dev_addr))
return(-EINVAL);
if (dev->start)
return(-EBUSY);
return(dlci_del(dev));
break; break;
case DLCI_GET_CONF: case SIOCDELDLCI:
case DLCI_SET_CONF: err = dlci_del(&add);
if (!*(short *)(dev->dev_addr))
return(-EINVAL);
return(dlci_config(dev, (struct dlci_conf *) ifr->ifr_data, cmd == DLCI_GET_CONF));
break; break;
default: default:
return(-EOPNOTSUPP); err = -EINVAL;
} }
return(0);
}
static int dlci_change_mtu(struct device *dev, int new_mtu)
{
struct dlci_local *dlp;
dlp = dev->priv;
return((*dlp->slave->change_mtu)(dlp->slave, new_mtu));
}
static int dlci_open(struct device *dev)
{
struct dlci_local *dlp;
struct frad_local *flp;
int err;
dlp = dev->priv;
if (!*(short *)(dev->dev_addr))
return(-EINVAL);
if (!dlp->slave->start)
return(-ENOTCONN);
dev->flags = 0;
dev->tbusy = 0;
dev->interrupt = 0;
dev->start = 1;
flp = dlp->slave->priv;
err = (*flp->activate)(dlp->slave, dev);
if (err)
return(err); return(err);
return 0;
}
static int dlci_close(struct device *dev)
{
struct dlci_local *dlp;
struct frad_local *flp;
int err;
dlp = dev->priv;
flp = dlp->slave->priv;
err = (*flp->deactivate)(dlp->slave, dev);
dev->start = 0;
dev->tbusy = 1;
return 0;
}
static struct enet_statistics *dlci_get_stats(struct device *dev)
{
struct dlci_local *dlp;
dlp = dev->priv;
return(&dlp->stats);
} }
int dlci_init(struct device *dev) int dlci_init(struct device *dev)
...@@ -574,7 +597,7 @@ int dlci_init(struct device *dev) ...@@ -574,7 +597,7 @@ int dlci_init(struct device *dev)
dev->flags = 0; dev->flags = 0;
dev->open = dlci_open; dev->open = dlci_open;
dev->stop = dlci_close; dev->stop = dlci_close;
dev->do_ioctl = dlci_ioctl; dev->do_ioctl = dlci_dev_ioctl;
dev->hard_start_xmit = dlci_transmit; dev->hard_start_xmit = dlci_transmit;
dev->hard_header = dlci_header; dev->hard_header = dlci_header;
dev->get_stats = dlci_get_stats; dev->get_stats = dlci_get_stats;
...@@ -622,18 +645,18 @@ int dlci_setup(void) ...@@ -622,18 +645,18 @@ int dlci_setup(void)
} }
#ifdef MODULE #ifdef MODULE
static struct device dlci = {"dlci", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, dlci_init, };
extern int (*dlci_ioctl_hook)(unsigned int, void *);
int init_module(void) int init_module(void)
{ {
dlci_setup(); dlci_ioctl_hook = dlci_ioctl;
return(register_netdev(&dlci));
return(dlci_setup());
} }
void cleanup_module(void) void cleanup_module(void)
{ {
unregister_netdev(&dlci); dlci_ioctl_hook = NULL;
if (dlci.priv)
kfree(dlci.priv);
} }
#endif /* MODULE */ #endif /* MODULE */
...@@ -201,14 +201,14 @@ static void scsi_dump_status(void); ...@@ -201,14 +201,14 @@ static void scsi_dump_status(void);
#define ABORT_TIMEOUT SCSI_TIMEOUT #define ABORT_TIMEOUT SCSI_TIMEOUT
#define RESET_TIMEOUT SCSI_TIMEOUT #define RESET_TIMEOUT SCSI_TIMEOUT
#else #else
#define SENSE_TIMEOUT (1*HZ) #define SENSE_TIMEOUT (5*HZ/10)
#define RESET_TIMEOUT (5*HZ) #define RESET_TIMEOUT (5*HZ/10)
#define ABORT_TIMEOUT (5*HZ) #define ABORT_TIMEOUT (5*HZ/10)
#endif #endif
#define MIN_RESET_DELAY (3*HZ) #define MIN_RESET_DELAY (2*HZ)
/* Do not call reset on error if we just did a reset within 10 sec. */ /* Do not call reset on error if we just did a reset within 15 sec. */
#define MIN_RESET_PERIOD (15*HZ) #define MIN_RESET_PERIOD (15*HZ)
/* The following devices are known not to tolerate a lun != 0 scan for /* The following devices are known not to tolerate a lun != 0 scan for
...@@ -2255,15 +2255,16 @@ static int update_timeout(Scsi_Cmnd * SCset, int timeout) ...@@ -2255,15 +2255,16 @@ static int update_timeout(Scsi_Cmnd * SCset, int timeout)
* it is called twice per SCSI operation: once when internal_cmnd is * it is called twice per SCSI operation: once when internal_cmnd is
* called, and again when scsi_done completes the command. To limit * called, and again when scsi_done completes the command. To limit
* the load this routine can cause, we shortcut processing if no clock * the load this routine can cause, we shortcut processing if no clock
* ticks have occurred since the last time it was called. This may * ticks have occurred since the last time it was called.
* cause the computation of least below to be inaccurate, but it will
* be corrected after the next clock tick.
*/ */
if (jiffies == time_start && timer_table[SCSI_TIMER].expires > 0) { if (jiffies == time_start && timer_table[SCSI_TIMER].expires > 0) {
if(SCset){ if(SCset){
oldto = SCset->timeout; oldto = SCset->timeout;
SCset->timeout = timeout; SCset->timeout = timeout;
if (timeout > 0 &&
jiffies + timeout < timer_table[SCSI_TIMER].expires)
timer_table[SCSI_TIMER].expires = jiffies + timeout;
} }
restore_flags(flags); restore_flags(flags);
return oldto; return oldto;
......
...@@ -333,6 +333,7 @@ int parse_rock_ridge_inode(struct iso_directory_record * de, ...@@ -333,6 +333,7 @@ int parse_rock_ridge_inode(struct iso_directory_record * de,
case SIG('S','L'): case SIG('S','L'):
{int slen; {int slen;
struct SL_component * slp; struct SL_component * slp;
struct SL_component * oldslp;
slen = rr->len - 5; slen = rr->len - 5;
slp = &rr->u.SL.link; slp = &rr->u.SL.link;
inode->i_size = symlink_len; inode->i_size = symlink_len;
...@@ -356,10 +357,20 @@ int parse_rock_ridge_inode(struct iso_directory_record * de, ...@@ -356,10 +357,20 @@ int parse_rock_ridge_inode(struct iso_directory_record * de,
printk("Symlink component flag not implemented\n"); printk("Symlink component flag not implemented\n");
}; };
slen -= slp->len + 2; slen -= slp->len + 2;
oldslp = slp;
slp = (struct SL_component *) (((char *) slp) + slp->len + 2); slp = (struct SL_component *) (((char *) slp) + slp->len + 2);
if(slen < 2) break; if(slen < 2) {
if(!rootflag) inode->i_size += 1; if( ((rr->u.SL.flags & 1) != 0)
&& ((oldslp->flags & 1) == 0) ) inode->i_size += 1;
break;
}
/*
* If this component record isnt continued, then append a '/'.
*/
if( (!rootflag)
&& ((oldslp->flags & 1) == 0) ) inode->i_size += 1;
} }
} }
symlink_len = inode->i_size; symlink_len = inode->i_size;
...@@ -475,6 +486,7 @@ char * get_rock_ridge_symlink(struct inode * inode) ...@@ -475,6 +486,7 @@ char * get_rock_ridge_symlink(struct inode * inode)
break; break;
case SIG('S','L'): case SIG('S','L'):
{int slen; {int slen;
struct SL_component * oldslp;
struct SL_component * slp; struct SL_component * slp;
slen = rr->len - 5; slen = rr->len - 5;
slp = &rr->u.SL.link; slp = &rr->u.SL.link;
...@@ -503,10 +515,25 @@ char * get_rock_ridge_symlink(struct inode * inode) ...@@ -503,10 +515,25 @@ char * get_rock_ridge_symlink(struct inode * inode)
printk("Symlink component flag not implemented (%d)\n",slen); printk("Symlink component flag not implemented (%d)\n",slen);
}; };
slen -= slp->len + 2; slen -= slp->len + 2;
oldslp = slp;
slp = (struct SL_component *) (((char *) slp) + slp->len + 2); slp = (struct SL_component *) (((char *) slp) + slp->len + 2);
if(slen < 2) break; if(slen < 2) {
if(!rootflag) strcat(rpnt,"/"); /*
* If there is another SL record, and this component record
* isn't continued, then add a slash.
*/
if( ((rr->u.SL.flags & 1) != 0)
&& ((oldslp->flags & 1) == 0) ) strcat(rpnt,"/");
break;
}
/*
* If this component record isnt continued, then append a '/'.
*/
if( (!rootflag)
&& ((oldslp->flags & 1) == 0) ) strcat(rpnt,"/");
}; };
break; break;
case SIG('C','E'): case SIG('C','E'):
......
...@@ -257,6 +257,7 @@ int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l) ...@@ -257,6 +257,7 @@ int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l)
if (!(inode = filp->f_inode)) if (!(inode = filp->f_inode))
return (-EINVAL); return (-EINVAL);
#ifdef CONFIG_LOCK_MANDATORY
/* Don't allow mandatory locks on files that may be memory mapped /* Don't allow mandatory locks on files that may be memory mapped
* and shared. * and shared.
*/ */
...@@ -268,6 +269,7 @@ int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l) ...@@ -268,6 +269,7 @@ int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l)
vma = vma->vm_next_share; vma = vma->vm_next_share;
} while (vma != inode->i_mmap); } while (vma != inode->i_mmap);
} }
#endif
memcpy_fromfs(&flock, l, sizeof(flock)); memcpy_fromfs(&flock, l, sizeof(flock));
if (!posix_make_lock(filp, &file_lock, &flock)) if (!posix_make_lock(filp, &file_lock, &flock))
...@@ -291,8 +293,8 @@ int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l) ...@@ -291,8 +293,8 @@ int fcntl_setlk(unsigned int fd, unsigned int cmd, struct flock *l)
if (count < 5) { if (count < 5) {
count++; count++;
printk(KERN_WARNING printk(KERN_WARNING
"fcntl_setlk() called by process %d with broken flock() emulation\n", "fcntl_setlk() called by process %d (%s) with broken flock() emulation\n",
current->pid); current->pid, current->comm);
} }
} }
#endif #endif
...@@ -332,25 +334,12 @@ void locks_remove_locks(struct task_struct *task, struct file *filp) ...@@ -332,25 +334,12 @@ void locks_remove_locks(struct task_struct *task, struct file *filp)
int locks_verify_locked(struct inode *inode) int locks_verify_locked(struct inode *inode)
{ {
#ifdef CONFIG_LOCK_MANDATORY
/* Candidates for mandatory locking have the setgid bit set /* Candidates for mandatory locking have the setgid bit set
* but no group execute bit - an otherwise meaningless combination. * but no group execute bit - an otherwise meaningless combination.
*/ */
if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
return (locks_mandatory_locked(inode)); return (locks_mandatory_locked(inode));
return (0);
}
int locks_mandatory_locked(struct inode *inode)
{
#ifdef CONFIG_LOCK_MANDATORY
struct file_lock *fl;
/* Search the lock list for this inode for any POSIX locks.
*/
for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if ((fl->fl_flags & F_POSIX) && (fl->fl_owner != current))
return (-EAGAIN);
}
#endif #endif
return (0); return (0);
} }
...@@ -358,10 +347,10 @@ int locks_mandatory_locked(struct inode *inode) ...@@ -358,10 +347,10 @@ int locks_mandatory_locked(struct inode *inode)
int locks_verify_area(int read_write, struct inode *inode, struct file *filp, int locks_verify_area(int read_write, struct inode *inode, struct file *filp,
unsigned int offset, unsigned int count) unsigned int offset, unsigned int count)
{ {
#ifdef CONFIG_LOCK_MANDATORY
/* Candidates for mandatory locking have the setgid bit set /* Candidates for mandatory locking have the setgid bit set
* but no group execute bit - an otherwise meaningless combination. * but no group execute bit - an otherwise meaningless combination.
*/ */
#ifdef CONFIG_LOCK_MANDATORY
if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
return (locks_mandatory_area(read_write, inode, filp, offset, return (locks_mandatory_area(read_write, inode, filp, offset,
count)); count));
...@@ -369,11 +358,24 @@ int locks_verify_area(int read_write, struct inode *inode, struct file *filp, ...@@ -369,11 +358,24 @@ int locks_verify_area(int read_write, struct inode *inode, struct file *filp,
return (0); return (0);
} }
#ifdef CONFIG_LOCK_MANDATORY
int locks_mandatory_locked(struct inode *inode)
{
struct file_lock *fl;
/* Search the lock list for this inode for any POSIX locks.
*/
for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
if ((fl->fl_flags & F_POSIX) && (fl->fl_owner != current))
return (-EAGAIN);
}
return (0);
}
int locks_mandatory_area(int read_write, struct inode *inode, int locks_mandatory_area(int read_write, struct inode *inode,
struct file *filp, unsigned int offset, struct file *filp, unsigned int offset,
unsigned int count) unsigned int count)
{ {
#ifdef CONFIG_LOCK_MANDATORY
struct file_lock *fl; struct file_lock *fl;
repeat: repeat:
...@@ -412,9 +414,9 @@ int locks_mandatory_area(int read_write, struct inode *inode, ...@@ -412,9 +414,9 @@ int locks_mandatory_area(int read_write, struct inode *inode,
goto repeat; goto repeat;
} }
} }
#endif
return (0); return (0);
} }
#endif
/* Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX /* Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX
* style lock. * style lock.
...@@ -939,10 +941,15 @@ static char *lock_get_status(struct file_lock *fl, char *p, int id, char *pfx) ...@@ -939,10 +941,15 @@ static char *lock_get_status(struct file_lock *fl, char *p, int id, char *pfx)
p += sprintf(p, "%d:%s ", id, pfx); p += sprintf(p, "%d:%s ", id, pfx);
if (fl->fl_flags & F_POSIX) { if (fl->fl_flags & F_POSIX) {
#ifdef CONFIG_LOCK_MANDATORY
p += sprintf(p, "%s %s ", p += sprintf(p, "%s %s ",
(fl->fl_flags & F_BROKEN) ? "BROKEN" : "POSIX ", (fl->fl_flags & F_BROKEN) ? "BROKEN" : "POSIX ",
((fl->fl_file->f_inode->i_mode & (S_IXGRP | S_ISGID)) ((fl->fl_file->f_inode->i_mode & (S_IXGRP | S_ISGID))
== S_ISGID) ? "MANDATORY" : "ADVISORY "); == S_ISGID) ? "MANDATORY" : "ADVISORY ");
#else
p += sprintf(p, "%s ADVISORY ",
(fl->fl_flags & F_BROKEN) ? "BROKEN" : "POSIX ");
#endif
} }
else { else {
p += sprintf(p, "FLOCK ADVISORY "); p += sprintf(p, "FLOCK ADVISORY ");
......
...@@ -15,7 +15,9 @@ static struct symbol_table procfs_syms = { ...@@ -15,7 +15,9 @@ static struct symbol_table procfs_syms = {
/* Should this be surrounded with "#ifdef CONFIG_MODULES" ? */ /* Should this be surrounded with "#ifdef CONFIG_MODULES" ? */
#include <linux/symtab_begin.h> #include <linux/symtab_begin.h>
X(proc_register), X(proc_register),
X(proc_register_dynamic),
X(proc_unregister), X(proc_unregister),
X(proc_root),
X(in_group_p), X(in_group_p),
X(generate_cluster), X(generate_cluster),
X(proc_net_inode_operations), X(proc_net_inode_operations),
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <asm/segment.h> #include <asm/segment.h>
asmlinkage int sys_lseek(unsigned int fd, off_t offset, unsigned int origin) asmlinkage long sys_lseek(unsigned int fd, off_t offset, unsigned int origin)
{ {
struct file * file; struct file * file;
long tmp = -1; long tmp = -1;
......
#ifndef _LINUX_MATH_EMU_H #ifndef _I386_MATH_EMU_H
#define _LINUX_MATH_EMU_H #define _I386_MATH_EMU_H
#include <asm/sigcontext.h>
void restore_i387_soft(struct _fpstate *buf); void restore_i387_soft(struct _fpstate *buf);
struct _fpstate * save_i387_soft(struct _fpstate * buf); struct _fpstate * save_i387_soft(struct _fpstate * buf);
......
...@@ -359,29 +359,36 @@ extern void locks_remove_locks(struct task_struct *task, struct file *filp); ...@@ -359,29 +359,36 @@ extern void locks_remove_locks(struct task_struct *task, struct file *filp);
#define FLOCK_VERIFY_READ 1 #define FLOCK_VERIFY_READ 1
#define FLOCK_VERIFY_WRITE 2 #define FLOCK_VERIFY_WRITE 2
#ifdef CONFIG_LOCK_MANDATORY
extern int locks_mandatory_locked(struct inode *inode); extern int locks_mandatory_locked(struct inode *inode);
extern int locks_mandatory_area(int read_write, struct inode *inode,
struct file *filp, unsigned int offset,
unsigned int count);
#endif
extern inline int locks_verify_locked(struct inode *inode) extern inline int locks_verify_locked(struct inode *inode)
{ {
#ifdef CONFIG_LOCK_MANDATORY
/* Candidates for mandatory locking have the setgid bit set /* Candidates for mandatory locking have the setgid bit set
* but no group execute bit - an otherwise meaningless combination. * but no group execute bit - an otherwise meaningless combination.
*/ */
if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
return (locks_mandatory_locked(inode)); return (locks_mandatory_locked(inode));
#endif
return (0); return (0);
} }
extern int locks_mandatory_area(int read_write, struct inode *inode,
struct file *filp, unsigned int offset,
unsigned int count);
extern inline int locks_verify_area(int read_write, struct inode *inode, extern inline int locks_verify_area(int read_write, struct inode *inode,
struct file *filp, unsigned int offset, struct file *filp, unsigned int offset,
unsigned int count) unsigned int count)
{ {
#ifdef CONFIG_LOCK_MANDATORY
/* Candidates for mandatory locking have the setgid bit set /* Candidates for mandatory locking have the setgid bit set
* but no group execute bit - an otherwise meaningless combination. * but no group execute bit - an otherwise meaningless combination.
*/ */
if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) if ((inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
return (locks_mandatory_area(read_write, inode, filp, offset, return (locks_mandatory_area(read_write, inode, filp, offset,
count)); count));
#endif
return (0); return (0);
} }
......
...@@ -24,10 +24,9 @@ ...@@ -24,10 +24,9 @@
#ifndef _FRAD_H_ #ifndef _FRAD_H_
#define _FRAD_H_ #define _FRAD_H_
/* Structures and constants associated with the DLCI device driver */ #include <linux/if.h>
#define DLCI_DEVADD (SIOCDEVPRIVATE) /* Structures and constants associated with the DLCI device driver */
#define DLCI_DEVDEL (SIOCDEVPRIVATE + 1)
struct dlci_add struct dlci_add
{ {
......
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
#ifndef _IP_FW_H #ifndef _IP_FW_H
#define _IP_FW_H #define _IP_FW_H
#include <linux/icmp.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
struct ip_fw struct ip_fw
{ {
struct ip_fw *fw_next; /* Next firewall on chain */ struct ip_fw *fw_next; /* Next firewall on chain */
......
...@@ -74,6 +74,10 @@ ...@@ -74,6 +74,10 @@
#define SIOCGIFMAP 0x8970 /* Get device parameters */ #define SIOCGIFMAP 0x8970 /* Get device parameters */
#define SIOCSIFMAP 0x8971 /* Set device parameters */ #define SIOCSIFMAP 0x8971 /* Set device parameters */
/* DLCI configuration calls */
#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
/* Device private ioctl calls */ /* Device private ioctl calls */
......
...@@ -830,7 +830,7 @@ int atif_ioctl(int cmd, void *arg) ...@@ -830,7 +830,7 @@ int atif_ioctl(int cmd, void *arg)
limit=ntohs(nr->nr_lastnet); limit=ntohs(nr->nr_lastnet);
if(limit-ntohs(nr->nr_firstnet) > 256) if(limit-ntohs(nr->nr_firstnet) > 256)
{ {
printk(KERN_WARING "Too many routes/iface.\n"); printk(KERN_WARNING "Too many routes/iface.\n");
return -EINVAL; return -EINVAL;
} }
for(ct=ntohs(nr->nr_firstnet);ct<=limit;ct++) for(ct=ntohs(nr->nr_firstnet);ct<=limit;ct++)
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
* Alan Cox : Only sendmsg/recvmsg now supported. * Alan Cox : Only sendmsg/recvmsg now supported.
* Alan Cox : Locked down bind (see security list). * Alan Cox : Locked down bind (see security list).
* Alan Cox : Loosened bind a little. * Alan Cox : Loosened bind a little.
* Mike McLagan : ADD/DEL DLCI Ioctls
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -112,6 +113,14 @@ extern int afinet_get_info(char *, char **, off_t, int, int); ...@@ -112,6 +113,14 @@ extern int afinet_get_info(char *, char **, off_t, int, int);
extern int tcp_get_info(char *, char **, off_t, int, int); extern int tcp_get_info(char *, char **, off_t, int, int);
extern int udp_get_info(char *, char **, off_t, int, int); extern int udp_get_info(char *, char **, off_t, int, int);
#ifdef CONFIG_DLCI
extern int dlci_ioctl(unsigned int, void*);
#endif
#ifdef CONFIG_DLCI_MODULE
int (*dlci_ioctl_hook)(unsigned int, void *) = NULL;
#endif
int (*rarp_ioctl_hook)(unsigned int,void*) = NULL; int (*rarp_ioctl_hook)(unsigned int,void*) = NULL;
/* /*
...@@ -1292,6 +1301,24 @@ static int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) ...@@ -1292,6 +1301,24 @@ static int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
return -ENOPKG; return -ENOPKG;
#endif #endif
case SIOCADDDLCI:
case SIOCDELDLCI:
#ifdef CONFIG_DLCI
return(dlci_ioctl(cmd, (void *) arg));
#endif
#ifdef CONFIG_DLCI_MODULE
#ifdef CONFIG_KERNELD
if (dlci_ioctl_hook == NULL)
request_module("dlci");
#endif
if (dlci_ioctl_hook)
return((*dlci_ioctl_hook)(cmd, (void *) arg));
#endif
return -ENOPKG;
default: default:
if ((cmd >= SIOCDEVPRIVATE) && if ((cmd >= SIOCDEVPRIVATE) &&
(cmd <= (SIOCDEVPRIVATE + 15))) (cmd <= (SIOCDEVPRIVATE + 15)))
......
...@@ -51,6 +51,9 @@ extern void destroy_EII_client(struct datalink_proto *); ...@@ -51,6 +51,9 @@ extern void destroy_EII_client(struct datalink_proto *);
extern void destroy_8023_client(struct datalink_proto *); extern void destroy_8023_client(struct datalink_proto *);
#endif #endif
#ifdef CONFIG_DLCI_MODULE
extern int (*dlci_ioctl_hook)(unsigned int, void *);
#endif
static struct symbol_table net_syms = { static struct symbol_table net_syms = {
#include <linux/symtab_begin.h> #include <linux/symtab_begin.h>
...@@ -85,6 +88,11 @@ static struct symbol_table net_syms = { ...@@ -85,6 +88,11 @@ static struct symbol_table net_syms = {
X(inet_add_protocol), X(inet_add_protocol),
X(inet_del_protocol), X(inet_del_protocol),
X(rarp_ioctl_hook), X(rarp_ioctl_hook),
#ifdef CONFIG_DLCI_MODULE
X(dlci_ioctl_hook),
#endif
X(init_etherdev), X(init_etherdev),
X(ip_rt_route), X(ip_rt_route),
X(icmp_send), X(icmp_send),
......
...@@ -505,6 +505,7 @@ static int unix_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le ...@@ -505,6 +505,7 @@ static int unix_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le
return err; return err;
skb->sk=sk; /* So they know it is us */ skb->sk=sk; /* So they know it is us */
skb->free=1; skb->free=1;
skb->h.filp=NULL;
sk->state=TCP_CLOSE; sk->state=TCP_CLOSE;
unix_mkname(sunaddr, addr_len); unix_mkname(sunaddr, addr_len);
other=unix_find_other(sunaddr->sun_path, &err); other=unix_find_other(sunaddr->sun_path, &err);
......
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