Path: blob/master/drivers/message/fusion/mptscsih.h
15109 views
/*1* linux/drivers/message/fusion/mptscsih.h2* High performance SCSI / Fibre Channel SCSI Host device driver.3* For use with PCI chip/adapter(s):4* LSIFC9xx/LSI409xx Fibre Channel5* running LSI Fusion MPT (Message Passing Technology) firmware.6*7* Copyright (c) 1999-2008 LSI Corporation8* (mailto:[email protected])9*10*/11/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/12/*13This program is free software; you can redistribute it and/or modify14it under the terms of the GNU General Public License as published by15the Free Software Foundation; version 2 of the License.1617This program is distributed in the hope that it will be useful,18but WITHOUT ANY WARRANTY; without even the implied warranty of19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the20GNU General Public License for more details.2122NO WARRANTY23THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR24CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT25LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,26MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is27solely responsible for determining the appropriateness of using and28distributing the Program and assumes all risks associated with its29exercise of rights under this Agreement, including but not limited to30the risks and costs of program errors, damage to or loss of data,31programs or equipment, and unavailability or interruption of operations.3233DISCLAIMER OF LIABILITY34NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY35DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL36DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND37ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR38TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE39USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED40HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES4142You should have received a copy of the GNU General Public License43along with this program; if not, write to the Free Software44Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA45*/4647#ifndef SCSIHOST_H_INCLUDED48#define SCSIHOST_H_INCLUDED4950/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/51/*52* SCSI Public stuff...53*/5455#define MPT_SCANDV_GOOD (0x00000000) /* must be 0 */56#define MPT_SCANDV_DID_RESET (0x00000001)57#define MPT_SCANDV_SENSE (0x00000002)58#define MPT_SCANDV_SOME_ERROR (0x00000004)59#define MPT_SCANDV_SELECTION_TIMEOUT (0x00000008)60#define MPT_SCANDV_ISSUE_SENSE (0x00000010)61#define MPT_SCANDV_FALLBACK (0x00000020)62#define MPT_SCANDV_BUSY (0x00000040)6364#define MPT_SCANDV_MAX_RETRIES (10)6566#define MPT_ICFLAG_BUF_CAP 0x01 /* ReadBuffer Read Capacity format */67#define MPT_ICFLAG_ECHO 0x02 /* ReadBuffer Echo buffer format */68#define MPT_ICFLAG_EBOS 0x04 /* ReadBuffer Echo buffer has EBOS */69#define MPT_ICFLAG_PHYS_DISK 0x08 /* Any SCSI IO but do Phys Disk Format */70#define MPT_ICFLAG_TAGGED_CMD 0x10 /* Do tagged IO */71#define MPT_ICFLAG_DID_RESET 0x20 /* Bus Reset occurred with this command */72#define MPT_ICFLAG_RESERVED 0x40 /* Reserved has been issued */7374#define MPT_SCSI_CMD_PER_DEV_HIGH 6475#define MPT_SCSI_CMD_PER_DEV_LOW 327677#define MPT_SCSI_CMD_PER_LUN 77879#define MPT_SCSI_MAX_SECTORS 81928081/* SCSI driver setup structure. Settings can be overridden82* by command line options.83*/84#define MPTSCSIH_DOMAIN_VALIDATION 185#define MPTSCSIH_MAX_WIDTH 186#define MPTSCSIH_MIN_SYNC 0x0887#define MPTSCSIH_SAF_TE 088#define MPTSCSIH_PT_CLEAR 08990#endif919293typedef struct _internal_cmd {94char *data; /* data pointer */95dma_addr_t data_dma; /* data dma address */96int size; /* transfer size */97u8 cmd; /* SCSI Op Code */98u8 channel; /* bus number */99u8 id; /* SCSI ID (virtual) */100int lun;101u8 flags; /* Bit Field - See above */102u8 physDiskNum; /* Phys disk number, -1 else */103u8 rsvd2;104u8 rsvd;105} INTERNAL_CMD;106107extern void mptscsih_remove(struct pci_dev *);108extern void mptscsih_shutdown(struct pci_dev *);109#ifdef CONFIG_PM110extern int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state);111extern int mptscsih_resume(struct pci_dev *pdev);112#endif113extern int mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int func);114extern const char * mptscsih_info(struct Scsi_Host *SChost);115extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *));116extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel,117u8 id, int lun, int ctx2abort, ulong timeout);118extern void mptscsih_slave_destroy(struct scsi_device *device);119extern int mptscsih_slave_configure(struct scsi_device *device);120extern int mptscsih_abort(struct scsi_cmnd * SCpnt);121extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt);122extern int mptscsih_bus_reset(struct scsi_cmnd * SCpnt);123extern int mptscsih_host_reset(struct scsi_cmnd *SCpnt);124extern int mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, sector_t capacity, int geom[]);125extern int mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);126extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);127extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);128extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);129extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);130extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth,131int reason);132extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id);133extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id);134extern struct device_attribute *mptscsih_host_attrs[];135extern struct scsi_cmnd *mptscsih_get_scsi_lookup(MPT_ADAPTER *ioc, int i);136extern void mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code);137138139