summaryrefslogtreecommitdiff
path: root/sys/src/9/sgi/etherif.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-03-28 05:15:40 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2015-03-28 05:15:40 +0100
commit177cbace733eeceaef54e2c1a4032c55d4e100dd (patch)
tree893344cde6ee858110b94fd2173e5907f22465ac /sys/src/9/sgi/etherif.h
parent9fd3e3f239162a192e0136034187ed674106e58b (diff)
sgi: work in progress kernel for sgi mips machines (only tested with r5k indy)
this provides basic console support using the ARC bios routines theu uartarcs driver. and has native seeq ethernet driver which was written by reading the 2ed devseq driver as i have no documentation on the hardware. mmu and trap code is based on the routerboard kernel.
Diffstat (limited to 'sys/src/9/sgi/etherif.h')
-rw-r--r--sys/src/9/sgi/etherif.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/sys/src/9/sgi/etherif.h b/sys/src/9/sgi/etherif.h
new file mode 100644
index 000000000..035dd64cb
--- /dev/null
+++ b/sys/src/9/sgi/etherif.h
@@ -0,0 +1,40 @@
+enum {
+ MaxEther = 1,
+ Ntypes = 8,
+};
+
+typedef struct Ether Ether;
+struct Ether {
+
+ int ctlrno;
+ int minmtu;
+ int maxmtu;
+ uchar ea[Eaddrlen];
+
+ int irq, irqlevel;
+ uintptr port;
+
+ void (*attach)(Ether*); /* filled in by reset routine */
+ void (*detach)(Ether*);
+ void (*transmit)(Ether*);
+ void (*interrupt)(Ureg*, void*);
+ long (*ifstat)(Ether*, void*, long, ulong);
+ long (*ctl)(Ether*, void*, long); /* custom ctl messages */
+ void (*power)(Ether*, int); /* power on/off */
+ void (*shutdown)(Ether*); /* shutdown hardware before reboot */
+ void *ctlr;
+
+ Queue* oq;
+
+ Netif;
+};
+
+extern Block* etheriq(Ether*, Block*, int);
+extern void addethercard(char*, int(*)(Ether*));
+extern ulong ethercrc(uchar*, int);
+extern int parseether(uchar*, char*);
+
+#define NEXT(x, l) (((x)+1)%(l))
+#define PREV(x, l) (((x) == 0) ? (l)-1: (x)-1)
+#define HOWMANY(x, y) (((x)+((y)-1))/(y))
+#define ROUNDUP(x, y) (HOWMANY((x), (y))*(y))