2005-04-17 05:20:36 +07:00
|
|
|
/*
|
[SCSI] fusion SAS support (mptsas driver) updates
Summary of Changes:
* splitting mpt_interrupt per Christophs suggestion
about a month ago
* rename ScsiCfgData to SpiCfgData structure,
then move all the raid related info into
new structure called RaidCfgData. This is
done because SAS supports RAID, as well as SPI,
so the raid stuff should be seperate.
* incorrect timeout calculation for cntdn
inside WaitForDoorbellAck and WaitForDoortbellInt
* add support for interpreting SAS Log Info
* Increase Event Log Size from 0xA to 0x32
* Fix bug in mptsas/mptfc/mptspi - when controller
has Initiator Mode Disabled, and only running in
TargetMode, the mptctl would panic when loading.
The fix is to return 0, instead of -ENODEV, in
SCSI LLD respective probe routines
* Fix bug in mptlan.c - driver will panic if
there is host reset, due to dev being set to
zero in mpt_lan_ioc_reset
* Fix's for SPI - Echo Buffer
* Several fix's in mptscsih_io_done - FCP Response
info, RESIDUAL_MISMATCH, Data Underrun, etc.
* Cleanup Error Handling - EH handlers,
mptscsih_flush_cmds, and zeroing out ScsiLookup
from mptscsih_qcmd
* Cleanup asyn event handling from
mptscsih -> mptscsih_event_process. Also
added support for SAS Persistent Table Full,
an asyn event
Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-15 07:09:10 +07:00
|
|
|
* linux/drivers/message/fusion/mptscsih.h
|
2005-04-17 05:20:36 +07:00
|
|
|
* High performance SCSI / Fibre Channel SCSI Host device driver.
|
|
|
|
* For use with PCI chip/adapter(s):
|
|
|
|
* LSIFC9xx/LSI409xx Fibre Channel
|
2007-08-14 17:52:54 +07:00
|
|
|
* running LSI Fusion MPT (Message Passing Technology) firmware.
|
2005-04-17 05:20:36 +07:00
|
|
|
*
|
2008-05-21 02:26:41 +07:00
|
|
|
* Copyright (c) 1999-2008 LSI Corporation
|
2007-06-14 05:31:07 +07:00
|
|
|
* (mailto:DL-MPTFusionLinux@lsi.com)
|
2005-04-17 05:20:36 +07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
|
|
|
/*
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
NO WARRANTY
|
|
|
|
THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
|
|
CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
|
|
|
|
LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
|
|
|
|
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
|
|
|
|
solely responsible for determining the appropriateness of using and
|
|
|
|
distributing the Program and assumes all risks associated with its
|
|
|
|
exercise of rights under this Agreement, including but not limited to
|
|
|
|
the risks and costs of program errors, damage to or loss of data,
|
|
|
|
programs or equipment, and unavailability or interruption of operations.
|
|
|
|
|
|
|
|
DISCLAIMER OF LIABILITY
|
|
|
|
NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
|
|
|
|
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
|
|
|
|
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
|
|
|
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
|
|
USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
|
|
|
|
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SCSIHOST_H_INCLUDED
|
|
|
|
#define SCSIHOST_H_INCLUDED
|
|
|
|
|
|
|
|
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
|
|
|
/*
|
|
|
|
* SCSI Public stuff...
|
|
|
|
*/
|
|
|
|
|
2007-01-29 23:42:20 +07:00
|
|
|
#define MPT_SCANDV_GOOD (0x00000000) /* must be 0 */
|
|
|
|
#define MPT_SCANDV_DID_RESET (0x00000001)
|
|
|
|
#define MPT_SCANDV_SENSE (0x00000002)
|
|
|
|
#define MPT_SCANDV_SOME_ERROR (0x00000004)
|
|
|
|
#define MPT_SCANDV_SELECTION_TIMEOUT (0x00000008)
|
|
|
|
#define MPT_SCANDV_ISSUE_SENSE (0x00000010)
|
|
|
|
#define MPT_SCANDV_FALLBACK (0x00000020)
|
2009-05-29 18:14:06 +07:00
|
|
|
#define MPT_SCANDV_BUSY (0x00000040)
|
2007-01-29 23:42:20 +07:00
|
|
|
|
|
|
|
#define MPT_SCANDV_MAX_RETRIES (10)
|
|
|
|
|
|
|
|
#define MPT_ICFLAG_BUF_CAP 0x01 /* ReadBuffer Read Capacity format */
|
|
|
|
#define MPT_ICFLAG_ECHO 0x02 /* ReadBuffer Echo buffer format */
|
|
|
|
#define MPT_ICFLAG_EBOS 0x04 /* ReadBuffer Echo buffer has EBOS */
|
|
|
|
#define MPT_ICFLAG_PHYS_DISK 0x08 /* Any SCSI IO but do Phys Disk Format */
|
|
|
|
#define MPT_ICFLAG_TAGGED_CMD 0x10 /* Do tagged IO */
|
|
|
|
#define MPT_ICFLAG_DID_RESET 0x20 /* Bus Reset occurred with this command */
|
|
|
|
#define MPT_ICFLAG_RESERVED 0x40 /* Reserved has been issued */
|
|
|
|
|
[SCSI] fusion SAS support (mptsas driver) updates
Summary of Changes:
* splitting mpt_interrupt per Christophs suggestion
about a month ago
* rename ScsiCfgData to SpiCfgData structure,
then move all the raid related info into
new structure called RaidCfgData. This is
done because SAS supports RAID, as well as SPI,
so the raid stuff should be seperate.
* incorrect timeout calculation for cntdn
inside WaitForDoorbellAck and WaitForDoortbellInt
* add support for interpreting SAS Log Info
* Increase Event Log Size from 0xA to 0x32
* Fix bug in mptsas/mptfc/mptspi - when controller
has Initiator Mode Disabled, and only running in
TargetMode, the mptctl would panic when loading.
The fix is to return 0, instead of -ENODEV, in
SCSI LLD respective probe routines
* Fix bug in mptlan.c - driver will panic if
there is host reset, due to dev being set to
zero in mpt_lan_ioc_reset
* Fix's for SPI - Echo Buffer
* Several fix's in mptscsih_io_done - FCP Response
info, RESIDUAL_MISMATCH, Data Underrun, etc.
* Cleanup Error Handling - EH handlers,
mptscsih_flush_cmds, and zeroing out ScsiLookup
from mptscsih_qcmd
* Cleanup asyn event handling from
mptscsih -> mptscsih_event_process. Also
added support for SAS Persistent Table Full,
an asyn event
Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-15 07:09:10 +07:00
|
|
|
#define MPT_SCSI_CMD_PER_DEV_HIGH 64
|
|
|
|
#define MPT_SCSI_CMD_PER_DEV_LOW 32
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
#define MPT_SCSI_CMD_PER_LUN 7
|
|
|
|
|
|
|
|
#define MPT_SCSI_MAX_SECTORS 8192
|
|
|
|
|
|
|
|
/* SCSI driver setup structure. Settings can be overridden
|
|
|
|
* by command line options.
|
|
|
|
*/
|
|
|
|
#define MPTSCSIH_DOMAIN_VALIDATION 1
|
|
|
|
#define MPTSCSIH_MAX_WIDTH 1
|
|
|
|
#define MPTSCSIH_MIN_SYNC 0x08
|
|
|
|
#define MPTSCSIH_SAF_TE 0
|
[SCSI] fusion SAS support (mptsas driver) updates
Summary of Changes:
* splitting mpt_interrupt per Christophs suggestion
about a month ago
* rename ScsiCfgData to SpiCfgData structure,
then move all the raid related info into
new structure called RaidCfgData. This is
done because SAS supports RAID, as well as SPI,
so the raid stuff should be seperate.
* incorrect timeout calculation for cntdn
inside WaitForDoorbellAck and WaitForDoortbellInt
* add support for interpreting SAS Log Info
* Increase Event Log Size from 0xA to 0x32
* Fix bug in mptsas/mptfc/mptspi - when controller
has Initiator Mode Disabled, and only running in
TargetMode, the mptctl would panic when loading.
The fix is to return 0, instead of -ENODEV, in
SCSI LLD respective probe routines
* Fix bug in mptlan.c - driver will panic if
there is host reset, due to dev being set to
zero in mpt_lan_ioc_reset
* Fix's for SPI - Echo Buffer
* Several fix's in mptscsih_io_done - FCP Response
info, RESIDUAL_MISMATCH, Data Underrun, etc.
* Cleanup Error Handling - EH handlers,
mptscsih_flush_cmds, and zeroing out ScsiLookup
from mptscsih_qcmd
* Cleanup asyn event handling from
mptscsih -> mptscsih_event_process. Also
added support for SAS Persistent Table Full,
an asyn event
Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-09-15 07:09:10 +07:00
|
|
|
#define MPTSCSIH_PT_CLEAR 0
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2005-04-23 05:02:09 +07:00
|
|
|
#endif
|
|
|
|
|
2009-05-29 18:22:37 +07:00
|
|
|
|
2007-01-29 23:42:20 +07:00
|
|
|
typedef struct _internal_cmd {
|
|
|
|
char *data; /* data pointer */
|
|
|
|
dma_addr_t data_dma; /* data dma address */
|
|
|
|
int size; /* transfer size */
|
|
|
|
u8 cmd; /* SCSI Op Code */
|
|
|
|
u8 channel; /* bus number */
|
|
|
|
u8 id; /* SCSI ID (virtual) */
|
2014-06-25 20:27:36 +07:00
|
|
|
u64 lun;
|
2007-01-29 23:42:20 +07:00
|
|
|
u8 flags; /* Bit Field - See above */
|
|
|
|
u8 physDiskNum; /* Phys disk number, -1 else */
|
|
|
|
u8 rsvd2;
|
|
|
|
u8 rsvd;
|
|
|
|
} INTERNAL_CMD;
|
|
|
|
|
2005-04-23 05:02:09 +07:00
|
|
|
extern void mptscsih_remove(struct pci_dev *);
|
2005-06-24 07:35:56 +07:00
|
|
|
extern void mptscsih_shutdown(struct pci_dev *);
|
2005-04-23 05:02:09 +07:00
|
|
|
#ifdef CONFIG_PM
|
2005-07-08 07:56:40 +07:00
|
|
|
extern int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state);
|
2005-04-23 05:02:09 +07:00
|
|
|
extern int mptscsih_resume(struct pci_dev *pdev);
|
2005-04-17 05:20:36 +07:00
|
|
|
#endif
|
2013-03-31 12:42:38 +07:00
|
|
|
extern int mptscsih_show_info(struct seq_file *, struct Scsi_Host *);
|
2005-04-23 05:02:09 +07:00
|
|
|
extern const char * mptscsih_info(struct Scsi_Host *SChost);
|
2014-03-28 03:40:36 +07:00
|
|
|
extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt);
|
2009-05-29 18:14:48 +07:00
|
|
|
extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel,
|
2014-06-25 20:27:36 +07:00
|
|
|
u8 id, u64 lun, int ctx2abort, ulong timeout);
|
2005-04-23 05:02:09 +07:00
|
|
|
extern void mptscsih_slave_destroy(struct scsi_device *device);
|
|
|
|
extern int mptscsih_slave_configure(struct scsi_device *device);
|
|
|
|
extern int mptscsih_abort(struct scsi_cmnd * SCpnt);
|
|
|
|
extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt);
|
|
|
|
extern int mptscsih_bus_reset(struct scsi_cmnd * SCpnt);
|
|
|
|
extern int mptscsih_host_reset(struct scsi_cmnd *SCpnt);
|
|
|
|
extern int mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, sector_t capacity, int geom[]);
|
|
|
|
extern int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
|
|
|
|
extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
|
|
|
|
extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
|
|
|
|
extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
|
|
|
|
extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
|
2014-11-13 21:08:42 +07:00
|
|
|
extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth);
|
2007-01-29 23:42:20 +07:00
|
|
|
extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id);
|
|
|
|
extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id);
|
2008-02-22 06:13:36 +07:00
|
|
|
extern struct device_attribute *mptscsih_host_attrs[];
|
2009-05-29 18:26:59 +07:00
|
|
|
extern struct scsi_cmnd *mptscsih_get_scsi_lookup(MPT_ADAPTER *ioc, int i);
|
2009-05-29 18:16:07 +07:00
|
|
|
extern void mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code);
|
2011-08-04 18:12:15 +07:00
|
|
|
extern void mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd);
|