mpt2sas_base.h revision 7fbae67a3faa90abcbe949f1494769c84e51e189
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" 72d334aa79786a878e90af5b5c1b14109c1df85820Eric Moore#define MPT2SAS_DRIVER_VERSION "05.100.00.03" 731a7d7eac6f651c00e954023dd2542f0c65ef66b7Kashyap, Desai#define MPT2SAS_MAJOR_VERSION 05 74635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPT2SAS_MINOR_VERSION 100 751a7d7eac6f651c00e954023dd2542f0c65ef66b7Kashyap, Desai#define MPT2SAS_BUILD_VERSION 00 76d334aa79786a878e90af5b5c1b14109c1df85820Eric Moore#define MPT2SAS_RELEASE_VERSION 03 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 250635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @status: MPT2_CMD_XXX status 251635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @smid: system message id 252635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 253635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _internal_cmd { 254635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct mutex mutex; 255635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct completion done; 256635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *reply; 257635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 status; 258635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 smid; 259635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 260635374e7eb110e80d9918b8611198edd56a32975Eric Moore 261595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 262635374e7eb110e80d9918b8611198edd56a32975Eric Moore/** 263635374e7eb110e80d9918b8611198edd56a32975Eric Moore * struct _sas_device - attached device information 264635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @list: sas device list 265635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @starget: starget object 266635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_address: device sas address 267635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_name: retrieved from the SAS IDENTIFY frame. 268635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @handle: device handle 269c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai * @sas_address_parent: sas address of parent expander or sas host 270635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @enclosure_handle: enclosure handle 271635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @enclosure_logical_id: enclosure logical identifier 272635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @volume_handle: volume handle (valid when hidden raid member) 273635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @volume_wwid: volume unique identifier 274635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_info: bitfield provides detailed info about the device 275635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @id: target id 276635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @channel: target channel 277635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @slot: number number 2787fbae67a3faa90abcbe949f1494769c84e51e189Kashyap, Desai * @phy: phy identifier provided in sas device page 0 279635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @hidden_raid_component: set to 1 when this is a raid member 280635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @responding: used in _scsih_sas_device_mark_responding 281635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 282635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct _sas_device { 283635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head list; 284635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct scsi_target *starget; 285635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 sas_address; 286635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 device_name; 287635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle; 288c5e039be7e81168a9156e801cfef2adae72e775bKashyap, Desai u64 sas_address_parent; 289635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 enclosure_handle; 290635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 enclosure_logical_id; 291635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 volume_handle; 292635374e7eb110e80d9918b8611198edd56a32975Eric Moore u64 volume_wwid; 293635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 device_info; 294635374e7eb110e80d9918b8611198edd56a32975Eric Moore int id; 295635374e7eb110e80d9918b8611198edd56a32975Eric Moore int channel; 296635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 slot; 2977fbae67a3faa90abcbe949f1494769c84e51e189Kashyap, Desai u8 phy; 298635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 hidden_raid_component; 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 492635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @base_cmds: 493635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @transport_cmds: 494744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai * @scsih_cmds: 495635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @tm_cmds: 496635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ctl_cmds: 497635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_cmds: 498635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @base_add_sg_single: handler for either 32/64 bit sgl's 499635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_type: bits indicating which events to log 500635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_context: unique id for each logged event 501635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_log: event log pointer 502635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @event_masks: events that are masked 503635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @facts: static facts data 504635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @pfacts: static port facts data 505635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @manu_pg0: static manufacturing page 0 506ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai * @manu_pg10: static manufacturing page 10 507635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @bios_pg2: static bios page 2 508635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @bios_pg3: static bios page 3 509635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @ioc_pg8: static ioc page 8 510635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @iounit_pg0: static iounit page 0 511635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @iounit_pg1: static iounit page 1 512635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_hba: sas host object 513635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_expander_list: expander object list 514635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_node_lock: 515635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_device_list: sas device object list 516635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_device_init_list: sas device object list (used only at init time) 517635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sas_device_lock: 518635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @io_missing_delay: time for IO completed by fw when PDR enabled 519635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @device_missing_delay: time for device missing by fw when PDR enabled 520635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_page_sz: config page size 521635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_page: reserve memory for config page payload 522635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @config_page_dma: 523595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hba_queue_depth: hba request queue depth 524635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sge_size: sg element size for either 32/64 bit 525595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @scsiio_depth: SCSI_IO queue depth 526635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request_sz: per request frame size 527635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request: pool of request frames 528635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request_dma: 529635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @request_dma_sz: 530635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @scsi_lookup: firmware request tracker list 531635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @scsi_lookup_lock: 532635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @free_list: free list of request 533635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain: pool of chains 534635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @pending_io_count: 535635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reset_wq: 536635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_dma: 537635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @max_sges_in_main_message: number sg elements in main message 538635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @max_sges_in_chain_message: number sg elements per chain 539635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chains_needed_per_io: max chains per io 540635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_offset_value_for_main_message: location 1st sg in main 541635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @chain_depth: total chains allocated 542595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority_smid: 543595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority: 544595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority_dma: 545595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hi_priority_depth: 546595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hpr_lookup: 547595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @hpr_free_list: 548595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_smid: 549595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal: 550595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_dma: 551595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_depth: 552595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_lookup: 553595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai * @internal_free_list: 554635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sense: pool of sense 555635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sense_dma: 556635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @sense_dma_pool: 557635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_depth: hba reply queue depth: 558635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_sz: per reply frame size: 559635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply: pool of replys: 560635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_dma: 561635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_dma_pool: 562635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_queue_depth: reply free depth 563635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free: pool for reply free queue (32 bit addr) 564635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_dma: 565635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_dma_pool: 566635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_free_host_index: tail index in pool to insert free replys 567635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_queue_depth: reply post queue depth 568635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_free: pool for reply post (64bit descriptor) 569635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_free_dma: 570635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_free_dma_pool: 571635374e7eb110e80d9918b8611198edd56a32975Eric Moore * @reply_post_host_index: head index in the pool where FW completes IO 572635374e7eb110e80d9918b8611198edd56a32975Eric Moore */ 573635374e7eb110e80d9918b8611198edd56a32975Eric Moorestruct MPT2SAS_ADAPTER { 574635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head list; 575635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct Scsi_Host *shost; 576635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 id; 577635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 pci_irq; 578635374e7eb110e80d9918b8611198edd56a32975Eric Moore char name[MPT_NAME_LENGTH]; 579635374e7eb110e80d9918b8611198edd56a32975Eric Moore char tmp_string[MPT_STRING_LENGTH]; 580635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct pci_dev *pdev; 581635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2SystemInterfaceRegs_t __iomem *chip; 5826846e75cdfa76c6609ac0381a6739c9f4af8fd3bKashyap, Desai resource_size_t chip_phys; 583635374e7eb110e80d9918b8611198edd56a32975Eric Moore int logging_level; 584fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desai int fwfault_debug; 585635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ir_firmware; 586635374e7eb110e80d9918b8611198edd56a32975Eric Moore int bars; 587635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 mask_interrupts; 588635374e7eb110e80d9918b8611198edd56a32975Eric Moore 589635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* fw fault handler */ 590635374e7eb110e80d9918b8611198edd56a32975Eric Moore char fault_reset_work_q_name[20]; 591635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct workqueue_struct *fault_reset_work_q; 592635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct delayed_work fault_reset_work; 593635374e7eb110e80d9918b8611198edd56a32975Eric Moore 594635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* fw event handler */ 595635374e7eb110e80d9918b8611198edd56a32975Eric Moore char firmware_event_name[20]; 596635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct workqueue_struct *firmware_event_thread; 597635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t fw_event_lock; 598635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head fw_event_list; 599635374e7eb110e80d9918b8611198edd56a32975Eric Moore 600635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* misc flags */ 601635374e7eb110e80d9918b8611198edd56a32975Eric Moore int aen_event_read_flag; 602635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 broadcast_aen_busy; 603635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 shost_recovery; 604d274213a1ae59e8abde8d43e1e3a478fe9f28794Kashyap, Desai 605d274213a1ae59e8abde8d43e1e3a478fe9f28794Kashyap, Desai struct mutex reset_in_progress_mutex; 606f1c35e6aea579d5bdb6dc02dfa99c67c7c3b3f67Kashyap, Desai struct completion shost_recovery_done; 607635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t ioc_reset_in_progress_lock; 608635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ioc_link_reset_in_progress; 609d274213a1ae59e8abde8d43e1e3a478fe9f28794Kashyap, Desai int ioc_reset_in_progress_status; 610d274213a1ae59e8abde8d43e1e3a478fe9f28794Kashyap, Desai 611635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ignore_loginfos; 612635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 remove_host; 613635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 wait_for_port_enable_to_complete; 614635374e7eb110e80d9918b8611198edd56a32975Eric Moore 615635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 msix_enable; 616635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 msix_vector_count; 617635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 *msix_table; 618635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 *msix_table_backup; 619d32a8c15e1116e87f0105356eca1afb99842ab49Kashyap, Desai u32 ioc_reset_count; 620635374e7eb110e80d9918b8611198edd56a32975Eric Moore 621635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* internal commands, callback index */ 622635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 scsi_io_cb_idx; 623635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 tm_cb_idx; 624635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 transport_cb_idx; 625744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai u8 scsih_cb_idx; 626635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 ctl_cb_idx; 627635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 base_cb_idx; 628635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 config_cb_idx; 62977e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u8 tm_tr_cb_idx; 63077e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u8 tm_sas_control_cb_idx; 631635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd base_cmds; 632635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd transport_cmds; 633744090d38b47ed8ead8f68b6f0c65866c0b9b17aKashyap, Desai struct _internal_cmd scsih_cmds; 634635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd tm_cmds; 635635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd ctl_cmds; 636635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _internal_cmd config_cmds; 637635374e7eb110e80d9918b8611198edd56a32975Eric Moore 638635374e7eb110e80d9918b8611198edd56a32975Eric Moore MPT_ADD_SGE base_add_sg_single; 639635374e7eb110e80d9918b8611198edd56a32975Eric Moore 640635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* event log */ 641635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 event_type[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS]; 642635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 event_context; 643635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *event_log; 644635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 event_masks[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS]; 645635374e7eb110e80d9918b8611198edd56a32975Eric Moore 646635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* static config pages */ 647635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOCFactsReply_t facts; 648635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2PortFactsReply_t *pfacts; 649635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2ManufacturingPage0_t manu_pg0; 650635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2BiosPage2_t bios_pg2; 651635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2BiosPage3_t bios_pg3; 652635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOCPage8_t ioc_pg8; 653635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOUnitPage0_t iounit_pg0; 654635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2IOUnitPage1_t iounit_pg1; 655635374e7eb110e80d9918b8611198edd56a32975Eric Moore 656635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _boot_device req_boot_device; 657635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _boot_device req_alt_boot_device; 658635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _boot_device current_boot_device; 659635374e7eb110e80d9918b8611198edd56a32975Eric Moore 660635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* sas hba, expander, and device list */ 661635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct _sas_node sas_hba; 662635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_expander_list; 663635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t sas_node_lock; 664635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_device_list; 665635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head sas_device_init_list; 666635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t sas_device_lock; 667635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head raid_device_list; 668635374e7eb110e80d9918b8611198edd56a32975Eric Moore spinlock_t raid_device_lock; 669635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 io_missing_delay; 670635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 device_missing_delay; 671635374e7eb110e80d9918b8611198edd56a32975Eric Moore int sas_id; 672635374e7eb110e80d9918b8611198edd56a32975Eric Moore 673635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* config page */ 674635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 config_page_sz; 675635374e7eb110e80d9918b8611198edd56a32975Eric Moore void *config_page; 676635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t config_page_dma; 677635374e7eb110e80d9918b8611198edd56a32975Eric Moore 678595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai /* scsiio request */ 679595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 hba_queue_depth; 680635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 sge_size; 681595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 scsiio_depth; 682635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 request_sz; 683635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *request; 684635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t request_dma; 685635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 request_dma_sz; 686635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct request_tracker *scsi_lookup; 68789009fbb7d2df37536c8dc932fdead4189783f92Kashyap, Desai ulong scsi_lookup_pages; 68889009fbb7d2df37536c8dc932fdead4189783f92Kashyap, Desai spinlock_t scsi_lookup_lock; 689635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct list_head free_list; 690635374e7eb110e80d9918b8611198edd56a32975Eric Moore int pending_io_count; 691635374e7eb110e80d9918b8611198edd56a32975Eric Moore wait_queue_head_t reset_wq; 692635374e7eb110e80d9918b8611198edd56a32975Eric Moore 693635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* chain */ 694635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *chain; 695635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t chain_dma; 696635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 max_sges_in_main_message; 697635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 max_sges_in_chain_message; 698635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 chains_needed_per_io; 699635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 chain_offset_value_for_main_message; 70089009fbb7d2df37536c8dc932fdead4189783f92Kashyap, Desai u32 chain_depth; 701635374e7eb110e80d9918b8611198edd56a32975Eric Moore 702595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai /* hi-priority queue */ 703595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 hi_priority_smid; 704595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u8 *hi_priority; 705595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai dma_addr_t hi_priority_dma; 706595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 hi_priority_depth; 707595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct request_tracker *hpr_lookup; 708595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct list_head hpr_free_list; 709595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 710595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai /* internal queue */ 711595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 internal_smid; 712595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u8 *internal; 713595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai dma_addr_t internal_dma; 714595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai u16 internal_depth; 715595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct request_tracker *internal_lookup; 716595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct list_head internal_free_list; 717595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 718635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* sense */ 719635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *sense; 720635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t sense_dma; 721635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *sense_dma_pool; 722635374e7eb110e80d9918b8611198edd56a32975Eric Moore 723635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* reply */ 724635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 reply_sz; 725635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *reply; 726635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t reply_dma; 727635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *reply_dma_pool; 728635374e7eb110e80d9918b8611198edd56a32975Eric Moore 729635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* reply free queue */ 730635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 reply_free_queue_depth; 731635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 *reply_free; 732635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t reply_free_dma; 733635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *reply_free_dma_pool; 734635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 reply_free_host_index; 735635374e7eb110e80d9918b8611198edd56a32975Eric Moore 736635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* reply post queue */ 737635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 reply_post_queue_depth; 738635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2ReplyDescriptorsUnion_t *reply_post_free; 739635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t reply_post_free_dma; 740635374e7eb110e80d9918b8611198edd56a32975Eric Moore struct dma_pool *reply_post_free_dma_pool; 741635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 reply_post_host_index; 742635374e7eb110e80d9918b8611198edd56a32975Eric Moore 74377e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai struct list_head delayed_tr_list; 74477e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai 745635374e7eb110e80d9918b8611198edd56a32975Eric Moore /* diag buffer support */ 746635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 *diag_buffer[MPI2_DIAG_BUF_TYPE_COUNT]; 747635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 diag_buffer_sz[MPI2_DIAG_BUF_TYPE_COUNT]; 748635374e7eb110e80d9918b8611198edd56a32975Eric Moore dma_addr_t diag_buffer_dma[MPI2_DIAG_BUF_TYPE_COUNT]; 749635374e7eb110e80d9918b8611198edd56a32975Eric Moore u8 diag_buffer_status[MPI2_DIAG_BUF_TYPE_COUNT]; 750635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 unique_id[MPI2_DIAG_BUF_TYPE_COUNT]; 751ed79f1280d1bc54f168abcffc8c3e0bf8ffb1873Kashyap, Desai Mpi2ManufacturingPage10_t manu_pg10; 752635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 product_specific[MPI2_DIAG_BUF_TYPE_COUNT][23]; 753635374e7eb110e80d9918b8611198edd56a32975Eric Moore u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; 754570c67ac443dab5c46e5744e950f0539724cb65dKashyap, Desai u32 ring_buffer_offset; 755570c67ac443dab5c46e5744e950f0539724cb65dKashyap, Desai u32 ring_buffer_sz; 756635374e7eb110e80d9918b8611198edd56a32975Eric Moore}; 757635374e7eb110e80d9918b8611198edd56a32975Eric Moore 75877e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaitypedef u8 (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 75977e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u32 reply); 760635374e7eb110e80d9918b8611198edd56a32975Eric Moore 761635374e7eb110e80d9918b8611198edd56a32975Eric Moore 762635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* base shared API */ 763ba33fadfabe88e838e73c76a6ff59546f5f6b92bEric Mooreextern struct list_head mpt2sas_ioc_list; 764e4750c989f732555fca86dd73d488c79972362dbKashyap, Desaivoid mpt2sas_base_start_watchdog(struct MPT2SAS_ADAPTER *ioc); 765e4750c989f732555fca86dd73d488c79972362dbKashyap, Desaivoid mpt2sas_base_stop_watchdog(struct MPT2SAS_ADAPTER *ioc); 766635374e7eb110e80d9918b8611198edd56a32975Eric Moore 767635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc); 768635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc); 769635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_map_resources(struct MPT2SAS_ADAPTER *ioc); 770635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_free_resources(struct MPT2SAS_ADAPTER *ioc); 771635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, 772635374e7eb110e80d9918b8611198edd56a32975Eric Moore enum reset_type type); 773635374e7eb110e80d9918b8611198edd56a32975Eric Moore 774635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid *mpt2sas_base_get_msg_frame(struct MPT2SAS_ADAPTER *ioc, u16 smid); 775635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid *mpt2sas_base_get_sense_buffer(struct MPT2SAS_ADAPTER *ioc, u16 smid); 776635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_build_zero_len_sge(struct MPT2SAS_ADAPTER *ioc, void *paddr); 777ec9472c74c3074541ea8389517f406b5c7ad0632Kashyap, Desai__le32 mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, 77877e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u16 smid); 779635374e7eb110e80d9918b8611198edd56a32975Eric Moore 780595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai/* hi-priority queue */ 781595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desaiu16 mpt2sas_base_get_smid_hpr(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); 782595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desaiu16 mpt2sas_base_get_smid_scsiio(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx, 783595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai struct scsi_cmnd *scmd); 784595bb0bd62edb28a965993d90e0fa1285560ce53Kashyap, Desai 785635374e7eb110e80d9918b8611198edd56a32975Eric Mooreu16 mpt2sas_base_get_smid(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); 786635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_free_smid(struct MPT2SAS_ADAPTER *ioc, u16 smid); 7877b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaivoid mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, 788635374e7eb110e80d9918b8611198edd56a32975Eric Moore u16 handle); 7897b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaivoid mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid); 790635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_put_smid_target_assist(struct MPT2SAS_ADAPTER *ioc, u16 smid, 7917b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u16 io_index); 7927b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaivoid mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid); 793635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_initialize_callback_handler(void); 794635374e7eb110e80d9918b8611198edd56a32975Eric Mooreu8 mpt2sas_base_register_callback_handler(MPT_CALLBACK cb_func); 795635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_release_callback_handler(u8 cb_idx); 796635374e7eb110e80d9918b8611198edd56a32975Eric Moore 79777e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 7987b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai u32 reply); 799635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr); 800635374e7eb110e80d9918b8611198edd56a32975Eric Moore 801635374e7eb110e80d9918b8611198edd56a32975Eric Mooreu32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked); 802635374e7eb110e80d9918b8611198edd56a32975Eric Moore 803635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_fault_info(struct MPT2SAS_ADAPTER *ioc , u16 fault_code); 804635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc, 805635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2SasIoUnitControlReply_t *mpi_reply, Mpi2SasIoUnitControlRequest_t 806635374e7eb110e80d9918b8611198edd56a32975Eric Moore *mpi_request); 807635374e7eb110e80d9918b8611198edd56a32975Eric Mooreint mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc, 808635374e7eb110e80d9918b8611198edd56a32975Eric Moore Mpi2SepReply_t *mpi_reply, Mpi2SepRequest_t *mpi_request); 809635374e7eb110e80d9918b8611198edd56a32975Eric Moorevoid mpt2sas_base_validate_event_type(struct MPT2SAS_ADAPTER *ioc, u32 *event_type); 810635374e7eb110e80d9918b8611198edd56a32975Eric Moore 811fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desaivoid mpt2sas_halt_firmware(struct MPT2SAS_ADAPTER *ioc); 812fa7f31673583a6e0876f8bb420735cdd8a3ffa57Kashyap, Desai 813635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* scsih shared API */ 81477e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desaiu8 mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, 81577e63ed44305e89c0564f8292f9cd5764d4fddfbKashyap, Desai u32 reply); 8168ed9a03ad4c1b6c5ae163e5e9f140852be0273a1Kashyap, Desaiint mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, 8178ed9a03ad4c1b6c5ae163e5e9f140852be0273a1Kashyap, Desai uint channel, uint id, uint lun, u8 type, u16 smid_task, 8188ed9a03ad4c1b6c5ae163e5e9f140852be0273a1Kashyap, Desai ulong timeout, struct scsi_cmnd *scmd); 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