diff options
author | sos <sos@FreeBSD.org> | 1999-12-18 20:06:30 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 1999-12-18 20:06:30 +0000 |
commit | b9dd0b7b175998d0086c15ddfe97ea484b17ef3a (patch) | |
tree | 259de71c47ca05f65474ff4f9e9f51f8be1195e5 /sys | |
parent | 794cbab436ec2bf5ae9de4cfcff455af91096c3f (diff) | |
download | FreeBSD-src-b9dd0b7b175998d0086c15ddfe97ea484b17ef3a.zip FreeBSD-src-b9dd0b7b175998d0086c15ddfe97ea484b17ef3a.tar.gz |
Relax the requirements for doing WDMA2, this should enable DMA
on non ATA[234] compliant disks.
Move all PCI dependent stuff under #ifdef NPCI > 0
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ata/ata-all.c | 48 | ||||
-rw-r--r-- | sys/dev/ata/ata-disk.c | 5 | ||||
-rw-r--r-- | sys/dev/ata/atapi-all.c | 1 |
3 files changed, 27 insertions, 27 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 6f850bb..10c1c73 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -404,6 +404,30 @@ ata_pciattach(device_t dev) return 0; } +int32_t +ata_find_dev(device_t dev, int32_t type) +{ + device_t *children, child; + int nchildren, i; + + if (device_get_children(device_get_parent(dev), &children, &nchildren)) + return 0; + + for (i = 0; i < nchildren; i++) { + child = children[i]; + + /* check that it's on the same silicon and the device we want */ + if (pci_get_slot(dev) == pci_get_slot(child) && + pci_get_vendor(child) == (type & 0xffff) && + pci_get_device(child) == ((type & 0xffff0000)>>16)) { + free(children, M_TEMP); + return 1; + } + } + free(children, M_TEMP); + return 0; +} + static device_method_t ata_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ata_pciprobe), @@ -945,27 +969,3 @@ bpack(int8_t *src, int8_t *dst, int32_t len) } dst[j] = 0x00; } - -int32_t -ata_find_dev(device_t dev, int32_t type) -{ - device_t *children, child; - int nchildren, i; - - if (device_get_children(device_get_parent(dev), &children, &nchildren)) - return 0; - - for (i = 0; i < nchildren; i++) { - child = children[i]; - - /* check that it's on the same silicon and the device we want */ - if (pci_get_slot(dev) == pci_get_slot(child) && - pci_get_vendor(child) == (type & 0xffff) && - pci_get_device(child) == ((type & 0xffff0000)>>16)) { - free(children, M_TEMP); - return 1; - } - } - free(children, M_TEMP); - return 0; -} diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 11ddf4f..ec25bf3 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -106,7 +106,7 @@ apiomode(struct ata_params *ap) static __inline int wdmamode(struct ata_params *ap) { - if ((ap->atavalid & 2) && ad_version(ap->versmajor) >= 2) { + if (ap->atavalid & 2) { if (ap->wdmamodes & 4) return 2; if (ap->wdmamodes & 2) return 1; if (ap->wdmamodes & 1) return 0; @@ -435,7 +435,7 @@ ad_transfer(struct ad_request *request) request->timeout_handle.callout = NULL; else request->timeout_handle = - timeout((timeout_t*)ad_timeout, request, 5*hz); + timeout((timeout_t*)ad_timeout, request, 10 * hz); /* setup transfer parameters */ count = howmany(request->bytecount, DEV_BSIZE); @@ -464,7 +464,6 @@ ad_transfer(struct ad_request *request) /* does this drive & transfer work with DMA ? */ request->flags &= ~AR_F_DMA_USED; if ((adp->flags & AD_F_DMA_ENABLED) && - !(request->flags & AR_F_FORCE_PIO) && !ata_dmasetup(adp->controller, adp->unit, (void *)request->data, request->bytecount, (request->flags & AR_F_READ))) { diff --git a/sys/dev/ata/atapi-all.c b/sys/dev/ata/atapi-all.c index 2d92455..0014b99 100644 --- a/sys/dev/ata/atapi-all.c +++ b/sys/dev/ata/atapi-all.c @@ -747,6 +747,7 @@ atapi_wait(struct atapi_softc *atp, u_int8_t mask) { u_int32_t timeout = 0; + DELAY(1); while (timeout++ <= 500000) { /* timeout 5 secs */ atp->controller->status = inb(atp->controller->ioaddr + ATA_STATUS); |