etherif.h 697 B

123456789101112131415161718192021222324252627282930313233
  1. enum {
  2. MaxEther = 24,
  3. Ntypes = 8,
  4. };
  5. typedef struct Ether Ether;
  6. struct Ether {
  7. ISAConf; /* hardware info */
  8. int ctlrno;
  9. int tbdf; /* type+busno+devno+funcno */
  10. int minmtu;
  11. int maxmtu;
  12. uchar ea[Eaddrlen];
  13. void (*attach)(Ether*); /* filled in by reset routine */
  14. void (*transmit)(Ether*);
  15. void (*interrupt)(Ureg*, void*);
  16. long (*ifstat)(Ether*, void*, long, ulong);
  17. long (*ctl)(Ether*, void*, long); /* custom ctl messages */
  18. void *ctlr;
  19. Queue* oq;
  20. Netif;
  21. };
  22. extern Block* etheriq(Ether*, Block*, int);
  23. extern void addethercard(char*, int(*)(Ether*));
  24. extern ulong ethercrc(uchar*, int);
  25. #define NEXT(x, l) (((x)+1)%(l))
  26. #define PREV(x, l) (((x) == 0) ? (l)-1: (x)-1)