linux/drivers/scsi/3w-sas.h

/*
   3w-sas.h -- LSI 3ware SAS/SATA-RAID Controller device driver for Linux.

   Written By: Adam Radford <[email protected]>

   Copyright (C) 2009 LSI Corporation.

   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

   Bugs/Comments/Suggestions should be mailed to:
   [email protected]
*/

#ifndef _3W_SAS_H
#define _3W_SAS_H

/* AEN severity table */
static char *twl_aen_severity_table[] =;

/* Liberator register offsets */
#define TWL_STATUS
#define TWL_HIBDB
#define TWL_HISTAT
#define TWL_HIMASK
#define TWL_HOBDB
#define TWL_HOBDBC
#define TWL_SCRPD3
#define TWL_HIBQPL
#define TWL_HIBQPH
#define TWL_HOBQPL
#define TWL_HOBQPH
#define TWL_HISTATUS_VALID_INTERRUPT
#define TWL_HISTATUS_ATTENTION_INTERRUPT
#define TWL_HISTATUS_RESPONSE_INTERRUPT
#define TWL_STATUS_OVERRUN_SUBMIT
#define TWL_ISSUE_SOFT_RESET
#define TWL_CONTROLLER_READY
#define TWL_DOORBELL_CONTROLLER_ERROR
#define TWL_DOORBELL_ATTENTION_INTERRUPT
#define TWL_PULL_MODE

/* Command packet opcodes used by the driver */
#define TW_OP_INIT_CONNECTION
#define TW_OP_GET_PARAM
#define TW_OP_SET_PARAM
#define TW_OP_EXECUTE_SCSI

/* Asynchronous Event Notification (AEN) codes used by the driver */
#define TW_AEN_QUEUE_EMPTY
#define TW_AEN_SOFT_RESET
#define TW_AEN_SYNC_TIME_WITH_HOST
#define TW_AEN_SEVERITY_ERROR
#define TW_AEN_SEVERITY_DEBUG
#define TW_AEN_NOT_RETRIEVED

/* Command state defines */
#define TW_S_INITIAL
#define TW_S_STARTED
#define TW_S_POSTED
#define TW_S_COMPLETED
#define TW_S_FINISHED

/* Compatibility defines */
#define TW_9750_ARCH_ID
#define TW_CURRENT_DRIVER_SRL
#define TW_CURRENT_DRIVER_BUILD
#define TW_CURRENT_DRIVER_BRANCH

/* Misc defines */
#define TW_SECTOR_SIZE
#define TW_MAX_UNITS
#define TW_INIT_MESSAGE_CREDITS
#define TW_INIT_COMMAND_PACKET_SIZE
#define TW_INIT_COMMAND_PACKET_SIZE_EXTENDED
#define TW_EXTENDED_INIT_CONNECT
#define TW_BASE_FW_SRL
#define TW_BASE_FW_BRANCH
#define TW_BASE_FW_BUILD
#define TW_Q_LENGTH
#define TW_Q_START
#define TW_MAX_SLOT
#define TW_MAX_RESET_TRIES
#define TW_MAX_CMDS_PER_LUN
#define TW_MAX_AEN_DRAIN
#define TW_IN_RESET
#define TW_USING_MSI
#define TW_IN_ATTENTION_LOOP
#define TW_MAX_SECTORS
#define TW_MAX_CDB_LEN
#define TW_IOCTL_CHRDEV_TIMEOUT
#define TW_IOCTL_CHRDEV_FREE
#define TW_COMMAND_OFFSET
#define TW_VERSION_TABLE
#define TW_TIMEKEEP_TABLE
#define TW_INFORMATION_TABLE
#define TW_PARAM_FWVER
#define TW_PARAM_FWVER_LENGTH
#define TW_PARAM_BIOSVER
#define TW_PARAM_BIOSVER_LENGTH
#define TW_PARAM_MODEL
#define TW_PARAM_MODEL_LENGTH
#define TW_PARAM_PHY_SUMMARY_TABLE
#define TW_PARAM_PHYCOUNT
#define TW_PARAM_PHYCOUNT_LENGTH
#define TW_IOCTL_FIRMWARE_PASS_THROUGH
#define TW_ALLOCATION_LENGTH
#define TW_SENSE_DATA_LENGTH
#define TW_ERROR_LOGICAL_UNIT_NOT_SUPPORTED
#define TW_ERROR_INVALID_FIELD_IN_CDB
#define TW_ERROR_UNIT_OFFLINE
#define TW_MESSAGE_SOURCE_CONTROLLER_ERROR
#define TW_MESSAGE_SOURCE_CONTROLLER_EVENT
#define TW_DRIVER
#ifndef PCI_DEVICE_ID_3WARE_9750
#define PCI_DEVICE_ID_3WARE_9750
#endif

/* Bitmask macros to eliminate bitfields */

/* opcode: 5, reserved: 3 */
#define TW_OPRES_IN(x,y)
#define TW_OP_OUT(x)

/* opcode: 5, sgloffset: 3 */
#define TW_OPSGL_IN(x,y)
#define TW_SGL_OUT(x)

/* severity: 3, reserved: 5 */
#define TW_SEV_OUT(x)

/* not_mfa: 1, reserved: 7, status: 8, request_id: 16 */
#define TW_RESID_OUT(x)
#define TW_NOTMFA_OUT(x)

/* request_id: 12, lun: 4 */
#define TW_REQ_LUN_IN(lun, request_id)
#define TW_LUN_OUT(lun)

/* Register access macros */
#define TWL_STATUS_REG_ADDR(x)
#define TWL_HOBQPL_REG_ADDR(x)
#define TWL_HOBQPH_REG_ADDR(x)
#define TWL_HOBDB_REG_ADDR(x)
#define TWL_HOBDBC_REG_ADDR(x)
#define TWL_HIMASK_REG_ADDR(x)
#define TWL_HISTAT_REG_ADDR(x)
#define TWL_HIBQPH_REG_ADDR(x)
#define TWL_HIBQPL_REG_ADDR(x)
#define TWL_HIBDB_REG_ADDR(x)
#define TWL_SCRPD3_REG_ADDR(x)
#define TWL_MASK_INTERRUPTS(x)
#define TWL_UNMASK_INTERRUPTS(x)
#define TWL_CLEAR_DB_INTERRUPT(x)
#define TWL_SOFT_RESET(x)

/* Macros */
#define TW_PRINTK(h,a,b,c)
#define TW_MAX_LUNS
#define TW_COMMAND_SIZE
#define TW_LIBERATOR_MAX_SGL_LENGTH
#define TW_LIBERATOR_MAX_SGL_LENGTH_OLD
#define TW_PADDING_LENGTH_LIBERATOR
#define TW_PADDING_LENGTH_LIBERATOR_OLD
#define TW_CPU_TO_SGL(x)

#pragma pack(1)

/* SGL entry */
TW_SG_Entry_ISO;

/* Old Command Packet with ISO SGL */
TW_Command;

/* New Command Packet with ISO SGL */
TW_Command_Apache;

/* New command packet header */
TW_Command_Apache_Header;

/* This struct is a union of the 2 command packets */
TW_Command_Full;

/* Initconnection structure */
TW_Initconnect;

/* Event info structure */
TW_Event;

TW_Ioctl_Driver_Command;

TW_Ioctl_Buf_Apache;

/* GetParam descriptor */
TW_Param_Apache;

/* Compatibility information structure */
TW_Compatibility_Info;

#pragma pack()

TW_Device_Extension;

#endif /* _3W_SAS_H */