mpt2sas_base.h revision 50d5c60634673a79f8d88564e10345b50fca7378
1635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 2635374e7eb110e80d9918b8611198edd56a32975Eric Moore * This is the Fusion MPT base driver providing common API layer interface 3635374e7eb110e80d9918b8611198edd56a32975Eric Moore * for access to MPT (Message Passing Technology) firmware. 4635374e7eb110e80d9918b8611198edd56a32975Eric Moore * 5635374e7eb110e80d9918b8611198edd56a32975Eric Moore * This code is based on drivers/scsi/mpt2sas/mpt2_base.h 619d3ebe3d5c4d56c8309a64561d99e7920a35fbbKashyap, Desai * Copyright (C) 2007-2009 LSI Corporation 7635374e7eb110e80d9918b8611198edd56a32975Eric Moore * (mailto:DL-MPTFusionLinux@lsi.com) 8635374e7eb110e80d9918b8611198edd56a32975Eric Moore * 9635374e7eb110e80d9918b8611198edd56a32975Eric Moore * This program is free software; you can redistribute it and/or 10635374e7eb110e80d9918b8611198edd56a32975Eric Moore * modify it under the terms of the GNU General Public License 11635374e7eb110e80d9918b8611198edd56a32975Eric Moore * as published by the Free Software Foundation; either version 2 12635374e7eb110e80d9918b8611198edd56a32975Eric Moore * of the License, or (at your option) any later version. 13635374e7eb110e80d9918b8611198edd56a32975Eric Moore * 14635374e7eb110e80d9918b8611198edd56a32975Eric Moore * This program is distributed in the hope that it will be useful, 15635374e7eb110e80d9918b8611198edd56a32975Eric Moore * but WITHOUT ANY WARRANTY; without even the implied warranty of 16635374e7eb110e80d9918b8611198edd56a32975Eric Moore * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17635374e7eb110e80d9918b8611198edd56a32975Eric Moore * GNU General Public License for more details. 18635374e7eb110e80d9918b8611198edd56a32975Eric Moore * 19635374e7eb110e80d9918b8611198edd56a32975Eric Moore * NO WARRANTY 20635374e7eb110e80d9918b8611198edd56a32975Eric Moore * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR 21635374e7eb110e80d9918b8611198edd56a32975Eric Moore * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT 22635374e7eb110e80d9918b8611198edd56a32975Eric Moore * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, 23635374e7eb110e80d9918b8611198edd56a32975Eric Moore * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is 24635374e7eb110e80d9918b8611198edd56a32975Eric Moore * solely responsible for determining the appropriateness of using and 25635374e7eb110e80d9918b8611198edd56a32975Eric Moore * distributing the Program and assumes all risks associated with its 26635374e7eb110e80d9918b8611198edd56a32975Eric Moore * exercise of rights under this Agreement, including but not limited to 27635374e7eb110e80d9918b8611198edd56a32975Eric Moore * the risks and costs of program errors, damage to or loss of data, 28635374e7eb110e80d9918b8611198edd56a32975Eric Moore * programs or equipment, and unavailability or interruption of operations. 29635374e7eb110e80d9918b8611198edd56a32975Eric Moore 30635374e7eb110e80d9918b8611198edd56a32975Eric Moore * DISCLAIMER OF LIABILITY 31635374e7eb110e80d9918b8611198edd56a32975Eric Moore * NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY 32635374e7eb110e80d9918b8611198edd56a32975Eric Moore * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33635374e7eb110e80d9918b8611198edd56a32975Eric Moore * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND 34635374e7eb110e80d9918b8611198edd56a32975Eric Moore * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 35635374e7eb110e80d9918b8611198edd56a32975Eric Moore * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 36635374e7eb110e80d9918b8611198edd56a32975Eric Moore * USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED 37635374e7eb110e80d9918b8611198edd56a32975Eric Moore * HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES 38635374e7eb110e80d9918b8611198edd56a32975Eric Moore 39635374e7eb110e80d9918b8611198edd56a32975Eric Moore * You should have received a copy of the GNU General Public License 40635374e7eb110e80d9918b8611198edd56a32975Eric Moore * along with this program; if not, write to the Free Software 41635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 42635374e7eb110e80d9918b8611198edd56a32975Eric Moore * USA. 43635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 44635374e7eb110e80d9918b8611198edd56a32975Eric Moore 45635374e7eb110e80d9918b8611198edd56a32975Eric Moore#ifndef MPT2SAS_BASE_H_INCLUDED 46635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_BASE_H_INCLUDED 47635374e7eb110e80d9918b8611198edd56a32975Eric Moore 48635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include "mpi/mpi2_type.h" 49635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include "mpi/mpi2.h" 50635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include "mpi/mpi2_ioc.h" 51635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include "mpi/mpi2_cnfg.h" 52635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include "mpi/mpi2_init.h" 53635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include "mpi/mpi2_raid.h" 54635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include "mpi/mpi2_tool.h" 55635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include "mpi/mpi2_sas.h" 56635374e7eb110e80d9918b8611198edd56a32975Eric Moore 57635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include <scsi/scsi.h> 58635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include <scsi/scsi_cmnd.h> 59635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include <scsi/scsi_device.h> 60635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include <scsi/scsi_host.h> 61635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include <scsi/scsi_tcq.h> 62635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include <scsi/scsi_transport_sas.h> 63635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include <scsi/scsi_dbg.h> 643c621b3ee1432e7a2aca4a3b670b1d05f19ecf9cEric Moore#include <scsi/scsi_eh.h> 65635374e7eb110e80d9918b8611198edd56a32975Eric Moore 66635374e7eb110e80d9918b8611198edd56a32975Eric Moore#include "mpt2sas_debug.h" 67635374e7eb110e80d9918b8611198edd56a32975Eric Moore 68635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* driver versioning info */ 69635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_DRIVER_NAME "mpt2sas" 70635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>" 71635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver" 72153f251e477f41dab0314c4cd2004b9e7ebac4ebKashyap, Desai#define MPT2SAS_DRIVER_VERSION "03.100.03.00" 73153f251e477f41dab0314c4cd2004b9e7ebac4ebKashyap, Desai#define MPT2SAS_MAJOR_VERSION 03 74635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_MINOR_VERSION 100 75dac3bbd643cd54e2383e88b4f0f86db68c921701Kashyap, Desai#define MPT2SAS_BUILD_VERSION 03 763b8b5c9b1f08660583e5dfe095c24170df62f1d2Eric Moore#define MPT2SAS_RELEASE_VERSION 00 77635374e7eb110e80d9918b8611198edd56a32975Eric Moore 78635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 79635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Set MPT2SAS_SG_DEPTH value based on user input. 80635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 81635374e7eb110e80d9918b8611198edd56a32975Eric Moore#ifdef CONFIG_SCSI_MPT2SAS_MAX_SGE 82635374e7eb110e80d9918b8611198edd56a32975Eric Moore#if CONFIG_SCSI_MPT2SAS_MAX_SGE < 16 83635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_SG_DEPTH 16 84635374e7eb110e80d9918b8611198edd56a32975Eric Moore#elif CONFIG_SCSI_MPT2SAS_MAX_SGE > 128 85635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_SG_DEPTH 128 86635374e7eb110e80d9918b8611198edd56a32975Eric Moore#else 87635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_SG_DEPTH CONFIG_SCSI_MPT2SAS_MAX_SGE 88635374e7eb110e80d9918b8611198edd56a32975Eric Moore#endif 89635374e7eb110e80d9918b8611198edd56a32975Eric Moore#else 90635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_SG_DEPTH 128 /* MAX_HW_SEGMENTS */ 91635374e7eb110e80d9918b8611198edd56a32975Eric Moore#endif 92635374e7eb110e80d9918b8611198edd56a32975Eric Moore 93635374e7eb110e80d9918b8611198edd56a32975Eric Moore 94635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 95635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Generic Defines 96635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 97635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_SATA_QUEUE_DEPTH 32 98635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_SAS_QUEUE_DEPTH 254 99635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_RAID_QUEUE_DEPTH 128 100635374e7eb110e80d9918b8611198edd56a32975Eric Moore 101635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_NAME_LENGTH 32 /* generic length of strings */ 102635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_STRING_LENGTH 64 103635374e7eb110e80d9918b8611198edd56a32975Eric Moore 104635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_MAX_CALLBACKS 16 105635374e7eb110e80d9918b8611198edd56a32975Eric Moore 106635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define CAN_SLEEP 1 107635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define NO_SLEEP 0 108635374e7eb110e80d9918b8611198edd56a32975Eric Moore 109635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define INTERNAL_CMDS_COUNT 10 /* reserved cmds */ 110635374e7eb110e80d9918b8611198edd56a32975Eric Moore 111635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIM_MASK 0xFFFFFFFF /* mask every bit*/ 112635374e7eb110e80d9918b8611198edd56a32975Eric Moore 113635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_INVALID_DEVICE_HANDLE 0xFFFF 114635374e7eb110e80d9918b8611198edd56a32975Eric Moore 115635374e7eb110e80d9918b8611198edd56a32975Eric Moore 116635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 117635374e7eb110e80d9918b8611198edd56a32975Eric Moore * reset phases 118635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 119635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_IOC_PRE_RESET 1 /* prior to host reset */ 120635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_IOC_AFTER_RESET 2 /* just after host reset */ 121635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_IOC_DONE_RESET 3 /* links re-initialized */ 122cd4e12e8ad246ec5bc23ab04d0da0e6985025620Kashyap, Desai#define MPT2_IOC_RUNNING 4 /* shost running */ 123635374e7eb110e80d9918b8611198edd56a32975Eric Moore 124635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 125635374e7eb110e80d9918b8611198edd56a32975Eric Moore * logging format 126635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 127635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_FMT "%s: " 128635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_DEBUG_FMT KERN_DEBUG MPT2SAS_FMT 129635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_INFO_FMT KERN_INFO MPT2SAS_FMT 130635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_NOTE_FMT KERN_NOTICE MPT2SAS_FMT 131635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_WARN_FMT KERN_WARNING MPT2SAS_FMT 132635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_ERR_FMT KERN_ERR MPT2SAS_FMT 133635374e7eb110e80d9918b8611198edd56a32975Eric Moore 134635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 135f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore * Dell HBA branding 136f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore */ 137f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_BRANDING_SIZE 32 138f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore 139f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_6GBPS_SAS_HBA_BRANDING "Dell 6Gbps SAS HBA" 140f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_ADAPTER_BRANDING "Dell PERC H200 Adapter" 141f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_INTEGRATED_BRANDING "Dell PERC H200 Integrated" 142f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_MODULAR_BRANDING "Dell PERC H200 Modular" 143f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_EMBEDDED_BRANDING "Dell PERC H200 Embedded" 144f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_BRANDING "Dell PERC H200" 145f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_6GBPS_SAS_BRANDING "Dell 6Gbps SAS" 146f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore 147f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore/* 148f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore * Dell HBA SSDIDs 149f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore */ 150f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_6GBPS_SAS_HBA_SSDID 0x1F1C 151f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_ADAPTER_SSDID 0x1F1D 152f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_INTEGRATED_SSDID 0x1F1E 153f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_MODULAR_SSDID 0x1F1F 154f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_EMBEDDED_SSDID 0x1F20 155f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_SSDID 0x1F21 156f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_6GBPS_SAS_SSDID 0x1F22 157f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore 158f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore/* 159635374e7eb110e80d9918b8611198edd56a32975Eric Moore * per target private data 160635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 161635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_TARGET_FLAGS_RAID_COMPONENT 0x01 162635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_TARGET_FLAGS_VOLUME 0x02 163635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_TARGET_FLAGS_DELETED 0x04 164635374e7eb110e80d9918b8611198edd56a32975Eric Moore 165635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 166635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct MPT2SAS_TARGET - starget private hostdata 167635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @starget: starget object 168635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_address: target sas address 169635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: device handle 170635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @num_luns: number luns 171635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @flags: MPT_TARGET_FLAGS_XXX flags 172635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @deleted: target flaged for deletion 173635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tm_busy: target is busy with TM request. 174635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 175635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct MPT2SAS_TARGET { 176635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_target *starget; 177635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 sas_address; 178635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 179635374e7eb110e80d9918b8611198edd56a32975Eric Moore int num_luns; 180635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 flags; 181635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 deleted; 182635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 tm_busy; 183635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 184635374e7eb110e80d9918b8611198edd56a32975Eric Moore 185635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 186635374e7eb110e80d9918b8611198edd56a32975Eric Moore * per device private data 187635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 188635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_DEVICE_FLAGS_INIT 0x01 189635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_DEVICE_TLR_ON 0x02 190635374e7eb110e80d9918b8611198edd56a32975Eric Moore 191635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 192635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct MPT2SAS_DEVICE - sdev private hostdata 193635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_target: starget private hostdata 194635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @lun: lun number 195635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @flags: MPT_DEVICE_XXX flags 196635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @configured_lun: lun is configured 197635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @block: device is in SDEV_BLOCK state 198635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tlr_snoop_check: flag used in determining whether to disable TLR 199635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 200ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai 201ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai/* OEM Identifiers */ 202ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_OEM_ID_INVALID (0x00000000) 203ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_OEM_ID_DELL (0x00000001) 204ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_OEM_ID_FSC (0x00000002) 205ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_OEM_ID_SUN (0x00000003) 206ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_OEM_ID_IBM (0x00000004) 207ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai 208ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai/* GENERIC Flags 0*/ 209ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_GF0_OCE_DISABLED (0x00000001) 210ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_GF0_R1E_DRIVE_COUNT (0x00000002) 211ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_GF0_R10_DISPLAY (0x00000004) 212ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_GF0_SSD_DATA_SCRUB_DISABLE (0x00000008) 213ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_GF0_SINGLE_DRIVE_R0 (0x00000010) 214ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai 215ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai/* OEM Specific Flags will come from OEM specific header files */ 216ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desaitypedef struct _MPI2_CONFIG_PAGE_MAN_10 { 217ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai MPI2_CONFIG_PAGE_HEADER Header; /* 00h */ 218ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U8 OEMIdentifier; /* 04h */ 219ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U8 Reserved1; /* 05h */ 220ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U16 Reserved2; /* 08h */ 221ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 Reserved3; /* 0Ch */ 222ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 GenericFlags0; /* 10h */ 223ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 GenericFlags1; /* 14h */ 224ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 Reserved4; /* 18h */ 225ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 OEMSpecificFlags0; /* 1Ch */ 226ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 OEMSpecificFlags1; /* 20h */ 227ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 Reserved5[18]; /* 24h-60h*/ 228ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai} MPI2_CONFIG_PAGE_MAN_10, 229ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_10, 230ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai Mpi2ManufacturingPage10_t, MPI2_POINTER pMpi2ManufacturingPage10_t; 231ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai 232635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct MPT2SAS_DEVICE { 233635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct MPT2SAS_TARGET *sas_target; 234635374e7eb110e80d9918b8611198edd56a32975Eric Moore unsigned int lun; 235635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 flags; 236635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 configured_lun; 237635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 block; 238635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 tlr_snoop_check; 239635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 240635374e7eb110e80d9918b8611198edd56a32975Eric Moore 241635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_CMD_NOT_USED 0x8000 /* free */ 242635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_CMD_COMPLETE 0x0001 /* completed */ 243635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_CMD_PENDING 0x0002 /* pending */ 244635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_CMD_REPLY_VALID 0x0004 /* reply is valid */ 245635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_CMD_RESET 0x0008 /* host reset dropped the command */ 246635374e7eb110e80d9918b8611198edd56a32975Eric Moore 247635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 248635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _internal_cmd - internal commands struct 249635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @mutex: mutex 250635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @done: completion 251635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply: reply message pointer 252635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @status: MPT2_CMD_XXX status 253635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @smid: system message id 254635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 255635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _internal_cmd { 256635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct mutex mutex; 257635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct completion done; 258635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *reply; 259635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 status; 260635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 smid; 261635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 262635374e7eb110e80d9918b8611198edd56a32975Eric Moore 263635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 264635374e7eb110e80d9918b8611198edd56a32975Eric Moore * SAS Topology Structures 265635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 266635374e7eb110e80d9918b8611198edd56a32975Eric Moore 267595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai#define MPTSAS_STATE_TR_SEND 0x0001 268595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai#define MPTSAS_STATE_TR_COMPLETE 0x0002 269595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai#define MPTSAS_STATE_CNTRL_SEND 0x0004 270595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai#define MPTSAS_STATE_CNTRL_COMPLETE 0x0008 271595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 272595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai#define MPT2SAS_REQ_SAS_CNTRL 0x0010 273595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 274635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 275635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _sas_device - attached device information 276635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @list: sas device list 277635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @starget: starget object 278635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_address: device sas address 279635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_name: retrieved from the SAS IDENTIFY frame. 280635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: device handle 281c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai * @sas_address_parent: sas address of parent expander or sas host 282635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @enclosure_handle: enclosure handle 283635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @enclosure_logical_id: enclosure logical identifier 284635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @volume_handle: volume handle (valid when hidden raid member) 285635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @volume_wwid: volume unique identifier 286635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_info: bitfield provides detailed info about the device 287635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @id: target id 288635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @channel: target channel 289635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @slot: number number 290635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @hidden_raid_component: set to 1 when this is a raid member 291635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @responding: used in _scsih_sas_device_mark_responding 292635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 293635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_device { 294635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head list; 295635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_target *starget; 296635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 sas_address; 297635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 device_name; 298635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 299c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u64 sas_address_parent; 300635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 enclosure_handle; 301635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 enclosure_logical_id; 302635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 volume_handle; 303635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 volume_wwid; 304635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 device_info; 305635374e7eb110e80d9918b8611198edd56a32975Eric Moore int id; 306635374e7eb110e80d9918b8611198edd56a32975Eric Moore int channel; 307635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 slot; 308635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 hidden_raid_component; 309635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 responding; 31077e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u16 state; 311635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 312635374e7eb110e80d9918b8611198edd56a32975Eric Moore 313635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 314635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _raid_device - raid volume link list 315635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @list: sas device list 316635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @starget: starget object 317635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sdev: scsi device struct (volumes are single lun) 318635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @wwid: unique identifier for the volume 319635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: device handle 320635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @id: target id 321635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @channel: target channel 322635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @volume_type: the raid level 323635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_info: bitfield provides detailed info about the hidden components 324635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @num_pds: number of hidden raid components 325635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @responding: used in _scsih_raid_device_mark_responding 326f7c95ef02b564d9984c0655c9659791b1dd5d7adKashyap, Desai * @percent_complete: resync percent complete 327635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 328635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _raid_device { 329635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head list; 330635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_target *starget; 331635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_device *sdev; 332635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 wwid; 333635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 334635374e7eb110e80d9918b8611198edd56a32975Eric Moore int id; 335635374e7eb110e80d9918b8611198edd56a32975Eric Moore int channel; 336635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 volume_type; 337635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 device_info; 338635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 num_pds; 339635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 responding; 340f7c95ef02b564d9984c0655c9659791b1dd5d7adKashyap, Desai u8 percent_complete; 341635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 342635374e7eb110e80d9918b8611198edd56a32975Eric Moore 343635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 344635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _boot_device - boot device info 345635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @is_raid: flag to indicate whether this is volume 346635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device: holds pointer for either struct _sas_device or 347635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _raid_device 348635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 349635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _boot_device { 350635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 is_raid; 351635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *device; 352635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 353635374e7eb110e80d9918b8611198edd56a32975Eric Moore 354635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 355635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _sas_port - wide/narrow sas port information 356635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @port_list: list of ports belonging to expander 357635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @num_phys: number of phys belonging to this port 358635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @remote_identify: attached device identification 359635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @rphy: sas transport rphy object 360635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @port: sas transport wide/narrow port object 361635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @phy_list: _sas_phy list objects belonging to this port 362635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 363635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_port { 364635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head port_list; 365635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 num_phys; 366635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_identify remote_identify; 367635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_rphy *rphy; 368635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_port *port; 369635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head phy_list; 370635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 371635374e7eb110e80d9918b8611198edd56a32975Eric Moore 372635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 373635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _sas_phy - phy information 374635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @port_siblings: list of phys belonging to a port 375635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @identify: phy identification 376635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @remote_identify: attached device identification 377635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @phy: sas transport phy object 378635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @phy_id: unique phy id 379635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: device handle for this phy 380635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @attached_handle: device handle for attached device 381635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 382635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_phy { 383635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head port_siblings; 384635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_identify identify; 385635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_identify remote_identify; 386635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_phy *phy; 387635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 phy_id; 388635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 389635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 attached_handle; 390635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 391635374e7eb110e80d9918b8611198edd56a32975Eric Moore 392635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 393635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _sas_node - sas_host/expander information 394635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @list: list of expanders 395635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @parent_dev: parent device class 396635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @num_phys: number phys belonging to this sas_host/expander 397635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_address: sas address of this sas_host/expander 398635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: handle for this sas_host/expander 399c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai * @sas_address_parent: sas address of parent expander or sas host 400635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @enclosure_handle: handle for this a member of an enclosure 401635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_info: bitwise defining capabilities of this sas_host/expander 402635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @responding: used in _scsih_expander_device_mark_responding 403635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @phy: a list of phys that make up this sas_host/expander 404635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_port_list: list of ports attached to this sas_host/expander 405635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 406635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_node { 407635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head list; 408635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct device *parent_dev; 409635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 num_phys; 410635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 sas_address; 411635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 412c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u64 sas_address_parent; 413635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 enclosure_handle; 414635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 enclosure_logical_id; 415635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 responding; 416635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _sas_phy *phy; 417635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_port_list; 418635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 419635374e7eb110e80d9918b8611198edd56a32975Eric Moore 420635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 421635374e7eb110e80d9918b8611198edd56a32975Eric Moore * enum reset_type - reset state 422635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @FORCE_BIG_HAMMER: issue diagnostic reset 423635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @SOFT_RESET: issue message_unit_reset, if fails to to big hammer 424635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 425635374e7eb110e80d9918b8611198edd56a32975Eric Mooreenum reset_type { 426635374e7eb110e80d9918b8611198edd56a32975Eric Moore FORCE_BIG_HAMMER, 427635374e7eb110e80d9918b8611198edd56a32975Eric Moore SOFT_RESET, 428635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 429635374e7eb110e80d9918b8611198edd56a32975Eric Moore 430635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 431635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct request_tracker - firmware request tracker 432635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @smid: system message id 433635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @scmd: scsi request pointer 434635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @cb_idx: callback index 435635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_list: list of chains associated to this IO 436635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tracker_list: list of free request (ioc->free_list) 437635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 438635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct request_tracker { 439635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 smid; 440635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_cmnd *scmd; 441635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 cb_idx; 442635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head tracker_list; 443635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 444635374e7eb110e80d9918b8611198edd56a32975Eric Moore 44577e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai/** 44677e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai * struct _tr_list - target reset list 44777e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai * @handle: device handle 44877e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai * @state: state machine 44977e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai */ 45077e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaistruct _tr_list { 45177e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai struct list_head list; 45277e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u16 handle; 45377e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u16 state; 45477e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai}; 45577e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai 456635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr); 457635374e7eb110e80d9918b8611198edd56a32975Eric Moore 458635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 459635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct MPT2SAS_ADAPTER - per adapter struct 460635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @list: ioc_list 461635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @shost: shost object 462635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @id: unique adapter id 463635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @pci_irq: irq number 464635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @name: generic ioc string 465635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tmp_string: tmp string used for logging 466635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @pdev: pci pdev object 467635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chip: memory mapped register space 468635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chip_phys: physical addrss prior to mapping 469635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @logging_level: see mpt2sas_debug.h 470fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desai * @fwfault_debug: debuging FW timeouts 471635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ir_firmware: IR firmware present 472635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @bars: bitmask of BAR's that must be configured 473635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @mask_interrupts: ignore interrupt 474635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fault_reset_work_q_name: fw fault work queue 475635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fault_reset_work_q: "" 476635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fault_reset_work: "" 477635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @firmware_event_name: fw event work queue 478635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @firmware_event_thread: "" 479635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fw_events_off: flag to turn off fw event handling 480635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fw_event_lock: 481635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fw_event_list: list of fw events 482635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @aen_event_read_flag: event log was read 483635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @broadcast_aen_busy: broadcast aen waiting to be serviced 484155dd4c763694222c125e65438d823f58ea653bcKashyap, Desai * @shost_recovery: host reset in progress 485635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ioc_reset_in_progress_lock: 486635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ioc_link_reset_in_progress: phy/hard reset in progress 487635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ignore_loginfos: ignore loginfos during task managment 488635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @remove_host: flag for when driver unloads, to avoid sending dev resets 489635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @wait_for_port_enable_to_complete: 490635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @msix_enable: flag indicating msix is enabled 491635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @msix_vector_count: number msix vectors 492635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @msix_table: virt address to the msix table 493635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @msix_table_backup: backup msix table 494635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @scsi_io_cb_idx: shost generated commands 495635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tm_cb_idx: task management commands 496744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai * @scsih_cb_idx: scsih internal commands 497635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @transport_cb_idx: transport internal commands 498635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ctl_cb_idx: clt internal commands 499635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @base_cb_idx: base internal commands 500635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_cb_idx: base internal commands 501635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @base_cmds: 502635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @transport_cmds: 503744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai * @scsih_cmds: 504635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tm_cmds: 505635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ctl_cmds: 506635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_cmds: 507635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @base_add_sg_single: handler for either 32/64 bit sgl's 508635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_type: bits indicating which events to log 509635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_context: unique id for each logged event 510635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_log: event log pointer 511635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_masks: events that are masked 512635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @facts: static facts data 513635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @pfacts: static port facts data 514635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @manu_pg0: static manufacturing page 0 515ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai * @manu_pg10: static manufacturing page 10 516635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @bios_pg2: static bios page 2 517635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @bios_pg3: static bios page 3 518635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ioc_pg8: static ioc page 8 519635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @iounit_pg0: static iounit page 0 520635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @iounit_pg1: static iounit page 1 521635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_hba: sas host object 522635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_expander_list: expander object list 523635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_node_lock: 524635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_device_list: sas device object list 525635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_device_init_list: sas device object list (used only at init time) 526635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_device_lock: 527635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @io_missing_delay: time for IO completed by fw when PDR enabled 528635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_missing_delay: time for device missing by fw when PDR enabled 529635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_page_sz: config page size 530635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_page: reserve memory for config page payload 531635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_page_dma: 532595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hba_queue_depth: hba request queue depth 533635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sge_size: sg element size for either 32/64 bit 534595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @scsiio_depth: SCSI_IO queue depth 535635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request_sz: per request frame size 536635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request: pool of request frames 537635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request_dma: 538635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request_dma_sz: 539635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @scsi_lookup: firmware request tracker list 540635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @scsi_lookup_lock: 541635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @free_list: free list of request 542635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain: pool of chains 543635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @pending_io_count: 544635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reset_wq: 545635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_dma: 546635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @max_sges_in_main_message: number sg elements in main message 547635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @max_sges_in_chain_message: number sg elements per chain 548635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chains_needed_per_io: max chains per io 549635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_offset_value_for_main_message: location 1st sg in main 550635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_depth: total chains allocated 551595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority_smid: 552595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority: 553595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority_dma: 554595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority_depth: 555595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hpr_lookup: 556595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hpr_free_list: 557595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_smid: 558595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal: 559595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_dma: 560595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_depth: 561595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_lookup: 562595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_free_list: 563635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sense: pool of sense 564635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sense_dma: 565635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sense_dma_pool: 566635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_depth: hba reply queue depth: 567635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_sz: per reply frame size: 568635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply: pool of replys: 569635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_dma: 570635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_dma_pool: 571635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_queue_depth: reply free depth 572635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free: pool for reply free queue (32 bit addr) 573635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_dma: 574635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_dma_pool: 575635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_host_index: tail index in pool to insert free replys 576635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_queue_depth: reply post queue depth 577635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_free: pool for reply post (64bit descriptor) 578635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_free_dma: 579635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_free_dma_pool: 580635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_host_index: head index in the pool where FW completes IO 581635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 582635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct MPT2SAS_ADAPTER { 583635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head list; 584635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct Scsi_Host *shost; 585635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 id; 586635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 pci_irq; 587635374e7eb110e80d9918b8611198edd56a32975Eric Moore char name[MPT_NAME_LENGTH]; 588635374e7eb110e80d9918b8611198edd56a32975Eric Moore char tmp_string[MPT_STRING_LENGTH]; 589635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct pci_dev *pdev; 590635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2SystemInterfaceRegs_t __iomem *chip; 5916846e75cdfa76c6609ac0381a6739c9f4af8fd3bKashyap, Desai resource_size_t chip_phys; 592635374e7eb110e80d9918b8611198edd56a32975Eric Moore int logging_level; 593fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desai int fwfault_debug; 594635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ir_firmware; 595635374e7eb110e80d9918b8611198edd56a32975Eric Moore int bars; 596635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 mask_interrupts; 597635374e7eb110e80d9918b8611198edd56a32975Eric Moore 598635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* fw fault handler */ 599635374e7eb110e80d9918b8611198edd56a32975Eric Moore char fault_reset_work_q_name[20]; 600635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct workqueue_struct *fault_reset_work_q; 601635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct delayed_work fault_reset_work; 602635374e7eb110e80d9918b8611198edd56a32975Eric Moore 603635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* fw event handler */ 604635374e7eb110e80d9918b8611198edd56a32975Eric Moore char firmware_event_name[20]; 605635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct workqueue_struct *firmware_event_thread; 606635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 fw_events_off; 607635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t fw_event_lock; 608635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head fw_event_list; 609635374e7eb110e80d9918b8611198edd56a32975Eric Moore 610635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* misc flags */ 611635374e7eb110e80d9918b8611198edd56a32975Eric Moore int aen_event_read_flag; 612635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 broadcast_aen_busy; 613635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 shost_recovery; 614635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t ioc_reset_in_progress_lock; 615635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ioc_link_reset_in_progress; 616635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ignore_loginfos; 617635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 remove_host; 618635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 wait_for_port_enable_to_complete; 619635374e7eb110e80d9918b8611198edd56a32975Eric Moore 620635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 msix_enable; 621635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 msix_vector_count; 622635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 *msix_table; 623635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 *msix_table_backup; 624635374e7eb110e80d9918b8611198edd56a32975Eric Moore 625635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* internal commands, callback index */ 626635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 scsi_io_cb_idx; 627635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 tm_cb_idx; 628635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 transport_cb_idx; 629744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai u8 scsih_cb_idx; 630635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ctl_cb_idx; 631635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 base_cb_idx; 632635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 config_cb_idx; 63377e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u8 tm_tr_cb_idx; 63477e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u8 tm_sas_control_cb_idx; 635635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd base_cmds; 636635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd transport_cmds; 637744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai struct _internal_cmd scsih_cmds; 638635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd tm_cmds; 639635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd ctl_cmds; 640635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd config_cmds; 641635374e7eb110e80d9918b8611198edd56a32975Eric Moore 642635374e7eb110e80d9918b8611198edd56a32975Eric Moore MPT_ADD_SGE base_add_sg_single; 643635374e7eb110e80d9918b8611198edd56a32975Eric Moore 644635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* event log */ 645635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 event_type[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS]; 646635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 event_context; 647635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *event_log; 648635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 event_masks[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS]; 649635374e7eb110e80d9918b8611198edd56a32975Eric Moore 650635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* static config pages */ 651635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOCFactsReply_t facts; 652635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2PortFactsReply_t *pfacts; 653635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2ManufacturingPage0_t manu_pg0; 654635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2BiosPage2_t bios_pg2; 655635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2BiosPage3_t bios_pg3; 656635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOCPage8_t ioc_pg8; 657635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOUnitPage0_t iounit_pg0; 658635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOUnitPage1_t iounit_pg1; 659635374e7eb110e80d9918b8611198edd56a32975Eric Moore 660635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _boot_device req_boot_device; 661635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _boot_device req_alt_boot_device; 662635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _boot_device current_boot_device; 663635374e7eb110e80d9918b8611198edd56a32975Eric Moore 664635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* sas hba, expander, and device list */ 665635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _sas_node sas_hba; 666635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_expander_list; 667635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t sas_node_lock; 668635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_device_list; 669635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_device_init_list; 670635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t sas_device_lock; 671635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head raid_device_list; 672635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t raid_device_lock; 673635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 io_missing_delay; 674635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 device_missing_delay; 675635374e7eb110e80d9918b8611198edd56a32975Eric Moore int sas_id; 676635374e7eb110e80d9918b8611198edd56a32975Eric Moore 677635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* config page */ 678635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 config_page_sz; 679635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *config_page; 680635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t config_page_dma; 681635374e7eb110e80d9918b8611198edd56a32975Eric Moore 682595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai /* scsiio request */ 683595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 hba_queue_depth; 684635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 sge_size; 685595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 scsiio_depth; 686635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 request_sz; 687635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *request; 688635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t request_dma; 689635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 request_dma_sz; 690635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct request_tracker *scsi_lookup; 691635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t scsi_lookup_lock; 692635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head free_list; 693635374e7eb110e80d9918b8611198edd56a32975Eric Moore int pending_io_count; 694635374e7eb110e80d9918b8611198edd56a32975Eric Moore wait_queue_head_t reset_wq; 695635374e7eb110e80d9918b8611198edd56a32975Eric Moore 696635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* chain */ 697635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *chain; 698635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t chain_dma; 699635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 max_sges_in_main_message; 700635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 max_sges_in_chain_message; 701635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 chains_needed_per_io; 702635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 chain_offset_value_for_main_message; 703635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 chain_depth; 704635374e7eb110e80d9918b8611198edd56a32975Eric Moore 705595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai /* hi-priority queue */ 706595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 hi_priority_smid; 707595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u8 *hi_priority; 708595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai dma_addr_t hi_priority_dma; 709595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 hi_priority_depth; 710595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct request_tracker *hpr_lookup; 711595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct list_head hpr_free_list; 712595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 713595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai /* internal queue */ 714595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 internal_smid; 715595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u8 *internal; 716595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai dma_addr_t internal_dma; 717595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 internal_depth; 718595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct request_tracker *internal_lookup; 719595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct list_head internal_free_list; 720595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 721635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* sense */ 722635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *sense; 723635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t sense_dma; 724635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *sense_dma_pool; 725635374e7eb110e80d9918b8611198edd56a32975Eric Moore 726635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* reply */ 727635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 reply_sz; 728635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *reply; 729635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t reply_dma; 730635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *reply_dma_pool; 731635374e7eb110e80d9918b8611198edd56a32975Eric Moore 732635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* reply free queue */ 733635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 reply_free_queue_depth; 734635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 *reply_free; 735635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t reply_free_dma; 736635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *reply_free_dma_pool; 737635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 reply_free_host_index; 738635374e7eb110e80d9918b8611198edd56a32975Eric Moore 739635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* reply post queue */ 740635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 reply_post_queue_depth; 741635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2ReplyDescriptorsUnion_t *reply_post_free; 742635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t reply_post_free_dma; 743635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *reply_post_free_dma_pool; 744635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 reply_post_host_index; 745635374e7eb110e80d9918b8611198edd56a32975Eric Moore 74677e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai struct list_head delayed_tr_list; 74777e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai 748635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* diag buffer support */ 749635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *diag_buffer[MPI2_DIAG_BUF_TYPE_COUNT]; 750635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 diag_buffer_sz[MPI2_DIAG_BUF_TYPE_COUNT]; 751635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t diag_buffer_dma[MPI2_DIAG_BUF_TYPE_COUNT]; 752635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 diag_buffer_status[MPI2_DIAG_BUF_TYPE_COUNT]; 753635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 unique_id[MPI2_DIAG_BUF_TYPE_COUNT]; 754ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai Mpi2ManufacturingPage10_t manu_pg10; 755635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 product_specific[MPI2_DIAG_BUF_TYPE_COUNT][23]; 756635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; 757635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 758635374e7eb110e80d9918b8611198edd56a32975Eric Moore 75977e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaitypedef u8 (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 76077e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u32 reply); 761635374e7eb110e80d9918b8611198edd56a32975Eric Moore 762635374e7eb110e80d9918b8611198edd56a32975Eric Moore 763635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* base shared API */ 764ba33fadfabe88e838e73c76a6ff59546f5f6b92bEric Mooreextern struct list_head mpt2sas_ioc_list; 765e4750c989f732555fca86dd73d488c79972362dbKashyap, Desaivoid mpt2sas_base_start_watchdog(struct MPT2SAS_ADAPTER *ioc); 766e4750c989f732555fca86dd73d488c79972362dbKashyap, Desaivoid mpt2sas_base_stop_watchdog(struct MPT2SAS_ADAPTER *ioc); 767635374e7eb110e80d9918b8611198edd56a32975Eric Moore 768635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc); 769635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc); 770635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_map_resources(struct MPT2SAS_ADAPTER *ioc); 771635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_free_resources(struct MPT2SAS_ADAPTER *ioc); 772635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, 773635374e7eb110e80d9918b8611198edd56a32975Eric Moore enum reset_type type); 774635374e7eb110e80d9918b8611198edd56a32975Eric Moore 775635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid *mpt2sas_base_get_msg_frame(struct MPT2SAS_ADAPTER *ioc, u16 smid); 776635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid *mpt2sas_base_get_sense_buffer(struct MPT2SAS_ADAPTER *ioc, u16 smid); 777635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_build_zero_len_sge(struct MPT2SAS_ADAPTER *ioc, void *paddr); 778ec9472c74c3074541ea8389517f406b5c7ad0632Kashyap, Desai__le32 mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, 77977e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u16 smid); 780635374e7eb110e80d9918b8611198edd56a32975Eric Moore 781595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai/* hi-priority queue */ 782595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desaiu16 mpt2sas_base_get_smid_hpr(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); 783595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desaiu16 mpt2sas_base_get_smid_scsiio(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx, 784595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct scsi_cmnd *scmd); 785595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 786635374e7eb110e80d9918b8611198edd56a32975Eric Mooreu16 mpt2sas_base_get_smid(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); 787635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_free_smid(struct MPT2SAS_ADAPTER *ioc, u16 smid); 7887b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaivoid mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, 789635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle); 7907b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaivoid mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid); 791635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_put_smid_target_assist(struct MPT2SAS_ADAPTER *ioc, u16 smid, 7927b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u16 io_index); 7937b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaivoid mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid); 794635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_initialize_callback_handler(void); 795635374e7eb110e80d9918b8611198edd56a32975Eric Mooreu8 mpt2sas_base_register_callback_handler(MPT_CALLBACK cb_func); 796635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_release_callback_handler(u8 cb_idx); 797635374e7eb110e80d9918b8611198edd56a32975Eric Moore 79877e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 7997b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u32 reply); 800635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr); 801635374e7eb110e80d9918b8611198edd56a32975Eric Moore 802635374e7eb110e80d9918b8611198edd56a32975Eric Mooreu32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked); 803635374e7eb110e80d9918b8611198edd56a32975Eric Moore 804635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_fault_info(struct MPT2SAS_ADAPTER *ioc , u16 fault_code); 805635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc, 806635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2SasIoUnitControlReply_t *mpi_reply, Mpi2SasIoUnitControlRequest_t 807635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_request); 808635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc, 809635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2SepReply_t *mpi_reply, Mpi2SepRequest_t *mpi_request); 810635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_validate_event_type(struct MPT2SAS_ADAPTER *ioc, u32 *event_type); 811635374e7eb110e80d9918b8611198edd56a32975Eric Moore 812fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desaivoid mpt2sas_halt_firmware(struct MPT2SAS_ADAPTER *ioc); 813fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desai 814635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* scsih shared API */ 81577e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, 81677e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u32 reply); 817635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, uint lun, 818635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 type, u16 smid_task, ulong timeout); 819635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_scsih_set_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle); 820635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_scsih_clear_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle); 821635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_node *mpt2sas_scsih_expander_find_by_handle(struct MPT2SAS_ADAPTER *ioc, 822635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle); 823635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_node *mpt2sas_scsih_expander_find_by_sas_address(struct MPT2SAS_ADAPTER 824635374e7eb110e80d9918b8611198edd56a32975Eric Moore *ioc, u64 sas_address); 825635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address( 826635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct MPT2SAS_ADAPTER *ioc, u64 sas_address); 827635374e7eb110e80d9918b8611198edd56a32975Eric Moore 828635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); 829635374e7eb110e80d9918b8611198edd56a32975Eric Moore 830635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* config shared API */ 83177e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 8327b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u32 reply); 833635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys); 834635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, 835635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage0_t *config_page); 836ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desaiint mpt2sas_config_get_manufacturing_pg10(struct MPT2SAS_ADAPTER *ioc, 837ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage10_t *config_page); 838635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_bios_pg2(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 839635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2BiosPage2_t *config_page); 840635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_bios_pg3(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 841635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2BiosPage3_t *config_page); 842635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_iounit_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 843635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2IOUnitPage0_t *config_page); 844635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_sas_device_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 845635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasDevicePage0_t *config_page, u32 form, u32 handle); 846635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_sas_device_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 847635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasDevicePage1_t *config_page, u32 form, u32 handle); 848635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_sas_iounit_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 849635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasIOUnitPage0_t *config_page, u16 sz); 850635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 851635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2IOUnitPage1_t *config_page); 852635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_set_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 8535b768581ea722172f059ad5a5eebea9008961af0Kashyap, Desai *mpi_reply, Mpi2IOUnitPage1_t *config_page); 854635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_sas_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 855635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasIOUnitPage1_t *config_page, u16 sz); 85650d5c60634673a79f8d88564e10345b50fca7378Kashyap, Desaiint mpt2sas_config_set_sas_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, 85750d5c60634673a79f8d88564e10345b50fca7378Kashyap, Desai Mpi2ConfigReply_t *mpi_reply, Mpi2SasIOUnitPage1_t *config_page, u16 sz); 858635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_ioc_pg8(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 859635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2IOCPage8_t *config_page); 860635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_expander_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 861635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2ExpanderPage0_t *config_page, u32 form, u32 handle); 862635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_expander_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 863635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2ExpanderPage1_t *config_page, u32 phy_number, u16 handle); 864635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_enclosure_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 865635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasEnclosurePage0_t *config_page, u32 form, u32 handle); 866635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_phy_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 867635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasPhyPage0_t *config_page, u32 phy_number); 868635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_phy_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 869635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasPhyPage1_t *config_page, u32 phy_number); 870635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_raid_volume_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 871635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2RaidVolPage1_t *config_page, u32 form, u32 handle); 872635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_number_pds(struct MPT2SAS_ADAPTER *ioc, u16 handle, u8 *num_pds); 873635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_raid_volume_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 874635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2RaidVolPage0_t *config_page, u32 form, u32 handle, u16 sz); 875635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_phys_disk_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 876635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2RaidPhysDiskPage0_t *config_page, u32 form, 877635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 form_specific); 878635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_volume_handle(struct MPT2SAS_ADAPTER *ioc, u16 pd_handle, 879635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 *volume_handle); 880635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_volume_wwid(struct MPT2SAS_ADAPTER *ioc, u16 volume_handle, 881635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 *wwid); 882635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* ctl shared API */ 883635374e7eb110e80d9918b8611198edd56a32975Eric Mooreextern struct device_attribute *mpt2sas_host_attrs[]; 884635374e7eb110e80d9918b8611198edd56a32975Eric Mooreextern struct device_attribute *mpt2sas_dev_attrs[]; 885635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_ctl_init(void); 886635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_ctl_exit(void); 88777e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 8887b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u32 reply); 889635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_ctl_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); 89077e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, 8917b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u32 reply); 892635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc, 893635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2EventNotificationReply_t *mpi_reply); 894635374e7eb110e80d9918b8611198edd56a32975Eric Moore 89532e0eb569df09a8cb790cf370ee498721d88e5c6Kashyap, Desaivoid mpt2sas_enable_diag_buffer(struct MPT2SAS_ADAPTER *ioc, 89632e0eb569df09a8cb790cf370ee498721d88e5c6Kashyap, Desai u8 bits_to_regsiter); 89732e0eb569df09a8cb790cf370ee498721d88e5c6Kashyap, Desai 898635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* transport shared API */ 89977e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 90077e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u32 reply); 901635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_port *mpt2sas_transport_port_add(struct MPT2SAS_ADAPTER *ioc, 902c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u16 handle, u64 sas_address); 903635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_transport_port_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address, 904c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u64 sas_address_parent); 905635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_transport_add_host_phy(struct MPT2SAS_ADAPTER *ioc, struct _sas_phy 906635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpt2sas_phy, Mpi2SasPhyPage0_t phy_pg0, struct device *parent_dev); 907635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_transport_add_expander_phy(struct MPT2SAS_ADAPTER *ioc, struct _sas_phy 908635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpt2sas_phy, Mpi2ExpanderPage1_t expander_pg1, struct device *parent_dev); 909c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desaivoid mpt2sas_transport_update_links(struct MPT2SAS_ADAPTER *ioc, 910c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u64 sas_address, u16 handle, u8 phy_number, u8 link_rate); 911635374e7eb110e80d9918b8611198edd56a32975Eric Mooreextern struct sas_function_template mpt2sas_transport_functions; 912635374e7eb110e80d9918b8611198edd56a32975Eric Mooreextern struct scsi_transport_template *mpt2sas_transport_template; 91334a03bef2202d0c9983a8da0a8abaee37d285847Kashyap, Desaiextern int scsi_internal_device_block(struct scsi_device *sdev); 91477e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiextern u8 mpt2sas_stm_zero_smid_handler(struct MPT2SAS_ADAPTER *ioc, 91577e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u8 msix_index, u32 reply); 91634a03bef2202d0c9983a8da0a8abaee37d285847Kashyap, Desaiextern int scsi_internal_device_unblock(struct scsi_device *sdev); 917635374e7eb110e80d9918b8611198edd56a32975Eric Moore 918635374e7eb110e80d9918b8611198edd56a32975Eric Moore#endif /* MPT2SAS_BASE_H_INCLUDED */ 919