Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Moore, Eric Dean | 466544d | 2005-09-14 18:09:10 -0600 | [diff] [blame] | 2 | * linux/drivers/message/fusion/mptscsih.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * High performance SCSI / Fibre Channel SCSI Host device driver. |
| 4 | * For use with PCI chip/adapter(s): |
| 5 | * LSIFC9xx/LSI409xx Fibre Channel |
Prakash, Sathya | f36789e | 2007-08-14 16:22:54 +0530 | [diff] [blame] | 6 | * running LSI Fusion MPT (Message Passing Technology) firmware. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * |
Prakash, Sathya | cddc0ab | 2008-05-21 00:56:41 +0530 | [diff] [blame] | 8 | * Copyright (c) 1999-2008 LSI Corporation |
Eric Moore | 16d2010 | 2007-06-13 16:31:07 -0600 | [diff] [blame] | 9 | * (mailto:DL-MPTFusionLinux@lsi.com) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | */ |
| 12 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 13 | /* |
| 14 | This program is free software; you can redistribute it and/or modify |
| 15 | it under the terms of the GNU General Public License as published by |
| 16 | the Free Software Foundation; version 2 of the License. |
| 17 | |
| 18 | This program is distributed in the hope that it will be useful, |
| 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | GNU General Public License for more details. |
| 22 | |
| 23 | NO WARRANTY |
| 24 | THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR |
| 25 | CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT |
| 26 | LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, |
| 27 | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is |
| 28 | solely responsible for determining the appropriateness of using and |
| 29 | distributing the Program and assumes all risks associated with its |
| 30 | exercise of rights under this Agreement, including but not limited to |
| 31 | the risks and costs of program errors, damage to or loss of data, |
| 32 | programs or equipment, and unavailability or interruption of operations. |
| 33 | |
| 34 | DISCLAIMER OF LIABILITY |
| 35 | NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY |
| 36 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 37 | DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND |
| 38 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
| 39 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE |
| 40 | USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED |
| 41 | HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES |
| 42 | |
| 43 | You should have received a copy of the GNU General Public License |
| 44 | along with this program; if not, write to the Free Software |
| 45 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 46 | */ |
| 47 | |
| 48 | #ifndef SCSIHOST_H_INCLUDED |
| 49 | #define SCSIHOST_H_INCLUDED |
| 50 | |
| 51 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
| 52 | /* |
| 53 | * SCSI Public stuff... |
| 54 | */ |
| 55 | |
Eric Moore | 793955f | 2007-01-29 09:42:20 -0700 | [diff] [blame] | 56 | #define MPT_SCANDV_GOOD (0x00000000) /* must be 0 */ |
| 57 | #define MPT_SCANDV_DID_RESET (0x00000001) |
| 58 | #define MPT_SCANDV_SENSE (0x00000002) |
| 59 | #define MPT_SCANDV_SOME_ERROR (0x00000004) |
| 60 | #define MPT_SCANDV_SELECTION_TIMEOUT (0x00000008) |
| 61 | #define MPT_SCANDV_ISSUE_SENSE (0x00000010) |
| 62 | #define MPT_SCANDV_FALLBACK (0x00000020) |
Kashyap, Desai | 37c60f3 | 2009-05-29 16:44:06 +0530 | [diff] [blame] | 63 | #define MPT_SCANDV_BUSY (0x00000040) |
Eric Moore | 793955f | 2007-01-29 09:42:20 -0700 | [diff] [blame] | 64 | |
| 65 | #define MPT_SCANDV_MAX_RETRIES (10) |
| 66 | |
| 67 | #define MPT_ICFLAG_BUF_CAP 0x01 /* ReadBuffer Read Capacity format */ |
| 68 | #define MPT_ICFLAG_ECHO 0x02 /* ReadBuffer Echo buffer format */ |
| 69 | #define MPT_ICFLAG_EBOS 0x04 /* ReadBuffer Echo buffer has EBOS */ |
| 70 | #define MPT_ICFLAG_PHYS_DISK 0x08 /* Any SCSI IO but do Phys Disk Format */ |
| 71 | #define MPT_ICFLAG_TAGGED_CMD 0x10 /* Do tagged IO */ |
| 72 | #define MPT_ICFLAG_DID_RESET 0x20 /* Bus Reset occurred with this command */ |
| 73 | #define MPT_ICFLAG_RESERVED 0x40 /* Reserved has been issued */ |
| 74 | |
Moore, Eric Dean | 466544d | 2005-09-14 18:09:10 -0600 | [diff] [blame] | 75 | #define MPT_SCSI_CMD_PER_DEV_HIGH 64 |
| 76 | #define MPT_SCSI_CMD_PER_DEV_LOW 32 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 77 | |
| 78 | #define MPT_SCSI_CMD_PER_LUN 7 |
| 79 | |
| 80 | #define MPT_SCSI_MAX_SECTORS 8192 |
| 81 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | /* SCSI driver setup structure. Settings can be overridden |
| 83 | * by command line options. |
| 84 | */ |
| 85 | #define MPTSCSIH_DOMAIN_VALIDATION 1 |
| 86 | #define MPTSCSIH_MAX_WIDTH 1 |
| 87 | #define MPTSCSIH_MIN_SYNC 0x08 |
| 88 | #define MPTSCSIH_SAF_TE 0 |
Moore, Eric Dean | 466544d | 2005-09-14 18:09:10 -0600 | [diff] [blame] | 89 | #define MPTSCSIH_PT_CLEAR 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | |
| 91 | #endif |
Moore, Eric Dean | 0d0c797 | 2005-04-22 18:02:09 -0400 | [diff] [blame] | 92 | |
Kashyap, Desai | 2f18786 | 2009-05-29 16:52:37 +0530 | [diff] [blame] | 93 | |
Eric Moore | 793955f | 2007-01-29 09:42:20 -0700 | [diff] [blame] | 94 | typedef struct _internal_cmd { |
| 95 | char *data; /* data pointer */ |
| 96 | dma_addr_t data_dma; /* data dma address */ |
| 97 | int size; /* transfer size */ |
| 98 | u8 cmd; /* SCSI Op Code */ |
| 99 | u8 channel; /* bus number */ |
| 100 | u8 id; /* SCSI ID (virtual) */ |
| 101 | int lun; |
| 102 | u8 flags; /* Bit Field - See above */ |
| 103 | u8 physDiskNum; /* Phys disk number, -1 else */ |
| 104 | u8 rsvd2; |
| 105 | u8 rsvd; |
| 106 | } INTERNAL_CMD; |
| 107 | |
Moore, Eric Dean | 0d0c797 | 2005-04-22 18:02:09 -0400 | [diff] [blame] | 108 | extern void mptscsih_remove(struct pci_dev *); |
Greg Kroah-Hartman | d18c3db | 2005-06-23 17:35:56 -0700 | [diff] [blame] | 109 | extern void mptscsih_shutdown(struct pci_dev *); |
Moore, Eric Dean | 0d0c797 | 2005-04-22 18:02:09 -0400 | [diff] [blame] | 110 | #ifdef CONFIG_PM |
Pavel Machek | 2a56957 | 2005-07-07 17:56:40 -0700 | [diff] [blame] | 111 | extern int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state); |
Moore, Eric Dean | 0d0c797 | 2005-04-22 18:02:09 -0400 | [diff] [blame] | 112 | extern int mptscsih_resume(struct pci_dev *pdev); |
| 113 | #endif |
| 114 | extern int mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int func); |
| 115 | extern const char * mptscsih_info(struct Scsi_Host *SChost); |
| 116 | extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)); |
Kashyap, Desai | 1ba9ab2 | 2009-05-29 16:44:48 +0530 | [diff] [blame] | 117 | extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, |
| 118 | u8 id, int lun, int ctx2abort, ulong timeout); |
Moore, Eric Dean | 0d0c797 | 2005-04-22 18:02:09 -0400 | [diff] [blame] | 119 | extern void mptscsih_slave_destroy(struct scsi_device *device); |
| 120 | extern int mptscsih_slave_configure(struct scsi_device *device); |
| 121 | extern int mptscsih_abort(struct scsi_cmnd * SCpnt); |
| 122 | extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt); |
| 123 | extern int mptscsih_bus_reset(struct scsi_cmnd * SCpnt); |
| 124 | extern int mptscsih_host_reset(struct scsi_cmnd *SCpnt); |
| 125 | extern int mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, sector_t capacity, int geom[]); |
| 126 | extern int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); |
| 127 | extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); |
| 128 | extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); |
| 129 | extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); |
| 130 | extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); |
Mike Christie | e881a17 | 2009-10-15 17:46:39 -0700 | [diff] [blame] | 131 | extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth, |
| 132 | int reason); |
Eric Moore | 793955f | 2007-01-29 09:42:20 -0700 | [diff] [blame] | 133 | extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id); |
| 134 | extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id); |
Tony Jones | ee959b0 | 2008-02-22 00:13:36 +0100 | [diff] [blame] | 135 | extern struct device_attribute *mptscsih_host_attrs[]; |
Kashyap, Desai | db7051b | 2009-05-29 16:56:59 +0530 | [diff] [blame] | 136 | extern struct scsi_cmnd *mptscsih_get_scsi_lookup(MPT_ADAPTER *ioc, int i); |
Kashyap, Desai | e7deff3 | 2009-05-29 16:46:07 +0530 | [diff] [blame] | 137 | extern void mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code); |