diff options
author | mav <mav@FreeBSD.org> | 2013-06-14 08:26:58 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2013-06-14 08:26:58 +0000 |
commit | 5abd78284cc4ac0a203a37fcbdacb389c96dc55e (patch) | |
tree | 465d8a294f5de5b2e1808e8cb20afd141293577f /sbin/camcontrol | |
parent | ca3bfcb001b460d9cdb101d7f4aee15a9a533028 (diff) | |
download | FreeBSD-src-5abd78284cc4ac0a203a37fcbdacb389c96dc55e.zip FreeBSD-src-5abd78284cc4ac0a203a37fcbdacb389c96dc55e.tar.gz |
Improve firmware download status check. Previous check was insufficient for
ATA since it ignored transport errors like command timeouts, while for SCSI
it was just wrong.
Diffstat (limited to 'sbin/camcontrol')
-rw-r--r-- | sbin/camcontrol/fwdownload.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sbin/camcontrol/fwdownload.c b/sbin/camcontrol/fwdownload.c index daa1520..2fa9ba4 100644 --- a/sbin/camcontrol/fwdownload.c +++ b/sbin/camcontrol/fwdownload.c @@ -370,17 +370,15 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, } if (!sim_mode) { /* Execute the command. */ - if (cam_send_ccb(cam_dev, ccb) < 0) { + if (cam_send_ccb(cam_dev, ccb) < 0 || + (ccb->ccb_h.status & CAM_STATUS_MASK) != + CAM_REQ_CMP) { warnx("Error writing image to device"); if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); goto bailout; } - if (ccb->ataio.res.status != 0 /*&& !last_pkt*/) { - cam_error_print(cam_dev, ccb, CAM_ESF_ALL, - CAM_EPF_ALL, stderr); - } } /* Prepare next round. */ pkt_count++; |