/shark/trunk/drivers/newnet/netbuff.h |
---|
20,11 → 20,11 |
/** |
------------ |
CVS : $Id: netbuff.h,v 1.1 2004-04-23 14:30:34 mauro Exp $ |
CVS : $Id: netbuff.h,v 1.2 2004-04-23 18:13:52 mauro Exp $ |
File: $File$ |
Revision: $Revision: 1.1 $ |
Last update: $Date: 2004-04-23 14:30:34 $ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-23 18:13:52 $ |
------------ |
**/ |
/shark/trunk/drivers/newnet/8390.c |
---|
98,8 → 98,9 |
#define ei_get_8390_hdr (ei_local->get_8390_hdr) |
/* use 0 for production, 1 for verification, >2 for debug */ |
//#define VERBOSE_ERROR_DUMP |
#ifndef ei_debug |
int ei_debug = 1; |
int ei_debug = 0; |
#endif |
/* Index to functions. */ |
1058,6 → 1059,7 |
{ |
outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i)); |
if(inb_p(e8390_base + EN1_PHYS_SHIFT(i))!=dev->dev_addr[i]) |
if (ei_debug > 0) |
printk(KERN_ERR "Hw. address read/write mismap %d\n",i); |
} |
/shark/trunk/drivers/newnet/3c509.c |
---|
70,10 → 70,11 |
#include <asm/io.h> |
#include <asm/irq.h> |
//#define EL3_DEBUG debug |
#ifdef EL3_DEBUG |
int el3_debug = EL3_DEBUG; |
#else |
int el3_debug = 2; |
int el3_debug = 0; |
#endif |
/* To minimize the size of the driver source I only define operating |
/shark/trunk/drivers/newnet/net_init.c |
---|
190,7 → 190,7 |
} |
else if (dev != ethdev_index[i]) { |
/* Really shouldn't happen! */ |
printk("ether_setup: Ouch! Someone else took %s\n", |
printk(KERN_ERR "ether_setup: Ouch! Someone else took %s\n", |
dev->name); |
} |
} |
320,7 → 320,7 |
for (i = 0; i < MAX_ETH_CARDS; ++i) |
if (ethdev_index[i] == NULL) { |
sprintf(dev->name, "eth%d", i); |
printk("loading device '%s'...\n", dev->name); |
printk(KERN_INFO "Loading device '%s'...\n", dev->name); |
ethdev_index[i] = dev; |
break; |
} |
/shark/trunk/drivers/newnet/3c59x.c |
---|
107,7 → 107,7 |
static int max_interrupt_work = 20; |
/* Put out somewhat more debugging messages. (0: no msg, 1 minimal .. 6). */ |
#define vortex_debug debug |
//#define vortex_debug debug |
#ifdef VORTEX_DEBUG |
static int vortex_debug = VORTEX_DEBUG; |
#else |
/shark/trunk/drivers/newnet/eth.c |
---|
20,11 → 20,11 |
/** |
------------ |
CVS : $Id: eth.c,v 1.1 2004-04-23 14:30:32 mauro Exp $ |
CVS : $Id: eth.c,v 1.2 2004-04-23 18:13:51 mauro Exp $ |
File: $File$ |
Revision: $Revision: 1.1 $ |
Last update: $Date: 2004-04-23 14:30:32 $ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-23 18:13:51 $ |
------------ |
**/ |
74,7 → 74,7 |
/*#include "lowlev.h" |
//#include "3com.h" */ |
#define DEBUG_ETH |
//#define DEBUG_ETH |
#define ETH_PAGE 5 |
128,12 → 128,9 |
kern_raise(ETH_NULLPROTOCOL_EXC,NIL); |
} |
void dev_tint(struct device *dev) |
{ |
printk(KERN_WARNING "Warning!!!! dev_tint called!!! (Why?)\n"); |
printk(KERN_WARNING "Warning! dev_tint called. (Why?)\n"); |
sys_abort(201); |
} |
152,7 → 149,7 |
} |
port_send(NetRxPort,skb,NON_BLOCK); |
/* task_activate(nettask_pid);*/ |
// task_activate(nettask_pid); |
} |
TASK net_extern_driver(void) |
361,7 → 358,7 |
printk(KERN_ERR "NET PANIC --> Etherlink not found.\n"); |
return 0; |
case ETH_RXERROR : |
printk(KERN_ERR "Receive error (vero dramma!!!).\n"); |
printk(KERN_ERR "Receive error.\n"); |
return 0; |
case ETH_TXERROR : |
printk(KERN_ERR "Transimit error: N. Max Retry.\n"); |
373,7 → 370,7 |
printk(KERN_ERR "Buffers full: frame lost!\n"); |
return 1; |
case ETH_NULLPROTOCOL_EXC: |
printk(KERN_ERR "Null protocol called!!!\n"); |
printk(KERN_ERR "Null protocol called!\n"); |
for (p = 0; p < ETH_MAX_PROTOCOLS; p++) { |
printk(KERN_ERR "%d: %d\n", p, eth_table[p].type); |
} |
525,7 → 522,7 |
printk(KERN_INFO "Network card found.\n"); |
} else { |
printk(KERN_INFO "No network card found.\n"); |
/* cprintf("No card found... Installing loopback device\n"); |
/* cprintf("No network card found. Installing loopback device.\n"); |
loopback_init(&device0); |
device0.open(&device0);*/ |
return 0; |
/shark/trunk/drivers/newnet/skbuff.c |
---|
69,9 → 69,7 |
unsigned long offset; |
int headroom = skb_headroom(skb); |
/* |
* Allocate the copy buffer |
*/ |
/* Allocate the copy buffer */ |
n=alloc_skb(skb->truesize+newheadroom-headroom, GFP_ATOMIC); |
if(n==NULL) |
87,6 → 85,7 |
/* Set the tail pointer and length */ |
skb_put(n,skb->len); |
/* Copy the bytes */ |
memcpy(n->data,skb->data,skb->len); |
n->list=NULL; |
/shark/trunk/drivers/newnet/udpip.c |
---|
20,11 → 20,11 |
/** |
------------ |
CVS : $Id: udpip.c,v 1.1 2004-04-23 14:30:35 mauro Exp $ |
CVS : $Id: udpip.c,v 1.2 2004-04-23 18:13:53 mauro Exp $ |
File: $File$ |
Revision: $Revision: 1.1 $ |
Last update: $Date: 2004-04-23 14:30:35 $ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-23 18:13:53 $ |
------------ |
**/ |
67,6 → 67,11 |
#include <drivers/udpip.h> |
#include "arp.h" |
//#define __UDP_DBG__ |
//#define __IP_DBG__ |
#define UDP_INFO "[UDP] " |
#define IP_INFO "[IP] " |
/* |
UDP-buffers number and dimension (UDP-buffers are provided by NetBuff |
module |
103,6 → 108,7 |
for (i=0; i < 4; i++) |
if (ip1.ad[i] != ip2.ad[i]) return FALSE; |
return TRUE; |
} |
125,7 → 131,9 |
i++; |
} |
for (i=0; i<4; i++) ip->ad[i] = ad[i]; |
for (i=0; i<4; i++) |
ip->ad[i] = ad[i]; |
return 1; |
} |
158,10 → 166,11 |
sprintf(dummystr, "Packet arrived!\n"); |
iphd = (IP_HEADER *)eth_getFDB(pkt); |
/* compute the checksum */ |
ptcheck = (WORD *)iphd; |
#ifdef __IP_DBG__ |
ip_print_header(iphd); |
//!!!ip_print_header(iphd); |
#endif |
hlen = getHlen(iphd->vers_hlen) * 2; |
checksum = oldChk = *ptcheck; |
175,21 → 184,20 |
if (checksum != 0xffff) { |
/* wrong ChkSum */ |
#ifdef __IP_DBG__ |
sprintf(msg, "Wrong checksum! %x\n",checksum); |
win_puts(&wip,msg); |
printk(KERN_DEBUG IP_INFO "Wrong checksum: %x.\n", checksum); |
#endif |
} else if (!ip_compAddr(iphd->dest,myIpAddr)) { |
#ifdef __IP_DBG__ |
win_puts(&wip,"Packet not addressed to this host!\n"); |
printk(KERN_DEBUG IP_INFO "Packet not addressed to this host.\n"); |
#endif |
} else if (getFlags(ntohs(iphd->flags_frOffset)) & 0x01) { |
#ifdef __IP_DBG__ |
/* fragment? */ |
win_puts(&wip,"Gotta a fragment!\n"); |
printk(KERN_DEBUG IP_INFO "Gotta a fragment!\n"); |
#endif |
} else if (getFrOffset(ntohs(iphd->flags_frOffset)) != 0) { |
#ifdef __IP_DBG__ |
win_puts(&wip,"Gotta a fragment again!\n"); |
printk(KERN_DEBUG IP_INFO "Gotta a fragment again!\n"); |
#endif |
} else { |
/* OK: the packet is good... */ |
204,7 → 212,7 |
if (!done) { |
#ifdef __IP_DBG__ |
/* Unknown transport protocol */ |
win_puts(&wip,"Wrong protocol\n"); |
printk(KERN_DEBUG IP_INFO "Wrong protocol.\n"); |
#endif |
} else { |
/* Call the correct transport protocol CallBack */ |
213,6 → 221,7 |
} else { |
/* UDP packet */ |
netlev = 4; |
udphd = (UDP_HEADER *)(void *)((BYTE *)iphd + 4*getHlen(iphd->vers_hlen)); |
/* compute the UDP checksum */ |
for (i = 0; i < 4; i++) { |
231,8 → 240,7 |
old = sum; |
} |
#ifdef __UDP_DBG__ |
sprintf(str,"half sum: %x\n",sum); |
win_puts(&dbg,str); |
printk(KERN_DEBUG UDP_INFO "Half sum: %x\n",sum); |
#endif |
p = (WORD *)udphd; |
((BYTE *)udphd)[ntohs(udphd->mlen)] = 0; |
242,21 → 250,16 |
old = sum; |
} |
#ifdef __UDP_DBG__ |
win_puts(&dbg,"UDP packet received!!!\n"); |
sprintf(str,"s_port: %x\n",udphd->s_port); |
win_puts(&dbg,str); |
sprintf(str,"d_port: %x\n",udphd->d_port); |
win_puts(&dbg,str); |
sprintf(str,"m_len: %x %d\n",udphd->mlen, ntohs(udphd->mlen)); |
win_puts(&dbg,str); |
sprintf(str,"checksum: %x\n",udphd->checksum); |
win_puts(&dbg,str); |
sprintf(str,"mysum: %x \n", sum); |
win_puts(&dbg,str); |
printk(KERN_DEBUG UDP_INFO "Packet received.\n"); |
printk(KERN_DEBUG UDP_INFO "s_port: %x\n",udphd->s_port); |
printk(KERN_DEBUG UDP_INFO "d_port: %x\n",udphd->d_port); |
printk(KERN_DEBUG UDP_INFO "m_len: %x %d\n",udphd->mlen, ntohs(udphd->mlen)); |
printk(KERN_DEBUG UDP_INFO "checksum: %x\n",udphd->checksum); |
printk(KERN_DEBUG UDP_INFO "mysum: %x \n", sum); |
#endif |
if(sum != 0xFFFF) { |
/* Wrong UDP ChkSum */ |
cprintf("Error %x!!!!\n",sum); |
cprintf("Error %x!\n", sum); |
kern_raise(XUDP_BADCHK_EXC,exec_shadow); |
} else { |
done = FALSE; |
263,8 → 266,7 |
i = 0; |
/* searching for the destination socket...*/ |
while((i < UDP_MAX_HANDLES) && !done) { |
if ((udpTable[i].valid == TRUE) && |
(udpTable[i].port == ntohs(udphd->d_port))) |
if ((udpTable[i].valid == TRUE) && (udpTable[i].port == ntohs(udphd->d_port))) |
done = TRUE; |
else i++; |
} |
287,7 → 289,7 |
if (!flag) { |
netbuff_release(&udp_rxbuff, b); |
#ifdef __UDP_DBG__ |
win_puts(&dbg,"Port is filled up "); |
printk(KERN_DEBUG "Port is filled up.\n"); |
#endif |
} |
} |
294,7 → 296,7 |
} |
} else { |
#ifdef __UDP_DBG__ |
win_puts(&dbg,"Port not found "); |
printk(KERN_DEBUG UDP_INFO "Port not found.\n"); |
#endif |
} |
} |
310,9 → 312,6 |
WORD check = 0, oldCheck = 0; |
int i, done; |
WORD *pt; |
#ifdef __IP_DBG__ |
char msg[50]; |
#endif |
iphd = (IP_HEADER *)eth_getFDB(pkt); |
iphd->vers_hlen = (4 << 4) + 5; |
339,8 → 338,7 |
check = ~check; |
iphd->headChecksum = check; |
#ifdef __IP_DBG__ |
sprintf(msg,"serv type : %d\n",iphd->servType); |
win_puts(&wip,msg); |
printk(KERN_DEBUG IP_INFO "Serv type : %d\n", iphd->servType); |
#endif |
/* Is the destination IP address the broadcast address?*/ |
if (ip_compAddr(dest,IPbroadcastaddress)) { |
380,7 → 378,8 |
while (i < IP_MAX_ENTRIES && !done) |
if (ipTable[i].rfun == NULL) done = TRUE; |
else i++; |
if (!done) return FALSE; |
if (!done) |
return FALSE; |
else { |
ipTable[i].protocol = proto; |
ipTable[i].rfun = recv; |
388,12 → 387,12 |
return TRUE; |
} |
//int ip_error(int code) |
//{ |
// cprintf("IP error\n"); |
/* cprintf("Code [%d]\nCause : %s",code,ip_error_msg[code-IP_ERROR_BASE]);*/ |
// return(0); |
//} |
/*int ip_error(int code) |
{ |
cprintf("IP error\n"); |
cprintf("Code [%d]\nCause : %s",code,ip_error_msg[code-IP_ERROR_BASE]); |
return(0); |
}*/ |
/* Initialize the IP layer: it also call the ARP initialization function, pass a struct ip_params* */ |
void ip_init(void *p) |
403,13 → 402,15 |
if (!ipIsInstalled) { |
arp_init(((struct ip_params*)p)->localAddr); |
//exc_set(IP_INIT_ERROR,ip_error); |
for (i=0; i < IP_MAX_ENTRIES; i++) ipTable[i].rfun = NULL; |
for (i=0; i < IP_MAX_ENTRIES; i++) |
ipTable[i].rfun = NULL; |
eth_setProtocol(ETH_IP_TYPE, ip_server_recv); |
ip_str2addr(((struct ip_params*)p)->broadcastAddr,&IPbroadcastaddress); |
ipIsInstalled = TRUE; |
eth_str2Addr("FF:FF:FF:FF:FF:FF",&broadcast); |
} else cprintf("IP: already installed!!!\n"); |
} else |
cprintf("IP: already installed.\n"); |
} |
/* Receive an UDP packet from a socket */ |
421,6 → 422,7 |
memcpy(buff,u.buff,u.mlen); |
netbuff_release(&udp_rxbuff, u.buff); |
*from = u.addr; |
return (u.mlen); |
} |
432,10 → 434,12 |
return 1; |
} |
if (udpTable[s].valid != TRUE) return -1; |
if (udpTable[s].valid != TRUE) |
return -1; |
udpTable[s].notify = TRUE; |
udpTable[s].notify_fun = f; |
udpTable[s].notify_par = p; |
return 1; |
} |
456,8 → 460,11 |
} else i++; |
kern_sti(); |
} |
/* No free entries: bind fail! */ |
if (!done) return -1; |
if (!done) |
return -1; |
/* Create a receive port for the socket */ |
udpTable[i].port = local->s_port; |
sprintf(str,"UDP%d",i); |
464,9 → 471,10 |
udpTable[i].hport = port_create(str,sizeof(UDP_MSG),4,STREAM,WRITE); |
udpTable[i].pport = port_connect(str,sizeof(UDP_MSG),STREAM,READ); |
udpTable[i].valid = TRUE; |
/* |
Request for the ethernet addresses associated to the IP addressed |
given in the bindlist |
* Request for the ethernet addresses associated to the IP addressed |
* given in the bindlist. |
*/ |
if (bindlist != NULL) { |
while (*(int*)bindlist != 0) { |
488,10 → 496,11 |
void *pkt; |
UDP_HEADER *udphd; |
char *msg; |
#ifdef __UDP_DBG__ |
static int num_pack = 0; |
char str[50]; |
#endif |
WORD sum, old; |
int i; |
struct pseudo_hd ph; |
535,8 → 544,7 |
ip_send(to->s_addr, pkt, ((WORD)nbytes + sizeof(UDP_HEADER))); |
#ifdef __UDP_DBG__ |
sprintf(str,"Packet sent %d; ",num_pack++); |
win_puts(&dbg,str); |
printk(KERN_DEBUG UDP_INFO "Packets sent: %d.\n", num_pack++); |
#endif |
return nbytes; |
555,5 → 563,6 |
udpTable[i].notify = FALSE; |
} |
udpIsInstalled = TRUE; |
} else cprintf("UDP: Already installed!!!\n"); |
} else |
printk(KERN_WARNING UDP_INFO ": Already installed.\n"); |
} |
/shark/trunk/drivers/newnet/arp.c |
---|
20,11 → 20,11 |
/** |
------------ |
CVS : $Id: arp.c,v 1.1 2004-04-23 14:30:32 mauro Exp $ |
CVS : $Id: arp.c,v 1.2 2004-04-23 18:13:51 mauro Exp $ |
File: $File$ |
Revision: $Revision: 1.1 $ |
Last update: $Date: 2004-04-23 14:30:32 $ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-23 18:13:51 $ |
------------ |
**/ |
71,6 → 71,9 |
#include "arp.h" |
#include <signal.h> |
//#define __ARP_DBG__ |
#define ARP_INFO "[ARP] " |
#define FALSE 0 |
#define TRUE 1 |
#define PENDING 2 |
136,7 → 139,7 |
} |
} |
if (j == -1) { |
cprintf("ARP table overflow!!!\n"); |
cprintf("ARP table overflow.\n"); |
sys_abort(AARPFULL); |
} |
arpTable[j].valid = FALSE; |
173,9 → 176,6 |
{ |
int i; |
PKT_NXT *p, *p1; |
#ifdef __ARP_DBG__ |
char msg[100]; |
#endif |
while (1) { |
/* mutual exclusion on the ARP table */ |
192,14 → 192,12 |
p1 = p->next; |
netbuff_release(&udp_txbuff, (void *)p); |
#ifdef __ARP_DBG__ |
sprintf(msg,"Pacchetto : %lp scartato\n",p); |
win_puts(&w1,msg); |
printk(KERN_DEBUG ARP_INFO "Pacchetto : %lp scartato.\n",p); |
#endif |
p = p1; |
} |
arpTable[i].valid = FALSE; |
} |
else { |
} else { |
arp_sendRequest(i); |
arpTable[i].time = ARP_TIMEOUT; |
} |
221,26 → 219,22 |
if (arpTable[j].valid == FALSE) { |
done = 1; |
arpTable[j].valid = PENDING; |
} else j++; |
} else |
j++; |
} |
if (!done) return -1; |
if (!done) |
return -1; |
/* Fill the entry */ |
setIpAddr(arpTable[j].ip, dest); |
#ifdef __ARP_DBG__ |
sprintf(msg,"Indirizzo : %d.%d.%d.%d\n",dest.ad[0], |
dest.ad[1], |
dest.ad[2], |
dest.ad[3]); |
win_puts(&w1,msg); |
sprintf(msg,"Indirizzo : %d.%d.%d.%d\n",arpTable[j].ip.ad[0], |
arpTable[j].ip.ad[1], |
arpTable[j].ip.ad[2], |
arpTable[j].ip.ad[3]); |
win_puts(&w1,msg); |
printk(KERN_DEBUG ARP_INFO "Indirizzo : %d.%d.%d.%d\n",dest.ad[0], dest.ad[1], dest.ad[2], dest.ad[3]); |
printk(KERN_DEBUG ARP_INFO "Indirizzo : %d.%d.%d.%d\n",arpTable[j].ip.ad[0], arpTable[j].ip.ad[1], arpTable[j].ip.ad[2], arpTable[j].ip.ad[3]); |
#endif |
arpTable[j].time = ARP_TIMEOUT; |
arpTable[j].ntrans = 0; |
return j; |
} |
253,9 → 247,6 |
int i,j; |
PKT_NXT *p,*p1 = NULL; |
int caso; |
#ifdef __ARP_DBG__ |
char msg[50]; |
#endif |
sem_xwait(&arpMutex, 1, BLOCK); |
caso = 0; |
282,8 → 273,7 |
netbuff_release(&udp_txbuff, (void *)pkt); |
arpTable[j].used++; |
if (arpTable[j].used > ARP_MAX_USED) arpTable[j].used = ARP_MAX_USED; |
} |
else if (caso == 2) { |
} else if (caso == 2) { |
/* Enqueue the packet until the ethernet address arrives */ |
p = arpTable[j].pkt; |
while (p != NULL) { |
294,17 → 284,15 |
((PKT_NXT *)pkt)->next = NULL; |
((PKT_NXT *)pkt)->len = len; |
#ifdef __ARP_DBG__ |
sprintf(msg,"Pacchetto : %lp accodato\n",pkt); |
win_puts(&w1,msg); |
printk(KERN_DEBUG ARP_INFO "Pacchetto : %lp accodato.\n", pkt); |
#endif |
} |
else { |
} else { |
/* Search for a free entry in the ARP table...*/ |
j = -1; |
while (j == -1) { |
j = arp_req(dest); |
if (j == -1) { |
cprintf("FULL!!!\n"); |
cprintf("ARP Table Full.\n"); |
kern_raise(XARP_TABLE_FULL,NIL); |
} |
} |
313,8 → 301,7 |
((PKT_NXT *)arpTable[j].pkt)->next = NULL; |
((PKT_NXT *)pkt)->len = len; |
#ifdef __ARP_DBG__ |
sprintf(msg,"Pacchetto : %lp accodato\n",pkt); |
win_puts(&w1,msg); |
printk(KERN_DEBUG ARP_INFO "Pacchetto : %lp accodato\n", pkt); |
#endif |
/*...and send the request!!! */ |
arp_sendRequest(j); |
329,15 → 316,14 |
PKT_NXT *p1,*q1; |
int len; |
int i,j = 0; |
#ifdef __ARP_DBG__ |
char msg[100]; |
#endif |
BYTE found; |
pkt = (ARP_PKT *)eth_getFDB(pk); |
#if 0 |
{int ii; |
{ |
int ii; |
cprintf("Arp PKT...\n"); |
cprintf ("source..."); |
for (ii=0; ii<4; ii++) cprintf("%d ", pkt->sip.ad[ii]); |
352,16 → 338,12 |
/* 1 : Search an entry with his IP address */ |
found = FALSE; |
for (i = 0; (i < ARP_MAX_ENTRIES) && !found; i++) { |
if ((arpTable[i].valid != FALSE) && |
ip_compAddr(arpTable[i].ip,pkt->sip)) { |
if ((arpTable[i].valid != FALSE) && ip_compAddr(arpTable[i].ip,pkt->sip)) { |
setEthAddr(arpTable[i].eth,pkt->sha); |
found = TRUE; |
} |
} |
/* |
If there isn't any, fill a new entry (if the table is |
not full) |
*/ |
/* If there isn't any, fill a new entry (if the table is not full) */ |
if (!found) { |
for (i = 0; (i < ARP_MAX_ENTRIES) && !found; i++) |
if (arpTable[i].valid == FALSE) { |
374,6 → 356,7 |
arpTable[j].valid = TRUE; |
} |
} |
/* If it is a request, send the reply */ |
if (ntohs(pkt->operation) == ARP_REQUEST) { |
rpkt = (ARP_PKT *)eth_getFDB(reply); |
389,15 → 372,12 |
eth_setHeader(reply, pkt->sha, ETH_ARP_TYPE); |
eth_sendPkt(reply,sizeof(ARP_PKT)); |
} |
/* If it is a reply, search for his pending request */ |
else { |
for (i = 0; i < ARP_MAX_ENTRIES; i++) { |
if ((arpTable[i].valid == PENDING) && |
ip_compAddr(arpTable[i].ip,pkt->sip)) { |
/* |
the eth field in the ARP table was |
filled previously |
*/ |
if ((arpTable[i].valid == PENDING) && ip_compAddr(arpTable[i].ip,pkt->sip)) { |
/* the eth field in the ARP table was filled previously */ |
arpTable[i].valid = TRUE; |
/* Send pending packets */ |
p1 = (PKT_NXT *)arpTable[i].pkt; |
409,8 → 389,7 |
eth_sendPkt(q1,len); |
netbuff_release(&udp_txbuff, (void *)q1); |
#ifdef __ARP_DBG__ |
sprintf(msg,"Pacchetto : %lp inviato\n",q1); |
win_puts(&w1,msg); |
printk(KERN_DEBUG ARP_INFO "Pacchetto : %lp inviato\n", q1); |
#endif |
} |
} |
472,5 → 451,6 |
task_activate(s); |
arpIsInstalled = TRUE; |
} else cprintf("Arp: already installed!!!!"); |
} else |
cprintf("Arp: already installed."); |
} |
/shark/trunk/drivers/newnet/eth_priv.h |
---|
20,11 → 20,11 |
/** |
------------ |
CVS : $Id: eth_priv.h,v 1.1 2004-04-23 14:30:32 mauro Exp $ |
CVS : $Id: eth_priv.h,v 1.2 2004-04-23 18:13:52 mauro Exp $ |
File: $File$ |
Revision: $Revision: 1.1 $ |
Last update: $Date: 2004-04-23 14:30:32 $ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-23 18:13:52 $ |
------------ |
**/ |
/shark/trunk/drivers/newnet/net.c |
---|
20,11 → 20,11 |
/** |
------------ |
CVS : $Id: net.c,v 1.1 2004-04-23 14:30:33 mauro Exp $ |
CVS : $Id: net.c,v 1.2 2004-04-23 18:13:52 mauro Exp $ |
File: $File$ |
Revision: $Revision: 1.1 $ |
Last update: $Date: 2004-04-23 14:30:33 $ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-23 18:13:52 $ |
------------ |
**/ |
63,12 → 63,11 |
#include <drivers/net.h> |
#include "eth_priv.h" |
#define DEBUG_NET |
//#define DEBUG_NET |
/* OKKIO!!!!! net_base must change if you change NET_MAX_PROTOCOLS!!!! */ |
struct net_model net_base = {0, 0, {{NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, |
NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, |
{NULL, NULL}, {NULL, NULL}, {NULL, NULL}}}; |
struct net_model net_base = {0, 0, {{NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, |
{NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}}}; |
void net_setprotocol(struct net_model *m, void (*initfun)(void *parm), void *initparms) |
{ |
88,10 → 87,11 |
if ((app = eth_init(m->lowlevparm,NULL)) != 1) { |
return app; |
} |
/* Then, the high level layers */ |
for(i = 0; i < m->numprotocol; i++) { |
#ifdef DEBUG_NET |
printk(KERN_DEBUG "Protocol %d init \n", i); |
printk(KERN_DEBUG "Protocol %d init.\n", i); |
#endif |
m->protocol[i].initfun(m->protocol[i].initparms); |
} |
/shark/trunk/drivers/newnet/rtl8139.c |
---|
25,8 → 25,8 |
/* A few user-configurable values. */ |
/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ |
static int max_interrupt_work = 20; |
#define rtl8129_debug debug |
static int rtl8129_debug = 3; |
//#define rtl8129_debug debug |
static int rtl8129_debug = 0; |
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). |
The RTL chips use a 64 element hash table based on the Ethernet CRC. */ |
/shark/trunk/drivers/newnet/arp.h |
---|
20,11 → 20,11 |
/** |
------------ |
CVS : $Id: arp.h,v 1.1 2004-04-23 14:30:32 mauro Exp $ |
CVS : $Id: arp.h,v 1.2 2004-04-23 18:13:51 mauro Exp $ |
File: $File$ |
Revision: $Revision: 1.1 $ |
Last update: $Date: 2004-04-23 14:30:32 $ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-23 18:13:51 $ |
------------ |
**/ |
/shark/trunk/drivers/newnet/netbuff.c |
---|
20,11 → 20,11 |
/** |
------------ |
CVS : $Id: netbuff.c,v 1.1 2004-04-23 14:30:34 mauro Exp $ |
CVS : $Id: netbuff.c,v 1.2 2004-04-23 18:13:52 mauro Exp $ |
File: $File$ |
Revision: $Revision: 1.1 $ |
Last update: $Date: 2004-04-23 14:30:34 $ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-04-23 18:13:52 $ |
------------ |
**/ |
/shark/trunk/drivers/newnet/misc.c |
---|
1,33 → 1,6 |
#include <string.h> |
#include <kernel/kern.h> |
#if 0 |
unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base) |
{ |
unsigned long result = 0,value; |
if (!base) { |
base = 10; |
if (*cp == '0') { |
base = 8; |
cp++; |
if ((*cp == 'x') && isxdigit(cp[1])) { |
cp++; |
base = 16; |
} |
} |
} |
while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp) |
? toupper(*cp) : *cp)-'A'+10) < base) { |
result = result*base + value; |
cp++; |
} |
if (endp) |
*endp = (char *)cp; |
return result; |
} |
#endif |
void panic_stub(void) |
{ |
cprintf("Panic: stub called!!!\n"); |
/shark/trunk/drivers/newnet/eepro100.c |
---|
106,7 → 106,7 |
The registers beyond 0x18 only exist on the i82558. */ |
#define SPEEDO3_TOTAL_SIZE 0x20 |
int speedo_debug = 1; |
int speedo_debug = 0; |
/* |
Theory of Operation |
477,6 → 477,7 |
u16 pci_command, new_command; |
if (speedo_debug > 0) |
printk("Finding Device\n"); |
if (pci20to26_find_class (PCI_CLASS_NETWORK_ETHERNET << 8, pci_index, |
489,6 → 490,7 |
pci20to26_read_config_word(pci_bus, pci_device_fn, |
PCI_DEVICE_ID, &device); |
if (speedo_debug > 0) |
printk("Device = %x Vendor = %x\n",(int)device,(int)vendor); |
if (vendor != PCI_VENDOR_ID_INTEL) |