Commit be164636 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.2.8

parent d43cc577
VERSION = 1 VERSION = 1
PATCHLEVEL = 2 PATCHLEVEL = 2
SUBLEVEL = 7 SUBLEVEL = 8
ARCH = i386 ARCH = i386
......
...@@ -358,6 +358,14 @@ void handle_vm86_fault(struct vm86_regs * regs, long error_code) ...@@ -358,6 +358,14 @@ void handle_vm86_fault(struct vm86_regs * regs, long error_code)
IP(regs) += 2; IP(regs) += 2;
set_vflags_long(popl(ssp, sp), regs); set_vflags_long(popl(ssp, sp), regs);
return; return;
/* iretd */
case 0xcf:
SP(regs) += 12;
IP(regs) = (unsigned short)popl(ssp, sp);
regs->cs = (unsigned short)popl(ssp, sp);
set_vflags_long(popl(ssp, sp), regs);
return;
} }
/* pushf */ /* pushf */
......
This diff is collapsed.
This diff is collapsed.
Tue May 2 00:53:25 1995 <tytso@rsx-11.mit.edu>
* tty_io.c (tty_set_ldisc): Wait until the output buffer is
drained before closing the old line discipline --- needed
in only one case: XON/XOFF processing.
* n_tty.c (n_tty_close): Don't bother waiting until the output
driver is closed; in general, the line discipline
shouldn't care if the hardware is finished
transmitting before the line discipline terminates.
* tty_io.c (release_dev): Shutdown the line discipline after
decrementing the tty count variable; but set the
TTY_CLOSING flag so that we know that this tty structure
isn't long for this world.
* tty_io.c (init_dev): Add sanity code to check to see if
TTY_CLOSING is set on a tty structure; if so, something
bad has happened (probably a line discipline close blocked
when it shouldn't have; so do a kernel printk and then
return an error).
Wed Apr 26 10:23:44 1995 Theodore Y. Ts'o <tytso@localhost> Wed Apr 26 10:23:44 1995 Theodore Y. Ts'o <tytso@localhost>
* tty_io.c (release_dev): Try to shutdown the line discpline * tty_io.c (release_dev): Try to shutdown the line discipline
*before* decrementing the tty count variable; this removes *before* decrementing the tty count variable; this removes
a potential race condition which occurs when the line a potential race condition which occurs when the line
discpline close blocks, and another process then tries discipline close blocks, and another process then tries
open the same serial port. open the same serial port.
* serial.c (rs_hangup): When hanging up, flush the output buffer * serial.c (rs_hangup): When hanging up, flush the output buffer
befure shutting down the UART. Otherwise the line before shutting down the UART. Otherwise the line
discpline close blocks waiting for the characters to get discipline close blocks waiting for the characters to get
flushed, which never happens until the serial port gets reused. flushed, which never happens until the serial port gets reused.
Wed Apr 12 08:06:16 1995 Theodore Y. Ts'o <tytso@localhost> Wed Apr 12 08:06:16 1995 Theodore Y. Ts'o <tytso@localhost>
......
...@@ -676,7 +676,6 @@ static void n_tty_set_termios(struct tty_struct *tty, struct termios * old) ...@@ -676,7 +676,6 @@ static void n_tty_set_termios(struct tty_struct *tty, struct termios * old)
static void n_tty_close(struct tty_struct *tty) static void n_tty_close(struct tty_struct *tty)
{ {
tty_wait_until_sent(tty, 0);
n_tty_flush_buffer(tty); n_tty_flush_buffer(tty);
if (tty->read_buf) { if (tty->read_buf) {
free_page((unsigned long) tty->read_buf); free_page((unsigned long) tty->read_buf);
......
...@@ -204,6 +204,8 @@ static int tty_set_ldisc(struct tty_struct *tty, int ldisc) ...@@ -204,6 +204,8 @@ static int tty_set_ldisc(struct tty_struct *tty, int ldisc)
return 0; /* We are already in the desired discipline */ return 0; /* We are already in the desired discipline */
o_ldisc = tty->ldisc; o_ldisc = tty->ldisc;
tty_wait_until_sent(tty, 0);
/* Shutdown the current discipline. */ /* Shutdown the current discipline. */
if (tty->ldisc.close) if (tty->ldisc.close)
(tty->ldisc.close)(tty); (tty->ldisc.close)(tty);
...@@ -865,8 +867,15 @@ static int init_dev(dev_t device, struct tty_struct **ret_tty) ...@@ -865,8 +867,15 @@ static int init_dev(dev_t device, struct tty_struct **ret_tty)
} }
} }
tty = NULL; tty = NULL;
} else } else {
if ((*tty_loc)->flags & (1 << TTY_CLOSING)) {
printk("Attempt to open closing tty %s.\n",
tty_name(*tty_loc));
printk("Ack!!!! This should never happen!!\n");
return -EINVAL;
}
(*tty_loc)->count++; (*tty_loc)->count++;
}
if (driver->type == TTY_DRIVER_TYPE_PTY) { if (driver->type == TTY_DRIVER_TYPE_PTY) {
if (!*o_tp_loc) { if (!*o_tp_loc) {
*o_tp_loc = o_tp; *o_tp_loc = o_tp;
...@@ -1006,22 +1015,6 @@ static void release_dev(struct file * filp) ...@@ -1006,22 +1015,6 @@ static void release_dev(struct file * filp)
tty->link->count = 0; tty->link->count = 0;
} }
} }
if (tty->count <= 1) {
/*
* Shutdown the current line discipline, and reset it
* to N_TTY.
*/
if (tty->ldisc.close)
(tty->ldisc.close)(tty);
tty->ldisc = ldiscs[N_TTY];
tty->termios->c_line = N_TTY;
if (o_tty && o_tty->count <= 0) {
if (o_tty->ldisc.close)
(o_tty->ldisc.close)(o_tty);
o_tty->ldisc = ldiscs[N_TTY];
o_tty->termios->c_line = N_TTY;
}
}
if (--tty->count < 0) { if (--tty->count < 0) {
printk("release_dev: bad tty->count (%d) for %s\n", printk("release_dev: bad tty->count (%d) for %s\n",
tty->count, tty_name(tty)); tty->count, tty_name(tty));
...@@ -1030,6 +1023,9 @@ static void release_dev(struct file * filp) ...@@ -1030,6 +1023,9 @@ static void release_dev(struct file * filp)
if (tty->count) if (tty->count)
return; return;
/*
* We're committed; at this point, we must not block!
*/
if (o_tty) { if (o_tty) {
if (o_tty->count) if (o_tty->count)
return; return;
...@@ -1041,6 +1037,7 @@ static void release_dev(struct file * filp) ...@@ -1041,6 +1037,7 @@ static void release_dev(struct file * filp)
#ifdef TTY_DEBUG_HANGUP #ifdef TTY_DEBUG_HANGUP
printk("freeing tty structure..."); printk("freeing tty structure...");
#endif #endif
tty->flags |= (1 << TTY_CLOSING);
/* /*
* Make sure there aren't any processes that still think this * Make sure there aren't any processes that still think this
...@@ -1055,6 +1052,20 @@ static void release_dev(struct file * filp) ...@@ -1055,6 +1052,20 @@ static void release_dev(struct file * filp)
(*p)->tty = NULL; (*p)->tty = NULL;
} }
/*
* Shutdown the current line discipline, and reset it to
* N_TTY.
*/
if (tty->ldisc.close)
(tty->ldisc.close)(tty);
tty->ldisc = ldiscs[N_TTY];
tty->termios->c_line = N_TTY;
if (o_tty) {
if (o_tty->ldisc.close)
(o_tty->ldisc.close)(o_tty);
o_tty->ldisc = ldiscs[N_TTY];
}
tty->driver.table[idx] = NULL; tty->driver.table[idx] = NULL;
if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS) { if (tty->driver.flags & TTY_DRIVER_RESET_TERMIOS) {
tty->driver.termios[idx] = NULL; tty->driver.termios[idx] = NULL;
......
...@@ -60,7 +60,7 @@ struct ei_device { ...@@ -60,7 +60,7 @@ struct ei_device {
struct enet_statistics stat; struct enet_statistics stat;
}; };
/* The maximum number of 8390 interrupt serivce routines called per IRQ. */ /* The maximum number of 8390 interrupt service routines called per IRQ. */
#define MAX_SERVICE 12 #define MAX_SERVICE 12
/* The maximum number of jiffies waited before assuming a Tx failed. */ /* The maximum number of jiffies waited before assuming a Tx failed. */
......
...@@ -40,10 +40,27 @@ ...@@ -40,10 +40,27 @@
# EWRK3_DEBUG Set the desired debug level # EWRK3_DEBUG Set the desired debug level
# #
# DE4x5 The DIGITAL series of PCI/EISA Ethernet Cards, # DE4x5 The DIGITAL series of PCI/EISA Ethernet Cards,
# DE425, DE434 and DE435 # DE425, DE434, DE435, DE500
# DE4x5_DEBUG Set the desired debug level # DE4X5_DEBUG Set the desired debug level
# IS_ZYNX May allow driver to work with Zynx cards - # IS_NOT_DEC May allow driver to work with Zynx & SMC cards -
# see linux/drivers/net/README.de4x5 # see linux/drivers/net/README.de4x5
# DE4X5_AUTOSENSE (Default) auto media/mode selection
# If you want at least one board to not autosense then
# no board can autosense. For a board mix of several
# types, OR the manual values [eg for a DE500 (100M) with
# a DE450 (AUI) use '-DDE4X5_AUTOSENSE=(0x80|0x08)']
# For full auto media/mode selection = 0x4000
# For manual TP media selection = 0x01
# For manual TP/Nway media selection (DC21041) = 0x02
# For manual BNC media selection = 0x04
# For manual AUI media selection = 0x08
# For manual BNC/AUI media selection (DC21040) = 0x10
# For manual 10Mb/s mode selection (DC21140) = 0x40
# For manual 100Mb/s mode selection (DC21140) = 0x80
# The DC21040 will default to TP if TP_NW is specified
# The DC21041 will default to BNC if BNC_AUI is specified
# The DC21140 needs it's speed to be manually set to
# 10Mb/s or 100Mb/s (AUTO defaults to 10Mb/s)
# #
# The following options exist, but cannot be set in this file. # The following options exist, but cannot be set in this file.
...@@ -66,4 +83,4 @@ HP_OPTS = ...@@ -66,4 +83,4 @@ HP_OPTS =
PLIP_OPTS = PLIP_OPTS =
DEPCA_OPTS = -DDEPCA_DEBUG=1 DEPCA_OPTS = -DDEPCA_DEBUG=1
EWRK3_OPTS = -DEWRK3_DEBUG=1 EWRK3_OPTS = -DEWRK3_DEBUG=1
DE4x5_OPTS = -DDE4x5_DEBUG=1 DE4X5_OPTS = -DDE4X5_DEBUG=1 -DDE4X5_AUTOSENSE=0x4000
The de425/de434/de435 driver in this distribution is designed to work with The de425/de434/de435/de500 driver in this distribution is designed to work
the Digital Equipment Corporation series of PCI/EISA ethernet cards (DE425, with the Digital Equipment Corporation series of PCI/EISA ethernet cards
DE434, DE435) and with all kernels that support PCI. (DE425, DE434, DE435, DE500) and with all kernels that support PCI.
Auto media detection is provided so that the media choice isn't compiled in Auto media detection is provided so that the media choice isn't compiled in
and is flexible enough to be able to reconfigure on-the-fly. and is flexible enough to be able to reconfigure on-the-fly. This feature
hasn't been included for the DE500 unfortunately, due to a potential patent
The ability to load this driver as a loadable module has been included, dispute. When I get around to implementing the autosense algorithm by myself
(which could legally be difficult to prove since I'm part of the group that
has implemented the patented algorithm) you'll have an auto speed selection
for the de500. If you want the auto speed feature yell at Digital. If enough
of you do things might change.
The ability to load this driver as a loadable module has been included,
although I don't recommend its use with PCI, since PCI dynamically allocates although I don't recommend its use with PCI, since PCI dynamically allocates
where the card will go at boot time. where the card will go at boot time (i.e. the card would have to be present
in the system at boot time for its address/IRQ to be assigned).
The performance we've achieved so far has been measured through the 'ttcp'
tool at 1.08MB/s. This measures the total tcp stack performance which The performance we've achieved so far has been measured through the 'ttcp'
includes the card, so don't expect to get much nearer the 1.25MB/s tool at 1.06MB/s for TCP and 1.17MB/s for UDP. This measures the total
theoretical ethernet rate. stack performance which includes the card, so don't expect to get much
nearer the 1.25MB/s theoretical ethernet rate.
************************************************************************
However there is still a known bug which causes ttcp to hang on transmit TCP UDP
(receive is OK), although the adapter/driver continues to function TX RX TX RX
normally for other applications e.g. nfs mounting disks, pinging etc. DE425 1030k 997k 1170k 1128k (EISA on a Dell 433DE)
The cause is under investigation. DE434 1063k 995k 1170k 1125k (PCI: DECpc XL 466d2)
************************************************************************ DE435 1063k 995k 1170k 1125k (PCI: DECpc XL 466d2)
DE500 1063k 998k 1170k 1125k in 10Mb/s mode (PCI: DECpc XL 466d2)
ZYNX cards, which use the PCI DECchip DC21040, are not specifically
All values are typical (in kBytes/sec) from a sample of 4 for each
measurement. Their error is approx +/-20k on a quiet (private) network and
also depend on what load the CPU has, CPU speed etc.
ZYNX and SMC cards, which use the PCI DECchip DC21040, are not specifically
supported in this driver because supported in this driver because
a) I have no information on them. a) I have no information on them.
b) I cannot test them with the driver. b) I cannot test them with the driver.
c) Donald Becker's 'tulip.c' driver works with them....well one person says c) Donald Becker's 'tulip.c' driver works with them....well one person says
they do and another doesn't, so take your pick! they do and another says they do not, so take your pick!
This driver can be made to work with the ZYNX (and may be the SMC) card by This driver can be made to work with the ZYNX (and may be the SMC) card by
setting a compile time flag in linux/drivers/net/CONFIG setting a compile time flag (IS_NOT_DEC) in linux/drivers/net/CONFIG
Enjoy! Enjoy!
......
This diff is collapsed.
This diff is collapsed.
...@@ -608,7 +608,7 @@ lance_open(struct device *dev) ...@@ -608,7 +608,7 @@ lance_open(struct device *dev)
outw(((int)&lp->init_block) >> 16, ioaddr+LANCE_DATA); outw(((int)&lp->init_block) >> 16, ioaddr+LANCE_DATA);
outw(0x0004, ioaddr+LANCE_ADDR); outw(0x0004, ioaddr+LANCE_ADDR);
outw(0x0d15, ioaddr+LANCE_DATA); outw(0x0915, ioaddr+LANCE_DATA);
outw(0x0000, ioaddr+LANCE_ADDR); outw(0x0000, ioaddr+LANCE_ADDR);
outw(0x0001, ioaddr+LANCE_DATA); outw(0x0001, ioaddr+LANCE_DATA);
......
...@@ -50,7 +50,7 @@ static char *version = ...@@ -50,7 +50,7 @@ static char *version =
/* Do we implement the read before write bugfix ? */ /* Do we implement the read before write bugfix ? */
/* #define CONFIG_NE_RW_BUGFIX */ /* #define CONFIG_NE_RW_BUGFIX */
/* ---- No user-servicable parts below ---- */ /* ---- No user-serviceable parts below ---- */
extern struct device *init_etherdev(struct device *dev, int sizeof_private, extern struct device *init_etherdev(struct device *dev, int sizeof_private,
unsigned long *mem_startp); unsigned long *mem_startp);
...@@ -86,7 +86,7 @@ bad_clone_list[] = { ...@@ -86,7 +86,7 @@ bad_clone_list[] = {
#define NESM_START_PG 0x40 /* First page of TX buffer */ #define NESM_START_PG 0x40 /* First page of TX buffer */
#define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */ #define NESM_STOP_PG 0x80 /* Last page +1 of RX ring */
#define NE_RDC_TIMEOUT 0x03 /* Max wait in jiffies for Tx RDC */ #define NE_RDC_TIMEOUT 0x02 /* Max wait in jiffies for Tx RDC */
int ne_probe(struct device *dev); int ne_probe(struct device *dev);
static int ne_probe1(struct device *dev, int ioaddr); static int ne_probe1(struct device *dev, int ioaddr);
...@@ -462,7 +462,6 @@ ne_block_output(struct device *dev, int count, ...@@ -462,7 +462,6 @@ ne_block_output(struct device *dev, int count,
SLOW_DOWN_IO; SLOW_DOWN_IO;
#endif /* rw_bugfix */ #endif /* rw_bugfix */
dma_start = jiffies;
outb_p(ENISR_RDC, nic_base + EN0_ISR); outb_p(ENISR_RDC, nic_base + EN0_ISR);
/* Now the normal output. */ /* Now the normal output. */
...@@ -478,6 +477,8 @@ ne_block_output(struct device *dev, int count, ...@@ -478,6 +477,8 @@ ne_block_output(struct device *dev, int count,
outsb(NE_BASE + NE_DATAPORT, buf, count); outsb(NE_BASE + NE_DATAPORT, buf, count);
} }
dma_start = jiffies;
#ifdef CONFIG_NE_SANITY #ifdef CONFIG_NE_SANITY
/* This was for the ALPHA version only, but enough people have /* This was for the ALPHA version only, but enough people have
been encountering problems so it is still here. */ been encountering problems so it is still here. */
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
/* #define NET02D -* */ /* #define NET02D -* */
#define NEW_TTY_DRIVERS /* */ #define NEW_TTY_DRIVERS /* */
#define OPTIMIZE_FLAG_TIME ((HZ * 3)/2) /* */ #define OPTIMIZE_FLAG_TIME ((HZ * 3)/2) /* */
#define CHECK_CHARACTERS
#ifdef MODULE #ifdef MODULE
#include <linux/module.h> #include <linux/module.h>
...@@ -469,8 +470,8 @@ ppp_release(struct ppp *ppp) ...@@ -469,8 +470,8 @@ ppp_release(struct ppp *ppp)
#endif #endif
if (ppp->dev) { if (ppp->dev) {
ppp->dev->flags &= ~IFF_UP; /* down the device */ dev_close (ppp->dev);
ppp->dev->flags |= IFF_POINTOPOINT; ppp->dev->flags = 0;
} }
kfree (ppp->xbuff); kfree (ppp->xbuff);
...@@ -953,14 +954,14 @@ static void ppp_receive_buf(struct tty_struct *tty, unsigned char *cp, ...@@ -953,14 +954,14 @@ static void ppp_receive_buf(struct tty_struct *tty, unsigned char *cp,
#ifdef CHECK_CHARACTERS #ifdef CHECK_CHARACTERS
if (c & 0x80) if (c & 0x80)
sc->sc_flags |= SC_RCV_B7_1; ppp->flags |= SC_RCV_B7_1;
else else
sc->sc_flags |= SC_RCV_B7_0; ppp->flags |= SC_RCV_B7_0;
if (paritytab[c >> 5] & (1 << (c & 0x1F))) if (paritytab[c >> 5] & (1 << (c & 0x1F)))
sc->sc_flags |= SC_RCV_ODDP; ppp->flags |= SC_RCV_ODDP;
else else
sc->sc_flags |= SC_RCV_EVNP; ppp->flags |= SC_RCV_EVNP;
#endif #endif
switch (c) { switch (c) {
...@@ -1005,6 +1006,7 @@ ppp_doframe(struct ppp *ppp) ...@@ -1005,6 +1006,7 @@ ppp_doframe(struct ppp *ppp)
if (ppp->toss) { if (ppp->toss) {
PRINTKN (1, (KERN_WARNING "ppp_toss: tossing frame, reason = %d\n", PRINTKN (1, (KERN_WARNING "ppp_toss: tossing frame, reason = %d\n",
ppp->toss)); ppp->toss));
slhc_toss (ppp->slcomp);
ppp->stats.rerrors++; ppp->stats.rerrors++;
return; return;
} }
...@@ -1018,6 +1020,7 @@ ppp_doframe(struct ppp *ppp) ...@@ -1018,6 +1020,7 @@ ppp_doframe(struct ppp *ppp)
if (count < 4) { if (count < 4) {
PRINTKN (1,(KERN_WARNING "ppp: got runt ppp frame, %d chars\n", count)); PRINTKN (1,(KERN_WARNING "ppp: got runt ppp frame, %d chars\n", count));
slhc_toss (ppp->slcomp);
ppp->stats.runts++; ppp->stats.runts++;
return; return;
} }
...@@ -1025,6 +1028,7 @@ ppp_doframe(struct ppp *ppp) ...@@ -1025,6 +1028,7 @@ ppp_doframe(struct ppp *ppp)
/* check PPP error detection field */ /* check PPP error detection field */
if (!ppp_check_fcs(ppp)) { if (!ppp_check_fcs(ppp)) {
PRINTKN (1,(KERN_WARNING "ppp: frame with bad fcs\n")); PRINTKN (1,(KERN_WARNING "ppp: frame with bad fcs\n"));
slhc_toss (ppp->slcomp);
ppp->stats.rerrors++; ppp->stats.rerrors++;
return; return;
} }
...@@ -1067,6 +1071,7 @@ ppp_doframe(struct ppp *ppp) ...@@ -1067,6 +1071,7 @@ ppp_doframe(struct ppp *ppp)
/* couldn't cope. */ /* couldn't cope. */
PRINTKN (1,(KERN_WARNING PRINTKN (1,(KERN_WARNING
"ppp: dropping packet on the floor: nobody could take it.\n")); "ppp: dropping packet on the floor: nobody could take it.\n"));
slhc_toss (ppp->slcomp);
ppp->stats.tossed++; ppp->stats.tossed++;
} }
...@@ -1109,6 +1114,7 @@ ppp_do_ip (struct ppp *ppp, unsigned short proto, unsigned char *c, ...@@ -1109,6 +1114,7 @@ ppp_do_ip (struct ppp *ppp, unsigned short proto, unsigned char *c,
PRINTKN (1,(KERN_NOTICE PRINTKN (1,(KERN_NOTICE
"ppp: no space to decompress VJ compressed TCP header.\n")); "ppp: no space to decompress VJ compressed TCP header.\n"));
ppp->stats.roverrun++; ppp->stats.roverrun++;
slhc_toss (ppp->slcomp);
return 1; return 1;
} }
...@@ -1116,6 +1122,7 @@ ppp_do_ip (struct ppp *ppp, unsigned short proto, unsigned char *c, ...@@ -1116,6 +1122,7 @@ ppp_do_ip (struct ppp *ppp, unsigned short proto, unsigned char *c,
if (count <= 0) { if (count <= 0) {
ppp->stats.rerrors++; ppp->stats.rerrors++;
PRINTKN (1,(KERN_NOTICE "ppp: error in VJ decompression\n")); PRINTKN (1,(KERN_NOTICE "ppp: error in VJ decompression\n"));
slhc_toss (ppp->slcomp);
return 1; return 1;
} }
ppp->stats.rcomp++; ppp->stats.rcomp++;
...@@ -1126,6 +1133,7 @@ ppp_do_ip (struct ppp *ppp, unsigned short proto, unsigned char *c, ...@@ -1126,6 +1133,7 @@ ppp_do_ip (struct ppp *ppp, unsigned short proto, unsigned char *c,
if (slhc_remember(ppp->slcomp, c, count) <= 0) { if (slhc_remember(ppp->slcomp, c, count) <= 0) {
ppp->stats.rerrors++; ppp->stats.rerrors++;
PRINTKN (1,(KERN_NOTICE "ppp: error in VJ memorizing\n")); PRINTKN (1,(KERN_NOTICE "ppp: error in VJ memorizing\n"));
slhc_toss (ppp->slcomp);
return 1; return 1;
} }
ppp->stats.runcomp++; ppp->stats.runcomp++;
...@@ -1709,7 +1717,12 @@ ppp_xmit(struct sk_buff *skb, struct device *dev) ...@@ -1709,7 +1717,12 @@ ppp_xmit(struct sk_buff *skb, struct device *dev)
PRINTKN(4,(KERN_DEBUG "ppp_xmit [%s]: skb %lX busy %d\n", dev->name, PRINTKN(4,(KERN_DEBUG "ppp_xmit [%s]: skb %lX busy %d\n", dev->name,
(unsigned long int) skb, ppp->sending)); (unsigned long int) skb, ppp->sending));
CHECK_PPP(0); /* avoid race conditions when the link fails */
if (!ppp->inuse) {
dev_kfree_skb(skb, FREE_WRITE);
dev_close (dev);
return 0;
}
if (tty == NULL) { if (tty == NULL) {
PRINTKN(1,(KERN_ERR "ppp_xmit: %s not connected to a TTY!\n", dev->name)); PRINTKN(1,(KERN_ERR "ppp_xmit: %s not connected to a TTY!\n", dev->name));
...@@ -1726,7 +1739,7 @@ ppp_xmit(struct sk_buff *skb, struct device *dev) ...@@ -1726,7 +1739,7 @@ ppp_xmit(struct sk_buff *skb, struct device *dev)
/* get length from IP header as per Alan Cox bugfix for slip.c */ /* get length from IP header as per Alan Cox bugfix for slip.c */
if (len < sizeof(struct iphdr)) { if (len < sizeof(struct iphdr)) {
PRINTKN(0,(KERN_ERR "ppp_xmit: given runt packet, ignoring\n")); PRINTKN(0,(KERN_ERR "ppp_xmit: given runt packet, ignoring\n"));
return 1; goto done;
} }
len = ntohs( ((struct iphdr *)(skb->data)) -> tot_len ); len = ntohs( ((struct iphdr *)(skb->data)) -> tot_len );
...@@ -1750,8 +1763,8 @@ ppp_xmit(struct sk_buff *skb, struct device *dev) ...@@ -1750,8 +1763,8 @@ ppp_xmit(struct sk_buff *skb, struct device *dev)
/* try to compress, if VJ compression mode is on */ /* try to compress, if VJ compression mode is on */
if (ppp->flags & SC_COMP_TCP) { if (ppp->flags & SC_COMP_TCP) {
/* NOTE: last 0 argument says never to compress connection ID */ len = slhc_compress(ppp->slcomp, p, len, ppp->cbuff, &p,
len = slhc_compress(ppp->slcomp, p, len, ppp->cbuff, &p, 0); !(ppp->flags & SC_NO_TCP_CCID));
if (p[0] & SL_TYPE_COMPRESSED_TCP) if (p[0] & SL_TYPE_COMPRESSED_TCP)
proto = PROTO_VJCOMP; proto = PROTO_VJCOMP;
else { else {
...@@ -2055,10 +2068,25 @@ static struct device dev_ppp[PPP_NRUNIT] = { ...@@ -2055,10 +2068,25 @@ static struct device dev_ppp[PPP_NRUNIT] = {
0, 0, 0, 0, /* memory */ 0, 0, 0, 0, /* memory */
0, 0, /* base, irq */ 0, 0, /* base, irq */
0, 0, 0, NULL, ppp_init, 0, 0, 0, NULL, ppp_init,
}, }
{ "ppp1" , 0, 0, 0, 0, 1, 0, 0, 0, 0, NULL, ppp_init }, , { "ppp1" , 0, 0, 0, 0, 1, 0, 0, 0, 0, NULL, ppp_init }
{ "ppp2" , 0, 0, 0, 0, 2, 0, 0, 0, 0, NULL, ppp_init }, , { "ppp2" , 0, 0, 0, 0, 2, 0, 0, 0, 0, NULL, ppp_init }
{ "ppp3" , 0, 0, 0, 0, 3, 0, 0, 0, 0, NULL, ppp_init }, , { "ppp3" , 0, 0, 0, 0, 3, 0, 0, 0, 0, NULL, ppp_init }
#ifdef PPP_PPP_LOTS
, { "ppp4" , 0, 0, 0, 0, 4, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp5" , 0, 0, 0, 0, 5, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp6" , 0, 0, 0, 0, 6, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp7" , 0, 0, 0, 0, 7, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp8" , 0, 0, 0, 0, 8, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp9" , 0, 0, 0, 0, 9, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp10" , 0, 0, 0, 0, 10, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp11" , 0, 0, 0, 0, 11, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp12" , 0, 0, 0, 0, 12, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp13" , 0, 0, 0, 0, 13, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp14" , 0, 0, 0, 0, 14, 0, 0, 0, 0, NULL, ppp_init }
, { "ppp15" , 0, 0, 0, 0, 15, 0, 0, 0, 0, NULL, ppp_init }
#endif
}; };
int int
......
...@@ -1046,6 +1046,13 @@ slip_ioctl(struct tty_struct *tty, void *file, int cmd, void *arg) ...@@ -1046,6 +1046,13 @@ slip_ioctl(struct tty_struct *tty, void *file, int cmd, void *arg)
} }
} }
static int sl_open_dev(struct device *dev)
{
struct slip *sl = &sl_ctrl[dev->base_addr];
if(sl->tty==NULL)
return -ENODEV;
return 0;
}
/* Initialize the SLIP driver. Called by DDI. */ /* Initialize the SLIP driver. Called by DDI. */
int int
...@@ -1103,7 +1110,7 @@ slip_init(struct device *dev) ...@@ -1103,7 +1110,7 @@ slip_init(struct device *dev)
/* Finish setting up the DEVICE info. */ /* Finish setting up the DEVICE info. */
dev->mtu = SL_MTU; dev->mtu = SL_MTU;
dev->hard_start_xmit = sl_xmit; dev->hard_start_xmit = sl_xmit;
dev->open = sl_open; dev->open = sl_open_dev;
dev->stop = sl_close; dev->stop = sl_close;
dev->hard_header = sl_header; dev->hard_header = sl_header;
dev->type_trans = sl_type_trans; dev->type_trans = sl_type_trans;
......
...@@ -1242,7 +1242,8 @@ static int NCR53c8xx_run_tests (struct Scsi_Host *host) { ...@@ -1242,7 +1242,8 @@ static int NCR53c8xx_run_tests (struct Scsi_Host *host) {
sti(); sti();
timeout = jiffies + 50; /* arbitrary */ timeout = jiffies + 50; /* arbitrary */
while ((hostdata->test_completed == -1) && jiffies < timeout); while ((hostdata->test_completed == -1) && jiffies < timeout)
barrier();
failed = 1; failed = 1;
if (hostdata->test_completed == -1) if (hostdata->test_completed == -1)
...@@ -1330,7 +1331,8 @@ static int NCR53c8xx_run_tests (struct Scsi_Host *host) { ...@@ -1330,7 +1331,8 @@ static int NCR53c8xx_run_tests (struct Scsi_Host *host) {
sti(); sti();
timeout = jiffies + 500; /* arbitrary */ timeout = jiffies + 500; /* arbitrary */
while ((hostdata->test_completed == -1) && jiffies < timeout); while ((hostdata->test_completed == -1) && jiffies < timeout)
barrier();
NCR53c7x0_write32 (DSA_REG, 0); NCR53c7x0_write32 (DSA_REG, 0);
if (hostdata->test_completed == 2) { if (hostdata->test_completed == 2) {
......
...@@ -636,7 +636,8 @@ static int NCR5380_probe_irq (struct Scsi_Host *instance, int possible) { ...@@ -636,7 +636,8 @@ static int NCR5380_probe_irq (struct Scsi_Host *instance, int possible) {
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA |
ICR_ASSERT_SEL); ICR_ASSERT_SEL);
while (probe_irq == IRQ_NONE && jiffies < timeout); while (probe_irq == IRQ_NONE && jiffies < timeout)
barrier();
NCR5380_write(SELECT_ENABLE_REG, 0); NCR5380_write(SELECT_ENABLE_REG, 0);
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
...@@ -2147,8 +2148,8 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) { ...@@ -2147,8 +2148,8 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) {
*/ */
NCR5380_write(TARGET_COMMAND_REG, 0); NCR5380_write(TARGET_COMMAND_REG, 0);
while ((NCR5380_read(STATUS_REG) & SR_BSY) && while ((NCR5380_read(STATUS_REG) & SR_BSY) && !hostdata->connected)
!hostdata->connected); barrier();
return; return;
case MESSAGE_REJECT: case MESSAGE_REJECT:
/* Accept message by clearing ACK */ /* Accept message by clearing ACK */
...@@ -2187,8 +2188,8 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) { ...@@ -2187,8 +2188,8 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) {
/* Enable reselect interrupts */ /* Enable reselect interrupts */
NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
/* Wait for bus free to avoid nasty timeouts */ /* Wait for bus free to avoid nasty timeouts */
while ((NCR5380_read(STATUS_REG) & SR_BSY) && while ((NCR5380_read(STATUS_REG) & SR_BSY) && !hostdata->connected)
!hostdata->connected); barrier();
return; return;
/* /*
* The SCSI data pointer is *IMPLICITLY* saved on a disconnect * The SCSI data pointer is *IMPLICITLY* saved on a disconnect
......
...@@ -968,7 +968,7 @@ int aha152x_abort( Scsi_Cmnd *SCpnt) ...@@ -968,7 +968,7 @@ int aha152x_abort( Scsi_Cmnd *SCpnt)
/* sleep until the abortion is complete */ /* sleep until the abortion is complete */
while(!abortion_complete) while(!abortion_complete)
; barrier();
aborting=0; aborting=0;
return abort_result; return abort_result;
} }
......
...@@ -681,7 +681,8 @@ int aha1542_command(Scsi_Cmnd * SCpnt) ...@@ -681,7 +681,8 @@ int aha1542_command(Scsi_Cmnd * SCpnt)
aha1542_queuecommand(SCpnt, internal_done); aha1542_queuecommand(SCpnt, internal_done);
SCpnt->SCp.Status = 0; SCpnt->SCp.Status = 0;
while (!SCpnt->SCp.Status); while (!SCpnt->SCp.Status)
barrier();
return SCpnt->result; return SCpnt->result;
} }
......
...@@ -788,7 +788,7 @@ int buslogic_command(Scsi_Cmnd *scpnt) ...@@ -788,7 +788,7 @@ int buslogic_command(Scsi_Cmnd *scpnt)
scpnt->SCp.Status = 0; scpnt->SCp.Status = 0;
while (!scpnt->SCp.Status) while (!scpnt->SCp.Status)
continue; barrier();
return scpnt->result; return scpnt->result;
} }
#endif #endif
......
...@@ -462,7 +462,8 @@ int in2000_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) ...@@ -462,7 +462,8 @@ int in2000_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
if ( in2000_SCptr ) if ( in2000_SCptr )
{ {
printk("in2000_queue_command waiting for free command block!\n"); printk("in2000_queue_command waiting for free command block!\n");
while ( in2000_SCptr ); while ( in2000_SCptr )
barrier();
} }
for ( timeout = jiffies + 5; timeout > jiffies; ) for ( timeout = jiffies + 5; timeout > jiffies; )
{ {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994 Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994
(you can reference it, but it is incomplete and inaccurate in places) (you can reference it, but it is incomplete and inaccurate in places)
Version 0.41 Version 0.43 4/6/95 - kernel 1.2.0+, pcmcia 2.5.4+
Functions as standalone, loadable, and PCMCIA driver, the latter from Functions as standalone, loadable, and PCMCIA driver, the latter from
Dave Hind's PCMCIA package. Dave Hind's PCMCIA package.
...@@ -29,6 +29,11 @@ ...@@ -29,6 +29,11 @@
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
/* Configuration */ /* Configuration */
/* Set the following to 2 to use normal interrupt (active high/totempole-
tristate), otherwise use 0 (REQUIRED FOR PCMCIA) for active low, open
drain */
#define QL_INT_ACTIVE_HIGH 2
/* Set the following to 1 to enable the use of interrupts. Note that 0 tends /* Set the following to 1 to enable the use of interrupts. Note that 0 tends
to be more stable, but slower (or ties up the system more) */ to be more stable, but slower (or ties up the system more) */
#define QL_USE_IRQ 1 #define QL_USE_IRQ 1
...@@ -100,6 +105,8 @@ ...@@ -100,6 +105,8 @@
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
#ifdef PCMCIA #ifdef PCMCIA
#undef QL_INT_ACTIVE_HIGH
#define QL_INT_ACTIVE_HIGH 0
#define MODULE #define MODULE
#endif #endif
...@@ -143,7 +150,7 @@ static int qlcfgc = ( FASTCLK << 3 ) | ( FASTSCSI << 4 ); ...@@ -143,7 +150,7 @@ static int qlcfgc = ( FASTCLK << 3 ) | ( FASTSCSI << 4 );
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
/* The qlogic card uses two register maps - These macros select which one */ /* The qlogic card uses two register maps - These macros select which one */
#define REG0 ( outb( inb( qbase + 0xd ) & 0x7f , qbase + 0xd ), outb( 4 , qbase + 0xd )) #define REG0 ( outb( inb( qbase + 0xd ) & 0x7f , qbase + 0xd ), outb( 4 , qbase + 0xd ))
#define REG1 ( outb( inb( qbase + 0xd ) | 0x80 , qbase + 0xd ), outb( 0xb6 , qbase + 0xd )) #define REG1 ( outb( inb( qbase + 0xd ) | 0x80 , qbase + 0xd ), outb( 0xb4 | QL_INT_ACTIVE_HIGH , qbase + 0xd ))
/* following is watchdog timeout in microseconds */ /* following is watchdog timeout in microseconds */
#define WATCHDOG 5000000 #define WATCHDOG 5000000
...@@ -262,8 +269,10 @@ rtrc(7) ...@@ -262,8 +269,10 @@ rtrc(7)
static int ql_wai(void) static int ql_wai(void)
{ {
int i,k; int i,k;
k = 0;
i = jiffies + WATCHDOG; i = jiffies + WATCHDOG;
while ( i > jiffies && !qabort && !((k = inb(qbase + 4)) & 0xe0)); while ( i > jiffies && !qabort && !((k = inb(qbase + 4)) & 0xe0))
barrier();
if (i <= jiffies) if (i <= jiffies)
return (DID_TIME_OUT); return (DID_TIME_OUT);
if (qabort) if (qabort)
...@@ -420,8 +429,10 @@ rtrc(1) ...@@ -420,8 +429,10 @@ rtrc(1)
return (k << 16); return (k << 16);
/* should get bus service interrupt and disconnect interrupt */ /* should get bus service interrupt and disconnect interrupt */
i = inb(qbase + 5); /* should be bus service */ i = inb(qbase + 5); /* should be bus service */
while (!qabort && ((i & 0x20) != 0x20)) while (!qabort && ((i & 0x20) != 0x20)) {
barrier();
i |= inb(qbase + 5); i |= inb(qbase + 5);
}
rtrc(0) rtrc(0)
if (qabort) if (qabort)
return ((qabort == 1 ? DID_ABORT : DID_RESET) << 16); return ((qabort == 1 ? DID_ABORT : DID_RESET) << 16);
...@@ -493,7 +504,8 @@ int qlogic_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) ...@@ -493,7 +504,8 @@ int qlogic_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
cmd->scsi_done = done; cmd->scsi_done = done;
/* wait for the last command's interrupt to finish */ /* wait for the last command's interrupt to finish */
while (qlcmd != NULL); while (qlcmd != NULL)
barrier();
ql_icmd(cmd); ql_icmd(cmd);
return 0; return 0;
} }
...@@ -556,7 +568,6 @@ unsigned long flags; ...@@ -556,7 +568,6 @@ unsigned long flags;
outb(0x40 | qlcfg8 | qinitid, qbase + 8); /* (ini) bus id, disable scsi rst */ outb(0x40 | qlcfg8 | qinitid, qbase + 8); /* (ini) bus id, disable scsi rst */
outb(qlcfg5, qbase + 5); /* select timer */ outb(qlcfg5, qbase + 5); /* select timer */
outb(qlcfg9, qbase + 9); /* prescaler */ outb(qlcfg9, qbase + 9); /* prescaler */
qlirq = -1;
#if QL_RESET_AT_START #if QL_RESET_AT_START
outb( 3 , qbase + 3 ); outb( 3 , qbase + 3 );
REG1; REG1;
...@@ -565,6 +576,7 @@ unsigned long flags; ...@@ -565,6 +576,7 @@ unsigned long flags;
#endif #endif
#if QL_USE_IRQ #if QL_USE_IRQ
/* IRQ probe - toggle pin and check request pending */ /* IRQ probe - toggle pin and check request pending */
if( qlirq == -1 ) { if( qlirq == -1 ) {
save_flags( flags ); save_flags( flags );
cli(); cli();
...@@ -575,21 +587,24 @@ unsigned long flags; ...@@ -575,21 +587,24 @@ unsigned long flags;
outb(10, 0x20); /* access pending interrupt map */ outb(10, 0x20); /* access pending interrupt map */
outb(10, 0xa0); outb(10, 0xa0);
while (j--) { while (j--) {
outb(0xb2 , qbase + 0xd); /* int pin off */ outb(0xb0 | QL_INT_ACTIVE_HIGH , qbase + 0xd); /* int pin off */
i &= ~(inb(0x20) | (inb(0xa0) << 8)); /* find IRQ off */ i &= ~(inb(0x20) | (inb(0xa0) << 8)); /* find IRQ off */
outb(0xb6 , qbase + 0xd); /* int pin on */ outb(0xb4 | QL_INT_ACTIVE_HIGH , qbase + 0xd); /* int pin on */
i &= inb(0x20) | (inb(0xa0) << 8); /* find IRQ on */ i &= inb(0x20) | (inb(0xa0) << 8); /* find IRQ on */
} }
REG0; REG0;
while (inb(qbase + 5)); /* purge int */ while (inb(qbase + 5)); /* purge int */
j = -1;
while (i) /* find on bit */ while (i) /* find on bit */
i >>= 1, qlirq++; /* should check for exactly 1 on */ i >>= 1, j++; /* should check for exactly 1 on */
if (qlirq >= 0 && !request_irq(qlirq, ql_ihandl, 0, "qlogic")) qlirq = j;
host->can_queue = 1;
restore_flags( flags ); restore_flags( flags );
} }
else else
printk( "Ql: Using preset IRQ of %d\n", qlirq ); printk( "Ql: Using preset IRQ %d\n", qlirq );
if (qlirq >= 0 && !request_irq(qlirq, ql_ihandl, 0, "qlogic"))
host->can_queue = 1;
#endif #endif
request_region( qbase , 0x10 ,"qlogic"); request_region( qbase , 0x10 ,"qlogic");
hreg = scsi_register( host , 0 ); /* no host data */ hreg = scsi_register( host , 0 ); /* no host data */
...@@ -599,7 +614,7 @@ unsigned long flags; ...@@ -599,7 +614,7 @@ unsigned long flags;
if( qlirq != -1 ) if( qlirq != -1 )
hreg->irq = qlirq; hreg->irq = qlirq;
sprintf(qinfo, "Qlogic Driver version 0.41, chip %02X at %03X, IRQ %d, TPdma:%d", sprintf(qinfo, "Qlogic Driver version 0.43, chip %02X at %03X, IRQ %d, TPdma:%d",
qltyp, qbase, qlirq, QL_TURBO_PDMA ); qltyp, qbase, qlirq, QL_TURBO_PDMA );
host->name = qinfo; host->name = qinfo;
......
...@@ -369,7 +369,7 @@ void scan_scsis (struct Scsi_Host * shpnt) ...@@ -369,7 +369,7 @@ void scan_scsis (struct Scsi_Host * shpnt)
do it right and use a mutex */ do it right and use a mutex */
if (current == task[0]) if (current == task[0])
while (SCpnt->request.dev != 0xfffe); while (SCpnt->request.dev != 0xfffe) barrier();
else if (SCpnt->request.dev != 0xfffe) { else if (SCpnt->request.dev != 0xfffe) {
struct semaphore sem = MUTEX_LOCKED; struct semaphore sem = MUTEX_LOCKED;
...@@ -421,7 +421,7 @@ void scan_scsis (struct Scsi_Host * shpnt) ...@@ -421,7 +421,7 @@ void scan_scsis (struct Scsi_Host * shpnt)
256, scan_scsis_done, SCSI_TIMEOUT, 3); 256, scan_scsis_done, SCSI_TIMEOUT, 3);
if (current == task[0]) if (current == task[0])
while (SCpnt->request.dev != 0xfffe); while (SCpnt->request.dev != 0xfffe) barrier();
else if (SCpnt->request.dev != 0xfffe) { else if (SCpnt->request.dev != 0xfffe) {
struct semaphore sem = MUTEX_LOCKED; struct semaphore sem = MUTEX_LOCKED;
...@@ -584,7 +584,7 @@ void scan_scsis (struct Scsi_Host * shpnt) ...@@ -584,7 +584,7 @@ void scan_scsis (struct Scsi_Host * shpnt)
SCSI_TIMEOUT, 3); SCSI_TIMEOUT, 3);
if (current == task[0]) if (current == task[0])
while (SCpnt->request.dev != 0xfffe); while (SCpnt->request.dev != 0xfffe) barrier();
else if (SCpnt->request.dev != 0xfffe) { else if (SCpnt->request.dev != 0xfffe) {
struct semaphore sem = MUTEX_LOCKED; struct semaphore sem = MUTEX_LOCKED;
...@@ -1551,7 +1551,8 @@ int scsi_abort (Scsi_Cmnd * SCpnt, int why, int pid) ...@@ -1551,7 +1551,8 @@ int scsi_abort (Scsi_Cmnd * SCpnt, int why, int pid)
if (SCpnt->internal_timeout & IN_ABORT) if (SCpnt->internal_timeout & IN_ABORT)
{ {
restore_flags(flags); restore_flags(flags);
while (SCpnt->internal_timeout & IN_ABORT); while (SCpnt->internal_timeout & IN_ABORT)
barrier();
} }
else else
{ {
...@@ -1644,7 +1645,8 @@ int scsi_reset (Scsi_Cmnd * SCpnt) ...@@ -1644,7 +1645,8 @@ int scsi_reset (Scsi_Cmnd * SCpnt)
if (SCpnt->internal_timeout & IN_RESET) if (SCpnt->internal_timeout & IN_RESET)
{ {
restore_flags(flags); restore_flags(flags);
while (SCpnt->internal_timeout & IN_RESET); while (SCpnt->internal_timeout & IN_RESET)
barrier();
} }
else else
{ {
......
...@@ -89,7 +89,8 @@ static int sd_open(struct inode * inode, struct file * filp) ...@@ -89,7 +89,8 @@ static int sd_open(struct inode * inode, struct file * filp)
/* Make sure that only one process can do a check_change_disk at one time. /* Make sure that only one process can do a check_change_disk at one time.
This is also used to lock out further access when the partition table is being re-read. */ This is also used to lock out further access when the partition table is being re-read. */
while (rscsi_disks[target].device->busy); while (rscsi_disks[target].device->busy)
barrier();
if(rscsi_disks[target].device->removable) { if(rscsi_disks[target].device->removable) {
check_disk_change(inode->i_rdev); check_disk_change(inode->i_rdev);
...@@ -879,7 +880,7 @@ static int sd_init_onedisk(int i) ...@@ -879,7 +880,7 @@ static int sd_init_onedisk(int i)
512, sd_init_done, SD_TIMEOUT, 512, sd_init_done, SD_TIMEOUT,
MAX_RETRIES); MAX_RETRIES);
while(SCpnt->request.dev != 0xfffe); while(SCpnt->request.dev != 0xfffe) barrier();
the_result = SCpnt->result; the_result = SCpnt->result;
...@@ -905,7 +906,7 @@ static int sd_init_onedisk(int i) ...@@ -905,7 +906,7 @@ static int sd_init_onedisk(int i)
512, sd_init_done, SD_TIMEOUT, 512, sd_init_done, SD_TIMEOUT,
MAX_RETRIES); MAX_RETRIES);
while(SCpnt->request.dev != 0xfffe); while(SCpnt->request.dev != 0xfffe) barrier();
spintime = jiffies; spintime = jiffies;
}; };
...@@ -941,7 +942,7 @@ static int sd_init_onedisk(int i) ...@@ -941,7 +942,7 @@ static int sd_init_onedisk(int i)
MAX_RETRIES); MAX_RETRIES);
if (current == task[0]) if (current == task[0])
while(SCpnt->request.dev != 0xfffe); while(SCpnt->request.dev != 0xfffe) barrier();
else else
if (SCpnt->request.dev != 0xfffe){ if (SCpnt->request.dev != 0xfffe){
struct semaphore sem = MUTEX_LOCKED; struct semaphore sem = MUTEX_LOCKED;
......
...@@ -926,7 +926,7 @@ static void get_sectorsize(int i){ ...@@ -926,7 +926,7 @@ static void get_sectorsize(int i){
MAX_RETRIES); MAX_RETRIES);
if (current == task[0]) if (current == task[0])
while(SCpnt->request.dev != 0xfffe); while(SCpnt->request.dev != 0xfffe) barrier();
else else
if (SCpnt->request.dev != 0xfffe){ if (SCpnt->request.dev != 0xfffe){
struct semaphore sem = MUTEX_LOCKED; struct semaphore sem = MUTEX_LOCKED;
......
...@@ -320,9 +320,9 @@ static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst, ...@@ -320,9 +320,9 @@ static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
#if 0 #if 0
for (; i; --i) { for (; i; --i) {
while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY); while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY) barrier();
#else #else
while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY); while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY) barrier();
for (; i; --i) { for (; i; --i) {
#endif #endif
*d++ = *reg; *d++ = *reg;
...@@ -363,9 +363,9 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src ...@@ -363,9 +363,9 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src
#if 0 #if 0
for (; i; --i) { for (; i; --i) {
while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY); while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY) barrier();
#else #else
while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY); while (!(instance->base[T_STATUS_REG_OFFSET]) & T_ST_RDY) barrier();
for (; i; --i) { for (; i; --i) {
#endif #endif
*reg = *s++; *reg = *s++;
......
...@@ -733,13 +733,13 @@ int ultrastor_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) ...@@ -733,13 +733,13 @@ int ultrastor_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
retry: retry:
if (config.slot) if (config.slot)
while (inb(config.ogm_address - 1) != 0 && while (inb(config.ogm_address - 1) != 0 &&
config.aborted[mscp_index] == 0xff); config.aborted[mscp_index] == 0xff) barrier();
/* else??? */ /* else??? */
while ((inb(LCL_DOORBELL_INTR(config.doorbell_address)) & while ((inb(LCL_DOORBELL_INTR(config.doorbell_address)) &
(config.slot ? 2 : 1)) (config.slot ? 2 : 1))
&& config.aborted[mscp_index] == 0xff); && config.aborted[mscp_index] == 0xff) barrier();
/* To avoid race conditions, make the code to write to the adapter /* To avoid race conditions, make the code to write to the adapter
atomic. This simplifies the abort code. */ atomic. This simplifies the abort code. */
......
...@@ -941,7 +941,7 @@ int wd7000_command(Scsi_Cmnd *SCpnt) ...@@ -941,7 +941,7 @@ int wd7000_command(Scsi_Cmnd *SCpnt)
{ {
wd7000_queuecommand(SCpnt, wd7000_scsi_done); wd7000_queuecommand(SCpnt, wd7000_scsi_done);
while (SCpnt->SCp.phase > 0); /* phase counts scbs down to 0 */ while (SCpnt->SCp.phase > 0) barrier(); /* phase counts scbs down to 0 */
return SCpnt->result; return SCpnt->result;
} }
...@@ -964,7 +964,8 @@ int wd7000_diagnostics( Adapter *host, int code ) ...@@ -964,7 +964,8 @@ int wd7000_diagnostics( Adapter *host, int code )
*/ */
mail_out(host, (struct scb *) &icb); mail_out(host, (struct scb *) &icb);
timeout = jiffies + WAITnexttimeout; /* wait up to 2 seconds */ timeout = jiffies + WAITnexttimeout; /* wait up to 2 seconds */
while (icb.phase && jiffies < timeout) /* wait for completion */; while (icb.phase && jiffies < timeout)
barrier(); /* wait for completion */
if (icb.phase) { if (icb.phase) {
printk("wd7000_diagnostics: timed out.\n"); printk("wd7000_diagnostics: timed out.\n");
...@@ -1074,7 +1075,8 @@ void wd7000_revision(Adapter *host) ...@@ -1074,7 +1075,8 @@ void wd7000_revision(Adapter *host)
* which in turn means that scatter/gather will be disabled. * which in turn means that scatter/gather will be disabled.
*/ */
mail_out(host, (struct scb *) &icb); mail_out(host, (struct scb *) &icb);
while (icb.phase) /* wait for completion */; while (icb.phase)
barrier(); /* wait for completion */
host->rev1 = icb.primary; host->rev1 = icb.primary;
host->rev2 = icb.secondary; host->rev2 = icb.secondary;
} }
......
This diff is collapsed.
...@@ -77,6 +77,8 @@ extern int nr_running, nr_tasks; ...@@ -77,6 +77,8 @@ extern int nr_running, nr_tasks;
#ifdef __KERNEL__ #ifdef __KERNEL__
#define barrier() __asm__("": : :"memory")
extern void sched_init(void); extern void sched_init(void);
extern void show_state(void); extern void show_state(void);
extern void trap_init(void); extern void trap_init(void);
......
...@@ -255,6 +255,7 @@ struct tty_struct { ...@@ -255,6 +255,7 @@ struct tty_struct {
#define TTY_DEBUG 4 #define TTY_DEBUG 4
#define TTY_DO_WRITE_WAKEUP 5 #define TTY_DO_WRITE_WAKEUP 5
#define TTY_PUSH 6 #define TTY_PUSH 6
#define TTY_CLOSING 7
#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
......
...@@ -321,7 +321,6 @@ struct symbol_table symbol_table = { ...@@ -321,7 +321,6 @@ struct symbol_table symbol_table = {
X(n_tty_ioctl), X(n_tty_ioctl),
X(tty_register_ldisc), X(tty_register_ldisc),
X(kill_fasync), X(kill_fasync),
X(tty_hung_up_p),
#endif #endif
#ifdef CONFIG_SCSI #ifdef CONFIG_SCSI
/* Supports loadable scsi drivers */ /* Supports loadable scsi drivers */
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* AX.25 now works right, and SPX is feasible. * AX.25 now works right, and SPX is feasible.
* Alan Cox : Fixed write select of non IP protocol crash. * Alan Cox : Fixed write select of non IP protocol crash.
* Florian La Roche: Changed for my new skbuff handling. * Florian La Roche: Changed for my new skbuff handling.
* Darryl Miles : Fixed non-blocking SOCK_SEQPACKET.
* *
* Note: * Note:
* A lot of this will change when the protocol/socket separation * A lot of this will change when the protocol/socket separation
...@@ -191,6 +192,11 @@ int datagram_select(struct sock *sk, int sel_type, select_table *wait) ...@@ -191,6 +192,11 @@ int datagram_select(struct sock *sk, int sel_type, select_table *wait)
return(0); return(0);
case SEL_OUT: case SEL_OUT:
if (sk->type==SOCK_SEQPACKET && sk->state==TCP_SYN_SENT)
{
/* Connection still in progress */
return(0);
}
if (sk->prot && sk->prot->wspace(sk) >= MIN_WRITE_SPACE) if (sk->prot && sk->prot->wspace(sk) >= MIN_WRITE_SPACE)
{ {
return(1); return(1);
......
...@@ -2854,7 +2854,7 @@ static void tcp_conn_request(struct sock *sk, struct sk_buff *skb, ...@@ -2854,7 +2854,7 @@ static void tcp_conn_request(struct sock *sk, struct sk_buff *skb,
buff = newsk->prot->wmalloc(newsk, MAX_SYN_SIZE, 1, GFP_ATOMIC); buff = newsk->prot->wmalloc(newsk, MAX_SYN_SIZE, 1, GFP_ATOMIC);
if (buff == NULL) if (buff == NULL)
{ {
sk->err = -ENOMEM; sk->err = ENOMEM;
newsk->dead = 1; newsk->dead = 1;
newsk->state = TCP_CLOSE; newsk->state = TCP_CLOSE;
/* And this will destroy it */ /* And this will destroy it */
......
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