Use the saved params for LBA-CHS conversion. Fixes PC98 bug.

This commit is contained in:
Søren Schmidt 2004-01-08 19:17:16 +00:00
parent ec6a729924
commit 986a964900
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124260

View File

@ -250,11 +250,10 @@ ad_start(struct ata_device *atadev)
/* convert LBA contents if this is an old non-LBA device */
if (atadev->flags & ATA_D_USE_CHS) {
struct ata_params *param = atadev->param;
int sector = (bp->bio_pblkno % param->sectors) + 1;
int cylinder = bp->bio_pblkno / (param->sectors * param->heads);
int sector = (bp->bio_pblkno % adp->sectors) + 1;
int cylinder = bp->bio_pblkno / (adp->sectors * adp->heads);
int head = (bp->bio_pblkno %
(param->sectors * param->heads)) / param->sectors;
(adp->sectors * adp->heads)) / adp->sectors;
request->u.ata.lba =
(sector & 0xff) | (cylinder & 0xffff) << 8 | (head & 0xf) << 24;