ne2000.h 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef HW_NE2000_H
  2. #define HW_NE2000_H 1
  3. #define NE2000_PMEM_SIZE (32*1024)
  4. #define NE2000_PMEM_START (16*1024)
  5. #define NE2000_PMEM_END (NE2000_PMEM_SIZE+NE2000_PMEM_START)
  6. #define NE2000_MEM_SIZE NE2000_PMEM_END
  7. typedef struct NE2000State {
  8. MemoryRegion io;
  9. uint8_t cmd;
  10. uint32_t start;
  11. uint32_t stop;
  12. uint8_t boundary;
  13. uint8_t tsr;
  14. uint8_t tpsr;
  15. uint16_t tcnt;
  16. uint16_t rcnt;
  17. uint32_t rsar;
  18. uint8_t rsr;
  19. uint8_t rxcr;
  20. uint8_t isr;
  21. uint8_t dcfg;
  22. uint8_t imr;
  23. uint8_t phys[6]; /* mac address */
  24. uint8_t curpag;
  25. uint8_t mult[8]; /* multicast mask array */
  26. qemu_irq irq;
  27. NICState *nic;
  28. NICConf c;
  29. uint8_t mem[NE2000_MEM_SIZE];
  30. } NE2000State;
  31. void ne2000_setup_io(NE2000State *s, unsigned size);
  32. extern const VMStateDescription vmstate_ne2000;
  33. void ne2000_reset(NE2000State *s);
  34. int ne2000_can_receive(NetClientState *nc);
  35. ssize_t ne2000_receive(NetClientState *nc, const uint8_t *buf, size_t size_);
  36. #endif