1/*- 2 * Implementation of SCSI Direct Access Peripheral driver for CAM. 3 * 4 * Copyright (c) 1997 Justin T. Gibbs. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_da.c 225950 2011-10-03 20:32:55Z ken $"); |
31 32#include <sys/param.h> 33 34#ifdef _KERNEL 35#include <sys/systm.h> 36#include <sys/kernel.h> 37#include <sys/bio.h> 38#include <sys/sysctl.h> --- 709 unchanged lines hidden (view full) --- 748 softc->disk->d_devstat); 749 750 if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { 751 if ((ccb->ccb_h.status & CAM_STATUS_MASK) == 752 CAM_SCSI_STATUS_ERROR) { 753 int asc, ascq; 754 int sense_key, error_code; 755 |
756 scsi_extract_sense_len(&ccb->csio.sense_data, 757 ccb->csio.sense_len - ccb->csio.sense_resid, 758 &error_code, &sense_key, &asc, &ascq, 759 /*show_errors*/ 1); |
760 if (sense_key != SSD_KEY_ILLEGAL_REQUEST) 761 scsi_sense_print(&ccb->csio); 762 } else { 763 xpt_print(periph->path, "Synchronize cache " 764 "failed, status == 0x%x, scsi status == " 765 "0x%x\n", ccb->csio.ccb_h.status, 766 ccb->csio.scsi_status); 767 } --- 143 unchanged lines hidden (view full) --- 911 xpt_polled_action((union ccb *)&csio); 912 913 if ((csio.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { 914 if ((csio.ccb_h.status & CAM_STATUS_MASK) == 915 CAM_SCSI_STATUS_ERROR) { 916 int asc, ascq; 917 int sense_key, error_code; 918 |
919 scsi_extract_sense_len(&csio.sense_data, 920 csio.sense_len - csio.sense_resid, 921 &error_code, &sense_key, &asc, &ascq, 922 /*show_errors*/ 1); |
923 if (sense_key != SSD_KEY_ILLEGAL_REQUEST) 924 scsi_sense_print(&csio); 925 } else { 926 xpt_print(periph->path, "Synchronize cache " 927 "failed, status == 0x%x, scsi status == " 928 "0x%x\n", csio.ccb_h.status, 929 csio.scsi_status); 930 } --- 866 unchanged lines hidden (view full) --- 1797 || ((csio->ccb_h.flags & CAM_SENSE_PTR) != 0) 1798 || ((status & CAM_AUTOSNS_VALID) == 0)) 1799 have_sense = FALSE; 1800 else 1801 have_sense = TRUE; 1802 1803 if (have_sense) { 1804 sense = &csio->sense_data; |
1805 scsi_extract_sense_len(sense, 1806 csio->sense_len - csio->sense_resid, 1807 &error_code, &sense_key, &asc, 1808 &ascq, /*show_errors*/ 1); |
1809 } 1810 /* 1811 * Attach to anything that claims to be a 1812 * direct access or optical disk device, 1813 * as long as it doesn't return a "Logical 1814 * unit not supported" (0x25) error. 1815 */ 1816 if ((have_sense) && (asc != 0x25) --- 434 unchanged lines hidden --- |