1 enum 2 { 3 MaxEther = 2, 4 Ntypes = 8, 5 }; 6 7 typedef struct Ether Ether; 8 struct Ether { 9 RWlock; /* TO DO */ 10 ISAConf; /* hardware info */ 11 int ctlrno; 12 int minmtu; 13 int maxmtu; 14 uchar ea[Eaddrlen]; 15 int tbusy; 16 int encry; 17 18 void (*attach)(Ether*); /* filled in by reset routine */ 19 void (*closed)(Ether*); 20 void (*detach)(Ether*); 21 void (*transmit)(Ether*); 22 int (*interrupt)(ulong); 23 long (*ifstat)(Ether*, void*, long, ulong); 24 long (*ctl)(Ether*, void*, long); /* custom ctl messages */ 25 void (*power)(Ether*, int); /* power on/off */ 26 void (*shutdown)(Ether*); /* shutdown hardware before reboot */ 27 void *ctlr; 28 int pcmslot; /* PCMCIA */ 29 int fullduplex; /* non-zero if full duplex */ 30 31 Queue* oq; 32 33 /* statistics */ 34 ulong interrupts; 35 ulong dmarxintr; 36 ulong dmatxintr; 37 ulong promisc; 38 ulong pktsdropped; 39 ulong pktsmisaligned; 40 ulong resets; /* after initialisation */ 41 ulong bcasts; /* broadcast pkts rcv'd */ 42 ulong mcasts; /* multicast pkts rcv'd */ 43 44 Netif; 45 }; 46 47 extern Block* etheriq(Ether*, Block*, int); 48 extern void addethercard(char*, int(*)(Ether*)); 49 extern int archether(int, Ether*); 50