diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2015-07-14 15:12:25 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2015-07-14 15:12:25 -0400 |
commit | 6a668b35e1691de8ebccf9c8b627c58f333cea7a (patch) | |
tree | 5e318628a48ca00ee8fc52d31e43db4e25bb54ba /src/block.c | |
parent | f318c0797bcea7f5b91853365a0bc65529570963 (diff) | |
download | seabios-6a668b35e1691de8ebccf9c8b627c58f333cea7a.tar.gz |
ata: Make sure "chanid" is relative to PCI device for bootorder file
When specifying drives in the bootorder file, the "drive@x" parameter
should be relative to the given PCI device and not relative to the
total number of ATA controllers in the machine. This patch separates
the tracking of "chanid" (channel number relative to a given PCI
devices) from the "ataid" (channel number relative to the total number
of ATA channels).
Reported-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/block.c')
-rw-r--r-- | src/block.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/block.c b/src/block.c index 5e086632..a1054ac3 100644 --- a/src/block.c +++ b/src/block.c @@ -74,10 +74,8 @@ get_translation(struct drive_s *drive) u8 type = drive->type; if (CONFIG_QEMU && type == DTYPE_ATA) { // Emulators pass in the translation info via nvram. - u8 ataid = drive->cntl_id; - u8 channel = ataid / 2; - u8 translation = rtc_read(CMOS_BIOS_DISKTRANSFLAG + channel/2); - translation >>= 2 * (ataid % 4); + u8 translation = rtc_read(CMOS_BIOS_DISKTRANSFLAG + drive->cntl_id/4); + translation >>= 2 * (drive->cntl_id % 4); translation &= 0x03; return translation; } |