Unify the calling of setup_translation(). --- src/ahci.c | 2 -- src/ata.c | 3 --- src/block.c | 5 ++++- src/disk.h | 1 - src/usb-msc.c | 3 --- src/virtio-blk.c | 1 - 6 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/src/ahci.c b/src/ahci.c index a7f458f..8fd2e14 100644 --- a/src/ahci.c +++ b/src/ahci.c @@ -379,8 +379,6 @@ ahci_port_init(struct ahci_ctrl_s *ctrl, u32 pnr) , ata_extract_version(buffer) , (u32)adjsize, adjprefix);
- // Setup disk geometry translation. - setup_translation(&port->drive); // Register with bcv system. boot_add_hd(&port->drive, -1); } else { diff --git a/src/ata.c b/src/ata.c index 872c5e3..86b89b5 100644 --- a/src/ata.c +++ b/src/ata.c @@ -834,9 +834,6 @@ init_drive_ata(struct atadrive_s *dummy, u16 *buffer) , (u32)adjsize, adjprefix); dprintf(1, "%s\n", adrive_g->drive.desc);
- // Setup disk geometry translation. - setup_translation(&adrive_g->drive); - int prio = bootprio_find_ata_device(adrive_g->chan_gf->pci_bdf, adrive_g->chan_gf->chanid, adrive_g->slave); diff --git a/src/block.c b/src/block.c index 6a3faa3..dafaaa6 100644 --- a/src/block.c +++ b/src/block.c @@ -72,7 +72,7 @@ get_translation(struct drive_s *drive_g) return TRANSLATION_LBA; }
-void +static void setup_translation(struct drive_s *drive_g) { u8 translation = get_translation(drive_g); @@ -221,6 +221,9 @@ map_hd_drive(struct drive_s *drive_g) dprintf(3, "Mapping hd drive %p to %d\n", drive_g, hdid); add_drive(Drives.idmap[EXTTYPE_HD], &bda->hdcount, drive_g);
+ // Setup disk geometry translation. + setup_translation(drive_g); + // Fill "fdpt" structure. fill_fdpt(drive_g, hdid); } diff --git a/src/disk.h b/src/disk.h index a598bb4..4802011 100644 --- a/src/disk.h +++ b/src/disk.h @@ -230,7 +230,6 @@ struct drives_s { extern struct drives_s Drives; struct drive_s *getDrive(u8 exttype, u8 extdriveoffset); int getDriveId(u8 exttype, struct drive_s *drive_g); -void setup_translation(struct drive_s *drive_g); void map_floppy_drive(struct drive_s *drive_g); void map_hd_drive(struct drive_s *drive_g); void map_cd_drive(struct drive_s *drive_g); diff --git a/src/usb-msc.c b/src/usb-msc.c index 2a6c31a..877ece4 100644 --- a/src/usb-msc.c +++ b/src/usb-msc.c @@ -167,9 +167,6 @@ setup_drive_hd(struct disk_op_s *op) op->drive_g->sectors = sectors; dprintf(1, "USB MSC blksize=%d sectors=%d\n", blksize, sectors);
- // Setup disk geometry translation. - setup_translation(op->drive_g); - // Register with bcv system. boot_add_hd(op->drive_g, -1);
diff --git a/src/virtio-blk.c b/src/virtio-blk.c index 834523a..6b49164 100644 --- a/src/virtio-blk.c +++ b/src/virtio-blk.c @@ -155,7 +155,6 @@ init_virtio_blk(u16 bdf) pci_bdf_to_bus(bdf), pci_bdf_to_dev(bdf)); vdrive_g->drive.desc = desc;
- setup_translation(&vdrive_g->drive); boot_add_hd(&vdrive_g->drive, bootprio_find_pci_device(bdf));
vp_set_status(ioaddr, VIRTIO_CONFIG_S_ACKNOWLEDGE |