Annotation of kernel/bsd/dev/ppc/drvSymbios8xx/Sym8xxInterface.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
        !             3:  *
        !             4:  * @APPLE_LICENSE_HEADER_START@
        !             5:  * 
        !             6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
        !             7:  * Reserved.  This file contains Original Code and/or Modifications of
        !             8:  * Original Code as defined in and that are subject to the Apple Public
        !             9:  * Source License Version 1.1 (the "License").  You may not use this file
        !            10:  * except in compliance with the License.  Please obtain a copy of the
        !            11:  * License at http://www.apple.com/publicsource and read it before using
        !            12:  * this file.
        !            13:  * 
        !            14:  * The Original Code and all software distributed under the License are
        !            15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
        !            16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
        !            17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
        !            18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
        !            19:  * License for the specific language governing rights and limitations
        !            20:  * under the License.
        !            21:  * 
        !            22:  * @APPLE_LICENSE_HEADER_END@
        !            23:  */
        !            24: 
        !            25: /* Sym8xxInterface.h created by russb2 on Sat 30-May-1998 */
        !            26: 
        !            27: /*
        !            28:  * This file contains shared data structures between the script and the driver
        !            29:  *
        !            30:  */
        !            31: 
        !            32: #define MAX_SCSI_TARGETS               16
        !            33: #define MAX_SCSI_LUNS                  8
        !            34: #define MAX_SCSI_TAG                   256
        !            35: #define MIN_SCSI_TAG                   128
        !            36: 
        !            37: #define kHostAdapterSCSIId             7
        !            38: 
        !            39: #define MAX_SCHED_MAILBOXES            256
        !            40: 
        !            41: #define kSCSITimerIntervalMS           250
        !            42: #define kReqSenseTimeoutMS             3000
        !            43: #define kAbortTimeoutMS                        3000
        !            44: #define kResetQuiesceDelayMS           3000
        !            45: #define kAbortScriptTimeoutMS          50
        !            46: 
        !            47: /*
        !            48:  * NEXUS DATA Structure
        !            49:  *
        !            50:  * The Nexus structure contains per-request information for the script/driver
        !            51:  * to execute a SCSI request.
        !            52:  */
        !            53: 
        !            54: typedef struct SGEntry
        !            55: {
        !            56:     u_int32_t                  length;
        !            57:     u_int32_t                  physAddr;
        !            58: } SGEntry;
        !            59: 
        !            60: /*
        !            61:  * Note: There are (3) SG List entries reserved for use by the driver, 
        !            62:  *       i.e SG Entries 0-1 and the last entry in the list.
        !            63:  */
        !            64: #define MAX_SGLIST_ENTRIES     (64+3)
        !            65: 
        !            66: /*
        !            67:  * This part of the Nexus structure contains the script engine clock registers to
        !            68:  * be used for this request. This information is also contained in the per-target
        !            69:  * table (AdapterInterface->targetClocks).
        !            70:  */
        !            71: typedef struct NexusParms
        !            72: {
        !            73:     u_int8_t                   reserved_1;
        !            74:     u_int8_t                   sxferReg;
        !            75:     u_int8_t                   target;
        !            76:     u_int8_t                   scntl3Reg;
        !            77: } NexusParms;
        !            78: 
        !            79: /*
        !            80:  * Pointers in the Nexus to our CDB/MsgOut data are in this format.
        !            81:  */
        !            82: typedef struct NexusData
        !            83: {
        !            84:    u_int32_t                   length;
        !            85:    u_int32_t                   ppData;
        !            86: } NexusData;
        !            87: 
        !            88: typedef struct Nexus           Nexus;
        !            89: struct Nexus
        !            90: {
        !            91:     NexusParms                 targetParms;
        !            92: 
        !            93:     SGEntry                    *ppSGList;
        !            94: 
        !            95:     NexusData                  msg;
        !            96:     NexusData                  cdb;
        !            97: 
        !            98:     u_int32_t                  currentDataPtr;
        !            99:     u_int32_t                  savedDataPtr;
        !           100: 
        !           101:     u_int8_t                   tag;
        !           102:     u_int8_t                   dataXferCalled;
        !           103:     u_int8_t                   wideResidCount;
        !           104:     u_int8_t                    reserved_1[1];
        !           105: 
        !           106:     /*
        !           107:      * Data buffers for nexus
        !           108:      */
        !           109:     cdb_t                      cdbData;
        !           110:     u_int8_t                   msgData[16];
        !           111:     u_int32_t                  sgNextIndex;
        !           112:     SGEntry                    sgListData[MAX_SGLIST_ENTRIES];
        !           113: 
        !           114: };
        !           115: 
        !           116: /*  
        !           117:  * Abort Bdr Mailbox  
        !           118:  * 
        !           119:  * The mailbox is used to send an Abort or Bus Device Reset to a device 
        !           120:  * This mailbox is 4 bytes long, and all the necessary information are  
        !           121:  * contained in this mailbox (No nexus Data associated)                 
        !           122:  */
        !           123: typedef struct IOAbortBdrMailBox
        !           124: {
        !           125:    u_int8_t                    identify;    /* Identify msg (0xC0) if Abort                    A0 */
        !           126:    u_int8_t                    tag;         /* Tag Message or Zero                             A1 */
        !           127:    u_int8_t                    scsi_id;     /* SCSI id of the target of the request            A2 */
        !           128:    u_int8_t                    message;     /* Abort(0x06) or Bdr(0x0C) or AbortTag (0x0D)     A3 */
        !           129: } IOAbortBdrMailBox;
        !           130: 
        !           131: /*
        !           132:  * IODone mailbox  
        !           133:  *                                                    
        !           134:  * This mailbox is used to signal the completion of an I/O to the driver.  
        !           135:  */                       
        !           136: 
        !           137: typedef struct IODoneMailBox 
        !           138: {
        !           139:    u_int8_t                    nexus;      /* Nexus of the completed I/O      */
        !           140:    u_int8_t                    status;     /* Status of the completed I/O     */
        !           141:    u_int8_t                    zero;
        !           142:    u_int8_t                    semaphore;  /* If set, these contents are valid   */
        !           143: } IODoneMailBox;
        !           144: 
        !           145: /*
        !           146:  * Adapter Interface
        !           147:  *
        !           148:  * This structure contains the shared data between the script and
        !           149:  * the driver. The script's local variable table is updated to point to the 
        !           150:  * physical addresses of the data in this control block.
        !           151:  */
        !           152: 
        !           153: typedef struct TargetClocks
        !           154: {
        !           155:     u_int8_t                   reserved_1;
        !           156:     u_int8_t                   sxferReg;
        !           157:     u_int8_t                   reserved_2;
        !           158:     u_int8_t                   scntl3Reg;
        !           159: } TargetClocks;
        !           160: 
        !           161: typedef struct AdapterInterface
        !           162: {
        !           163:     Nexus                      **nexusPtrsVirt;
        !           164:     Nexus                      **nexusPtrsPhys;
        !           165: 
        !           166:     Nexus                      *nexusArrayPhys[MAX_SCSI_TAG];          /* Active SRBs or -1                            */
        !           167:     Nexus                      *schedMailBox[MAX_SCHED_MAILBOXES];     /* New SRBs                                     */
        !           168:     TargetClocks               targetClocks[MAX_SCSI_TARGETS];
        !           169: 
        !           170:     u_int32_t                  xferSWideInst[4];
        !           171: 
        !           172: } AdapterInterface;
        !           173: 
        !           174: #define SCRIPT_VAR(x)  ( *(u_int32_t *)(chipRamAddr+(x)) )

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.