Skip to contentSkip to conversation

PATCH: Add 3C90X emulation

Qemu-devel Matthew Iselin 3 participants 7 messages May 5, 2009 – Jul 2, 2009 5 messages not in the archive Kbuild

lore
Share & tools
lore
#0 lore raw

Hi,

This patch adds the 3Com 3C90x series to the set of NICs that QEMU can emulate. It is still a work in progress, however
at this stage it has the base required functionality and works with Ubuntu and Damn Small Linux.

Part 1 modifies the Makefile.target file to add the object file for the emulation implementation.

Part 2 includes the hw directory modifications, including the new 3c90x.c file.

Thanks,

Matthew

qemu-0.10.3/Makefile.target renamed from qemu-0.10.3-clean/Makefile.target +1 -0
@@ -572,6 +572,7 @@ OBJS += eepro100.o
 OBJS += ne2000.o
 OBJS += pcnet.o
 OBJS += rtl8139.o
+OBJS += 3c90x.o
 OBJS += e1000.o
 
 # Serial mouse
qemu-0.10.3/hw/3c90x.c renamed from qemu-0.10.3-clean/hw/3c90x.c +2405 -0

2,405 lines not on this page · raw message

qemu-0.10.3/hw/pci.c renamed from qemu-0.10.3-clean/hw/pci.c +2 -0
diff -ruNp -- ./qemu-0.10.3-clean/hw/pci.c ./qemu-0.10.3/hw/pci.c
@@ -781,6 +781,7 @@ static const char * const pci_nic_models
     "i82557b",
     "i82559er",
     "rtl8139",
+    "3c90x",
     "e1000",
     "pcnet",
     "virtio",
@@ -795,6 +796,7 @@ static PCINICInitFn pci_nic_init_fns[] =
     pci_i82557b_init,
     pci_i82559er_init,
     pci_rtl8139_init,
+    pci_a3c90x_init,
     pci_e1000_init,
     pci_pcnet_init,
     virtio_net_init,
qemu-0.10.3/hw/pci.h renamed from qemu-0.10.3-clean/hw/pci.h +6 -0
diff -ruNp -- ./qemu-0.10.3-clean/hw/pci.h ./qemu-0.10.3/hw/pci.h
@@ -85,6 +85,9 @@ extern target_phys_addr_t pci_mem_base;
 #define PCI_DEVICE_ID_REALTEK_RTL8029    0x8029
 #define PCI_DEVICE_ID_REALTEK_8139       0x8139
 
+#define PCI_VENDOR_ID_3COM               0x10b7
+#define PCI_DEVICE_ID_3C90X              0x9200
+
 #define PCI_VENDOR_ID_XILINX             0x10ee
 
 #define PCI_VENDOR_ID_MARVELL            0x11ab
@@ -294,6 +297,9 @@ PCIDevice *pci_ne2000_init(PCIBus *bus, 
 
 PCIDevice *pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn);
 
+/* 3c90x.c */
+PCIDevice *pci_a3c90x_init(PCIBus *bus, NICInfo *nd, int devfn);
+
 /* e1000.c */
 PCIDevice *pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn);
 
#1 lore raw
Quoted 7 lines · Matthew Iselin

Hi,

This patch adds the 3Com 3C90x series to the set of NICs that QEMU can emulate. It is still a work in progress, however
at this stage it has the base required functionality and works with Ubuntu and Damn Small Linux.

Quoted 8 lines

Part 1 modifies the Makefile.target file to add the object file for the emulation implementation.

Part 2 includes the hw directory modifications, including the new 3c90x.c file.

Thanks,

Matthew

The patch unfortunatelly no longer applies. Can you please rebase on top of git master and resend?

- Sebastian

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 3 lines · Sebastian

The patch unfortunatelly no longer applies. Can you please rebase on top of git master
and resend?

Hi,

The attached patch now applies to the latest git master.

Thanks,

Matthew

Makefile.target +1 -0
index 82ada5a..d43355c 100644
@@ -580,6 +580,7 @@ OBJS += eepro100.o
 OBJS += ne2000.o
 OBJS += pcnet.o
 OBJS += rtl8139.o
+OBJS += 3c90x.o
 OBJS += e1000.o
 
 ifeq ($(TARGET_BASE_ARCH), i386)
hw/3c90x.c new file +2405 -0

2,405 lines not on this page · raw message

hw/pci.c +2 -0
index bfd3942..e8603df 100644
@@ -783,6 +783,7 @@ static const char * const pci_nic_models[] = {
     "i82557b",
     "i82559er",
     "rtl8139",
+    "3c90x",
     "e1000",
     "pcnet",
     "virtio",
@@ -797,6 +798,7 @@ static PCINICInitFn pci_nic_init_fns[] = {
     pci_i82557b_init,
     pci_i82559er_init,
     pci_rtl8139_init,
+    pci_a3c90x_init,
     pci_e1000_init,
     pci_pcnet_init,
     virtio_net_init,
hw/pci.h +3 -0
index 4a30d98..18bedfe 100644
@@ -242,6 +242,9 @@ PCIDevice *pci_ne2000_init(PCIBus *bus, NICInfo *nd, int devfn);
 
 PCIDevice *pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn);
 
+/* 3c90x.c */
+PCIDevice *pci_a3c90x_init(PCIBus *bus, NICInfo *nd, int devfn);
+
 /* e1000.c */
 PCIDevice *pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn);
 
hw/pci_ids.h +3 -0
index 427fcd5..4f7b788 100644
@@ -73,6 +73,9 @@
 #define PCI_VENDOR_ID_REALTEK            0x10ec
 #define PCI_DEVICE_ID_REALTEK_8139       0x8139
 
+#define PCI_VENDOR_ID_3COM               0x10b7
+#define PCI_DEVICE_ID_3C90X              0x9200
+
 #define PCI_VENDOR_ID_XILINX             0x10ee
 
 #define PCI_VENDOR_ID_MARVELL            0x11ab
#4 lore raw
Quoted 8 lines · Matthew Iselin
Quoted 3 lines · Sebastian

The patch unfortunatelly no longer applies. Can you please rebase on top of git master
and resend?

Hi,

The attached patch now applies to the latest git master.

Still no go here. Can you please state on top of which commit it does apply?

- Sebastian

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): EE2BA4D82E644425BA529D5A9D43F756@FSCPC

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

Hi,

After a long break in which I wasn't able to actually get access to a system to create the patch on, I present this patch, which applies cleanly to commit 3da6abd472200bc30b88d5a900ad316d9517d163 ("Use pstrcpy and pstrcat to avoid OpenBSD linker warning").

Thanks,

Matthew

#10 lore raw
Quoted 6 lines · Matthew Iselin

Hi,

After a long break in which I wasn't able to actually get access to a system to create the patch on, I present this patch, which applies cleanly to commit 3da6abd472200bc30b88d5a900ad316d9517d163 ("Use pstrcpy and pstrcat to avoid OpenBSD linker warning").

I think you forgot something... ;-)

Also, if you want the patch to merged you should send a proper patch description that can serve as a commit message, including a Signed-off-by line. You don't seem to have included this in the previous attempts.

Kevin

#11 lore raw
Quoted 8 lines · Kevin Wolf

I think you forgot something... ;-)
Also, if you want the patch to merged you should send a proper patch description that can serve as a commit message, including a Signed-off-by line. You don't seem to have included this in the previous attempts.

Kevin

Hi,

Whoops! New patch attached.

Cheers,

Matthew

This patch adds an emulation of the 3Com 3C90x series of NICs to QEMU.

---
 Makefile.target |    1 +
 hw/3c90x.c      | 2408 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/pci.c        |    2 +
 hw/pci_ids.h    |    3 +
 4 files changed, 2414 insertions(+), 0 deletions(-)
 create mode 100644 hw/3c90x.c
Makefile.target +1 -0
index a593503..eb45199 100644
@@ -555,6 +555,7 @@ obj-y += eepro100.o
 obj-y += ne2000.o
 obj-y += pcnet.o
 obj-y += rtl8139.o
+obj-y += 3c90x.o
 obj-y += e1000.o
 
 # Generic watchdog support and some watchdog devices
hw/3c90x.c new file +2408 -0

2,408 lines not on this page · raw message

hw/pci.c +2 -0
index 4458079..e11dda6 100644
@@ -771,6 +771,7 @@ static const char * const pci_nic_models[] = {
     "i82557b",
     "i82559er",
     "rtl8139",
+	"3c90x",
     "e1000",
     "pcnet",
     "virtio",
@@ -783,6 +784,7 @@ static const char * const pci_nic_names[] = {
     "i82557b",
     "i82559er",
     "rtl8139",
+	"3c90x",
     "e1000",
     "pcnet",
     "virtio-net-pci",
hw/pci_ids.h +3 -0
index 3afe674..edbbcb7 100644
@@ -75,6 +75,9 @@
 #define PCI_VENDOR_ID_REALTEK            0x10ec
 #define PCI_DEVICE_ID_REALTEK_8139       0x8139
 
+#define PCI_VENDOR_ID_3COM               0x10b7
+#define PCI_VENDOR_ID_3COM_3C90X         0x9200
+
 #define PCI_VENDOR_ID_XILINX             0x10ee
 
 #define PCI_VENDOR_ID_MARVELL            0x11ab
Signature · 1 line
1.6.3.2.1299.gee46c