ne2000.h 1005 B

123456789101112131415161718192021222324252627282930
  1. /* NE2000-compatible (Realtek RTL8029AS) Ethernet driver.
  2. Polling based (no IRQ), byte-mode remote DMA, on-card 16 KB SRAM ring. */
  3. #ifndef NE2000_H
  4. #define NE2000_H
  5. /* Probe + reset + configure the NIC. Idempotent; 0 on success, -1 if absent. */
  6. int ne2000_init(void);
  7. /* 1 if a supported NIC was found. */
  8. int ne2000_present(void);
  9. /* Copy the NIC's 6-byte MAC address into out[]. */
  10. void ne2000_get_mac(unsigned char out[6]);
  11. /* Print NIC info (base, MAC) to the console. */
  12. void ne2000_print_info(void);
  13. /* Poll one received frame. Returns length (>= 14) or -1 if none pending.
  14. buf must hold at least maxlen bytes; frames longer than maxlen are skipped. */
  15. int ne2000_rx(unsigned char *buf, unsigned int maxlen);
  16. /* Transmit a raw Ethernet frame (must include the 14-byte header).
  17. Returns 0 on success, -1 on error. */
  18. int ne2000_tx(const unsigned char *buf, unsigned int len);
  19. /* netdev adapter (see netdev.h). */
  20. #include "netdev.h"
  21. extern const struct netdev ne2000_netdev;
  22. #endif