diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2011-08-04 19:36:29 +0200 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2011-08-06 13:57:53 -0400 |
commit | 263ea2f20507d7d30f6bfd80a8dc6fa16976d784 (patch) | |
tree | dc969d35834168a4c83b66c20559d3892c11fdfc | |
parent | 9713f2418f99f003876419f8c656fa9725d912c1 (diff) | |
download | seabios-263ea2f20507d7d30f6bfd80a8dc6fa16976d784.zip seabios-263ea2f20507d7d30f6bfd80a8dc6fa16976d784.tar.gz seabios-263ea2f20507d7d30f6bfd80a8dc6fa16976d784.tar.bz2 |
ahci: ignore atapi devices which are not cdroms
Also simplify the code a bit further down the road
as we know iscd must be true ;)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | src/ahci.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -547,19 +547,20 @@ static int ahci_port_init(struct ahci_port_s *port) port->drive.blksize = CDROM_SECTOR_SIZE; port->drive.sectors = (u64)-1; u8 iscd = ((buffer[0] >> 8) & 0x1f) == 0x05; + if (!iscd) { + dprintf(1, "AHCI/%d: atapi device is'nt a cdrom\n", port->pnr); + return -1; + } char *desc = znprintf(MAXDESCSIZE - , "DVD/CD [AHCI/%d: %s ATAPI-%d %s]" + , "DVD/CD [AHCI/%d: %s ATAPI-%d DVD/CD]" , port->pnr , ata_extract_model(model, MAXMODEL, buffer) - , ata_extract_version(buffer) - , (iscd ? "DVD/CD" : "Device")); + , ata_extract_version(buffer)); dprintf(1, "%s\n", desc); // fill cdidmap - if (iscd) { - int prio = bootprio_find_ata_device(ctrl->pci_tmp, pnr, 0); - boot_add_cd(&port->drive, desc, prio); - } + int prio = bootprio_find_ata_device(ctrl->pci_tmp, pnr, 0); + boot_add_cd(&port->drive, desc, prio); } return 0; } |