/* * 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:[email protected]) * */ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* 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 */ #ifndef MPTCTL_H_INCLUDED #define MPTCTL_H_INCLUDED /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * */ #define MPT_MISCDEV_BASENAME … #define MPT_MISCDEV_PATHNAME … #define MPT_PRODUCT_LENGTH … /* * Generic MPT Control IOCTLs and structures */ #define MPT_MAGIC_NUMBER … #define MPTRWPERF … #define MPTFWDOWNLOAD … #define MPTCOMMAND … #if defined(__KERNEL__) && defined(CONFIG_COMPAT) #define MPTFWDOWNLOAD32 … #define MPTCOMMAND32 … #endif #define MPTIOCINFO … #define MPTIOCINFO1 … #define MPTIOCINFO2 … #define MPTTARGETINFO … #define MPTTEST … #define MPTEVENTQUERY … #define MPTEVENTENABLE … #define MPTEVENTREPORT … #define MPTHARDRESET … #define MPTFWREPLACE … /* * 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 { … }; #if defined(__KERNEL__) && defined(CONFIG_COMPAT) struct mpt_fw_xfer32 { … }; #endif /*}*/ /* * 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) */ mpt_ioctl_header; /* * Issue a diagnostic reset */ struct mpt_ioctl_diag_reset { … }; /* * PCI bus/device/function information structure. */ struct mpt_ioctl_pci_info { … }; struct mpt_ioctl_pci_info2 { … }; /* * Adapter Information Page * Read only. * Data starts at offset 0xC */ #define MPT_IOCTL_INTERFACE_SCSI … #define MPT_IOCTL_INTERFACE_FC … #define MPT_IOCTL_INTERFACE_FC_IP … #define MPT_IOCTL_INTERFACE_SAS … #define MPT_IOCTL_VERSION_LENGTH … struct mpt_ioctl_iocinfo { … }; struct mpt_ioctl_iocinfo_rev1 { … }; /* 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 { … }; /* * 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 { … }; /* * Event reporting IOCTL's. These IOCTL's will * use the following defines: */ struct mpt_ioctl_eventquery { … }; struct mpt_ioctl_eventenable { … }; #ifndef __KERNEL__ typedef struct { uint event; uint eventContext; uint data[2]; } MPT_IOCTL_EVENTS; #endif struct mpt_ioctl_eventreport { … }; #define MPT_MAX_NAME … struct mpt_ioctl_test { … }; /* Replace the FW image cached in host driver memory * newImageSize - image size in bytes * newImage - first byte of the new image */ 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 { … }; /* * SPARC PLATFORM: See earlier remark. */ #if defined(__KERNEL__) && defined(CONFIG_COMPAT) struct mpt_ioctl_command32 { … }; #endif /*}*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ #define CPQFCTS_IOC_MAGIC … #define HP_IOC_MAGIC … #define HP_GETHOSTINFO … #define HP_GETHOSTINFO1 … #define HP_GETTARGETINFO … hp_header_t; /* * Header: * iocnum required (input) * host ignored * channe ignored * id ignored * lun ignored */ hp_host_info_t; /* replace ulongs with uints, need to preserve backwards * compatibility. */ hp_host_info_rev0_t; /* * Header: * iocnum required (input) * host required * channel required (bus number) * id required * lun ignored * * All error values between 0 and 0xFFFF in size. */ hp_target_info_t; #define HP_STATUS_OTHER … #define HP_STATUS_OK … #define HP_STATUS_FAILED … #define HP_BUS_WIDTH_UNK … #define HP_BUS_WIDTH_8 … #define HP_BUS_WIDTH_16 … #define HP_BUS_WIDTH_32 … #define HP_DEV_SPEED_ASYNC … #define HP_DEV_SPEED_FAST … #define HP_DEV_SPEED_ULTRA … #define HP_DEV_SPEED_ULTRA2 … #define HP_DEV_SPEED_ULTRA160 … #define HP_DEV_SPEED_SCSI1 … #define HP_DEV_SPEED_ULTRA320 … /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ #endif