Commit 16119ae5 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.12

parent b7c2deb6
......@@ -34,7 +34,7 @@ S: 76297 Stutensee
S: Germany
N: Donald Becker
E: becker@super.org
E: becker@cesdis.gsfc.nasa.gov
D: General low-level networking hacker
D: Most of the ethercard drivers
D: Original author of the NFS server
......@@ -107,6 +107,7 @@ S: Bellevue WA 98007
S: USA
N: Alan Cox
E: A.Cox@swansea.ac.uk
E: iiitac@pyr.swan.ac.uk
E: gw4pts@gw4pts.ampr.org
E: GW4PTS@GB7SWN (packet radio)
......@@ -418,6 +419,14 @@ S: Dragonvagen 1 A 13
S: FIN-00330 Helsingfors
S: Finland
N: David C. Niemi
E: David.Niemi@oasis.gtegsc.com
D: FSSTND, The XFree86 Project
D: DMA memory support and future floppy driver
S: 2364 Old Trail Drive
S: Reston, VA 22091
S: USA
N: Kai Petzke
E: wpp@marie.physik.tu-berlin.de
D: Driver for Laser Magnetic Storage CD-ROM
......@@ -451,6 +460,13 @@ N: Robert Sanders
E: gt8134b@prism.gatech.edu
D: Dosemu
N: Hannu Savolainen
E: hannu@voxware.pp.fi
D: Kernel sound drivers
S: Pallaksentie 4 A 2
S: 00970 Helsinki
S: Finland
N: Peter De Schrijver
E: stud11@cc4.kuleuven.ac.be
D: Mitsumi CD-ROM driver patches March version
......
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 11
SUBLEVEL = 12
all: Version zImage
......
......@@ -13,6 +13,19 @@ bool 'Limit memory to low 16MB' CONFIG_MAX_16M n
bool 'System V IPC' CONFIG_SYSVIPC y
bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
if [ "$CONFIG_INET" = "y" ]; then
comment 'Networking options'
comment '(it is safe to leave these untouched)'
comment 'IP (required for now) y'
bool 'Reverse ARP' CONFIG_INET_RARP y
bool 'Assume subnets are local' CONFIG_INET_SNARL y
bool 'Disable NAGLE algorithm (normally enabled)' CONFIG_TCP_NAGLE_OFF n
#bool 'Novell IPX protocol' CONFIG_IPX n
#bool 'Amateur Radio AX.25 Level 2' CONFIG_AX25 n
fi
comment 'Program binary formats'
bool 'Elf executables' CONFIG_BINFMT_ELF y
......
......@@ -21,6 +21,7 @@
* Michael Riepe : Automatic CSLIP recognition added
* Charles Hedrick : CSLIP header length problem fix.
* Alan Cox : Corrected non-IP cases of the above.
* Alan Cox : Now uses hardware type as per FvK.
*
*
* FIXME: This driver still makes some IP'ish assumptions. It should build cleanly KISS TNC only without
......@@ -56,6 +57,7 @@
#include "tcp.h"
#endif
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include "sock.h"
#include "slip.h"
#ifdef CONFIG_INET
......@@ -169,6 +171,7 @@ sl_initialize(struct slip *sl, struct device *dev)
dev->rmem_start = (unsigned long) NULL;
dev->mem_end = (unsigned long) NULL;
dev->mem_start = (unsigned long) NULL;
dev->type = ARPHRD_SLIP + sl->mode;
}
......@@ -1072,15 +1075,14 @@ slip_ioctl(struct tty_struct *tty, void *file, int cmd, void *arg)
{
sl->dev->addr_len=7; /* sizeof an AX.25 addr */
sl->dev->hard_header_len=17; /* We don't do digipeaters */
sl->dev->type=3; /* AF_AX25 not an AF_INET device */
}
else
{
sl->dev->addr_len=0; /* No mac addr in slip mode */
sl->dev->hard_header_len=0;
sl->dev->type=0;
}
#endif
sl->dev->type=ARPHRD_SLIP+sl->mode;
return(0);
case SIOCSIFHWADDR:
#ifdef CONFIG_AX25
......
This file contains brief information about the SCSI tape driver.
Last modified: Thu May 5 00:13:24 1994 by root@kai.home
BASICS
The driver is generic. The state of a drive is not modified when the
driver is initalized or a device is opened. The mode parameters of the
drive can be modified with ioctls. The driver supports fixed and
variable block size (within buffer limits). Both the auto-rewind
(minor equals device number) and non-rewind devices (minor is 128 +
device number) are implemented.
BUFFERING
The driver uses a buffer allocated at system initialization. The size
of the buffer is selectable at compile and/or boot time. The buffer is
used to store the data being transferred to/from the SCSI adapter. The
following buffering options are selectable at compile time and/or at run
time (via ioctl):
Buffering of data to be written across write calls for fixed block
mode (define ST_BUFFER_WRITES). This should be disabled if reliable
detection of end of media (EOM) for fixed block mode is desired.
Asynchronous writing. Writing the buffer contents to the tape is
started and the write call returns immediately. The status is checked
at the next tape operation. Should not used if reliable EOM detection
is desired.
Read ahead for fixed block mode (ST_READ_AHEAD). Filling the buffer is
attempted even if the user does not want to get all of the data at
this read command. Should be disabled for those drives that don't like
a filemark to truncate a read request or that don't like backspacing.
The buffer size is defined (in 1024 byte units) by ST_BUFFER_BLOCKS or
at boot time. The maximum number of buffers allocated is defined by
ST_MAX_BUFFERS. One buffer is allocated for each detected drive up to
the maximum. The threshold for triggering asynchronous write is
defined by ST_WRITE_THRESHOLD.
BOOT TIME CONFIGURATION
The buffer size, write threshold, and the maximum number of allocated buffers
are configurable at boot time using, e.g., the LILO command line. The option
syntax is the following:
st=aa[,bb[,cc]]
where
aa is the buffer size in 1024 byte units
bb is the write threshold in 1024 byte units
cc is the maximum number of tape buffers to allocate (the number of
buffers is bounded also by the number of drives detected)
IOCTLS
The tape is positioned and the drive parameters are set with ioctls
defined in mtio.h The tape control program 'mt' uses these ioctls. Try
to find an mt that supports all of the Linux SCSI tape ioctls and
opens the device for writing if the tape contents will be modified
(look for a package mt-st* from the Linux ftp sites; the GNU mt does
not open for writing for, e.g., erase).
The supported ioctls are:
The following use the structure mtop:
MTFSF Space forward over count filemarks. Tape positioned after filemark.
MTFSFM As above but tape positioned before filemark.
MTBSF Space backward over count filemarks. Tape positioned before
filemark.
MTBSFM As above but ape positioned after filemark.
MTFSR Space forward over count records.
MTBSR Space backward over count records.
MTWEOF Write count filemarks.
MTREW Rewind tape.
MTOFFL Set device off line (often rewind plus eject).
MTNOP Do nothing.
MTRETEN Retension tape.
MTEOM Space to end of recorded data.
MTERASE Erase tape.
MTSEEK Seek to tape block count. Uses Tandberg-compatible seek (QFA)
for SCSI-1 drives and SCSI-2 seek for SCSI-2 drives.
MTSETBLK Set the drive block size. Setting to zero sets the drive into
variable block mode (if applicable).
MTSETDENSITY Sets the drive density code to arg. See drive
documentation for available codes.
MTSETDRVBUFFER
Is used for several things. The command is obtained from count
with mask MT_SET_OPTIONS, the low order bits are used as argument.
The subcommands are:
0
The drive buffer option is set to the argument. Zero means
no buffering.
MT_ST_BOOLEANS
Sets the buffering options. The bits are the new states
(enabled/disabled) of the write buffering (MT_ST_BUFFER_WRITES),
asynchronous writes (MT_ST_ASYNC_WRITES), read ahead
(MT_ST_READ_AHEAD) and debugging (MT_ST_DEBUGGING;
(debugging must be compiled into the driver).
MT_ST_WRITE_THRESHOLD
Sets the write threshold for this device to kilobytes
specified by the lowest bits.
The following ioctl uses the structure mtpos:
MTIOCPOS Reads the current position from the drive. Uses
Tandberg-compatible QFA for SCSI-1 drives and the SCSI-2
command for the SCSI-2 drives.
The following ioctl uses the structure mtget to return the status:
MTIOCGET Returns some status information.
The file number and block number within file are returned. The
block is -1 when it can't be determined (e.g., after MTBSF).
The drive type is either MTISSCSI1 or MTISSCSI2.
The number of recovered errors since the previous status call
is stored in the lower word of the field mt_erreg.
The current block size and the density code are stored in the field
mt_dsreg (shifts for the subfields are MT_ST_BLKSIZE_SHIFT and
MT_ST_DENSITY_SHIFT).
The other fields are empty.
MISCELLANEOUS COMPILE OPTIONS
The recovered write errors are considered fatal if ST_RECOVERED_WRITE_FATAL
is defined.
Immediate return from tape positioning SCSI commands can be enabled by
defining ST_NOWAIT.
When using read ahead or buffered writes the position within the file
may not be correct after the file is closed (correct position may
require backspacing over more than one record). The correct position
within file can be obtained if ST_IN_FILE_POS is defined. (The
driver always backs over a filemark crossed by read ahead if the user
does not request data that far.)
Kai M{kisara
This diff is collapsed.
......@@ -11,7 +11,6 @@
typedef struct {
int in_use;
struct mtget * mt_status;
int buffer_size;
int buffer_blocks;
int buffer_bytes;
......@@ -33,12 +32,18 @@ typedef struct {
unsigned in_use:1;
unsigned eof_hit:1;
unsigned drv_buffer:3;
unsigned do_buffer_writes:1;
unsigned do_async_writes:1;
unsigned do_read_ahead:1;
unsigned char density;
ST_buffer * buffer;
int block_size;
int min_block;
int max_block;
int write_threshold;
int recover_count;
int drv_block; /* The block where the drive head is */
struct mtget * mt_status;
Scsi_Cmnd SCpnt;
} Scsi_Tape;
......
This diff is collapsed.
......@@ -4,169 +4,14 @@
*
* Header file for the WD-7000 driver for Linux
*
* $Log: $
* Revision 1.1 1992/07/24 06:27:38 root
* Initial revision
*
* Revision 1.1 1992/07/05 08:32:32 root
* Initial revision
*
* Revision 1.1 1992/05/15 18:38:05 root
* Initial revision
*
* Revision 1.1 1992/04/02 03:23:13 drew
* Initial revision
*
* Revision 1.3 1992/01/27 14:46:29 tthorn
* *** empty log message ***
* John Boyd <boyd@cis.ohio-state.edu> Jan 1994:
* This file has been reduced to only the definitions needed for the
* WD7000 host structure.
*
*/
#include <linux/types.h>
#undef STATMASK
#undef CONTROL
#define IO_BASE 0x350
#define IRQ_LVL 15
#define DMA_CH 6
#define OGMB_CNT 8
#define ICMB_CNT 16
/* I/O Port interface 4.2 */
/* READ */
#define ASC_STAT IO_BASE
#define INT_IM 0x80 /* Interrupt Image Flag */
#define CMD_RDY 0x40 /* Command Port Ready */
#define CMD_REJ 0x20 /* Command Port Byte Rejected */
#define ASC_INI 0x10 /* ASC Initialized Flag */
#define STATMASK 0xf0 /* The lower 4 Bytes are reserved */
/* This register serves two purposes
* Diagnostics error code
* Interrupt Status
*/
#define INTR_STAT ASC_STAT+1
#define ANYINTR 0x80 /* Mailbox Service possible/required */
#define IMB 0x40 /* 1 Incoming / 0 Outgoing */
#define MBMASK 0x3f
/* if MSb is zero, the lower bits are diagnostic status *
* Diagnostics:
* 01 No diagnostic error occurred
* 02 RAM failure
* 03 FIFO R/W failed
* 04 SBIC register read/write failed
* 05 Initialization D-FF failed
* 06 Host IRQ D-FF failed
* 07 ROM checksum error
* Interrupt status (bitwise):
* 10NNNNNN outgoing mailbox NNNNNN is free
* 11NNNNNN incoming mailbox NNNNNN needs service
*/
/* WRITE */
#define COMMAND ASC_STAT
/*
* COMMAND opcodes
*/
#define NO_OP 0
#define INITIALIZATION 1 /* initialization after reset (10 bytes) */
#define DISABLE_UNS_INTR 2 /* disable unsolicited interrupts */
#define ENABLE_UNS_INTR 3 /* enable unsolicited interrupts */
#define INTR_ON_FREE_OGMB 4 /* interrupt on free OGMB */
#define SCSI_SOFT_RESET 5 /* SCSI soft reset */
#define SCSI_HARD_RESET 6 /* SCSI hard reset acknowledge */
#define START_OGMB 0x80 /* start command in OGMB (n) */
#define SCAN_OGMBS 0xc0 /* start multiple commands, signature (n) */
/* where (n) = lower 6 bits */
/*
* For INITIALIZATION:
*/
#define BUS_ON 48 /* x 125ns, 48 = 6000ns, BIOS uses 8000ns */
#define BUS_OFF 24 /* x 125ns, 24 = 3000ns, BIOS uses 1875ns */
#define INTR_ACK ASC_STAT+1
#define CONTROL ASC_STAT+2
#define INT_EN 0x08 /* Interrupt Enable */
#define DMA_EN 0x04 /* DMA Enable */
#define SCSI_RES 0x02 /* SCSI Reset */
#define ASC_RES 0x01 /* ASC Reset */
/* Mailbox Definition */
struct wd_mailbox{
unchar status;
unchar scbptr[3];
};
/* These belong in scsi.h also */
#undef any2scsi
#define any2scsi(up, p) \
(up)[0] = (((long)(p)) >> 16); \
(up)[1] = ((long)(p)) >> 8; \
(up)[2] = ((long)(p));
#define scsi2int(up) ( (((long)*(up)) << 16) + (((long)(up)[1]) << 8) + ((long)(up)[2]) )
#define xany2scsi(up, p) \
(up)[0] = ((long)(p)) >> 24; \
(up)[1] = ((long)(p)) >> 16; \
(up)[2] = ((long)(p)) >> 8; \
(up)[3] = ((long)(p));
#define xscsi2int(up) ( (((long)(up)[0]) << 24) + (((long)(up)[1]) << 16) \
+ (((long)(up)[2]) << 8) + ((long)(up)[3]) )
#define MAX_CDB 12
#define MAX_SENSE 14
typedef struct scb { /* Command Control Block 5.4.1 */
unchar op; /* Command Control Block Operation Code */
unchar idlun; /* op=0,2:Target Id, op=1:Initiator Id */
/* Outbound data transfer, length is checked*/
/* Inbound data transfer, length is checked */
/* Logical Unit Number */
unchar cdb[12]; /* SCSI Command Block */
unchar status; /* SCSI Return Status */
unchar vue; /* Vendor Unique Error Code */
unchar maxlen[3]; /* Maximum Data Transfer Length */
unchar dataptr[3]; /* SCSI Data Block Pointer */
unchar linkptr[3]; /* Next Command Link Pointer */
unchar direc; /* Transfer Direction */
unchar reserved2[6]; /* SCSI Command Descriptor Block */
/* end of hardware SCB */
Scsi_Cmnd *SCpnt; /* Scsi_Cmnd using this SCB */
struct scb *next; /* for lists of scbs */
} Scb;
/*
* WD7000-specific scatter/gather element structure
*/
typedef struct sgb {
unchar len[3];
unchar ptr[3];
} Sgb;
/*
* Note: MAX_SCBS _must_ be defined large enough to keep ahead of the
* demand for SCBs, which will be at most WD7000_Q * WD7000_SG. 1 is
* added to each because they can be 0.
*/
#define MAX_SCBS ((WD7000_Q+1) * (WD7000_SG+1))
/*
* The driver is written to allow host-only commands to be executed. These
* use a 16-byte block called an ICB.
*
* (Currently, only wd7000_info uses this, to get the firmware rev. level.)
*/
#define ICB_STATUS 16 /* set to icmb status by wd7000_intr_handle */
#define ICB_PHASE 17 /* set to 0 by wd7000_intr_handle */
#define ICB_LEN 18 /* actually 16; this includes the above */
int wd7000_detect(int);
int wd7000_command(Scsi_Cmnd *);
int wd7000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
......@@ -176,30 +21,32 @@ int wd7000_reset(Scsi_Cmnd *);
int wd7000_biosparam(int, int, int*);
#ifndef NULL
#define NULL 0
#define NULL 0L
#endif
/*
* Define WD7000_SG to be the number of Sgbs that will fit in a block of
* size WD7000_SCRIBBLE. WD7000_SCRIBBLE must be 512, 1024, 2048, or 4096.
* In this version, sg_tablesize now defaults to WD7000_SG, and will
* be set to SG_NONE for older boards. This is the reverse of the
* previous default, and was changed so that the driver-level
* Scsi_Host_Template would reflect the driver's support for scatter/
* gather.
*
* The sg_tablesize value will default to SG_NONE for older boards (before
* rev 7.0), but will be changed to WD7000_SG when a newer board is
* detected.
* Also, it has been reported that boards at Revision 6 support scatter/
* gather, so the new definition of an "older" board has been changed
* accordingly.
*/
#define WD7000_SCRIBBLE 512
#define WD7000_Q OGMB_CNT
#define WD7000_SG (WD7000_SCRIBBLE / sizeof(Sgb))
#define WD7000_Q 16
#define WD7000_SG 16
#define WD7000 {\
"Western Digital WD-7000", \
wd7000_detect, \
wd7000_info, wd7000_command, \
wd7000_info, \
wd7000_command, \
wd7000_queuecommand, \
wd7000_abort, \
wd7000_reset, \
NULL, \
wd7000_biosparam, \
WD7000_Q, 7, SG_NONE, 1, 0, 1}
WD7000_Q, 7, WD7000_SG, 1, 0, 1}
#endif
......@@ -49,7 +49,7 @@ extern int check_mcd_media_change(int, int);
static char buffersize_index[9] = {-1, 0, 1, -1, 2, -1, -1, -1, 3};
static short int bufferindex_size[NR_SIZES] = {512, 1024, 2048, 4096};
#define BUFSIZE_INDEX(X) (buffersize_index[(X)>>9])
#define BUFSIZE_INDEX(X) ((int) buffersize_index[(X)>>9])
static int grow_buffers(int pri, int size);
static int shrink_specific_buffers(unsigned int priority, int size);
......
......@@ -44,6 +44,7 @@ extern int tcp_get_info(char *, char **, off_t, int);
extern int udp_get_info(char *, char **, off_t, int);
extern int raw_get_info(char *, char **, off_t, int);
extern int arp_get_info(char *, char **, off_t, int);
extern int rarp_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);
#endif /* CONFIG_INET */
......@@ -96,11 +97,14 @@ static struct proc_dir_entry net_dir[] = {
{ 131,3,"dev" },
{ 132,3,"raw" },
{ 133,3,"tcp" },
{ 134,3,"udp" }
{ 134,3,"udp" },
#ifdef CONFIG_INET_RARP
{ 135,4,"rarp"}
#endif
#endif /* CONFIG_INET */
#ifdef CONFIG_IPX
,{ 135,9,"ipx_route" },
{ 136,3,"ipx" }
,{ 136,9,"ipx_route" },
{ 137,3,"ipx" }
#endif /* CONFIG_IPX */
};
......@@ -212,12 +216,15 @@ static int proc_readnet(struct inode * inode, struct file * file,
case 134:
length = udp_get_info(page,&start,file->f_pos,thistime);
break;
case 135:
length = rarp_get_info(page,&start,file->f_pos,thistime);
break;
#endif /* CONFIG_INET */
#ifdef CONFIG_IPX
case 135:
case 136:
length = ipx_rt_get_info(page,&start,file->f_pos,thistime);
break;
case 136:
case 137:
length = ipx_get_info(page,&start,file->f_pos,thistime);
break;
#endif /* CONFIG_IPX */
......
......@@ -30,6 +30,13 @@
#define ARPHRD_IEEE802 6 /* IEEE 802.2 Ethernet- huh? */
#define ARPHRD_ARCNET 7 /* ARCnet */
#define ARPHRD_APPLETLK 8 /* APPLEtalk */
/* Dummy types for non ARP hardware */
#define ARPHRD_SLIP 256
#define ARPHRD_CSLIP 257
#define ARPHRD_SLIP6 258
#define ARPHRD_CSLIP6 259
#define ARPHRD_KISS 260
#define ARPHRD_ADAPT 264
/* ARP protocol opcodes. */
#define ARPOP_REQUEST 1 /* ARP request */
......
/*
* Swansea University Computer Society NET3
*
* This file declares the constants of special use with the SLIP/CSLIP/
* KISS TNC driver.
*/
#ifndef __LINUX_SLIP_H
#define __LINUX_SLIP_H
#define SL_MODE_SLIP 0
#define SL_MODE_CSLIP 1
#define SL_MODE_KISS 4
#define SL_OPT_SIXBIT 2
#define SL_OPT_ADAPTIVE 8
#endif
......@@ -32,8 +32,17 @@ struct timestamp {
unsigned char len;
unsigned char ptr;
union {
#if defined(__i386__)
unsigned char flags:4,
overflow:4;
#else
#if defined(__mc680x0__)
unsigned char overflow:4,
flags:4;
#else
#error "Adjust this structure to match your CPU"
#endif
#endif
unsigned char full_char;
} x;
unsigned long data[9];
......@@ -63,8 +72,17 @@ struct options {
struct iphdr {
#if defined(__i386__)
unsigned char ihl:4,
version:4;
#else
#if defined (__mc680x0__)
unsigned char version:4,
ihl:4;
#else
#error "Adjust this structure to match your CPU"
#endif
#endif
unsigned char tos;
unsigned short tot_len;
unsigned short id;
......
......@@ -88,6 +88,7 @@ struct mtget {
#define MT_ISDDS1 0x51 /* DDS device without partitions */
#define MT_ISDDS2 0x52 /* DDS device with partitions */
#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit */
#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit */
struct mt_tape_info {
long t_type; /* device type id (mt_type) */
......@@ -106,6 +107,7 @@ struct mt_tape_info {
{MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"}, \
{MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \
{MT_ISSCSI1, "Generic SCSI-1 tape"}, \
{MT_ISSCSI2, "Generic SCSI-2 tape"}, \
{0, NULL} \
}
......@@ -152,5 +154,22 @@ struct mtpos {
* I think DDS drives are DAT drives.
*/
/* SCSI-tape specific definitions */
#define MT_ST_BLKSIZE_SHIFT 0
#define MT_ST_BLKSIZE_MASK 0xffffff
#define MT_ST_DENSITY_SHIFT 24
#define MT_ST_DENSITY_MASK 0xff000000
#define MT_ST_SOFTERR_SHIFT 0
#define MT_ST_SOFTERR_MASK 0xffff
#define MT_ST_OPTIONS 0xf0000000
#define MT_ST_BOOLEANS 0x10000000
#define MT_ST_WRITE_THRESHOLD 0x20000000
#define MT_ST_BUFFER_WRITES 0x1
#define MT_ST_ASYNC_WRITES 0x2
#define MT_ST_READ_AHEAD 0x4
#define MT_ST_DEBUGGING 0x8
#endif /* _LINUX_MTIO_H */
......@@ -11,6 +11,7 @@
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Corey Minyard <wf-rch!minyard@relay.EU.net>
* Donald J. Becker, <becker@super.org>
* Alan Cox, <A.Cox@swansea.ac.uk>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -34,7 +35,7 @@
#define IS_MYADDR 1 /* address is (one of) our own */
#define IS_LOOPBACK 2 /* address is for LOOPBACK */
#define IS_BROADCAST 3 /* address is a valid broadcast */
#define IS_INVBCAST 4 /* Wrong netmask bcast not for us */
#define IS_INVBCAST 4 /* Wrong netmask bcast not for us (unused)*/
/*
* The DEVICE structure.
......@@ -52,7 +53,7 @@ struct device
*/
char *name;
/* I/O specific fields. These will be moved to DDI soon. */
/* I/O specific fields. */
unsigned long rmem_end; /* shmem "recv" end */
unsigned long rmem_start; /* shmem "recv" start */
unsigned long mem_end; /* sahared mem end */
......@@ -65,12 +66,6 @@ struct device
tbusy, /* transmitter busy */
interrupt; /* interrupt arrived */
/*
* Another mistake.
* This points to the next device in the "dev" chain. It will
* be moved to the "invisible" part of the structure as soon as
* it has been cleaned up. -FvK
*/
struct device *next;
/* The device initialization function. Called only once. */
......@@ -135,6 +130,8 @@ struct device
int num_addrs, void *addrs);
#define HAVE_SET_MAC_ADDR
int (*set_mac_address)(struct device *dev, void *addr);
#define HAVE_PRIVATE_IOCTL
int (*do_ioctl)(struct device *dev, struct ifreq *ifr);
};
......
......@@ -67,4 +67,21 @@
#define SIOCGARP 0x8951 /* get ARP table entry */
#define SIOCSARP 0x8952 /* set ARP table entry */
/* RARP cache control calls. */
#define SIOCDRARP 0x8960 /* delete RARP table entry */
#define SIOCGRARP 0x8961 /* get RARP table entry */
#define SIOCSRARP 0x8962 /* set RARP table entry */
/* Device private ioctl calls */
/*
* These 16 ioctls are available to devices via the do_ioctl() device
* vector. Each device should include this file and redefine these names
* as their own. Because these are device dependant it is a good idea
* _NOT_ to issue them to random objects and hope.
*/
#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
#endif /* _LINUX_SOCKIOS_H */
......@@ -26,6 +26,7 @@ struct tcphdr {
unsigned short dest;
unsigned long seq;
unsigned long ack_seq;
#if defined(__i386__)
unsigned short res1:4,
doff:4,
fin:1,
......@@ -35,6 +36,21 @@ struct tcphdr {
ack:1,
urg:1,
res2:2;
#else
#if defined(__mc680x0__)
unsigned short res2:2,
urg:1,
ack:1,
psh:1,
rst:1,
syn:1,
fin:1,
doff:4,
res1:4;
#else
#error "Adjust this structure for your cpu alignment rules"
#endif
#endif
unsigned short window;
unsigned short check;
unsigned short urg_ptr;
......@@ -45,17 +61,14 @@ enum {
TCP_ESTABLISHED = 1,
TCP_SYN_SENT,
TCP_SYN_RECV,
#if 0
TCP_CLOSING, /* not a valid state, just a seperator so we can use
< tcp_closing or > tcp_closing for checks. */
#endif
TCP_FIN_WAIT1,
TCP_FIN_WAIT2,
TCP_TIME_WAIT,
TCP_CLOSE,
TCP_CLOSE_WAIT,
TCP_LAST_ACK,
TCP_LISTEN
TCP_LISTEN,
TCP_CLOSING /* now a valid state */
};
#endif /* _LINUX_TCP_H */
......@@ -84,6 +84,7 @@ 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 mcd_setup(char *str, int *ints);
extern void st_setup(char *str, int *ints);
extern void st0x_setup(char *str, int *ints);
extern void tmc8xx_setup(char *str, int *ints);
extern void t128_setup(char *str, int *ints);
......@@ -176,6 +177,9 @@ struct {
#ifdef CONFIG_BLK_DEV_HD
{ "hd=", hd_setup },
#endif
#ifdef CONFIG_CHR_DEV_ST
{ "st=", st_setup },
#endif
#ifdef CONFIG_BUSMOUSE
{ "bmouse=", bmouse_setup },
#endif
......
......@@ -227,7 +227,7 @@ asmlinkage int sys_setregid(gid_t rgid, gid_t egid)
}
}
if (rgid != (gid_t) -1 ||
egid != (gid_t) -1 && egid != old_rgid)
(egid != (gid_t) -1 && egid != old_rgid))
current->sgid = current->egid;
return 0;
}
......@@ -314,7 +314,7 @@ asmlinkage int sys_setreuid(uid_t ruid, uid_t euid)
}
}
if (ruid != (uid_t) -1 ||
euid != (uid_t) -1 && euid != old_ruid)
(euid != (uid_t) -1 && euid != old_ruid))
current->suid = current->euid;
return 0;
}
......
......@@ -31,8 +31,8 @@
/*
* 8- and 16-bit register defines..
*/
#define AL(regs) (((unsigned char *) ((regs)->eax))[0])
#define AH(regs) (((unsigned char *) ((regs)->eax))[1])
#define AL(regs) (((unsigned char *)&((regs)->eax))[0])
#define AH(regs) (((unsigned char *)&((regs)->eax))[1])
#define IP(regs) (*(unsigned short *)&((regs)->eip))
#define SP(regs) (*(unsigned short *)&((regs)->esp))
......@@ -289,9 +289,8 @@ static void do_int(struct vm86_regs *regs, int i, unsigned char * ssp, unsigned
if (seg == BIOSSEG || regs->cs == BIOSSEG ||
is_revectored(i, &current->vm86_info->int_revectored))
return_to_32bit(regs, VM86_INTx + (i << 8));
if (i==0x21 && is_revectored(AH(regs),&current->vm86_info->int21_revectored)) {
if (i==0x21 && is_revectored(AH(regs),&current->vm86_info->int21_revectored))
return_to_32bit(regs, VM86_INTx + (i << 8));
}
pushw(ssp, sp, get_vflags(regs));
pushw(ssp, sp, regs->cs);
pushw(ssp, sp, IP(regs));
......@@ -305,7 +304,15 @@ static void do_int(struct vm86_regs *regs, int i, unsigned char * ssp, unsigned
void handle_vm86_debug(struct vm86_regs * regs, long error_code)
{
do_int(regs, 3, (unsigned char *) (regs->ss << 4), SP(regs));
#if 0
do_int(regs, 1, (unsigned char *) (regs->ss << 4), SP(regs));
#else
if (current->flags & PF_PTRACED)
current->blocked &= ~(1 << (SIGTRAP-1));
send_sig(SIGTRAP, current, 1);
current->tss.trap_no = 1;
current->tss.error_code = error_code;
#endif
}
void handle_vm86_fault(struct vm86_regs * regs, long error_code)
......
This diff is collapsed.
......@@ -10,5 +10,8 @@ extern int arp_find(unsigned char *haddr, unsigned long paddr,
struct device *dev, unsigned long saddr, struct sk_buff *skb);
extern int arp_get_info(char *buffer, char **start, off_t origin, int length);
extern int arp_ioctl(unsigned int cmd, void *arg);
extern void arp_send(int type, int ptype, unsigned long dest_ip,
struct device *dev, unsigned long src_ip,
unsigned char *dest_hw, unsigned char *src_hw);
#endif /* _ARP_H */
......@@ -1273,7 +1273,7 @@ static struct sk_buff *ip_defrag(struct iphdr *iph, struct sk_buff *skb, struct
* Set up data on packet
*/
skb2->arp = skb->arp;
skb2->arp = 0;/*skb->arp;*/
skb2->free = skb->free;
skb2->len = len + hlen;
skb2->h.raw=(char *) skb2->data;
......@@ -1549,7 +1549,7 @@ int ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt)
ip_statistics.IpInReceives++;
DPRINTF((DBG_IP, "<<\n"));
/*
* Tag the ip header of this packet so we can find it
*/
......
This diff is collapsed.
/* linux/net/inet/rarp.h */
#ifndef _RARP_H
#define _RARP_H
extern int rarp_ioctl(unsigned int cmd, void *arg);
extern int rarp_rcv(struct sk_buff *skb,
struct device *dev,
struct packet_type *pt);
extern int rarp_get_info(char *buffer,
char **start,
off_t offset,
int length);
#endif /* _RARP_H */
......@@ -52,6 +52,7 @@
* Alan Cox : Split socket option code
* Alan Cox : Callbacks
* Alan Cox : Nagle flag for Charles & Johannes stuff
* Alex : Removed restriction on inet fioctl
*
* To Fix:
*
......@@ -86,6 +87,7 @@
#include "ip.h"
#include "protocol.h"
#include "arp.h"
#include "rarp.h"
#include "route.h"
#include "tcp.h"
#include "udp.h"
......@@ -1482,6 +1484,11 @@ inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
case SIOCSARP:
return(arp_ioctl(cmd,(void *) arg));
case SIOCDRARP:
case SIOCGRARP:
case SIOCSRARP:
return(rarp_ioctl(cmd,(void *) arg));
case SIOCGIFCONF:
case SIOCGIFFLAGS:
case SIOCSIFFLAGS:
......@@ -1701,7 +1708,6 @@ inet_fioctl(struct inode *inode, struct file *file,
/* Extract the minor number on which we work. */
minor = MINOR(inode->i_rdev);
if (minor != 0) return(-ENODEV);
/* Now dispatch on the minor device. */
switch(minor) {
......@@ -1780,7 +1786,7 @@ void inet_proto_init(struct ddi_proto *pro)
struct inet_protocol *p;
int i;
printk("Swansea University Computer Society NET3.010\n");
printk("Swansea University Computer Society NET3.012\n");
/*
* Set up our UNIX VFS major device. (compatibility)
*/
......
This diff is collapsed.
......@@ -195,7 +195,7 @@ net_timer (unsigned long data)
DPRINTF ((DBG_TMR, "timer.c TIME_WRITE time-out 2\n"));
sk->err = ETIMEDOUT;
if (sk->state == TCP_FIN_WAIT1 || sk->state == TCP_FIN_WAIT2
|| sk->state == TCP_LAST_ACK) {
|| sk->state == TCP_CLOSING) {
sk->state = TCP_TIME_WAIT;
reset_timer (sk, TIME_CLOSE, TCP_TIMEWAIT_LEN);
} else {
......
......@@ -36,6 +36,7 @@
* Alan Cox : Use ip_tos and ip_ttl
* Alan Cox : SNMP Mibs
* Alan Cox : MSG_DONTROUTE, and 0.0.0.0 support.
* Matt Dillon : UDP length checks.
*
*
* This program is free software; you can redistribute it and/or
......@@ -653,7 +654,8 @@ int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
{
struct sock *sk;
struct udphdr *uh;
unsigned short ulen;
/*
* Get the header.
*/
......@@ -661,7 +663,22 @@ int udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt,
ip_statistics.IpInDelivers++;
/*
* Validate the packet and the UDP length.
*/
ulen = ntohs(uh->len);
if (ulen > len || len < sizeof(*uh) || ulen < sizeof(*uh))
{
printk("UDP: short packet: %d/%d\n", ulen, len);
DPRINTF((DBG_UDP, "UDP: short packet %d/%d\n", ulen, len));
udp_statistics.UdpInErrors++;
kfree_skb(skb, FREE_WRITE);
return(0);
}
len=ulen;
sk = get_sock(&udp_prot, uh->dest, saddr, uh->source, daddr);
if (sk == NULL)
{
......
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