X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fide%2Fide-timing.h;h=2e91c5870b4c8afe240b0a2ec826e57c554aef16;hb=7e2225d860772aaa07e1cebca6a5aa6f93f9aa91;hp=e6cb8593b5ba8382ce4e481e524bdcf6b1de3ca7;hpb=71780f59e127bb281a9302d430495ca9586c14e7;p=linux-2.6 diff --git a/drivers/ide/ide-timing.h b/drivers/ide/ide-timing.h index e6cb8593b5..2e91c5870b 100644 --- a/drivers/ide/ide-timing.h +++ b/drivers/ide/ide-timing.h @@ -2,8 +2,6 @@ #define _IDE_TIMING_H /* - * $Id: ide-timing.h,v 1.6 2001/12/23 22:47:56 vojtech Exp $ - * * Copyright (c) 1999-2001 Vojtech Pavlik */ @@ -97,7 +95,6 @@ static struct ide_timing ide_timing[] = { #define IDE_TIMING_UDMA 0x80 #define IDE_TIMING_ALL 0xff -#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin) #define ENOUGH(v,unit) (((v)-1)/(unit)+1) #define EZ(v,unit) ((v)?ENOUGH(v,unit):0) @@ -106,23 +103,6 @@ static struct ide_timing ide_timing[] = { #define XFER_EPIO 0x01 #define XFER_PIO 0x00 -static short ide_find_best_pio_mode(ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - short best = 0; - - if (id->field_valid & 2) { /* EIDE PIO modes */ - - if ((best = (drive->id->eide_pio_modes & 4) ? XFER_PIO_5 : - (drive->id->eide_pio_modes & 2) ? XFER_PIO_4 : - (drive->id->eide_pio_modes & 1) ? XFER_PIO_3 : 0)) return best; - } - - return (drive->id->tPIO == 2) ? XFER_PIO_2 : - (drive->id->tPIO == 1) ? XFER_PIO_1 : - (drive->id->tPIO == 0) ? XFER_PIO_0 : XFER_PIO_SLOW; -} - static void ide_timing_quantize(struct ide_timing *t, struct ide_timing *q, int T, int UT) { q->setup = EZ(t->setup * 1000, T); @@ -212,12 +192,13 @@ static int ide_timing_compute(ide_drive_t *drive, short speed, struct ide_timing */ if ((speed & XFER_MODE) != XFER_PIO) { - ide_timing_compute(drive, ide_find_best_pio_mode(drive), &p, T, UT); + u8 pio = ide_get_best_pio_mode(drive, 255, 5); + ide_timing_compute(drive, XFER_PIO_0 + pio, &p, T, UT); ide_timing_merge(&p, t, t, IDE_TIMING_ALL); } /* - * Lenghten active & recovery time so that cycle time is correct. + * Lengthen active & recovery time so that cycle time is correct. */ if (t->act8b + t->rec8b < t->cyc8b) {