Date: Sat, 22 Aug 2009 18:29:31 GMT From: Alexander Motin <mav@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 167622 for review Message-ID: <200908221829.n7MITVio020965@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=167622 Change 167622 by mav@mav_mavbook on 2009/08/22 18:29:14 Improve error reporting in ATA_CAM wrapper. Affected files ... .. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-all.c#24 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/dev/ata/ata-all.c#24 (text+ko) ==== @@ -1246,13 +1246,35 @@ //device_printf(dev, "%s\n", __func__); ccb->ccb_h.status &= ~CAM_STATUS_MASK; - if (request->result == 0) + if (request->flags & ATA_R_TIMEOUT) + ccb->ccb_h.status |= CAM_CMD_TIMEOUT; + else if (request->status & ATA_S_ERROR) { + if (ccb->ccb_h.func_code == XPT_ATA_IO) { + ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; + } else { + ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; + ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; + } + } else if (request->result != 0) + ccb->ccb_h.status |= CAM_REQ_CMP_ERR; + else ccb->ccb_h.status |= CAM_REQ_CMP; - else if (ccb->ccb_h.func_code == XPT_SCSI_IO) { - ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; - ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; - } else - ccb->ccb_h.status |= CAM_REQ_CMP_ERR; + if (ccb->ccb_h.func_code == XPT_ATA_IO && + ((request->status & ATA_S_ERROR) || + (ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT))) { + struct ata_res *res = &ccb->ataio.res; + res->status = request->status; + res->error = request->error; + res->lba_low = request->u.ata.lba; + res->lba_mid = request->u.ata.lba >> 8; + res->lba_high = request->u.ata.lba >> 16; + res->device = request->u.ata.lba >> 24; + res->lba_low_exp = request->u.ata.lba >> 24; + res->lba_mid_exp = request->u.ata.lba >> 32; + res->lba_high_exp = request->u.ata.lba >> 40; + res->sector_count = request->u.ata.count; + res->sector_count_exp = request->u.ata.count >> 8; + } ata_free_request(request); xpt_done(ccb); }help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908221829.n7MITVio020965>
