Annotation of kernel/bsd/dev/ppc/drvApple96_SCSI/Apple96HWPrivate.h, revision 1.1.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: /**
                     26:  * Copyright (c) 1994-1996 NeXT Software, Inc.  All rights reserved. 
                     27:  * Copyright  1997 Apple Computer Inc. All Rights Reserved.
                     28:  * @author     Martin Minow    mailto:[email protected]
                     29:  * @revision   1997.02.13      Initial conversion from AMDPCSCSIDriver sources.
                     30:  *
                     31:  * Set tabs every 4 characters.
                     32:  *
                     33:  * 
                     34:  * AppleMeshHardwarePrivate.h - Architecture-specific methods for Apple Mesh SCSI driver.
                     35:  * Apple96SCSI is closely based on Doug Mitchell's AMD 53C974/79C974 driver.
                     36:  *
                     37:  * Edit History
                     38:  * 1997.02.13  MM              Initial conversion from AMDPCSCSIDriver sources. 
                     39:  */
                     40: 
                     41: #import "Apple96SCSI.h"
                     42: 
                     43: /*
                     44:  * These macros are used to access words (32 bit) and bytes (8 bit) in the channel
                     45:  * command area. They may be used as source or destination. CCLDescriptor is
                     46:  * aligned to a descriptor start, CCLAddress is just an address pointer.
                     47:  */
                     48: #define CCLAddress(offset)             (((UInt8 *) gChannelCommandArea) + (offset))
                     49: #define CCLDescriptor(offset)  ((DBDMADescriptor *) CCLAddress(offset))
                     50: #define CCLWord(offset)                        (*((UInt32 *) CCLAddress(offset)))
                     51: #define CCLByte(offset)                        (*((UInt8  *) CCLAddress(offset)))
                     52: 
                     53: @interface Apple96_SCSI (HardwarePrivate)
                     54: 
                     55: /**
                     56:  * Perform one-time-only memory allocation.
                     57:  * @return  IO_R_SUCCESS    If successful.
                     58:  *          IO_R_NO_MEMORY  Can't allocate memory (fatal)
                     59:  */
                     60: - (IOReturn) hardwareAllocateHardwareAndChannelMemory
                     61:                                                : deviceDescription;
                     62: 
                     63: /**
                     64:  * When a (legitimate) data phase starts, this method is called to configure
                     65:  * the DBDMA Channel Command list. Autosense is simple (as we "cannot" be
                     66:  * called more than once), while ordinary data transfers are arbitrarily complex.
                     67:  */
                     68: - (IOReturn) hardwareInitializeCCL;
                     69: 
                     70: /**
                     71:  * Initialize the data transfer channel command list for a normal SCSI command.
                     72:  * This is not an optimal implementation, but it simplifies maintaining a
                     73:  * common code base with the NuBus Curio/AMIC hardware interface.
                     74:  * Note that the last DBDMA command must be INPUT_LAST or OUTPUT_LAST to handle
                     75:  * synchronous transfer odd-byte disconnect. 
                     76:  */
                     77: - (IOReturn) hardwareInitializeRequestCCL;
                     78:  
                     79: /**
                     80:  * Start a request after the CCL has been initialized
                     81:  * by either hardwareInitializeSCSIRequest or
                     82:  * hardwareInitializeAutosense.
                     83:  */
                     84: - (void)    hardwareStartSCSIRequest;
                     85: 
                     86: /**
                     87:  * Clear the volatile results field in the channel command list.
                     88:  * Don't touch the permanent data.
                     89:  */
                     90: - (void) clearChannelCommandResults;
                     91: 
                     92: /**
                     93:  * Perform one-time-only channel command program.
                     94:  */
                     95: - (void) initializeChannelProgram;
                     96: 
                     97: /**
                     98:  * Debug log channel command area
                     99:  */
                    100: - (void) logChannelCommandArea
                    101:             : (const char *) reason;
                    102: 
                    103: /**
                    104:  * Debug log the current IOMemoryDescriptor
                    105:  */
                    106: - (void)            logIOMemoryDescriptor
                    107:             : (const char *) info;
                    108: 
                    109: @end
                    110: 

unix.superglobalmegacorp.com

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