linux/drivers/scsi/esas2r/atvda.h

/*  linux/drivers/scsi/esas2r/atvda.h
 *       ATTO VDA interface definitions
 *
 *  Copyright (c) 2001-2013 ATTO Technology, Inc.
 *  (mailto:[email protected])
 */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  NO WARRANTY
 *  THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
 *  CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
 *  LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
 *  MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
 *  solely responsible for determining the appropriateness of using and
 *  distributing the Program and assumes all risks associated with its
 *  exercise of rights under this Agreement, including but not limited to
 *  the risks and costs of program errors, damage to or loss of data,
 *  programs or equipment, and unavailability or interruption of operations.
 *
 *  DISCLAIMER OF LIABILITY
 *  NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
 *  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 *  DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
 *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
 *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 *  USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
 *  HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/


#ifndef ATVDA_H
#define ATVDA_H

struct __packed atto_dev_addr {};

/* dev_addr2 was added for 64-bit alignment */

struct __packed atto_dev_addr2 {};

struct __packed atto_vda_sge {};


/* VDA request function codes */

#define VDA_FUNC_SCSI
#define VDA_FUNC_FLASH
#define VDA_FUNC_DIAG
#define VDA_FUNC_AE
#define VDA_FUNC_CLI
#define VDA_FUNC_IOCTL
#define VDA_FUNC_CFG
#define VDA_FUNC_MGT
#define VDA_FUNC_GSV


/* VDA request status values.  for host driver considerations, values for
 * SCSI requests start at zero.  other requests may use these values as well. */

#define RS_SUCCESS
#define RS_INV_FUNC
#define RS_BUSY
#define RS_SEL
#define RS_NO_LUN
#define RS_TIMEOUT
#define RS_OVERRUN
#define RS_UNDERRUN
#define RS_SCSI_ERROR
#define RS_ABORTED
#define RS_RESID_MISM
#define RS_TM_FAILED
#define RS_RESET
#define RS_ERR_DMA_SG
#define RS_ERR_DMA_DATA
#define RS_UNSUPPORTED
#define RS_SEL2
#define RS_VDA_BASE
#define RS_MGT_BASE
#define RS_SCAN_FAIL
#define RS_DEV_INVALID
#define RS_DEV_ASSIGNED
#define RS_DEV_REMOVE
#define RS_DEV_LOST
#define RS_SCAN_GEN
#define RS_GRP_INVALID
#define RS_GRP_EXISTS
#define RS_GRP_LIMIT
#define RS_GRP_INTLV
#define RS_GRP_SPAN
#define RS_GRP_TYPE
#define RS_GRP_MEMBERS
#define RS_GRP_COMMIT
#define RS_GRP_REBUILD
#define RS_GRP_REBUILD_TYPE
#define RS_GRP_BLOCK_SIZE
#define RS_CFG_SAVE
#define RS_PART_LAST
#define RS_ELEM_INVALID
#define RS_PART_MAPPED
#define RS_PART_TARGET
#define RS_PART_LUN
#define RS_PART_DUP
#define RS_PART_NOMAP
#define RS_PART_MAX
#define RS_PART_CAP
#define RS_PART_STATE
#define RS_TEST_IN_PROG
#define RS_METRICS_ERROR
#define RS_HS_ERROR
#define RS_NO_METRICS_TEST
#define RS_BAD_PARAM
#define RS_GRP_MEMBER_SIZE
#define RS_FLS_BASE
#define RS_FLS_ERR_AREA
#define RS_FLS_ERR_BUSY
#define RS_FLS_ERR_RANGE
#define RS_FLS_ERR_BEGIN
#define RS_FLS_ERR_CHECK
#define RS_FLS_ERR_FAIL
#define RS_FLS_ERR_RSRC
#define RS_FLS_ERR_NOFILE
#define RS_FLS_ERR_FSIZE
#define RS_CFG_BASE
#define RS_CFG_ERR_BUSY
#define RS_CFG_ERR_SGE
#define RS_CFG_ERR_DATE
#define RS_CFG_ERR_TIME
#define RS_DEGRADED
#define RS_CLI_INTERNAL
#define RS_VDA_INTERNAL
#define RS_PENDING
#define RS_STARTED


/* flash request subfunctions.  these are used in both the IOCTL and the
 * driver-firmware interface (VDA_FUNC_FLASH). */

#define VDA_FLASH_BEGINW
#define VDA_FLASH_READ
#define VDA_FLASH_WRITE
#define VDA_FLASH_COMMIT
#define VDA_FLASH_CANCEL
#define VDA_FLASH_INFO
#define VDA_FLASH_FREAD
#define VDA_FLASH_FWRITE
#define VDA_FLASH_FINFO


/* IOCTL request subfunctions.  these identify the payload type for
 * VDA_FUNC_IOCTL.
 */

#define VDA_IOCTL_HBA
#define VDA_IOCTL_CSMI
#define VDA_IOCTL_SMP

struct __packed atto_vda_devinfo {};


/*! struct atto_vda_devinfo2 is a replacement for atto_vda_devinfo.  it
 * extends beyond the 0x70 bytes allowed in atto_vda_mgmt_req; therefore,
 * the entire structure is DMaed between the firmware and host buffer and
 * the data will always be in little endian format.
 */

struct __packed atto_vda_devinfo2 {};


struct __packed atto_vda_grp_info {};


struct __packed atto_vdapart_info {};


struct __packed atto_vda_dh_info {};


struct __packed atto_vda_dh_smart {};


struct __packed atto_vda_metrics_info {};


struct __packed atto_vda_metrics_data {};


struct __packed atto_vda_schedule_info {};


struct __packed atto_vda_n_vcache_info {};


struct __packed atto_vda_buzzer_info {};


struct  __packed atto_vda_adapter_info {};


struct __packed atto_vda_temp_info {};


struct __packed atto_vda_fan_info {};


/* VDA management commands */

#define VDAMGT_DEV_SCAN
#define VDAMGT_DEV_INFO
#define VDAMGT_DEV_CLEAN
#define VDAMGT_DEV_IDENTIFY
#define VDAMGT_DEV_IDENTSTOP
#define VDAMGT_DEV_PT_INFO
#define VDAMGT_DEV_FEATURES
#define VDAMGT_DEV_PT_FEATURES
#define VDAMGT_DEV_HEALTH_REQ
#define VDAMGT_DEV_METRICS
#define VDAMGT_DEV_INFO2
#define VDAMGT_DEV_OPERATION
#define VDAMGT_DEV_INFO2_BYADDR
#define VDAMGT_GRP_INFO
#define VDAMGT_GRP_CREATE
#define VDAMGT_GRP_DELETE
#define VDAMGT_ADD_STORAGE
#define VDAMGT_MEMBER_ADD
#define VDAMGT_GRP_COMMIT
#define VDAMGT_GRP_REBUILD
#define VDAMGT_GRP_COMMIT_INIT
#define VDAMGT_QUICK_RAID
#define VDAMGT_GRP_FEATURES
#define VDAMGT_GRP_COMMIT_INIT_AUTOMAP
#define VDAMGT_QUICK_RAID_INIT_AUTOMAP
#define VDAMGT_GRP_OPERATION
#define VDAMGT_CFG_SAVE
#define VDAMGT_LAST_ERROR
#define VDAMGT_ADAP_INFO
#define VDAMGT_ADAP_FEATURES
#define VDAMGT_TEMP_INFO
#define VDAMGT_FAN_INFO
#define VDAMGT_PART_INFO
#define VDAMGT_PART_MAP
#define VDAMGT_PART_UNMAP
#define VDAMGT_PART_AUTOMAP
#define VDAMGT_PART_SPLIT
#define VDAMGT_PART_MERGE
#define VDAMGT_SPARE_LIST
#define VDAMGT_SPARE_ADD
#define VDAMGT_SPARE_REMOVE
#define VDAMGT_LOCAL_SPARE_ADD
#define VDAMGT_SCHEDULE_EVENT
#define VDAMGT_SCHEDULE_INFO
#define VDAMGT_NVCACHE_INFO
#define VDAMGT_NVCACHE_SET
#define VDAMGT_BUZZER_INFO
#define VDAMGT_BUZZER_SET


struct __packed atto_vda_ae_hdr {};


struct  __packed atto_vda_ae_raid {};


struct __packed atto_vda_ae_lu_tgt_lun {};


struct __packed atto_vda_ae_lu_tgt_lun_raid {};


struct __packed atto_vda_ae_lu {};


struct __packed atto_vda_ae_disk {};


#define VDAAE_LOG_STRSZ

struct __packed atto_vda_ae_log {};


#define VDAAE_TLG_STRSZ

struct __packed atto_vda_ae_timestamp_log {};


struct __packed atto_vda_ae_nvc {};


struct __packed atto_vda_ae_dev {};


atto_vda_ae;


struct __packed atto_vda_date_and_time {};

#define SGE_LEN_LIMIT
#define SGE_LEN_MAX
#define SGE_LAST
#define SGE_ADDR_64
#define SGE_CHAIN
#define SGE_CHAIN_LEN
#define SGE_CHAIN_SZ


struct __packed atto_vda_cfg_init {};


/* configuration commands */

#define VDA_CFG_INIT
#define VDA_CFG_GET_INIT
#define VDA_CFG_GET_INIT2


/*! physical region descriptor (PRD) aka scatter/gather entry */

struct __packed atto_physical_region_description {};

/* Request types. NOTE that ALL requests have the same layout for the first
 * few bytes.
 */
struct __packed atto_vda_req_header {};


#define FCP_CDB_SIZE

struct __packed atto_vda_scsi_req {};


struct __packed atto_vda_flash_req {};


struct __packed atto_vda_diag_req {};


struct __packed atto_vda_ae_req {};


struct __packed atto_vda_cli_req {};


struct __packed atto_vda_ioctl_req {};


struct __packed atto_vda_cfg_req {};


struct __packed atto_vda_mgmt_req {};


atto_vda_req;

/* Outbound response structures */

struct __packed atto_vda_scsi_rsp {};

struct __packed atto_vda_flash_rsp {};

struct __packed atto_vda_ae_rsp {};

struct __packed atto_vda_cli_rsp {};

struct __packed atto_vda_ioctl_rsp {};

struct __packed atto_vda_cfg_rsp {};

struct __packed atto_vda_mgmt_rsp {};

atto_vda_func_rsp;

struct __packed atto_vda_ob_rsp {};

struct __packed atto_vda_ae_data {};

struct __packed atto_vda_mgmt_data {};

atto_vda_rsp_data;

#endif