Commit 466add5a authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.21

parent 50198be8
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 20
SUBLEVEL = 21
all: Version zImage
......
......@@ -102,6 +102,7 @@ bool 'DEPCA support' CONFIG_DEPCA n
#bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n
#bool 'Cabletron E21xx support (not recommended)' CONFIG_E2100 n
bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 n
bool 'D-Link DE620 pocket adaptor support' CONFIG_DE620 n
bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP n
fi
fi
......
......@@ -655,6 +655,8 @@ static void hd_geninit(void)
hd_info[drive].ctl = *(8+BIOS);
hd_info[drive].lzone = *(unsigned short *) (12+BIOS);
hd_info[drive].sect = *(14+BIOS);
if (hd_info[drive].cyl && NR_HD == drive)
NR_HD++;
BIOS += 16;
}
......
......@@ -956,7 +956,8 @@ static int normal_select(struct tty_struct * tty, struct inode * inode,
{
switch (sel_type) {
case SEL_IN:
if (input_available_p(tty, MIN_CHAR(tty)))
if (input_available_p(tty, TIME_CHAR(tty) ? 0 :
MIN_CHAR(tty)))
return 1;
/* fall through */
case SEL_EX:
......
......@@ -133,7 +133,7 @@ static int pty_chars_in_buffer(struct tty_struct *tty)
{
struct tty_struct *to = tty->link;
if (!to)
if (!to || !to->ldisc.chars_in_buffer)
return 0;
return to->ldisc.chars_in_buffer(to);
......
......@@ -871,8 +871,13 @@ static int startup(struct async_struct * info)
* here.
*/
if (serial_inp(info, UART_LSR) == 0xff) {
restore_flags(flags);
return -ENODEV;
restore_flags(flags);
if (suser()) {
if (info->tty)
set_bit(TTY_IO_ERROR, &info->tty->flags);
return 0;
} else
return -ENODEV;
}
/*
......@@ -892,7 +897,13 @@ static int startup(struct async_struct * info)
retval = irqaction(info->irq,&sa);
if (retval) {
restore_flags(flags);
return retval;
if (suser()) {
if (info->tty)
set_bit(TTY_IO_ERROR,
&info->tty->flags);
return 0;
} else
return retval;
}
}
......@@ -1410,10 +1421,13 @@ static int set_serial_info(struct async_struct * info,
}
/* Make sure address is not already in use */
for (i = 0 ; i < NR_PORTS; i++)
if ((info != &rs_table[i]) &&
(rs_table[i].port == new_serial.port) && rs_table[i].type)
return -EADDRINUSE;
if (new_serial.type) {
for (i = 0 ; i < NR_PORTS; i++)
if ((info != &rs_table[i]) &&
(rs_table[i].port == new_serial.port) &&
rs_table[i].type)
return -EADDRINUSE;
}
if ((change_port || change_irq) && (info->count > 1))
return -EBUSY;
......
......@@ -30,6 +30,10 @@
# DE600_IO The DE600 I/O-port address (0x378 == default)
# DE600_IRQ The DE600 IRQ number to use (IRQ7 == default)
# DE600_DEBUG Enable or disable DE600 debugging (default off)
# DE620 The D-Link DE-600 Portable Ethernet Adaptor.
# DE620_IO The DE620 I/O-port address (0x378 == default)
# DE620_IRQ The DE620 IRQ number to use (IRQ7 == default)
# DE620_DEBUG Enable or disable DE600 debugging (default off)
# DEPCA The DIGITAL series of AT Ethernet Cards (DE100, DE200)
# DEPCA_IRQ Set the desired IRQ (=0, for autoprobe)
# DEPCA_DEBUG Set the desired debug level
......
MODULES = \
3c509.o \
de600.o \
de620.o \
3c501.o \
plip.o
......
......@@ -91,6 +91,15 @@ endif
ifdef CONFIG_DE600
NETDRV_OBJS := $(NETDRV_OBJS) net.a(de600.o)
endif
de600.o: de600.c CONFIG
$(CC) $(CPPFLAGS) $(CFLAGS) $(DE600_OPTS) -c $<
ifdef CONFIG_DE620
NETDRV_OBJS := $(NETDRV_OBJS) net.a(de620.o)
endif
de620.o: de620.c CONFIG
$(CC) $(CPPFLAGS) $(CFLAGS) $(DE620_OPTS) -c $<
ifdef CONFIG_AT1500
NETDRV_OBJS := $(NETDRV_OBJS) net.a(lance.o)
endif
......
This diff is collapsed.
......@@ -57,6 +57,7 @@ extern int e2100_probe(struct device *);
/* Detachable devices ("pocket adaptors" and special PCMCIA drivers). */
extern int atp_init(struct device *);
extern int de600_probe(struct device *);
extern int de620_probe(struct device *);
static int
ethif_probe(struct device *dev)
......@@ -115,8 +116,11 @@ ethif_probe(struct device *dev)
#ifdef CONFIG_E2100 /* Cabletron E21xx series. */
&& e2100_probe(dev)
#endif
#ifdef CONFIG_DE600
#ifdef CONFIG_DE600 /* D-Link DE-600 adapter */
&& de600_probe(dev)
#endif
#ifdef CONFIG_DE620 /* D-Link DE-620 adapter */
&& de620_probe(dev)
#endif
&& 1 ) {
return 1; /* -ENODEV or -EAGAIN would be more accurate. */
......
......@@ -636,11 +636,14 @@ unsigned long apricot_init(unsigned long mem_start, unsigned long mem_end)
if (check_region(ioaddr, APRICOT_TOTAL_SIZE))
return mem_start;
/* very similar to the SMC card except that the checksum is 0x200 */
for (i = 0; i < 8; i++)
checksum += inb(ioaddr + 8 + i);
if (checksum != 0x200) return mem_start;
/* checksum is a multiple of 0x100, got this wrong first time
some machines have 0x100, some 0x200. The DOS driver doesn't
even bother with the checksum */
if (checksum % 0x100) return mem_start;
dev = init_etherdev(0, (sizeof (struct i596_private) + 0xf), &mem_start);
......
This diff is collapsed.
This diff is collapsed.
/*********************************************************
* *
* Definition of D-Link DE-620 Ethernet Pocket adapter *
* *
*********************************************************/
/* DE-620's CMD port Command */
#define CS0 0x08 /* 1->0 command strobe */
#define ICEN 0x04 /* 0=enable DL3520 host interface */
#define DS0 0x02 /* 1->0 data strobe 0 */
#define DS1 0x01 /* 1->0 data strobe 1 */
#define WDIR 0x20 /* general 0=read 1=write */
#define RDIR 0x00 /* (not 100% confirm ) */
#define PS2WDIR 0x00 /* ps/2 mode 1=read, 0=write */
#define PS2RDIR 0x20
#define IRQEN 0x10 /* 1 = enable printer IRQ line */
#define SELECTIN 0x08 /* 1 = select printer */
#define INITP 0x04 /* 0 = initial printer */
#define AUTOFEED 0x02 /* 1 = printer auto form feed */
#define STROBE 0x01 /* 0->1 data strobe */
#define RESET 0x08
#define NIS0 0x20 /* 0 = BNC, 1 = UTP */
#define NCTL0 0x10
/* DE-620 DIC Command */
#define W_DUMMY 0x00 /* DIC reserved command */
#define W_CR 0x20 /* DIC write command register */
#define W_NPR 0x40 /* DIC write Nect Page Register */
#define W_TBR 0x60 /* DIC write Tx Byte Count 1 reg */
#define W_RSA 0x80 /* DIC write Remote Start Addr 1 */
/* DE-620's STAT port bits 7-4 */
#define EMPTY 0x80 /* 1 = receive buffer empty */
#define INTLEVEL 0x40 /* 1 = interrupt level is high */
#define TXBF1 0x20 /* 1 = transmit buffer 1 is in use */
#define TXBF0 0x10 /* 1 = transmit buffer 0 is in use */
#define READY 0x08 /* 1 = h/w ready to accept cmd/data */
/* IDC 1 Command */
#define W_RSA1 0xa0 /* write remote start address 1 */
#define W_RSA0 0xa1 /* write remote start address 0 */
#define W_NPRF 0xa2 /* write next page register NPR15-NPR8 */
#define W_DFR 0xa3 /* write delay factor register */
#define W_CPR 0xa4 /* write current page register */
#define W_SPR 0xa5 /* write start page register */
#define W_EPR 0xa6 /* write end page register */
#define W_SCR 0xa7 /* write system configuration register */
#define W_TCR 0xa8 /* write Transceiver Configuration reg */
#define W_EIP 0xa9 /* write EEPM Interface port */
#define W_PAR0 0xaa /* write physical address registr 0 */
#define W_PAR1 0xab /* write physical address registr 1 */
#define W_PAR2 0xac /* write physical address registr 2 */
#define W_PAR3 0xad /* write physical address registr 3 */
#define W_PAR4 0xae /* write physical address registr 4 */
#define W_PAR5 0xaf /* write physical address registr 5 */
/* IDC 2 Command */
#define R_STS 0xc0 /* read status register */
#define R_CPR 0xc1 /* read current page register */
#define R_BPR 0xc2 /* read boundary page register */
#define R_TDR 0xc3 /* read time domain reflectometry reg */
/* STATUS Register */
#define EEDI 0x80 /* EEPM DO pin */
#define TXSUC 0x40 /* tx success */
#define T16 0x20 /* tx fail 16 times */
#define TS1 0x40 /* 0=Tx success, 1=T16 */
#define TS0 0x20 /* 0=Tx success, 1=T16 */
#define RXGOOD 0x10 /* rx a good packet */
#define RXCRC 0x08 /* rx a CRC error packet */
#define RXSHORT 0x04 /* rx a short packet */
#define COLS 0x02 /* coaxial collision status */
#define LNKS 0x01 /* UTP link status */
/* Command Register */
#define CLEAR 0x10 /* reset part of hardware */
#define NOPER 0x08 /* No Operation */
#define RNOP 0x08
#define RRA 0x06 /* After RR then auto-advance NPR & BPR(=NPR-1) */
#define RRN 0x04 /* Normal Remote Read mode */
#define RW1 0x02 /* Remote Write tx buffer 1 ( page 6 - 11 ) */
#define RW0 0x00 /* Remote Write tx buffer 0 ( page 0 - 5 ) */
#define TXEN 0x01 /* 0->1 tx enable */
/* System Configuration Register */
#define TESTON 0x80 /* test host data transfer reliability */
#define SLEEP 0x40 /* sleep mode */
#if 0
#define FASTMODE 0x04 /* fast mode for intel 82360SL fast mode */
#define BYTEMODE 0x02 /* byte mode */
#else
#define FASTMODE 0x20 /* fast mode for intel 82360SL fast mode */
#define BYTEMODE 0x10 /* byte mode */
#endif
#define NIBBLEMODE 0x00 /* nibble mode */
#define IRQINV 0x08 /* turn off IRQ line inverter */
#define IRQNML 0x00 /* turn on IRQ line inverter */
#define INTON 0x04
#define AUTOFFSET 0x02 /* auto shift address to TPR+12 */
#define AUTOTX 0x01 /* auto tx when leave RW mode */
/* Tranceiver Configuration Register */
#define JABBER 0x80 /* generate jabber condition */
#define TXSUCINT 0x40 /* enable tx success interrupt */
#define T16INT 0x20 /* enable T16 interrupt */
#define RXERRPKT 0x10 /* accept CRC error or short packet */
#define EXTERNALB2 0x0C /* external loopback 2 */
#define EXTERNALB1 0x08 /* external loopback 1 */
#define INTERNALB 0x04 /* internal loopback */
#define NMLOPERATE 0x00 /* normal operation */
#define RXPBM 0x03 /* rx physical, broadcast, multicast */
#define RXPB 0x02 /* rx physical, broadcast */
#define RXALL 0x01 /* rx all packet */
#define RXOFF 0x00 /* rx disable */
......@@ -172,6 +172,7 @@ struct net_local {
struct plip_local rcv_data;
unsigned long trigger_us;
unsigned long nibble_us;
unsigned long unit_us;
};
/* Routines used internally. */
......@@ -948,10 +949,12 @@ static int plip_ioctl(struct device *dev, struct ifreq *rq)
case PLIP_GET_TIMEOUT:
pc->trigger=nl->trigger_us;
pc->nibble=nl->nibble_us;
pc->unit=nl->unit_us;
break;
case PLIP_SET_TIMEOUT:
nl->trigger_us=pc->trigger;
nl->nibble_us=pc->nibble;
nl->unit_us=pc->unit;
break;
default:
return -EOPNOTSUPP;
......
......@@ -711,12 +711,14 @@ static void ppp_write_wakeup(struct tty_struct *tty)
return;
}
if (!ppp->xtail || (ppp->flags & SC_XMIT_BUSY))
if (!ppp->xtail)
return;
cli();
if (ppp->flags & SC_XMIT_BUSY)
if (ppp->flags & SC_XMIT_BUSY) {
sti();
return;
}
ppp->flags |= SC_XMIT_BUSY;
sti();
......@@ -746,7 +748,7 @@ static void ppp_write_wakeup(struct tty_struct *tty)
/* stuff a single character into the receive buffer */
inline void
static inline void
ppp_enqueue(struct ppp *ppp, unsigned char c)
{
unsigned long flags;
......@@ -1966,8 +1968,7 @@ ppp_check_fcs(struct ppp *ppp)
static char hex[] = "0123456789ABCDEF";
inline void ppp_print_hex (register char *out, char *in, int count);
inline void ppp_print_hex (register char *out, char *in, int count)
static inline void ppp_print_hex (register char *out, char *in, int count)
{
register unsigned char next_ch;
......@@ -1981,8 +1982,7 @@ inline void ppp_print_hex (register char *out, char *in, int count)
}
}
inline void ppp_print_char (register char *out, char *in, int count);
inline void ppp_print_char (register char *out, char *in, int count)
static inline void ppp_print_char (register char *out, char *in, int count)
{
register unsigned char next_ch;
......
......@@ -22,6 +22,7 @@
* 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.
* Alan Cox : Default to 192.168.0.0 (RFC 1597)
*
*
* FIXME: This driver still makes some IP'ish assumptions. It should build cleanly KISS TNC only without
......@@ -400,12 +401,14 @@ static void slip_write_wakeup(struct tty_struct *tty)
return;
}
if (!sl->xtail || (sl->flags & SLF_XMIT_BUSY))
if (!sl->xtail)
return;
cli();
if (sl->flags & SLF_XMIT_BUSY)
if (sl->flags & SLF_XMIT_BUSY) {
sti();
return;
}
sl->flags |= SLF_XMIT_BUSY;
sti();
......@@ -596,7 +599,7 @@ sl_open(struct device *dev)
dev->flags|=IFF_UP;
/* Needed because address '0' is special */
if(dev->pa_addr==0)
dev->pa_addr=ntohl(0xC0000001);
dev->pa_addr=ntohl(0xC0A80001);
return(0);
}
......
......@@ -20,6 +20,7 @@ struct plipconf
unsigned short pcmd;
unsigned long nibble;
unsigned long trigger;
unsigned long unit;
};
#define PLIP_GET_TIMEOUT 0x1
......
......@@ -90,10 +90,29 @@ struct mtget {
#define MT_ISSCSI1 0x71 /* Generic ANSI SCSI-1 tape unit */
#define MT_ISSCSI2 0x72 /* Generic ANSI SCSI-2 tape unit */
/* QIC-40/QIC-80 ftape supported drives.
* 20bit vendor ID + 0x800000
*/
#define MT_ISFTAPE_UNKNOWN 0x800000
#define MT_ISCMSDJ10_DJ20 0x800047
#define MT_ISCMSDJ10_DJ20_NEW 0x8011c4
#define MT_ISARCHIVE_5580I 0x800005
#define MT_ISARCHIVE_XL9250I 0x80014a
#define MT_ISARCHIVE_31250Q 0x800146
#define MT_ISINSIGHT_80 0x810005
#define MT_ISCONNER_C250MQT 0x80014c
#define MT_ISWANGTEK_2040F 0x8001c1
#define MT_ISWANGTEK_2080F 0x8001c8
#define MT_ISIOMEGA_250 0x808880
#define MT_ISSUMMIT_SE150 0x800180
#define MT_ISSUMMIT_SE250 0x800181
#define MT_ISESCOM_IDTBU120E 0x800140
struct mt_tape_info {
long t_type; /* device type id (mt_type) */
char *t_name; /* descriptive name */
};
#define MT_TAPE_INFO { \
{MT_ISUNKNOWN, "Unknown type of tape device"}, \
{MT_ISQIC02, "Generic QIC-02 tape streamer"}, \
......@@ -108,6 +127,20 @@ struct mt_tape_info {
{MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"}, \
{MT_ISSCSI1, "Generic SCSI-1 tape"}, \
{MT_ISSCSI2, "Generic SCSI-2 tape"}, \
{MT_ISFTAPE_UNKNOWN, "Unknown floppy interface tape drive"},\
{MT_ISCMSDJ10_DJ20, "Colorado DJ-10/DJ-20"},\
{MT_ISCMSDJ10_DJ20_NEW, "Colorado DJ-10/DJ-20 (new)"},\
{MT_ISARCHIVE_5580I, "Archive 5580i"},\
{MT_ISARCHIVE_XL9250I, "Archive XL9250i [Conner/Escom]"},\
{MT_ISARCHIVE_31250Q, "Escom/Archive 31250Q"},\
{MT_ISINSIGHT_80, "Insight 80 Mb"},\
{MT_ISCONNER_C250MQT, "Conner C250MQT"},\
{MT_ISWANGTEK_2040F, "Wangtek 3040F"},\
{MT_ISWANGTEK_2080F, "Wangtek 3080F"},\
{MT_ISIOMEGA_250, "Iomega 250"},\
{MT_ISSUMMIT_SE150, "Summit SE 150"},\
{MT_ISSUMMIT_SE250, "Summit SE 250/Mountain FS8000"},\
{MT_ISESCOM_IDTBU120E, "Identity IDTBU120E, Escom?"},\
{0, NULL} \
}
......
......@@ -36,6 +36,7 @@ struct linger {
#define AF_MAX 8 /* For now.. */
/* Protocol families, same as address families. */
#define PF_UNSPEC AF_UNSPEC
#define PF_UNIX AF_UNIX
#define PF_INET AF_INET
#define PF_AX25 AF_AX25
......
......@@ -10,7 +10,6 @@
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/malloc.h>
#include <linux/binfmts.h>
#include <linux/ptrace.h>
#include <linux/sys.h>
#include <linux/utsname.h>
......@@ -30,6 +29,9 @@ extern char * ftape_big_buffer;
extern void (*do_floppy)(void);
#endif
extern int request_dma(unsigned int dmanr);
extern void free_dma(unsigned int dmanr);
extern int do_execve(char * filename, char ** argv, char ** envp,
struct pt_regs * regs);
extern void flush_old_exec(struct linux_binprm * bprm);
......@@ -104,11 +106,16 @@ struct {
X(unregister_exec_domain),
/* interrupt handling */
X(irqaction),
X(request_irq),
X(free_irq),
X(bh_active),
X(bh_mask),
/* dma handling */
X(request_dma),
X(free_dma),
/* process management */
X(wake_up),
X(wake_up_interruptible),
......
......@@ -58,10 +58,8 @@ static int write_ldt(void * ptr, unsigned long bytecount)
limit *= PAGE_SIZE;
limit += base;
#ifdef NOTDEF_KLUDGE
if (limit < base || limit >= 0xC0000000)
return -EINVAL;
#endif
if (!current->ldt) {
for (i=1 ; i<NR_TASKS ; i++) {
......
......@@ -120,6 +120,8 @@ sys_delete_module(char *module_name)
return error;
if ((mp = find_module(name)) == NULL)
return -ENOENT;
if (GET_USE_COUNT(mp) != 0)
return -EBUSY;
if (mp->state == MOD_RUNNING)
(*mp->cleanup)();
mp->state = MOD_DELETED;
......
......@@ -1057,7 +1057,9 @@ void show_mem(void)
printk("%d reserved pages\n",reserved);
printk("%d pages shared\n",shared);
show_buffers();
#ifdef CONFIG_NET
show_net_buffers();
#endif
}
extern unsigned long free_area_init(unsigned long, unsigned long);
......
This is snapshot 015
Changes for 1.1.21
o Small bug fix in the apricot xen-ii driver code (Mark Evans)
o DE600 changes + DE620 driver (Bj0rn Eckwall)
o WWW error return bug fixed (Everyone!)
o SLIP default address is now better
o Small changes to PLIP (Niibe)
o Added PF_UNSPEC (Dominic Kubla)
o TCP fastpath for receive.
o Turbo charged tcp checksum routine (Arnt Gulbrandsen)
o PPP locking bug fixes (Florian La Roche)
Changes for the 015 snapshot
To Do
o Include the HP onboard lance fixes.
o Fix Unix domain sockets.
o Fix the _SLOW_ TCP window calculation junk in tcp_data/tcp_ack.
o Make the dev_add_proto() list hashed by protocol type.
o Remove the call to dev->header_type - load it into the skbuff.
instead to avoid the extra calls and cache misses.
o Include new sk_buff skb_push() code and move toward using it.
o Fix the PI driver so pi0a can be down when pi0b is up without getting
crashes. Also fix the stuff to allow piconfig to set the parameters.
o Make AX.25 set the packet type - certainly before it hits IP.
o sk_buff building at the top level - pure kernel interfaces to the
protocol layers
o Clean up NFS, merge NFS/TCP code.
o SIGIO
o IP forwarding use of options properly (needs new sk_buff code)
o Reroute TCP retransmits if needed (needs new sk_buffs)
Changes for 1.1.20
o All read/write buffers are validated at the top level _only_
o All address structures are moved to and from user mode at the top
......@@ -46,29 +76,6 @@ o Added Donald's multicast reception while promiscuous fix for the
o Potential ARP TCP-retransmit clear race fixed. Incredibly
unlikely to occur but no doubt it will 8(.
To Do
o Fast path the tcp for packets in order with no flags set - we ought
to hit cable speed on slower machines if we fix that and the below.
(under test - define TCP_FASTPATH in tcp.c if you want to be brave
and report any findings.)
o Include the HP onboard lance fixes.
o Fix Unix domain sockets.
o Fix the _SLOW_ TCP window calculation junk in tcp_data/tcp_ack.
o Make the dev_add_proto() list hashed by protocol type.
o Remove the call to dev->header_type - load it into the skbuff.
instead to avoid the extra calls and cache misses.
o Include new sk_buff skb_push() code and move toward using it.
o Fix the PI driver so pi0a can be down when pi0b is up without getting
crashes. Also fix the stuff to allow piconfig to set the parameters.
o Make AX.25 set the packet type - certainly before it hits IP.
o sk_buff building at the top level - pure kernel interfaces to the
protocol layers
o Clean up NFS, merge NFS/TCP code.
o SIGIO
o IP forwarding use of options properly (needs new sk_buff code)
o Reroute TCP retransmits if needed (needs new sk_buffs)
Fixes added for 1.1.19
......
......@@ -847,7 +847,7 @@ static int inet_connect(struct socket *sock, struct sockaddr * uaddr,
}
if (sock->state == SS_CONNECTING && sk->protocol == IPPROTO_TCP && (flags & O_NONBLOCK))
return -EINPROGRESS; /* Connecting is currently in progress */
return -EALREADY; /* Connecting is currently in progress */
if (sock->state != SS_CONNECTING)
{
......@@ -1303,7 +1303,7 @@ void inet_proto_init(struct net_proto *pro)
int i;
printk("NET3 TCP/IP protcols stack v016\n");
printk("NET3 TCP/IP protocols stack v016\n");
/*
* Tell SOCKET that we are alive...
......
......@@ -1633,10 +1633,6 @@ void ip_queue_xmit(struct sock *sk, struct device *dev,
struct iphdr *iph;
unsigned char *ptr;
/* All buffers without an owner socket get freed */
if (sk == NULL)
free = 1;
/* Sanity check */
if (dev == NULL)
{
......@@ -1677,6 +1673,10 @@ void ip_queue_xmit(struct sock *sk, struct device *dev,
else
free=1;
/* All buffers without an owner socket get freed */
if (sk == NULL)
free = 1;
skb->free = free;
/*
......
......@@ -16,6 +16,7 @@
* Linus Torvalds, <torvalds@cs.helsinki.fi>
* Alan Cox, <gw4pts@gw4pts.ampr.org>
* Matthew Dillon, <dillon@apollo.west.oic.com>
* Arnt Gulbrandsen, <agulbra@no.unit.nvg>
*
* Fixes:
* Alan Cox : Numerous verify_area() calls
......@@ -74,6 +75,7 @@
* Matthew Dillon : Fixed another RST bug
* Alan Cox : Move to kernel side addressing changes.
* Alan Cox : Beginning work on TCP fastpathing (not yet usable)
* Arnt Gulbrandsen: Turbocharged tcp_check() routine.
*
*
* To Fix:
......@@ -85,10 +87,6 @@
* Fast path the code. Two things here - fix the window calculation
* so it doesn't iterate over the queue, also spot packets with no funny
* options arriving in order and process directly.
* Any assembler hacker who can speed up the checksum routines will
* be welcome as well as someone who feels like writing a single 'checksum udp
* and copy up to user mode for the first n bytes at the same time' routine.
* which should be quicker than the current sum then copy for the UDP layer.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -154,7 +152,7 @@
#include <asm/segment.h>
#include <linux/mm.h>
#undef TCP_FASTPATH
#define TCP_FASTPATH
#define SEQ_TICK 3
unsigned long seq_offset;
......@@ -184,6 +182,8 @@ static __inline__ int min(unsigned int a, unsigned int b)
of two things. Firstly we will bin packets even within the window
in order to get the data we are waiting for into the memory limit.
Secondly we bin common duplicate forms at receive time
TODO: add sk->window_clamp to limit windows over the DE600 and AX.25
Better heuristics welcome
*/
......@@ -524,66 +524,81 @@ unsigned short tcp_check(struct tcphdr *th, int len,
unsigned long sum;
if (saddr == 0) saddr = ip_my_addr();
__asm__("\t addl %%ecx,%%ebx\n"
"\t adcl %%edx,%%ebx\n"
"\t adcl $0, %%ebx\n"
: "=b"(sum)
: "0"(daddr), "c"(saddr), "d"((ntohs(len) << 16) + IPPROTO_TCP*256)
: "cx","bx","dx" );
if (len > 3)
{
__asm__("\tclc\n"
"1:\n"
"\t lodsl\n"
"\t adcl %%eax, %%ebx\n"
"\t loop 1b\n"
"\t adcl $0, %%ebx\n"
: "=b"(sum) , "=S"(th)
: "0"(sum), "c"(len/4) ,"1"(th)
: "ax", "cx", "bx", "si" );
}
/* Convert from 32 bits to 16 bits. */
__asm__("\t movl %%ebx, %%ecx\n"
"\t shrl $16,%%ecx\n"
"\t addw %%cx, %%bx\n"
"\t adcw $0, %%bx\n"
: "=b"(sum)
: "0"(sum)
: "bx", "cx");
/* Check for an extra word. */
if ((len & 2) != 0)
{
__asm__("\t lodsw\n"
"\t addw %%ax,%%bx\n"
"\t adcw $0, %%bx\n"
: "=b"(sum), "=S"(th)
: "0"(sum) ,"1"(th)
: "si", "ax", "bx");
}
/* Now check for the extra byte. */
if ((len & 1) != 0)
{
__asm__("\t lodsb\n"
"\t movb $0,%%ah\n"
"\t addw %%ax,%%bx\n"
"\t adcw $0, %%bx\n"
: "=b"(sum)
: "0"(sum) ,"S"(th)
: "si", "ax", "bx");
}
/*
* stupid, gcc complains when I use just one __asm__ block,
* something about too many reloads, but this is just two
* instructions longer than what I want
*/
__asm__("
addl %%ecx, %%ebx
adcl %%edx, %%ebx
adcl $0, %%ebx
"
: "=b"(sum)
: "0"(daddr), "c"(saddr), "d"((ntohs(len) << 16) + IPPROTO_TCP*256)
: "bx", "cx", "dx" );
__asm__("
movl %%ecx, %%edx
cld
cmpl $32, %%ecx
jb 2f
shrl $5, %%ecx
clc
1: lodsl
adcl %%eax, %%ebx
lodsl
adcl %%eax, %%ebx
lodsl
adcl %%eax, %%ebx
lodsl
adcl %%eax, %%ebx
lodsl
adcl %%eax, %%ebx
lodsl
adcl %%eax, %%ebx
lodsl
adcl %%eax, %%ebx
lodsl
adcl %%eax, %%ebx
loop 1b
adcl $0, %%ebx
movl %%edx, %%ecx
2: andl $28, %%ecx
cmpl $4, %%ecx
jb 4f
shrl $2, %%ecx
clc
3: lodsl
adcl %%eax, %%ebx
loop 3b
adcl $0, %%ebx
4: movl $0, %%eax
testw $2, %%dx
je 5f
lodsw
addl %%eax, %%ebx
movw $0, %%ax
5: test $1, %%edx
je 6f
lodsb
addl %%eax, %%ebx
6: movl %%ebx, %%eax
shrl $16, %%eax
addw %%ax, %%bx
adcw $0, %%bx
"
: "=b"(sum)
: "0"(sum), "c"(len), "S"(th)
: "ax", "bx", "cx", "dx", "si" );
/* We only want the bottom 16 bits, but we never cleared the top 16. */
return((~sum) & 0xffff);
}
void tcp_send_check(struct tcphdr *th, unsigned long saddr,
unsigned long daddr, int len, struct sock *sk)
{
......
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