mpt2sas_base.h revision d4572c3dbb00fa47b9e8cd496f12a8ec9e9b66c3
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 631b7f2e25d4b30d9b8701a6820c8e521cf409c29Kashyap, Desai * Copyright (C) 2007-2010 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" 72d4572c3dbb00fa47b9e8cd496f12a8ec9e9b66c3Kashyap, Desai#define MPT2SAS_DRIVER_VERSION "06.100.00.00" 73d4572c3dbb00fa47b9e8cd496f12a8ec9e9b66c3Kashyap, Desai#define MPT2SAS_MAJOR_VERSION 06 74635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_MINOR_VERSION 100 751a7d7eac6f651c00e954023dd2542f0c65ef66b7Kashyap, Desai#define MPT2SAS_BUILD_VERSION 00 76d4572c3dbb00fa47b9e8cd496f12a8ec9e9b66c3Kashyap, Desai#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 */ 122635374e7eb110e80d9918b8611198edd56a32975Eric Moore 123635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 124635374e7eb110e80d9918b8611198edd56a32975Eric Moore * logging format 125635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 126635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_FMT "%s: " 127635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_INFO_FMT KERN_INFO MPT2SAS_FMT 128635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_NOTE_FMT KERN_NOTICE MPT2SAS_FMT 129635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_WARN_FMT KERN_WARNING MPT2SAS_FMT 130635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_ERR_FMT KERN_ERR MPT2SAS_FMT 131635374e7eb110e80d9918b8611198edd56a32975Eric Moore 132635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 133f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore * Dell HBA branding 134f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore */ 135f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_BRANDING_SIZE 32 136f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore 137f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_6GBPS_SAS_HBA_BRANDING "Dell 6Gbps SAS HBA" 138f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_ADAPTER_BRANDING "Dell PERC H200 Adapter" 139f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_INTEGRATED_BRANDING "Dell PERC H200 Integrated" 140f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_MODULAR_BRANDING "Dell PERC H200 Modular" 141f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_EMBEDDED_BRANDING "Dell PERC H200 Embedded" 142f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_BRANDING "Dell PERC H200" 143f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_6GBPS_SAS_BRANDING "Dell 6Gbps SAS" 144f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore 145f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore/* 146f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore * Dell HBA SSDIDs 147f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore */ 148f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_6GBPS_SAS_HBA_SSDID 0x1F1C 149f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_ADAPTER_SSDID 0x1F1D 150f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_INTEGRATED_SSDID 0x1F1E 151f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_MODULAR_SSDID 0x1F1F 152f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_EMBEDDED_SSDID 0x1F20 153f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_PERC_H200_SSDID 0x1F21 154f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore#define MPT2SAS_DELL_6GBPS_SAS_SSDID 0x1F22 155f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore 156f0f9cc1fb8a21f3ff90900505fc82a43d29d0975Eric Moore/* 157635374e7eb110e80d9918b8611198edd56a32975Eric Moore * per target private data 158635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 159635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_TARGET_FLAGS_RAID_COMPONENT 0x01 160635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_TARGET_FLAGS_VOLUME 0x02 161635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_TARGET_FLAGS_DELETED 0x04 162635374e7eb110e80d9918b8611198edd56a32975Eric Moore 163635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 164635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct MPT2SAS_TARGET - starget private hostdata 165635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @starget: starget object 166635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_address: target sas address 167635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: device handle 168635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @num_luns: number luns 169635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @flags: MPT_TARGET_FLAGS_XXX flags 170635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @deleted: target flaged for deletion 171635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tm_busy: target is busy with TM request. 172635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 173635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct MPT2SAS_TARGET { 174635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_target *starget; 175635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 sas_address; 176635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 177635374e7eb110e80d9918b8611198edd56a32975Eric Moore int num_luns; 178635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 flags; 179635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 deleted; 180635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 tm_busy; 181635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 182635374e7eb110e80d9918b8611198edd56a32975Eric Moore 183635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* 184635374e7eb110e80d9918b8611198edd56a32975Eric Moore * per device private data 185635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 186635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_DEVICE_FLAGS_INIT 0x01 187635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT_DEVICE_TLR_ON 0x02 188635374e7eb110e80d9918b8611198edd56a32975Eric Moore 189635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 190635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct MPT2SAS_DEVICE - sdev private hostdata 191635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_target: starget private hostdata 192635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @lun: lun number 193635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @flags: MPT_DEVICE_XXX flags 194635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @configured_lun: lun is configured 195635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @block: device is in SDEV_BLOCK state 196635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tlr_snoop_check: flag used in determining whether to disable TLR 197635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 198ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai 199ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai/* OEM Identifiers */ 200ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_OEM_ID_INVALID (0x00000000) 201ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_OEM_ID_DELL (0x00000001) 202ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_OEM_ID_FSC (0x00000002) 203ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_OEM_ID_SUN (0x00000003) 204ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_OEM_ID_IBM (0x00000004) 205ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai 206ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai/* GENERIC Flags 0*/ 207ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_GF0_OCE_DISABLED (0x00000001) 208ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_GF0_R1E_DRIVE_COUNT (0x00000002) 209ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_GF0_R10_DISPLAY (0x00000004) 210ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_GF0_SSD_DATA_SCRUB_DISABLE (0x00000008) 211ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai#define MFG10_GF0_SINGLE_DRIVE_R0 (0x00000010) 212ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai 213ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai/* OEM Specific Flags will come from OEM specific header files */ 214ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desaitypedef struct _MPI2_CONFIG_PAGE_MAN_10 { 215ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai MPI2_CONFIG_PAGE_HEADER Header; /* 00h */ 216ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U8 OEMIdentifier; /* 04h */ 217ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U8 Reserved1; /* 05h */ 218ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U16 Reserved2; /* 08h */ 219ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 Reserved3; /* 0Ch */ 220ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 GenericFlags0; /* 10h */ 221ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 GenericFlags1; /* 14h */ 222ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 Reserved4; /* 18h */ 223ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 OEMSpecificFlags0; /* 1Ch */ 224ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 OEMSpecificFlags1; /* 20h */ 225ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai U32 Reserved5[18]; /* 24h-60h*/ 226ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai} MPI2_CONFIG_PAGE_MAN_10, 227ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_10, 228ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai Mpi2ManufacturingPage10_t, MPI2_POINTER pMpi2ManufacturingPage10_t; 229ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai 230635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct MPT2SAS_DEVICE { 231635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct MPT2SAS_TARGET *sas_target; 232635374e7eb110e80d9918b8611198edd56a32975Eric Moore unsigned int lun; 233635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 flags; 234635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 configured_lun; 235635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 block; 236635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 tlr_snoop_check; 237635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 238635374e7eb110e80d9918b8611198edd56a32975Eric Moore 239635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_CMD_NOT_USED 0x8000 /* free */ 240635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_CMD_COMPLETE 0x0001 /* completed */ 241635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_CMD_PENDING 0x0002 /* pending */ 242635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_CMD_REPLY_VALID 0x0004 /* reply is valid */ 243635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2_CMD_RESET 0x0008 /* host reset dropped the command */ 244635374e7eb110e80d9918b8611198edd56a32975Eric Moore 245635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 246635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _internal_cmd - internal commands struct 247635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @mutex: mutex 248635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @done: completion 249635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply: reply message pointer 250769578ff811e43ccddd96b15640fa7c9df65c374Kashyap, Desai * @sense: sense data 251635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @status: MPT2_CMD_XXX status 252635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @smid: system message id 253635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 254635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _internal_cmd { 255635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct mutex mutex; 256635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct completion done; 257635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *reply; 258769578ff811e43ccddd96b15640fa7c9df65c374Kashyap, Desai void *sense; 259635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 status; 260635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 smid; 261635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 262635374e7eb110e80d9918b8611198edd56a32975Eric Moore 263595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 264635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 265635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _sas_device - attached device information 266635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @list: sas device list 267635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @starget: starget object 268635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_address: device sas address 269635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_name: retrieved from the SAS IDENTIFY frame. 270635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: device handle 271c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai * @sas_address_parent: sas address of parent expander or sas host 272635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @enclosure_handle: enclosure handle 273635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @enclosure_logical_id: enclosure logical identifier 274635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @volume_handle: volume handle (valid when hidden raid member) 275635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @volume_wwid: volume unique identifier 276635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_info: bitfield provides detailed info about the device 277635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @id: target id 278635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @channel: target channel 279635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @slot: number number 2807fbae67a3faa90abcbe949f1494769c84e51e189Kashyap, Desai * @phy: phy identifier provided in sas device page 0 281635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @responding: used in _scsih_sas_device_mark_responding 282635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 283635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_device { 284635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head list; 285635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_target *starget; 286635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 sas_address; 287635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 device_name; 288635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 289c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u64 sas_address_parent; 290635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 enclosure_handle; 291635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 enclosure_logical_id; 292635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 volume_handle; 293635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 volume_wwid; 294635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 device_info; 295635374e7eb110e80d9918b8611198edd56a32975Eric Moore int id; 296635374e7eb110e80d9918b8611198edd56a32975Eric Moore int channel; 297635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 slot; 2987fbae67a3faa90abcbe949f1494769c84e51e189Kashyap, Desai u8 phy; 299635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 responding; 300635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 301635374e7eb110e80d9918b8611198edd56a32975Eric Moore 302635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 303635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _raid_device - raid volume link list 304635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @list: sas device list 305635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @starget: starget object 306635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sdev: scsi device struct (volumes are single lun) 307635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @wwid: unique identifier for the volume 308635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: device handle 309635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @id: target id 310635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @channel: target channel 311635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @volume_type: the raid level 312635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_info: bitfield provides detailed info about the hidden components 313635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @num_pds: number of hidden raid components 314635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @responding: used in _scsih_raid_device_mark_responding 315f7c95ef02b564d9984c0655c9659791b1dd5d7adKashyap, Desai * @percent_complete: resync percent complete 316635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 317635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _raid_device { 318635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head list; 319635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_target *starget; 320635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_device *sdev; 321635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 wwid; 322635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 323635374e7eb110e80d9918b8611198edd56a32975Eric Moore int id; 324635374e7eb110e80d9918b8611198edd56a32975Eric Moore int channel; 325635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 volume_type; 326635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 device_info; 327635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 num_pds; 328635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 responding; 329f7c95ef02b564d9984c0655c9659791b1dd5d7adKashyap, Desai u8 percent_complete; 330635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 331635374e7eb110e80d9918b8611198edd56a32975Eric Moore 332635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 333635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _boot_device - boot device info 334635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @is_raid: flag to indicate whether this is volume 335635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device: holds pointer for either struct _sas_device or 336635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _raid_device 337635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 338635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _boot_device { 339635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 is_raid; 340635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *device; 341635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 342635374e7eb110e80d9918b8611198edd56a32975Eric Moore 343635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 344635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _sas_port - wide/narrow sas port information 345635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @port_list: list of ports belonging to expander 346635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @num_phys: number of phys belonging to this port 347635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @remote_identify: attached device identification 348635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @rphy: sas transport rphy object 349635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @port: sas transport wide/narrow port object 350635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @phy_list: _sas_phy list objects belonging to this port 351635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 352635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_port { 353635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head port_list; 354635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 num_phys; 355635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_identify remote_identify; 356635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_rphy *rphy; 357635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_port *port; 358635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head phy_list; 359635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 360635374e7eb110e80d9918b8611198edd56a32975Eric Moore 361635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 362635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _sas_phy - phy information 363635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @port_siblings: list of phys belonging to a port 364635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @identify: phy identification 365635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @remote_identify: attached device identification 366635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @phy: sas transport phy object 367635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @phy_id: unique phy id 368635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: device handle for this phy 369635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @attached_handle: device handle for attached device 37038c2911449b19664e0dc46132a7b4cb249ff5e06Kashyap, Desai * @phy_belongs_to_port: port has been created for this phy 371635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 372635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_phy { 373635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head port_siblings; 374635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_identify identify; 375635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_identify remote_identify; 376635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct sas_phy *phy; 377635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 phy_id; 378635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 379635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 attached_handle; 38038c2911449b19664e0dc46132a7b4cb249ff5e06Kashyap, Desai u8 phy_belongs_to_port; 381635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 382635374e7eb110e80d9918b8611198edd56a32975Eric Moore 383635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 384635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _sas_node - sas_host/expander information 385635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @list: list of expanders 386635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @parent_dev: parent device class 387635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @num_phys: number phys belonging to this sas_host/expander 388635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_address: sas address of this sas_host/expander 389635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: handle for this sas_host/expander 390c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai * @sas_address_parent: sas address of parent expander or sas host 391635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @enclosure_handle: handle for this a member of an enclosure 392635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_info: bitwise defining capabilities of this sas_host/expander 393635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @responding: used in _scsih_expander_device_mark_responding 394635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @phy: a list of phys that make up this sas_host/expander 395635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_port_list: list of ports attached to this sas_host/expander 396635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 397635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_node { 398635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head list; 399635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct device *parent_dev; 400635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 num_phys; 401635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 sas_address; 402635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 403c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u64 sas_address_parent; 404635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 enclosure_handle; 405635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 enclosure_logical_id; 406635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 responding; 407635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _sas_phy *phy; 408635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_port_list; 409635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 410635374e7eb110e80d9918b8611198edd56a32975Eric Moore 411635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 412635374e7eb110e80d9918b8611198edd56a32975Eric Moore * enum reset_type - reset state 413635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @FORCE_BIG_HAMMER: issue diagnostic reset 414635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @SOFT_RESET: issue message_unit_reset, if fails to to big hammer 415635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 416635374e7eb110e80d9918b8611198edd56a32975Eric Mooreenum reset_type { 417635374e7eb110e80d9918b8611198edd56a32975Eric Moore FORCE_BIG_HAMMER, 418635374e7eb110e80d9918b8611198edd56a32975Eric Moore SOFT_RESET, 419635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 420635374e7eb110e80d9918b8611198edd56a32975Eric Moore 421635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 422635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct request_tracker - firmware request tracker 423635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @smid: system message id 424635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @scmd: scsi request pointer 425635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @cb_idx: callback index 426635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_list: list of chains associated to this IO 427635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tracker_list: list of free request (ioc->free_list) 428635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 429635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct request_tracker { 430635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 smid; 431635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_cmnd *scmd; 432635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 cb_idx; 433635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head tracker_list; 434635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 435635374e7eb110e80d9918b8611198edd56a32975Eric Moore 43677e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai/** 43777e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai * struct _tr_list - target reset list 43877e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai * @handle: device handle 43977e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai * @state: state machine 44077e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai */ 44177e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaistruct _tr_list { 44277e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai struct list_head list; 44377e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u16 handle; 44477e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u16 state; 44577e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai}; 44677e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai 447635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr); 448635374e7eb110e80d9918b8611198edd56a32975Eric Moore 449635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 450635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct MPT2SAS_ADAPTER - per adapter struct 451635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @list: ioc_list 452635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @shost: shost object 453635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @id: unique adapter id 454635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @pci_irq: irq number 455635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @name: generic ioc string 456635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tmp_string: tmp string used for logging 457635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @pdev: pci pdev object 458635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chip: memory mapped register space 459635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chip_phys: physical addrss prior to mapping 460635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @logging_level: see mpt2sas_debug.h 461fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desai * @fwfault_debug: debuging FW timeouts 462635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ir_firmware: IR firmware present 463635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @bars: bitmask of BAR's that must be configured 464635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @mask_interrupts: ignore interrupt 465635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fault_reset_work_q_name: fw fault work queue 466635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fault_reset_work_q: "" 467635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fault_reset_work: "" 468635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @firmware_event_name: fw event work queue 469635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @firmware_event_thread: "" 470635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fw_events_off: flag to turn off fw event handling 471635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fw_event_lock: 472635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @fw_event_list: list of fw events 473635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @aen_event_read_flag: event log was read 474635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @broadcast_aen_busy: broadcast aen waiting to be serviced 475155dd4c763694222c125e65438d823f58ea653bcKashyap, Desai * @shost_recovery: host reset in progress 476635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ioc_reset_in_progress_lock: 477635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ioc_link_reset_in_progress: phy/hard reset in progress 478635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ignore_loginfos: ignore loginfos during task managment 479635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @remove_host: flag for when driver unloads, to avoid sending dev resets 480635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @wait_for_port_enable_to_complete: 481635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @msix_enable: flag indicating msix is enabled 482635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @msix_vector_count: number msix vectors 483635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @msix_table: virt address to the msix table 484635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @msix_table_backup: backup msix table 485635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @scsi_io_cb_idx: shost generated commands 486635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tm_cb_idx: task management commands 487744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai * @scsih_cb_idx: scsih internal commands 488635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @transport_cb_idx: transport internal commands 489635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ctl_cb_idx: clt internal commands 490635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @base_cb_idx: base internal commands 491635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_cb_idx: base internal commands 492f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai * @tm_tr_cb_idx : device removal target reset handshake 493f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai * @tm_tr_volume_cb_idx : volume removal target reset 494635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @base_cmds: 495635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @transport_cmds: 496744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai * @scsih_cmds: 497635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tm_cmds: 498635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ctl_cmds: 499635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_cmds: 500635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @base_add_sg_single: handler for either 32/64 bit sgl's 501635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_type: bits indicating which events to log 502635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_context: unique id for each logged event 503635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_log: event log pointer 504635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_masks: events that are masked 505635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @facts: static facts data 506635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @pfacts: static port facts data 507635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @manu_pg0: static manufacturing page 0 508ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai * @manu_pg10: static manufacturing page 10 509635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @bios_pg2: static bios page 2 510635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @bios_pg3: static bios page 3 511635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ioc_pg8: static ioc page 8 512635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @iounit_pg0: static iounit page 0 513635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @iounit_pg1: static iounit page 1 514635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_hba: sas host object 515635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_expander_list: expander object list 516635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_node_lock: 517635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_device_list: sas device object list 518635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_device_init_list: sas device object list (used only at init time) 519635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_device_lock: 520635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @io_missing_delay: time for IO completed by fw when PDR enabled 521635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_missing_delay: time for device missing by fw when PDR enabled 522f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai * @sas_id : used for setting volume target IDs 523f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai * @pd_handles : bitmask for PD handles 524f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai * @pd_handles_sz : size of pd_handle bitmask 525635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_page_sz: config page size 526635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_page: reserve memory for config page payload 527635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_page_dma: 528595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hba_queue_depth: hba request queue depth 529635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sge_size: sg element size for either 32/64 bit 530595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @scsiio_depth: SCSI_IO queue depth 531635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request_sz: per request frame size 532635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request: pool of request frames 533635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request_dma: 534635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request_dma_sz: 535635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @scsi_lookup: firmware request tracker list 536635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @scsi_lookup_lock: 537635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @free_list: free list of request 538635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain: pool of chains 539635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @pending_io_count: 540635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reset_wq: 541635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_dma: 542635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @max_sges_in_main_message: number sg elements in main message 543635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @max_sges_in_chain_message: number sg elements per chain 544635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chains_needed_per_io: max chains per io 545635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_offset_value_for_main_message: location 1st sg in main 546635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_depth: total chains allocated 547595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority_smid: 548595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority: 549595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority_dma: 550595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority_depth: 551595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hpr_lookup: 552595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hpr_free_list: 553595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_smid: 554595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal: 555595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_dma: 556595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_depth: 557595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_lookup: 558595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_free_list: 559635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sense: pool of sense 560635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sense_dma: 561635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sense_dma_pool: 562635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_depth: hba reply queue depth: 563635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_sz: per reply frame size: 564635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply: pool of replys: 565635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_dma: 566635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_dma_pool: 567635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_queue_depth: reply free depth 568635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free: pool for reply free queue (32 bit addr) 569635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_dma: 570635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_dma_pool: 571635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_host_index: tail index in pool to insert free replys 572635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_queue_depth: reply post queue depth 573635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_free: pool for reply post (64bit descriptor) 574635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_free_dma: 575635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_free_dma_pool: 576635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_host_index: head index in the pool where FW completes IO 577f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai * @delayed_tr_list: target reset link list 578f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai * @delayed_tr_volume_list: volume target reset link list 579635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 580635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct MPT2SAS_ADAPTER { 581635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head list; 582635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct Scsi_Host *shost; 583635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 id; 584635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 pci_irq; 585635374e7eb110e80d9918b8611198edd56a32975Eric Moore char name[MPT_NAME_LENGTH]; 586635374e7eb110e80d9918b8611198edd56a32975Eric Moore char tmp_string[MPT_STRING_LENGTH]; 587635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct pci_dev *pdev; 588635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2SystemInterfaceRegs_t __iomem *chip; 5896846e75cdfa76c6609ac0381a6739c9f4af8fd3bKashyap, Desai resource_size_t chip_phys; 590635374e7eb110e80d9918b8611198edd56a32975Eric Moore int logging_level; 591fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desai int fwfault_debug; 592635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ir_firmware; 593635374e7eb110e80d9918b8611198edd56a32975Eric Moore int bars; 594635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 mask_interrupts; 595635374e7eb110e80d9918b8611198edd56a32975Eric Moore 596635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* fw fault handler */ 597635374e7eb110e80d9918b8611198edd56a32975Eric Moore char fault_reset_work_q_name[20]; 598635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct workqueue_struct *fault_reset_work_q; 599635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct delayed_work fault_reset_work; 600635374e7eb110e80d9918b8611198edd56a32975Eric Moore 601635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* fw event handler */ 602635374e7eb110e80d9918b8611198edd56a32975Eric Moore char firmware_event_name[20]; 603635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct workqueue_struct *firmware_event_thread; 604635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t fw_event_lock; 605635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head fw_event_list; 606635374e7eb110e80d9918b8611198edd56a32975Eric Moore 607635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* misc flags */ 608635374e7eb110e80d9918b8611198edd56a32975Eric Moore int aen_event_read_flag; 609635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 broadcast_aen_busy; 610635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 shost_recovery; 611d274213a1ae59e8abde8d43e1e3a478fe9f28794Kashyap, Desai 612d274213a1ae59e8abde8d43e1e3a478fe9f28794Kashyap, Desai struct mutex reset_in_progress_mutex; 613f1c35e6aea579d5bdb6dc02dfa99c67c7c3b3f67Kashyap, Desai struct completion shost_recovery_done; 614635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t ioc_reset_in_progress_lock; 615635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ioc_link_reset_in_progress; 616d274213a1ae59e8abde8d43e1e3a478fe9f28794Kashyap, Desai int ioc_reset_in_progress_status; 617d274213a1ae59e8abde8d43e1e3a478fe9f28794Kashyap, Desai 618635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ignore_loginfos; 619635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 remove_host; 620635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 wait_for_port_enable_to_complete; 621635374e7eb110e80d9918b8611198edd56a32975Eric Moore 622635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 msix_enable; 623635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 msix_vector_count; 624635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 *msix_table; 625635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 *msix_table_backup; 626d32a8c15e1116e87f0105356eca1afb99842ab49Kashyap, Desai u32 ioc_reset_count; 627635374e7eb110e80d9918b8611198edd56a32975Eric Moore 628635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* internal commands, callback index */ 629635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 scsi_io_cb_idx; 630635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 tm_cb_idx; 631635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 transport_cb_idx; 632744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai u8 scsih_cb_idx; 633635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ctl_cb_idx; 634635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 base_cb_idx; 635635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 config_cb_idx; 63677e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u8 tm_tr_cb_idx; 637f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai u8 tm_tr_volume_cb_idx; 63877e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u8 tm_sas_control_cb_idx; 639635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd base_cmds; 640635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd transport_cmds; 641744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai struct _internal_cmd scsih_cmds; 642635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd tm_cmds; 643635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd ctl_cmds; 644635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd config_cmds; 645635374e7eb110e80d9918b8611198edd56a32975Eric Moore 646635374e7eb110e80d9918b8611198edd56a32975Eric Moore MPT_ADD_SGE base_add_sg_single; 647635374e7eb110e80d9918b8611198edd56a32975Eric Moore 648635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* event log */ 649635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 event_type[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS]; 650635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 event_context; 651635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *event_log; 652635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 event_masks[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS]; 653635374e7eb110e80d9918b8611198edd56a32975Eric Moore 654635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* static config pages */ 655635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOCFactsReply_t facts; 656635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2PortFactsReply_t *pfacts; 657635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2ManufacturingPage0_t manu_pg0; 658635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2BiosPage2_t bios_pg2; 659635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2BiosPage3_t bios_pg3; 660635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOCPage8_t ioc_pg8; 661635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOUnitPage0_t iounit_pg0; 662635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOUnitPage1_t iounit_pg1; 663635374e7eb110e80d9918b8611198edd56a32975Eric Moore 664635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _boot_device req_boot_device; 665635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _boot_device req_alt_boot_device; 666635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _boot_device current_boot_device; 667635374e7eb110e80d9918b8611198edd56a32975Eric Moore 668635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* sas hba, expander, and device list */ 669635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _sas_node sas_hba; 670635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_expander_list; 671635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t sas_node_lock; 672635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_device_list; 673635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_device_init_list; 674635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t sas_device_lock; 675635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head raid_device_list; 676635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t raid_device_lock; 677635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 io_missing_delay; 678635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 device_missing_delay; 679635374e7eb110e80d9918b8611198edd56a32975Eric Moore int sas_id; 680635374e7eb110e80d9918b8611198edd56a32975Eric Moore 681f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai void *pd_handles; 682f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai u16 pd_handles_sz; 683f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai 684635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* config page */ 685635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 config_page_sz; 686635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *config_page; 687635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t config_page_dma; 688635374e7eb110e80d9918b8611198edd56a32975Eric Moore 689595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai /* scsiio request */ 690595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 hba_queue_depth; 691635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 sge_size; 692595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 scsiio_depth; 693635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 request_sz; 694635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *request; 695635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t request_dma; 696635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 request_dma_sz; 697635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct request_tracker *scsi_lookup; 69889009fbb7d2df37536c8dc932fdead4189783f92Kashyap, Desai ulong scsi_lookup_pages; 69989009fbb7d2df37536c8dc932fdead4189783f92Kashyap, Desai spinlock_t scsi_lookup_lock; 700635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head free_list; 701635374e7eb110e80d9918b8611198edd56a32975Eric Moore int pending_io_count; 702635374e7eb110e80d9918b8611198edd56a32975Eric Moore wait_queue_head_t reset_wq; 703635374e7eb110e80d9918b8611198edd56a32975Eric Moore 704635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* chain */ 705635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *chain; 706635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t chain_dma; 707635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 max_sges_in_main_message; 708635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 max_sges_in_chain_message; 709635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 chains_needed_per_io; 710635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 chain_offset_value_for_main_message; 71189009fbb7d2df37536c8dc932fdead4189783f92Kashyap, Desai u32 chain_depth; 712635374e7eb110e80d9918b8611198edd56a32975Eric Moore 713595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai /* hi-priority queue */ 714595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 hi_priority_smid; 715595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u8 *hi_priority; 716595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai dma_addr_t hi_priority_dma; 717595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 hi_priority_depth; 718595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct request_tracker *hpr_lookup; 719595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct list_head hpr_free_list; 720595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 721595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai /* internal queue */ 722595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 internal_smid; 723595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u8 *internal; 724595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai dma_addr_t internal_dma; 725595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 internal_depth; 726595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct request_tracker *internal_lookup; 727595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct list_head internal_free_list; 728595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 729635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* sense */ 730635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *sense; 731635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t sense_dma; 732635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *sense_dma_pool; 733635374e7eb110e80d9918b8611198edd56a32975Eric Moore 734635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* reply */ 735635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 reply_sz; 736635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *reply; 737635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t reply_dma; 738635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *reply_dma_pool; 739635374e7eb110e80d9918b8611198edd56a32975Eric Moore 740635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* reply free queue */ 741635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 reply_free_queue_depth; 742635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 *reply_free; 743635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t reply_free_dma; 744635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *reply_free_dma_pool; 745635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 reply_free_host_index; 746635374e7eb110e80d9918b8611198edd56a32975Eric Moore 747635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* reply post queue */ 748635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 reply_post_queue_depth; 749635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2ReplyDescriptorsUnion_t *reply_post_free; 750635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t reply_post_free_dma; 751635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *reply_post_free_dma_pool; 752635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 reply_post_host_index; 753635374e7eb110e80d9918b8611198edd56a32975Eric Moore 75477e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai struct list_head delayed_tr_list; 755f3eedd698ebafd0fe8a292672604a2db61c2c00aKashyap, Desai struct list_head delayed_tr_volume_list; 75677e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai 757635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* diag buffer support */ 758635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *diag_buffer[MPI2_DIAG_BUF_TYPE_COUNT]; 759635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 diag_buffer_sz[MPI2_DIAG_BUF_TYPE_COUNT]; 760635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t diag_buffer_dma[MPI2_DIAG_BUF_TYPE_COUNT]; 761635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 diag_buffer_status[MPI2_DIAG_BUF_TYPE_COUNT]; 762635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 unique_id[MPI2_DIAG_BUF_TYPE_COUNT]; 763ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai Mpi2ManufacturingPage10_t manu_pg10; 764635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 product_specific[MPI2_DIAG_BUF_TYPE_COUNT][23]; 765635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; 766570c67ac443dab5c46e5744e950f0539724cb65dKashyap, Desai u32 ring_buffer_offset; 767570c67ac443dab5c46e5744e950f0539724cb65dKashyap, Desai u32 ring_buffer_sz; 768635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 769635374e7eb110e80d9918b8611198edd56a32975Eric Moore 77077e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaitypedef u8 (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 77177e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u32 reply); 772635374e7eb110e80d9918b8611198edd56a32975Eric Moore 773635374e7eb110e80d9918b8611198edd56a32975Eric Moore 774635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* base shared API */ 775ba33fadfabe88e838e73c76a6ff59546f5f6b92bEric Mooreextern struct list_head mpt2sas_ioc_list; 776e4750c989f732555fca86dd73d488c79972362dbKashyap, Desaivoid mpt2sas_base_start_watchdog(struct MPT2SAS_ADAPTER *ioc); 777e4750c989f732555fca86dd73d488c79972362dbKashyap, Desaivoid mpt2sas_base_stop_watchdog(struct MPT2SAS_ADAPTER *ioc); 778635374e7eb110e80d9918b8611198edd56a32975Eric Moore 779635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc); 780635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc); 781635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_map_resources(struct MPT2SAS_ADAPTER *ioc); 782635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_free_resources(struct MPT2SAS_ADAPTER *ioc); 783635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, 784635374e7eb110e80d9918b8611198edd56a32975Eric Moore enum reset_type type); 785635374e7eb110e80d9918b8611198edd56a32975Eric Moore 786635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid *mpt2sas_base_get_msg_frame(struct MPT2SAS_ADAPTER *ioc, u16 smid); 787635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid *mpt2sas_base_get_sense_buffer(struct MPT2SAS_ADAPTER *ioc, u16 smid); 788635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_build_zero_len_sge(struct MPT2SAS_ADAPTER *ioc, void *paddr); 789ec9472c74c3074541ea8389517f406b5c7ad0632Kashyap, Desai__le32 mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, 79077e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u16 smid); 791635374e7eb110e80d9918b8611198edd56a32975Eric Moore 792595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai/* hi-priority queue */ 793595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desaiu16 mpt2sas_base_get_smid_hpr(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); 794595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desaiu16 mpt2sas_base_get_smid_scsiio(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx, 795595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct scsi_cmnd *scmd); 796595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 797635374e7eb110e80d9918b8611198edd56a32975Eric Mooreu16 mpt2sas_base_get_smid(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); 798635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_free_smid(struct MPT2SAS_ADAPTER *ioc, u16 smid); 7997b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaivoid mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, 800635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle); 8017b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaivoid mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid); 802635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_put_smid_target_assist(struct MPT2SAS_ADAPTER *ioc, u16 smid, 8037b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u16 io_index); 8047b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaivoid mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid); 805635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_initialize_callback_handler(void); 806635374e7eb110e80d9918b8611198edd56a32975Eric Mooreu8 mpt2sas_base_register_callback_handler(MPT_CALLBACK cb_func); 807635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_release_callback_handler(u8 cb_idx); 808635374e7eb110e80d9918b8611198edd56a32975Eric Moore 80977e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 8107b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u32 reply); 811635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr); 812635374e7eb110e80d9918b8611198edd56a32975Eric Moore 813635374e7eb110e80d9918b8611198edd56a32975Eric Mooreu32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked); 814635374e7eb110e80d9918b8611198edd56a32975Eric Moore 815635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_fault_info(struct MPT2SAS_ADAPTER *ioc , u16 fault_code); 816635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc, 817635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2SasIoUnitControlReply_t *mpi_reply, Mpi2SasIoUnitControlRequest_t 818635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_request); 819635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc, 820635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2SepReply_t *mpi_reply, Mpi2SepRequest_t *mpi_request); 821635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_validate_event_type(struct MPT2SAS_ADAPTER *ioc, u32 *event_type); 822635374e7eb110e80d9918b8611198edd56a32975Eric Moore 823fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desaivoid mpt2sas_halt_firmware(struct MPT2SAS_ADAPTER *ioc); 824fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desai 825635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* scsih shared API */ 82677e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, 82777e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u32 reply); 8288ed9a03ad4c1b6c5ae163e5e9f140852be0273a1Kashyap, Desaiint mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, 8298ed9a03ad4c1b6c5ae163e5e9f140852be0273a1Kashyap, Desai uint channel, uint id, uint lun, u8 type, u16 smid_task, 8308ed9a03ad4c1b6c5ae163e5e9f140852be0273a1Kashyap, Desai ulong timeout, struct scsi_cmnd *scmd); 831635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_scsih_set_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle); 832635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_scsih_clear_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle); 833635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_node *mpt2sas_scsih_expander_find_by_handle(struct MPT2SAS_ADAPTER *ioc, 834635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle); 835635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_node *mpt2sas_scsih_expander_find_by_sas_address(struct MPT2SAS_ADAPTER 836635374e7eb110e80d9918b8611198edd56a32975Eric Moore *ioc, u64 sas_address); 837635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address( 838635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct MPT2SAS_ADAPTER *ioc, u64 sas_address); 839635374e7eb110e80d9918b8611198edd56a32975Eric Moore 840635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); 841635374e7eb110e80d9918b8611198edd56a32975Eric Moore 842635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* config shared API */ 84377e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 8447b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u32 reply); 845635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys); 846635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, 847635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage0_t *config_page); 848ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desaiint mpt2sas_config_get_manufacturing_pg10(struct MPT2SAS_ADAPTER *ioc, 849ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage10_t *config_page); 850635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_bios_pg2(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 851635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2BiosPage2_t *config_page); 852635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_bios_pg3(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 853635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2BiosPage3_t *config_page); 854635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_iounit_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 855635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2IOUnitPage0_t *config_page); 856635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_sas_device_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 857635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasDevicePage0_t *config_page, u32 form, u32 handle); 858635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_sas_device_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 859635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasDevicePage1_t *config_page, u32 form, u32 handle); 860635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_sas_iounit_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 861635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasIOUnitPage0_t *config_page, u16 sz); 862635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 863635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2IOUnitPage1_t *config_page); 864635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_set_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 8655b768581ea722172f059ad5a5eebea9008961af0Kashyap, Desai *mpi_reply, Mpi2IOUnitPage1_t *config_page); 866635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_sas_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 867635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasIOUnitPage1_t *config_page, u16 sz); 86850d5c60634673a79f8d88564e10345b50fca7378Kashyap, Desaiint mpt2sas_config_set_sas_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, 86950d5c60634673a79f8d88564e10345b50fca7378Kashyap, Desai Mpi2ConfigReply_t *mpi_reply, Mpi2SasIOUnitPage1_t *config_page, u16 sz); 870635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_ioc_pg8(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 871635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2IOCPage8_t *config_page); 872635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_expander_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 873635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2ExpanderPage0_t *config_page, u32 form, u32 handle); 874635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_expander_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 875635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2ExpanderPage1_t *config_page, u32 phy_number, u16 handle); 876635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_enclosure_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 877635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasEnclosurePage0_t *config_page, u32 form, u32 handle); 878635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_phy_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 879635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasPhyPage0_t *config_page, u32 phy_number); 880635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_phy_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 881635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2SasPhyPage1_t *config_page, u32 phy_number); 882635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_raid_volume_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 883635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2RaidVolPage1_t *config_page, u32 form, u32 handle); 884635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_number_pds(struct MPT2SAS_ADAPTER *ioc, u16 handle, u8 *num_pds); 885635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_raid_volume_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 886635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2RaidVolPage0_t *config_page, u32 form, u32 handle, u16 sz); 887635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_phys_disk_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t 888635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_reply, Mpi2RaidPhysDiskPage0_t *config_page, u32 form, 889635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 form_specific); 890635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_volume_handle(struct MPT2SAS_ADAPTER *ioc, u16 pd_handle, 891635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 *volume_handle); 892635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_config_get_volume_wwid(struct MPT2SAS_ADAPTER *ioc, u16 volume_handle, 893635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 *wwid); 894635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* ctl shared API */ 895635374e7eb110e80d9918b8611198edd56a32975Eric Mooreextern struct device_attribute *mpt2sas_host_attrs[]; 896635374e7eb110e80d9918b8611198edd56a32975Eric Mooreextern struct device_attribute *mpt2sas_dev_attrs[]; 897635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_ctl_init(void); 898635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_ctl_exit(void); 89977e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 9007b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u32 reply); 901635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_ctl_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); 90277e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, 9037b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u32 reply); 904635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc, 905635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2EventNotificationReply_t *mpi_reply); 906635374e7eb110e80d9918b8611198edd56a32975Eric Moore 90732e0eb569df09a8cb790cf370ee498721d88e5c6Kashyap, Desaivoid mpt2sas_enable_diag_buffer(struct MPT2SAS_ADAPTER *ioc, 90832e0eb569df09a8cb790cf370ee498721d88e5c6Kashyap, Desai u8 bits_to_regsiter); 90932e0eb569df09a8cb790cf370ee498721d88e5c6Kashyap, Desai 910635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* transport shared API */ 91177e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 91277e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u32 reply); 913635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_port *mpt2sas_transport_port_add(struct MPT2SAS_ADAPTER *ioc, 914c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u16 handle, u64 sas_address); 915635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_transport_port_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address, 916c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u64 sas_address_parent); 917635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_transport_add_host_phy(struct MPT2SAS_ADAPTER *ioc, struct _sas_phy 918635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpt2sas_phy, Mpi2SasPhyPage0_t phy_pg0, struct device *parent_dev); 919635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_transport_add_expander_phy(struct MPT2SAS_ADAPTER *ioc, struct _sas_phy 920635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpt2sas_phy, Mpi2ExpanderPage1_t expander_pg1, struct device *parent_dev); 921c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desaivoid mpt2sas_transport_update_links(struct MPT2SAS_ADAPTER *ioc, 922c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u64 sas_address, u16 handle, u8 phy_number, u8 link_rate); 923635374e7eb110e80d9918b8611198edd56a32975Eric Mooreextern struct sas_function_template mpt2sas_transport_functions; 924635374e7eb110e80d9918b8611198edd56a32975Eric Mooreextern struct scsi_transport_template *mpt2sas_transport_template; 92534a03bef2202d0c9983a8da0a8abaee37d285847Kashyap, Desaiextern int scsi_internal_device_block(struct scsi_device *sdev); 92677e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiextern u8 mpt2sas_stm_zero_smid_handler(struct MPT2SAS_ADAPTER *ioc, 92777e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u8 msix_index, u32 reply); 92834a03bef2202d0c9983a8da0a8abaee37d285847Kashyap, Desaiextern int scsi_internal_device_unblock(struct scsi_device *sdev); 929635374e7eb110e80d9918b8611198edd56a32975Eric Moore 930635374e7eb110e80d9918b8611198edd56a32975Eric Moore#endif /* MPT2SAS_BASE_H_INCLUDED */ 931