diff options
author | sos <sos@FreeBSD.org> | 2006-01-18 09:14:55 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2006-01-18 09:14:55 +0000 |
commit | d58866740c089e3724a5a9049ac3b78608114eec (patch) | |
tree | da2305be8bfa03a7f41aee0ff0229d27a19c4159 /sys/dev/ata/ata-lowlevel.c | |
parent | 2fcf51df2979107d234e91c3c571b83868ec5625 (diff) | |
download | FreeBSD-src-d58866740c089e3724a5a9049ac3b78608114eec.zip FreeBSD-src-d58866740c089e3724a5a9049ac3b78608114eec.tar.gz |
Add support for using DMA on dump, greatly speeds up the dump process.
Add dump support in ataraid.
Diffstat (limited to 'sys/dev/ata/ata-lowlevel.c')
-rw-r--r-- | sys/dev/ata/ata-lowlevel.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c index cca8cc8..0d50ccf 100644 --- a/sys/dev/ata/ata-lowlevel.c +++ b/sys/dev/ata/ata-lowlevel.c @@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$"); #include <ata_if.h> /* prototypes */ -static int ata_begin_transaction(struct ata_request *); -static int ata_end_transaction(struct ata_request *); +static int ata_generic_status(device_t dev); static int ata_wait(struct ata_channel *ch, struct ata_device *, u_int8_t); static void ata_pio_read(struct ata_request *, int); static void ata_pio_write(struct ata_request *, int); @@ -62,11 +61,12 @@ ata_generic_hw(device_t dev) ch->hw.begin_transaction = ata_begin_transaction; ch->hw.end_transaction = ata_end_transaction; + ch->hw.status = ata_generic_status; ch->hw.command = ata_generic_command; } /* must be called with ATA channel locked and state_mtx held */ -static int +int ata_begin_transaction(struct ata_request *request) { struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); @@ -220,7 +220,7 @@ begin_continue: } /* must be called with ATA channel locked and state_mtx held */ -static int +int ata_end_transaction(struct ata_request *request) { struct ata_channel *ch = device_get_softc(device_get_parent(request->dev)); @@ -470,7 +470,7 @@ end_continue: return ATA_OP_CONTINUES; } -/* must be called with ATA channel locked */ +/* must be called with ATA channel locked and state_mtx held */ void ata_generic_reset(device_t dev) { @@ -605,6 +605,20 @@ ata_generic_reset(device_t dev) "\20\4ATAPI_SLAVE\3ATAPI_MASTER\2ATA_SLAVE\1ATA_MASTER"); } +/* must be called with ATA channel locked and state_mtx held */ +int +ata_generic_status(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + + if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) { + DELAY(100); + if (ATA_IDX_INB(ch, ATA_ALTSTAT) & ATA_S_BUSY) + return 0; + } + return 1; +} + static int ata_wait(struct ata_channel *ch, struct ata_device *atadev, u_int8_t mask) { |