Annotation of kernel/bsd/dev/ppc/drvMaceEnet/MaceEnet.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) 1995-1996 NeXT Software, Inc.
                     27:  *
                     28:  * Interface definition for the Mace Ethernet chip 
                     29:  *
                     30:  * HISTORY
                     31:  *
                     32:  * 16-Sept-97   
                     33:  *     Created.
                     34:  */
                     35: 
                     36: #import <driverkit/kernelDriver.h>
                     37: #import <driverkit/IOEthernet.h>
                     38: #import <driverkit/IONetbufQueue.h>
                     39: #import <driverkit/ppc/IOTreeDevice.h>
                     40: #import <driverkit/ppc/IODBDMA.h>
                     41: #import <driverkit/generalFuncs.h>
                     42: #import <driverkit/IOPower.h>
                     43: #import <machdep/ppc/proc_reg.h>               /* eieio */
                     44: #import <bsd/net/etherdefs.h>
                     45: #import <string.h>                             /* bcopy */
                     46: #import <driverkit/IOEthernetPrivate.h>                /* debugger methods */
                     47: #import <kern/kdebug.h>                                /* Performance tracepoints */
                     48: 
                     49: 
                     50: #import "MaceEnetRegisters.h"
                     51: 
                     52: #if 0
                     53: #define IOLog kprintf
                     54: #endif
                     55: 
                     56: typedef void  *                IOPPCAddress;
                     57: 
                     58: typedef struct enet_dma_cmd_t
                     59: {
                     60:     IODBDMADescriptor          desc_seg[2];
                     61: } enet_dma_cmd_t;
                     62: 
                     63: typedef struct enet_txdma_cmd_t
                     64: {
                     65:     IODBDMADescriptor          desc_seg[4];
                     66: } enet_txdma_cmd_t;
                     67: 
                     68: @interface MaceEnet:IOEthernet <IOPower>
                     69: {
                     70:     volatile IOPPCAddress              ioBaseEnet;
                     71:     volatile IOPPCAddress              ioBaseEnetROM;
                     72:     volatile IODBDMAChannelRegisters   *ioBaseEnetRxDMA;       
                     73:     volatile IODBDMAChannelRegisters   *ioBaseEnetTxDMA;
                     74: 
                     75:     u_int16_t                          chipId; 
                     76: 
                     77:     enet_addr_t                                myAddress;
                     78:     IONetwork                          *networkInterface;
                     79:     IONetbufQueue                      *transmitQueue;
                     80:     BOOL                               isPromiscuous;
                     81:     BOOL                               multicastEnabled;
                     82: 
                     83:     BOOL                               resetAndEnabled;
                     84:     netbuf_t                           txNetbuf[TX_RING_LENGTH];
                     85:     netbuf_t                           rxNetbuf[RX_RING_LENGTH];
                     86:     
                     87:     unsigned int                       txCommandHead;          /* Transmit ring descriptor index */
                     88:     unsigned int                       txCommandTail;
                     89:     unsigned int                               txMaxCommand;           
                     90:     unsigned int                       rxCommandHead;          /* Receive ring descriptor index */
                     91:     unsigned int                       rxCommandTail;
                     92:     unsigned int                       rxMaxCommand;           
                     93: 
                     94:     unsigned char *                    dmaCommands;
                     95:     enet_txdma_cmd_t *                 txDMACommands;          /* TX descriptor ring ptr */
                     96:     unsigned int                       txDMACommandsPhys;
                     97: 
                     98:     enet_dma_cmd_t *                   rxDMACommands;          /* RX descriptor ring ptr */
                     99:     unsigned int                       rxDMACommandsPhys;
                    100: 
                    101:     u_int32_t                          txWDInterrupts;
                    102:     u_int32_t                          txWDTimeouts;
                    103:     BOOL                               txWDForceReset;
                    104: 
                    105:     netbuf_t                           debuggerPkt;
                    106:     u_int32_t                                  debuggerPktSize;
                    107:    
                    108:     u_int16_t                          hashTableUseCount[64];
                    109:     u_int8_t                           hashTableMask[8];
                    110: }
                    111: 
                    112: + (BOOL)probe:devDesc;
                    113: - initFromDeviceDescription:devDesc;
                    114: 
                    115: - free;
                    116: - (void)transmit:(netbuf_t)pkt;
                    117: - (void)serviceTransmitQueue;
                    118: - (BOOL)resetAndEnable:(BOOL)enable;
                    119: 
                    120: - (void)interruptOccurredAt:(int)irqNum;
                    121: - (void)timeoutOccurred;
                    122: 
                    123: - (BOOL)enableMulticastMode;
                    124: - (void)disableMulticastMode;
                    125: - (BOOL)enablePromiscuousMode;
                    126: - (void)disablePromiscuousMode;
                    127: 
                    128: /*
                    129:  * Kernel Debugger
                    130:  */
                    131: - (void)sendPacket:(void *)pkt length:(unsigned int)pkt_len;
                    132: - (void)receivePacket:(void *)pkt length:(unsigned int *)pkt_len timeout:(unsigned int)timeout;
                    133: 
                    134: 
                    135: /*
                    136:  * Power management methods. 
                    137:  */
                    138: - (IOReturn)getPowerState:(PMPowerState *)state_p;
                    139: - (IOReturn)setPowerState:(PMPowerState)state;
                    140: - (IOReturn)getPowerManagement:(PMPowerManagementState *)state_p;
                    141: - (IOReturn)setPowerManagement:(PMPowerManagementState)state;
                    142: 
                    143: /*
                    144:  * Queue interface
                    145:  */
                    146: - (int) transmitQueueSize;
                    147: - (int) transmitQueueCount;
                    148: 
                    149: @end
                    150: 
                    151: /*
                    152:  * Performance tracepoints
                    153:  *
                    154:  * DBG_MACE_RXIRQ      - Receive  ISR run time
                    155:  * DBG_MACE_TXIRQ      - Transmit ISR run time
                    156:  * DBG_MACE_TXQUEUE     - Transmit packet passed from network stack
                    157:  * DBG_MACE_TXCOMPLETE  - Transmit packet sent
                    158:  * DBG_MACE_RXCOMPLETE  - Receive packet passed to network stack
                    159:  */
                    160: #define DBG_MACE_ENET          0x0800
                    161: #define DBG_MACE_RXIRQ                 DRVDBG_CODE(DBG_DRVNETWORK,(DBG_MACE_ENET+1))   
                    162: #define DBG_MACE_TXIRQ         DRVDBG_CODE(DBG_DRVNETWORK,(DBG_MACE_ENET+2))   
                    163: #define DBG_MACE_TXQUEUE       DRVDBG_CODE(DBG_DRVNETWORK,(DBG_MACE_ENET+3))   
                    164: #define DBG_MACE_TXCOMPLETE    DRVDBG_CODE(DBG_DRVNETWORK,(DBG_MACE_ENET+4))   
                    165: #define DBG_MACE_RXCOMPLETE    DRVDBG_CODE(DBG_DRVNETWORK,(DBG_MACE_ENET+5))   
                    166: 

unix.superglobalmegacorp.com

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