Commit 00c2e5a7 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.70

parent ea8a68b9
VERSION = 1 VERSION = 1
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 69 SUBLEVEL = 70
ARCH = i386 ARCH = i386
......
...@@ -22,8 +22,12 @@ STRIP =strip ...@@ -22,8 +22,12 @@ STRIP =strip
ifdef CONFIG_M486 ifdef CONFIG_M486
CFLAGS := $(CFLAGS) -m486 CFLAGS := $(CFLAGS) -m486
else else
ifdef CONFIG_M586
CFLAGS := $(CFLAGS) -mpentium
else
CFLAGS := $(CFLAGS) -m386 CFLAGS := $(CFLAGS) -m386
endif endif
endif
zBoot/zSystem: zBoot/*.c zBoot/*.S tools/zSystem zBoot/zSystem: zBoot/*.c zBoot/*.S tools/zSystem
$(MAKE) -C zBoot $(MAKE) -C zBoot
......
...@@ -11,9 +11,20 @@ bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y ...@@ -11,9 +11,20 @@ bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y
bool 'XT harddisk support' CONFIG_BLK_DEV_XD n bool 'XT harddisk support' CONFIG_BLK_DEV_XD n
bool 'Networking support' CONFIG_NET y bool 'Networking support' CONFIG_NET y
bool 'Limit memory to low 16MB' CONFIG_MAX_16M n bool 'Limit memory to low 16MB' CONFIG_MAX_16M n
bool 'PCI bios support' CONFIG_PCI n
bool 'System V IPC' CONFIG_SYSVIPC y bool 'System V IPC' CONFIG_SYSVIPC y
bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
#bool 'Use -mpentium flag for Pentium-specific optimizations' CONFIG_M586 n
#if [ "$CONFIG_M586" = "n" ]; then
bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
#fi
comment 'Screen saver mode'
bool 'VESA Power Saving Protocol Support' CONFIG_VESA_PSPM n
if [ "$CONFIG_VESA_PSPM" = "y" ]; then
bool 'VESA PSPM Force Off' CONFIG_PSPM_FORCE_OFF n
fi
if [ "$CONFIG_NET" = "y" ]; then if [ "$CONFIG_NET" = "y" ]; then
comment 'Networking options' comment 'Networking options'
...@@ -60,7 +71,9 @@ bool 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC n ...@@ -60,7 +71,9 @@ bool 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC n
bool 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F n bool 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F n
bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n
bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 n bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 n
bool 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx n if [ "$CONFIG_PCI" = "y" ]; then
bool 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx n
fi
bool 'Always IN2000 SCSI support (test release)' CONFIG_SCSI_IN2000 n bool 'Always IN2000 SCSI support (test release)' CONFIG_SCSI_IN2000 n
bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 n bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 n
bool 'QLOGIC SCSI support' CONFIG_SCSI_QLOGIC n bool 'QLOGIC SCSI support' CONFIG_SCSI_QLOGIC n
......
...@@ -160,7 +160,9 @@ static unsigned short *vc_scrbuf[MAX_NR_CONSOLES]; ...@@ -160,7 +160,9 @@ static unsigned short *vc_scrbuf[MAX_NR_CONSOLES];
static int console_blanked = 0; static int console_blanked = 0;
static int blankinterval = 10*60*HZ; static int blankinterval = 10*60*HZ;
#ifndef CONFIG_VESA_PSPM
static long blank_origin, blank__origin, unblank_origin; static long blank_origin, blank__origin, unblank_origin;
#endif
struct vc_data { struct vc_data {
unsigned long vc_screenbuf_size; unsigned long vc_screenbuf_size;
...@@ -288,6 +290,159 @@ static struct vc { ...@@ -288,6 +290,159 @@ static struct vc {
#define vcmode (vt_cons[currcons]->vc_mode) #define vcmode (vt_cons[currcons]->vc_mode)
#define structsize (sizeof(struct vc_data) + sizeof(struct vt_struct)) #define structsize (sizeof(struct vc_data) + sizeof(struct vt_struct))
#ifdef CONFIG_VESA_PSPM
/*
* This section(s) handles the VESA Power Saving Protocol that let a *
* monitor be powered down whenever not needed for a longer time. *
* VESA protocol defines: *
* *
* Mode/Status HSync VSync Video *
* ---------------------------------------------- *
* "On" on on active *
* "Suspend" {either} on off blank *
* { or } off on blank *
* "Off" off off blank << PSPM_FORCE_OFF *
* *
* Original code taken from the Power Management Utility (PMU) of *
* Huang shi chao, delivered together with many new monitor models *
* capable of the VESA Power Saving Protocol. *
* Adapted to Linux by Christoph Rimek (chrimek@toppoint.de) 15-may-94 *
* Re-Adapted by Nicholas Leon (nicholas@neko.binary9.com) 10/94 *
* (with minor reorganization/changes) *
*/
static void vesa_blank(void);
static void vesa_unblank(void);
#define seq_port_reg (0x3c4) /* Sequencer register select port */
#define seq_port_val (0x3c5) /* Sequencer register value port */
#define video_misc_rd (0x3cc) /* Video misc. read port */
#define video_misc_wr (0x3c2) /* Video misc. write port */
/* structure holding original VGA register settings */
static struct {
unsigned char SeqCtrlIndex; /* Sequencer Index reg. */
unsigned char CrtCtrlIndex; /* CRT-Contr. Index reg. */
unsigned char CrtMiscIO; /* Miscellaneous register */
#ifdef CONFIG_PSPM_FORCE_OFF
unsigned char HorizontalTotal; /* CRT-Controller:00h */
unsigned char HorizDisplayEnd; /* CRT-Controller:01h */
unsigned char StartHorizRetrace; /* CRT-Controller:04h */
unsigned char EndHorizRetrace; /* CRT-Controller:05h */
#endif
unsigned char Overflow; /* CRT-Controller:07h */
unsigned char StartVertRetrace; /* CRT-Controller:10h */
unsigned char EndVertRetrace; /* CRT-Controller:11h */
unsigned char ModeControl; /* CRT-Controller:17h */
unsigned char ClockingMode; /* Seq-Controller:01h */
} vga;
/* routine to blank a vesa screen */
static void vesa_blank(void)
{
/* save original values of VGA controller registers */
cli();
vga.SeqCtrlIndex = inb_p(seq_port_reg);
vga.CrtCtrlIndex = inb_p(video_port_reg);
vga.CrtMiscIO = inb_p(video_misc_rd);
sti();
#ifdef CONFIG_PSPM_FORCE_OFF
outb_p(0x00,video_port_reg); /* HorizontalTotal */
vga.HorizontalTotal = inb_p(video_port_val);
outb_p(0x01,video_port_reg); /* HorizDisplayEnd */
vga.HorizDisplayEnd = inb_p(video_port_val);
outb_p(0x04,video_port_reg); /* StartHorizRetrace */
vga.StartHorizRetrace = inb_p(video_port_val);
outb_p(0x05,video_port_reg); /* EndHorizRetrace */
vga.EndHorizRetrace = inb_p(video_port_val);
#endif
outb_p(0x07,video_port_reg); /* Overflow */
vga.Overflow = inb_p(video_port_val);
outb_p(0x10,video_port_reg); /* StartVertRetrace */
vga.StartVertRetrace = inb_p(video_port_val);
outb_p(0x11,video_port_reg); /* EndVertRetrace */
vga.EndVertRetrace = inb_p(video_port_val);
outb_p(0x17,video_port_reg); /* ModeControl */
vga.ModeControl = inb_p(video_port_val);
outb_p(0x01,seq_port_reg); /* ClockingMode */
vga.ClockingMode = inb_p(seq_port_val);
/* assure that video is enabled */
/* "0x20" is VIDEO_ENABLE_bit in register 01 of sequencer */
cli();
outb_p(0x01,seq_port_reg);
outb_p(vga.ClockingMode | 0x20,seq_port_val);
/* sti();
cli(); */
/* test for vertical retrace in process.... */
if ((vga.CrtMiscIO & 0x80) == 0x80)
outb_p(vga.CrtMiscIO & 0xef,video_misc_wr);
/* Set <End of vertical retrace> to minimum (0) and *
* <Start of vertical Retrace> to maximum (incl. overflow) *
* Result: turn off vertical sync (VSync) pulse */
outb_p(0x10,video_port_reg); /* StartVertRetrace */
outb_p(0xff,video_port_val); /* maximum value */
outb_p(0x11,video_port_reg); /* EndVertRetrace */
outb_p(0x40,video_port_val); /* minimum (bits 0..3) */
outb_p(0x07,video_port_reg); /* Overflow */
outb_p(vga.Overflow | 0x84,video_port_val); /* bits 9,10 of */
/* vert. retrace */
#ifdef CONFIG_PSPM_FORCE_OFF
/* Set <End of horizontal retrace> to minimum (0) and *
* <Start of horizontal Retrace> to maximum *
* Result: turn off horizontal sync (HSync) pulse */
outb_p(0x04,video_port_reg); /* StartHorizRetrace */
outb_p(0xff,video_port_val); /* maximum */
outb_p(0x05,video_port_reg); /* EndHorizRetrace */
outb_p(0x00,video_port_val); /* minimum (0) */
#endif
/* restore both index registers */
outb_p(vga.SeqCtrlIndex,seq_port_reg);
outb_p(vga.CrtCtrlIndex,video_port_reg);
sti();
}
/* routine to unblank a vesa screen */
static void vesa_unblank(void)
{
/* restore original values of VGA controller registers */
cli();
outb_p(vga.CrtMiscIO,video_misc_wr);
#ifdef CONFIG_PSPM_FORCE_OFF
outb_p(0x00,video_port_reg); /* HorizontalTotal */
outb_p(vga.HorizontalTotal,video_port_val);
outb_p(0x01,video_port_reg); /* HorizDisplayEnd */
outb_p(vga.HorizDisplayEnd,video_port_val);
outb_p(0x04,video_port_reg); /* StartHorizRetrace */
outb_p(vga.StartHorizRetrace,video_port_val);
outb_p(0x05,video_port_reg); /* EndHorizRetrace */
outb_p(vga.EndHorizRetrace,video_port_val);
#endif
outb_p(0x07,video_port_reg); /* Overflow */
outb_p(vga.Overflow,video_port_val);
outb_p(0x10,video_port_reg); /* StartVertRetrace */
outb_p(vga.StartVertRetrace,video_port_val);
outb_p(0x11,video_port_reg); /* EndVertRetrace */
outb_p(vga.EndVertRetrace,video_port_val);
outb_p(0x17,video_port_reg); /* ModeControl */
outb_p(vga.ModeControl,video_port_val);
outb_p(0x01,seq_port_reg); /* ClockingMode */
outb_p(vga.ClockingMode,seq_port_val);
/* restore index/control registers */
outb_p(vga.SeqCtrlIndex,seq_port_reg);
outb_p(vga.CrtCtrlIndex,video_port_reg);
sti();
}
#endif /* CONFIG_VESA_PSPM */
static void * memsetw(void * s, unsigned short c, unsigned int count) static void * memsetw(void * s, unsigned short c, unsigned int count)
{ {
__asm__("cld\n\t" __asm__("cld\n\t"
...@@ -2032,7 +2187,9 @@ static void set_scrmem(int currcons, long offset) ...@@ -2032,7 +2187,9 @@ static void set_scrmem(int currcons, long offset)
void blank_screen(void) void blank_screen(void)
{ {
#ifndef CONFIG_VESA_PSPM
int currcons; int currcons;
#endif
if (console_blanked) if (console_blanked)
return; return;
...@@ -2043,6 +2200,9 @@ void blank_screen(void) ...@@ -2043,6 +2200,9 @@ void blank_screen(void)
} }
timer_table[BLANK_TIMER].fn = unblank_screen; timer_table[BLANK_TIMER].fn = unblank_screen;
#ifdef CONFIG_VESA_PSPM
vesa_blank();
#else
/* try not to lose information by blanking, and not to waste memory */ /* try not to lose information by blanking, and not to waste memory */
currcons = fg_console; currcons = fg_console;
has_scrolled = 0; has_scrolled = 0;
...@@ -2053,14 +2213,17 @@ void blank_screen(void) ...@@ -2053,14 +2213,17 @@ void blank_screen(void)
unblank_origin = origin; unblank_origin = origin;
memsetw((void *)blank_origin, BLANK, video_mem_term-blank_origin); memsetw((void *)blank_origin, BLANK, video_mem_term-blank_origin);
hide_cursor(); hide_cursor();
#endif
console_blanked = fg_console + 1; console_blanked = fg_console + 1;
} }
void unblank_screen(void) void unblank_screen(void)
{ {
int currcons; int currcons;
#ifndef CONFIG_VESA_PSPM
int resetorg; int resetorg;
long offset; long offset;
#endif
if (!console_blanked) if (!console_blanked)
return; return;
...@@ -2075,6 +2238,10 @@ void unblank_screen(void) ...@@ -2075,6 +2238,10 @@ void unblank_screen(void)
timer_active |= 1<<BLANK_TIMER; timer_active |= 1<<BLANK_TIMER;
} }
currcons = fg_console; currcons = fg_console;
#ifdef CONFIG_VESA_PSPM
vesa_unblank();
console_blanked=0;
#else
offset = 0; offset = 0;
resetorg = 0; resetorg = 0;
if (console_blanked == fg_console + 1 && origin == unblank_origin if (console_blanked == fg_console + 1 && origin == unblank_origin
...@@ -2091,6 +2258,7 @@ void unblank_screen(void) ...@@ -2091,6 +2258,7 @@ void unblank_screen(void)
set_cursor(fg_console); set_cursor(fg_console);
if (resetorg) if (resetorg)
__set_origin(blank__origin); __set_origin(blank__origin);
#endif
} }
void update_screen(int new_console) void update_screen(int new_console)
......
...@@ -3,7 +3,7 @@ Tue Nov 29 15:43:50 1994 Eric Youngdale (eric@andante.aib.com) ...@@ -3,7 +3,7 @@ Tue Nov 29 15:43:50 1994 Eric Youngdale (eric@andante.aib.com)
* Linux 1.1.68 released. * Linux 1.1.68 released.
Add support for 12 byte vendor specific commands in scsi-generics, Add support for 12 byte vendor specific commands in scsi-generics,
more (i.e. the last manditory) low-level changes to support more (i.e. the last mandatory) low-level changes to support
loadable modules, plus a few other changes people have requested loadable modules, plus a few other changes people have requested
lately. Changes by me (ERY) unless otherwise noted. Spelling lately. Changes by me (ERY) unless otherwise noted. Spelling
changes appear from some unknown corner of the universe. changes appear from some unknown corner of the universe.
......
...@@ -472,7 +472,7 @@ scsi_tape_open(struct inode * inode, struct file * filp) ...@@ -472,7 +472,7 @@ scsi_tape_open(struct inode * inode, struct file * filp)
SCpnt->request.dev = -1; /* Mark as not busy */ SCpnt->request.dev = -1; /* Mark as not busy */
(STp->buffer)->in_use = 0; (STp->buffer)->in_use = 0;
STp->buffer = NULL; STp->buffer = NULL;
STp->density = 0; /* Clear the errorneus "residue" */ STp->density = 0; /* Clear the erroneous "residue" */
STp->write_prot = 0; STp->write_prot = 0;
STp->block_size = 0; STp->block_size = 0;
STp->eof = ST_NOEOF; STp->eof = ST_NOEOF;
......
/*
* fs/msdos/mmap.c
*
* Written by Jacques Gelinas (jacques@solucorp.qc.ca)
* Inspired by fs/nfs/mmap.c (Jaon Tombs 15 Aug 1993)
*
* msdos mmap handling
*/
#include <linux/stat.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/shm.h>
#include <linux/errno.h>
#include <linux/mman.h>
#include <linux/string.h>
#include <linux/malloc.h>
#include <asm/segment.h>
#include <asm/system.h>
#include <linux/msdos_fs.h>
/*
* Fill in the supplied page for mmap
*/
static unsigned long msdos_file_mmap_nopage(
struct vm_area_struct * area,
unsigned long address,
unsigned long page,
int error_code)
{
struct inode * inode = area->vm_inode;
unsigned int clear;
int pos;
long gap; /* distance from eof to pos */
address &= PAGE_MASK;
pos = address - area->vm_start + area->vm_offset;
clear = 0;
gap = inode->i_size - pos;
if (gap <= 0){
/* mmaping beyond end of file */
clear = PAGE_SIZE;
}else{
int cur_read;
int need_read;
struct file filp;
if (gap < PAGE_SIZE){
clear = PAGE_SIZE - gap;
}
filp.f_pos = pos;
need_read = PAGE_SIZE - clear;
{
unsigned long cur_fs = get_fs();
set_fs (KERNEL_DS);
cur_read = msdos_file_read (inode,&filp,(char*)page
,need_read);
set_fs (cur_fs);
}
if (cur_read != need_read){
printk ("MSDOS: Error while reading an mmap file %d <> %d\n"
,cur_read,need_read);
}
}
if (clear > 0){
memset ((char*)page+PAGE_SIZE-clear,0,clear);
}
return page;
}
struct vm_operations_struct msdos_file_mmap = {
NULL, /* open */
NULL, /* close */
msdos_file_mmap_nopage, /* nopage */
NULL, /* wppage */
NULL, /* share */
NULL, /* unmap */
};
/*
* This is used for a general mmap of an msdos file
* Returns 0 if ok, or a negative error code if not.
*/
int msdos_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma)
{
if (vma->vm_page_prot & PAGE_RW) /* only PAGE_COW or read-only supported now */
return -EINVAL;
if (vma->vm_offset & (inode->i_sb->s_blocksize - 1))
return -EINVAL;
if (!inode->i_sb || !S_ISREG(inode->i_mode))
return -EACCES;
if (!IS_RDONLY(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
vma->vm_inode = inode;
inode->i_count++;
vma->vm_ops = &msdos_file_mmap;
return 0;
}
...@@ -50,6 +50,10 @@ extern int rarp_get_info(char *, char **, off_t, int); ...@@ -50,6 +50,10 @@ extern int rarp_get_info(char *, char **, off_t, int);
extern int dev_get_info(char *, char **, off_t, int); extern int dev_get_info(char *, char **, off_t, int);
extern int rt_get_info(char *, char **, off_t, int); extern int rt_get_info(char *, char **, off_t, int);
extern int snmp_get_info(char *, char **, off_t, int); extern int snmp_get_info(char *, char **, off_t, int);
extern int ip_acct_procinfo(char *, char **, off_t, int);
extern int ip_fw_blk_procinfo(char *, char **, off_t, int);
extern int ip_fw_fwd_procinfo(char *, char **, off_t, int);
extern int ip_mc_procinfo(char *, char **, off_t, int);
#endif /* CONFIG_INET */ #endif /* CONFIG_INET */
#ifdef CONFIG_IPX #ifdef CONFIG_IPX
extern int ipx_get_info(char *, char **, off_t, int); extern int ipx_get_info(char *, char **, off_t, int);
...@@ -115,6 +119,16 @@ static struct proc_dir_entry net_dir[] = { ...@@ -115,6 +119,16 @@ static struct proc_dir_entry net_dir[] = {
#ifdef CONFIG_INET_RARP #ifdef CONFIG_INET_RARP
{ PROC_NET_RARP, 4, "rarp"}, { PROC_NET_RARP, 4, "rarp"},
#endif #endif
#ifdef CONFIG_IP_MULTICAST
{ PROC_NET_IGMP, 4, "igmp"},
#endif
#ifdef CONFIG_IP_FIREWALL
{ PROC_NET_IPFWFWD, 10, "ip_forward"},
{ PROC_NET_IPBLFWD, 8, "ip_block"},
#endif
#ifdef CONFIG_IP_ACCT
{ PROC_NET_IPACCT, 7, "ip_acct"},
#endif
#endif /* CONFIG_INET */ #endif /* CONFIG_INET */
#ifdef CONFIG_IPX #ifdef CONFIG_IPX
{ PROC_NET_IPX_ROUTE, 9, "ipx_route" }, { PROC_NET_IPX_ROUTE, 9, "ipx_route" },
...@@ -237,6 +251,24 @@ static int proc_readnet(struct inode * inode, struct file * file, ...@@ -237,6 +251,24 @@ static int proc_readnet(struct inode * inode, struct file * file,
case PROC_NET_SNMP: case PROC_NET_SNMP:
length = snmp_get_info(page, &start, file->f_pos,thistime); length = snmp_get_info(page, &start, file->f_pos,thistime);
break; break;
#ifdef CONFIG_IP_MULTICAST
case PROC_NET_IGMP:
length = ip_mc_procinfo(page, &start, file->f_pos,thistime);
break;
#endif
#ifdef CONFIG_IP_FIREWALL
case PROC_NET_IPFWFWD:
length = ip_fw_fwd_procinfo(page, &start, file->f_pos,thistime);
break;
case PROC_NET_IPBLFWD:
length = ip_fw_blk_procinfo(page, &start, file->f_pos,thistime);
break;
#endif
#ifdef CONFIG_IP_ACCT
case PROC_NET_IPACCT:
length = ip_acct_procinfo(page, &start, file->f_pos,thistime);
break;
#endif
#ifdef CONFIG_INET_RARP #ifdef CONFIG_INET_RARP
case PROC_NET_RARP: case PROC_NET_RARP:
length = rarp_get_info(page,&start,file->f_pos,thistime); length = rarp_get_info(page,&start,file->f_pos,thistime);
......
/*
* linux/fs/sysv/mmap.c
*
* mm/memory.c, mm/mmap.c
* Copyright (C) 1991, 1992, 1993 Linus Torvalds
*
* nfs/mmap.c
* Copyright (C) 1993 Jon Tombs
*
* fs/msdos/mmap.c
* Copyright (C) 1994 Jacques Gelinas
*
* fs/sysv/mmap.c
* Copyright (C) 1994 Bruno Haible
*
* SystemV/Coherent mmap handling
*/
#include <asm/segment.h>
#include <linux/fs.h>
#include <linux/sysv_fs.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/stat.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/malloc.h>
/*
* Fill in the supplied page for mmap
*/
static unsigned long sysv_file_mmap_nopage (struct vm_area_struct * area,
unsigned long address, unsigned long page, int no_share)
{
int remaining, count, old_fs;
struct file filp;
address &= PAGE_MASK;
/* prepare a file pointer */
filp.f_pos = address - area->vm_start + area->vm_offset;
filp.f_reada = 0;
remaining = area->vm_end - address;
if (remaining > PAGE_SIZE)
remaining = PAGE_SIZE;
/* read from the file. page is in kernel space, not user space. */
old_fs = get_fs(); set_fs(get_ds());
count = sysv_file_read (area->vm_inode, &filp, (char *)page, remaining);
set_fs(old_fs);
if (count < 0)
count = 0; /* do nothing on I/O error ?? */
else
remaining -= count;
if (remaining > 0)
memset((char *)page + count, 0, remaining);
return page;
}
static struct vm_operations_struct sysv_file_mmap = {
NULL, /* open */
NULL, /* close */
sysv_file_mmap_nopage, /* nopage */
NULL, /* wppage */
NULL, /* share */
NULL, /* unmap */
};
int sysv_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma)
{
if (vma->vm_page_prot & PAGE_RW) /* only PAGE_COW or read-only supported right now */
return -EINVAL;
if (vma->vm_offset & (inode->i_sb->s_blocksize - 1))
return -EINVAL;
if (!inode->i_sb || !S_ISREG(inode->i_mode))
return -EACCES;
if (!IS_RDONLY(inode)) {
inode->i_atime = CURRENT_TIME;
inode->i_dirt = 1;
}
vma->vm_inode = inode;
inode->i_count++;
vma->vm_ops = &sysv_file_mmap;
return 0;
}
#ifndef _ALPHA_TYPES_H #ifndef _ALPHA_TYPES_H
#define _ALPHA_TYPES_H #define _ALPHA_TYPES_H
/*
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
* header files exported to user space
*/
typedef signed char __s8;
typedef unsigned char __u8;
typedef signed short __s16;
typedef unsigned short __u16;
typedef signed int __s32;
typedef unsigned int __u32;
/*
* There are 32-bit compilers for the alpha out there..
*/
#if ((~0UL) == 0xffffffff)
typedef signed long long __s64;
typedef unsigned long long __u64;
#else
typedef signed long __s64;
typedef unsigned long __u64;
#endif
/* /*
* These aren't exported outside the kernel to avoid name space clashes * These aren't exported outside the kernel to avoid name space clashes
*/ */
......
#ifndef _I386_TYPES_H #ifndef _I386_TYPES_H
#define _I386_TYPES_H #define _I386_TYPES_H
/*
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
* header files exported to user space
*/
typedef signed char __s8;
typedef unsigned char __u8;
typedef signed short __s16;
typedef unsigned short __u16;
typedef signed long __s32;
typedef unsigned long __u32;
typedef signed long long __s64;
typedef unsigned long long __u64;
/* /*
* These aren't exported outside the kernel to avoid name space clashes * These aren't exported outside the kernel to avoid name space clashes
*/ */
......
...@@ -29,24 +29,24 @@ ...@@ -29,24 +29,24 @@
struct timestamp { struct timestamp {
u8 len; __u8 len;
u8 ptr; __u8 ptr;
union { union {
#if defined(__i386__) #if defined(__i386__)
u8 flags:4, __u8 flags:4,
overflow:4; overflow:4;
#elif defined(__mc68000__) #elif defined(__mc68000__)
u8 overflow:4, __u8 overflow:4,
flags:4; flags:4;
#elif defined(__alpha__) #elif defined(__alpha__)
u8 flags:4, __u8 flags:4,
overflow:4; overflow:4;
#else #else
#error "Adjust this structure to match your CPU" #error "Adjust this structure to match your CPU"
#endif #endif
u8 full_char; __u8 full_char;
} x; } x;
u32 data[9]; __u32 data[9];
}; };
...@@ -74,26 +74,26 @@ struct options { ...@@ -74,26 +74,26 @@ struct options {
struct iphdr { struct iphdr {
#if defined(__i386__) #if defined(__i386__)
u8 ihl:4, __u8 ihl:4,
version:4; version:4;
#elif defined (__mc68000__) #elif defined (__mc68000__)
u8 version:4, __u8 version:4,
ihl:4; ihl:4;
#elif defined (__alpha__) #elif defined (__alpha__)
u8 ihl:4, __u8 ihl:4,
version:4; version:4;
#else #else
#error "Adjust this structure to match your CPU" #error "Adjust this structure to match your CPU"
#endif #endif
u8 tos; __u8 tos;
u16 tot_len; __u16 tot_len;
u16 id; __u16 id;
u16 frag_off; __u16 frag_off;
u8 ttl; __u8 ttl;
u8 protocol; __u8 protocol;
u16 check; __u16 check;
u32 saddr; __u32 saddr;
u32 daddr; __u32 daddr;
/*The options start here. */ /*The options start here. */
}; };
......
...@@ -58,6 +58,16 @@ enum net_directory_inos { ...@@ -58,6 +58,16 @@ enum net_directory_inos {
#ifdef CONFIG_INET_RARP #ifdef CONFIG_INET_RARP
PROC_NET_RARP, PROC_NET_RARP,
#endif #endif
#ifdef CONFIG_IP_MULTICAST
PROC_NET_IGMP,
#endif
#ifdef CONFIG_IP_FIREWALL
PROC_NET_IPFWFWD,
PROC_NET_IPBLFWD,
#endif
#ifdef CONFIG_IP_ACCT
PROC_NET_IPACCT,
#endif
#endif #endif
#ifdef CONFIG_IPX #ifdef CONFIG_IPX
PROC_NET_IPX_ROUTE, PROC_NET_IPX_ROUTE,
......
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
struct tcphdr { struct tcphdr {
u16 source; __u16 source;
u16 dest; __u16 dest;
u32 seq; __u32 seq;
u32 ack_seq; __u32 ack_seq;
#if defined(__i386__) #if defined(__i386__)
u16 res1:4, __u16 res1:4,
doff:4, doff:4,
fin:1, fin:1,
syn:1, syn:1,
...@@ -38,7 +38,7 @@ struct tcphdr { ...@@ -38,7 +38,7 @@ struct tcphdr {
urg:1, urg:1,
res2:2; res2:2;
#elif defined(__mc68000__) #elif defined(__mc68000__)
u16 res2:2, __u16 res2:2,
urg:1, urg:1,
ack:1, ack:1,
psh:1, psh:1,
...@@ -48,7 +48,7 @@ struct tcphdr { ...@@ -48,7 +48,7 @@ struct tcphdr {
doff:4, doff:4,
res1:4; res1:4;
#elif defined(__alpha__) #elif defined(__alpha__)
u16 res1:4, __u16 res1:4,
doff:4, doff:4,
fin:1, fin:1,
syn:1, syn:1,
...@@ -60,9 +60,9 @@ struct tcphdr { ...@@ -60,9 +60,9 @@ struct tcphdr {
#else #else
#error "Adjust this structure for your cpu alignment rules" #error "Adjust this structure for your cpu alignment rules"
#endif #endif
u16 window; __u16 window;
u16 check; __u16 check;
u16 urg_ptr; __u16 urg_ptr;
}; };
......
...@@ -41,16 +41,6 @@ ...@@ -41,16 +41,6 @@
#include <asm/segment.h> #include <asm/segment.h>
/*
* It would seem some PCI bioses are buggy, so we don't actually use these
* routines unless we need to..
*/
#ifdef CONFIG_SCSI_NCR53C7xx
#define CONFIG_PCI
#else
#undef CONFIG_PCI
#endif
#define PCIBIOS_PCI_FUNCTION_ID 0xb1XX #define PCIBIOS_PCI_FUNCTION_ID 0xb1XX
#define PCIBIOS_PCI_BIOS_PRESENT 0xb101 #define PCIBIOS_PCI_BIOS_PRESENT 0xb101
#define PCIBIOS_FIND_PCI_DEVICE 0xb102 #define PCIBIOS_FIND_PCI_DEVICE 0xb102
......
...@@ -34,12 +34,13 @@ ...@@ -34,12 +34,13 @@
#include <linux/net.h> #include <linux/net.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#endif #endif
#ifdef CONFIG_PCI
#include <pci.h>
#endif
#include <asm/irq.h> #include <asm/irq.h>
extern char floppy_track_buffer[]; extern char floppy_track_buffer[];
extern void set_device_ro(int dev,int flag); extern void set_device_ro(int dev,int flag);
#include <linux/delay.h>
#include <linux/locks.h>
extern void *sys_call_table; extern void *sys_call_table;
...@@ -70,6 +71,18 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */ ...@@ -70,6 +71,18 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */
X(EISA_bus), X(EISA_bus),
X(wp_works_ok), X(wp_works_ok),
#ifdef CONFIG_PCI
/* PCI BIOS support */
X(pcibios_find_class),
X(pcibios_find_device),
X(pcibios_read_config_byte),
X(pcibios_read_config_word),
X(pcibios_read_config_dword),
X(pcibios_write_config_byte),
X(pcibios_write_config_word),
X(pcibios_write_config_dword),
#endif
/* process memory management */ /* process memory management */
X(verify_area), X(verify_area),
X(do_mmap), X(do_mmap),
......
...@@ -444,8 +444,15 @@ static int inet_listen(struct socket *sock, int backlog) ...@@ -444,8 +444,15 @@ static int inet_listen(struct socket *sock, int backlog)
return -EAGAIN; return -EAGAIN;
/* We might as well re use these. */ /* We might as well re use these. */
/*
* note that the backlog is "unsigned char", so truncate it
* somewhere. We might as well truncate it to what everybody
* else does..
*/
if (backlog > 5)
backlog = 5;
sk->max_ack_backlog = backlog; sk->max_ack_backlog = backlog;
if (sk->state != TCP_LISTEN) if (sk->state != TCP_LISTEN)
{ {
sk->ack_backlog = 0; sk->ack_backlog = 0;
sk->state = TCP_LISTEN; sk->state = TCP_LISTEN;
...@@ -656,6 +663,7 @@ static int inet_create(struct socket *sock, int protocol) ...@@ -656,6 +663,7 @@ static int inet_create(struct socket *sock, int protocol)
sk->ip_mc_loop=0; sk->ip_mc_loop=0;
sk->ip_mc_ttl=1; sk->ip_mc_ttl=1;
*sk->ip_mc_name=0; *sk->ip_mc_name=0;
sk->ip_mc_list=NULL;
#endif #endif
sk->state_change = def_callback1; sk->state_change = def_callback1;
......
...@@ -1442,6 +1442,8 @@ int dev_ioctl(unsigned int cmd, void *arg) ...@@ -1442,6 +1442,8 @@ int dev_ioctl(unsigned int cmd, void *arg)
case SIOCSIFMEM: case SIOCSIFMEM:
case SIOCSIFMAP: case SIOCSIFMAP:
case SIOCSIFSLAVE: case SIOCSIFSLAVE:
case SIOCADDMULTI:
case SIOCDELMULTI:
if (!suser()) if (!suser())
return -EPERM; return -EPERM;
return dev_ifsioc(arg, cmd); return dev_ifsioc(arg, cmd);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Alan Cox <Alan.Cox@linux.org> * Alan Cox <Alan.Cox@linux.org>
* *
* WARNING: * WARNING:
* This is a 'prelimary' implementation... on your own head * This is a 'preliminary' implementation... on your own head
* be it. * be it.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Alan Cox <Alan.Cox@linux.org> * Alan Cox <Alan.Cox@linux.org>
* *
* WARNING: * WARNING:
* This is a 'prelimary' implementation... on your own head * This is a 'preliminary' implementation... on your own head
* be it. * be it.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
......
...@@ -876,7 +876,7 @@ static struct sk_buff *ip_glue(struct ipq *qp) ...@@ -876,7 +876,7 @@ static struct sk_buff *ip_glue(struct ipq *qp)
fp = qp->fragments; fp = qp->fragments;
while(fp != NULL) while(fp != NULL)
{ {
if(count+fp->len>skb->len) if(count+fp->len > skb->len)
{ {
printk("Invalid fragment list: Fragment over size.\n"); printk("Invalid fragment list: Fragment over size.\n");
ip_free(qp); ip_free(qp);
...@@ -1610,6 +1610,7 @@ int ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) ...@@ -1610,6 +1610,7 @@ int ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt)
skb=ip_defrag(iph,skb,dev); skb=ip_defrag(iph,skb,dev);
if(skb==NULL) if(skb==NULL)
return 0; return 0;
skb->dev = dev;
iph=skb->h.iph; iph=skb->h.iph;
} }
......
...@@ -214,7 +214,7 @@ int ip_fw_chk(struct iphdr *ip, struct ip_fw *chain) ...@@ -214,7 +214,7 @@ int ip_fw_chk(struct iphdr *ip, struct ip_fw *chain)
} }
/* /*
* At this moment we surely know the protocol of this * At this moment we surely know the protocol of this
* packet and we'll check if it matches,then proceed futher.. * packet and we'll check if it matches,then proceed further..
*/ */
if (proto==frwl_proto) if (proto==frwl_proto)
{ {
...@@ -387,7 +387,7 @@ void ip_acct_cnt(struct iphdr *ip,struct ip_fw *chain,int nh_conv) ...@@ -387,7 +387,7 @@ void ip_acct_cnt(struct iphdr *ip,struct ip_fw *chain,int nh_conv)
} }
/* /*
* At this moment we surely know the protocol of this * At this moment we surely know the protocol of this
* packet and we'll check if it matches,then proceed futher.. * packet and we'll check if it matches,then proceed further..
*/ */
if (proto==frwl_proto) if (proto==frwl_proto)
{ {
...@@ -628,10 +628,7 @@ static int add_to_chain(struct ip_fw **chainptr, struct ip_fw *frwl) ...@@ -628,10 +628,7 @@ static int add_to_chain(struct ip_fw **chainptr, struct ip_fw *frwl)
if (chtmp_prev) if (chtmp_prev)
chtmp_prev->next=ftmp; chtmp_prev->next=ftmp;
else else
{
*chainptr=ftmp; *chainptr=ftmp;
printk("ip_fw: add_to_chain: Can't happen");
}
restore_flags(flags); restore_flags(flags);
return(0); return(0);
} }
...@@ -866,7 +863,7 @@ int ip_fw_ctl(int stage, void *m, int len) ...@@ -866,7 +863,7 @@ int ip_fw_ctl(int stage, void *m, int len)
/* /*
* Here we really working hard-adding new elements * Here we really working hard-adding new elements
* to blocking/forwarding chains or deleting'em * to blocking/forwarding chains or deleting 'em
*/ */
if ( stage == IP_FW_ADD_BLK || stage == IP_FW_ADD_FWD if ( stage == IP_FW_ADD_BLK || stage == IP_FW_ADD_FWD
...@@ -905,3 +902,73 @@ int ip_fw_ctl(int stage, void *m, int len) ...@@ -905,3 +902,73 @@ int ip_fw_ctl(int stage, void *m, int len)
return(EINVAL); return(EINVAL);
} }
#endif /* CONFIG_IP_FIREWALL */ #endif /* CONFIG_IP_FIREWALL */
#if defined(CONFIG_IP_FIREWALL) || defined(CONFIG_IP_ACCT)
static int ip_chain_procinfo(struct ip_fw *chain, char *buffer, char **start, off_t offset, int length)
{
off_t pos=0, begin=0;
struct ip_fw *i;
unsigned long flags;
int len=0;
len=sprintf(buffer,"Firewall Rules\n");
save_flags(flags);
cli();
i=chain;
while(i!=NULL)
{
len+=sprintf(buffer+len,"%08lX/%08lX->%08lX/%08lX %X ",
ntohl(i->src.s_addr),ntohl(i->src_mask.s_addr),
ntohl(i->dst.s_addr),ntohl(i->dst_mask.s_addr),
i->flags);
len+=sprintf(buffer+len,"%u %u %lu %lu ",
i->n_src_p,i->n_dst_p, i->p_cnt,i->b_cnt);
len+=sprintf(buffer+len,"%u %u %u %u %u %u %u %u %u %u\n",
i->ports[0],i->ports[1],i->ports[2],i->ports[3],
i->ports[4],i->ports[5],i->ports[6],i->ports[7],
i->ports[8],i->ports[9]);
pos=begin+len;
if(pos<offset)
{
len=0;
begin=pos;
}
if(pos>offset+length)
break;
i=i->next;
}
restore_flags(flags);
*start=buffer+(offset-begin);
len-=(offset-begin);
if(len>length)
len=length;
return len;
}
#endif
#ifdef CONFIG_IP_ACCT
int ip_acct_procinfo(char *buffer, char **start, off_t offset, int length)
{
return ip_chain_procinfo(ip_acct_chain, buffer,start,offset,length);
}
#endif
#ifdef CONFIG_IP_FIREWALL
int ip_fw_blk_procinfo(char *buffer, char **start, off_t offset, int length)
{
return ip_chain_procinfo(ip_fw_blk_chain, buffer,start,offset,length);
}
int ip_fw_fwd_procinfo(char *buffer, char **start, off_t offset, int length)
{
return ip_chain_procinfo(ip_fw_fwd_chain, buffer,start,offset,length);
}
#endif
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
* Alan Cox : MTU in route table * Alan Cox : MTU in route table
* Alan Cox : MSS actually. Also added the window * Alan Cox : MSS actually. Also added the window
* clamper. * clamper.
* Sam Lantinga : Fixed route matching in rt_del()
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -66,7 +67,7 @@ static struct rtable *rt_loopback = NULL; ...@@ -66,7 +67,7 @@ static struct rtable *rt_loopback = NULL;
* Remove a routing table entry. * Remove a routing table entry.
*/ */
static void rt_del(unsigned long dst) static void rt_del(unsigned long dst, char *devname)
{ {
struct rtable *r, **rp; struct rtable *r, **rp;
unsigned long flags; unsigned long flags;
...@@ -82,7 +83,9 @@ static void rt_del(unsigned long dst) ...@@ -82,7 +83,9 @@ static void rt_del(unsigned long dst)
cli(); cli();
while((r = *rp) != NULL) while((r = *rp) != NULL)
{ {
if (r->rt_dst != dst) /* Make sure both the destination and the device match */
if ( r->rt_dst != dst ||
(devname != NULL && strcmp((r->rt_dev)->name,devname) != 0) )
{ {
rp = &r->rt_next; rp = &r->rt_next;
continue; continue;
...@@ -467,9 +470,19 @@ static int rt_new(struct rtentry *r) ...@@ -467,9 +470,19 @@ static int rt_new(struct rtentry *r)
static int rt_kill(struct rtentry *r) static int rt_kill(struct rtentry *r)
{ {
struct sockaddr_in *trg; struct sockaddr_in *trg;
char *devname;
int err;
trg = (struct sockaddr_in *) &r->rt_dst; trg = (struct sockaddr_in *) &r->rt_dst;
rt_del(trg->sin_addr.s_addr); if ((devname = r->rt_dev) != NULL)
{
err = getname(devname, &devname);
if (err)
return err;
}
rt_del(trg->sin_addr.s_addr, devname);
if ( devname != NULL )
putname(devname);
return 0; return 0;
} }
......
...@@ -563,9 +563,9 @@ int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt, ...@@ -563,9 +563,9 @@ int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
struct sock *sk; struct sock *sk;
struct udphdr *uh; struct udphdr *uh;
unsigned short ulen; unsigned short ulen;
int addr_type=IS_MYADDR; int addr_type = IS_MYADDR;
if(skb->dev->pa_addr!=daddr) if(!dev || dev->pa_addr!=daddr)
addr_type=ip_chk_addr(daddr); addr_type=ip_chk_addr(daddr);
/* /*
...@@ -621,7 +621,7 @@ int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt, ...@@ -621,7 +621,7 @@ int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
else else
skb1=skb; skb1=skb;
if(skb1) if(skb1)
udp_deliver(sk, uh, skb1,skb->dev,saddr,daddr,len); udp_deliver(sk, uh, skb1, dev,saddr,daddr,len);
sk=sknext; sk=sknext;
} }
while(sknext!=NULL); while(sknext!=NULL);
...@@ -648,7 +648,7 @@ int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt, ...@@ -648,7 +648,7 @@ int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
return(0); return(0);
} }
return udp_deliver(sk,uh,skb,skb->dev, saddr, daddr, len); return udp_deliver(sk,uh,skb,dev, saddr, daddr, len);
} }
static int udp_deliver(struct sock *sk, struct udphdr *uh, struct sk_buff *skb, struct device *dev, long saddr, long daddr, int len) static int udp_deliver(struct sock *sk, struct udphdr *uh, struct sk_buff *skb, struct device *dev, long saddr, long daddr, int 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