atapicam-dma-workaround.patch
| b/sys/dev/disk/nata/atapi-cam.c | ||
|---|---|---|
| 504 | 504 | |
| 505 | 505 |
switch (ccb_h->flags & CAM_DIR_MASK) {
|
| 506 | 506 |
case CAM_DIR_IN: |
| 507 |
request_flags |= ATA_R_READ|ATA_R_DMA;
|
|
| 507 |
request_flags |= ATA_R_READ; |
|
| 508 | 508 |
break; |
| 509 | 509 |
case CAM_DIR_OUT: |
| 510 |
request_flags |= ATA_R_WRITE|ATA_R_DMA;
|
|
| 510 |
request_flags |= ATA_R_WRITE; |
|
| 511 | 511 |
break; |
| 512 | 512 |
case CAM_DIR_NONE: |
| 513 | 513 |
/* No flags need to be set */ |
| ... | ... | |
| 516 | 516 |
device_printf(softc->dev, "unknown IO operation\n"); |
| 517 | 517 |
goto action_invalid; |
| 518 | 518 |
} |
| 519 |
if (softc->atadev[tid]->mode < ATA_DMA) |
|
| 520 |
request_flags &= ~ATA_R_DMA; |
|
| 521 | 519 | |
| 522 | 520 |
if ((hcb = allocate_hcb(softc, unit, bus, ccb)) == NULL) {
|
| 523 | 521 |
kprintf("cannot allocate ATAPI/CAM hcb\n");
|
| ... | ... | |
| 579 | 577 |
request->u.atapi.ccb[3] = request->u.atapi.ccb[1] & 0x1f; |
| 580 | 578 |
request->u.atapi.ccb[2] = 0; |
| 581 | 579 |
request->u.atapi.ccb[1] = 0; |
| 580 |
/* FALLTHROUGH */ |
|
| 581 | ||
| 582 |
case READ_10: |
|
| 583 |
case WRITE_10: |
|
| 584 |
case READ_12: |
|
| 585 |
case WRITE_12: |
|
| 586 |
if (softc->atadev[tid]->mode >= ATA_DMA) |
|
| 587 |
request_flags |= ATA_R_DMA; |
|
| 582 | 588 |
break; |
| 583 | 589 |
} |
| 584 | 590 | |