diff --git a/src/sys/include/isa/ne2k.h b/src/sys/include/isa/ne2k.h index a4e86a3..83901bf 100644 --- a/src/sys/include/isa/ne2k.h +++ b/src/sys/include/isa/ne2k.h @@ -162,8 +162,9 @@ int NICtoPC(struct device *dev,void *packet,int length,int nic_addr); int PCtoNIC(struct device *dev,void *packet,int length); -struct nicBuffer *allocBuffer(int); -struct nicBuffer *getBuffer(); +struct nicBuffer *ne2kAllocBuffer(int); +struct nicBuffer *ne2kGetBuffer(); +void ne2kFreeBuffer(struct nicBuffer *); #endif diff --git a/src/sys/init/main.c b/src/sys/init/main.c index 7a96c5e..83c49ff 100644 --- a/src/sys/init/main.c +++ b/src/sys/init/main.c @@ -24,6 +24,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.4 2004/04/19 21:32:14 reddawg + Fixes: + + ne2k: + + we now have allocBuffer() and getBuffer() - alloc gets an avail buffer on the + memory ring for the nic and get will fetch the oldest buffer on there + Revision 1.3 2004/04/15 12:53:08 reddawg There Fixed @@ -68,6 +76,7 @@ #include #include #include +#include char kernelStack[8192]; // Stack Space For Our Kernel diff --git a/src/sys/isa/ne2k.c b/src/sys/isa/ne2k.c index 776abf9..4d85bf5 100644 --- a/src/sys/isa/ne2k.c +++ b/src/sys/isa/ne2k.c @@ -24,6 +24,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.2 2004/04/19 21:32:14 reddawg + Fixes: + + ne2k: + + we now have allocBuffer() and getBuffer() - alloc gets an avail buffer on the + memory ring for the nic and get will fetch the oldest buffer on there + Revision 1.1.1.1 2004/04/15 12:07:09 reddawg UbixOS v1.0 @@ -164,7 +172,7 @@ outportByte(dev->ioAddr+0x05,(length & 0xFF)); outportByte(dev->ioAddr+0x06,(length >> 8)); outportByteP(dev->ioAddr,0x26); - kprintf("SENT\n"); + //kprintf("SENT\n"); return(length); } @@ -312,7 +320,7 @@ kprintf("A"); } else { - tmpBuf = allocBuffer(length); + tmpBuf = ne2kAllocBuffer(length); NICtoPC(dev,tmpBuf->buffer,length,page * DP_PAGESIZE + sizeof(dp_rcvhdr_t)); } @@ -320,7 +328,7 @@ return(OK); } -struct nicBuffer *allocBuffer(int length) { +struct nicBuffer *ne2kAllocBuffer(int length) { struct nicBuffer *tmpBuf = 0x0; if (ne2kBuffer == 0x0) { ne2kBuffer = (struct nicBuffer *)kmalloc(sizeof(struct nicBuffer),sysID); @@ -341,13 +349,19 @@ return(0x0); } -struct nicBuffer *getBuffer() { +struct nicBuffer *ne2kGetBuffer() { struct nicBuffer *tmpBuf = 0x0; tmpBuf = ne2kBuffer; ne2kBuffer = ne2kBuffer->next; return(tmpBuf); } +void ne2kFreeBuffer(struct nicBuffer *buf) { + kfree(buf->buffer); + kfree(buf); + return; + } + /*** END ***/ diff --git a/src/sys/lib/kmalloc.c b/src/sys/lib/kmalloc.c index 2391286..a1e5b41 100644 --- a/src/sys/lib/kmalloc.c +++ b/src/sys/lib/kmalloc.c @@ -24,6 +24,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. $Log$ + Revision 1.1.1.1 2004/04/15 12:07:10 reddawg + UbixOS v1.0 + Revision 1.21 2004/04/13 16:36:33 reddawg Changed our copyright, it is all now under a BSD-Style license @@ -53,10 +56,14 @@ emptyKernDesc = (struct memDescriptor *)vmmGetFreeKernelPage(pid,4); tmpDesc1 = emptyKernDesc; tmpDesc1->prev = 0x0; + tmpDesc1->status = 0x0; + tmpDesc1->limit = 0x0; for (i=1;i<((4096/sizeof(struct memDescriptor))*4);i++) { tmpDesc2 = &emptyKernDesc[i]; tmpDesc2->prev = tmpDesc1; tmpDesc1->next = tmpDesc2; + tmpDesc2->status = 0x0; + tmpDesc2->limit = 0x0; tmpDesc1 = tmpDesc2; } tmpDesc1->next = 0x0; diff --git a/src/sys/net/net/init.c b/src/sys/net/net/init.c index 54503bf..db98aa8 100644 --- a/src/sys/net/net/init.c +++ b/src/sys/net/net/init.c @@ -37,12 +37,16 @@ sem = sys_sem_new(0); tcpip_init(tcpip_init_done, &sem); sys_sem_wait(sem); - kprintf("WAIT2"); sys_sem_free(sem); kprintf("TCP/IP initialized.\n"); IP4_ADDR(&gw, 192,168,0,1); IP4_ADDR(&ipaddr, 192,168,0,69); + /* + IP4_ADDR(&gw, 10,1,0,1); + IP4_ADDR(&ipaddr, 10,1,0,69); + */ + IP4_ADDR(&netmask, 255,255,255,0); netif_set_default(netif_add(&ipaddr, &netmask, &gw, ethernetif_init, tcpip_input)); @@ -65,9 +69,7 @@ static void tcpip_init_done(void *arg) { sys_sem_t *sem = 0x0; sem = arg; - kprintf("SIGNAL [%x]",sem); sys_sem_signal(*sem); - kprintf("DONE"); } /*** diff --git a/src/sys/net/net/shell.c b/src/sys/net/net/shell.c index b388f5d..8fa2f52 100644 --- a/src/sys/net/net/shell.c +++ b/src/sys/net/net/shell.c @@ -65,6 +65,7 @@ struct netbuf *buf; uInt32 len; int i; + char bufr[1500]; do { if (buf != NULL) { @@ -74,6 +75,8 @@ netbuf_delete(buf); buffer[len-2] = '\0'; kprintf("Buffer: [%s:%i]",buffer,len); + //sprintf(bufr,"Command: %s not found.\n\0",buffer); + //sendstr(bufr,conn); } if (buf != NULL) { prompt(conn); diff --git a/src/sys/net/netif/ethernetif.c b/src/sys/net/netif/ethernetif.c index abd74b0..28ec25c 100644 --- a/src/sys/net/netif/ethernetif.c +++ b/src/sys/net/netif/ethernetif.c @@ -124,7 +124,7 @@ bufptr += q->len; } PCtoNIC(dev,buf,p->tot_len); - kprintf("Sending Data[%i]\n",p->tot_len); + //kprintf("Sending Data[%i]\n",p->tot_len); return ERR_OK; } @@ -214,7 +214,6 @@ if(ip_addr_isany(ipaddr) || ip_addr_isbroadcast(ipaddr, &(netif->netmask))) { dest = (struct eth_addr *)ðbroadcast; - kprintf("A"); } else if(ip_addr_ismulticast(ipaddr)) { /* Hash IP multicast address to MAC address. */ mcastaddr.addr[0] = 0x01; @@ -224,18 +223,15 @@ mcastaddr.addr[4] = ip4_addr3(ipaddr); mcastaddr.addr[5] = ip4_addr4(ipaddr); dest = &mcastaddr; - kprintf("B"); } else { if(ip_addr_maskcmp(ipaddr, &(netif->ip_addr), &(netif->netmask))) { /* Use destination IP address if the destination is on the same subnet as we are. */ queryaddr = ipaddr; - kprintf("Word"); } else { /* Otherwise we use the default router as the address to send the Ethernet frame to. */ queryaddr = &(netif->gw); - kprintf("Word2"); } dest = arp_lookup(queryaddr); } @@ -303,7 +299,6 @@ } break; default: - kprintf("DEFAULT [0x%X]",ethhdr->type); pbuf_free(p); break; } @@ -337,9 +332,7 @@ netif->output = ethernetif_output; netif->linkoutput = (void *)low_level_output; - kprintf("Star"); ethernetif->ethaddr = (struct eth_addr *)&(netif->hwaddr[0]); - kprintf("ting"); low_level_init(netif); arp_init(); @@ -355,9 +348,10 @@ netif = arg; while (1) { - tmpBuf = getBuffer(); + tmpBuf = ne2kGetBuffer(); if (tmpBuf->length > 0x0) { ethernetif_input(netif); } } + ne2kFreeBuffer(tmpBuf); }