]> xenbits.xensource.com Git - seabios.git/commitdiff
Revert "geometry: Apply LCHS values for boot devices"
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 15 Nov 2019 11:17:50 +0000 (12:17 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 18 Nov 2019 13:58:37 +0000 (14:58 +0100)
This reverts commit 9caa19be0e534c687081fbdfcd301406e728c98c.

src/block.c
src/block.h
src/hw/ahci.c
src/hw/ata.c
src/hw/esp-scsi.c
src/hw/lsi-scsi.c
src/hw/megasas.c
src/hw/mpt-scsi.c
src/hw/pvscsi.c
src/hw/virtio-blk.c
src/hw/virtio-scsi.c

index ca23a83a0764038c24fe3ab39c5c1c22dd7ff96d..f73ec18c8f704f4214602539f563da3a5e8a2422 100644 (file)
@@ -69,17 +69,9 @@ int create_bounce_buf(void)
  * Disk geometry translation
  ****************************************************************/
 
-static int
-overriden_lchs_supplied(struct drive_s *drive)
-{
-    return drive->lchs.cylinder || drive->lchs.head || drive->lchs.sector;
-}
-
 static u8
 get_translation(struct drive_s *drive)
 {
-    if (overriden_lchs_supplied(drive))
-        return TRANSLATION_MACHINE;
     u8 type = drive->type;
     if (CONFIG_QEMU && type == DTYPE_ATA) {
         // Emulators pass in the translation info via nvram.
@@ -167,16 +159,6 @@ setup_translation(struct drive_s *drive)
                 break;
         }
         break;
-    case TRANSLATION_MACHINE:
-        desc = "overriden";
-        cylinders = drive->lchs.cylinder;
-        heads = drive->lchs.head;
-        if (heads > 255)
-            heads = 255;
-        spt = drive->lchs.sector;
-        if (spt > 63)
-            spt = 63;
-        break;
     }
     // clip to 1024 cylinders in lchs
     if (cylinders > 1024)
@@ -441,8 +423,7 @@ fill_ata_edd(struct segoff_s edd, struct drive_s *drive_gf)
     u16 options = 0;
     if (GET_GLOBALFLAT(drive_gf->type) == DTYPE_ATA) {
         u8 translation = GET_GLOBALFLAT(drive_gf->translation);
-        if ((translation != TRANSLATION_NONE) &&
-            (translation != TRANSLATION_MACHINE)) {
+        if (translation != TRANSLATION_NONE) {
             options |= 1<<3; // CHS translation
             if (translation == TRANSLATION_LBA)
                 options |= 1<<9;
index 12f27eee7054b24326bb7aa9b8376a423e49dc82..f64e880777cf967fde86e384a6b4ead6534cea6d 100644 (file)
@@ -90,7 +90,6 @@ struct drive_s {
 #define TRANSLATION_LBA   1
 #define TRANSLATION_LARGE 2
 #define TRANSLATION_RECHS 3
-#define TRANSLATION_MACHINE 4
 
 #define EXTTYPE_FLOPPY 0
 #define EXTTYPE_HD 1
index d45b4307ec687245e3dd02b206516863f63e9398..45dc6613991664ab956fe5aa822b2255e8836d4a 100644 (file)
@@ -594,7 +594,6 @@ static int ahci_port_setup(struct ahci_port_s *port)
                               , ata_extract_version(buffer));
         port->prio = bootprio_find_ata_device(ctrl->pci_tmp, pnr, 0);
     }
-    boot_lchs_find_ata_device(ctrl->pci_tmp, pnr, 0, &(port->drive.lchs));
     return 0;
 }
 
index f788ce718eacdda1a699070d569e4af0851b0fc9..b6e073cf526d48eee249c4e0548a92c25d561efa 100644 (file)
@@ -755,10 +755,6 @@ init_drive_atapi(struct atadrive_s *dummy, u16 *buffer)
         int prio = bootprio_find_ata_device(adrive->chan_gf->pci_tmp,
                                             adrive->chan_gf->chanid,
                                             adrive->slave);
-        boot_lchs_find_ata_device(adrive->chan_gf->pci_tmp,
-                                  adrive->chan_gf->chanid,
-                                  adrive->slave,
-                                  &(adrive->drive.lchs));
         boot_add_cd(&adrive->drive, desc, prio);
     }
 
@@ -809,10 +805,6 @@ init_drive_ata(struct atadrive_s *dummy, u16 *buffer)
     int prio = bootprio_find_ata_device(adrive->chan_gf->pci_tmp,
                                         adrive->chan_gf->chanid,
                                         adrive->slave);
-    boot_lchs_find_ata_device(adrive->chan_gf->pci_tmp,
-                              adrive->chan_gf->chanid,
-                              adrive->slave,
-                              &(adrive->drive.lchs));
     // Register with bcv system.
     boot_add_hd(&adrive->drive, desc, prio);
 
index cc25f227c7f0c5b6a11fb6d08df6e5b58ab968e9..ffd86d0f5d3d30c0e9eb901608925b2e42373036 100644 (file)
@@ -181,8 +181,6 @@ esp_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv)
 
     char *name = znprintf(MAXDESCSIZE, "esp %pP %d:%d",
                           llun->pci, llun->target, llun->lun);
-    boot_lchs_find_scsi_device(llun->pci, llun->target, llun->lun,
-                               &(llun->drive.lchs));
     int prio = bootprio_find_scsi_device(llun->pci, llun->target, llun->lun);
     int ret = scsi_drive_setup(&llun->drive, name, prio);
     free(name);
index cbaa2acd200ea98ad18ee316369bb14b22a5c8a7..d5fc3e456df88859bafe788c03e11eb18a44dfd4 100644 (file)
@@ -158,8 +158,6 @@ lsi_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv)
     lsi_scsi_init_lun(llun, tmpl_llun->pci, tmpl_llun->iobase,
                       tmpl_llun->target, lun);
 
-    boot_lchs_find_scsi_device(llun->pci, llun->target, llun->lun,
-                               &(llun->drive.lchs));
     char *name = znprintf(MAXDESCSIZE, "lsi %pP %d:%d",
                           llun->pci, llun->target, llun->lun);
     int prio = bootprio_find_scsi_device(llun->pci, llun->target, llun->lun);
index 87b8beec67af3bac20ab75f88508b80724d90c17..d2675804930c208d7ce053d0d33a040f7f85b6b2 100644 (file)
@@ -225,7 +225,6 @@ megasas_add_lun(struct pci_device *pci, u32 iobase, u8 target, u8 lun)
         free(mlun);
         return -1;
     }
-    boot_lchs_find_scsi_device(pci, target, lun, &(mlun->drive.lchs));
     name = znprintf(MAXDESCSIZE, "MegaRAID SAS (PCI %pP) LD %d:%d"
                     , pci, target, lun);
     prio = bootprio_find_scsi_device(pci, target, lun);
index 570b21268970f993bac5a0bb6083eea908d65ca3..1faede6aec6f8dede373689430375764726133f4 100644 (file)
@@ -221,8 +221,6 @@ mpt_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv)
     mpt_scsi_init_lun(llun, tmpl_llun->pci, tmpl_llun->iobase,
                       tmpl_llun->target, lun);
 
-    boot_lchs_find_scsi_device(llun->pci, llun->target, llun->lun,
-                               &(llun->drive.lchs));
     char *name = znprintf(MAXDESCSIZE, "mpt %pP %d:%d",
                           llun->pci, llun->target, llun->lun);
     int prio = bootprio_find_scsi_device(llun->pci, llun->target, llun->lun);
index 3e5171adb9ed41a532ad404bbc3c7d5e10d4b2b6..9d7d68d8096404fab1481e8ea14d25c10f57e923 100644 (file)
@@ -273,7 +273,6 @@ pvscsi_add_lun(struct pci_device *pci, void *iobase,
     plun->iobase = iobase;
     plun->ring_dsc = ring_dsc;
 
-    boot_lchs_find_scsi_device(pci, target, lun, &(plun->drive.lchs));
     char *name = znprintf(MAXDESCSIZE, "pvscsi %pP %d:%d", pci, target, lun);
     int prio = bootprio_find_scsi_device(pci, target, lun);
     int ret = scsi_drive_setup(&plun->drive, name, prio);
index 3e615b26aada42b7fb955aa8aafe95b297765c73..88d7e54a2a92d2bbbb4ff1f2916d119963fbb553 100644 (file)
@@ -183,8 +183,6 @@ init_virtio_blk(void *data)
 
     status |= VIRTIO_CONFIG_S_DRIVER_OK;
     vp_set_status(&vdrive->vp, status);
-
-    boot_lchs_find_pci_device(pci, &vdrive->drive.lchs);
     return;
 
 fail:
index e1e2f5d44b27fae635229cdf5dd7d57b6a4101e0..a87cad88e1520ed5f7898f0a66654e48f4b6ead1 100644 (file)
@@ -121,8 +121,6 @@ virtio_scsi_add_lun(u32 lun, struct drive_s *tmpl_drv)
     virtio_scsi_init_lun(vlun, tmpl_vlun->pci, tmpl_vlun->vp, tmpl_vlun->vq,
                          tmpl_vlun->target, lun);
 
-    boot_lchs_find_scsi_device(vlun->pci, vlun->target, vlun->lun,
-                               &(vlun->drive.lchs));
     int prio = bootprio_find_scsi_device(vlun->pci, vlun->target, vlun->lun);
     int ret = scsi_drive_setup(&vlun->drive, "virtio-scsi", prio);
     if (ret)