usb4bsd: Fix some SCSI handling in umass
authorMarkus Pfeiffer <markus.pfeiffer@morphism.de>
Mon, 10 Mar 2014 22:33:13 +0000 (22:33 +0000)
committerMarkus Pfeiffer <markus.pfeiffer@morphism.de>
Mon, 10 Mar 2014 22:34:14 +0000 (22:34 +0000)
Set the sense data on probe.

sys/bus/u4b/storage/umass.c

index 2b3ee34..1b0293c 100644 (file)
@@ -2316,16 +2316,15 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb)
                                         */
                                        if ((sc->sc_quirks & (NO_INQUIRY_EVPD | NO_INQUIRY)) &&
                                            (sc->sc_transfer.cmd_data[1] & SI_EVPD)) {
-
-#if 0 /* XXXDF */
-                                               scsi_set_sense_data(&ccb->csio.sense_data,
-                                                       /*sense_format*/ SSD_TYPE_NONE,
-                                                       /*current_error*/ 1,
-                                                       /*sense_key*/ SSD_KEY_ILLEGAL_REQUEST,
-                                                       /*asc*/ 0x24,
-                                                       /*ascq*/ 0x00,
-                                                       /*extra args*/ SSD_ELEM_NONE);
-#endif
+                                               struct scsi_sense_data *sense;
+
+                                               sense = &ccb->csio.sense_data;
+                                               bzero(sense, sizeof(*sense));
+                                               sense->error_code = SSD_CURRENT_ERROR;
+                                               sense->flags = SSD_KEY_ILLEGAL_REQUEST;
+                                               sense->add_sense_code = 0x24;
+                                               sense->extra_len = 10;
+       
                                                ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND;
                                                ccb->ccb_h.status =
                                                    CAM_SCSI_STATUS_ERROR |