qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Add support for r6040 NIC


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] Add support for r6040 NIC
Date: Tue, 30 Aug 2011 20:59:12 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 08/30/2011 08:30 PM, malc wrote:
On Tue, 30 Aug 2011, Anthony Liguori wrote:

This won't even come close to passing checkpatch.pl

Have you actually tried?

Sigh.  I was hoping checkpatch.pl was more useful than it appears to be.

At any rate, the patch doesn't follow CODING_STYLE.

Regards,

Anthony Liguori



Regards,

Anthony Liguori

On 08/30/2011 08:05 PM, bifferos wrote:

Signed-off-by: Mark Kelly<address@hidden>
diff --git a/Makefile.objs b/Makefile.objs
index 6991a9f..7d87503 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -240,6 +240,7 @@ hw-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o
   hw-obj-$(CONFIG_PCNET_COMMON) += pcnet.o
   hw-obj-$(CONFIG_E1000_PCI) += e1000.o
   hw-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o
+hw-obj-$(CONFIG_R6040_PCI) += r6040.o

   hw-obj-$(CONFIG_SMC91C111) += smc91c111.o
   hw-obj-$(CONFIG_LAN9118) += lan9118.o
diff --git a/default-configs/pci.mak b/default-configs/pci.mak
index 22bd350..d2ea7a2 100644
--- a/default-configs/pci.mak
+++ b/default-configs/pci.mak
@@ -10,6 +10,7 @@ CONFIG_PCNET_PCI=y
   CONFIG_PCNET_COMMON=y
   CONFIG_LSI_SCSI_PCI=y
   CONFIG_RTL8139_PCI=y
+CONFIG_R6040_PCI=y
   CONFIG_E1000_PCI=y
   CONFIG_IDE_CORE=y
   CONFIG_IDE_QDEV=y
diff --git a/hw/pci.c b/hw/pci.c
index b904a4e..7e12935 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1527,6 +1527,7 @@ static const char * const pci_nic_models[] = {
       "rtl8139",
       "e1000",
       "pcnet",
+    "r6040",
       "virtio",
       NULL
   };
@@ -1539,6 +1540,7 @@ static const char * const pci_nic_names[] = {
       "rtl8139",
       "e1000",
       "pcnet",
+    "r6040",
       "virtio-net-pci",
       NULL
   };
diff --git a/hw/r6040.c b/hw/r6040.c
new file mode 100644
index 0000000..83587e7
--- /dev/null
+++ b/hw/r6040.c
@@ -0,0 +1,627 @@
+/*
+   Emulation of r6040 ethernet controller found in a number of SoCs.
+   Copyright (c) 2011 Mark Kelly, address@hidden

This doesn't spell out under which conditions this can be used by
people other than Mark Kelly.

+
+   This has been written using the R8610[1] and ip101a[2] datasheets.
+
+   ICs with the embedded controller include R8610, R3210, AMRISC20000
+   and Vortex86SX
+
+   The emulation seems good enough to fool Linux 2.6.37.6.  It is
+   not perfect, but has proven useful.
+
+   [1] http://www.sima.com.tw/download/R8610_D06_20051003.pdf
+   [2] http://www.icplus.com.tw/pp-IP101A.html
+ */
+
+#include "hw.h"
+#include "pci.h"
+#include "net.h"
+#include "loader.h"
+#include "sysemu.h"
+#include "qemu-timer.h"
+
+/* #define DEBUG_R6040 1 */
+
+
+#if defined DEBUG_R6040
+#define DPRINTF(fmt, ...) \
+    do { fprintf(stderr, "R6040: " fmt, ## __VA_ARGS__); } while (0)
+#else
+static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...)
+{
+    return 0;
+}
+#endif
+
+
+/* Cast in order of appearance.  _W prevfix means it's used to index the

                                          prefix (though suffix is even better)

[..snip..]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]