Project

General

Profile

Bug #1158 ยป atapicam-dma-workaround.patch

hasso, 11/16/2008 05:37 PM

View differences:

sys/dev/disk/nata/atapi-cam.c
switch (ccb_h->flags & CAM_DIR_MASK) {
case CAM_DIR_IN:
request_flags |= ATA_R_READ|ATA_R_DMA;
request_flags |= ATA_R_READ;
break;
case CAM_DIR_OUT:
request_flags |= ATA_R_WRITE|ATA_R_DMA;
request_flags |= ATA_R_WRITE;
break;
case CAM_DIR_NONE:
/* No flags need to be set */
......
device_printf(softc->dev, "unknown IO operation\n");
goto action_invalid;
}
if (softc->atadev[tid]->mode < ATA_DMA)
request_flags &= ~ATA_R_DMA;
if ((hcb = allocate_hcb(softc, unit, bus, ccb)) == NULL) {
kprintf("cannot allocate ATAPI/CAM hcb\n");
......
request->u.atapi.ccb[3] = request->u.atapi.ccb[1] & 0x1f;
request->u.atapi.ccb[2] = 0;
request->u.atapi.ccb[1] = 0;
/* FALLTHROUGH */
case READ_10:
case WRITE_10:
case READ_12:
case WRITE_12:
if (softc->atadev[tid]->mode >= ATA_DMA)
request_flags |= ATA_R_DMA;
break;
}
    (1-1/1)