1 #define PCNET_IOPORT_SIZE 0x20
2 #define PCNET_PNPMMIO_SIZE 0x20
4 #define PCNET_LOOPTEST_CRC 1
5 #define PCNET_LOOPTEST_NOCRC 2
9 /* BUS CONFIGURATION REGISTERS */
23 #define BCR_APROMWE(S) !!((S)->bcr[BCR_MC ] & 0x0100)
24 #define BCR_DWIO(S) !!((S)->bcr[BCR_BSBC] & 0x0080)
25 #define BCR_SSIZE32(S) !!((S)->bcr[BCR_SWS ] & 0x0100)
26 #define BCR_SWSTYLE(S) ((S)->bcr[BCR_SWS ] & 0x00FF)
28 typedef struct PCNetState_st PCNetState
;
30 struct PCNetState_st
{
33 QEMUTimer
*poll_timer
;
44 void (*phys_mem_read
)(void *dma_opaque
, target_phys_addr_t addr
,
45 uint8_t *buf
, int len
, int do_bswap
);
46 void (*phys_mem_write
)(void *dma_opaque
, target_phys_addr_t addr
,
47 uint8_t *buf
, int len
, int do_bswap
);
53 void pcnet_h_reset(void *opaque
);
54 void pcnet_ioport_writew(void *opaque
, uint32_t addr
, uint32_t val
);
55 uint32_t pcnet_ioport_readw(void *opaque
, uint32_t addr
);
56 void pcnet_ioport_writel(void *opaque
, uint32_t addr
, uint32_t val
);
57 uint32_t pcnet_ioport_readl(void *opaque
, uint32_t addr
);
58 uint32_t pcnet_bcr_readw(PCNetState
*s
, uint32_t rap
);
59 int pcnet_can_receive(VLANClientState
*nc
);
60 ssize_t
pcnet_receive(VLANClientState
*nc
, const uint8_t *buf
, size_t size_
);
61 void pcnet_set_link_status(VLANClientState
*nc
);
62 void pcnet_common_cleanup(PCNetState
*d
);
63 int pcnet_common_init(DeviceState
*dev
, PCNetState
*s
, NetClientInfo
*info
);
64 extern const VMStateDescription vmstate_pcnet
;