Author: mav
Date: Tue Jun 25 07:17:10 2013
New Revision: 252199
URL: http://svnweb.freebsd.org/changeset/base/252199

Log:
  MFC r251743:
  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:
  stable/9/sbin/camcontrol/fwdownload.c
Directory Properties:
  stable/9/sbin/camcontrol/   (props changed)

Modified: stable/9/sbin/camcontrol/fwdownload.c
==============================================================================
--- stable/9/sbin/camcontrol/fwdownload.c       Tue Jun 25 07:11:07 2013        
(r252198)
+++ stable/9/sbin/camcontrol/fwdownload.c       Tue Jun 25 07:17:10 2013        
(r252199)
@@ -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++;
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to