/*
*/
/*
* Copyright 2005-06 Adaptec, Inc.
* Copyright (c) 2005-06 Adaptec Inc., Achim Leubner
* Copyright (c) 2000 Michael Smith
* Copyright (c) 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_H_
#define _AAC_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifndef AAC_DRIVER_BUILD
#endif
#define STR(s) # s
#define AACOK 0
/* Definitions for mode sense */
#ifndef SD_MODE_SENSE_PAGE3_CODE
#endif
#ifndef SD_MODE_SENSE_PAGE4_CODE
#endif
#ifndef SCMD_SYNCHRONIZE_CACHE
#endif
/*
* The controller reports status events in AIFs. We hang on to a number of
* these in order to pass them out to user-space management tools.
*/
#ifdef __x86
#else
#endif
/* Adapter hardware interface types */
#define AAC_HWIF_UNKNOWN 0
#define AAC_TYPE_UNKNOWN 0
/*
* Internal events that will be handled serially by aac_event_thread()
*/
/*
* AAC_CMDQ_SYNC should be 0 and AAC_CMDQ_ASYNC be 1 for Sync FIB io
* to be served before async FIB io, see aac_start_waiting_io().
* So that io requests sent by interactive userland commands get
* responded asap.
*/
enum aac_cmdq {
};
/*
* IO command flags
*/
struct aac_cmd_queue {
};
struct aac_card_type {
};
/* Device types */
/* Device flags */
/*
* Device config change events
*/
enum aac_cfg_event {
};
struct aac_device {
int flags;
};
/* Array description */
struct aac_container {
};
/* Non-DASD phys. device descrption, eg. CDROM or tape */
struct aac_nondasd {
};
/*
* The firmware can support a lot of outstanding commands. Each aac_slot
* is corresponding to one of such commands. It records the command and
* associated DMA resource for FIB command.
*/
struct aac_slot {
};
/*
* Scatter-gather list structure defined by HBA hardware
*/
struct aac_sge {
union {
struct {
} addr;
};
/* aac_cmd flags */
struct aac_softstate;
struct aac_cmd {
/*
* Note: should be the first member for aac_cmd_queue to work
* correctly.
*/
int cmdlen;
int flags;
/* For non-aligned buffer and SRB */
/* Data transfer state */
/* FIB construct function */
/* Call back function for completed command */
/* FIB for this IO command */
#ifdef DEBUG
#endif
};
/* Flags for attach tracking */
/* Driver running states */
#define AAC_STATE_STOPPED 0
/*
* Flags for aac firmware
* Note: Quirks are only valid for the older cards. These cards only supported
* old comm. Thus they are not valid for any cards that support new comm.
*/
/* between 0x2000 & 0x7FFFFFFF */
struct aac_softstate;
struct aac_interface {
};
struct aac_fib_context {
int ctx_idx;
int ctx_flags;
int ctx_overrun;
};
struct aac_softstate {
/* mapped to address the card */
int instance;
int slen;
/* DMA attributes */
/* PCI spaces */
/* Communication space */
/* Old Comm. interface: message queues */
/* New Comm. interface */
/*
* Command queues
* Each aac command flows through wait(or wait_sync) queue,
* busy queue, and complete queue sequentially.
*/
/* I/O slots and FIBs */
/* Internal timer */
/* Internal events handling */
int events;
/* AIF */
int fm_capabilities;
/* MSI specific fields */
int intr_size;
#ifdef DEBUG
/* UART trace printf variables */
#endif
};
/*
* The following data are kept stable because they are only written at driver
* initialization, and we do not allow them changed otherwise even at driver
* re-initialization.
*/
#ifdef DEBUG
/*
* Flags for FIB print
*/
/* FIB sources */
/* FIB components */
/* FIB states */
extern uint32_t aac_debug_flags;
extern int aac_dbflag_on(struct aac_softstate *, int);
if (aac_dbflag_on((s), AACDB_FLAGS_MISC)) \
#define AACDB_PRINT_IOCTL(s, ...) { \
if (aac_dbflag_on((s), AACDB_FLAGS_IOCTL)) \
#define AACDB_PRINT_TRAN(s, ...) { \
if (aac_dbflag_on((s), AACDB_FLAGS_SCMD)) \
#define DBCALLED(s, n) { \
if (aac_dbflag_on((s), AACDB_FLAGS_FUNC ## n)) \
#define AACDB_PRINT_SCMD(s, x) { \
#define AACDB_PRINT_AIF(s, x) { \
#define AACDB_PRINT_FIB(s, x) { \
#else /* DEBUG */
#define AACDB_PRINT(s, lev, ...)
#define AACDB_PRINT_IOCTL(s, ...)
#define AACDB_PRINT_TRAN(s, ...)
#define AACDB_PRINT_FIB(s, x)
#define AACDB_PRINT_SCMD(s, x)
#define AACDB_PRINT_AIF(s, x)
#define DBCALLED(s, n)
#endif /* DEBUG */
#ifdef __cplusplus
}
#endif
#endif /* _AAC_H_ */