1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Update the PIO mode gathering code.

Reported by: bde
This commit is contained in:
Søren Schmidt 2003-09-08 08:30:43 +00:00
parent 04a398293c
commit 9855ae3844
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=119877
2 changed files with 12 additions and 10 deletions

View File

@ -832,14 +832,18 @@ ata_pmode(struct ata_params *ap)
if (ap->apiomodes & 0x01)
return ATA_PIO3;
}
if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 2)
return ATA_PIO2;
if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 1)
return ATA_PIO1;
if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0)
return ATA_PIO0;
if (ap->capabilities1 & ATA_SUPPORT_DMA)
if (ap->mwdmamodes & 0x04)
return ATA_PIO4;
if (ap->mwdmamodes & 0x02)
return ATA_PIO3;
if (ap->mwdmamodes & 0x01)
return ATA_PIO2;
if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x200)
return ATA_PIO2;
if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x100)
return ATA_PIO1;
if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x000)
return ATA_PIO0;
return ATA_PIO0;
}
@ -852,8 +856,6 @@ ata_wmode(struct ata_params *ap)
return ATA_WDMA1;
if (ap->mwdmamodes & 0x01)
return ATA_WDMA0;
if (ap->capabilities1 & ATA_SUPPORT_DMA)
return ATA_WDMA2;
return -1;
}

View File

@ -72,7 +72,7 @@ struct ata_params {
/*050*/ u_int16_t capabilities2;
/*051*/ u_int16_t retired_piomode; /* PIO modes 0-2 */
#define ATA_RETIRED_PIO_MASK 0x0003
#define ATA_RETIRED_PIO_MASK 0x0300
/*052*/ u_int16_t retired_dmamode; /* DMA modes */
#define ATA_RETIRED_DMA_MASK 0x0003