ne2000.h 960 B

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