4 #define PCNET_IOPORT_SIZE 0x20
5 #define PCNET_PNPMMIO_SIZE 0x20
7 #define PCNET_LOOPTEST_CRC 1
8 #define PCNET_LOOPTEST_NOCRC 2
10 #include "exec/memory.h"
12 /* BUS CONFIGURATION REGISTERS */
26 #define BCR_TMAULOOP(S) !!((S)->bcr[BCR_MC ] & 0x4000)
27 #define BCR_APROMWE(S) !!((S)->bcr[BCR_MC ] & 0x0100)
28 #define BCR_DWIO(S) !!((S)->bcr[BCR_BSBC] & 0x0080)
29 #define BCR_SSIZE32(S) !!((S)->bcr[BCR_SWS ] & 0x0100)
30 #define BCR_SWSTYLE(S) ((S)->bcr[BCR_SWS ] & 0x00FF)
32 typedef struct PCNetState_st PCNetState
;
34 struct PCNetState_st
{
37 QEMUTimer
*poll_timer
;
48 void (*phys_mem_read
)(void *dma_opaque
, hwaddr addr
,
49 uint8_t *buf
, int len
, int do_bswap
);
50 void (*phys_mem_write
)(void *dma_opaque
, hwaddr addr
,
51 uint8_t *buf
, int len
, int do_bswap
);
57 void pcnet_h_reset(void *opaque
);
58 void pcnet_ioport_writew(void *opaque
, uint32_t addr
, uint32_t val
);
59 uint32_t pcnet_ioport_readw(void *opaque
, uint32_t addr
);
60 void pcnet_ioport_writel(void *opaque
, uint32_t addr
, uint32_t val
);
61 uint32_t pcnet_ioport_readl(void *opaque
, uint32_t addr
);
62 uint32_t pcnet_bcr_readw(PCNetState
*s
, uint32_t rap
);
63 int pcnet_can_receive(NetClientState
*nc
);
64 ssize_t
pcnet_receive(NetClientState
*nc
, const uint8_t *buf
, size_t size_
);
65 void pcnet_set_link_status(NetClientState
*nc
);
66 void pcnet_common_cleanup(PCNetState
*d
);
67 int pcnet_common_init(DeviceState
*dev
, PCNetState
*s
, NetClientInfo
*info
);
68 extern const VMStateDescription vmstate_pcnet
;