Commit b872e060 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.11

parent bb9c5bf1
......@@ -688,7 +688,9 @@ S: United Kingdom
N: Michael Neuffer
E: neuffer@goofy.zdv.uni-mainz.de
D: developer and maintainer of the eata_dma SCSI driver
D: Developer and maintainer of the EATA-DMA SCSI driver
D: Co-developer EATA-PIO SCSI driver
D: Assorted other snippets
S: Zum Schiersteiner Grund 2
S: 55127 Mainz
S: Germany
......
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 10
SUBLEVEL = 11
ARCH = i386
......
......@@ -9,7 +9,7 @@
#define halt .long PAL_halt
#define rti .long PAL_rti
#define NR_SYSCALLS 310
#define NR_SYSCALLS 320
#define osf_vfork sys_fork
/*
......@@ -565,3 +565,6 @@ sys_call_table:
/* linux-specific system calls start at 300 */
/*300*/ .quad sys_bdflush, sys_sethae, sys_mount, sys_adjtimex, sys_swapoff
.quad sys_getdents, sys_create_module, sys_init_module, sys_delete_module, sys_get_kernel_syms
.quad sys_syslog, do_entSys, do_entSys, do_entSys, do_entSys
.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
......@@ -693,7 +693,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data, int a4,
else
child->flags &= ~PF_TRACESYS;
child->exit_code = data;
child->state = TASK_RUNNING;
wake_up_process(child);
ptrace_cancel_bpt(child);
set_success(&regs,data);
return 0;
......@@ -705,7 +705,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data, int a4,
* exit.
*/
case PTRACE_KILL: {
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = SIGKILL;
ptrace_cancel_bpt(child);
return 0;
......@@ -721,7 +721,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data, int a4,
return res;
}
child->flags &= ~PF_TRACESYS;
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
/* give it a chance to run. */
return 0;
......@@ -733,7 +733,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data, int a4,
return -EIO;
}
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
......
......@@ -8,7 +8,7 @@
$(CC) $(CFLAGS) -c $<
OBJS = __divqu.o __remqu.o __divlu.o __remlu.o memset.o memcpy.o io.o \
checksum.o
checksum.o strlen.o
lib.a: $(OBJS)
$(AR) rcs lib.a $(OBJS)
......
/*
* strlen.S (c) 1995 David Mosberger (davidm@cs.arizona.edu)
*
* Finds length of a 0-terminated string. Optimized for the
* Alpha architecture:
*
* - memory accessed as aligned quadwords only
* - uses bcmpge to compare 8 bytes in parallel
* - does binary search to find 0 byte in last
* quadword (HAKMEM needed 12 instructions to
* do this instead of the 9 instructions that
* binary search needs).
*/
.set noreorder
.set noat
.align 3
.globl strlen
.ent strlen
strlen:
ldq_u $1, 0($16) # load first quadword ($16 may be misaligned)
lda $2, -1($31)
insqh $2, $16, $2
andnot $16, 7, $0
or $2, $1, $1
cmpbge $31, $1, $2 # $2 <- bitmask: bit i == 1 <==> i-th byte == 0
bne $2, found
loop: ldq $1, 8($0)
addq $0, 8, $0 # addr += 8
nop # helps dual issue last two insns
cmpbge $31, $1, $2
beq $2, loop
found: blbs $2, done # make aligned case fast
negq $2, $3
and $2, $3, $2
and $2, 0x0f, $1
addq $0, 4, $3
cmoveq $1, $3, $0
and $2, 0x33, $1
addq $0, 2, $3
cmoveq $1, $3, $0
and $2, 0x55, $1
addq $0, 1, $3
cmoveq $1, $3, $0
done: subq $0, $16, $0
ret $31, ($26)
.end strlen
......@@ -466,7 +466,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
else
child->flags &= ~PF_TRACESYS;
child->exit_code = data;
child->state = TASK_RUNNING;
wake_up_process(child);
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) & ~TRAP_FLAG;
put_stack_long(child, sizeof(long)*EFL-MAGICNUMBER,tmp);
......@@ -481,7 +481,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
case PTRACE_KILL: {
long tmp;
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = SIGKILL;
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) & ~TRAP_FLAG;
......@@ -497,7 +497,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
child->flags &= ~PF_TRACESYS;
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) | TRAP_FLAG;
put_stack_long(child, sizeof(long)*EFL-MAGICNUMBER,tmp);
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
/* give it a chance to run. */
return 0;
......@@ -509,7 +509,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
if ((unsigned long) data > NSIG)
return -EIO;
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
......
......@@ -448,7 +448,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
else
child->flags &= ~PF_TRACESYS;
child->exit_code = data;
child->state = TASK_RUNNING;
wake_up_process(child);
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) & ~TRAP_FLAG;
put_stack_long(child, sizeof(long)*EFL-MAGICNUMBER,tmp);
......@@ -463,7 +463,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
case PTRACE_KILL: {
long tmp;
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = SIGKILL;
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) & ~TRAP_FLAG;
......@@ -479,7 +479,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
child->flags &= ~PF_TRACESYS;
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) | TRAP_FLAG;
put_stack_long(child, sizeof(long)*EFL-MAGICNUMBER,tmp);
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
/* give it a chance to run. */
return 0;
......@@ -491,7 +491,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
if ((unsigned long) data > NSIG)
return -EIO;
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
......
......@@ -15,7 +15,6 @@
$(CC) $(CFLAGS) -c $<
SUBDIRS = block char net #streams
ALL_SUBDIRS = block char net scsi #streams
ifdef CONFIG_PCI
SUBDIRS := $(SUBDIRS) pci
......@@ -35,9 +34,9 @@ driversubdirs: dummy
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done
modules: dummy
set -e; for i in $(ALL_SUBDIRS); do $(MAKE) -C $$i modules; done
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i modules; done
dep:
set -e; for i in $(ALL_SUBDIRS); do $(MAKE) -C $$i dep; done
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i dep; done
include $(TOPDIR)/Rules.make
-- README.sjcd
80% of the work takes 20% of the time,
20% of the work takes 80% of the time...
(Murphy law)
......@@ -5,21 +6,36 @@
Once started, training can not be stopped...
(StarWars)
This is the README for the sjcd cdrom driver, version 1.3.
This file is meant as a tips & tricks edge for the usage of the SANYO CDR-H94A
cdrom drive. It will grow as the questions arise. ;-)
Since the drive often comes with an ISP16 soundcard, which can be used
as cdrom interface, this is also the place for ISP16 related issues.
The driver should work with any SoundBlaster/Panasonic style CDROM interface,
including the "soft configurable" MediaMagic sound card.
To make this sound card (and others like "Mozart") working, it has to get
"configured" by software.
So, you should boot DOS once (and by this, run the "configuration driver")
The suggestion to configure the ISP16 soundcard by booting DOS and
a warm reboot to boot Linux somehow doesn't work, at least not
on Eric's machine (IPC P90), with the version of the ISP16
card he has (there appear to be at least two versions: Eric's card with
no jumpered IDE support and Vadim's version with a jumper to enable
IDE support).
Therefore detection and configuration of the ISP16 interfaces is included
in the driver.
If we should support any other interfaces (which cannot be configured
through DOS) or if there are any more ISP16 types, please let us
know (maarel@marin.nl) and we'll see.
Otherwise, you should boot DOS once (and by this, run the "configuration driver")
and then switch to Linux by use of CTL-ALT-DEL. Each use of the RESET
button or the power switch makes this procedure necessary again.
If no ISP16 is detected, there's no harm done; a card configured trough DOS
may still work as expected.
Vadim has implemented a Linux "configuration driver" to set up the
registers of the MediaMagic (ISP-16) sound card. These routines have to get
integrated into the related CDROM and sound drivers directly at a later
time. Currently, they reside at Vadim's server
ISP16 configuration routines reside at Vadim's server
rbrf.msk.su:/linux/mediamagic/
and at Eberhard's mirror
ftp.gwdg.de:/pub/linux/cdrom/drivers/sanyo/
......@@ -29,6 +45,26 @@ Leo Spiekman's configuration routines for the ISP-16 card can get found at
and at Eberhard's mirror
ftp.gwdg.de:/pub/linux/cdrom/drivers/optics/
Eric van der Maarel's routines are included in sjcd.c.
This, and any related stuff may be found by anonymous ftp at
ftp.gwdg.de:/pub/linux/cdrom/drivers/sanyo/
The device major for sjcd is 18, and minor is 0. Create a block special
file in your /dev directory (e.g., /dev/sjcd) with these numbers.
(For those who don't know, being root and the following should do the trick:
mknod -m 644 /dev/sjcd b 18 0
and mount the cdrom by /dev/sjcd).
The default configuration parameters are:
base address 0x340
irq 10
no dma
As of version 1.2, setting base address, irq and dma at boot time is supported
through the use of command line options: type at the "boot:" prompt:
linux sjcd=<base address>,<irq>,<dma>
(where your kernel is assumed to be called by saying "linux" to
the boot manager).
If something is wrong, e-mail to vadim@rbrf.msk.su
or vadim@ipsun.ras.ru
or model@cecmow.enet.dec.com
......
......@@ -1358,7 +1358,7 @@ static int ide_open(struct inode * inode, struct file * filp)
sleep_on(&dev->wqueue);
dev->usage++;
restore_flags(flags);
if (dev->id->config & (1<<7)) /* for removeable disks */
if (dev->id && (dev->id->config & (1<<7))) /* for removeable disks */
check_disk_change(inode->i_rdev);
#ifdef CONFIG_BLK_DEV_IDECD
if (dev->type == cdrom)
......@@ -1654,7 +1654,7 @@ static int ide_check_media_change (dev_t full_dev)
if (dev->type == cdrom)
return cdrom_check_media_change (dev);
#endif /* CONFIG_BLK_DEV_IDECD */
if (dev->id->config & (1<<7)) /* for removeable disks */
if (dev->id && (dev->id->config & (1<<7))) /* for removeable disks */
return 1; /* always assume it was changed */
return 0;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -42,6 +42,8 @@ endif
ifdef CONFIG_HP100
NETDRV_OBJS := $(NETDRV_OBJS) hp100.o
else
MODULES := $(MODULES) hp100.o
endif
ifdef CONFIG_WD80x3
......
......@@ -65,6 +65,7 @@
* 0.11 14-Jun-95 Reset interface bug fixed?
* Little bug in hp100_close function fixed.
* 100Mb/s connection debugged.
* 0.12 14-Jul-95 Link down is now handled better.
*
*/
......@@ -350,12 +351,6 @@ static int hp100_open( struct device *dev )
int ioaddr = dev -> base_addr;
struct hp100_private *lp = (struct hp100_private *)dev -> priv;
if ( ( lp -> lan_type = hp100_sense_lan( dev ) ) < 0 )
{
printk( "%s: no connection found - check wire\n", dev -> name );
return -EIO;
}
if ( request_irq( dev -> irq, hp100_interrupt, SA_INTERRUPT, lp -> id -> name ) )
{
printk( "%s: unable to get IRQ %d\n", dev -> name, dev -> irq );
......@@ -372,6 +367,7 @@ static int hp100_open( struct device *dev )
dev -> interrupt = 0;
dev -> start = 1;
lp -> lan_type = hp100_sense_lan( dev );
lp -> mac1_mode = HP100_MAC1MODE3;
lp -> mac2_mode = HP100_MAC2MODE3;
......@@ -424,11 +420,11 @@ static int hp100_close( struct device *dev )
struct hp100_private *lp = (struct hp100_private *)dev -> priv;
hp100_page( PERFORMANCE );
hp100_outw( 0xfefe, IRQ_MASK ); /* mask off all ints */
hp100_outw( 0xfefe, IRQ_MASK ); /* mask off all IRQs */
hp100_stop_interface( dev ); /* relogin */
hp100_stop_interface( dev );
if ( lp -> lan_type == HP100_LAN_100 )
if ( lp -> lan_type == HP100_LAN_100 ) /* relogin */
hp100_login_to_vg_hub( dev );
dev -> tbusy = 1;
......@@ -452,6 +448,20 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev )
int ioaddr = dev -> base_addr;
u_short val;
struct hp100_private *lp = (struct hp100_private *)dev -> priv;
if ( lp -> lan_type < 0 )
{
hp100_stop_interface( dev );
if ( ( lp -> lan_type = hp100_sense_lan( dev ) ) < 0 )
{
printk( "%s: no connection found - check wire\n", dev -> name );
hp100_start_interface( dev ); /* 10Mb/s RX packets maybe handled */
return -EIO;
}
if ( lp -> lan_type == HP100_LAN_100 )
lp -> hub_status = hp100_login_to_vg_hub( dev );
hp100_start_interface( dev );
}
if ( ( i = ( hp100_inl( TX_MEM_FREE ) & ~0x7fffffff ) ) < skb -> len + 16 )
{
......@@ -463,11 +473,9 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev )
/* 100Mb/s adapter isn't connected to hub */
{
printk( "%s: login to 100Mb/s hub retry\n", dev -> name );
hp100_ints_off();
hp100_stop_interface( dev );
lp -> hub_status = hp100_login_to_vg_hub( dev );
hp100_start_interface( dev );
hp100_ints_on();
}
else
{
......@@ -483,20 +491,16 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev )
/* it's very heavy - all network setting must be changed!!! */
printk( "%s: cable change 10Mb/s <-> 100Mb/s detected\n", dev -> name );
lp -> lan_type = i;
hp100_ints_off();
hp100_stop_interface( dev );
if ( lp -> lan_type == HP100_LAN_100 )
lp -> hub_status = hp100_login_to_vg_hub( dev );
hp100_start_interface( dev );
hp100_ints_on();
}
else
{
printk( "%s: interface reset\n", dev -> name );
hp100_ints_off();
hp100_stop_interface( dev );
hp100_start_interface( dev );
hp100_ints_on();
}
}
dev -> trans_start = jiffies;
......@@ -566,6 +570,15 @@ static void hp100_rx( struct device *dev )
u_int header;
struct sk_buff *skb;
#if 0
if ( lp -> lan_type < 0 )
{
if ( ( lp -> lan_type = hp100_sense_lan( dev ) ) == HP100_LAN_100 )
lp -> hub_status = hp100_login_to_vg_hub( dev );
hp100_page( PERFORMANCE );
}
#endif
packets = hp100_inb( RX_PKT_CNT );
#ifdef HP100_DEBUG
if ( packets > 1 )
......@@ -730,6 +743,7 @@ static void hp100_interrupt( int irq )
printk( "%s: re-entering the interrupt handler\n", dev -> name );
hp100_ints_off();
dev -> interrupt = 1;
hp100_page( PERFORMANCE );
val = hp100_inw( IRQ_STATUS );
#ifdef HP100_DEBUG_IRQ
printk( "hp100_interrupt: irq_status = 0x%x\n", val );
......
......@@ -49,6 +49,7 @@
April 23, 1995 (dp) Fixed ioctl so it works properly with piconfig program
when changing the baud rate or clock mode.
version 0.8 ALPHA
July 17, 1995 (ac) Finally polishing of AX25.030+ support
*/
......@@ -59,7 +60,7 @@
of each transmitted packet. If this causes you to lose sleep, #undefine it.
*/
#define STUFF2 1
/*#define STUFF2 1*/
/* The default configuration */
#define PI_DMA 3
......@@ -1429,10 +1430,10 @@ static int pi_probe(struct device *dev, int card_type)
dev->rebuild_header = pi_rebuild_header;
dev->set_mac_address = pi_set_mac_address;
dev->type = ARPHRD_AX25; /* AF_AX25 device */
dev->hard_header_len = 17; /* We don't do digipeaters */
dev->mtu = 1500; /* eth_mtu is the default */
dev->addr_len = 7; /* sizeof an ax.25 address */
dev->type = ARPHRD_AX25; /* AF_AX25 device */
dev->hard_header_len = 73; /* We do digipeaters now */
dev->mtu = 1500; /* eth_mtu is the default */
dev->addr_len = 7; /* sizeof an ax.25 address */
memcpy(dev->broadcast, ax25_bcast, 7);
memcpy(dev->dev_addr, ax25_test, 7);
......
......@@ -36,6 +36,7 @@
* statistics. Include CSLIP code only
* if it really needed.
* Alan Cox : Free slhc buffers in the right place.
* Alan Cox : Allow for digipeated IP over AX.25
*
*
*
......@@ -1014,7 +1015,7 @@ slip_ioctl(struct tty_struct *tty, void *file, int cmd, void *arg)
#else
if ((tmp & SL_MODE_AX25) || (tmp & SL_MODE_AX25VC)) {
sl->dev->addr_len=AX25_ADDR_LEN; /* sizeof an AX.25 addr */
sl->dev->hard_header_len=AX25_HEADER_LEN; /* We don't do digipeaters */
sl->dev->hard_header_len=73; /* We don't do digipeaters */
} else {
sl->dev->addr_len=0; /* No mac addr in slip mode */
sl->dev->hard_header_len=0;
......
......@@ -3,36 +3,24 @@
*
* Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of Calgary
* Department of Computer Science and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 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 Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
* An alternate version of this driver with a BSD-style copyright can
* be found on XXX.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Sources include the Adaptec 1740 driver (aha1740.c), the Ultrastor 24F
* driver (ultrastor.c), various Linux kernel source, the Adaptec EISA
* config file (!adp7771.cfg), the Adaptec AHA-2740A Series User's Guide,
......
......@@ -3,36 +3,24 @@
*
* Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of Calgary
* Department of Computer Science and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 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 Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
* An alternate version of this driver with a BSD-style copyright can
* be found on XXX.
*
* $Id: aic7xxx.h,v 1.18 1995/06/22 04:17:56 deang Exp $
*-M*************************************************************************/
#ifndef _aic7xxx_h
......
......@@ -3,35 +3,23 @@
*
* Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of Calgary
* Department of Computer Science and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* 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 Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
* An alternate version of this driver with a BSD-style copyright can
* be found on XXX.
*
* Comments are started by `#' and continue to the end of the line; lines
* may be of the form:
......
This diff is collapsed.
......@@ -16,7 +16,7 @@
#define VER_MAJOR 2
#define VER_MINOR 5
#define VER_SUB "6a"
#define VER_SUB "7a"
/************************************************************************
......
......@@ -4,11 +4,11 @@ const char *const scsi_dev_types[MAX_SCSI_DEVICE_CODE] =
{
"Direct-Access ",
"Sequential-Access",
"Printer ",
"Processor ",
"WORM ",
"CD-ROM ",
"Scanner ",
"Printer ",
"Processor ",
"WORM ",
"CD-ROM ",
"Scanner ",
"Optical Device ",
"Medium Changer ",
"Communications "
......@@ -47,8 +47,24 @@ void swap_statistics(u8 *p)
*/
int eata_set_info(char *buffer, int length, struct Scsi_Host *HBA_ptr)
{
DBG(DBG_PROC_WRITE, printk("%s\n", buffer));
return(-ENOSYS); /* Currently this is a no-op */
if (length >= 8 && strncmp(buffer, "eata_dma", 8) == 0) {
buffer += 9;
length -= 9;
if(length >= 8 && strncmp(buffer, "latency", 7) == 0) {
SD(HBA_ptr)->do_latency = TRUE;
return(length+9);
}
if(length >=10 && strncmp(buffer, "nolatency", 9) == 0) {
SD(HBA_ptr)->do_latency = FALSE;
return(length+9);
}
printk("Unknown command:%s length: %d\n", buffer, length);
} else
printk("Wrong Signature:%10s\n", (char *) ((ulong)buffer-9));
return(-EINVAL);
}
/*
......@@ -72,19 +88,19 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
static u8 buff[512];
static u8 buff2[512];
hst_cmd_stat *rhcs, *whcs;
coco *cc;
scsitrans *st;
scsimod *sm;
hobu *hb;
scbu *sb;
boty *bt;
memco *mc;
firm *fm;
subinf *si;
pcinf *pi;
arrlim *al;
coco *cc;
scsitrans *st;
scsimod *sm;
hobu *hb;
scbu *sb;
boty *bt;
memco *mc;
firm *fm;
subinf *si;
pcinf *pi;
arrlim *al;
int i, x;
int size, len = 0;
int size, len = 0;
off_t begin = 0;
off_t pos = 0;
......@@ -327,7 +343,7 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
SD(HBA_ptr)->writes[11]);
len += size;
pos = begin + len;
size = sprintf(buffer+len,"Sum :%12u %12u\n",
size = sprintf(buffer+len,"Sum : %12u %12u\n",
SD(HBA_ptr)->reads[12],
SD(HBA_ptr)->writes[12]);
len += size;
......@@ -341,6 +357,79 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
if (pos > offset + length)
goto stop_output;
if(SD(HBA_ptr)->do_latency == TRUE) {
size = sprintf(buffer + len, "Host Latency Command Statistics:\n"
"Current timer resolution: 10ms\n"
" Reads: Min:(ms) Max:(ms) Ave:(ms)\n");
len += size;
pos = begin + len;
for (x = 0; x <= 10; x++) {
size = sprintf(buffer+len,"%5dk:%12u %12u %12u %12u\n",
1 << x,
SD(HBA_ptr)->reads_lat[x][0],
(SD(HBA_ptr)->reads_lat[x][1] == 0xffffffff)
? 0:(SD(HBA_ptr)->reads_lat[x][1] * 10),
SD(HBA_ptr)->reads_lat[x][2] * 10,
SD(HBA_ptr)->reads_lat[x][3] * 10 /
((SD(HBA_ptr)->reads_lat[x][0])
? SD(HBA_ptr)->reads_lat[x][0]:1));
len += size;
pos = begin + len;
}
size = sprintf(buffer+len,">1024k:%12u %12u %12u %12u\n",
SD(HBA_ptr)->reads_lat[11][0],
(SD(HBA_ptr)->reads_lat[11][1] == 0xffffffff)
? 0:(SD(HBA_ptr)->reads_lat[11][1] * 10),
SD(HBA_ptr)->reads_lat[11][2] * 10,
SD(HBA_ptr)->reads_lat[11][3] * 10 /
((SD(HBA_ptr)->reads_lat[x][0])
? SD(HBA_ptr)->reads_lat[x][0]:1));
len += size;
pos = begin + len;
if (pos < offset) {
len = 0;
begin = pos;
}
if (pos > offset + length)
goto stop_output;
size = sprintf(buffer + len,
" Writes: Min:(ms) Max:(ms) Ave:(ms)\n");
len += size;
pos = begin + len;
for (x = 0; x <= 10; x++) {
size = sprintf(buffer+len,"%5dk:%12u %12u %12u %12u\n",
1 << x,
SD(HBA_ptr)->writes_lat[x][0],
(SD(HBA_ptr)->writes_lat[x][1] == 0xffffffff)
? 0:(SD(HBA_ptr)->writes_lat[x][1] * 10),
SD(HBA_ptr)->writes_lat[x][2] * 10,
SD(HBA_ptr)->writes_lat[x][3] * 10 /
((SD(HBA_ptr)->writes_lat[x][0])
? SD(HBA_ptr)->writes_lat[x][0]:1));
len += size;
pos = begin + len;
}
size = sprintf(buffer+len,">1024k:%12u %12u %12u %12u\n",
SD(HBA_ptr)->writes_lat[11][0],
(SD(HBA_ptr)->writes_lat[11][1] == 0xffffffff)
? 0:(SD(HBA_ptr)->writes_lat[x][1] * 10),
SD(HBA_ptr)->writes_lat[11][2] * 10,
SD(HBA_ptr)->writes_lat[11][3] * 10/
((SD(HBA_ptr)->writes_lat[x][0])
? SD(HBA_ptr)->writes_lat[x][0]:1));
len += size;
pos = begin + len;
if (pos < offset) {
len = 0;
begin = pos;
}
if (pos > offset + length)
goto stop_output;
}
scd = scsi_devices;
size = sprintf(buffer+len,"Attached devices: %s\n", (scd)?"":"none");
......@@ -350,7 +439,8 @@ int eata_proc_info(char *buffer, char **start, off_t offset, int length,
while (scd) {
if (scd->host == HBA_ptr) {
size = sprintf(buffer + len, "Channel: %02d Id: %02d Lun: %02d\n Vendor: ",
size = sprintf(buffer + len,
"Channel: %02d Id: %02d Lun: %02d\n Vendor: ",
scd->channel, scd->id, scd->lun);
for (x = 0; x < 8; x++) {
if (scd->vendor[x] >= 0x20)
......
This diff is collapsed.
......@@ -32,7 +32,7 @@
* Cambridge, MA 02139, USA. *
* *
************************************************************
* last change: 95/06/20 OS: Linux 1.3.3 + pre1.3 SCSI pat.*
* last change: 95/07/13 OS: Linux 1.3.9 *
************************************************************/
/* Look in eata_pio.h for configuration information */
......@@ -504,7 +504,7 @@ int eata_pio_reset(Scsi_Cmnd * cmd)
HD(cmd)->state = RESET;
time = jiffies;
while (jiffies < (time + 300) && limit++ < 10000000);
while (jiffies < (time + (3 * HZ)) && limit++ < 10000000);
DBG(DBG_ABNORM, printk("eata_pio_reset: interrupts disabled, loops %d.\n", limit));
DBG(DBG_ABNORM && DBG_DELAY, DEL2(500));
......@@ -650,7 +650,7 @@ void print_pio_config(struct get_conf *gc)
printk("IRQ:%d IRQT:%d FORCADR:%d MCH:%d RIDQ:%d\n",
gc->IRQ, gc->IRQ_TR, gc->FORCADR,
gc->MAX_CHAN, gc->ID_qest);
DBG(DPT_DEBUG, DELAY(1400));
DBG(DPT_DEBUG, DELAY(14));
}
static uint print_selftest(uint base)
......@@ -1014,7 +1014,7 @@ int eata_pio_detect(Scsi_Host_Template * tpnt)
HBA_ptr = SD(HBA_ptr)->next;
}
}
DBG(DPT_DEBUG,DELAY(1200));
DBG(DPT_DEBUG,DELAY(12));
return (registered_HBAs);
}
......
......@@ -80,6 +80,7 @@
#define LOG_SENSE 0x4d
#define MODE_SELECT_10 0x55
#define MODE_SENSE_10 0x5a
#define READ_12 0xa8
#define WRITE_12 0xaa
#define WRITE_VERIFY_12 0xae
#define SEARCH_HIGH_12 0xb0
......
......@@ -30,7 +30,7 @@
#include "sound_config.h"
#if defined(CONFIGURE_SOUNDCARD) && !defined(EXCLUDE_GUS)
#include "ultrasound.h"
#include <linux/ultrasound.h>
#include "gus_hw.h"
#define MIX_DEVS (SOUND_MASK_MIC|SOUND_MASK_LINE| \
......
......@@ -7,6 +7,10 @@
*
* Modularised by Alan Cox <Alan.Cox@linux.org>, while hacking some
* experimental NFS changes. Modularisation taken straight from SYS5 fs.
*
* Change to nfs_read_super() to permit NFS mounts to multi-homed hosts.
* J.S.Peatfield@damtp.cam.ac.uk
*
*/
#ifdef MODULE
......@@ -76,6 +80,7 @@ struct super_block *nfs_read_super(struct super_block *sb, void *raw_data,
struct nfs_server *server;
unsigned int fd;
struct file *filp;
dev_t dev = sb->s_dev;
MOD_INC_USE_COUNT;
......@@ -104,6 +109,7 @@ struct super_block *nfs_read_super(struct super_block *sb, void *raw_data,
}
filp->f_count++;
lock_super(sb);
sb->s_blocksize = 1024; /* XXX */
sb->s_blocksize_bits = 10;
sb->s_magic = NFS_SUPER_MAGIC;
......@@ -131,6 +137,31 @@ struct super_block *nfs_read_super(struct super_block *sb, void *raw_data,
server->acdirmin = data->acdirmin*HZ;
server->acdirmax = data->acdirmax*HZ;
strcpy(server->hostname, data->hostname);
/* Start of JSP NFS patch */
/* Check if passed address in data->addr */
if (data->addr.sin_addr.s_addr == INADDR_ANY) { /* No address passed */
if (((struct sockaddr_in *)(&server->toaddr))->sin_addr.s_addr == INADDR_ANY) {
printk("NFS: Error passed unconnected socket and no address\n") ;
return NULL ;
} else {
/* Need access to socket internals JSP */
struct socket *sock;
int dummylen ;
/* printk("NFS: using socket address\n") ;*/
sock = &((filp->f_inode)->u.socket_i);
/* extract the other end of the socket into server->toaddr */
sock->ops->getname(sock, &(server->toaddr), &dummylen, 1) ;
}
} else {
/* printk("NFS: coppying passed addr to server->toaddr\n") ;*/
memcpy((char *)&(server->toaddr),(char *)(&data->addr),sizeof(server->toaddr));
}
/* End of JSP NFS patch */
sb->u.nfs_sb.s_root = data->root;
unlock_super(sb);
if (!(sb->s_mounted = nfs_fhget(sb, &data->root, NULL))) {
......
......@@ -102,7 +102,10 @@ static int do_nfs_rpc_call(struct nfs_server *server, int *start, int *end, int
fs = get_fs();
set_fs(get_ds());
for (n = 0, timeout = init_timeout; ; n++, timeout <<= 1) {
result = sock->ops->send(sock, (void *) start, len, 0, 0);
/* JSP 1995-07-01 Use sendto() not send() to cope with multi-homed hosts
as we have set the socket to have INADDR_ANY as it's desination */
result = sock->ops->sendto(sock, (void *) start, len, 0, 0,
&(server->toaddr), sizeof((server->toaddr))) ;
if (result < 0) {
printk("nfs_rpc_call: send error = %d\n", result);
break;
......
......@@ -85,7 +85,7 @@ __old_ipl; })
#define save_flags(flags) do { flags = getipl(); } while (0)
#define restore_flags(flags) setipl(flags)
extern inline unsigned long xchg_u32(int * m, unsigned long val)
extern inline unsigned long xchg_u32(volatile int * m, unsigned long val)
{
unsigned long dummy, dummy2;
......@@ -100,7 +100,7 @@ extern inline unsigned long xchg_u32(int * m, unsigned long val)
return val;
}
extern inline unsigned long xchg_u64(long * m, unsigned long val)
extern inline unsigned long xchg_u64(volatile long * m, unsigned long val)
{
unsigned long dummy, dummy2;
......@@ -115,9 +115,19 @@ extern inline unsigned long xchg_u64(long * m, unsigned long val)
return val;
}
extern inline void * xchg_ptr(void *m, void *val)
#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
#define tas(ptr) (xchg((ptr),1))
static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
{
return (void *) xchg_u64((long *) m, (unsigned long) val);
switch (size) {
case 4:
return xchg_u32(ptr, x);
case 8:
return xchg_u64(ptr, x);
}
printk("Argh.. xchg() with unsupported size\n");
return x;
}
#endif /* __ASSEMBLY__ */
......
......@@ -8,6 +8,123 @@
* yet. I'll have to see about this later..
*/
#define __NR_exit 1
#define __NR_fork 2
#define __NR_read 3
#define __NR_write 4
#define __NR_close 6
#define __NR_wait4 7
#define __NR_link 9
#define __NR_unlink 10
#define __NR_chdir 12
#define __NR_fchdir 13
#define __NR_mknod 14
#define __NR_chmod 15
#define __NR_chown 16
#define __NR_brk 17
#define __NR_lseek 19
#define __NR_getxpid 20
#define __NR_setuid 23
#define __NR_getxuid 24
#define __NR_ptrace 26
#define __NR_access 33
#define __NR_sync 36
#define __NR_kill 37
#define __NR_setpgid 39
#define __NR_dup 41
#define __NR_pipe 42
#define __NR_open 45
#define __NR_getxgid 47
#define __NR_ioctl 54
#define __NR_symlink 57
#define __NR_readlink 58
#define __NR_execve 59
#define __NR_umask 60
#define __NR_getpgrp 63
#define __NR_getpagesize 64
#define __NR_stat 67
#define __NR_lstat 68
#define __NR_munmap 73
#define __NR_mprotect 74
#define __NR_madvise 75
#define __NR_vhangup 76
#define __NR_getgroups 79
#define __NR_setgroups 80
#define __NR_setpgid 82
#define __NR_setitimer 83
#define __NR_getitimer 86
#define __NR_gethostname 87
#define __NR_sethostname 88
#define __NR_getdtablesize 89
#define __NR_dup2 90
#define __NR_fstat 91
#define __NR_fcntl 92
#define __NR_select 93
#define __NR_fsync 95
#define __NR_setpriority 96
#define __NR_socket 97
#define __NR_connect 98
#define __NR_accept 99
#define __NR_getpriority 100
#define __NR_send 101
#define __NR_recv 102
#define __NR_sigreturn 103
#define __NR_bind 104
#define __NR_setsockopt 105
#define __NR_listen 106
#define __NR_sigsuspend 111
#define __NR_gettimeofday 116
#define __NR_getrusage 117
#define __NR_getsockopt 118
#define __NR_settimeofday 122
#define __NR_fchown 123
#define __NR_fchmod 124
#define __NR_recvfrom 125
#define __NR_setreuid 126
#define __NR_setregid 127
#define __NR_rename 128
#define __NR_truncate 129
#define __NR_ftruncate 130
#define __NR_setgid 132
#define __NR_sendto 133
#define __NR_shutdown 134
#define __NR_socketpair 135
#define __NR_mkdir 136
#define __NR_rmdir 137
#define __NR_utimes 138
#define __NR_getpeername 141
#define __NR_getrlimit 144
#define __NR_setrlimit 145
#define __NR_setsid 147
#define __NR_getsockname 150
#define __NR_sigaction 156
#define __NR_msgctl 200
#define __NR_msgget 201
#define __NR_msgrcv 202
#define __NR_msgsnd 203
#define __NR_semctl 204
#define __NR_semget 205
#define __NR_semop 206
#define __NR_shmctl 210
#define __NR_shmdt 211
#define __NR_shmget 212
/*
* Linux-specific system calls begin at 300
*/
#define __NR_bdflush 300
#define __NR_sethae 301
#define __NR_mount 302
#define __NR_adjtimex 303
#define __NR_swapoff 304
#define __NR_getdents 305
#define __NR_create_module 306
#define __NR_init_module 307
#define __NR_delete_module 308
#define __NR_get_kernel_syms 309
#define __NR_syslog 310
#ifdef __LIBRARY__
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
......
......@@ -138,32 +138,32 @@ __asm__ __volatile__ ( \
:"ax")
extern inline unsigned long xchg_u8(char * m, unsigned long val)
{
__asm__("xchgb %b0,%1":"=q" (val),"=m" (*m):"0" (val):"memory");
return val;
}
extern inline unsigned long xchg_u16(short * m, unsigned long val)
{
__asm__("xchgw %w0,%1":"=r" (val),"=m" (*m):"0" (val):"memory");
return val;
}
#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
#define tas(ptr) (xchg((ptr),1))
extern inline unsigned long xchg_u32(int * m, unsigned long val)
{
__asm__("xchgl %0,%1":"=r" (val),"=m" (*m):"0" (val):"memory");
return val;
}
extern inline int tas(char * m)
{
return xchg_u8(m,1);
}
struct __xchg_dummy { unsigned long a[100]; };
#define __xg(x) ((volatile struct __xchg_dummy *)(x))
extern inline void * xchg_ptr(void * m, void * val)
static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size)
{
return (void *) xchg_u32(m, (unsigned long) val);
switch (size) {
case 1:
__asm__("xchgb %b0,%1"
:"=q" (x), "=m" (*__xg(ptr))
:"0" (x), "m" (*__xg(ptr)));
break;
case 2:
__asm__("xchgw %w0,%1"
:"=r" (x), "=m" (*__xg(ptr))
:"0" (x), "m" (*__xg(ptr)));
break;
case 4:
__asm__("xchgl %0,%1"
:"=r" (x), "=m" (*__xg(ptr))
:"0" (x), "m" (*__xg(ptr)));
break;
}
return x;
}
#define mb() __asm__ __volatile__ ("" : : :"memory")
......
#ifndef _ASM_I386_UNISTD_H_
#define _ASM_I386_UNISTD_H_
/*
* This file contains the system call numbers.
*/
#define __NR_setup 0 /* used only by init, to get system going */
#define __NR_exit 1
#define __NR_fork 2
#define __NR_read 3
#define __NR_write 4
#define __NR_open 5
#define __NR_close 6
#define __NR_waitpid 7
#define __NR_creat 8
#define __NR_link 9
#define __NR_unlink 10
#define __NR_execve 11
#define __NR_chdir 12
#define __NR_time 13
#define __NR_mknod 14
#define __NR_chmod 15
#define __NR_chown 16
#define __NR_break 17
#define __NR_oldstat 18
#define __NR_lseek 19
#define __NR_getpid 20
#define __NR_mount 21
#define __NR_umount 22
#define __NR_setuid 23
#define __NR_getuid 24
#define __NR_stime 25
#define __NR_ptrace 26
#define __NR_alarm 27
#define __NR_oldfstat 28
#define __NR_pause 29
#define __NR_utime 30
#define __NR_stty 31
#define __NR_gtty 32
#define __NR_access 33
#define __NR_nice 34
#define __NR_ftime 35
#define __NR_sync 36
#define __NR_kill 37
#define __NR_rename 38
#define __NR_mkdir 39
#define __NR_rmdir 40
#define __NR_dup 41
#define __NR_pipe 42
#define __NR_times 43
#define __NR_prof 44
#define __NR_brk 45
#define __NR_setgid 46
#define __NR_getgid 47
#define __NR_signal 48
#define __NR_geteuid 49
#define __NR_getegid 50
#define __NR_acct 51
#define __NR_phys 52
#define __NR_lock 53
#define __NR_ioctl 54
#define __NR_fcntl 55
#define __NR_mpx 56
#define __NR_setpgid 57
#define __NR_ulimit 58
#define __NR_oldolduname 59
#define __NR_umask 60
#define __NR_chroot 61
#define __NR_ustat 62
#define __NR_dup2 63
#define __NR_getppid 64
#define __NR_getpgrp 65
#define __NR_setsid 66
#define __NR_sigaction 67
#define __NR_sgetmask 68
#define __NR_ssetmask 69
#define __NR_setreuid 70
#define __NR_setregid 71
#define __NR_sigsuspend 72
#define __NR_sigpending 73
#define __NR_sethostname 74
#define __NR_setrlimit 75
#define __NR_getrlimit 76
#define __NR_getrusage 77
#define __NR_gettimeofday 78
#define __NR_settimeofday 79
#define __NR_getgroups 80
#define __NR_setgroups 81
#define __NR_select 82
#define __NR_symlink 83
#define __NR_oldlstat 84
#define __NR_readlink 85
#define __NR_uselib 86
#define __NR_swapon 87
#define __NR_reboot 88
#define __NR_readdir 89
#define __NR_mmap 90
#define __NR_munmap 91
#define __NR_truncate 92
#define __NR_ftruncate 93
#define __NR_fchmod 94
#define __NR_fchown 95
#define __NR_getpriority 96
#define __NR_setpriority 97
#define __NR_profil 98
#define __NR_statfs 99
#define __NR_fstatfs 100
#define __NR_ioperm 101
#define __NR_socketcall 102
#define __NR_syslog 103
#define __NR_setitimer 104
#define __NR_getitimer 105
#define __NR_stat 106
#define __NR_lstat 107
#define __NR_fstat 108
#define __NR_olduname 109
#define __NR_iopl 110
#define __NR_vhangup 111
#define __NR_idle 112
#define __NR_vm86 113
#define __NR_wait4 114
#define __NR_swapoff 115
#define __NR_sysinfo 116
#define __NR_ipc 117
#define __NR_fsync 118
#define __NR_sigreturn 119
#define __NR_clone 120
#define __NR_setdomainname 121
#define __NR_uname 122
#define __NR_modify_ldt 123
#define __NR_adjtimex 124
#define __NR_mprotect 125
#define __NR_sigprocmask 126
#define __NR_create_module 127
#define __NR_init_module 128
#define __NR_delete_module 129
#define __NR_get_kernel_syms 130
#define __NR_quotactl 131
#define __NR_getpgid 132
#define __NR_fchdir 133
#define __NR_bdflush 134
#define __NR_sysfs 135
#define __NR_personality 136
#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
#define __NR_setfsuid 138
#define __NR_setfsgid 139
#define __NR__llseek 140
#define __NR_getdents 141
#define __NR__newselect 142
#define __NR_flock 143
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
#define _syscall0(type,name) \
type name(void) \
......
......@@ -275,7 +275,7 @@ extern inline long find_in_swap_cache (unsigned long addr)
#ifdef SWAP_CACHE_INFO
swap_cache_find_total++;
#endif
entry = (unsigned long) xchg_ptr(swap_cache + MAP_NR(addr), NULL);
entry = xchg(swap_cache + MAP_NR(addr), 0);
#ifdef SWAP_CACHE_INFO
if (entry)
swap_cache_find_success++;
......@@ -290,7 +290,7 @@ extern inline int delete_from_swap_cache(unsigned long addr)
#ifdef SWAP_CACHE_INFO
swap_cache_del_total++;
#endif
entry= (unsigned long) xchg_ptr(swap_cache + MAP_NR(addr), NULL);
entry= xchg(swap_cache + MAP_NR(addr), 0);
if (entry) {
#ifdef SWAP_CACHE_INFO
swap_cache_del_success++;
......
......@@ -31,7 +31,11 @@
/* for future expansion when we will have different priorities. */
#define DEV_NUMBUFFS 3
#define MAX_ADDR_LEN 7
#define MAX_HEADER 38
#ifndef CONFIG_AX25
#define MAX_HEADER 32 /* We really need about 18 worst case .. so 32 is aligned */
#else
#define MAX_HEADER 96 /* AX.25 + NetROM */
#endif
#define IS_MYADDR 1 /* address is (one of) our own */
#define IS_LOOPBACK 2 /* address is for LOOPBACK */
......@@ -73,12 +77,12 @@ struct device
unsigned long mem_end; /* sahared mem end */
unsigned long mem_start; /* shared mem start */
unsigned long base_addr; /* device I/O address */
unsigned long tbusy; /* transmitter busy must be long for bitops */
unsigned char irq; /* device IRQ number */
/* Low-level status flags. */
volatile unsigned char start, /* start an operation */
interrupt; /* interrupt arrived */
unsigned long tbusy; /* transmitter busy must be long for bitops */
struct device *next;
......
......@@ -5,6 +5,7 @@
struct nfs_server {
struct file *file;
struct sockaddr toaddr ; /* Added for change to NFS code to use sendto() 1995-06-02 JSP */
int lock;
struct wait_queue *wait;
int flags;
......
/* $Id: scc.h,v 1.9 1995/01/12 18:24:40 JReuter Exp JReuter $ */
#ifndef _SCC_H
#define _SCC_H
......@@ -15,9 +14,9 @@
/* Constants */
#define MAXSCC 4 /* number of max. supported chips */
#define MAX_IBUFS 200 /* change this if you run out of memory */
#define BUFSIZE 128 /* must not exceed 4096 */
#define TPS 25 /* scc_timer(): Ticks Per Second */
#define MAX_IBUFS 300 /* change this if you run out of memory */
#define BUFSIZE 64 /* must not exceed 4096 */
#define TPS 25 /* scc_timer(): 25 Ticks Per Second */
#define SCC_TIMER 3
......@@ -134,15 +133,13 @@ typedef unsigned short ioaddr; /* old def */
/* Basic message buffer structure */
/* looks familiar? Hmm, yes... */
struct mbuf {
struct mbuf *next; /* Links mbufs belonging to single packets */
struct mbuf *anext; /* Links packets on queues */
char type; /* who allocated this buffer? */
int time_out; /* unimplemented yet */
unsigned long time_out;/* buffer time out */
int size; /* Size of associated data buffer */
int refcnt; /* Reference count */
struct mbuf *dup; /* Pointer to duplicated mbuf */
......@@ -240,16 +237,19 @@ struct scc_channel {
struct scc_stat stat; /* statistical information */
struct scc_modem modem; /* modem information */
struct mbuf *rbp; /* rx: Head of mbuf chain being filled */
struct mbuf *rbp1; /* rx: Pointer to mbuf currently being written */
struct mbuf *rcvq; /* Pointer to mbuf packets currently received */
char rxbuf[2048]; /* Rx frame buffer max framesize * 2 */
int rxbufcnt; /* Rx frame counter */
struct mbuf *sndq; /* tx: Packets awaiting transmission */
struct mbuf *tbp; /* tx: Transmit mbuf being sent */
struct mbuf *sndq1; /* Pointer to mbuf currently under construction */
struct mbuf *sndq2; /* Pointer to mbuf currently under construction */
/* unsigned char *xmit_buf;
int xmit_head;
int xmit_tail;
int xmit_cnt;*/
/* Timer */
......
......@@ -61,6 +61,7 @@ extern int nr_running, nr_tasks;
#include <linux/vm86.h>
#include <linux/math_emu.h>
#include <linux/ptrace.h>
#include <linux/timer.h>
#include <asm/processor.h>
......@@ -174,6 +175,7 @@ struct task_struct {
unsigned long timeout;
unsigned long it_real_value, it_prof_value, it_virt_value;
unsigned long it_real_incr, it_prof_incr, it_virt_incr;
struct timer_list real_timer;
long utime, stime, cutime, cstime, start_time;
struct rlimit rlim[RLIM_NLIMITS];
unsigned short used_math;
......@@ -237,7 +239,9 @@ struct task_struct {
/* suppl grps*/ {NOGROUP,}, \
/* proc links*/ &init_task,&init_task,NULL,NULL,NULL,NULL, \
/* uid etc */ 0,0,0,0,0,0,0,0, \
/* timeout */ 0,0,0,0,0,0,0,0,0,0,0,0, \
/* timeout */ 0,0,0,0,0,0,0, \
/* timer */ { NULL, NULL, 0, 0, it_real_fn }, \
/* utime */ 0,0,0,0,0, \
/* rlimits */ { {LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX}, \
{LONG_MAX, LONG_MAX}, {_STK_LIM, _STK_LIM}, \
{ 0, LONG_MAX}, {LONG_MAX, LONG_MAX}, \
......@@ -271,6 +275,7 @@ extern void sleep_on(struct wait_queue ** p);
extern void interruptible_sleep_on(struct wait_queue ** p);
extern void wake_up(struct wait_queue ** p);
extern void wake_up_interruptible(struct wait_queue ** p);
extern void wake_up_process(struct task_struct * tsk);
extern void notify_parent(struct task_struct * tsk);
extern int send_sig(unsigned long sig,struct task_struct * p,int priv);
......
/*
/* -- sjcd.h
*
* Definitions for a Sanyo CD-ROM interface
*
* Copyright (C) 1995 Vadim V. Model
......@@ -22,6 +23,11 @@
*/
#define SJCD_INTR_NR 10
/*
* Change this to set the dma channel.
*/
#define SJCD_DMA 0
/*
* port access macros
*/
......
......@@ -87,6 +87,8 @@ struct timer_list {
extern void add_timer(struct timer_list * timer);
extern int del_timer(struct timer_list * timer);
extern void it_real_fn(unsigned long);
extern inline void init_timer(struct timer_list * timer)
{
timer->next = NULL;
......
......@@ -143,7 +143,7 @@ _INLINE_ void run_task_queue(task_queue *list)
void (*f) (void *);
while(1) {
p = xchg_ptr(list,&tq_last);
p = xchg(list,&tq_last);
if(p == &tq_last)
break;
......
......@@ -28,9 +28,9 @@
#include <linux/if_tr.h>
#ifdef __KERNEL__
extern int tr_header(struct sk_buff *skb, struct device *dev,
extern int tr_header(unsigned char *buff, struct device *dev,
unsigned short type, void *daddr,
void *saddr, unsigned len);
void *saddr, unsigned len, struct sk_buff *skb);
extern int tr_rebuild_header(void *buff, struct device *dev,
unsigned long raddr, struct sk_buff *skb);
extern unsigned short tr_type_trans(struct sk_buff *skb, struct device *dev);
......
#ifndef _LINUX_UNISTD_H_
#define _LINUX_UNISTD_H_
/*
* This file contains the system call numbers.
*/
#define __NR_setup 0 /* used only by init, to get system going */
#define __NR_exit 1
#define __NR_fork 2
#define __NR_read 3
#define __NR_write 4
#define __NR_open 5
#define __NR_close 6
#define __NR_waitpid 7
#define __NR_creat 8
#define __NR_link 9
#define __NR_unlink 10
#define __NR_execve 11
#define __NR_chdir 12
#define __NR_time 13
#define __NR_mknod 14
#define __NR_chmod 15
#define __NR_chown 16
#define __NR_break 17
#define __NR_oldstat 18
#define __NR_lseek 19
#define __NR_getpid 20
#define __NR_mount 21
#define __NR_umount 22
#define __NR_setuid 23
#define __NR_getuid 24
#define __NR_stime 25
#define __NR_ptrace 26
#define __NR_alarm 27
#define __NR_oldfstat 28
#define __NR_pause 29
#define __NR_utime 30
#define __NR_stty 31
#define __NR_gtty 32
#define __NR_access 33
#define __NR_nice 34
#define __NR_ftime 35
#define __NR_sync 36
#define __NR_kill 37
#define __NR_rename 38
#define __NR_mkdir 39
#define __NR_rmdir 40
#define __NR_dup 41
#define __NR_pipe 42
#define __NR_times 43
#define __NR_prof 44
#define __NR_brk 45
#define __NR_setgid 46
#define __NR_getgid 47
#define __NR_signal 48
#define __NR_geteuid 49
#define __NR_getegid 50
#define __NR_acct 51
#define __NR_phys 52
#define __NR_lock 53
#define __NR_ioctl 54
#define __NR_fcntl 55
#define __NR_mpx 56
#define __NR_setpgid 57
#define __NR_ulimit 58
#define __NR_oldolduname 59
#define __NR_umask 60
#define __NR_chroot 61
#define __NR_ustat 62
#define __NR_dup2 63
#define __NR_getppid 64
#define __NR_getpgrp 65
#define __NR_setsid 66
#define __NR_sigaction 67
#define __NR_sgetmask 68
#define __NR_ssetmask 69
#define __NR_setreuid 70
#define __NR_setregid 71
#define __NR_sigsuspend 72
#define __NR_sigpending 73
#define __NR_sethostname 74
#define __NR_setrlimit 75
#define __NR_getrlimit 76
#define __NR_getrusage 77
#define __NR_gettimeofday 78
#define __NR_settimeofday 79
#define __NR_getgroups 80
#define __NR_setgroups 81
#define __NR_select 82
#define __NR_symlink 83
#define __NR_oldlstat 84
#define __NR_readlink 85
#define __NR_uselib 86
#define __NR_swapon 87
#define __NR_reboot 88
#define __NR_readdir 89
#define __NR_mmap 90
#define __NR_munmap 91
#define __NR_truncate 92
#define __NR_ftruncate 93
#define __NR_fchmod 94
#define __NR_fchown 95
#define __NR_getpriority 96
#define __NR_setpriority 97
#define __NR_profil 98
#define __NR_statfs 99
#define __NR_fstatfs 100
#define __NR_ioperm 101
#define __NR_socketcall 102
#define __NR_syslog 103
#define __NR_setitimer 104
#define __NR_getitimer 105
#define __NR_stat 106
#define __NR_lstat 107
#define __NR_fstat 108
#define __NR_olduname 109
#define __NR_iopl 110
#define __NR_vhangup 111
#define __NR_idle 112
#define __NR_vm86 113
#define __NR_wait4 114
#define __NR_swapoff 115
#define __NR_sysinfo 116
#define __NR_ipc 117
#define __NR_fsync 118
#define __NR_sigreturn 119
#define __NR_clone 120
#define __NR_setdomainname 121
#define __NR_uname 122
#define __NR_modify_ldt 123
#define __NR_adjtimex 124
#define __NR_mprotect 125
#define __NR_sigprocmask 126
#define __NR_create_module 127
#define __NR_init_module 128
#define __NR_delete_module 129
#define __NR_get_kernel_syms 130
#define __NR_quotactl 131
#define __NR_getpgid 132
#define __NR_fchdir 133
#define __NR_bdflush 134
#define __NR_sysfs 135
#define __NR_personality 136
#define __NR_afs_syscall 137 /* Syscall for Andrew File System */
#define __NR_setfsuid 138
#define __NR_setfsgid 139
#define __NR__llseek 140
#define __NR_getdents 141
#define __NR__newselect 142
#define __NR_flock 143
extern int errno;
/*
......
......@@ -74,7 +74,7 @@ int request_dma(unsigned int dmanr, char * device_id)
if (dmanr >= MAX_DMA_CHANNELS)
return -EINVAL;
if (xchg_u32(&dma_chan_busy[dmanr].lock, 1) != 0)
if (xchg(&dma_chan_busy[dmanr].lock, 1) != 0)
return -EBUSY;
dma_chan_busy[dmanr].device_id = device_id;
......@@ -91,7 +91,7 @@ void free_dma(unsigned int dmanr)
return;
}
if (xchg_u32(&dma_chan_busy[dmanr].lock, 0) == 0) {
if (xchg(&dma_chan_busy[dmanr].lock, 0) == 0) {
printk("Trying to free free DMA%d\n", dmanr);
return;
}
......
......@@ -27,18 +27,18 @@ static int generate(unsigned long sig, struct task_struct * p)
struct sigaction * sa = sig + p->sigaction - 1;
/* always generate signals for traced processes ??? */
if (p->flags & PF_PTRACED) {
p->signal |= mask;
return 1;
if (!(p->flags & PF_PTRACED)) {
/* don't bother with ignored signals (but SIGCHLD is special) */
if (sa->sa_handler == SIG_IGN && sig != SIGCHLD)
return 0;
/* some signals are ignored by default.. (but SIGCONT already did its deed) */
if ((sa->sa_handler == SIG_DFL) &&
(sig == SIGCONT || sig == SIGCHLD || sig == SIGWINCH))
return 0;
}
/* don't bother with ignored signals (but SIGCHLD is special) */
if (sa->sa_handler == SIG_IGN && sig != SIGCHLD)
return 0;
/* some signals are ignored by default.. (but SIGCONT already did its deed) */
if ((sa->sa_handler == SIG_DFL) &&
(sig == SIGCONT || sig == SIGCHLD || sig == SIGWINCH))
return 0;
p->signal |= mask;
if (p->state == TASK_INTERRUPTIBLE && (p->signal & ~p->blocked))
wake_up_process(p);
return 1;
}
......@@ -58,7 +58,7 @@ int send_sig(unsigned long sig,struct task_struct * p,int priv)
return 0;
if ((sig == SIGKILL) || (sig == SIGCONT)) {
if (p->state == TASK_STOPPED)
p->state = TASK_RUNNING;
wake_up_process(p);
p->exit_code = 0;
p->signal &= ~( (1<<(SIGSTOP-1)) | (1<<(SIGTSTP-1)) |
(1<<(SIGTTIN-1)) | (1<<(SIGTTOU-1)) );
......@@ -382,6 +382,7 @@ NORET_TYPE void do_exit(long code)
}
fake_volatile:
current->flags |= PF_EXITING;
del_timer(&current->real_timer);
sem_exit();
exit_mmap(current);
free_page_tables(current);
......
......@@ -197,6 +197,8 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
p->signal = 0;
p->it_real_value = p->it_virt_value = p->it_prof_value = 0;
p->it_real_incr = p->it_virt_incr = p->it_prof_incr = 0;
init_timer(&p->real_timer);
p->real_timer.data = (unsigned long) p;
p->leader = 0; /* process leadership doesn't inherit */
p->tty_old_pgrp = 0;
p->utime = p->stime = 0;
......@@ -219,7 +221,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
p->mm->swappable = 1;
p->exit_signal = clone_flags & CSIGNAL;
p->counter = current->counter >> 1;
p->state = TASK_RUNNING; /* do this last, just in case */
wake_up_process(p); /* do this last, just in case */
return p->pid;
bad_fork_cleanup:
task[nr] = NULL;
......
......@@ -71,6 +71,17 @@ asmlinkage int sys_getitimer(int which, struct itimerval *value)
return 0;
}
void it_real_fn(unsigned long __data)
{
struct task_struct * p = (struct task_struct *) __data;
send_sig(SIGALRM, p, 1);
if (p->it_real_incr) {
p->real_timer.expires = p->it_real_incr;
add_timer(&p->real_timer);
}
}
int _setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
{
register unsigned long i, j;
......@@ -82,10 +93,10 @@ int _setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
return k;
switch (which) {
case ITIMER_REAL:
del_timer(&current->real_timer);
if (j) {
j += 1+itimer_ticks;
if (j < itimer_next)
itimer_next = j;
current->real_timer.expires = j;
add_timer(&current->real_timer);
}
current->it_real_value = j;
current->it_real_incr = i;
......
......@@ -151,6 +151,7 @@ struct symbol_table symbol_table = {
X(kfree_s),
X(vmalloc),
X(vfree),
X(mem_map),
/* filesystem internal functions */
X(getname),
......@@ -243,6 +244,7 @@ struct symbol_table symbol_table = {
X(tq_last),
X(timer_active),
X(timer_table),
X(intr_count),
/* dma handling */
X(request_dma),
......@@ -310,6 +312,7 @@ struct symbol_table symbol_table = {
X(slhc_remember),
X(slhc_compress),
X(slhc_uncompress),
X(slhc_toss),
#endif
#endif
/* Device callback registration */
......@@ -384,8 +387,6 @@ struct symbol_table symbol_table = {
X(generic_proc_info),
X(scsi_devices),
X(free_pages),
X(intr_count),
X(mem_map),
X(print_msg),
X(print_status),
X(gendisk_head), /* Needed for sd.c */
......@@ -395,8 +396,6 @@ struct symbol_table symbol_table = {
* With no scsi configured, we still need to export a few
* symbols so that scsi can be loaded later via insmod.
*/
X(intr_count),
X(mem_map),
X(gendisk_head),
X(resetup_one_dev),
......
......@@ -92,8 +92,27 @@ struct task_struct * task[NR_TASKS] = {&init_task, };
struct kernel_stat kstat = { 0 };
unsigned long itimer_ticks = 0;
unsigned long itimer_next = ~0;
/*
* Wake up a process. Put it on the run-queue if it's not
* already there. The "current" process is always on the
* run-queue, and as such you're allowed to do the simpler
* "current->state = TASK_RUNNING" to mark yourself runnable
* without the overhead of this.
*
* (actually, the run-queue isn't implemented yet, so this
* function is mostly a dummy one)
*/
inline void wake_up_process(struct task_struct * p)
{
long oldstate;
oldstate = xchg(&p->state, TASK_RUNNING);
/* already on run-queue? */
if (oldstate == TASK_RUNNING || p == current)
return;
if (p->counter > current->counter + 3)
need_resched = 1;
}
/*
* 'schedule()' is the scheduler function. It's a very simple and nice
......@@ -103,16 +122,12 @@ unsigned long itimer_next = ~0;
* NOTE!! Task 0 is the 'idle' task, which gets called when no other
* tasks can run. It can not be killed, and it cannot sleep. The 'state'
* information in task[0] is never used.
*
* The "confuse_gcc" goto is used only to get better assembly code..
* Dijkstra probably hates me.
*/
asmlinkage void schedule(void)
{
int c;
struct task_struct * p;
struct task_struct * next;
unsigned long ticks;
/* check alarm, wake up any interruptible tasks that have got a signal */
......@@ -121,69 +136,35 @@ asmlinkage void schedule(void)
intr_count = 0;
}
run_task_queue(&tq_scheduler);
cli();
ticks = itimer_ticks;
itimer_ticks = 0;
itimer_next = ~0;
sti();
if (current->state == TASK_INTERRUPTIBLE) {
if (current->signal & ~current->blocked)
current->state = TASK_RUNNING;
}
need_resched = 0;
nr_running = 0;
p = &init_task;
for (;;) {
if ((p = p->next_task) == &init_task)
goto confuse_gcc1;
if (ticks && p->it_real_value) {
if (p->it_real_value <= ticks) {
send_sig(SIGALRM, p, 1);
if (!p->it_real_incr) {
p->it_real_value = 0;
goto end_itimer;
}
do {
p->it_real_value += p->it_real_incr;
} while (p->it_real_value <= ticks);
}
p->it_real_value -= ticks;
if (p->it_real_value < itimer_next)
itimer_next = p->it_real_value;
}
end_itimer:
if (p->state != TASK_INTERRUPTIBLE)
continue;
if (p->signal & ~p->blocked) {
p->state = TASK_RUNNING;
continue;
}
if (p->timeout && p->timeout <= jiffies) {
p->timeout = 0;
p->state = TASK_RUNNING;
}
}
confuse_gcc1:
/* this is the scheduler proper: */
#if 0
/* give processes that go to sleep a bit higher priority.. */
/* This depends on the values for TASK_XXX */
/* This gives smoother scheduling for some things, but */
/* can be very unfair under some circumstances, so.. */
if (TASK_UNINTERRUPTIBLE >= (unsigned) current->state &&
current->counter < current->priority*2) {
++current->counter;
}
#endif
c = -1000;
next = p = &init_task;
for (;;) {
if ((p = p->next_task) == &init_task)
goto confuse_gcc2;
if (p->state == TASK_RUNNING) {
nr_running++;
if (p->counter > c)
c = p->counter, next = p;
next = &init_task;
for_each_task(p) {
switch (p->state) {
case TASK_INTERRUPTIBLE:
if (!p->timeout)
continue;
if (p->timeout > jiffies)
continue;
p->timeout = 0;
p->state = TASK_RUNNING;
/* fall through */
case TASK_RUNNING:
nr_running++;
if (p->counter > c)
c = p->counter, next = p;
}
}
confuse_gcc2:
/* if all runnable processes have "counter == 0", re-calculate counters */
if (!c) {
for_each_task(p)
p->counter = (p->counter >> 1) + p->priority;
......@@ -219,11 +200,8 @@ void wake_up(struct wait_queue **q)
do {
if ((p = tmp->task) != NULL) {
if ((p->state == TASK_UNINTERRUPTIBLE) ||
(p->state == TASK_INTERRUPTIBLE)) {
p->state = TASK_RUNNING;
if (p->counter > current->counter + 3)
need_resched = 1;
}
(p->state == TASK_INTERRUPTIBLE))
wake_up_process(p);
}
if (!tmp->next) {
printk("wait_queue is bad (eip = %p)\n",
......@@ -246,11 +224,8 @@ void wake_up_interruptible(struct wait_queue **q)
return;
do {
if ((p = tmp->task) != NULL) {
if (p->state == TASK_INTERRUPTIBLE) {
p->state = TASK_RUNNING;
if (p->counter > current->counter + 3)
need_resched = 1;
}
if (p->state == TASK_INTERRUPTIBLE)
wake_up_process(p);
}
if (!tmp->next) {
printk("wait_queue is bad (eip = %p)\n",
......@@ -665,9 +640,6 @@ static void do_timer(int irq, struct pt_regs * regs)
mark_bh(TIMER_BH);
}
cli();
itimer_ticks++;
if (itimer_ticks > itimer_next)
need_resched = 1;
if (timer_head.next->expires < jiffies)
mark_bh(TIMER_BH);
if (tq_timer != &tq_last)
......
......@@ -82,7 +82,7 @@ static int add_to_swap_cache(unsigned long addr, unsigned long entry)
swap_cache_add_total++;
#endif
if ((p->flags & SWP_WRITEOK) == SWP_WRITEOK) {
entry = (unsigned long) xchg_ptr(swap_cache + MAP_NR(addr), (void *) entry);
entry = xchg(swap_cache + MAP_NR(addr), entry);
if (entry) {
printk("swap_cache: replacing non-NULL entry\n");
}
......
......@@ -178,7 +178,6 @@ static void aarp_send_reply(struct device *dev, struct at_addr *us, struct at_ad
eah = (struct elapaarp *)skb_put(skb,sizeof(struct elapaarp));
skb->arp = 1;
skb->free = 1;
skb_put(skb,len);
skb->dev = dev;
/*
......@@ -243,7 +242,6 @@ void aarp_send_probe(struct device *dev, struct at_addr *us)
skb->arp = 1;
skb->free = 1;
skb_put(skb,len);
skb->dev = dev;
/*
......
......@@ -26,6 +26,7 @@
* Alan Cox : ARP only when compiled with CONFIG_INET
* Greg Page : 802.2 and SNAP stuff.
* Alan Cox : MAC layer pointers/new format.
* Paul Gortmaker : eth_copy_and_sum shouldn't csum padding.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -231,11 +232,13 @@ void eth_header_cache(struct device *dev, struct sock *sk, unsigned long saddr,
/*
* Copy from an ethernet device memory space to an sk_buff while checksumming if IP
* The magic "34" is Rx_addr+Tx_addr+type_field+sizeof(struct iphdr) == 6+6+2+20.
*/
void eth_copy_and_sum(struct sk_buff *dest, unsigned char *src, int length, int base)
{
struct ethhdr *eth;
struct iphdr *iph;
IS_SKB(dest);
eth=(struct ethhdr *)dest->data;
......@@ -246,6 +249,14 @@ void eth_copy_and_sum(struct sk_buff *dest, unsigned char *src, int length, int
memcpy(dest->data+34,src+34,length);
return;
}
/*
* We have to watch for padded packets. The csum doesn't include the
* padding, and there is no point in copying the padding anyway.
*/
iph=(struct iphdr*)(src+14); /* 14 = Rx_addr+Tx_addr+type_field */
if (ntohs(iph->tot_len)-sizeof(struct iphdr) <= length)
length=ntohs(iph->tot_len)-sizeof(struct iphdr);
dest->csum=csum_partial_copy(src+34,dest->data+34,length,base);
dest->ip_summed=1;
}
......@@ -733,7 +733,7 @@ void ip_fw_masquerade(struct sk_buff **skb_ptr, struct device *dev)
if (portptr[1]==htons(21))
{
skb = revamp(*skb_ptr, dev, ms);
skb = *skb_ptr;
*skb_ptr = skb;
iph = skb->h.iph;
portptr = (unsigned short *)&(((char *)iph)[iph->ihl*4]);
}
......
......@@ -145,6 +145,11 @@
* sk->retransmits misupdating fixed.
* Fixed tcp_write_timeout: stuck close,
* and TCP syn retries gets used now.
* Mark Yarvis : In tcp_read_wakeup(), don't send an
* ack if stat is TCP_CLOSED.
* Alan Cox : Look up device on a retransmit - routes may
* change. Doesn't yet cope with MSS shrink right
* but its a start!
*
*
* To Fix:
......@@ -439,6 +444,7 @@ void tcp_do_retransmit(struct sock *sk, int all)
struct proto *prot;
struct device *dev;
int ct=0;
struct rtable *rt;
prot = sk->prot;
skb = sk->send_head;
......@@ -453,6 +459,12 @@ void tcp_do_retransmit(struct sock *sk, int all)
IS_SKB(skb);
skb->when = jiffies;
/*
* Discard the surplus MAC header
*/
skb_pull(skb,((unsigned char *)skb->ip_hdr)-skb->data);
/*
* In general it's OK just to use the old packet. However we
* need to use the current ack and window fields. Urg and
......@@ -462,60 +474,89 @@ void tcp_do_retransmit(struct sock *sk, int all)
* changing the packet, we have to issue a new IP identifier.
*/
iph = (struct iphdr *)(skb->data + dev->hard_header_len);
iph = (struct iphdr *)skb->data;
th = (struct tcphdr *)(((char *)iph) + (iph->ihl << 2));
size = skb->len - (((unsigned char *) th) - skb->data);
size = ntohs(iph->tot_len) - (iph->ihl<<2);
/*
* Note: We ought to check for window limits here but
* currently this is done (less efficiently) elsewhere.
* We do need to check for a route change but can't handle
* that until we have the new 1.3.x buffers in.
*
*/
iph->id = htons(ip_id_count++);
ip_send_check(iph);
/*
* This is not the right way to handle this. We have to
* issue an up to date window and ack report with this
* retransmit to keep the odd buggy tcp that relies on
* the fact BSD does this happy.
* We don't however need to recalculate the entire
* checksum, so someone wanting a small problem to play
* with might like to implement RFC1141/RFC1624 and speed
* this up by avoiding a full checksum.
*/
th->ack_seq = ntohl(sk->acked_seq);
th->window = ntohs(tcp_select_window(sk));
tcp_send_check(th, sk->saddr, sk->daddr, size, sk);
/*
* If the interface is (still) up and running, kick it.
* Put a MAC header back on (may cause ARPing)
*/
if (dev->flags & IFF_UP)
if(skb->localroute)
rt=ip_rt_local(iph->daddr,NULL,NULL);
else
rt=ip_rt_route(iph->daddr,NULL,NULL);
if(rt==NULL) /* Deep poo */
{
if(skb->sk)
{
skb->sk->err=ENETUNREACH;
skb->sk->error_report(skb->sk);
}
}
else
{
dev=rt->rt_dev;
skb->raddr=rt->rt_gateway;
if(skb->raddr==0)
skb->raddr=iph->daddr;
skb->dev=dev;
skb->arp=1;
if(dev->hard_header)
{
if(dev->hard_header(skb, dev, ETH_P_IP, NULL, NULL, skb->len)<0)
skb->arp=0;
}
/*
* This is not the right way to handle this. We have to
* issue an up to date window and ack report with this
* retransmit to keep the odd buggy tcp that relies on
* the fact BSD does this happy.
* We don't however need to recalculate the entire
* checksum, so someone wanting a small problem to play
* with might like to implement RFC1141/RFC1624 and speed
* this up by avoiding a full checksum.
*/
th->ack_seq = ntohl(sk->acked_seq);
th->window = ntohs(tcp_select_window(sk));
tcp_send_check(th, sk->saddr, sk->daddr, size, sk);
/*
* If the packet is still being sent by the device/protocol
* below then don't retransmit. This is both needed, and good -
* especially with connected mode AX.25 where it stops resends
* occurring of an as yet unsent anyway frame!
* We still add up the counts as the round trip time wants
* adjusting.
* If the interface is (still) up and running, kick it.
*/
if (sk && !skb_device_locked(skb))
if (dev->flags & IFF_UP)
{
/* Remove it from any existing driver queue first! */
skb_unlink(skb);
/* Now queue it */
ip_statistics.IpOutRequests++;
dev_queue_xmit(skb, dev, sk->priority);
/*
* If the packet is still being sent by the device/protocol
* below then don't retransmit. This is both needed, and good -
* especially with connected mode AX.25 where it stops resends
* occurring of an as yet unsent anyway frame!
* We still add up the counts as the round trip time wants
* adjusting.
*/
if (sk && !skb_device_locked(skb))
{
/* Remove it from any existing driver queue first! */
skb_unlink(skb);
/* Now queue it */
ip_statistics.IpOutRequests++;
dev_queue_xmit(skb, dev, sk->priority);
}
}
}
/*
* Count retransmissions
*/
......@@ -1771,6 +1812,13 @@ static void tcp_read_wakeup(struct sock *sk)
if (!sk->ack_backlog)
return;
/*
* If we're closed, don't send an ack, or we'll get a RST
* from the closed destination.
*/
if ((sk->state == TCP_CLOSE) || (sk->state == TCP_TIME_WAIT))
return;
/*
* FIXME: we need to put code here to prevent this routine from
* being called. Being called once in a while is ok, so only check
......@@ -3034,8 +3082,7 @@ static void tcp_write_xmit(struct sock *sk)
* Ack and window will in general have changed since this packet was put
* on the write queue.
*/
iph = (struct iphdr *)(skb->data +
skb->dev->hard_header_len);
iph = skb->ip_hdr;
th = (struct tcphdr *)(((char *)iph) +(iph->ihl << 2));
size = skb->len - (((unsigned char *) th) - skb->data);
......
......@@ -45,8 +45,7 @@
* Arnt Gulbrandsen : New udp_send and stuff
* Alan Cox : Cache last socket
* Alan Cox : Route cache
* Alan Cox : Checksum precompute is bogus is some lame
* software is padding its udp frames in IP!
* Jon Peatfield : Minor efficientcy fix to sendto().
*
*
* This program is free software; you can redistribute it and/or
......@@ -301,10 +300,9 @@ static int udp_sendto(struct sock *sk, unsigned char *from, int len, int noblock
{
if (addr_len < sizeof(sin))
return(-EINVAL);
memcpy(&sin,usin,sizeof(sin));
if (sin.sin_family && sin.sin_family != AF_INET)
if (usin->sin_family && usin->sin_family != AF_INET)
return(-EINVAL);
if (sin.sin_port == 0)
if (usin->sin_port == 0)
return(-EINVAL);
}
else
......@@ -314,6 +312,7 @@ static int udp_sendto(struct sock *sk, unsigned char *from, int len, int noblock
sin.sin_family = AF_INET;
sin.sin_port = sk->dummy_th.dest;
sin.sin_addr.s_addr = sk->daddr;
usin = &sin;
}
/*
......@@ -321,16 +320,16 @@ static int udp_sendto(struct sock *sk, unsigned char *from, int len, int noblock
* broadcasting of data.
*/
if(sin.sin_addr.s_addr==INADDR_ANY)
sin.sin_addr.s_addr=ip_my_addr();
if(usin->sin_addr.s_addr==INADDR_ANY)
usin->sin_addr.s_addr=ip_my_addr();
if(!sk->broadcast && ip_chk_addr(sin.sin_addr.s_addr)==IS_BROADCAST)
if(!sk->broadcast && ip_chk_addr(usin->sin_addr.s_addr)==IS_BROADCAST)
return -EACCES; /* Must turn broadcast on first */
sk->inuse = 1;
/* Send the packet. */
tmp = udp_send(sk, &sin, from, len, flags);
tmp = udp_send(sk, usin, from, len, flags);
/* The datagram has been sent off. Release the socket. */
release_sock(sk);
......@@ -538,9 +537,6 @@ int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
ulen = ntohs(uh->len);
if(ulen!=len)
skb->ip_summed=0; /* Bogoid padded frame */
if (ulen > len || len < sizeof(*uh) || ulen < sizeof(*uh))
{
NETDEBUG(printk("UDP: short packet: %d/%d\n", ulen, len));
......
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