Add option ATA_ENABLE_WC for enabling write caching (now off by default).

This commit is contained in:
Søren Schmidt 2001-01-29 18:00:35 +00:00
parent bb0030a4f8
commit 6fe4e0a915
2 changed files with 8 additions and 2 deletions

View File

@ -215,7 +215,8 @@ ATAPI_DEBUG opt_ata.h
ATA_DEBUG opt_ata.h
ATA_STATIC_ID opt_ata.h
ATA_ENABLE_ATAPI_DMA opt_ata.h
ATA_ENABLE_TAGS opt_ata.h
ATA_ENABLE_WC opt_ata.h
ATA_ENABLE_TAGS opt_ata.h # also sets ATA_ENABLE_WC
DEV_ATADISK opt_ata.h
DEV_ATAPICD opt_ata.h
DEV_ATAPIST opt_ata.h

View File

@ -133,10 +133,15 @@ ad_attach(struct ata_softc *scp, int device)
0, 0, 0, 0, ATA_C_F_ENAB_RCACHE, ATA_WAIT_INTR))
printf("ad%d: enabling readahead cache failed\n", adp->lun);
#if defined(ATA_ENABLE_WC) || defined(ATA_ENABLE_TAGS)
if (ata_command(adp->controller, adp->unit, ATA_C_SETFEATURES,
0, 0, 0, 0, ATA_C_F_ENAB_WCACHE, ATA_WAIT_INTR))
printf("ad%d: enabling write cache failed\n", adp->lun);
#else
if (ata_command(adp->controller, adp->unit, ATA_C_SETFEATURES,
0, 0, 0, 0, ATA_C_F_DIS_WCACHE, ATA_WAIT_INTR))
printf("ad%d: disabling write cache failed\n", adp->lun);
#endif
/* use DMA if drive & controller supports it */
ata_dmainit(adp->controller, adp->unit,
ata_pmode(AD_PARAM), ata_wmode(AD_PARAM), ata_umode(AD_PARAM));