/* * linux/drivers/message/fusion/mptbase.h * High performance SCSI + LAN / Fibre Channel device drivers. * For use with PCI chip/adapter(s): * LSIFC9xx/LSI409xx Fibre Channel * running LSI Fusion MPT (Message Passing Technology) firmware. * * Copyright (c) 1999-2008 LSI Corporation * (mailto:DL-MPTFusionLinux@lsi.com) *
*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* 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
*/
#include"lsi/mpi_type.h" #include"lsi/mpi.h"/* Fusion MPI(nterface) basic defs */ #include"lsi/mpi_ioc.h"/* Fusion MPT IOC(ontroller) defs */ #include"lsi/mpi_cnfg.h"/* IOC configuration support */ #include"lsi/mpi_init.h"/* SCSI Host (initiator) protocol support */ #include"lsi/mpi_lan.h"/* LAN over FC protocol support */ #include"lsi/mpi_raid.h"/* Integrated Mirroring support */
#include"lsi/mpi_fc.h"/* Fibre Channel (lowlevel) support */ #include"lsi/mpi_targ.h"/* SCSI/FCP Target protcol support */ #include"lsi/mpi_tool.h"/* Tools support */ #include"lsi/mpi_sas.h"/* SAS support */
/* * MPT adapter / port / bus / device info structures...
*/
typedefunion _MPT_FRAME_TRACKER { struct { struct list_head list;
u32 arg1;
u32 pad; void *argp1;
} linkage; /* * NOTE: When request frames are free, on the linkage structure * contents are valid. All other values are invalid. * In particular, do NOT reply on offset [2] * (in words) being the * message context. * The message context must be reset (computed via base address * + an offset) prior to issuing any command. * * NOTE2: On non-32-bit systems, where pointers are LARGE, * using the linkage pointers destroys our sacred MsgContext * field contents. But we don't care anymore because these * are now reset in mpt_put_msg_frame() just prior to sending * a request off to the IOC.
*/ struct {
u32 __hdr[2]; /* * The following _MUST_ match the location of the * MsgContext field in the MPT message headers.
*/ union {
u32 MsgContext; struct {
u16 req_idx; /* Request index */
u8 cb_idx; /* callback function index */
u8 rsvd;
} fld;
} msgctxu;
} hwhdr; /* * Remark: 32 bit identifier: * 31-24: reserved * 23-16: call back index * 15-0 : request index
*/
} MPT_FRAME_TRACKER;
/* * Substructure to store SCSI specific configuration page data
*/ /* dvStatus defines: */ #define MPT_SCSICFG_USE_NVRAM 0x01 /* WriteSDP1 using NVRAM */ #define MPT_SCSICFG_ALL_IDS 0x02 /* WriteSDP1 to all IDS */ /* #define MPT_SCSICFG_BLK_NEGO 0x10 WriteSDP1 with WDTR and SDTR disabled */
typedefstruct _SpiCfgData {
u32 PortFlags; int *nvram; /* table of device NVRAM values */
IOCPage4_t *pIocPg4; /* SEP devices addressing */
dma_addr_t IocPg4_dma; /* Phys Addr of IOCPage4 data */ int IocPg4Sz; /* IOCPage4 size */
u8 minSyncFactor; /* 0xFF if async */
u8 maxSyncOffset; /* 0 if async */
u8 maxBusWidth; /* 0 if narrow, 1 if wide */
u8 busType; /* SE, LVD, HD */
u8 sdp1version; /* SDP1 version */
u8 sdp1length; /* SDP1 length */
u8 sdp0version; /* SDP0 version */
u8 sdp0length; /* SDP0 length */
u8 dvScheduled; /* 1 if scheduled */
u8 noQas; /* Disable QAS for this adapter */
u8 Saf_Te; /* 1 to force all Processors as * SAF-TE if Inquiry data length * is too short to check for SAF-TE
*/
u8 bus_reset; /* 1 to allow bus reset */
u8 rsvd[1];
}SpiCfgData;
typedefstruct _SasCfgData {
u8 ptClear; /* 1 to automatically clear the * persistent table. * 0 to disable * automatic clearing.
*/
}SasCfgData;
/* * Inactive volume link list of raid component data * @inactive_list
*/ struct inactive_raid_component_info { struct list_head list;
u8 volumeID; /* volume target id */
u8 volumeBus; /* volume channel */
IOC_3_PHYS_DISK d; /* phys disk info */
};
typedefstruct _RaidCfgData {
IOCPage2_t *pIocPg2; /* table of Raid Volumes */
IOCPage3_t *pIocPg3; /* table of physical disks */ struct mutex inactive_list_mutex; struct list_head inactive_list; /* link list for physical disk that belong in
inactive volumes */
}RaidCfgData;
typedefstruct _FcCfgData { /* will ultimately hold fc_port_page0 also */ struct {
FCPortPage1_t *data;
dma_addr_t dma; int pg_sz;
} fc_port_page1[2];
} FcCfgData;
/* * Adapter Structure - pci_dev specific. Maximum: MPT_MAX_ADAPTERS
*/ typedefstruct _MPT_ADAPTER
{ int id; /* Unique adapter id N {0,1,2,...} */ int pci_irq; /* This irq */ char name[MPT_NAME_LENGTH]; /* "iocN" */ constchar *prod_name; /* "LSIFC9x9" */ #ifdef CONFIG_FUSION_LOGGING /* used in mpt_display_event_info */ char evStr[EVENT_DESCR_STR_SZ]; #endif char board_name[16]; char board_assembly[16]; char board_tracer[16];
u16 nvdata_version_persistent;
u16 nvdata_version_default; int debug_level;
u8 io_missing_delay;
u16 device_missing_delay;
SYSIF_REGS __iomem *chip; /* == c8817000 (mmap) */
SYSIF_REGS __iomem *pio_chip; /* Programmed IO (downloadboot) */
u8 bus_type;
u32 mem_phys; /* == f4020000 (mmap) */
u32 pio_mem_phys; /* Programmed IO (downloadboot) */ int mem_size; /* mmap memory size */ int number_of_buses; int devices_per_bus; int alloc_total;
u32 last_state; int active;
u8 *alloc; /* frames alloc ptr */
dma_addr_t alloc_dma;
u32 alloc_sz;
MPT_FRAME_HDR *reply_frames; /* Reply msg frames - rounded up! */
u32 reply_frames_low_dma; int reply_depth; /* Num Allocated reply frames */ int reply_sz; /* Reply frame size */ int num_chain; /* Number of chain buffers */
MPT_ADD_SGE add_sge; /* Pointer to add_sge
function */
MPT_ADD_CHAIN add_chain; /* Pointer to add_chain
function */ /* Pool of buffers for chaining. ReqToChain * and ChainToChain track index of chain buffers. * ChainBuffer (DMA) virt/phys addresses. * FreeChainQ (lock) locking mechanisms.
*/ int *ReqToChain; int *RequestNB; int *ChainToChain;
u8 *ChainBuffer;
dma_addr_t ChainBufferDMA; struct list_head FreeChainQ;
spinlock_t FreeChainQlock; /* We (host driver) get to manage our own RequestQueue! */
dma_addr_t req_frames_dma;
MPT_FRAME_HDR *req_frames; /* Request msg frames - rounded up! */
u32 req_frames_low_dma; int req_depth; /* Number of request frames */ int req_sz; /* Request frame size (bytes) */
spinlock_t FreeQlock; struct list_head FreeQ; /* Pool of SCSI sense buffers for commands coming from * the SCSI mid-layer. We have one 256 byte sense buffer * for each REQ entry.
*/
u8 *sense_buf_pool;
dma_addr_t sense_buf_pool_dma;
u32 sense_buf_low_dma;
u8 *HostPageBuffer; /* SAS - host page buffer support */
u32 HostPageBuffer_sz;
dma_addr_t HostPageBuffer_dma; struct pci_dev *pcidev; /* struct pci_dev pointer */ int bars; /* bitmask of BAR's that must be configured */ int msi_enable;
u8 __iomem *memmap; /* mmap address */ struct Scsi_Host *sh; /* Scsi Host pointer */
SpiCfgData spi_data; /* Scsi config. data */
RaidCfgData raid_data; /* Raid config. data */
SasCfgData sas_data; /* Sas config. data */
FcCfgData fc_data; /* Fc config. data */ struct proc_dir_entry *ioc_dentry; struct _MPT_ADAPTER *alt_ioc; /* ptr to 929 bound adapter port */
u32 biosVersion; /* BIOS version from IO Unit Page 2 */ int eventTypes; /* Event logging parameters */ int eventContext; /* Next event context */ int eventLogSize; /* Max number of cached events */ struct _mpt_ioctl_events *events; /* pointer to event log */
u8 *cached_fw; /* Pointer to FW */
dma_addr_t cached_fw_dma; int hs_reply_idx; #ifndef MFCNT
u32 pad0; #else
u32 mfcnt; #endif
u32 NB_for_64_byte_frame;
u32 hs_req[MPT_MAX_FRAME_SIZE/sizeof(u32)];
u16 hs_reply[MPT_MAX_FRAME_SIZE/sizeof(u16)];
IOCFactsReply_t facts;
PortFactsReply_t pfacts[2];
FCPortPage0_t fc_port_page0[2];
LANPage0_t lan_cnfg_page0;
LANPage1_t lan_cnfg_page1;
u8 ir_firmware; /* =1 if IR firmware detected */ /* * Description: errata_flag_1064 * If a PCIX read occurs within 1 or 2 cycles after the chip receives * a split completion for a read data, an internal address pointer incorrectly * increments by 32 bytes
*/ int errata_flag_1064; int aen_event_read_flag; /* flag to indicate event log was read*/
u8 FirstWhoInit;
u8 upload_fw; /* If set, do a fw upload */
u8 NBShiftFactor; /* NB Shift Factor based on Block Size (Facts) */
u8 pad1[4];
u8 DoneCtx;
u8 TaskCtx;
u8 InternalCtx; struct list_head list; struct net_device *netdev; struct list_head sas_topology; struct mutex sas_topology_mutex;
struct workqueue_struct *fw_event_q; struct list_head fw_event_list;
spinlock_t fw_event_lock;
u8 fw_events_off; /* if '1', then ignore events */
/* * MPT_SCSI_HOST defines - Used by the IOCTL and the SCSI drivers * Private to the driver.
*/ /* LOCAL structure and fields used when processing * internally generated commands. These include: * bus scan, dv and config requests.
*/ typedefstruct _MPT_LOCAL_REPLY {
ConfigPageHeader_t header; int completion;
u8 sense[SCSI_STD_SENSE_BYTES];
u8 scsiStatus;
u8 skip;
u32 pad;
} MPT_LOCAL_REPLY;
/* The TM_STATE variable is used to provide strict single threading of TM * requests as well as communicate TM error conditions.
*/ #define TM_STATE_NONE (0) #define TM_STATE_IN_PROGRESS (1) #define TM_STATE_ERROR (2)
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * More Dynamic Multi-Pathing stuff...
*/
/* Forward decl, a strange C thing, to prevent gcc compiler warnings */ struct scsi_cmnd;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.