19453c5bcSGerd Hoffmann #define NE2000_PMEM_SIZE (32*1024) 29453c5bcSGerd Hoffmann #define NE2000_PMEM_START (16*1024) 39453c5bcSGerd Hoffmann #define NE2000_PMEM_END (NE2000_PMEM_SIZE+NE2000_PMEM_START) 49453c5bcSGerd Hoffmann #define NE2000_MEM_SIZE NE2000_PMEM_END 59453c5bcSGerd Hoffmann 69453c5bcSGerd Hoffmann typedef struct NE2000State { 7*1ec4e1ddSAvi Kivity MemoryRegion io; 89453c5bcSGerd Hoffmann uint8_t cmd; 99453c5bcSGerd Hoffmann uint32_t start; 109453c5bcSGerd Hoffmann uint32_t stop; 119453c5bcSGerd Hoffmann uint8_t boundary; 129453c5bcSGerd Hoffmann uint8_t tsr; 139453c5bcSGerd Hoffmann uint8_t tpsr; 149453c5bcSGerd Hoffmann uint16_t tcnt; 159453c5bcSGerd Hoffmann uint16_t rcnt; 169453c5bcSGerd Hoffmann uint32_t rsar; 179453c5bcSGerd Hoffmann uint8_t rsr; 189453c5bcSGerd Hoffmann uint8_t rxcr; 199453c5bcSGerd Hoffmann uint8_t isr; 209453c5bcSGerd Hoffmann uint8_t dcfg; 219453c5bcSGerd Hoffmann uint8_t imr; 229453c5bcSGerd Hoffmann uint8_t phys[6]; /* mac address */ 239453c5bcSGerd Hoffmann uint8_t curpag; 249453c5bcSGerd Hoffmann uint8_t mult[8]; /* multicast mask array */ 259453c5bcSGerd Hoffmann qemu_irq irq; 261c2045b5SMark McLoughlin NICState *nic; 2793db6685SGerd Hoffmann NICConf c; 289453c5bcSGerd Hoffmann uint8_t mem[NE2000_MEM_SIZE]; 299453c5bcSGerd Hoffmann } NE2000State; 309453c5bcSGerd Hoffmann 31*1ec4e1ddSAvi Kivity void ne2000_setup_io(NE2000State *s, unsigned size); 327c131dd5SJuan Quintela extern const VMStateDescription vmstate_ne2000; 339453c5bcSGerd Hoffmann void ne2000_reset(NE2000State *s); 349453c5bcSGerd Hoffmann int ne2000_can_receive(VLANClientState *vc); 359453c5bcSGerd Hoffmann ssize_t ne2000_receive(VLANClientState *vc, const uint8_t *buf, size_t size_); 36