Commit 3ba1ba97 authored by Linus Torvalds's avatar Linus Torvalds

Import 0.99.14w

parent b168ffdf
VERSION = 0.99
PATCHLEVEL = 14
ALPHA = v
ALPHA = w
all: Version zImage
......
......@@ -12,7 +12,7 @@
*/
static char *version =
"atp.c:v0.02 12/22/93 Donald Becker (becker@super.org)\n";
"atp.c:v0.03 1/19/94 Donald Becker (becker@super.org)\n";
/*
This file is a device driver for the RealTek (aka AT-Lan-Tec) pocket
......@@ -623,6 +623,12 @@ net_interrupt(int reg_ptr)
break;
}
{
int i;
for (i = 0; i < 6; i++)
write_reg_byte(ioaddr, PAR0 + i, dev->dev_addr[i]);
}
/* Tell the adaptor that it can go back to using the output line as IRQ. */
write_reg(ioaddr, CMR2, CMR2_IRQOUT);
/* Enable the physical interrupt line, which is sure to be low until.. */
......
......@@ -17,7 +17,7 @@
/* Routines for the NatSemi-based designs (NE[12]000). */
static char *version =
"ne.c:v0.99-14a 12/3/93 Donald Becker (becker@super.org)\n";
"ne.c:v0.99-15 1/19/93 Donald Becker (becker@super.org)\n";
#include <linux/config.h>
#include <linux/kernel.h>
......@@ -123,6 +123,10 @@ static int neprobe1(int ioaddr, struct device *dev, int verbose)
printk("NE*000 ethercard probe at %#3x:", ioaddr);
/* First hard-reset the ethercard. */
i = inb_p(ioaddr + NE_RESET);
outb_p(i, ioaddr + NE_RESET);
/* Read the 16 bytes of station address prom, returning 1 for
an eight-bit interface and 2 for a 16-bit interface.
We must first initialize registers, similar to NS8390_init(eifdev, 0).
......@@ -158,8 +162,8 @@ static int neprobe1(int ioaddr, struct device *dev, int verbose)
/* We must set the 8390 for word mode, AND RESET IT. */
int tmp;
outb_p(0x49, ioaddr + EN0_DCFG);
tmp = inb_p(NE_BASE + NE_RESET);
outb(tmp, NE_BASE + NE_RESET);
tmp = inb_p(ioaddr + NE_RESET);
outb(tmp, ioaddr + NE_RESET);
/* Un-double the SA_prom values. */
for (i = 0; i < 16; i++)
SA_prom[i] = SA_prom[i+i];
......
......@@ -583,57 +583,8 @@ sl_header(unsigned char *buff, struct device *dev, unsigned short type,
{
#ifdef CONFIG_AX25
struct slip *sl=&sl_ctrl[dev->base_addr];
unsigned long flags;
if((sl->mode&SL_MODE_AX25) && type!=NET16(ETH_P_AX25))
{
/* header is an AX.25 UI frame from us to them */
if(chk_addr(daddr) == IS_BROADCAST)
{
*buff++=0;
memcpy(buff,dev->broadcast,dev->addr_len); /* QST-0 */
}
else
{
if(type!=ETH_P_IP)
printk("AX25 Encap: Non IP frame to encapsulate directed\n");
save_flags(flags);
cli();
*buff++=0; /* KISS DATA */
memcpy(buff,&daddr,4); /* In case arp fails */
if(arp_find(buff,daddr,dev, saddr))
{
memcpy(buff+7,&saddr,4);
buff+=14;
*buff++=LAPB_UI; /* UI */
/* Append a suitable AX.25 PID */
*buff++=PID_IP; /* AX25 IP */
restore_flags(flags);
return ( -dev->hard_header_len);
}
}
buff[6]&=~LAPB_C;
buff[6]&=~LAPB_E;
buff+=7;
memcpy(buff,dev->dev_addr,dev->addr_len);
buff[6]&=~LAPB_C;
buff[6]|=LAPB_E;
buff+=7;
*buff++=LAPB_UI; /* UI */
/* Append a suitable AX.25 PID */
switch(type)
{
case ETH_P_IP:
*buff++=PID_IP; /* AX25 IP */
break;
case ETH_P_ARP:
*buff++=PID_ARP;
break;
default:
*buff++=0;
}
return (17);
}
return ax25_encapsulate_ip(buff,dev,type,daddr,saddr,len);
#endif
return(0);
......@@ -661,19 +612,7 @@ sl_rebuild_header(void *buff, struct device *dev)
struct slip *sl=&sl_ctrl[dev->base_addr];
if(sl->mode&SL_MODE_AX25)
{
unsigned char *bp=(unsigned char *)buff;
long dest=*(long *)(bp+1);
long src=*(long *)(bp+8);
if(arp_find(bp+1,dest,dev,src))
return 1;
memcpy(bp+8,dev->dev_addr,7);
bp[7]&=~LAPB_C;
bp[7]&=~LAPB_E;
bp[14]&=~LAPB_C;
bp[14]|=LAPB_E;
return(0);
}
return ax25_rebuild_header(buff,dev);
#endif
return(0);
}
......
......@@ -508,7 +508,7 @@ void wd7000_revision(void)
}
static const char *wd_bases[] = {(char *)0xce000,(char *)d8000};
static const char *wd_bases[] = {(char *)0xce000,(char *)0xd8000};
typedef struct {
char * signature;
......
......@@ -134,6 +134,7 @@ packet_sendto(struct sock *sk, unsigned char *from, int len,
memcpy_fromfs(skb->data, from, len);
skb->len = len;
skb->next = NULL;
skb->arp = 1;
if (dev->flags & IFF_UP) dev->queue_xmit(skb, dev, sk->priority);
else kfree_skb(skb, FREE_WRITE);
return(len);
......
......@@ -1157,7 +1157,7 @@ inet_connect(struct socket *sock, struct sockaddr * uaddr,
sock->state = SS_UNCONNECTED;
err=sk->err;
sk->err=0;
return(err);
return(-err);
}
return(0);
}
......
......@@ -2926,6 +2926,10 @@ tcp_connect(struct sock *sk, struct sockaddr_in *usin, int addr_len)
return(-ENETUNREACH);
}
/* Connect back to the same socket: Blows up so disallow it */
if(sk->saddr == sin.sin_addr.s_addr && sk->num==ntohs(sin.sin_port))
return -EBUSY;
sk->inuse = 1;
sk->daddr = sin.sin_addr.s_addr;
sk->send_seq = jiffies * SEQ_TICK - seq_offset;
......
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