diff options
author | mav <mav@FreeBSD.org> | 2009-10-31 13:24:14 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2009-10-31 13:24:14 +0000 |
commit | 0bf5f10c46aea8f2fe18b9a91167a9aefc33bc31 (patch) | |
tree | 92fd162ac0493f8aac178ae1620be42aeb377f24 /sys/dev/ata/ata-queue.c | |
parent | 789d8ecfb76d1350ba654a835108b98bc15c8c98 (diff) | |
download | FreeBSD-src-0bf5f10c46aea8f2fe18b9a91167a9aefc33bc31.zip FreeBSD-src-0bf5f10c46aea8f2fe18b9a91167a9aefc33bc31.tar.gz |
MFp4:
- Remove most of direct relations between ATA(4) peripherial and controller
levels. It makes logic more transparent and is a mandatory step to wrap
ATA(4) controller level into ATA-native CAM SIM.
- Tune AHCI and SATA2 SiI drivers memory allocation a bit to allow bigger
I/O transaction sizes without additional cost.
Diffstat (limited to 'sys/dev/ata/ata-queue.c')
-rw-r--r-- | sys/dev/ata/ata-queue.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/ata/ata-queue.c b/sys/dev/ata/ata-queue.c index c0eb558..eeb7a1a 100644 --- a/sys/dev/ata/ata-queue.c +++ b/sys/dev/ata/ata-queue.c @@ -52,17 +52,25 @@ void ata_queue_request(struct ata_request *request) { struct ata_channel *ch; + struct ata_device *atadev = device_get_softc(request->dev); /* treat request as virgin (this might be an ATA_R_REQUEUE) */ request->result = request->status = request->error = 0; - /* check that the device is still valid */ + /* Prepare paramers required by low-level code. */ + request->unit = atadev->unit; if (!(request->parent = device_get_parent(request->dev))) { request->result = ENXIO; if (request->callback) (request->callback)(request); return; } + if ((atadev->param.config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16) + request->flags |= ATA_R_ATAPI16; + if ((atadev->param.config & ATA_DRQ_MASK) == ATA_DRQ_INTR) + request->flags |= ATA_R_ATAPI_INTR; + if ((request->flags & ATA_R_ATAPI) == 0) + ata_modify_if_48bit(request); ch = device_get_softc(request->parent); callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); if (!request->callback && !(request->flags & ATA_R_REQUEUE)) |