| plan 9 kernel history: overview | file list | diff list |
2002/0403/pc/devether.c (diff list | history)
| 2002/0314/sys/src/9/pc/devether.c:343,429 – 2002/0403/sys/src/9/pc/devether.c:343,462 (short | long | prev | next) | ||
| 1997/0327 | return 0; } | |
| 1992/0424 |
| |
| 2002/0403 | static Ether* etherprobe(int cardno, int ctlrno) | |
| 1992/0424 | { | |
| 2002/0403 | int i; | |
| 1997/0327 | Ether *ether; | |
| 1993/1113 |
| |
| 2001/0527 |
| |
| 2002/0403 | char buf[128], name[32]; | |
| 1992/0410 | ||
| 1997/0327 |
| |
| 2000/0921 |
| |
| 1997/0327 |
| |
| 1993/1113 |
| |
| 1997/0327 |
| |
| 2002/0403 | ether = malloc(sizeof(Ether)); memset(ether, 0, sizeof(Ether)); ether->ctlrno = ctlrno; ether->tbdf = BUSUNKNOWN; ether->mbps = 10; ether->minmtu = ETHERMINTU; ether->maxmtu = ETHERMAXTU; if(cardno < 0){ if(isaconfig("ether", ctlrno, ether) == 0){ free(ether); return nil; } for(cardno = 0; cards[cardno].type; cardno++){ if(cistrcmp(cards[cardno].type, ether->type)) | |
| 1993/1113 | continue; | |
| 1997/0327 | for(i = 0; i < ether->nopt; i++){ if(strncmp(ether->opt[i], "ea=", 3)) continue; | |
| 2002/0403 | if(parseether(ether->ea, ðer->opt[i][3])) | |
| 1997/0327 | memset(ether->ea, 0, Eaddrlen); | |
| 1993/1113 |
| |
| 2002/0403 | } break; } } | |
| 1992/1222 |
| |
| 1997/0327 |
| |
| 1999/0819 |
| |
| 2002/0403 | if(cardno >= MaxEther || cards[cardno].type == nil){ free(ether); return nil; } if(cards[cardno].reset(ether) < 0){ free(ether); return nil; } | |
| 2000/0817 | ||
| 2001/1130 |
| |
| 2000/0817 |
| |
| 2001/1130 |
| |
| 2000/0817 |
| |
| 2002/0403 | /* * IRQ2 doesn't really exist, it's used to gang the interrupt * controllers together. A device set to IRQ2 will appear on * the second interrupt controller as IRQ9. */ if(ether->irq == 2) ether->irq = 9; snprint(name, sizeof(name), "ether%d", ctlrno); | |
| 1993/0212 | ||
| 1998/0825 |
| |
| 1997/0327 |
| |
| 1997/1101 |
| |
| 1997/0327 |
| |
| 2002/0403 | /* * If ether->irq is 0, it is a hack to indicate no interrupt * used by ethersink. */ if(ether->irq > 0) intrenable(ether->irq, ether->interrupt, ether, ether->tbdf, name); | |
| 1993/0212 | ||
| 2000/0921 |
| |
| 1997/0327 |
| |
| 1998/0218 |
| |
| 1997/0327 |
| |
| 1998/0218 |
| |
| 1997/0327 |
| |
| 1997/1105 |
| |
| 1997/0327 |
| |
| 2002/0403 | i = sprint(buf, "#l%d: %s: %dMbps port 0x%luX irq %lud", ctlrno, cards[cardno].type, ether->mbps, ether->port, ether->irq); if(ether->mem) i += sprint(buf+i, " addr 0x%luX", PADDR(ether->mem)); if(ether->size) i += sprint(buf+i, " size 0x%luX", ether->size); i += sprint(buf+i, ": %2.2uX%2.2uX%2.2uX%2.2uX%2.2uX%2.2uX", ether->ea[0], ether->ea[1], ether->ea[2], ether->ea[3], ether->ea[4], ether->ea[5]); sprint(buf+i, "\n"); print(buf); | |
| 1992/0410 | ||
| 1997/0327 |
| |
| 1993/1120 |
| |
| 2002/0403 | if(ether->mbps >= 100){ netifinit(ether, name, Ntypes, 256*1024); if(ether->oq == 0) ether->oq = qopen(256*1024, 1, 0, 0); } else{ netifinit(ether, name, Ntypes, 65*1024); if(ether->oq == 0) ether->oq = qopen(65*1024, 1, 0, 0); } if(ether->oq == 0) panic("etherreset %s", name); ether->alen = Eaddrlen; memmove(ether->addr, ether->ea, Eaddrlen); memset(ether->bcast, 0xFF, Eaddrlen); return ether; } static void etherreset(void) { Ether *ether; int cardno, ctlrno; for(ctlrno = 0; ctlrno < MaxEther; ctlrno++){ if((ether = etherprobe(-1, ctlrno)) == nil) continue; etherxx[ctlrno] = ether; } cardno = ctlrno = 0; while(cards[cardno].type != nil && ctlrno < MaxEther){ if(etherxx[ctlrno] != nil){ ctlrno++; continue; | |
| 1993/1113 | } | |
| 2002/0403 | if((ether = etherprobe(cardno, ctlrno)) == nil){ cardno++; continue; } etherxx[ctlrno] = ether; ctlrno++; | |
| 1992/0403 | } | |
| 1997/0327 |
| |
| 1992/0403 | } | |
| 1997/0327 | ||
| 2002/0109 | static void | |