summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/probing.c12
-rw-r--r--mdk-stage1/probing.h7
2 files changed, 11 insertions, 8 deletions
diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c
index 4ca30fbe4..3052b2823 100644
--- a/mdk-stage1/probing.c
+++ b/mdk-stage1/probing.c
@@ -329,18 +329,22 @@ void probe_virtio_modules(void)
int i;
char *name;
char *options;
+ int loaded_pci = 0;
entries = pci_probe();
for (i = 0; i < entries.nb; i++) {
struct pciusb_entry *e = &entries.entries[i];
if (e->vendor == VIRTIO_PCI_VENDOR) {
+ if (!loaded_pci) {
+ log_message("loading virtio-pci");
+ my_insmod("virtio_pci", ANY_DRIVER_TYPE, NULL, 0);
+ loaded_pci = 1;
+ }
+
name = NULL;
options = NULL;
- switch (e->device) {
- case VIRTIO_ID_PCI:
- name = "virtio_pci";
- break;
+ switch (e->subdevice) {
case VIRTIO_ID_NET:
name = "virtio_net";
options = "csum=0";
diff --git a/mdk-stage1/probing.h b/mdk-stage1/probing.h
index 15dec7392..b4eda9c34 100644
--- a/mdk-stage1/probing.h
+++ b/mdk-stage1/probing.h
@@ -30,10 +30,9 @@ enum driver_type { MEDIA_ADAPTERS, NETWORK_DEVICES, USB_CONTROLLERS,
enum media_bus { BUS_IDE, BUS_SCSI, BUS_USB, BUS_PCMCIA, BUS_ANY };
#define VIRTIO_PCI_VENDOR 0x1af4
-#define VIRTIO_ID_PCI 0x1000
-#define VIRTIO_ID_NET 0x1001
-#define VIRTIO_ID_BLOCK 0x1002
-#define VIRTIO_ID_BALLOON 0x1005
+#define VIRTIO_ID_NET 0x0001
+#define VIRTIO_ID_BLOCK 0x0002
+#define VIRTIO_ID_BALLOON 0x0005
void find_media(enum media_bus bus);
void get_medias(enum media_type media, char *** names, char *** models, enum media_bus bus);