Date: Fri, 14 Jun 2013 08:26:58 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251743 - head/sbin/camcontrol Message-ID: <201306140826.r5E8Qwdu032938@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Jun 14 08:26:58 2013 New Revision: 251743 URL: http://svnweb.freebsd.org/changeset/base/251743 Log: 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. Modified: head/sbin/camcontrol/fwdownload.c Modified: head/sbin/camcontrol/fwdownload.c ============================================================================== --- head/sbin/camcontrol/fwdownload.c Fri Jun 14 08:18:17 2013 (r251742) +++ head/sbin/camcontrol/fwdownload.c Fri Jun 14 08:26:58 2013 (r251743) @@ -370,17 +370,15 @@ fw_download_img(struct cam_device *cam_d } 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++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306140826.r5E8Qwdu032938>