Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  *  linux/drivers/message/fusion/mptscsih.h
0003  *      High performance SCSI / Fibre Channel SCSI Host device driver.
0004  *      For use with PCI chip/adapter(s):
0005  *          LSIFC9xx/LSI409xx Fibre Channel
0006  *      running LSI Fusion MPT (Message Passing Technology) firmware.
0007  *
0008  *  Copyright (c) 1999-2008 LSI Corporation
0009  *  (mailto:DL-MPTFusionLinux@lsi.com)
0010  *
0011  */
0012 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
0013 /*
0014     This program is free software; you can redistribute it and/or modify
0015     it under the terms of the GNU General Public License as published by
0016     the Free Software Foundation; version 2 of the License.
0017 
0018     This program is distributed in the hope that it will be useful,
0019     but WITHOUT ANY WARRANTY; without even the implied warranty of
0020     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0021     GNU General Public License for more details.
0022 
0023     NO WARRANTY
0024     THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
0025     CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
0026     LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
0027     MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
0028     solely responsible for determining the appropriateness of using and
0029     distributing the Program and assumes all risks associated with its
0030     exercise of rights under this Agreement, including but not limited to
0031     the risks and costs of program errors, damage to or loss of data,
0032     programs or equipment, and unavailability or interruption of operations.
0033 
0034     DISCLAIMER OF LIABILITY
0035     NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
0036     DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0037     DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
0038     ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
0039     TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
0040     USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
0041     HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
0042 
0043     You should have received a copy of the GNU General Public License
0044     along with this program; if not, write to the Free Software
0045     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
0046 */
0047 
0048 #ifndef SCSIHOST_H_INCLUDED
0049 #define SCSIHOST_H_INCLUDED
0050 
0051 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
0052 /*
0053  *  SCSI Public stuff...
0054  */
0055 
0056 #define MPT_SCANDV_GOOD         (0x00000000) /* must be 0 */
0057 #define MPT_SCANDV_DID_RESET        (0x00000001)
0058 #define MPT_SCANDV_SENSE        (0x00000002)
0059 #define MPT_SCANDV_SOME_ERROR       (0x00000004)
0060 #define MPT_SCANDV_SELECTION_TIMEOUT    (0x00000008)
0061 #define MPT_SCANDV_ISSUE_SENSE      (0x00000010)
0062 #define MPT_SCANDV_FALLBACK     (0x00000020)
0063 #define MPT_SCANDV_BUSY         (0x00000040)
0064 
0065 #define MPT_SCANDV_MAX_RETRIES      (10)
0066 
0067 #define MPT_ICFLAG_BUF_CAP  0x01    /* ReadBuffer Read Capacity format */
0068 #define MPT_ICFLAG_ECHO     0x02    /* ReadBuffer Echo buffer format */
0069 #define MPT_ICFLAG_EBOS     0x04    /* ReadBuffer Echo buffer has EBOS */
0070 #define MPT_ICFLAG_PHYS_DISK    0x08    /* Any SCSI IO but do Phys Disk Format */
0071 #define MPT_ICFLAG_TAGGED_CMD   0x10    /* Do tagged IO */
0072 #define MPT_ICFLAG_DID_RESET    0x20    /* Bus Reset occurred with this command */
0073 #define MPT_ICFLAG_RESERVED 0x40    /* Reserved has been issued */
0074 
0075 #define MPT_SCSI_CMD_PER_DEV_HIGH   64
0076 #define MPT_SCSI_CMD_PER_DEV_LOW    32
0077 
0078 #define MPT_SCSI_CMD_PER_LUN        7
0079 
0080 #define MPT_SCSI_MAX_SECTORS    8192
0081 
0082 /* SCSI driver setup structure. Settings can be overridden
0083  * by command line options.
0084  */
0085 #define MPTSCSIH_DOMAIN_VALIDATION      1
0086 #define MPTSCSIH_MAX_WIDTH              1
0087 #define MPTSCSIH_MIN_SYNC               0x08
0088 #define MPTSCSIH_SAF_TE                 0
0089 #define MPTSCSIH_PT_CLEAR               0
0090 
0091 #endif
0092 
0093 
0094 typedef struct _internal_cmd {
0095     char        *data;      /* data pointer */
0096     dma_addr_t  data_dma;   /* data dma address */
0097     int     size;       /* transfer size */
0098     u8      cmd;        /* SCSI Op Code */
0099     u8      channel;    /* bus number */
0100     u8      id;     /* SCSI ID (virtual) */
0101     u64     lun;
0102     u8      flags;      /* Bit Field - See above */
0103     u8      physDiskNum;    /* Phys disk number, -1 else */
0104     u8      rsvd2;
0105     u8      rsvd;
0106 } INTERNAL_CMD;
0107 
0108 extern void mptscsih_remove(struct pci_dev *);
0109 extern void mptscsih_shutdown(struct pci_dev *);
0110 #ifdef CONFIG_PM
0111 extern int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state);
0112 extern int mptscsih_resume(struct pci_dev *pdev);
0113 #endif
0114 extern int mptscsih_show_info(struct seq_file *, struct Scsi_Host *);
0115 extern const char * mptscsih_info(struct Scsi_Host *SChost);
0116 extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt);
0117 extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel,
0118     u8 id, u64 lun, int ctx2abort, ulong timeout);
0119 extern void mptscsih_slave_destroy(struct scsi_device *device);
0120 extern int mptscsih_slave_configure(struct scsi_device *device);
0121 extern int mptscsih_abort(struct scsi_cmnd * SCpnt);
0122 extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt);
0123 extern int mptscsih_bus_reset(struct scsi_cmnd * SCpnt);
0124 extern int mptscsih_host_reset(struct scsi_cmnd *SCpnt);
0125 extern int mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, sector_t capacity, int geom[]);
0126 extern int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
0127 extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
0128 extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
0129 extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
0130 extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
0131 extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth);
0132 extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id);
0133 extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id);
0134 extern const struct attribute_group *mptscsih_host_attr_groups[];
0135 extern struct scsi_cmnd *mptscsih_get_scsi_lookup(MPT_ADAPTER *ioc, int i);
0136 extern void mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code);
0137 extern void mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd);