aboutsummaryrefslogtreecommitdiff
path: root/hw/ne2000.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-09-10 11:43:33 +0200
committermalc <av1474@comtv.ru>2009-09-10 19:48:01 +0400
commit9453c5bc2634fdbdd05450034c21a58806d366a4 (patch)
treea0e3f729626cd1021d9c2086e47f4730ae6fd165 /hw/ne2000.h
parent9df34396d5066678d13155eea2060f73a36b98a9 (diff)
qdev/isa: convert ne2000
Also split the isa bits into a separate source file, so we don't drag in a dependency for isa-bus.o for machines which want ne2k_pci only. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/ne2000.h')
-rw-r--r--hw/ne2000.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/hw/ne2000.h b/hw/ne2000.h
new file mode 100644
index 0000000000..92a2ddb41f
--- /dev/null
+++ b/hw/ne2000.h
@@ -0,0 +1,40 @@
+#define NE2000_PMEM_SIZE (32*1024)
+#define NE2000_PMEM_START (16*1024)
+#define NE2000_PMEM_END (NE2000_PMEM_SIZE+NE2000_PMEM_START)
+#define NE2000_MEM_SIZE NE2000_PMEM_END
+
+typedef struct NE2000State {
+ uint8_t cmd;
+ uint32_t start;
+ uint32_t stop;
+ uint8_t boundary;
+ uint8_t tsr;
+ uint8_t tpsr;
+ uint16_t tcnt;
+ uint16_t rcnt;
+ uint32_t rsar;
+ uint8_t rsr;
+ uint8_t rxcr;
+ uint8_t isr;
+ uint8_t dcfg;
+ uint8_t imr;
+ uint8_t phys[6]; /* mac address */
+ uint8_t curpag;
+ uint8_t mult[8]; /* multicast mask array */
+ qemu_irq irq;
+ VLANClientState *vc;
+ uint8_t macaddr[6];
+ uint8_t mem[NE2000_MEM_SIZE];
+} NE2000State;
+
+void ne2000_ioport_write(void *opaque, uint32_t addr, uint32_t val);
+uint32_t ne2000_ioport_read(void *opaque, uint32_t addr);
+void ne2000_asic_ioport_write(void *opaque, uint32_t addr, uint32_t val);
+uint32_t ne2000_asic_ioport_read(void *opaque, uint32_t addr);
+void ne2000_reset_ioport_write(void *opaque, uint32_t addr, uint32_t val);
+uint32_t ne2000_reset_ioport_read(void *opaque, uint32_t addr);
+void ne2000_save(QEMUFile* f, void* opaque);
+int ne2000_load(QEMUFile* f, void* opaque, int version_id);
+void ne2000_reset(NE2000State *s);
+int ne2000_can_receive(VLANClientState *vc);
+ssize_t ne2000_receive(VLANClientState *vc, const uint8_t *buf, size_t size_);