diff options
author | sos <sos@FreeBSD.org> | 2006-06-19 11:47:57 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2006-06-19 11:47:57 +0000 |
commit | b24bbb5c56fbe33183b32a10701302ad941e47a1 (patch) | |
tree | 59f4900634381df538e6e4b27404c48111946017 /sys/dev/ata | |
parent | 0e1f961d757efa1f5ef241a65db1311e73b8a868 (diff) | |
download | FreeBSD-src-b24bbb5c56fbe33183b32a10701302ad941e47a1.zip FreeBSD-src-b24bbb5c56fbe33183b32a10701302ad941e47a1.tar.gz |
Fix type casts so that we get at the right response queue.
Submitted by: glebius+ru
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/ata-chipset.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index aed0720..1b24f40 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -2303,9 +2303,12 @@ ata_marvell_allocate(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - bus_addr_t wordp = ch->dma->work_bus; + bus_addr_t work = ch->dma->work_bus; int i; + /* clear work area */ + bzero(ch->dma->work, 1024+256); + /* set legacy ATA resources */ for (i = ATA_DATA; i <= ATA_COMMAND; i++) { ch->r_io[i].res = ctlr->r_res1; @@ -2353,23 +2356,23 @@ ata_marvell_allocate(device_t dev) ATA_OUTL(ctlr->r_res1, 0x02000 + ATA_MV_EDMA_BASE(ch), (1<<11) | (1<<13)); /* request queue base high */ - ATA_OUTL(ctlr->r_res1, 0x02010 + ATA_MV_EDMA_BASE(ch), (wordp >> 16) >> 16); + ATA_OUTL(ctlr->r_res1, 0x02010 + ATA_MV_EDMA_BASE(ch), (work >> 16) >> 16); /* request queue in ptr */ - ATA_OUTL(ctlr->r_res1, 0x02014 + ATA_MV_EDMA_BASE(ch), wordp & 0xffffffff); + ATA_OUTL(ctlr->r_res1, 0x02014 + ATA_MV_EDMA_BASE(ch), work & 0xffffffff); /* request queue out ptr */ ATA_OUTL(ctlr->r_res1, 0x02018 + ATA_MV_EDMA_BASE(ch), 0x0); /* response queue base high */ - wordp += 1024; - ATA_OUTL(ctlr->r_res1, 0x0201c + ATA_MV_EDMA_BASE(ch), (wordp >> 16) >> 16); + work += 1024; + ATA_OUTL(ctlr->r_res1, 0x0201c + ATA_MV_EDMA_BASE(ch), (work >> 16) >> 16); /* response queue in ptr */ ATA_OUTL(ctlr->r_res1, 0x02020 + ATA_MV_EDMA_BASE(ch), 0x0); /* response queue out ptr */ - ATA_OUTL(ctlr->r_res1, 0x02024 + ATA_MV_EDMA_BASE(ch), wordp & 0xffffffff); + ATA_OUTL(ctlr->r_res1, 0x02024 + ATA_MV_EDMA_BASE(ch), work & 0xffffffff); /* clear SATA error register */ ATA_IDX_OUTL(ch, ATA_SERROR, ATA_IDX_INL(ch, ATA_SERROR)); @@ -2559,7 +2562,7 @@ ata_marvell_end_transaction(struct ata_request *request) rsp_out &= 0xffffff00; rsp_out += (slot << 3); response = (struct ata_marvell_response *) - (int8_t *)(ch->dma->work) + 1024 + (slot << 3); + (ch->dma->work + 1024 + (slot << 3)); /* record status for this request */ request->status = response->dev_status; |