/* linux/drivers/scsi/esas2r/atvda.h
* ATTO VDA interface definitions
*
* Copyright (c) 2001-2013 ATTO Technology, Inc.
* (mailto:linuxdrivers@attotech.com)
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* 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 {
u64 dev_port;
u64 hba_port;
u8 lun;
u8 flags;
#define VDA_DEVADDRF_SATA 0x01
#define VDA_DEVADDRF_SSD 0x02
u8 link_speed; /* VDALINKSPEED_xxx */
u8 pad[1];
};
/* dev_addr2 was added for 64-bit alignment */
struct __packed atto_dev_addr2 {
u64 dev_port;
u64 hba_port;
u8 lun;
u8 flags;
u8 link_speed;
u8 pad[5];
};
struct __packed atto_vda_sge {
u32 length;
u64 address;
};
/* VDA request function codes */
#define VDA_FUNC_SCSI 0x00
#define VDA_FUNC_FLASH 0x01
#define VDA_FUNC_DIAG 0x02
#define VDA_FUNC_AE 0x03
#define VDA_FUNC_CLI 0x04
#define VDA_FUNC_IOCTL 0x05
#define VDA_FUNC_CFG 0x06
#define VDA_FUNC_MGT 0x07
#define VDA_FUNC_GSV 0x08
/* 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 0x00 /*! successful completion */
#define RS_INV_FUNC 0x01 /*! invalid command function */
#define RS_BUSY 0x02 /*! insufficient resources */
#define RS_SEL 0x03 /*! no target at target_id */
#define RS_NO_LUN 0x04 /*! invalid LUN */
#define RS_TIMEOUT 0x05 /*! request timeout */
#define RS_OVERRUN 0x06 /*! data overrun */
#define RS_UNDERRUN 0x07 /*! data underrun */
#define RS_SCSI_ERROR 0x08 /*! SCSI error occurred */
#define RS_ABORTED 0x0A /*! command aborted */
#define RS_RESID_MISM 0x0B /*! residual length incorrect */
#define RS_TM_FAILED 0x0C /*! task management failed */
#define RS_RESET 0x0D /*! aborted due to bus reset */
#define RS_ERR_DMA_SG 0x0E /*! error reading SG list */
#define RS_ERR_DMA_DATA 0x0F /*! error transferring data */
#define RS_UNSUPPORTED 0x10 /*! unsupported request */
#define RS_SEL2 0x70 /*! internal generated RS_SEL */
#define RS_VDA_BASE 0x80 /*! base of VDA-specific errors */
#define RS_MGT_BASE 0x80 /*! base of VDA management errors */
#define RS_SCAN_FAIL (RS_MGT_BASE + 0x00)
#define RS_DEV_INVALID (RS_MGT_BASE + 0x01)
#define RS_DEV_ASSIGNED (RS_MGT_BASE + 0x02)
#define RS_DEV_REMOVE (RS_MGT_BASE + 0x03)
#define RS_DEV_LOST (RS_MGT_BASE + 0x04)
#define RS_SCAN_GEN (RS_MGT_BASE + 0x05)
#define RS_GRP_INVALID (RS_MGT_BASE + 0x08)
#define RS_GRP_EXISTS (RS_MGT_BASE + 0x09)
#define RS_GRP_LIMIT (RS_MGT_BASE + 0x0A)
#define RS_GRP_INTLV (RS_MGT_BASE + 0x0B)
#define RS_GRP_SPAN (RS_MGT_BASE + 0x0C)
#define RS_GRP_TYPE (RS_MGT_BASE + 0x0D)
#define RS_GRP_MEMBERS (RS_MGT_BASE + 0x0E)
#define RS_GRP_COMMIT (RS_MGT_BASE + 0x0F)
#define RS_GRP_REBUILD (RS_MGT_BASE + 0x10)
#define RS_GRP_REBUILD_TYPE (RS_MGT_BASE + 0x11)
#define RS_GRP_BLOCK_SIZE (RS_MGT_BASE + 0x12)
#define RS_CFG_SAVE (RS_MGT_BASE + 0x14)
#define RS_PART_LAST (RS_MGT_BASE + 0x18)
#define RS_ELEM_INVALID (RS_MGT_BASE + 0x19)
#define RS_PART_MAPPED (RS_MGT_BASE + 0x1A)
#define RS_PART_TARGET (RS_MGT_BASE + 0x1B)
#define RS_PART_LUN (RS_MGT_BASE + 0x1C)
#define RS_PART_DUP (RS_MGT_BASE