diff options
author | Linus Torvalds <torvalds@cc.helsinki.fi> | 1994-01-04 12:26:13 +0000 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2007-08-19 14:19:25 -0400 |
commit | 12a5cbbb06981b64fa0f8e3dc7ad3405b3d730a8 (patch) | |
tree | eb1d8930455514f746423da4eff1b95388e2af14 | |
parent | 8c14943430cec122e60f8065d087c095b5b54eca (diff) | |
download | archive-12a5cbbb06981b64fa0f8e3dc7ad3405b3d730a8.tar.gz |
ALPHA-pl14l
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | drivers/char/tty_ioctl.c | 28 | ||||
-rw-r--r-- | drivers/scsi/ultrastor.c | 14 | ||||
-rw-r--r-- | net/inet/icmp.c | 7 | ||||
-rw-r--r-- | net/inet/ip.c | 3 | ||||
-rw-r--r-- | net/inet/tcp.c | 3 | ||||
-rw-r--r-- | net/inet/udp.c | 3 |
7 files changed, 33 insertions, 30 deletions
@@ -1,6 +1,6 @@ VERSION = 0.99 PATCHLEVEL = 14 -ALPHA = k +ALPHA = l all: Version zImage @@ -210,6 +210,9 @@ lib: dummy mm: dummy $(MAKE) linuxsubdirs SUBDIRS=mm +ipc: dummy + $(MAKE) linuxsubdirs SUBDIRS=ipc + kernel: dummy $(MAKE) linuxsubdirs SUBDIRS=kernel diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 2e86bac..49d8514 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c @@ -1,7 +1,7 @@ /* - * linux/kernel/chr_drv/tty_ioctl.c + * linux/kernel/drivers/char/tty_ioctl.c * - * Copyright (C) 1991, 1992 Linus Torvalds + * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds * * Modified by Fred N. van Kempen, 01/29/93, to add line disciplines * which can be dynamically activated and de-activated by the line @@ -406,6 +406,25 @@ static int tty_set_ldisc(struct tty_struct *tty, int ldisc) return 0; } +static int inq_canon(struct tty_struct * tty) +{ + int nr, head, tail; + + if (!tty->secondary.data) + return 0; + head = tty->secondary.head; + tail = tty->secondary.tail; + nr = (head - tail) & (TTY_BUF_SIZE-1); + /* Skip EOF-chars.. */ + if (EOF_CHAR(tty) == __DISABLED_CHAR) + return nr; + while (head != tail) { + if (tty->secondary.buf[tail] == EOF_CHAR(tty)) + nr--; + INC(tail); + } + return nr; +} int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg) @@ -557,8 +576,9 @@ int tty_ioctl(struct inode * inode, struct file * file, retval = verify_area(VERIFY_WRITE, (void *) arg,4); if (retval) return retval; - if (L_CANON(tty) && !tty->secondary.data) - put_fs_long(0, (unsigned long *) arg); + if (L_CANON(tty)) + put_fs_long(inq_canon(tty), + (unsigned long *) arg); else put_fs_long(CHARS(&tty->secondary), (unsigned long *) arg); diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index d59398b..c2564b9 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c @@ -302,20 +302,6 @@ static inline unsigned char xchgb(unsigned char reg, return reg; } -static inline void outl(unsigned int value, unsigned short port) -{ -__asm__ __volatile__ ("outl %%al,%%dx" - : :"a" (value),"d" ((unsigned short) port)); -} - -static inline unsigned int inl(unsigned short port) -{ - unsigned int _v; -__asm__ __volatile__ ("inl %%dx,%%eax" - :"=a" (_v):"d" ((unsigned short) port),"0" (0)); - return _v; -} - #if ULTRASTOR_DEBUG & (UD_COMMAND | UD_ABORT) static void log_ultrastor_abort(register struct ultrastor_config *config, diff --git a/net/inet/icmp.c b/net/inet/icmp.c index 31049b9..abd1cb5 100644 --- a/net/inet/icmp.c +++ b/net/inet/icmp.c @@ -357,6 +357,7 @@ icmp_rcv(struct sk_buff *skb1, struct device *dev, struct options *opt, unsigned long saddr, int redo, struct inet_protocol *protocol) { struct icmphdr *icmph; + unsigned char *buff; /* Drop broadcast packets. */ if (chk_addr(daddr) == IS_BROADCAST) { @@ -367,10 +368,8 @@ icmp_rcv(struct sk_buff *skb1, struct device *dev, struct options *opt, return(0); } - /* Skip IP-Header */ - len -= skb1->h.iph->ihl << 2; - skb1->h.raw += skb1->h.iph->ihl << 2; - icmph = (struct icmphdr *) skb1->h.raw; + buff = skb1->h.raw; + icmph = (struct icmphdr *) buff; /* Validate the packet first */ if (ip_compute_csum((unsigned char *) icmph, len)) { diff --git a/net/inet/ip.c b/net/inet/ip.c index 5f76d91..4c9f924 100644 --- a/net/inet/ip.c +++ b/net/inet/ip.c @@ -1267,6 +1267,7 @@ ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) } /* Point into the IP datagram, just past the header. */ + skb->h.raw += iph->ihl*4; hash = iph->protocol & (MAX_INET_PROTOS -1); for (ipprot = (struct inet_protocol *)inet_protos[hash]; ipprot != NULL; @@ -1305,7 +1306,7 @@ ip_rcv(struct sk_buff *skb, struct device *dev, struct packet_type *pt) * check the protocol handler's return values here... */ ipprot->handler(skb2, dev, opts_p ? &opt : 0, iph->daddr, - ntohs(iph->tot_len), + (ntohs(iph->tot_len) - (iph->ihl * 4)), iph->saddr, 0, ipprot); } diff --git a/net/inet/tcp.c b/net/inet/tcp.c index c3be0bc..83dfb41 100644 --- a/net/inet/tcp.c +++ b/net/inet/tcp.c @@ -2934,9 +2934,6 @@ tcp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt, DPRINTF((DBG_TCP, "tcp.c: tcp_rcv dev = NULL\n")); return(0); } - /* Skip IP-Header */ - len -= skb->h.iph->ihl << 2; - skb->h.raw += skb->h.iph->ihl << 2; th = skb->h.th; /* Find the socket. */ diff --git a/net/inet/udp.c b/net/inet/udp.c index 74e0a2e..78066c3 100644 --- a/net/inet/udp.c +++ b/net/inet/udp.c @@ -550,9 +550,6 @@ udp_rcv(struct sk_buff *skb, struct device *dev, struct options *opt, struct sock *sk; struct udphdr *uh; - /* Skip IP-Header */ - len -= skb->h.iph->ihl << 2; - skb->h.raw += skb->h.iph->ihl << 2; uh = (struct udphdr *) skb->h.uh; sk = get_sock(&udp_prot, uh->dest, saddr, uh->source, daddr); if (sk == NULL) |