Commit 686bb5a7 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.99

parent 6b6e62fd
......@@ -155,7 +155,7 @@ ENTRY(system_call)
jae badsys
testb $0x20,flags(%ebx) # PF_TRACESYS
jne tracesys
call SYMBOL_NAME(sys_call_table)(,%eax,4)
call *SYMBOL_NAME(sys_call_table)(,%eax,4)
movl %eax,EAX(%esp) # save the return value
ALIGN
.globl ret_from_sys_call
......@@ -193,7 +193,7 @@ tracesys:
movl $-ENOSYS,EAX(%esp)
call SYMBOL_NAME(syscall_trace)
movl ORIG_EAX(%esp),%eax
call SYMBOL_NAME(sys_call_table)(,%eax,4)
call *SYMBOL_NAME(sys_call_table)(,%eax,4)
movl %eax,EAX(%esp) # save the return value
call SYMBOL_NAME(syscall_trace)
jmp ret_from_sys_call
......
......@@ -68,9 +68,6 @@ static unsigned int cached_irq_mask = (1<<NR_IRQS)-1;
spinlock_t irq_controller_lock;
static unsigned int irq_events [NR_IRQS] = { -1, };
static int disabled_irq [NR_IRQS] = { 0, };
/*
* Not all IRQs can be routed through the IO-APIC, eg. on certain (older)
* boards the timer interrupt and sometimes the keyboard interrupt is
......@@ -123,11 +120,34 @@ static struct hw_interrupt_type ioapic_irq_type = {
};
#endif
struct hw_interrupt_type *irq_handles[NR_IRQS] =
{
[0 ... 15] = &i8259A_irq_type /* standard ISA IRQs */
/*
* Status: reason for being disabled: somebody has
* done a "disable_irq()" or we must not re-enter the
* already executing irq..
*/
#define IRQ_INPROGRESS 1
#define IRQ_DISABLED 2
/*
* This is the "IRQ descriptor", which contains various information
* about the irq, including what kind of hardware handling it has,
* whether it is disabled etc etc.
*
* Pad this out to 32 bytes for cache and indexing reasons.
*/
typedef struct {
unsigned int status; /* IRQ status - IRQ_INPROGRESS, IRQ_DISABLED */
unsigned int events; /* Do we have any pending events? */
unsigned int ipi; /* Have we sent off the pending IPI? */
struct hw_interrupt_type *handler; /* handle/enable/disable functions */
struct irqaction *action; /* IRQ action list */
unsigned int unused[3];
} irq_desc_t;
irq_desc_t irq_desc[NR_IRQS] = {
[0 ... 15] = { 0, 0, 0, &i8259A_irq_type, }, /* standard ISA IRQs */
#ifdef __SMP__
, [16 ... NR_IRQS-1] = &ioapic_irq_type /* 'high' PCI IRQs */
[16 ... 23] = { 0, 0, 0, &ioapic_irq_type, }, /* 'high' PCI IRQs */
#endif
};
......@@ -174,6 +194,7 @@ void set_8259A_irq_mask(unsigned int irq)
void unmask_generic_irq(unsigned int irq)
{
irq_desc[irq].status = 0;
if (IO_APIC_IRQ(irq))
enable_IO_APIC_irq(irq);
else {
......@@ -297,17 +318,6 @@ static struct irqaction irq13 = { math_error_irq, 0, 0, "fpu", NULL, NULL };
*/
static struct irqaction irq2 = { no_action, 0, 0, "cascade", NULL, NULL};
static struct irqaction *irq_action[NR_IRQS] = {
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL
#ifdef __SMP__
,NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL
#endif
};
int get_irq_list(char *buf)
{
int i, j;
......@@ -320,7 +330,7 @@ int get_irq_list(char *buf)
*p++ = '\n';
for (i = 0 ; i < NR_IRQS ; i++) {
action = irq_action[i];
action = irq_desc[i].action;
if (!action)
continue;
p += sprintf(p, "%3d: ",i);
......@@ -628,7 +638,7 @@ static int handle_IRQ_event(unsigned int irq, struct pt_regs * regs)
int status;
status = 0;
action = *(irq + irq_action);
action = irq_desc[irq].action;
if (action) {
status |= 1;
......@@ -668,7 +678,7 @@ void enable_8259A_irq (unsigned int irq)
void make_8259A_irq (unsigned int irq)
{
io_apic_irqs &= ~(1<<irq);
irq_handles[irq] = &i8259A_irq_type;
irq_desc[irq].handler = &i8259A_irq_type;
disable_irq(irq);
enable_irq(irq);
}
......@@ -682,6 +692,7 @@ void make_8259A_irq (unsigned int irq)
static inline void mask_and_ack_8259A(unsigned int irq)
{
spin_lock(&irq_controller_lock);
irq_desc[irq].status |= IRQ_INPROGRESS;
cached_irq_mask |= 1 << irq;
if (irq & 8) {
inb(0xA1); /* DUMMY */
......@@ -704,6 +715,7 @@ static void do_8259A_IRQ(unsigned int irq, int cpu, struct pt_regs * regs)
if (handle_IRQ_event(irq, regs)) {
spin_lock(&irq_controller_lock);
if (!(irq_desc[irq].status &= IRQ_DISABLED))
unmask_8259A(irq);
spin_unlock(&irq_controller_lock);
}
......@@ -713,8 +725,6 @@ static void do_8259A_IRQ(unsigned int irq, int cpu, struct pt_regs * regs)
#ifdef __SMP__
static int ipi_pending [NR_IRQS] = { 0, };
/*
* In the SMP+IOAPIC case it might happen that there are an unspecified
* number of pending IRQ events unhandled. These cases are very rare,
......@@ -722,45 +732,41 @@ static int ipi_pending [NR_IRQS] = { 0, };
* better to do it this way as thus we dont have to be aware of
* 'pending' interrupts in the IRQ path, except at this point.
*/
static inline void trigger_pending_irqs(unsigned int irq)
static void enable_ioapic_irq(unsigned int irq)
{
if (irq_events[irq] && !ipi_pending[irq]) {
ipi_pending[irq] = 1;
irq_desc_t *desc = irq_desc + irq;
if (desc->events && !desc->ipi) {
desc->ipi = 1;
send_IPI(APIC_DEST_SELF, IO_APIC_VECTOR(irq));
}
}
void enable_ioapic_irq (unsigned int irq)
{
disabled_irq[irq] = 0;
trigger_pending_irqs(irq);
}
/*
* We do not actually disable IO-APIC irqs in hardware ...
*/
static void disable_ioapic_irq(unsigned int irq)
{
disabled_irq[irq] = 1;
}
static void do_ioapic_IRQ(unsigned int irq, int cpu, struct pt_regs * regs)
{
irq_desc_t *desc = irq_desc + irq;
spin_lock(&irq_controller_lock);
/* Ack the irq inside the lock! */
ack_APIC_irq();
ipi_pending[irq] = 0;
desc->ipi = 0;
/* If the irq is disabled, just set a flag and return */
if (disabled_irq[irq]) {
irq_events[irq] = 1;
/* If the irq is disabled for whatever reason, just set a flag and return */
if (desc->status & (IRQ_DISABLED | IRQ_INPROGRESS)) {
desc->events = 1;
spin_unlock(&irq_controller_lock);
return;
}
disabled_irq[irq] = 1;
irq_events[irq] = 0;
desc->status = IRQ_INPROGRESS;
desc->events = 0;
hardirq_enter(cpu);
spin_unlock(&irq_controller_lock);
......@@ -769,18 +775,21 @@ static void do_ioapic_IRQ(unsigned int irq, int cpu, struct pt_regs * regs)
for (;;) {
int pending;
handle_IRQ_event(irq, regs);
/* If there is no IRQ handler, exit early, leaving the irq "in progress" */
if (!handle_IRQ_event(irq, regs))
goto no_handler;
spin_lock(&irq_controller_lock);
pending = irq_events[irq];
irq_events[irq] = 0;
disabled_irq[irq] = pending;
spin_unlock(&irq_controller_lock);
pending = desc->events;
desc->events = 0;
if (!pending)
break;
spin_unlock(&irq_controller_lock);
}
desc->status &= IRQ_DISABLED;
spin_unlock(&irq_controller_lock);
no_handler:
hardirq_exit(cpu);
release_irqlock(cpu);
}
......@@ -790,15 +799,21 @@ static void do_ioapic_IRQ(unsigned int irq, int cpu, struct pt_regs * regs)
/*
* Generic enable/disable code: this just calls
* down into the PIC-specific version after having
* gotten the irq controller lock.
* down into the PIC-specific version for the actual
* hardware disable after having gotten the irq
* controller lock.
*/
void disable_irq(unsigned int irq)
{
unsigned long flags;
spin_lock_irqsave(&irq_controller_lock, flags);
irq_handles[irq]->disable(irq);
/*
* At this point we may actually have a pending interrupt being active
* on another CPU. So don't touch the IRQ_INPROGRESS bit..
*/
irq_desc[irq].status |= IRQ_DISABLED;
irq_desc[irq].handler->disable(irq);
spin_unlock_irqrestore(&irq_controller_lock, flags);
synchronize_irq();
......@@ -809,7 +824,16 @@ void enable_irq(unsigned int irq)
unsigned long flags;
spin_lock_irqsave(&irq_controller_lock, flags);
irq_handles[irq]->enable(irq);
/*
* In contrast to the above, we should _not_ have any concurrent
* interrupt activity here, so we just clear both disabled bits.
*
* This allows us to have IRQ_INPROGRESS set until we actually
* install a handler for this interrupt (make irq autodetection
* work by just looking at the status field for the irq)
*/
irq_desc[irq].status = 0;
irq_desc[irq].handler->enable(irq);
spin_unlock_irqrestore(&irq_controller_lock, flags);
}
......@@ -843,7 +867,7 @@ asmlinkage void do_IRQ(struct pt_regs regs)
int cpu = smp_processor_id();
kstat.irqs[cpu][irq]++;
irq_handles[irq]->handle(irq, cpu, &regs);
irq_desc[irq].handler->handle(irq, cpu, &regs);
/*
* This should be conditional: we should really get
......@@ -863,7 +887,7 @@ int setup_x86_irq(unsigned int irq, struct irqaction * new)
struct irqaction *old, **p;
unsigned long flags;
p = irq_action + irq;
p = &irq_desc[irq].action;
if ((old = *p) != NULL) {
/* Can't share interrupts unless both agree to */
if (!(old->flags & new->flags & SA_SHIRQ))
......@@ -888,7 +912,7 @@ int setup_x86_irq(unsigned int irq, struct irqaction * new)
spin_lock(&irq_controller_lock);
#ifdef __SMP__
if (IO_APIC_IRQ(irq)) {
irq_handles[irq] = &ioapic_irq_type;
irq_desc[irq].handler = &ioapic_irq_type;
/*
* First disable it in the 8259A:
*/
......@@ -946,7 +970,7 @@ void free_irq(unsigned int irq, void *dev_id)
printk("Trying to free IRQ%d\n",irq);
return;
}
for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) {
for (p = &irq_desc[irq].action; (action = *p) != NULL; p = &action->next) {
if (action->dev_id != dev_id)
continue;
......@@ -962,32 +986,29 @@ void free_irq(unsigned int irq, void *dev_id)
}
/*
* probing is always single threaded [FIXME: is this true?]
* IRQ autodetection code..
*
* This depends on the fact that any interrupt that
* comes in on to an unassigned handler will get stuck
* with "IRQ_INPROGRESS" asserted and the interrupt
* disabled.
*/
static unsigned int probe_irqs[NR_CPUS][NR_IRQS];
unsigned long probe_irq_on (void)
{
unsigned int i, j, irqs = 0;
unsigned int i, irqs = 0;
unsigned long delay;
/*
* save current irq counts
*/
memcpy(probe_irqs,kstat.irqs,NR_CPUS*NR_IRQS*sizeof(int));
/*
* first, enable any unassigned irqs
*/
spin_lock_irq(&irq_controller_lock);
for (i = NR_IRQS-1; i > 0; i--) {
if (!irq_action[i]) {
unsigned long flags;
spin_lock_irqsave(&irq_controller_lock, flags);
if (!irq_desc[i].action) {
unmask_generic_irq(i);
irqs |= (1 << i);
spin_unlock_irqrestore(&irq_controller_lock, flags);
}
}
spin_unlock_irq(&irq_controller_lock);
/*
* wait for spurious interrupts to increase counters
......@@ -998,35 +1019,35 @@ unsigned long probe_irq_on (void)
/*
* now filter out any obviously spurious interrupts
*/
for (i=0; i<NR_IRQS; i++)
for (j=0; j<NR_CPUS; j++)
if (kstat.irqs[j][i] != probe_irqs[j][i])
spin_lock_irq(&irq_controller_lock);
for (i=0; i<NR_IRQS; i++) {
if (irq_desc[i].status & IRQ_INPROGRESS)
irqs &= ~(1UL << i);
}
spin_unlock_irq(&irq_controller_lock);
return irqs;
}
int probe_irq_off (unsigned long irqs)
{
int i,j, irq_found = -1;
int i, irq_found = -1;
spin_lock_irq(&irq_controller_lock);
for (i=0; i<NR_IRQS; i++) {
int sum = 0;
for (j=0; j<NR_CPUS; j++) {
sum += kstat.irqs[j][i];
sum -= probe_irqs[j][i];
}
if (sum && (irqs & (1UL << i))) {
if ((irqs & 1) && (irq_desc[i].status & IRQ_INPROGRESS)) {
if (irq_found != -1) {
irq_found = -irq_found;
goto out;
} else
}
irq_found = i;
}
irqs >>= 1;
}
if (irq_found == -1)
irq_found = 0;
out:
spin_unlock_irq(&irq_controller_lock);
return irq_found;
}
......@@ -1048,7 +1069,7 @@ void init_IO_APIC_traps(void)
for (i = 0; i < NR_IRQS ; i++)
if (IO_APIC_VECTOR(i) <= 0xfe) /* HACK */ {
if (IO_APIC_IRQ(i)) {
irq_handles[i] = &ioapic_irq_type;
irq_desc[i].handler = &ioapic_irq_type;
/*
* First disable it in the 8259A:
*/
......@@ -1070,8 +1091,8 @@ __initfunc(void init_IRQ(void))
outb(LATCH >> 8 , 0x40); /* MSB */
for (i=0; i<NR_IRQS; i++) {
irq_events[i] = 0;
disabled_irq[i] = 0;
irq_desc[i].events = 0;
irq_desc[i].status = 0;
}
/*
* 16 old-style INTA-cycle interrupt gates:
......
......@@ -23,10 +23,7 @@ void init_pic_mode (void);
extern unsigned int io_apic_irqs;
extern inline int IO_APIC_VECTOR (int irq)
{
return (0x51+(irq<<3));
}
#define IO_APIC_VECTOR(irq) (0x51+((irq)<<3))
#define MAX_IRQ_SOURCES 128
#define MAX_MP_BUSSES 32
......
......@@ -28,6 +28,7 @@
* Alan Cox : Added EBDA scanning
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/timer.h>
......
......@@ -328,7 +328,7 @@ void cleanup_module(void)
#ifdef RD_LOADER
/*
* This routine tries to a ramdisk image to load, and returns the
* This routine tries to find a ramdisk image to load, and returns the
* number of blocks to read for a non-compressed image, 0 if the image
* is a compressed image, and -1 if an image with the right magic
* numbers could not be found.
......@@ -503,15 +503,21 @@ __initfunc(static void rd_load_image(kdev_t device,int offset))
if (blk_size[MAJOR(device)])
devblocks = blk_size[MAJOR(device)][MINOR(device)];
#ifdef CONFIG_BLK_DEV_INITRD
if (MAJOR(device) == MAJOR_NR && MINOR(device) == INITRD_MINOR)
devblocks = nblocks;
#endif
if (devblocks == 0) {
printk(KERN_ERR "RAMDISK: could not determine device size\n");
goto done;
}
printk(KERN_NOTICE "RAMDISK: Loading %d blocks [%d disk(s)] into ram disk... ", nblocks, nblocks/devblocks+1);
printk(KERN_NOTICE "RAMDISK: Loading %d blocks [%d disk%s] into ram disk... ",
nblocks, ((nblocks-1)/devblocks)+1, nblocks>devblocks ? "s" : "");
for (i=0; i < nblocks; i++) {
if (i && (i % devblocks == 0)) {
printk("done.\n");
printk("done disk #%d.\n", i/devblocks);
rotate = 0;
invalidate_buffers(device);
if (infile.f_op->release)
......
......@@ -239,8 +239,9 @@ __initfunc(int ultra32_probe1(struct device *dev, int ioaddr))
static int ultra32_open(struct device *dev)
{
int ioaddr = dev->base_addr - ULTRA32_NIC_OFFSET; /* ASIC addr */
int irq_flags = (inb(ioaddr + ULTRA32_CFG5) & 0x08) ? 0 : SA_SHIRQ;
if (request_irq(dev->irq, ei_interrupt, 0, ei_status.name, dev))
if (request_irq(dev->irq, ei_interrupt, irq_flags, ei_status.name, dev))
return -EAGAIN;
outb(ULTRA32_MEMENB, ioaddr); /* Enable Shared Memory. */
......
......@@ -11,6 +11,7 @@
* the bridge optimization, but others might appear later.
*/
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/pci.h>
......
......@@ -1441,9 +1441,8 @@ ncr_pci_init (Scsi_Host_Template *tpnt, int board, int chip,
&command)) ||
(error = pcibios_read_config_byte (bus, device_fn, PCI_CLASS_REVISION,
&revision))) {
printk ("scsi-ncr53c7,8xx : error %s not initializing due to error reading configuration space\n"
" perhaps you specified an incorrect PCI bus, device, or function.\n"
, pcibios_strerror(error));
printk ("scsi-ncr53c7,8xx : error %d not initializing due to error reading configuration space\n"
" perhaps you specified an incorrect PCI bus, device, or function.\n", error);
return -1;
}
io_port = pdev->base_address[0];
......
......@@ -4,7 +4,7 @@
* Author: Rickard E. Faith, faith@cs.unc.edu
* Copyright 1992, 1993, 1994, 1995, 1996 Rickard E. Faith
*
* $Id: fdomain.c,v 5.45 1996/10/02 15:13:06 root Exp $
* Version 5.46 (23-04-1998)
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
......@@ -20,8 +20,6 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
* PCI detection rewritten by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
**************************************************************************
SUMMARY:
......@@ -108,6 +106,7 @@
1.3.85 5.41 4 Apr 1996
2.0.12 5.44 8 Aug 1996 Use ID 7 for all PCI cards
2.1.1 5.45 2 Oct 1996 Update ROM accesses for 2.1.x
2.1.97 5.46 23 Apr 1998 Rewritten PCI detection routines [mj]
......@@ -206,6 +205,8 @@
Thanks to Tom Cavin (tec@usa1.com) for preliminary command-line option
patches.
New PCI detection code written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
All of the alpha testers deserve much thanks.
......@@ -886,7 +887,6 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
#endif
#ifdef CONFIG_PCI
printk( "\nTMC-3260 36C70 PCI scsi chip detection failed.\n" );
printk( "Send mail to mckinley@msupa.pa.msu.edu.\n" );
#endif
return 0; /* Cannot find valid set of ports */
}
......
......@@ -23,6 +23,7 @@
#ifndef _LINUX_MTRR_H
#define _LINUX_MTRR_H
#include <linux/config.h>
#include <linux/ioctl.h>
#define MTRR_IOCTL_BASE 'M'
......
......@@ -8,6 +8,7 @@
#ifndef _NET_DST_H
#define _NET_DST_H
#include <linux/config.h>
#include <net/neighbour.h>
/*
......
......@@ -67,7 +67,7 @@ static int exec_modprobe(void * module_name)
}
set_fs(KERNEL_DS); /* Allow execve args to be in kernel space. */
current->uid = current->euid = 0;
current->uid = current->euid = current->fsuid = 0;
if (execve(modprobe_path, argv, envp) < 0) {
printk(KERN_ERR
"kmod: failed to exec %s -s -k %s, errno = %d\n",
......
......@@ -3,7 +3,7 @@
*
* Alan Cox, <alan@cymru.net>
*
* Version: $Id: icmp.c,v 1.40 1998/04/11 09:38:24 freitag Exp $
* Version: $Id: icmp.c,v 1.41 1998/04/29 22:12:10 alan Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -680,7 +680,7 @@ static void icmp_unreach(struct icmphdr *icmph, struct sk_buff *skb, int len)
if (inet_addr_type(iph->daddr) == RTN_BROADCAST)
{
if (net_ratelimit())
printk("%s sent an invalid ICMP error to a broadcast.\n",
printk(KERN_WARNING "%s sent an invalid ICMP error to a broadcast.\n",
in_ntoa(skb->nh.iph->saddr));
return;
}
......@@ -856,6 +856,9 @@ static void icmp_timestamp(struct icmphdr *icmph, struct sk_buff *skb, int len)
* All these rules are so bizarre, that I removed kernel addrmask
* support at all. It is wrong, it is obsolete, nobody uses it in
* any case. --ANK
*
* Furthermore you can do it with a usermode address agent program
* anyway...
*/
static void icmp_address(struct icmphdr *icmph, struct sk_buff *skb, int len)
......
......@@ -5,7 +5,7 @@
*
* Implementation of the Transmission Control Protocol(TCP).
*
* Version: $Id: tcp_ipv4.c,v 1.141 1998/04/24 19:38:19 freitag Exp $
* Version: $Id: tcp_ipv4.c,v 1.142 1998/04/30 12:00:45 davem Exp $
*
* IPv4 specific functions
*
......@@ -48,6 +48,7 @@
#include <linux/config.h>
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/fcntl.h>
#include <linux/random.h>
#include <linux/init.h>
......@@ -61,9 +62,6 @@
#include <linux/inet.h>
/* That should be really in a standard kernel include file. */
#define offsetof(t,m) ((unsigned int) (&((t *)0)->m))
extern int sysctl_tcp_timestamps;
extern int sysctl_tcp_window_scaling;
extern int sysctl_tcp_sack;
......
......@@ -449,6 +449,7 @@ EXPORT_SYMBOL(qdisc_head);
EXPORT_SYMBOL(qdisc_create_dflt);
EXPORT_SYMBOL(noop_qdisc);
#ifdef CONFIG_NET_SCHED
EXPORT_SYMBOL(pfifo_qdisc_ops);
EXPORT_SYMBOL(register_qdisc);
EXPORT_SYMBOL(unregister_qdisc);
EXPORT_SYMBOL(qdisc_get_rtab);
......
......@@ -9,7 +9,6 @@
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include <linux/config.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <asm/system.h>
......
......@@ -9,7 +9,6 @@
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include <linux/config.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <asm/system.h>
......
......@@ -9,7 +9,6 @@
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include <linux/config.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <asm/system.h>
......
......@@ -66,6 +66,8 @@
powerful clsssification engine.
*/
#include <linux/config.h>
struct rsvp_head
{
u32 tmap[256/32];
......
......@@ -9,7 +9,6 @@
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include <linux/config.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <asm/system.h>
......
......@@ -12,7 +12,6 @@
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
......
......@@ -8,7 +8,6 @@
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*/
#include <linux/config.h>
#include <linux/module.h>
#include <asm/uaccess.h>
#include <asm/system.h>
......
......@@ -1118,13 +1118,14 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
struct x25_facilities facilities;
if (copy_from_user(&facilities, (void *)arg, sizeof(facilities)))
return -EFAULT;
if (sk->state != TCP_LISTEN)
if (sk->state != TCP_LISTEN && sk->state != TCP_CLOSE)
return -EINVAL;
if (facilities.pacsize_in < X25_PS16 || facilities.pacsize_in > X25_PS4096)
return -EINVAL;
if (facilities.pacsize_out < X25_PS16 || facilities.pacsize_out > X25_PS4096)
return -EINVAL;
if (sk->protinfo.x25->neighbour->extended) {
if (sk->state == TCP_CLOSE || sk->protinfo.x25->neighbour->extended)
{
if (facilities.winsize_in < 1 || facilities.winsize_in > 127)
return -EINVAL;
if (facilities.winsize_out < 1 || facilities.winsize_out > 127)
......
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