/*
* LSIUtil -- configuration utility for MPT adapters (FC, SCSI, and SAS/SATA)
*
* Written by Stephen F. Shirron, October 11, 2002
*/
#define LSIUTIL_VERSION "Version 1.57, April 28, 2008"
char what[] = "@(#)LSI Logic MPT Configuration Utility, " LSIUTIL_VERSION;
#ifndef MAX_DEVICES
#define MAX_DEVICES 99
#endif
#ifndef REGISTER_ACCESS
#define REGISTER_ACCESS 1
#endif
#ifndef VERIFY_ENDIANNESS
#define VERIFY_ENDIANNESS 0
#endif
#if !EFI
#include <fcntl.h>
#if WIN32
#include <io.h>
#else
#define _cdecl
#endif
#include <sys/stat.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#if WIN32
#include <windows.h>
#include "inc/devioctl.h"
#include <basetsd.h>
#ifdef _CONSOLE
#pragma warning(disable:4242)
#include "inc/getopt.h"
#define sleep(x) _sleep(x*1000)
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#if !_WIN64
typedef unsigned long ULONG_PTR;
#endif
#define stricmp _stricmp
#define strnicmp _strnicmp
#define open _open
#define close _close
#define read _read
#define write _write
#define stat _stat
#define fstat _fstat
#define INT64_FMT "I64"
#else
#define INT64_FMT "ll"
#include <unistd.h>
#include <getopt.h>
int optopt;
int optind;
#endif
#define strcasecmp stricmp
#define strncasecmp strnicmp
#include "inc/ntddscsi.h"
#endif
#if __linux__ || __sparc__ || __irix__ || __alpha__
#include <stdarg.h>
#include <unistd.h>
#include <strings.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <limits.h>
#include <dirent.h>
#define FALSE 0
#define TRUE 1
typedef int HANDLE;
#define O_BINARY 0
#define min(x,y) ((int)(x) < (int)(y) ? (x) : (y))
#define max(x,y) ((int)(x) > (int)(y) ? (x) : (y))
#define INT64_FMT "ll"
#endif
#if __linux__
#include <linux/stddef.h>
#ifndef offsetof
#define offsetof(type,member) ((size_t)&((type *)0)->member)
#endif
#define TotalBufferSize DataSize
#define DataBuffer DiagnosticData
#include <scsi/scsi.h>
#if i386
#include <sys/io.h>
#endif
#define LINUX_MOD_DEVICETABLE_H
#include <linux/pci.h>
#include <sys/mman.h>
#define REG_IO_READ 1
#define REG_IO_WRITE 2
#define REG_MEM_READ 3
#define REG_MEM_WRITE 4
#define REG_DIAG_READ 5
#define REG_DIAG_WRITE 6
#define REG_DIAG_WRITE_BYTE 7
#endif
#if __sparc__
#include <libdevinfo.h>
#include <stddef.h>
#include <sys/param.h>
#include <sys/mkdev.h>
typedef struct
{
caddr_t client;
caddr_t phci;
caddr_t addr;
uint_t buf_elem;
void *ret_buf;
uint_t *ret_elem;
} sv_iocdata_t;
#define SCSI_VHCI_GET_CLIENT_NAME (('x' << 8) + 0x03)
#define NAME_MAX MAXNAMLEN
#define getmajor(x) (((x)>>NBITSMINOR)&MAXMAJ)
#define getminor(x) ((x)&MAXMIN)
#define MINOR2INST(x) ((x)>>6)
#endif
#if DOS
#include <unistd.h>
#include <conio.h>
#include <dos.h>
#include <time.h>
#include <errno.h>
#include <stddef.h>
#include <stdarg.h>
#define FALSE 0
#define TRUE 1
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef unsigned int PHYSICAL_ADDRESS;
typedef unsigned int mpt_bus_addr_t;
typedef struct mpt_adap *HANDLE;
#define strcasecmp stricmp
#define strncasecmp strnicmp
#define DELAY(n) mpt_delay(adap, n)
#define REG_IO_READ 1
#define REG_IO_WRITE 2
#define REG_MEM_READ 3
#define REG_MEM_WRITE 4
#define REG_DIAG_READ 5
#define REG_DIAG_WRITE 6
#define REG_DIAG_WRITE_BYTE 7
#define INT64_FMT "ll"
#endif
#endif
#if EFI
#if EFIEBC
#pragma warning(disable:175)
#endif
#define _cdecl
#include "helper.h"
#include "getopt.h"
#define O_BINARY 0
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef EFI_PHYSICAL_ADDRESS mpt_bus_addr_t;
typedef struct mpt_adap *HANDLE;
#define min(x,y) ((int)(x) < (int)(y) ? (x) : (y))
#define max(x,y) ((int)(x) > (int)(y) ? (x) : (y))
#define DELAY(n) mpt_delay(adap, n)
#define REG_IO_READ 1
#define REG_IO_WRITE 2
#define REG_MEM_READ 3
#define REG_MEM_WRITE 4
#define REG_DIAG_READ 5
#define REG_DIAG_WRITE 6
#define REG_DIAG_WRITE_BYTE 7
#define INT64_FMT "ll"
extern EFI_HANDLE gImageHandle;
extern EFI_LOADED_IMAGE *gLoadedImage;
#endif
#if DOS || EFI
#define CHUNK_SIZE 0x10000
#else
#define CHUNK_SIZE 0x4000
#endif
typedef unsigned char U8;
typedef unsigned short U16;
typedef unsigned int U32;
#define MPI_POINTER *
#define MPI2_POINTER *
#if VERIFY_ENDIANNESS
typedef unsigned short * _U16;
typedef unsigned int * _U32;
typedef struct { _U32 Low; _U32 High; } U64;
#else
typedef unsigned short _U16;
typedef unsigned int _U32;
typedef struct { U32 Low; U32 High; } U64;
#endif
#if VERIFY_ENDIANNESS
#define U16 _U16
#define U32 _U32
#endif
#if WIN32 || __linux__ || __sparc__ || DOS || EFI
#pragma pack(1)
#include "lsi/mpi.h"
#include "lsi/mpi_ioc.h"
#include "lsi/mpi_cnfg.h"
#include "lsi/mpi_init.h"
#include "lsi/mpi_fc.h"
#include "lsi/mpi_sas.h"
#include "lsi/mpi_raid.h"
#include "lsi/mpi_tool.h"
#include "lsi/mpi2.h"
#include "lsi/mpi2_ioc.h"
#include "lsi/mpi2_cnfg.h"
#include "lsi/mpi2_init.h"
#include "lsi/mpi2_sas.h"
#include "lsi/mpi2_raid.h"
#include "lsi/mpi2_tool.h"
#pragma pack()
#endif
#if VERIFY_ENDIANNESS
#undef U16
#undef U32
#endif
#if WIN32
#include "inc/sym_dmi.h"
#define ISSUE_BUS_RESET 0x800000FF
typedef struct
{
SRB_IO_CONTROL Sic;
UCHAR Buf[8+128+1024];
} SRB_BUFFER;
typedef struct
{
SRB_IO_CONTROL Sic;
ULONG DiagType;
UCHAR PageVersion[4];
UCHAR Buf[64+32768];
} SRB_DIAG_BUFFER;
#endif
#if __linux__
#ifndef __user
#define __user
#endif
typedef unsigned long long uint64_t;
typedef U8 u8;
typedef U16 u16;
typedef U32 u32;
#include "mptctl.h"
typedef U8 uint8_t;
typedef U16 uint16_t;
typedef U32 uint32_t;
#include "mpt2sas_ctl.h"
#define IOCTL_NAME "/dev/" MPT_MISCDEV_BASENAME
#define IOCTL_NAME2 "/dev/" MPT2SAS_DEV_NAME
#ifdef MPI_FW_DIAG_IOCTL
#define LINUX_DIAG 1
typedef struct
{
mpt_ioctl_header hdr;
unsigned char buf[64+32768];
} IOCTL_DIAG_BUFFER;
#endif
#endif
#if __sparc__
#define TARGET_MPTx
typedef uint8_t UINT8;
typedef uint16_t UINT16;
typedef uint32_t UINT32;
typedef uint64_t UINT64;
#include "inc/dmi_ioctl.h"
#endif
#if __irix__
#define MPI_POINTER *
typedef uint8_t U8;
typedef uint16_t U16;
typedef uint32_t U32;
typedef struct
{
U32 Low;
U32 High;
} mpiU64;
#pragma pack(1)
#define U64 mpiU64
#include "mpi.h"
#include "mpi_ioc.h"
#include "mpi_cnfg.h"
#include "mpi_init.h"
#include "mpi_fc.h"
#include "mpi_sas.h"
#include "mpi_raid.h"
#include "mpi_tool.h"
#pragma pack(0)
#undef U64
#define TARGET_MPT
typedef uint8_t UINT8;
typedef uint16_t UINT16;
typedef uint32_t UINT32;
typedef uint64_t UINT64;
#include "dmi_ioctl.h"
#include <sys/scsi.h>
#endif
#if __alpha__
typedef unsigned __int64 uint64_t;
#define MPI_POINTER *
typedef unsigned char U8;
typedef unsigned short U16;
typedef unsigned int U32;
typedef unsigned long U64;
typedef struct
{
U32 Low;
U32 High;
} mpiU64;
#pragma pack(1)
#define U64 mpiU64
#include "mpi.h"
#include "mpi_ioc.h"
#include "mpi_cnfg.h"
#include "mpi_init.h"
#include "mpi_fc.h"
#include "mpi_sas.h"
#include "mpi_raid.h"
#include "mpi_tool.h"
#pragma pack(0)
#undef U64
typedef U8 u8;
typedef U16 u16;
typedef U32 u32;
typedef U64 u64;
#include "mptctl.h"
#endif
#if DOS
#include "pcidefs.h"
#include "pcilib.h"
#include "dpmilib.h"
#endif
#define printf printfPaged
#define fprintf fprintfPaged
#define swap16(x) \
((((U16)(x)>>8)&0xff) | \
(((U16)(x)&0xff)<<8))
#define swap32(x) \
((((U32)(x)>>24)&0xff) | \
((((U32)(x)>>16)&0xff)<<8) | \
((((U32)(x)>>8)&0xff)<<16) | \
(((U32)(x)&0xff)<<24))
#if WIN32 || __alpha__ || DOS || EFI
#define get16(x) (x)
#define get32(x) (x)
#define set16(x) (x)
#define set32(x) (x)
#define get16x(x) (x)
#define get32x(x) (x)
#defi
lsiutil.tar.gz
5星 · 超过95%的资源 需积分: 50 122 浏览量
2009-04-19
00:43:58
上传
评论 3
收藏 289KB GZ 举报
patrn
- 粉丝: 1
- 资源: 8
最新资源
- 开机次数记忆_单片机C语言实例(纯C语言源代码).zip
- [信息办公]点易网络智能办公系统v3.2_dyoa32.rar
- 1602液晶显示的计算器_单片机C语言实例(纯C语言源代码).zip
- [影音娱乐]火柴天堂音乐系统 v2.0_hcmusic20.rar
- 黑个人blog.zip
- IDEA快速搭建一个SpringBoot3项目
- 【NumberOne专业开发】红色新版仿京东商城模板html源码.rar
- vb图书管理系统(论文+源代码+开题报告+外文翻译+答辩ppt).rar
- [信息办公]电信计费系统完整代码_netctossconformity.rar
- [其他类别]phplib v7.4a_phplib-7.4a.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
- 3
- 4
前往页