aac.h revision 0749e8de8370b977962d1cbaa31a8ebbaf755a01
2N/A * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * Copyright 2005-06 Adaptec, Inc. 2N/A * Copyright (c) 2005-06 Adaptec Inc., Achim Leubner 2N/A * Copyright (c) 2000 Michael Smith 2N/A * Copyright (c) 2001 Scott Long 2N/A * Copyright (c) 2000 BSDi 2N/A * All rights reserved. 2N/A * Redistribution and use in source and binary forms, with or without 2N/A * modification, are permitted provided that the following conditions 2N/A * 1. Redistributions of source code must retain the above copyright 2N/A * notice, this list of conditions and the following disclaimer. 2N/A * 2. Redistributions in binary form must reproduce the above copyright 2N/A * notice, this list of conditions and the following disclaimer in the 2N/A * documentation and/or other materials provided with the distribution. 2N/A * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 2N/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2N/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2N/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF /* Definitions for mode sense */ * 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. /* Adapter hardware interface types */ * 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 char *
vid;
/* ASCII data for INQUIRY command vendor id */ char *
desc;
/* ASCII data for INQUIRY command product id */ * Device config change events /* Non-DASD phys. device descrption, eg. CDROM or tape */ * 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 *
next;
/* next slot in the free slot list */ int index;
/* index of this slot */ struct aac_cmd *
acp;
/* command using this slot */ struct aac_fib *
fibp;
/* virtual address of FIB memory */ * Scatter-gather list structure defined by HBA hardware }
ad64;
/* 64 bit address */ * Note: should be the first member for aac_cmd_queue to work /* For non-aligned buffer and SRB */ /* Data transfer state */ /* FIB construct function */ /* Call back function for completed command */ /* FIB for this IO command */ /* Flags for attach tracking */ /* Driver running states */ * 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 */ #
define AAC_FLAGS_17SG (
1 <<
8)
/* quirk: 17 scatter gather maximum */#
define AAC_FLAGS_34SG (
1 <<
9)
/* quirk: 34 scatter gather maximum */ int ctx_filled;
/* aifq is full for this fib context */ int card;
/* index to aac_cards */ /* mapped to address the card */ int flags;
/* firmware features enabled */ int legacy;
/* legacy device naming */ /* Communication space */ /* Old Comm. interface: message queues */ /* New Comm. interface */ int state;
/* driver state */ * Each aac command flows through wait(or wait_sync) queue, * busy queue, and complete queue sequentially. int ndrains;
/* number of draining threads */ /* Internal events handling */ int aifq_idx;
/* slot for next new AIF */ int aifq_wrap;
/* AIF queue has ever been wrapped */ /* MSI specific fields */ int intr_cnt;
/* # of intrs count returned */ int intr_cap;
/* Interrupt capabilities */ /* UART trace printf variables */ * 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