Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
mptscsih.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/kdev_t.h>
#include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/reboot.h>
#include <linux/workqueue.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsi_dbg.h>
#include "mptbase.h"
#include "mptscsih.h"
#include "lsi/mpi_log_sas.h"

Go to the source code of this file.

Data Structures

struct  info_str
 

Macros

#define my_NAME   "Fusion MPT SCSI Host driver"
 
#define my_VERSION   MPT_LINUX_VERSION_COMMON
 
#define MYNAM   "mptscsih"
 
#define SNS_LEN(scp)   SCSI_SENSE_BUFFERSIZE
 
#define ADD_INDEX_LOG(req_ent)   do { } while(0)
 

Functions

 MODULE_AUTHOR (MODULEAUTHOR)
 
 MODULE_DESCRIPTION (my_NAME)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (my_VERSION)
 
struct scsi_cmndmptscsih_get_scsi_lookup (MPT_ADAPTER *ioc, int i)
 
int mptscsih_io_done (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r)
 
int mptscsih_taskmgmt_complete (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r)
 
int mptscsih_IssueTaskMgmt (MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, int ctx2abort, ulong timeout)
 
int mptscsih_ioc_reset (MPT_ADAPTER *ioc, int post_reset)
 
int mptscsih_event_process (MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
 
void mptscsih_taskmgmt_response_code (MPT_ADAPTER *ioc, u8 response_code)
 
int mptscsih_scandv_complete (MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r)
 
void mptscsih_remove (struct pci_dev *)
 
void mptscsih_shutdown (struct pci_dev *)
 
void mptscsih_flush_running_cmds (MPT_SCSI_HOST *hd)
 
 EXPORT_SYMBOL (mptscsih_flush_running_cmds)
 
const charmptscsih_info (struct Scsi_Host *SChost)
 
int mptscsih_proc_info (struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int func)
 
int mptscsih_qcmd (struct scsi_cmnd *SCpnt, void(*done)(struct scsi_cmnd *))
 
 EXPORT_SYMBOL (mptscsih_IssueTaskMgmt)
 
int mptscsih_abort (struct scsi_cmnd *SCpnt)
 
int mptscsih_dev_reset (struct scsi_cmnd *SCpnt)
 
int mptscsih_bus_reset (struct scsi_cmnd *SCpnt)
 
int mptscsih_host_reset (struct scsi_cmnd *SCpnt)
 
 EXPORT_SYMBOL (mptscsih_taskmgmt_response_code)
 
int mptscsih_bios_param (struct scsi_device *sdev, struct block_device *bdev, sector_t capacity, int geom[])
 
int mptscsih_is_phys_disk (MPT_ADAPTER *ioc, u8 channel, u8 id)
 
 EXPORT_SYMBOL (mptscsih_is_phys_disk)
 
u8 mptscsih_raid_id_to_num (MPT_ADAPTER *ioc, u8 channel, u8 id)
 
 EXPORT_SYMBOL (mptscsih_raid_id_to_num)
 
void mptscsih_slave_destroy (struct scsi_device *sdev)
 
int mptscsih_change_queue_depth (struct scsi_device *sdev, int qdepth, int reason)
 
int mptscsih_slave_configure (struct scsi_device *sdev)
 
 EXPORT_SYMBOL (mptscsih_get_scsi_lookup)
 
 EXPORT_SYMBOL (mptscsih_host_attrs)
 
 EXPORT_SYMBOL (mptscsih_remove)
 
 EXPORT_SYMBOL (mptscsih_shutdown)
 
 EXPORT_SYMBOL (mptscsih_proc_info)
 
 EXPORT_SYMBOL (mptscsih_info)
 
 EXPORT_SYMBOL (mptscsih_qcmd)
 
 EXPORT_SYMBOL (mptscsih_slave_destroy)
 
 EXPORT_SYMBOL (mptscsih_slave_configure)
 
 EXPORT_SYMBOL (mptscsih_abort)
 
 EXPORT_SYMBOL (mptscsih_dev_reset)
 
 EXPORT_SYMBOL (mptscsih_bus_reset)
 
 EXPORT_SYMBOL (mptscsih_host_reset)
 
 EXPORT_SYMBOL (mptscsih_bios_param)
 
 EXPORT_SYMBOL (mptscsih_io_done)
 
 EXPORT_SYMBOL (mptscsih_taskmgmt_complete)
 
 EXPORT_SYMBOL (mptscsih_scandv_complete)
 
 EXPORT_SYMBOL (mptscsih_event_process)
 
 EXPORT_SYMBOL (mptscsih_ioc_reset)
 
 EXPORT_SYMBOL (mptscsih_change_queue_depth)
 

Variables

struct device_attributemptscsih_host_attrs []
 

Macro Definition Documentation

#define ADD_INDEX_LOG (   req_ent)    do { } while(0)

Definition at line 1384 of file mptscsih.c.

#define my_NAME   "Fusion MPT SCSI Host driver"

Definition at line 71 of file mptscsih.c.

#define my_VERSION   MPT_LINUX_VERSION_COMMON

Definition at line 72 of file mptscsih.c.

#define MYNAM   "mptscsih"

Definition at line 73 of file mptscsih.c.

#define SNS_LEN (   scp)    SCSI_SENSE_BUFFERSIZE

Definition at line 121 of file mptscsih.c.

Function Documentation

EXPORT_SYMBOL ( mptscsih_flush_running_cmds  )
EXPORT_SYMBOL ( mptscsih_IssueTaskMgmt  )
EXPORT_SYMBOL ( mptscsih_taskmgmt_response_code  )
EXPORT_SYMBOL ( mptscsih_is_phys_disk  )
EXPORT_SYMBOL ( mptscsih_raid_id_to_num  )
EXPORT_SYMBOL ( mptscsih_get_scsi_lookup  )
EXPORT_SYMBOL ( mptscsih_host_attrs  )
EXPORT_SYMBOL ( mptscsih_remove  )
EXPORT_SYMBOL ( mptscsih_shutdown  )
EXPORT_SYMBOL ( mptscsih_proc_info  )
EXPORT_SYMBOL ( mptscsih_info  )
EXPORT_SYMBOL ( mptscsih_qcmd  )
EXPORT_SYMBOL ( mptscsih_slave_destroy  )
EXPORT_SYMBOL ( mptscsih_slave_configure  )
EXPORT_SYMBOL ( mptscsih_abort  )
EXPORT_SYMBOL ( mptscsih_dev_reset  )
EXPORT_SYMBOL ( mptscsih_bus_reset  )
EXPORT_SYMBOL ( mptscsih_host_reset  )
EXPORT_SYMBOL ( mptscsih_bios_param  )
EXPORT_SYMBOL ( mptscsih_io_done  )
EXPORT_SYMBOL ( mptscsih_taskmgmt_complete  )
EXPORT_SYMBOL ( mptscsih_scandv_complete  )
EXPORT_SYMBOL ( mptscsih_event_process  )
EXPORT_SYMBOL ( mptscsih_ioc_reset  )
EXPORT_SYMBOL ( mptscsih_change_queue_depth  )
MODULE_AUTHOR ( MODULEAUTHOR  )
MODULE_DESCRIPTION ( my_NAME  )
MODULE_LICENSE ( "GPL"  )
MODULE_VERSION ( my_VERSION  )
int mptscsih_abort ( struct scsi_cmnd SCpnt)

mptscsih_abort - Abort linux scsi_cmnd routine, new_eh variant : Pointer to scsi_cmnd structure, IO to be aborted

(linux scsi_host_template.eh_abort_handler routine)

Returns SUCCESS or FAILED.

Definition at line 1775 of file mptscsih.c.

int mptscsih_bios_param ( struct scsi_device sdev,
struct block_device bdev,
sector_t  capacity,
int  geom[] 
)

Definition at line 2178 of file mptscsih.c.

int mptscsih_bus_reset ( struct scsi_cmnd SCpnt)

mptscsih_bus_reset - Perform a SCSI BUS_RESET! new_eh variant : Pointer to scsi_cmnd structure, IO which reset is due to

(linux scsi_host_template.eh_bus_reset_handler routine)

Returns SUCCESS or FAILED.

Definition at line 1958 of file mptscsih.c.

int mptscsih_change_queue_depth ( struct scsi_device sdev,
int  qdepth,
int  reason 
)

Definition at line 2407 of file mptscsih.c.

int mptscsih_dev_reset ( struct scsi_cmnd SCpnt)

mptscsih_dev_reset - Perform a SCSI TARGET_RESET! new_eh variant : Pointer to scsi_cmnd structure, IO which reset is due to

(linux scsi_host_template.eh_dev_reset_handler routine)

Returns SUCCESS or FAILED.

Definition at line 1898 of file mptscsih.c.

int mptscsih_event_process ( MPT_ADAPTER *  ioc,
EventNotificationReply_t pEvReply 
)

Definition at line 2686 of file mptscsih.c.

void mptscsih_flush_running_cmds ( MPT_SCSI_HOST *  hd)

Definition at line 1029 of file mptscsih.c.

struct scsi_cmnd * mptscsih_get_scsi_lookup ( MPT_ADAPTER *  ioc,
int  i 
)
read

mptscsih_get_scsi_lookup - retrieves scmd entry : Pointer to MPT_ADAPTER structure : index into the array

Returns the scsi_cmd pointer

Definition at line 2572 of file mptscsih.c.

int mptscsih_host_reset ( struct scsi_cmnd SCpnt)

mptscsih_host_reset - Perform a SCSI host adapter RESET (new_eh variant) : Pointer to scsi_cmnd structure, IO which reset is due to

(linux scsi_host_template.eh_host_reset_handler routine)

Returns SUCCESS or FAILED.

Definition at line 2008 of file mptscsih.c.

const char* mptscsih_info ( struct Scsi_Host SChost)

mptscsih_info - Return information about MPT adapter : Pointer to Scsi_Host structure

(linux scsi_host_template.info routine)

Returns pointer to buffer where information was written.

Definition at line 1266 of file mptscsih.c.

int mptscsih_io_done ( MPT_ADAPTER *  ioc,
MPT_FRAME_HDR *  mf,
MPT_FRAME_HDR *  r 
)

Definition at line 588 of file mptscsih.c.

int mptscsih_ioc_reset ( MPT_ADAPTER *  ioc,
int  post_reset 
)

Definition at line 2651 of file mptscsih.c.

int mptscsih_is_phys_disk ( MPT_ADAPTER *  ioc,
u8  channel,
u8  id 
)

Definition at line 2217 of file mptscsih.c.

int mptscsih_IssueTaskMgmt ( MPT_SCSI_HOST *  hd,
u8  type,
u8  channel,
u8  id,
int  lun,
int  ctx2abort,
ulong  timeout 
)

mptscsih_IssueTaskMgmt - Generic send Task Management function. : Pointer to MPT_SCSI_HOST structure : Task Management type : channel number for task management : Logical Target ID for reset (if appropriate) : Logical Unit for reset (if appropriate) : Context for the task to be aborted (if appropriate) : timeout for task management control

Remark: _HardResetHandler can be invoked from an interrupt thread (timer) or a non-interrupt thread. In the former, must not call schedule().

Not all fields are meaningfull for all task types.

Returns 0 for SUCCESS, or FAILED.

Definition at line 1606 of file mptscsih.c.

int mptscsih_proc_info ( struct Scsi_Host host,
char buffer,
char **  start,
off_t  offset,
int  length,
int  func 
)

mptscsih_proc_info - Return information about MPT adapter : scsi host struct : if write, user data; if read, buffer for user : returns the buffer address : if write, 0; if read, the current offset into the buffer from the previous read. : if write, return length; : write = 1; read = 0

(linux scsi_host_template.info routine)

Definition at line 1362 of file mptscsih.c.

int mptscsih_qcmd ( struct scsi_cmnd SCpnt,
void(*)(struct scsi_cmnd *)  done 
)

mptscsih_qcmd - Primary Fusion MPT SCSI initiator IO start routine. : Pointer to scsi_cmnd structure : Pointer SCSI mid-layer IO completion function

(linux scsi_host_template.queuecommand routine) This is the primary SCSI IO start routine. Create a MPI SCSIIORequest from a linux scsi_cmnd request and send it to the IOC.

Returns 0. (rtn value discarded by linux scsi mid-layer)

Definition at line 1399 of file mptscsih.c.

u8 mptscsih_raid_id_to_num ( MPT_ADAPTER *  ioc,
u8  channel,
u8  id 
)

Definition at line 2295 of file mptscsih.c.

void mptscsih_remove ( struct pci_dev pdev)

Definition at line 1171 of file mptscsih.c.

int mptscsih_scandv_complete ( MPT_ADAPTER *  ioc,
MPT_FRAME_HDR *  mf,
MPT_FRAME_HDR *  r 
)

Definition at line 2728 of file mptscsih.c.

void mptscsih_shutdown ( struct pci_dev pdev)

Definition at line 1215 of file mptscsih.c.

int mptscsih_slave_configure ( struct scsi_device sdev)

Definition at line 2454 of file mptscsih.c.

void mptscsih_slave_destroy ( struct scsi_device sdev)

Definition at line 2376 of file mptscsih.c.

int mptscsih_taskmgmt_complete ( MPT_ADAPTER *  ioc,
MPT_FRAME_HDR *  mf,
MPT_FRAME_HDR *  mr 
)

mptscsih_taskmgmt_complete - Registered with Fusion MPT base driver : Pointer to MPT_ADAPTER structure : Pointer to SCSI task mgmt request frame : Pointer to SCSI task mgmt reply frame

This routine is called from mptbase.c::mpt_interrupt() at the completion of any SCSI task management request. This routine is registered with the MPT (base) driver at driver load/init time via the mpt_register() API call.

Returns 1 indicating alloc'd request frame ptr should be freed.

Definition at line 2147 of file mptscsih.c.

void mptscsih_taskmgmt_response_code ( MPT_ADAPTER *  ioc,
u8  response_code 
)

Definition at line 2097 of file mptscsih.c.

Variable Documentation

struct device_attribute* mptscsih_host_attrs[]
Initial value:
= {
&dev_attr_version_fw,
&dev_attr_version_bios,
&dev_attr_version_mpi,
&dev_attr_version_product,
&dev_attr_version_nvdata_persistent,
&dev_attr_version_nvdata_default,
&dev_attr_board_name,
&dev_attr_board_assembly,
&dev_attr_board_tracer,
&dev_attr_io_delay,
&dev_attr_device_delay,
&dev_attr_debug_level,
}

Definition at line 3326 of file mptscsih.c.