diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2010-12-26 17:22:28 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2010-12-26 17:22:28 -0500 |
commit | ce24be5f62a2062aaca5805d0adc2c846fa0c9ba (patch) | |
tree | bd46e6fca37d65cb75e7ff103de94b6b50521c8f | |
parent | 74fd94294ee6eac510ab89819eae27442cbbff5d (diff) | |
download | seabios-hppa-ce24be5f62a2062aaca5805d0adc2c846fa0c9ba.zip seabios-hppa-ce24be5f62a2062aaca5805d0adc2c846fa0c9ba.tar.gz seabios-hppa-ce24be5f62a2062aaca5805d0adc2c846fa0c9ba.tar.bz2 |
Populate drive_g->desc prior to calling add_bcv_internal().
Make sure the description is populated before registering a drive.
-rw-r--r-- | src/usb-msc.c | 5 | ||||
-rw-r--r-- | src/virtio-blk.c | 8 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/usb-msc.c b/src/usb-msc.c index 080efdc..48635d9 100644 --- a/src/usb-msc.c +++ b/src/usb-msc.c @@ -235,6 +235,8 @@ usb_msc_init(struct usb_pipe *pipe , strtcpy(rev, data.rev, sizeof(rev)) , pdt, removable); udrive_g->drive.removable = removable; + snprintf(desc, MAXDESCSIZE, "USB Drive %s %s %s", vendor, product, rev); + udrive_g->drive.desc = desc; if (pdt == USB_MSC_TYPE_CDROM) ret = setup_drive_cdrom(&dop); @@ -243,9 +245,6 @@ usb_msc_init(struct usb_pipe *pipe if (ret) goto fail; - snprintf(desc, MAXDESCSIZE, "USB Drive %s %s %s", vendor, product, rev); - udrive_g->drive.desc = desc; - return 0; fail: dprintf(1, "Unable to configure USB MSC device.\n"); diff --git a/src/virtio-blk.c b/src/virtio-blk.c index 7a25826..9c9ed83 100644 --- a/src/virtio-blk.c +++ b/src/virtio-blk.c @@ -151,15 +151,13 @@ init_virtio_blk(u16 bdf) vdrive_g->drive.pchs.cylinders = cfg.cylinders; vdrive_g->drive.pchs.heads = cfg.heads; vdrive_g->drive.pchs.spt = cfg.sectors; - - setup_translation(&vdrive_g->drive); - add_bcv_internal(&vdrive_g->drive); - snprintf(desc, MAXDESCSIZE, "Virtio disk PCI:%x:%x", pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf)); - vdrive_g->drive.desc = desc; + setup_translation(&vdrive_g->drive); + add_bcv_internal(&vdrive_g->drive); + vp_set_status(ioaddr, VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER | VIRTIO_CONFIG_S_DRIVER_OK); return; |