/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 1999,2000 Michael Smith
* Copyright (c) 2000 BSDi
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* 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 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Copyright (c) 2002 Eric Moore
* Copyright (c) 2002 LSI Logic Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. The party using or redistributing the source code and binary forms
* agrees to the disclaimer below and the terms and conditions set forth
* herein.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* 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 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Note: If the structures and variables definitions can be found from the
* "MegaRAID PCI SCSI Disk Array Controller F/W Technical Reference
* Manual", the names defined in this documents will also be provided
* by " ", and the descriptions for each variables and constants are
* given as well.
*/
#ifndef _AMRREG_H
#define _AMRREG_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Array constraints for controllers that support 8 logic drivers
*/
/*
* Array constraints for controllers that support 40 logic drivers
*/
/*
* The buffer size for enquiry command
*/
/*
* Constants used for poll command
*/
#pragma pack(1)
/*
* The AMR mailbox. This is the main interface for
* programming the controller. Must be aligned at
* a 16-Byte physical address boundary.
*
* The first sixteen bytes are commands to the controller.
*
* There are two formats:
* 1. Commands for I/O: mb_blkcount/mb_lba are used.
* 2. Commands for I/O control: mb_channel/mb_param are used.
*
*/
struct amr_mailbox
{
/* code of the command */
/* id for this command */
union {
/* number of sectors for */
/* this request */
/* OUT, Channel No. and */
/* parameters */
} mb_un1;
union {
/* LBA for this request */
} mb_un2;
/* physical address for a */
/* non-s/g command or the */
/* physical address of a s/g */
/* list for a s/g command */
/* the log-drive for which */
/* this request is intended */
/* number of s/g elements */
/* to 1 before submit the */
/* command, firmware picks */
/* it and makes this byte 0 */
/* number of status returned */
/* by firmware */
/* the IDs in mb_completed[] */
/* "CompletedIdList", IN, */
/* finished ID list */
/* polling/interrupt-driven */
/* polling/interrupt-driver */
};
/* Fields before mb_nstatus are the portions worth copying for controller */
/*
* I/O commands expect the physical address of an array
* in mb_physaddr.
*
* sg_addr is a physical address.
*/
struct amr_sgentry
{
};
/*
* Mailbox commands
* Note: This is a subset for the command set
*/
/*
* Subcodes for AMR_CMD_CONFIG
*/
/*
* Subcodes for AMR_CMD_MISC_OPCODE
*/
/*
* Mailbox command results
*/
/*
* Adapter Info structure
*/
struct amr_adapter_info
{
/* commands supported */
/* varies from 0%-100% */
/* supported per chan */
/* Chans present on this */
/* adapter */
/* FW has been downloaded */
/* of 0xC0000832 */
/* terms of Seconds */
/* increase with evry */
/* configuration change */
/* increase with every drive */
/* inserted */
/* of inserted drive */
/* status */
/* reserved */
};
/*
* aa_batterystatus values
*/
/*
* Logical Drive info structure
*/
struct amr_logdrive_info
{
/* configured logic drivers */
/* "LDrvSize", size of each */
/* logic driver */
/* "LDrvProp", properties of */
/* each logic driver */
/* "LDrvState", state of */
/* each logic driver */
};
/*
* Logical drive only: al_properties
*/
/*
* Physical Drive info structure
*/
struct amr_physdrive_info
{
/* "PDrvState", state of each */
/* phy-driver. Low nibble is */
/* current state, high nibble */
/* is previous state */
};
/*
*
* Both logical and physical drives maintain
* nibble of the _state field.
*/
/*
* Logical drives: al_state.
*/
/*
* Physical drives: ap_state.
*/
/*
* Notify structure
*/
struct amr_notify
{
/* counter */
/* change counter */
/* last param modified */
/* write config occurred */
/* drive operation */
/* operations */
/* the operation */
/* of logical drive state */
/* of physical drive state */
/* xfer rate change */
/* params of last pdrv */
/* loop 0 */
/* loop 1 */
/* fc loop 0 */
/* fc loop 1 */
};
/*
* an_param values
*/
/*
* an_ldrvopcmd values
*/
/*
* an_ldrvopstatus: return values after issuing command
* via an_ldrvopcmd.
*/
/*
*/
/*
* Enquiry response structure for AMR_CMD_ENQUIRY, AMR_CMD_EXT_ENQUIRY and
* AMR_CMD_EXT_ENQUIRY2.
*/
struct amr_enquiry
{
};
/*
* ae_signature values
*/
/*
* Enquiry3 structure
*/
struct amr_enquiry3
{
/* in bytes(resvd excluded) */
/* structure */
/* rebuild rate in % */
/* flush interval in seconds */
/* count of inserted drives */
/* drivers configured */
/* "reconState", */
/* reconstruction state */
/* "lDrvOpStatus", operation */
/* state per logic driver */
/* "lDrvSize", size of each */
/* logic driver */
/* "lDrvProp", properties of */
/* each logic driver */
/* "lDrvState", state of */
/* each logic driver */
/* "pDrvState", state of each */
/* physical driver */
/* "physDrvFormat" */
/* transfer rates */
};
/*
* Product Info structure. Query for this via AMR_CONFIG_PRODUCT_INFO.
*/
struct amr_prodinfo
{
/* in bytes */
/* is 0x00282008, indicating */
/* 0x28 max logical drives, */
/* 0x20 maximum stripes and */
/* 0x08 maximum spans */
/* of concurrent commands */
/* of SCSI channels present */
/* fibre loops present */
/* in MB */
/* identifier */
/* of notify counters */
};
/*
* The union for used enquiry commands
*/
union amr_enq_buffer
{
};
#pragma pack()
#ifdef _KERNEL
/*
* I/O Port offsets
*/
/*
* Doorbell registers
*/
/*
* Initialisation status
*/
/*
* I/O primitives
*/
/*
* I/O registers
*/
/*
* I/O magic numbers
*/
/*
* Initialisation status
*/
/*
* I/O primitives
*/
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _AMRREG_H */