aac_regs.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2000 Michael Smith
* Copyright (c) 2000-2001 Scott Long
* 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.
*
*/
#ifndef __AAC_REGS_H__
#define __AAC_REGS_H__
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/* Status bits in the doorbell registers */
/* FIB */
/* commands */
/* complete */
/* printf */
#define AAC_DB_INTR_BITS (AAC_DB_COMMAND_READY | \
/* Status bits in firmware status reg */
#define AAC_SELF_TEST_FAILED 0x00000004
#define AAC_READY 0x00000080
#define AAC_KERNEL_PANIC 0x00000100
/* Aac registers definitions */
#define AAC_MONKER_INITSTRUCT 0x05
#define AAC_MONKER_SYNCFIB 0x0c
#define AAC_MONKER_GETKERNVER 0x11
#define AAC_MONKER_GETINFO 0x19
#define AAC_BLK_SIZE 512
#pragma pack(1)
/*
* FIB (FSA Interface Block) this is the datastructure passed between
* the host and adapter.
*/
struct aac_fib_header {
int prev;
int next;
};
struct aac_fib {
struct aac_fib_header Header;
};
/* fib transfer state */
/* FIB types */
#define AAC_FIBTYPE_TFIB 1
/* FIB commands */
#define ContainerCommand 500
#define RequestAdapterInfo 703
/* Structures used to respond to a RequestAdapterInfo fib */
struct FsaRev {
union {
struct {
} comp;
} external;
};
struct aac_adapter_info {
struct FsaRev HardwareRevision;
};
/* Container creation data */
struct aac_container_creation {
};
struct aac_mntobj {
char FileSystemName[16];
struct aac_container_creation CreateInfo;
union {
} ObjExtension;
};
struct aac_mntinfo {
};
struct aac_mntinforesp {
struct aac_mntobj MntObj;
};
/* volumn manager commands */
#define VM_NameServe 1
#define VM_CtBlockRead 6
#define VM_CtBlockWrite 7
/* Host-addressable object types */
#define FT_FILESYS 8
struct aac_sg_entry {
};
struct aac_sg_table {
/* SUN's CC cannot accept [0] */
};
/*
* These structures are packed into the 'data' area in the FIB.
*/
struct aac_blockread {
struct aac_sg_table SgMap;
};
struct aac_blockwrite {
struct aac_sg_table SgMap;
};
/* Write 'stability' options */
#define CSTABLE 1
#define CUNSTABLE 2
/* Fibs for the controller to send us messages */
#define AAC_ADAPTER_FIBS 8
/* Fibs for the host I/O request */
#define AAC_HOST_FIBS 256
/* buffer for text messages from the controller */
#define AAC_ADAPTER_PRINT_BUFSIZE 256
#define AAC_INIT_STRUCT_REVISION 3
#define AAC_INIT_STRUCT_MINIPORT_REVISION 1
#define AAC_PAGE_SIZE 4096
struct aac_adapter_init {
};
/* ************AAC QUEUE DEFINES (BELOW)*********** */
#define AAC_QUEUE_ALIGN 16
#define AAC_QUEUE_COUNT 8
#define AAC_PRODUCER_INDEX 0
#define AAC_CONSUMER_INDEX 1
struct aac_queue_entry {
};
/*
* Queue names
*
* Note that we base these at 0 in order to use them as array indices.
* Adaptec used base 1 for some unknown reason, and sorted them in a
* different order.
*/
#define AAC_HOST_NORM_CMD_Q 0
#define AAC_HOST_HIGH_CMD_Q 1
#define AAC_ADAP_NORM_CMD_Q 2
#define AAC_ADAP_HIGH_CMD_Q 3
#define AAC_HOST_NORM_RESP_Q 4
#define AAC_HOST_HIGH_RESP_Q 5
#define AAC_ADAP_NORM_RESP_Q 6
#define AAC_ADAP_HIGH_RESP_Q 7
/*
* We establish 4 command queues and matching response queues. Queues must
* be 16-byte aligned, and are sized as follows:
*/
/* command adapter->host, normal priority */
#define AAC_HOST_NORM_CMD_ENTRIES 8
/* command adapter->host, high priority */
#define AAC_HOST_HIGH_CMD_ENTRIES 4
/* command host->adapter, normal priority */
#define AAC_ADAP_NORM_CMD_ENTRIES 512
/* command host->adapter, high priority */
#define AAC_ADAP_HIGH_CMD_ENTRIES 4
/* response, adapter->host, normal priority */
#define AAC_HOST_NORM_RESP_ENTRIES 512
/* response, adapter->host, high priority */
#define AAC_HOST_HIGH_RESP_ENTRIES 4
/* response, host->adapter, normal priority */
#define AAC_ADAP_NORM_RESP_ENTRIES 8
/* response, host->adapter, high priority */
#define AAC_ADAP_HIGH_RESP_ENTRIES 4
#define AAC_TOTALQ_LENGTH (AAC_HOST_HIGH_CMD_ENTRIES + \
/*
* Table of queue indices and queues used to communicate with the
* controller. This structure must be aligned to AAC_QUEUE_ALIGN
*/
struct aac_queue_table {
/* queue entry structures (layout mandated by adapter) */
struct aac_queue_entry qt_HostNormCmdQueue \
struct aac_queue_entry qt_HostHighCmdQueue \
struct aac_queue_entry qt_AdapNormCmdQueue \
struct aac_queue_entry qt_AdapHighCmdQueue \
struct aac_queue_entry qt_HostNormRespQueue\
struct aac_queue_entry qt_HostHighRespQueue\
struct aac_queue_entry qt_AdapNormRespQueue\
struct aac_queue_entry qt_AdapHighRespQueue\
};
/* ************AAC QUEUE DEFINES (ABOVE)*********** */
#pragma pack()
/* AAC Communication Space */
struct aac_comm_space {
struct aac_queue_table qtable;
char qt_align_pad[AAC_QUEUE_ALIGN];
struct aac_adapter_init init_data;
};
#ifdef __cplusplus
}
#endif
#endif /* __AAC_REGS_H__ */