20,11 → 20,11 |
|
/** |
------------ |
CVS : $Id: eth.c,v 1.2 2002-10-28 08:01:36 pj Exp $ |
CVS : $Id: eth.c,v 1.1.1.1 2002-03-29 14:12:50 pj Exp $ |
|
File: $File$ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2002-10-28 08:01:36 $ |
Revision: $Revision: 1.1.1.1 $ |
Last update: $Date: 2002-03-29 14:12:50 $ |
------------ |
**/ |
|
74,8 → 74,6 |
/*#include "lowlev.h" |
//#include "3com.h" */ |
|
//#define DEBUG_ETH |
|
#define ETH_PAGE 5 |
|
struct eth_service{ |
133,7 → 131,7 |
|
void dev_tint(struct device *dev) |
{ |
printk(KERN_WARNING "Warning!!!! dev_tint called!!! (Why???)\n"); |
cprintf("Warning!!!! dev_tint called!!! (Why???)\n"); |
sys_abort(201); |
} |
|
147,7 → 145,7 |
{ |
//cprintf("DENTRO netif_rx, skbuf=%p\n",skb->data); |
if (nettask_pid == NIL) { |
printk(KERN_CRIT "Net receives packets, but the driver doesn't exist!!!\n"); |
cprintf("Net receives packets, but the driver doesn't exist!!!\n"); |
sys_abort(300); |
} |
|
202,7 → 200,7 |
/* formatted print of an ethernet header */ |
void eth_printHeader(struct eth_header *p) |
{ |
cprintf("Dest : %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x \n",p->dest.ad[0], |
cprintf("Dest : %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x \n",p->dest.ad[0], |
p->dest.ad[1], |
p->dest.ad[2], |
p->dest.ad[3], |
340,27 → 338,27 |
{ |
int p; |
|
if (err != ETH_BUFFERS_FULL) printk(KERN_ERR "Ethernet : "); |
if (err != ETH_BUFFERS_FULL) cprintf("Ethernet : "); |
switch (err) { |
case ETH_DRIVER_NOT_FOUND : |
printk(KERN_ERR "NET PANIC --> Etherlink not found.\n"); |
cprintf("NET PANIC --> Etherlink not found.\n"); |
return 0; |
case ETH_RXERROR : |
printk(KERN_ERR "Receive error (vero dramma!!!).\n"); |
cprintf("Receive error (vero dramma!!!).\n"); |
return 0; |
case ETH_TXERROR : |
printk(KERN_ERR "Transimit error: N. Max Retry.\n"); |
cprintf("Transimit error: N. Max Retry.\n"); |
return 0; |
case ETH_PROTOCOL_ERROR : |
printk(KERN_ERR "Too much protocols.\n"); |
cprintf("Too much protocols.\n"); |
return 0; |
case ETH_BUFFERS_FULL: |
printk(KERN_ERR "Buffers full: frame lost!\n"); |
cprintf("Buffers full: frame lost!\n"); |
return 1; |
case ETH_NULLPROTOCOL_EXC: |
printk(KERN_ERR "Null protocol called!!!\n"); |
cprintf("Null protocol called!!!\n"); |
for (p = 0; p < ETH_MAX_PROTOCOLS; p++) { |
printk(KERN_ERR "%d: %d\n", p, eth_table[p].type); |
cprintf("%d: %d\n", p, eth_table[p].type); |
} |
return 0; |
default : |
379,7 → 377,7 |
int linux_found = 0; |
|
if (!ethIsInstalled) { |
printk(KERN_INFO "Hartik/Shark Net lib"); |
cprintf(" Hartik Net lib\n\n"); |
/* Scan the devices connected to the PCI bus */ |
cardtype = NONE; |
|
398,25 → 396,19 |
|
nettask_pid = task_create("rxProc", net_extern_driver, m, NULL); |
if (nettask_pid == NIL) { |
printk(KERN_ERR "Can't create extern driver!!!\n"); |
return 0; |
cprintf("Can't create extern driver!!!\n"); |
return 0; |
} |
task_activate(nettask_pid); |
if (pci_init() == 1) { |
linuxpci_init(); |
// pci_show(); |
#ifdef DEBUG_ETH |
printk(KERN_DEBUG "LF %d\n", linux_found); |
#endif |
cprintf("LF %d\n", linux_found); |
linux_found += (rtl8139_probe(&device0) == 0); |
#ifdef DEBUG_ETH |
printk(KERN_DEBUG "LF %d\n", linux_found); |
#endif |
cprintf("LF %d\n", linux_found); |
|
linux_found += (tc59x_probe(&device0) == 0); |
#ifdef DEBUG_ETH |
printk(KERN_DEBUG "LF %d\n", linux_found); |
#endif |
cprintf("LF %d\n", linux_found); |
#if 0 |
ndev = pci_scan_bus(pci_devs); |
#ifdef __ETH_DBG__ |
442,7 → 434,7 |
} else { |
lowlev_send = vortex_send_mem; |
} |
printk(KERN_INFO "PCI Ethlink card found:\n"); |
cprintf("PCI Ethlink card found:\n"); |
lowlev_info(r); |
cardtype = VORTEX; |
} |
468,14 → 460,10 |
#else |
} |
if (linux_found == 0) { |
linux_found += (el3_probe(&device0) == 0); |
#ifdef DEBUG_ETH |
printk(KERN_DEBUG "LF %d\n", linux_found); |
#endif |
linux_found += (ne_probe(&device0) == 0); |
#ifdef DEBUG_ETH |
printk(KERN_DEBUG "LF %d\n", linux_found); |
#endif |
linux_found += (el3_probe(&device0) == 0); |
cprintf("LF %d\n", linux_found); |
linux_found += (ne_probe(&device0) == 0); |
cprintf("LF %d\n", linux_found); |
} |
|
/* |
486,9 → 474,9 |
*/ |
if (linux_found) { |
device0.open(&device0); |
printk(KERN_INFO "Net card found!!!\n"); |
cprintf("Net card found!!!\n"); |
} else { |
printk(KERN_INFO "No card found... \n"); |
cprintf("No card found... \n"); |
/* cprintf("No card found... Installing loopback device\n"); |
loopback_init(&device0); |
device0.open(&device0);*/ |
509,7 → 497,7 |
sys_atrunlevel(eth_close,NULL,RUNLEVEL_BEFORE_EXIT); |
|
} else { |
printk(KERN_INFO "Ethernet already installed!!!\n"); |
cprintf("Ethernet already installed!!!\n"); |
return 0; |
} |
return 1; |
517,12 → 505,10 |
|
void eth_close(void *a) |
{ |
#ifdef DEBUG_ETH |
printk(KERN_DEBUG "CLOSE!!!!\n"); |
#endif |
if (ethIsInstalled == TRUE) { |
device0.stop(&device0); /*This seems to break everithing... |
// lowlev_close(eth_dev.BaseAddress);*/ |
ethIsInstalled = FALSE; |
} |
kern_printf("CLOSE!!!!\n"); |
if (ethIsInstalled == TRUE) { |
device0.stop(&device0); /*This seems to break everithing... |
// lowlev_close(eth_dev.BaseAddress);*/ |
ethIsInstalled = FALSE; |
} |
} |