Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2)  * Data structures and definitions for the CAM system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (c) 1997 Justin T. Gibbs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Copyright (c) 2000 Adaptec Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * Redistribution and use in source and binary forms, with or without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * modification, are permitted provided that the following conditions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  * are met:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  * 1. Redistributions of source code must retain the above copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  *    notice, this list of conditions, and the following disclaimer,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  *    without modification.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  * 2. The name of the author may not be used to endorse or promote products
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  *    derived from this software without specific prior written permission.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  * Alternatively, this software may be distributed under the terms of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  * GNU General Public License ("GPL").
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  * SUCH DAMAGE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/cam.h#15 $
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) #ifndef _AIC7XXX_CAM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) #define _AIC7XXX_CAM_H 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) #define	CAM_BUS_WILDCARD ((u_int)~0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) #define	CAM_TARGET_WILDCARD ((u_int)~0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) #define	CAM_LUN_WILDCARD ((u_int)~0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) /* CAM Status field values */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) typedef enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	CAM_REQ_INPROG,		/* CCB request is in progress */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	CAM_REQ_CMP,		/* CCB request completed without error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	CAM_REQ_ABORTED,	/* CCB request aborted by the host */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	CAM_UA_ABORT,		/* Unable to abort CCB request */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	CAM_REQ_CMP_ERR,	/* CCB request completed with an error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	CAM_BUSY,		/* CAM subsystem is busy */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	CAM_REQ_INVALID,	/* CCB request was invalid */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	CAM_PATH_INVALID,	/* Supplied Path ID is invalid */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	CAM_SEL_TIMEOUT,	/* Target Selection Timeout */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	CAM_CMD_TIMEOUT,	/* Command timeout */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	CAM_SCSI_STATUS_ERROR,	/* SCSI error, look at error code in CCB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	CAM_SCSI_BUS_RESET,	/* SCSI Bus Reset Sent/Received */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	CAM_UNCOR_PARITY,	/* Uncorrectable parity error occurred */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	CAM_AUTOSENSE_FAIL,	/* Autosense: request sense cmd fail */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	CAM_NO_HBA,		/* No HBA Detected Error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	CAM_DATA_RUN_ERR,	/* Data Overrun error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	CAM_UNEXP_BUSFREE,	/* Unexpected Bus Free */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	CAM_SEQUENCE_FAIL,	/* Protocol Violation */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	CAM_CCB_LEN_ERR,	/* CCB length supplied is inadequate */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	CAM_PROVIDE_FAIL,	/* Unable to provide requested capability */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	CAM_BDR_SENT,		/* A SCSI BDR msg was sent to target */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	CAM_REQ_TERMIO,		/* CCB request terminated by the host */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	CAM_UNREC_HBA_ERROR,	/* Unrecoverable Host Bus Adapter Error */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	CAM_REQ_TOO_BIG,	/* The request was too large for this host */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	CAM_UA_TERMIO,		/* Unable to terminate I/O CCB request */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	CAM_MSG_REJECT_REC,	/* Message Reject Received */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	CAM_DEV_NOT_THERE,	/* SCSI Device Not Installed/there */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	CAM_RESRC_UNAVAIL,	/* Resource Unavailable */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	 * This request should be requeued to preserve
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	 * transaction ordering.  This typically occurs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	 * when the SIM recognizes an error that should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	 * freeze the queue and must place additional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	 * requests for the target at the sim level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	 * back into the XPT queue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	CAM_REQUEUE_REQ,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	CAM_DEV_QFRZN		= 0x40,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	CAM_STATUS_MASK		= 0x3F
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) } cam_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)  * Definitions for the asynchronous callback CCB fields.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) typedef enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	AC_GETDEV_CHANGED	= 0x800,/* Getdev info might have changed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	AC_INQ_CHANGED		= 0x400,/* Inquiry info might have changed */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	AC_TRANSFER_NEG		= 0x200,/* New transfer settings in effect */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	AC_LOST_DEVICE		= 0x100,/* A device went away */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	AC_FOUND_DEVICE		= 0x080,/* A new device was found */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	AC_PATH_DEREGISTERED	= 0x040,/* A path has de-registered */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	AC_PATH_REGISTERED	= 0x020,/* A new path has been registered */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	AC_SENT_BDR		= 0x010,/* A BDR message was sent to target */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	AC_SCSI_AEN		= 0x008,/* A SCSI AEN has been received */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	AC_UNSOL_RESEL		= 0x002,/* Unsolicited reselection occurred */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	AC_BUS_RESET		= 0x001 /* A SCSI bus reset occurred */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) } ac_code;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) typedef enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	CAM_DIR_IN		= DMA_FROM_DEVICE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	CAM_DIR_OUT		= DMA_TO_DEVICE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	CAM_DIR_NONE		= DMA_NONE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) } ccb_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) #endif /* _AIC7XXX_CAM_H */