Commit 66a2c418 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.72

parent 9c1069bc
......@@ -710,9 +710,8 @@ E: jon@gtex02.us.es
D: NFS mmap()
D: XF86_S3
D: Kernel modules
S: C/ Teodosio 43
S: Portal 6 1-A
S: Sevilla 41002
S: C/ Carlos de Cepeda 36 2-5
S: Sevilla 41005
S: Spain
N: Linus Torvalds
......
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 71
SUBLEVEL = 72
ARCH = i386
......@@ -102,7 +102,7 @@ endif
$(CC) $(CFLAGS) -c -o $*.o $<
Version: dummy
rm -f tools/version.h
rm -f include/linux/version.h
boot:
ln -sf arch/$(ARCH)/boot boot
......@@ -127,25 +127,25 @@ config: symlinks config.in
linuxsubdirs: dummy
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done
tools/./version.h: tools/version.h
$(TOPDIR)/include/linux/version.h: include/linux/version.h
tools/version.h: $(CONFIGURE) Makefile
include/linux/version.h: $(CONFIGURE) Makefile
@./makever.sh
@echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)\" > tools/version.h
@echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)\" > include/linux/version.h
@if [ -f .name ]; then \
echo \#define UTS_VERSION \"\#`cat .version`-`cat .name` `date`\"; \
else \
echo \#define UTS_VERSION \"\#`cat .version` `date`\"; \
fi >> tools/version.h
@echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h
@echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h
@echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> tools/version.h
fi >> include/linux/version.h
@echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> include/linux/version.h
@echo \#define LINUX_COMPILE_BY \"`whoami`\" >> include/linux/version.h
@echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> include/linux/version.h
@if [ -x /bin/dnsdomainname ]; then \
echo \#define LINUX_COMPILE_DOMAIN \"`dnsdomainname`\"; \
else \
echo \#define LINUX_COMPILE_DOMAIN \"`domainname`\"; \
fi >> tools/version.h
@echo \#define LINUX_COMPILER \"`$(HOSTCC) -v 2>&1 | tail -1`\" >> tools/version.h
fi >> include/linux/version.h
@echo \#define LINUX_COMPILER \"`$(HOSTCC) -v 2>&1 | tail -1`\" >> include/linux/version.h
tools/build: tools/build.c $(CONFIGURE)
$(HOSTCC) $(CFLAGS) -o $@ $<
......@@ -155,7 +155,7 @@ boot/head.o: $(CONFIGURE) boot/head.s
boot/head.s: boot/head.S $(CONFIGURE) include/linux/tasks.h
$(CPP) -traditional $< -o $@
tools/version.o: tools/version.c tools/version.h
tools/version.o: tools/version.c include/linux/version.h
init/main.o: $(CONFIGURE) init/main.c
$(CC) $(CFLAGS) $(PROFILING) -c -o $*.o $<
......@@ -191,7 +191,7 @@ clean: archclean
rm -f .tmp* drivers/sound/configure
mrproper: clean
rm -f include/linux/autoconf.h tools/version.h
rm -f include/linux/autoconf.h include/linux/version.h
rm -f drivers/sound/local.h
rm -f .version .config* config.in config.old
rm -f boot include/asm kernel/entry.S
......@@ -204,11 +204,11 @@ backup: mrproper
sync
depend dep:
touch tools/version.h
touch include/linux/version.h
for i in init/*.c;do echo -n "init/";$(CPP) -M $$i;done > .tmpdepend
for i in tools/*.c;do echo -n "tools/";$(CPP) -M $$i;done >> .tmpdepend
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i dep; done
rm -f tools/version.h
rm -f include/linux/version.h
mv .tmpdepend .depend
ifdef CONFIGURATION
......
This diff is collapsed.
/* string.h: Efficient string functions in sparc-assembly for
the linux kernel.
Copyright 1994 (c) David S. Miller (davem@caip.rutgers.edu)
*/
/* If we are smart we will use only the output and global registers
as that will allow us to avoid a window save which would be nice.
*/
/* Believe it or not the following strlen is not optimized enough!
In the future I may play games with doing word reads and reducing
the per-word comparisons to *one*, yes I have seen it done.
*/
.align 4
.globl _strlen
_strlen:
mov %o0, %g3 ! leaf-proceedure optimization, here
ldsb [%g3], %g2 ! I only use the register sent to me
cmp %g2, 0 ! and the globals. Now, this routine
be 1f ! is callable from boot code.
nop
add %o0, 1, %o0
0: ldsb [%o0], %g2
cmp %g2, 0
bne,a 0b ! annuling branch, yuck
add %o0, 1, %o0
1: retl
sub %o0, %g3, %o0 ! since %g3 holds the origional pointer
! and %o0 is at the end byte, we can
! subtract and the result is strlen.
/* String concatenate function. I am too lazy to honor the third count
arguement at this time. Once again, this could be optimized so much
more to use word accesses instead of slooow byte loads.
*/
.align 4
.globl _strcat
_strcat:
mov %o0, %g4
ldsb [%g4], %g3
cmp %g3, 0
be,a 2f
ldub [%o1], %g3
add %o0, 1, %o0
0: ldsb [%o0], %g3
cmp %g3, 0
bne,a 0b
add %o0, 1, %o0
1: ldub [%o1], %g3
2: add %o1, 1, %o1
stb %g3, [%o0]
cmp %g3, 0
bne 1b
add %o0, 1, %o0
retl
mov %g4, %o0
/* Aieee, this code is starting to give me a headache. I shouldn't
have tried to do this in one sitting :-(
*/
.align 4
.globl _strcmp
_strcmp: b 2f
ldsb [%o1], %g4
0: sll %o2, 24, %g3
cmp %g3, 0
bne 1f
add %o0, 1, %o0
b 3f
or %g0, %g0, %o0
1: ldsb [%o1], %g4
2: ldsb [%o0], %g3
add %o1, 1, %o1
cmp %g3, %g4
be 0b
mov %g3, %o2
ldub [%o2], %g3
ldub [%o1-1], %o0 ! oh man, no joke
sub %g2, %o0, %o0
3: retl
nop
/* Ok, strcpy() should be easy enough. Maybe I catch some sleep after
this one....
*/
.align 4
.globl _strcpy
_strcpy: ldub [%o1], %g3
mov %o0, %g4
cmp %g3, 0
be 1f
stb %g3, [%g4]
0: add %o1, 1, %o1
ldub [%o1], %g3
add %o0, 1, %o0
cmp %g3, 0
bne 0b
stb %g3, [%o0]
1: retl
mov %g4, %o0
\ No newline at end of file
......@@ -82,8 +82,7 @@
*/
#define CONFIG_FLOPPY_SANITY
#undef CONFIG_FLOPPY_23
#undef CONFIG_FLOPPY_2_FDC
#define CONFIG_FLOPPY_2_FDC
#undef CONFIG_FLOPPY_SILENT_DCL_CLEAR
#define REALLY_SLOW_IO
......@@ -99,16 +98,12 @@
* motor of these drives causes system hangs on some PCI computers. drive
* 0 is the low bit (0x1), and drive 7 is the high bit (0x80). Bits are on if
* a drive is allowed. */
#ifdef CONFIG_FLOPPY_23
#define ALLOWED_DRIVE_MASK 0xff
#else
#define ALLOWED_DRIVE_MASK 0x33
#endif
static int ALLOWED_DRIVE_MASK=0x33;
#define FLOPPY_IRQ 6
#define FLOPPY_DMA 2
#define FDC1 0x3f0
#define FDC2 0x370
static int FDC2=-1;
#endif
#define MODULE_AWARE_DRIVER
......@@ -236,6 +231,7 @@ static int inr; /* size of reply buffer, when called from interrupt */
#define R_SECTOR (reply_buffer[5])
#define R_SIZECODE (reply_buffer[6])
#define ARRAY_SIZE(x) (sizeof(x) / sizeof( (x)[0] ))
/*
* this struct defines the different floppy drive types.
*/
......@@ -1500,9 +1496,11 @@ void show_floppy(void)
printk("floppy driver state\n");
printk("-------------------\n");
for(i=0; i<N_FDC; i++){
printk("dor %d = %x\n", i, fdc_state[i].dor );
outb_p(fdc_state[i].address+2, fdc_state[i].dor);
udelay(1000); /* maybe we'll catch an interrupt... */
if(FDCS->address != -1){
printk("dor %d = %x\n", i, fdc_state[i].dor );
outb_p(fdc_state[i].address+2, fdc_state[i].dor);
udelay(1000); /* maybe we'll catch an interrupt... */
}
}
printk("status=%x\n", inb_p(FD_STATUS));
printk("fdc_busy=%d\n", fdc_busy);
......@@ -3163,6 +3161,57 @@ static char get_fdc_version(void)
return FDC_82077; /* Revised 82077AA passes all the tests */
} /* get_fdc_version */
#ifndef FD_MODULE
/* lilo configuration */
static void invert_dcl(int *ints)
{
int i;
for (i=0; i < ARRAY_SIZE(default_drive_params); i++)
default_drive_params[i].params.flags |= 0x80;
DPRINT("Configuring drives for inverted dcl\n");
}
static void allow_drives(int *ints)
{
if (ints[1] >= 1 ){
ALLOWED_DRIVE_MASK=ints[1];
DPRINT1("setting allowed_drive_mask to 0x%x\n", ints[1]);
} else
DPRINT("allowed_drive_mask needs a parameter\n");
}
#ifdef CONFIG_FLOPPY_2_FDC
static void twofdc(int *ints)
{
FDC2 = 0x370;
DPRINT("enabling second fdc at address 0x370\n");
}
#endif
static struct param_table {
char *name;
void (*fn)(int *ints);
} config_params[]={
{ "allowed_drive_mask", allow_drives },
#ifdef CONFIG_FLOPPY_2_FDC
{ "two_fdc", twofdc },
#endif
{ "thinkpad", invert_dcl } };
void floppy_setup(char *str, int *ints)
{
int i;
for(i=0; i< ARRAY_SIZE(config_params); i++){
if (strcmp(str,config_params[i].name) == 0 ){
config_params[i].fn(ints);
return;
}
}
printk("unknown floppy paramter %s\n", str);
}
#endif
#ifdef FD_MODULE
static
#endif
......@@ -3230,12 +3279,16 @@ int new_floppy_init(void)
if (FDCS->address == -1 )
continue;
FDCS->rawcmd = 2;
if(user_reset_fdc(-1,FD_RESET_IF_NEEDED,0))
if(user_reset_fdc(-1,FD_RESET_IF_NEEDED,0)){
FDCS->address = -1;
continue;
}
/* Try to determine the floppy controller type */
FDCS->version = get_fdc_version();
if (FDCS->version == FDC_NONE)
if (FDCS->version == FDC_NONE){
FDCS->address = -1;
continue;
}
have_no_fdc = 0;
/* Not all FDCs seem to be able to handle the version command
......@@ -3272,10 +3325,12 @@ static int floppy_grab_irq_and_dma(void)
#ifdef FD_MODULE
MOD_INC_USE_COUNT;
#endif
for(i=0; i< N_FDC; i++){
fdc = i;
reset_fdc_info(1);
outb_p(FDCS->dor, FD_DOR);
for(i=0; i< N_FDC; i++){
if(FDCS->address != -1){
fdc = i;
reset_fdc_info(1);
outb_p(FDCS->dor, FD_DOR);
}
}
set_dor(0, ~0, 8); /* avoid immediate interrupt */
......
......@@ -34,7 +34,7 @@ struct lp_struct lp_table[] = {
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
/*
......@@ -467,7 +467,7 @@ long lp_init(long kmem_start)
if (testvalue == LP_DUMMY) {
LP_F(offset) |= LP_EXIST;
lp_reset(offset);
printk("lp_init: lp%d exists, ", offset);
printk("lp%d at 0x%04x, ", offset,LP_B(offset));
snarf_region(LP_B(offset), 3);
if (LP_IRQ(offset))
printk("using IRQ%d\n", LP_IRQ(offset));
......@@ -505,7 +505,8 @@ int init_module(void)
if (testvalue == LP_DUMMY) {
LP_F(offset) |= LP_EXIST;
lp_reset(offset);
printk("lp_init: lp%d exists, ", offset);
printk("lp%d at 0x%04x, ", offset,LP_B(offset));
snarf_region(LP_B(offset),3);
if (LP_IRQ(offset))
printk("using IRQ%d\n", LP_IRQ(offset));
else
......@@ -520,10 +521,14 @@ int init_module(void)
void cleanup_module(void)
{
if(MOD_IN_USE)
int offset;
if(MOD_IN_USE)
printk("lp: busy - remove delayed\n");
else
else
unregister_chrdev(LP_MAJOR,"lp");
for (offset = 0; offset < LP_NO; offset++)
if(LP_F(offset) && LP_EXIST)
release_region(LP_B(offset),3);
}
#endif
......@@ -45,7 +45,7 @@ static char *version =
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
extern struct device *init_etherdev(struct device *dev, int sizeof_private,
......
......@@ -44,7 +44,7 @@ static char *version = "3c509.c:1.03 10/8/94 becker@cesdis.gsfc.nasa.gov\n";
#include <linux/skbuff.h>
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
......
......@@ -54,7 +54,7 @@ static char *version =
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
/* These are the operational function interfaces to board-specific
......
......@@ -3,6 +3,7 @@ MODULES = \
de600.o \
de620.o \
3c501.o \
apricot.o \
eexpress.o \
plip.o \
8390.o
......@@ -28,8 +28,6 @@
#include <linux/netdevice.h>
#include <linux/errno.h>
#define LOOPBACK /* always present, right? */
#define NEXT_DEV NULL
......@@ -49,6 +47,7 @@ extern int el3_probe(struct device *);
extern int at1500_probe(struct device *);
extern int at1700_probe(struct device *);
extern int depca_probe(struct device *);
extern int apricot_probe(struct device *);
extern int ewrk3_probe(struct device *);
extern int el1_probe(struct device *);
extern int el16_probe(struct device *);
......@@ -112,6 +111,9 @@ ethif_probe(struct device *dev)
#ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */
&& ewrk3_probe(dev)
#endif
#ifdef CONFIG_APRICOT /* Apricot I82596 */
&& apricot_probe(dev)
#endif
#ifdef CONFIG_EL1 /* 3c501 */
&& el1_probe(dev)
#endif
......@@ -289,9 +291,8 @@ static struct device ppp0_dev = {
# define NEXT_DEV (&dummy_dev)
#endif
#ifdef LOOPBACK
extern int loopback_init(struct device *dev);
static struct device loopback_dev = {
extern int loopback_init(struct device *dev);
struct device loopback_dev = {
"lo", /* Software Loopback interface */
0x0, /* recv memory end */
0x0, /* recv memory start */
......@@ -302,10 +303,6 @@ static struct device ppp0_dev = {
0, 0, 0, /* flags */
NEXT_DEV, /* next device */
loopback_init /* loopback_init should set up the rest */
};
# undef NEXT_DEV
# define NEXT_DEV (&loopback_dev)
#endif
};
struct device *dev_base = NEXT_DEV;
struct device *dev_base = &loopback_dev;
This diff is collapsed.
......@@ -110,7 +110,7 @@ unsigned int de600_debug = DE600_DEBUG;
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
#ifdef FAKE_SMALL_MAX
......
......@@ -121,7 +121,7 @@ static char *version =
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
/* Constant definitions for the DE-620 registers, commands and bits */
......
......@@ -188,7 +188,7 @@ static char *version = "depca.c:v0.38 8/15/94 davies@wanton.lkg.dec.com\n";
#ifdef MODULE
#include <linux/module.h>
#include "/linux/tools/version.h"
#include <linux/version.h>
#endif /* MODULE */
#include "depca.h"
......
......@@ -57,7 +57,7 @@ static char *version =
#include <linux/skbuff.h>
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
#include <linux/malloc.h>
......
......@@ -149,7 +149,7 @@ static char *version = "ewrk3.c:v0.30 11/1/94 davies@wanton.lkg.dec.com\n";
#ifdef MODULE
#include <linux/module.h>
#include "/linux/tools/version.h"
#include <linux/version.h>
#endif /* MODULE */
#include "ewrk3.h"
......
......@@ -67,9 +67,6 @@ unsigned long net_dev_init (unsigned long mem_start, unsigned long mem_end)
#endif
#if defined(CONFIG_PI)
mem_start = pi_init(mem_start, mem_end);
#endif
#if defined(CONFIG_APRICOT)
mem_start = apricot_init(mem_start, mem_end);
#endif
return mem_start;
}
......
......@@ -92,7 +92,7 @@ make one yourself. The wiring is:
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
/* use 0 for production, 1 for verification, >2 for debug */
......
......@@ -548,18 +548,15 @@ static void znet_rx(struct device *dev)
lp->stats.rx_length_errors++;
} else {
/* Malloc up new buffer. */
int sksize = sizeof(struct sk_buff) + pkt_len;
struct sk_buff *skb;
skb = alloc_skb(sksize, GFP_ATOMIC);
skb = alloc_skb(pkt_len, GFP_ATOMIC);
if (skb == NULL) {
if (znet_debug)
printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name);
lp->stats.rx_dropped++;
break;
}
skb->mem_len = sksize;
skb->mem_addr = skb;
skb->len = pkt_len;
skb->dev = dev;
......
......@@ -58,6 +58,7 @@ struct scsi_generic
};
static struct scsi_generic *scsi_generics=NULL;
static void sg_free(char *buff,int size);
static int sg_ioctl(struct inode * inode,struct file * file,
unsigned int cmd_in, unsigned long arg)
......@@ -109,7 +110,7 @@ static int sg_open(struct inode * inode, struct file * filp)
if (!scsi_generics[dev].users && scsi_generics[dev].pending && scsi_generics[dev].complete)
{
if (scsi_generics[dev].buff != NULL)
scsi_free(scsi_generics[dev].buff,scsi_generics[dev].buff_len);
sg_free(scsi_generics[dev].buff,scsi_generics[dev].buff_len);
scsi_generics[dev].buff=NULL;
scsi_generics[dev].pending=0;
}
......
......@@ -29,7 +29,7 @@
#ifndef CONFIG_BINFMT_ELF
#include <linux/module.h>
#include "../tools/version.h"
#include <linux/version.h>
#endif
#include <linux/unistd.h>
......
......@@ -22,7 +22,7 @@
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
#ifdef LEAK_CHECK
......
......@@ -17,7 +17,7 @@
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
#include <asm/segment.h>
......
......@@ -29,6 +29,7 @@
#include <linux/string.h>
#include <linux/mman.h>
#include <linux/proc_fs.h>
#include <linux/ioport.h>
#include <asm/segment.h>
#include <asm/io.h>
......@@ -529,6 +530,8 @@ static int get_root_array(char * page, int type)
case PROC_DMA:
return get_dma_list(page);
case PROC_IOPORTS:
return get_ioport_list(page);
}
return -EBADF;
}
......
......@@ -73,6 +73,7 @@ static struct proc_dir_entry root_dir[] = {
{ PROC_FILESYSTEMS, 11,"filesystems" },
{ PROC_KSYMS, 5, "ksyms" },
{ PROC_DMA, 3, "dma" },
{ PROC_IOPORTS, 7, "ioports"},
};
#define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0])))
......
......@@ -32,7 +32,7 @@
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#else
#define MOD_INC_USE_COUNT
#define MOD_DEC_USE_COUNT
......
......@@ -19,7 +19,7 @@
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#endif
struct inode *pseudo_root=NULL; /* Useful to simulate the pseudo DOS */
......
......@@ -21,7 +21,7 @@
#ifdef MODULE
#include <linux/module.h>
#include "../../tools/version.h"
#include <linux/version.h>
#else
#define MOD_INC_USE_COUNT
#define MOD_DEC_USE_COUNT
......
......@@ -15,7 +15,7 @@
#ifndef _M68K_SYSTEM_H
#define _M68K_SYSTEM_H
#include <linux/autoconf.h> /* get configuration makros */
#include <linux/autoconf.h> /* get configuration macros */
#if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) && !defined(CONFIG_MAC)
/* block out HSYNC on the atari */
......
......@@ -127,6 +127,7 @@ struct floppy_drive_params {
#define FD_BROKEN_DCL 0x20
#define FD_DEBUG 0x02
#define FD_SILENT_DCL_CLEAR 0x4
#define FD_INVERTED_DCL 0x80
char read_track; /* use readtrack during probing? */
......
......@@ -20,6 +20,7 @@ extern void reserve_setup(char *str, int *ints);
extern int check_region(unsigned int from, unsigned int extent);
extern void snarf_region(unsigned int from, unsigned int extent);
extern void release_region(unsigned int from, unsigned int extent);
extern int get_ioport_list(char *);
#define HAVE_AUTOIRQ
......
......@@ -180,6 +180,7 @@ struct packet_type {
extern volatile char in_bh;
extern struct device loopback_dev;
extern struct device *dev_base;
extern struct packet_type *ptype_base;
......
......@@ -25,7 +25,8 @@ enum root_directory_inos {
PROC_INTERRUPTS,
PROC_FILESYSTEMS,
PROC_KSYMS,
PROC_DMA
PROC_DMA,
PROC_IOPORTS
};
enum pid_directory_inos {
......
......@@ -84,6 +84,7 @@ extern void hd_setup(char *str, int *ints);
extern void bmouse_setup(char *str, int *ints);
extern void eth_setup(char *str, int *ints);
extern void xd_setup(char *str, int *ints);
extern void floppy_setup(char *str, int *ints);
extern void mcd_setup(char *str, int *ints);
extern void st_setup(char *str, int *ints);
extern void st0x_setup(char *str, int *ints);
......@@ -221,6 +222,9 @@ struct {
#ifdef CONFIG_BLK_DEV_XD
{ "xd=", xd_setup },
#endif
#ifdef CONFIG_BLK_DEV_FD
{ "floppy=", floppy_setup },
#endif
#ifdef CONFIG_MCD
{ "mcd=", mcd_setup },
#endif
......
......@@ -108,6 +108,26 @@ asmlinkage int check_bitmap(unsigned long *bitmap, short base, short extent)
return 0;
}
int get_ioport_list(char *buf)
{ int len=0,num,from;
for(num=0;num<IO_BITMAP_SIZE*32;num++)
if(check_bitmap(ioport_registrar,num,1)) {
from=num;
while(check_bitmap(ioport_registrar,num+1,1)
&& num+1<IO_BITMAP_SIZE*32 )
num++;
if(from==num)
len+=sprintf(buf+len,"%04x\n",num);
else
len+=sprintf(buf+len,"%04x-%04x\n",from,num);
if(len>4000) {
len+=sprintf((buf+len),"4k-Limit reached!\n");
return len;
}
}
return len;
}
/*
* this changes the io permissions bitmap in the current task.
*/
......
......@@ -76,6 +76,7 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */
#ifdef CONFIG_PCI
/* PCI BIOS support */
X(pcibios_present),
X(pcibios_find_class),
X(pcibios_find_device),
X(pcibios_read_config_byte),
......@@ -235,6 +236,7 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */
X(ftape_big_buffer),
X(do_floppy),
#endif
X(floppy_track_buffer),
#ifdef CONFIG_INET
/* support for loadable net drivers */
X(register_netdev),
......@@ -244,6 +246,7 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */
X(kfree_skb),
X(dev_kfree_skb),
X(snarf_region),
X(release_region),
X(netif_rx),
X(dev_rint),
X(dev_tint),
......
......@@ -213,8 +213,13 @@ int generic_mmap(struct inode * inode, struct file * file, struct vm_area_struct
return -ENOEXEC;
ops = &file_private_mmap;
if (vma->vm_flags & VM_SHARED) {
if (vma->vm_flags & (VM_WRITE | VM_MAYWRITE))
if (vma->vm_flags & (VM_WRITE | VM_MAYWRITE)) {
static int nr = 0;
ops = &file_shared_mmap;
if (nr++ < 5)
printk("%s tried to do a shared writeable mapping\n", current->comm);
return -EINVAL;
}
}
if (!IS_RDONLY(inode)) {
inode->i_atime = CURRENT_TIME;
......
......@@ -804,6 +804,7 @@ asmlinkage int sys_swapoff(const char * specialfile)
struct swap_info_struct * p;
struct inode * inode;
unsigned int type;
struct file filp;
int i;
if (!suser())
......@@ -825,15 +826,32 @@ asmlinkage int sys_swapoff(const char * specialfile)
break;
}
}
iput(inode);
if (type >= nr_swapfiles)
if (type >= nr_swapfiles){
iput(inode);
return -EINVAL;
}
p->flags = SWP_USED;
i = try_to_unuse(type);
if (i) {
iput(inode);
p->flags = SWP_WRITEOK;
return i;
}
if(p->swap_device){
memset(&filp, 0, sizeof(filp));
filp.f_inode = inode;
filp.f_mode = 3; /* read write */
/* open it again to get fops */
if( !blkdev_open(inode, &filp) &&
filp.f_op && filp.f_op->release){
filp.f_op->release(inode,&filp);
filp.f_op->release(inode,&filp);
}
}
iput(inode);
nr_swap_pages -= p->pages;
iput(p->swap_file);
p->swap_file = NULL;
......@@ -858,7 +876,9 @@ asmlinkage int sys_swapon(const char * specialfile)
unsigned int type;
int i,j;
int error;
struct file filp;
memset(&filp, 0, sizeof(filp));
if (!suser())
return -EPERM;
p = swap_info;
......@@ -879,16 +899,23 @@ asmlinkage int sys_swapon(const char * specialfile)
p->max = 1;
error = namei(specialfile,&swap_inode);
if (error)
goto bad_swap;
goto bad_swap_2;
p->swap_file = swap_inode;
error = -EBUSY;
if (swap_inode->i_count != 1)
goto bad_swap;
goto bad_swap_2;
error = -EINVAL;
if (S_ISBLK(swap_inode->i_mode)) {
p->swap_device = swap_inode->i_rdev;
filp.f_inode = swap_inode;
filp.f_mode = 3; /* read write */
error = blkdev_open(swap_inode, &filp);
p->swap_file = NULL;
iput(swap_inode);
if(error)
goto bad_swap_2;
error = -ENODEV;
if (!p->swap_device)
goto bad_swap;
......@@ -950,6 +977,9 @@ asmlinkage int sys_swapon(const char * specialfile)
printk("Adding Swap: %dk swap-space\n",j<<2);
return 0;
bad_swap:
if(filp.f_op && filp.f_op->release)
filp.f_op->release(filp.f_inode,&filp);
bad_swap_2:
free_page((long) p->swap_lockmap);
vfree(p->swap_map);
iput(p->swap_file);
......
3c509.o de600.o de620.o 3c501.o eexpress.o plip.o 8390.o
3c509.o de600.o de620.o 3c501.o apricot.o eexpress.o plip.o 8390.o
......@@ -232,6 +232,7 @@ static void ip_mc_inc_group(struct device *dev, unsigned long addr)
return;
i->users=1;
i->interface=dev;
i->multiaddr=addr;
i->next=dev->ip_mc_list;
igmp_group_added(i);
dev->ip_mc_list=i;
......
......@@ -224,6 +224,10 @@ int ip_build_header(struct sk_buff *skb, unsigned long saddr, unsigned long dadd
* See if we need to look up the device.
*/
#ifdef CONFIG_INET_MULTICAST
if(MULTICAST(daddr) && *dev==NULL && skb->sk && *skb->sk->ip_mc_name)
*dev=dev_get(skb->sk->ip_mc_name);
#endif
if (*dev == NULL)
{
if(skb->localroute)
......@@ -316,6 +320,7 @@ int ip_build_header(struct sk_buff *skb, unsigned long saddr, unsigned long dadd
iph->saddr = saddr;
iph->protocol = type;
iph->ihl = 5;
skb->ip_hdr = iph;
/* Setup the IP options. */
#ifdef Not_Yet_Avail
......@@ -1591,7 +1596,28 @@ int ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt)
kfree_skb(skb, FREE_WRITE);
return(0);
}
#ifdef CONFIG_IP_MULTICAST
if(brd==IS_MULTICAST)
{
/*
* Check it is for one of our groups
*/
struct ip_mc_list *ip_mc=dev->ip_mc_list;
do
{
if(ip_mc==NULL)
{
kfree_skb(skb, FREE_WRITE);
return 0;
}
if(ip_mc->multiaddr==iph->daddr)
break;
ip_mc=ip_mc->next;
}
while(1);
}
#endif
/*
* Account for the packet
*/
......@@ -1714,6 +1740,41 @@ int ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt)
return(0);
}
/*
* Loop a packet back to the sender.
*/
static void ip_loopback(struct device *old_dev, struct sk_buff *skb)
{
struct device *dev=&loopback_dev;
int len=skb->len-old_dev->hard_header_len;
struct sk_buff *newskb=alloc_skb(len+dev->hard_header_len, GFP_ATOMIC);
if(newskb==NULL)
return;
newskb->link3=NULL;
newskb->sk=NULL;
newskb->dev=dev;
newskb->saddr=skb->saddr;
newskb->daddr=skb->daddr;
newskb->raddr=skb->raddr;
newskb->free=1;
newskb->lock=0;
newskb->users=0;
newskb->pkt_type=skb->pkt_type;
newskb->len=len+dev->hard_header_len;
newskb->ip_hdr=(struct iphdr *)(newskb->data+ip_send(newskb, skb->ip_hdr->daddr, len, dev, skb->ip_hdr->saddr));
memcpy(newskb->ip_hdr,skb->ip_hdr,len);
/* Recurse. The device check against IFF_LOOPBACK will stop infinite recursion */
/*printk("Loopback output queued [%lX to %lX].\n", newskb->ip_hdr->saddr,newskb->ip_hdr->daddr);*/
ip_queue_xmit(NULL, dev, newskb, 1);
}
/*
* Queues a packet to be sent, and starts the transmitter
......@@ -1858,11 +1919,46 @@ void ip_queue_xmit(struct sock *sk, struct device *dev,
/*
* If the indicated interface is up and running, send the packet.
*/
ip_statistics.IpOutRequests++;
#ifdef CONFIG_IP_ACCT
ip_acct_cnt(iph,ip_acct_chain,1);
#endif
#ifdef CONFIG_IP_MULTICAST
/*
* Multicasts are looped back for other local users
*/
if (MULTICAST(skb->daddr) && !(dev->flags&IFF_LOOPBACK))
{
if(sk==NULL || sk->ip_mc_loop)
{
struct ip_mc_list *imc=dev->ip_mc_list;
while(imc!=NULL)
{
if(imc->multiaddr==skb->daddr)
{
ip_loopback(dev,skb);
break;
}
imc=imc->next;
}
}
/* Multicasts with ttl 0 must not go beyond the host */
if(skb->ip_hdr->ttl==0)
{
kfree_skb(skb, FREE_READ);
return;
}
}
#endif
if((dev->flags&IFF_BROADCAST) && iph->daddr==dev->pa_brdaddr && !(dev->flags&IFF_LOOPBACK))
ip_loopback(dev,skb);
if (dev->flags & IFF_UP)
{
/*
......
......@@ -450,10 +450,6 @@ static void free_fw_chain(struct ip_fw **chainptr)
restore_flags(flags);
}
#endif /* CONFIG_IP_ACCT || CONFIG_IP_FIREWALL */
#ifdef CONFIG_IP_FIREWALL
static int add_to_chain(struct ip_fw **chainptr, struct ip_fw *frwl)
{
struct ip_fw *ftmp;
......@@ -706,7 +702,7 @@ static int del_from_chain(struct ip_fw **chainptr, struct ip_fw *frwl)
return(EINVAL);
}
#endif /* CONFIG_IP_FIREWALL */
#endif /* CONFIG_IP_ACCT || CONFIG_IP_FIREWALL */
struct ip_fw *check_ipfw_struct(struct ip_fw *frwl, int len)
{
......
......@@ -262,7 +262,7 @@ static struct sk_buff *tcp_find_established(struct sock *s)
return p;
p=p->next;
}
while(p!=skb_peek(&s->receive_queue));
while(p!=(struct sk_buff *)&s->receive_queue);
return NULL;
}
......@@ -907,7 +907,7 @@ static void tcp_send_ack(unsigned long sequence, unsigned long ack,
* This routine builds a generic TCP header.
*/
extern __inline int tcp_build_header(struct tcphdr *th, struct sock *sk, int push)
int tcp_build_header(struct tcphdr *th, struct sock *sk, int push)
{
/* FIXME: want to get rid of this. */
......@@ -4027,22 +4027,19 @@ tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
if (th->rst)
{
if(sk->state!=TCP_TIME_WAIT) /* RFC 1337 recommendation re RST in time wait */
tcp_statistics.TcpEstabResets++;
sk->zapped=1;
/* This means the thing should really be closed. */
sk->err = ECONNRESET;
if (sk->state == TCP_CLOSE_WAIT)
{
tcp_statistics.TcpEstabResets++;
sk->zapped=1;
/* This means the thing should really be closed. */
sk->err = ECONNRESET;
if (sk->state == TCP_CLOSE_WAIT)
{
sk->err = EPIPE;
}
tcp_set_state(sk,TCP_CLOSE);
sk->shutdown = SHUTDOWN_MASK;
if (!sk->dead)
{
sk->state_change(sk);
}
sk->err = EPIPE;
}
tcp_set_state(sk,TCP_CLOSE);
sk->shutdown = SHUTDOWN_MASK;
if (!sk->dead)
{
sk->state_change(sk);
}
kfree_skb(skb, FREE_READ);
release_sock(sk);
......
......@@ -8,8 +8,7 @@
#include <linux/config.h>
#include <linux/utsname.h>
#include "./version.h"
#include <linux/version.h>
struct new_utsname system_utsname = {
UTS_SYSNAME, UTS_NODENAME, UTS_RELEASE, UTS_VERSION,
......
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