You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nic.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * This program is free software; you can redistribute it and/or
  3. * modify it under the terms of the GNU General Public License as
  4. * published by the Free Software Foundation; either version 2, or (at
  5. * your option) any later version.
  6. */
  7. #ifndef NIC_H
  8. #define NIC_H
  9. #include "dev.h"
  10. typedef enum {
  11. DISABLE = 0,
  12. ENABLE,
  13. FORCE
  14. } irq_action_t;
  15. /*
  16. * Structure returned from eth_probe and passed to other driver
  17. * functions.
  18. */
  19. struct nic
  20. {
  21. struct dev dev; /* This must come first */
  22. int (*poll)P((struct nic *, int retrieve));
  23. void (*transmit)P((struct nic *, const char *d,
  24. unsigned int t, unsigned int s, const char *p));
  25. void (*irq)P((struct nic *, irq_action_t));
  26. int flags; /* driver specific flags */
  27. struct rom_info *rom_info; /* -> rom_info from main */
  28. unsigned char *node_addr;
  29. unsigned char *packet;
  30. unsigned int packetlen;
  31. unsigned int ioaddr;
  32. unsigned char irqno;
  33. void *priv_data; /* driver can hang private data here */
  34. };
  35. extern struct nic nic;
  36. extern int eth_probe(struct dev *dev);
  37. extern int eth_poll(int retrieve);
  38. extern void eth_transmit(const char *d, unsigned int t, unsigned int s, const void *p);
  39. extern void eth_disable(void);
  40. extern void eth_irq(irq_action_t action);
  41. extern int eth_load_configuration(struct dev *dev);
  42. extern int eth_load(struct dev *dev);;
  43. #endif /* NIC_H */