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