Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Data structures and definitions for the CAM system.
0003  *
0004  * Copyright (c) 1997 Justin T. Gibbs.
0005  * Copyright (c) 2000 Adaptec Inc.
0006  * All rights reserved.
0007  *
0008  * Redistribution and use in source and binary forms, with or without
0009  * modification, are permitted provided that the following conditions
0010  * are met:
0011  * 1. Redistributions of source code must retain the above copyright
0012  *    notice, this list of conditions, and the following disclaimer,
0013  *    without modification.
0014  * 2. The name of the author may not be used to endorse or promote products
0015  *    derived from this software without specific prior written permission.
0016  *
0017  * Alternatively, this software may be distributed under the terms of the
0018  * GNU General Public License ("GPL").
0019  *
0020  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
0021  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0022  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0023  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
0024  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0025  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
0026  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
0027  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
0028  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
0029  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
0030  * SUCH DAMAGE.
0031  *
0032  * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/cam.h#15 $
0033  */
0034 
0035 #ifndef _AIC7XXX_CAM_H
0036 #define _AIC7XXX_CAM_H 1
0037 
0038 #include <linux/types.h>
0039 
0040 #define CAM_BUS_WILDCARD ((u_int)~0)
0041 #define CAM_TARGET_WILDCARD ((u_int)~0)
0042 #define CAM_LUN_WILDCARD ((u_int)~0)
0043 
0044 /* CAM Status field values */
0045 typedef enum {
0046     CAM_REQ_INPROG,     /* CCB request is in progress */
0047     CAM_REQ_CMP,        /* CCB request completed without error */
0048     CAM_REQ_ABORTED,    /* CCB request aborted by the host */
0049     CAM_UA_ABORT,       /* Unable to abort CCB request */
0050     CAM_REQ_CMP_ERR,    /* CCB request completed with an error */
0051     CAM_BUSY,       /* CAM subsystem is busy */
0052     CAM_REQ_INVALID,    /* CCB request was invalid */
0053     CAM_PATH_INVALID,   /* Supplied Path ID is invalid */
0054     CAM_SEL_TIMEOUT,    /* Target Selection Timeout */
0055     CAM_CMD_TIMEOUT,    /* Command timeout */
0056     CAM_SCSI_STATUS_ERROR,  /* SCSI error, look at error code in CCB */
0057     CAM_SCSI_BUS_RESET, /* SCSI Bus Reset Sent/Received */
0058     CAM_UNCOR_PARITY,   /* Uncorrectable parity error occurred */
0059     CAM_AUTOSENSE_FAIL, /* Autosense: request sense cmd fail */
0060     CAM_NO_HBA,     /* No HBA Detected Error */
0061     CAM_DATA_RUN_ERR,   /* Data Overrun error */
0062     CAM_UNEXP_BUSFREE,  /* Unexpected Bus Free */
0063     CAM_SEQUENCE_FAIL,  /* Protocol Violation */
0064     CAM_CCB_LEN_ERR,    /* CCB length supplied is inadequate */
0065     CAM_PROVIDE_FAIL,   /* Unable to provide requested capability */
0066     CAM_BDR_SENT,       /* A SCSI BDR msg was sent to target */
0067     CAM_REQ_TERMIO,     /* CCB request terminated by the host */
0068     CAM_UNREC_HBA_ERROR,    /* Unrecoverable Host Bus Adapter Error */
0069     CAM_REQ_TOO_BIG,    /* The request was too large for this host */
0070     CAM_UA_TERMIO,      /* Unable to terminate I/O CCB request */
0071     CAM_MSG_REJECT_REC, /* Message Reject Received */
0072     CAM_DEV_NOT_THERE,  /* SCSI Device Not Installed/there */
0073     CAM_RESRC_UNAVAIL,  /* Resource Unavailable */
0074     /*
0075      * This request should be requeued to preserve
0076      * transaction ordering.  This typically occurs
0077      * when the SIM recognizes an error that should
0078      * freeze the queue and must place additional
0079      * requests for the target at the sim level
0080      * back into the XPT queue.
0081      */
0082     CAM_REQUEUE_REQ,
0083     CAM_DEV_QFRZN       = 0x40,
0084 
0085     CAM_STATUS_MASK     = 0x3F
0086 } cam_status;
0087 
0088 /*
0089  * Definitions for the asynchronous callback CCB fields.
0090  */
0091 typedef enum {
0092     AC_GETDEV_CHANGED   = 0x800,/* Getdev info might have changed */
0093     AC_INQ_CHANGED      = 0x400,/* Inquiry info might have changed */
0094     AC_TRANSFER_NEG     = 0x200,/* New transfer settings in effect */
0095     AC_LOST_DEVICE      = 0x100,/* A device went away */
0096     AC_FOUND_DEVICE     = 0x080,/* A new device was found */
0097     AC_PATH_DEREGISTERED    = 0x040,/* A path has de-registered */
0098     AC_PATH_REGISTERED  = 0x020,/* A new path has been registered */
0099     AC_SENT_BDR     = 0x010,/* A BDR message was sent to target */
0100     AC_SCSI_AEN     = 0x008,/* A SCSI AEN has been received */
0101     AC_UNSOL_RESEL      = 0x002,/* Unsolicited reselection occurred */
0102     AC_BUS_RESET        = 0x001 /* A SCSI bus reset occurred */
0103 } ac_code;
0104 
0105 typedef enum {
0106     CAM_DIR_IN      = DMA_FROM_DEVICE,
0107     CAM_DIR_OUT     = DMA_TO_DEVICE,
0108     CAM_DIR_NONE        = DMA_NONE,
0109 } ccb_flags;
0110 
0111 #endif /* _AIC7XXX_CAM_H */