eepro100: Fix boot ROM support
authorStefan Weil <weil@mail.berlios.de>
Sat, 31 Oct 2009 12:38:33 +0000 (13:38 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 12 Nov 2009 17:23:54 +0000 (11:23 -0600)
* Rename pxe-eepro100.bin to pxe-i82559er.bin.
  The other devices supported by eepro100.c need
  additional pxe boot ROM images.
* Call rom_add_option during initialisation.
  The code won't work with two or more different
  eepro100 devices, because it only adds one option
  ROM, but this use case is perhaps never needed.

Using this patch, model=i82559er at least works partially.
For full support, more eepro100 patches are needed
(will follow later, can be fetched from ar7 branch
of QEMU).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/eepro100.c
pc-bios/pxe-eepro100.bin [deleted file]
pc-bios/pxe-i82559er.bin [new file with mode: 0644]

index 25aabcf209e89785b6efee8bb9dd3a75bb0e3e4e..c5ec0be0d5a1bdb487c39f11606219cbe628a275 100644 (file)
@@ -40,6 +40,7 @@
 #include <stddef.h>             /* offsetof */
 #include <stdbool.h>
 #include "hw.h"
+#include "loader.h"             /* rom_add_option */
 #include "pci.h"
 #include "net.h"
 #include "eeprom93xx.h"
@@ -1843,6 +1844,16 @@ static int nic_init(PCIDevice *pci_dev, uint32_t device)
     memcpy(s->vmstate, &vmstate_eepro100, sizeof(vmstate_eepro100));
     s->vmstate->name = s->vc->model;
     vmstate_register(-1, s->vmstate, s);
+
+    if (!pci_dev->qdev.hotplugged) {
+        static int loaded = 0;
+        if (!loaded) {
+            char fname[32];
+            snprintf(fname, sizeof(fname), "pxe-%s.bin", s->vc->model);
+            rom_add_option(fname);
+            loaded = 1;
+        }
+    }
     return 0;
 }
 
diff --git a/pc-bios/pxe-eepro100.bin b/pc-bios/pxe-eepro100.bin
deleted file mode 100644 (file)
index 2ca59ec..0000000
Binary files a/pc-bios/pxe-eepro100.bin and /dev/null differ
diff --git a/pc-bios/pxe-i82559er.bin b/pc-bios/pxe-i82559er.bin
new file mode 100644 (file)
index 0000000..2ca59ec
Binary files /dev/null and b/pc-bios/pxe-i82559er.bin differ