| plan 9 kernel history: overview | file list | diff list |
1997/0327/carrera/devether.c (diff list | history)
| 1995/0520/sys/src/9/carrera/devether.c:241,247 – 1997/0327/sys/src/9/carrera/devether.c:241,247 (short | long | prev | next) | ||
| 1993/0903 | Netif; | |
| 1993/0904 | }; | |
| 1993/0903 | ||
| 1993/0904 |
| |
| 1997/0327 | static Ether *ether[Nether]; | |
| 1993/0903 | ||
| 1993/0904 | #define NEXT(x, l) (((x)+1)%(l)) #define PREV(x, l) (((x) == 0) ? (l)-1: (x)-1) | |
| 1995/0520/sys/src/9/carrera/devether.c:248,254 – 1997/0327/sys/src/9/carrera/devether.c:248,254 | ||
| 1993/0904 | #define LS16(addr) (PADDR(addr) & 0xFFFF) #define MS16(addr) ((PADDR(addr)>>16) & 0xFFFF) | |
| 1993/0906 |
| |
| 1997/0327 | static void sonicswap(void*, int); | |
| 1993/0906 | ||
| 1993/0903 | static void | |
| 1993/0906 | wus(ushort *a, ushort v) | |
| 1995/0520/sys/src/9/carrera/devether.c:400,406 – 1997/0327/sys/src/9/carrera/devether.c:400,406 | ||
| 1993/0904 | WR(imr, AllIntr); | |
| 1993/0903 | } | |
| 1997/0327 | static void | |
| 1993/0906 | sonicpkt(Ether *ctlr, RXpkt *r, Pbuf *p) | |
| 1993/0905 | { | |
| 1993/0906 | int len; | |
| 1995/0520/sys/src/9/carrera/devether.c:606,612 – 1997/0327/sys/src/9/carrera/devether.c:606,612 | ||
| 1993/1217 | panic("sonic init"); | |
| 1993/0906 | } | |
| 1993/0903 |
| |
| 1997/0327 | static void | |
| 1993/0903 | etherreset(void) { | |
| 1993/0904 | Ether *ctlr; | |
| 1995/0520/sys/src/9/carrera/devether.c:630,636 – 1997/0327/sys/src/9/carrera/devether.c:630,636 | ||
| 1993/0904 | memset(ctlr->ba, 0xFF, sizeof(ctlr->ba)); | |
| 1993/0903 | /* general network interface structure */ | |
| 1993/0904 |
| |
| 1997/0327 | netifinit(ether[0], "ether0", Ntypes, 32*1024); | |
| 1993/0904 | ether[0]->alen = 6; memmove(ether[0]->addr, ether[0]->ea, 6); memmove(ether[0]->bcast, ctlr->ba, 6); | |
| 1995/0520/sys/src/9/carrera/devether.c:638,649 – 1997/0327/sys/src/9/carrera/devether.c:638,644 | ||
| 1993/0904 | ether[0]->arg = ether[0]; | |
| 1993/0903 | } | |
| 1997/0327 | static Chan* | |
| 1993/0903 | etherattach(char *spec) { | |
| 1993/0905 | static int enable; | |
| 1995/0520/sys/src/9/carrera/devether.c:657,687 – 1997/0327/sys/src/9/carrera/devether.c:652,676 | ||
| 1993/0903 | return devattach('l', spec); } | |
| 1997/0327 | static int | |
| 1993/0903 | etherwalk(Chan *c, char *name) { | |
| 1993/0904 | return netifwalk(ether[0], c, name); | |
| 1993/0903 | } | |
| 1997/0327 | static Chan* | |
| 1993/0903 | etheropen(Chan *c, int omode) { | |
| 1993/0904 | return netifopen(ether[0], c, omode); | |
| 1993/0903 | } | |
| 1997/0327 | static void | |
| 1993/0903 | ethercreate(Chan *c, char *name, int omode, ulong perm) { USED(c, name, omode, perm); } | |
| 1997/0327 | static void | |
| 1993/0903 | etherclose(Chan *c) { | |
| 1993/0904 | netifclose(ether[0], c); | |
| 1995/0520/sys/src/9/carrera/devether.c:693,704 – 1997/0327/sys/src/9/carrera/devether.c:682,687 | ||
| 1993/0904 | return netifread(ether[0], c, buf, n, offset); | |
| 1993/0903 | } | |
| 1995/0108 |
| |
| 1993/0903 | static int | |
| 1993/1202 | etherloop(Etherpkt *p, long n) { | |
| 1995/0520/sys/src/9/carrera/devether.c:731,737 – 1997/0327/sys/src/9/carrera/devether.c:714,720 | ||
| 1993/1202 | return !different; } | |
| 1993/0903 |
| |
| 1997/0327 | static long | |
| 1993/0903 | etherwrite(Chan *c, void *buf, long n, ulong offset) { | |
| 1993/0906 | Pbuf *p; | |
| 1995/0520/sys/src/9/carrera/devether.c:792,816 – 1997/0327/sys/src/9/carrera/devether.c:775,793 | ||
| 1993/0903 | return n; | |
| 1995/0108 | } | |
| 1993/0903 |
| |
| 1997/0327 | static void | |
| 1993/0903 | etherremove(Chan *c) { USED(c); } | |
| 1997/0327 | static void | |
| 1993/0903 | etherstat(Chan *c, char *dp) { | |
| 1993/0904 | netifstat(ether[0], c, dp); | |
| 1993/0903 | } | |
| 1997/0327 | static void | |
| 1993/0903 | etherwstat(Chan *c, char *dp) { | |
| 1993/0904 | netifwstat(ether[0], c, dp); | |
| 1995/0520/sys/src/9/carrera/devether.c:818,824 – 1997/0327/sys/src/9/carrera/devether.c:795,801 | ||
| 1993/0906 | #define swiz(s) (s<<24)|((s>>8)&0xff00)|((s<<8)&0xff0000)|(s>>24) | |
| 1997/0327 | static void | |
| 1993/0906 | sonicswap(void *a, int n) { ulong *p, t0, t1; | |
| 1995/0520/sys/src/9/carrera/devether.c:834,836 – 1997/0327/sys/src/9/carrera/devether.c:811,854 | ||
| 1993/0906 | n -= 8; } | |
| 1993/0903 | } | |
| 1997/0327 | int parseether(uchar *to, char *from) { char nip[4]; char *p; int i; p = from; for(i = 0; i < 6; i++){ if(*p == 0) return -1; nip[0] = *p++; if(*p == 0) return -1; nip[1] = *p++; nip[2] = 0; to[i] = strtoul(nip, 0, 16); if(*p == ':') p++; } return 0; } Dev etherdevtab = { etherreset, devinit, etherattach, devclone, etherwalk, etherstat, etheropen, ethercreate, etherclose, etherread, devbread, etherwrite, devbwrite, etherremove, etherwstat, }; | |