Ticket #245: ata.patch
File ata.patch, 3.7 KB (added by , 12 years ago) |
---|
-
sys/dev/ata/chipsets/ata-ahci.c
555 555 if (request->status & ATA_S_ERROR) 556 556 request->error = tf_data >> 8; 557 557 558 /* on control commands read back registers to the request struct */ 559 if (request->flags & ATA_R_CONTROL) { 558 /* Read back registers to the request struct. */ 559 if ((request->flags & ATA_R_ATAPI) == 0 && 560 ((request->status & ATA_S_ERROR) || 561 (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT)))) { 560 562 u_int8_t *fis = ch->dma.work + ATA_AHCI_FB_OFFSET + 0x40; 561 563 562 564 request->u.ata.count = fis[12] | ((u_int16_t)fis[13] << 8); -
sys/dev/ata/chipsets/ata-siliconimage.c
658 658 } 659 659 } 660 660 661 /* on control commands read back registers to the request struct */ 662 if (request->flags & ATA_R_CONTROL) { 661 /* Read back registers to the request struct. */ 662 if ((request->flags & ATA_R_ATAPI) == 0 && 663 ((request->status & ATA_S_ERROR) || 664 (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT)))) { 663 665 request->u.ata.count = prb->fis[12] | ((u_int16_t)prb->fis[13] << 8); 664 666 request->u.ata.lba = prb->fis[4] | ((u_int64_t)prb->fis[5] << 8) | 665 667 ((u_int64_t)prb->fis[6] << 16); -
sys/dev/ata/ata-all.c
1483 1483 request->u.ata.lba |= ((uint64_t)ccb->ataio.cmd.lba_high << 16) | 1484 1484 ((uint64_t)ccb->ataio.cmd.lba_mid << 8) | 1485 1485 (uint64_t)ccb->ataio.cmd.lba_low; 1486 if (ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT) 1487 request->flags |= ATA_R_NEEDRESULT; 1486 1488 if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && 1487 1489 ccb->ataio.cmd.flags & CAM_ATAIO_DMA) 1488 1490 request->flags |= ATA_R_DMA; -
sys/dev/ata/ata-all.h
396 396 #define ATA_R_REQUEUE 0x00000400 397 397 #define ATA_R_THREAD 0x00000800 398 398 #define ATA_R_DIRECT 0x00001000 399 #define ATA_R_NEEDRESULT 0x00002000 399 400 400 401 #define ATA_R_ATAPI16 0x00010000 401 402 #define ATA_R_ATAPI_INTR 0x00020000 -
sys/dev/ata/ata-lowlevel.c
116 116 } while (request->status & ATA_S_BUSY && timeout--); 117 117 if (request->status & ATA_S_ERROR) 118 118 request->error = ATA_IDX_INB(ch, ATA_ERROR); 119 ch->hw.tf_read(request); 119 120 goto begin_finished; 120 121 } 121 122 … … 253 254 if (request->flags & ATA_R_TIMEOUT) 254 255 goto end_finished; 255 256 256 /* on control commands read back registers to the request struct */ 257 if (request->flags & ATA_R_CONTROL) { 257 /* Read back registers to the request struct. */ 258 if ((request->status & ATA_S_ERROR) || 259 (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT))) { 258 260 ch->hw.tf_read(request); 259 261 } 260 262 … … 332 334 else if (!(request->flags & ATA_R_TIMEOUT)) 333 335 request->donecount = request->bytecount; 334 336 337 /* Read back registers to the request struct. */ 338 if ((request->status & ATA_S_ERROR) || 339 (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT))) { 340 ch->hw.tf_read(request); 341 } 342 335 343 /* release SG list etc */ 336 344 ch->dma.unload(request); 337 345