scsi_sg.c (187247) | scsi_sg.c (192015) |
---|---|
1/*- 2 * Copyright (c) 2007 Scott Long 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 */ 26 27/* 28 * scsi_sg peripheral driver. This driver is meant to implement the Linux 29 * SG passthrough interface for SCSI. 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2007 Scott Long 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 */ 26 27/* 28 * scsi_sg peripheral driver. This driver is meant to implement the Linux 29 * SG passthrough interface for SCSI. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_sg.c 187247 2009-01-14 21:31:22Z trasz $"); | 33__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_sg.c 192015 2009-05-12 15:03:47Z trasz $"); |
34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/kernel.h> 38#include <sys/types.h> 39#include <sys/bio.h> 40#include <sys/malloc.h> 41#include <sys/fcntl.h> --- 906 unchanged lines hidden (view full) --- 948 break; 949 case CAM_CMD_TIMEOUT: 950 *hoststat = DID_TIME_OUT; 951 *drvstat = 0; 952 break; 953 case CAM_SCSI_STATUS_ERROR: 954 *hoststat = DID_ERROR; 955 *drvstat = 0; | 34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/kernel.h> 38#include <sys/types.h> 39#include <sys/bio.h> 40#include <sys/malloc.h> 41#include <sys/fcntl.h> --- 906 unchanged lines hidden (view full) --- 948 break; 949 case CAM_CMD_TIMEOUT: 950 *hoststat = DID_TIME_OUT; 951 *drvstat = 0; 952 break; 953 case CAM_SCSI_STATUS_ERROR: 954 *hoststat = DID_ERROR; 955 *drvstat = 0; |
956 break; |
|
956 case CAM_SCSI_BUS_RESET: 957 *hoststat = DID_RESET; 958 *drvstat = 0; 959 break; 960 case CAM_UNCOR_PARITY: 961 *hoststat = DID_PARITY; 962 *drvstat = 0; 963 break; 964 case CAM_SCSI_BUSY: 965 *hoststat = DID_BUS_BUSY; 966 *drvstat = 0; | 957 case CAM_SCSI_BUS_RESET: 958 *hoststat = DID_RESET; 959 *drvstat = 0; 960 break; 961 case CAM_UNCOR_PARITY: 962 *hoststat = DID_PARITY; 963 *drvstat = 0; 964 break; 965 case CAM_SCSI_BUSY: 966 *hoststat = DID_BUS_BUSY; 967 *drvstat = 0; |
968 break; |
|
967 default: 968 *hoststat = DID_ERROR; 969 *drvstat = DRIVER_ERROR; 970 } 971 972 if (status & CAM_AUTOSNS_VALID) 973 *drvstat = DRIVER_SENSE; 974} 975 976static int 977scsi_group_len(u_char cmd) 978{ 979 int len[] = {6, 10, 10, 12, 12, 12, 10, 10}; 980 int group; 981 982 group = (cmd >> 5) & 0x7; 983 return (len[group]); 984} 985 | 969 default: 970 *hoststat = DID_ERROR; 971 *drvstat = DRIVER_ERROR; 972 } 973 974 if (status & CAM_AUTOSNS_VALID) 975 *drvstat = DRIVER_SENSE; 976} 977 978static int 979scsi_group_len(u_char cmd) 980{ 981 int len[] = {6, 10, 10, 12, 12, 12, 10, 10}; 982 int group; 983 984 group = (cmd >> 5) & 0x7; 985 return (len[group]); 986} 987 |