/* * linux/drivers/message/fusion/mptioctl.h * Fusion MPT misc device (ioctl) driver. * 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
*/
/* * SPARC PLATFORM REMARKS: * IOCTL data structures that contain pointers * will have different sizes in the driver and applications * (as the app. will not use 8-byte pointers). * Apps should use MPTFWDOWNLOAD and MPTCOMMAND. * The driver will convert data from * mpt_fw_xfer32 (mpt_ioctl_command32) to mpt_fw_xfer (mpt_ioctl_command) * internally. * * If data structures change size, must handle as in IOCGETINFO.
*/ struct mpt_fw_xfer { unsignedint iocnum; /* IOC unit number */ unsignedint fwlen; void __user *bufp; /* Pointer to firmware buffer */
};
/* * IOCTL header structure. * iocnum - must be defined. * port - must be defined for all IOCTL commands other than MPTIOCINFO * maxDataSize - ignored on MPTCOMMAND commands * - ignored on MPTFWREPLACE commands * - on query commands, reports the maximum number of bytes to be returned * to the host driver (count includes the header). * That is, set to sizeof(struct mpt_ioctl_iocinfo) for fixed sized commands. * Set to sizeof(struct mpt_ioctl_targetinfo) + datasize for variable * sized commands. (MPTTARGETINFO, MPTEVENTREPORT)
*/ typedefstruct _mpt_ioctl_header { unsignedint iocnum; /* IOC unit number */ unsignedint port; /* IOC port number */ int maxDataSize; /* Maximum Num. bytes to transfer on read */
} mpt_ioctl_header;
/* * Adapter Information Page * Read only. * Data starts at offset 0xC
*/ #define MPT_IOCTL_INTERFACE_SCSI (0x00) #define MPT_IOCTL_INTERFACE_FC (0x01) #define MPT_IOCTL_INTERFACE_FC_IP (0x02) #define MPT_IOCTL_INTERFACE_SAS (0x03) #define MPT_IOCTL_VERSION_LENGTH (32)
struct mpt_ioctl_iocinfo {
mpt_ioctl_header hdr; int adapterType; /* SCSI or FCP */ int port; /* port number */ int pciId; /* PCI Id. */ int hwRev; /* hardware revision */ int subSystemDevice; /* PCI subsystem Device ID */ int subSystemVendor; /* PCI subsystem Vendor ID */ int numDevices; /* number of devices */ int FWVersion; /* FW Version (integer) */ int BIOSVersion; /* BIOS Version (integer) */ char driverVersion[MPT_IOCTL_VERSION_LENGTH]; /* Driver Version (string) */ char busChangeEvent; char hostId; char rsvd[2]; struct mpt_ioctl_pci_info2 pciInfo; /* Added Rev 2 */
};
struct mpt_ioctl_iocinfo_rev1 {
mpt_ioctl_header hdr; int adapterType; /* SCSI or FCP */ int port; /* port number */ int pciId; /* PCI Id. */ int hwRev; /* hardware revision */ int subSystemDevice; /* PCI subsystem Device ID */ int subSystemVendor; /* PCI subsystem Vendor ID */ int numDevices; /* number of devices */ int FWVersion; /* FW Version (integer) */ int BIOSVersion; /* BIOS Version (integer) */ char driverVersion[MPT_IOCTL_VERSION_LENGTH]; /* Driver Version (string) */ char busChangeEvent; char hostId; char rsvd[2]; struct mpt_ioctl_pci_info pciInfo; /* Added Rev 1 */
};
/* Original structure, must always accept these * IOCTLs. 4 byte pads can occur based on arch with * above structure. Wish to re-align, but cannot.
*/ struct mpt_ioctl_iocinfo_rev0 {
mpt_ioctl_header hdr; int adapterType; /* SCSI or FCP */ int port; /* port number */ int pciId; /* PCI Id. */ int hwRev; /* hardware revision */ int subSystemDevice; /* PCI subsystem Device ID */ int subSystemVendor; /* PCI subsystem Vendor ID */ int numDevices; /* number of devices */ int FWVersion; /* FW Version (integer) */ int BIOSVersion; /* BIOS Version (integer) */ char driverVersion[MPT_IOCTL_VERSION_LENGTH]; /* Driver Version (string) */ char busChangeEvent; char hostId; char rsvd[2];
};
/* * Device Information Page * Report the number of, and ids of, all targets * on this IOC. The ids array is a packed structure * of the known targetInfo. * bits 31-24: reserved * 23-16: LUN * 15- 8: Bus Number * 7- 0: Target ID
*/ struct mpt_ioctl_targetinfo {
mpt_ioctl_header hdr; int numDevices; /* Num targets on this ioc */ int targetInfo[1];
};
/* * Event reporting IOCTL's. These IOCTL's will * use the following defines:
*/ struct mpt_ioctl_eventquery {
mpt_ioctl_header hdr; unsignedshort eventEntries; unsignedshort reserved; unsignedint eventTypes;
};
/* Replace the FW image cached in host driver memory * newImageSize - image size in bytes * newImage - first byte of the new image
*/ typedefstruct mpt_ioctl_replace_fw {
mpt_ioctl_header hdr; int newImageSize;
u8 newImage[1];
} mpt_ioctl_replace_fw_t;
/* General MPT Pass through data strucutre * * iocnum * timeout - in seconds, command timeout. If 0, set by driver to * default value. * replyFrameBufPtr - reply location * dataInBufPtr - destination for read * dataOutBufPtr - data source for write * senseDataPtr - sense data location * maxReplyBytes - maximum number of reply bytes to be sent to app. * dataInSize - num bytes for data transfer in (read) * dataOutSize - num bytes for data transfer out (write) * dataSgeOffset - offset in words from the start of the request message * to the first SGL * MF[1]; * * Remark: Some config pages have bi-directional transfer, * both a read and a write. The basic structure allows for * a bidirectional set up. Normal messages will have one or * both of these buffers NULL.
*/ struct mpt_ioctl_command {
mpt_ioctl_header hdr; int timeout; /* optional (seconds) */ char __user *replyFrameBufPtr; char __user *dataInBufPtr; char __user *dataOutBufPtr; char __user *senseDataPtr; int maxReplyBytes; int dataInSize; int dataOutSize; int maxSenseBytes; int dataSgeOffset; char MF[1];
};
/* * SPARC PLATFORM: See earlier remark.
*/ #ifdefined(__KERNEL__) && defined(CONFIG_COMPAT) struct mpt_ioctl_command32 {
mpt_ioctl_header hdr; int timeout;
u32 replyFrameBufPtr;
u32 dataInBufPtr;
u32 dataOutBufPtr;
u32 senseDataPtr; int maxReplyBytes; int dataInSize; int dataOutSize; int maxSenseBytes; int dataSgeOffset; char MF[1];
}; #endif/*}*/
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.