Statistics
| Branch: | Revision:

root / hw / pcnet.h @ c6df7102

History | View | Annotate | Download (1.4 kB)

1 94e1a912 Gerd Hoffmann
#define PCNET_IOPORT_SIZE       0x20
2 94e1a912 Gerd Hoffmann
#define PCNET_PNPMMIO_SIZE      0x20
3 94e1a912 Gerd Hoffmann
4 94e1a912 Gerd Hoffmann
#define PCNET_LOOPTEST_CRC        1
5 94e1a912 Gerd Hoffmann
#define PCNET_LOOPTEST_NOCRC        2
6 94e1a912 Gerd Hoffmann
7 94e1a912 Gerd Hoffmann
8 94e1a912 Gerd Hoffmann
typedef struct PCNetState_st PCNetState;
9 94e1a912 Gerd Hoffmann
10 94e1a912 Gerd Hoffmann
struct PCNetState_st {
11 1fa51482 Mark McLoughlin
    NICState *nic;
12 94e1a912 Gerd Hoffmann
    NICConf conf;
13 94e1a912 Gerd Hoffmann
    QEMUTimer *poll_timer;
14 94e1a912 Gerd Hoffmann
    int rap, isr, lnkst;
15 94e1a912 Gerd Hoffmann
    uint32_t rdra, tdra;
16 94e1a912 Gerd Hoffmann
    uint8_t prom[16];
17 94e1a912 Gerd Hoffmann
    uint16_t csr[128];
18 94e1a912 Gerd Hoffmann
    uint16_t bcr[32];
19 94e1a912 Gerd Hoffmann
    uint64_t timer;
20 94e1a912 Gerd Hoffmann
    int mmio_index, xmit_pos;
21 94e1a912 Gerd Hoffmann
    uint8_t buffer[4096];
22 94e1a912 Gerd Hoffmann
    int tx_busy;
23 94e1a912 Gerd Hoffmann
    qemu_irq irq;
24 94e1a912 Gerd Hoffmann
    void (*phys_mem_read)(void *dma_opaque, target_phys_addr_t addr,
25 94e1a912 Gerd Hoffmann
                         uint8_t *buf, int len, int do_bswap);
26 94e1a912 Gerd Hoffmann
    void (*phys_mem_write)(void *dma_opaque, target_phys_addr_t addr,
27 94e1a912 Gerd Hoffmann
                          uint8_t *buf, int len, int do_bswap);
28 94e1a912 Gerd Hoffmann
    void *dma_opaque;
29 94e1a912 Gerd Hoffmann
    int looptest;
30 94e1a912 Gerd Hoffmann
};
31 94e1a912 Gerd Hoffmann
32 94e1a912 Gerd Hoffmann
void pcnet_h_reset(void *opaque);
33 94e1a912 Gerd Hoffmann
void pcnet_ioport_writew(void *opaque, uint32_t addr, uint32_t val);
34 94e1a912 Gerd Hoffmann
uint32_t pcnet_ioport_readw(void *opaque, uint32_t addr);
35 a4c75a21 Paul Brook
void pcnet_ioport_writel(void *opaque, uint32_t addr, uint32_t val);
36 a4c75a21 Paul Brook
uint32_t pcnet_ioport_readl(void *opaque, uint32_t addr);
37 a4c75a21 Paul Brook
uint32_t pcnet_bcr_readw(PCNetState *s, uint32_t rap);
38 1fa51482 Mark McLoughlin
int pcnet_can_receive(VLANClientState *nc);
39 1fa51482 Mark McLoughlin
ssize_t pcnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size_);
40 94e1a912 Gerd Hoffmann
void pcnet_common_cleanup(PCNetState *d);
41 1fa51482 Mark McLoughlin
int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info);
42 3d865059 Juan Quintela
extern const VMStateDescription vmstate_pcnet;