]> git.proxmox.com Git - mirror_qemu.git/blame - hw/net/ne2000.h
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
[mirror_qemu.git] / hw / net / ne2000.h
CommitLineData
cb9c377f 1#ifndef HW_NE2000_H
175de524 2#define HW_NE2000_H
cb9c377f 3
872a2b7c 4#include "qemu/units.h"
489983d6
PMD
5#include "hw/hw.h"
6#include "net/net.h"
7
872a2b7c
PMD
8#define NE2000_PMEM_SIZE (32 * KiB)
9#define NE2000_PMEM_START (16 * KiB)
9453c5bc
GH
10#define NE2000_PMEM_END (NE2000_PMEM_SIZE+NE2000_PMEM_START)
11#define NE2000_MEM_SIZE NE2000_PMEM_END
12
13typedef struct NE2000State {
1ec4e1dd 14 MemoryRegion io;
9453c5bc
GH
15 uint8_t cmd;
16 uint32_t start;
17 uint32_t stop;
18 uint8_t boundary;
19 uint8_t tsr;
20 uint8_t tpsr;
21 uint16_t tcnt;
22 uint16_t rcnt;
23 uint32_t rsar;
24 uint8_t rsr;
25 uint8_t rxcr;
26 uint8_t isr;
27 uint8_t dcfg;
28 uint8_t imr;
29 uint8_t phys[6]; /* mac address */
30 uint8_t curpag;
31 uint8_t mult[8]; /* multicast mask array */
32 qemu_irq irq;
1c2045b5 33 NICState *nic;
93db6685 34 NICConf c;
9453c5bc
GH
35 uint8_t mem[NE2000_MEM_SIZE];
36} NE2000State;
37
dcb117bf 38void ne2000_setup_io(NE2000State *s, DeviceState *dev, unsigned size);
7c131dd5 39extern const VMStateDescription vmstate_ne2000;
9453c5bc 40void ne2000_reset(NE2000State *s);
35277d14 41ssize_t ne2000_receive(NetClientState *nc, const uint8_t *buf, size_t size_);
cb9c377f
PB
42
43#endif