summaryrefslogtreecommitdiff
path: root/sys/src/9/teg2/etherif.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-01-26 17:33:21 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2013-01-26 17:33:21 +0100
commitea108c8ca6e726ac008f75775ab83775ec233171 (patch)
tree982816b58d50e1b12b7eeb2c29fe22ca8d9c195b /sys/src/9/teg2/etherif.h
parent43e09c468b4c6562c93c9375a316012e238d21b2 (diff)
add tegra2 soc kernel (from sources)
Diffstat (limited to 'sys/src/9/teg2/etherif.h')
-rw-r--r--sys/src/9/teg2/etherif.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/sys/src/9/teg2/etherif.h b/sys/src/9/teg2/etherif.h
new file mode 100644
index 000000000..bae31be07
--- /dev/null
+++ b/sys/src/9/teg2/etherif.h
@@ -0,0 +1,42 @@
+enum
+{
+ MaxEther = 4,
+ Ntypes = 8,
+};
+
+typedef struct Ether Ether;
+struct Ether {
+ RWlock;
+ ISAConf; /* hardware info */
+
+ int ctlrno;
+ ulong tbdf;
+ int minmtu;
+ int maxmtu;
+
+ Netif;
+
+ 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;
+ uchar ea[Eaddrlen];
+ void* address;
+ int irq;
+
+ Queue* oq;
+};
+
+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)