!**************************************************************************
!*
!* Network driver interface for netboot bootrom
!*
!* Module: ndispriv.inc
!* Purpose: Definitions for NDIS interface
!* Entries: None
!*
!**************************************************************************
!*
!* Copyright (C) 1998-2003 Gero Kuhlmann <gero@gkminix.han.de>
!*
!* This program is free software; you can redistribute it and/or modify
!* it under the terms of the GNU General Public License as published by
!* the Free Software Foundation; either version 2 of the License, or
!* any later version.
!*
!* This program is distributed in the hope that it will be useful,
!* but WITHOUT ANY WARRANTY; without even the implied warranty of
!* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
!* GNU General Public License for more details.
!*
!* You should have received a copy of the GNU General Public License
!* along with this program; if not, write to the Free Software
!* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!*
!* $Id: ndispriv.inc,v 1.4 2003/01/25 23:29:41 gkminix Exp $
!*
#ifndef _NETDRVR_NDIS2_NDISPRIV_INC
#define _NETDRVR_NDIS2_NDISPRIV_INC
!
!**************************************************************************
!
! NDIS version number this interface conforms to:
!
NDIS_MAJOR_VER equ 2 ! major version number
NDIS_MINOR_VER equ 0 ! minor version number
!
!**************************************************************************
!
! NDIS module IDs:
!
MODID_MAC equ 1 ! MAC module ID (we only have one MAC)
MODID_PROT equ 2 ! protocol module ID
!
!**************************************************************************
!
! Size of one generic NDIS hardware address:
!
NDIS_HWADDR_SIZE equ 16
!
!**************************************************************************
!
! NDIS general request opcodes:
!
NDIS_INIT_DIAG equ 1 ! initiate diagnostics
NDIS_READ_ERR_LOG equ 2 ! read error log
NDIS_SET_STA_ADDR equ 3 ! set station address
NDIS_OPEN_ADAPTER equ 4 ! open adapter
NDIS_CLOSE_ADAPTER equ 5 ! close adapter
NDIS_RESET_MAC equ 6 ! reset adapter
NDIS_SET_PKT_FLT equ 7 ! set packet filter
NDIS_ADD_MULT_ADDR equ 8 ! add multicast address
NDIS_DEL_MULT_ADDR equ 9 ! delete multicast address
NDIS_UPDATE_STATS equ 10 ! update statistics
NDIS_CLEAR_STATS equ 11 ! clear statistics
NDIS_REQUEST_INT equ 12 ! request asynchronous notification
NDIS_SET_FUNC_ADDR equ 13 ! set functional address
NDIS_LOOKAHEAD equ 14 ! set size of lookahead buffer
!
!**************************************************************************
!
! NDIS status indication opcodes:
!
NDIS_RING_STATUS equ 1 ! return a change in ring status
NDIS_ADAPTER_CHECK equ 2 ! return hardware status
NDIS_START_RESET equ 3 ! imply that adapter has started reset
NDIS_END_RESET equ 4 ! imply that adapter has finished reset
NDIS_INTERRUPT equ 5 ! imply that an interrupt has occurred
!
!**************************************************************************
!
! NDIS system request opcodes:
!
NDIS_INITIATE_BIND equ 1 ! instruct module to bind
NDIS_BIND equ 2 ! bind to a module
NDIS_PREBIND equ 3 ! restart pre-bind initialization
NDIS_INITIATE_UNBIND equ 4 ! instruct module to unbind
NDIS_UNBIND equ 5 ! unbind from module
!
!**************************************************************************
!
! NDIS error codes:
!
NDISERR_SUCCESS equ $0000 ! success
NDISERR_RELEASE equ $0001 ! wait for release
NDISERR_QUEUED equ $0002 ! request queued
NDISERR_RECOG equ $0003 ! frame not recognized
NDISERR_REJECT equ $0004 ! frame rejected
NDISERR_FORWARD equ $0005 ! frame should be forwarded
NDISERR_RESOURCE equ $0006 ! out of resources
NDISERR_PARAM equ $0007 ! invalid parameter
NDISERR_FUNCTION equ $0008 ! invalid function
NDISERR_SUPPORTED equ $0009 ! not supported
NDISERR_HARDWARE equ $000A ! hardware error
NDISERR_TRANSMIT equ $000B ! transmit error
NDISERR_DEST equ $000C ! unrecognized destination
NDISERR_BUFFER equ $000D ! buffer too small
NDISERR_STARTED equ $0020 ! already started
NDISERR_INCOMPLETE equ $0021 ! binding incomplete
NDISERR_DRVINIT equ $0022 ! driver not initialized
NDISERR_NOTFOUND equ $0023 ! hardware not found
NDISERR_HWFAIL equ $0024 ! hardware failure
NDISERR_CONFIG equ $0025 ! configuration failure
NDISERR_INT equ $0026 ! interrupt conflict
NDISERR_INCOMPATIBLE equ $0027 ! MAC incompatible
NDISERR_INITFAIL equ $0028 ! initialization failed
NDISERR_NOBIND equ $0029 ! no binding
NDISERR_DISCONNECT equ $002A ! network might be disconnected
NDISERR_OSVERSION equ $002B ! incompatible OS version
NDISERR_REGISTERED equ $002C ! already registered
NDISERR_PATH equ $002D ! path not found
NDISERR_MEMORY equ $002E ! insufficient memory
NDISERR_INFO equ $002F ! info not found
NDISERR_GENERAL equ $00FF ! general failure
!
!**************************************************************************
!
! Layout of Common Characteristics Table (CCT):
!
CCT_LENGTH equ $0000 ! length of CCT structure
CCT_NDIS_MAJOR equ $0002 ! major NDIS version number
CCT_NDIS_MINOR equ $0003 ! minor NDIS version number
CCT_MOD_MAJOR equ $0006 ! major module version number
CCT_MOD_MINOR equ $0007 ! minor module version number
CCT_FUNCTION_FLAGS equ $0008 ! module function flags
CCT_MOD_NAME equ $000C ! name of module (ASCIZ, max 16 bytes)
CCT_UPPER_LEVEL equ $001C ! protocol level at upper boundary
CCT_UPPER_TYPE equ $001D ! type of interface at upper boundary
CCT_LOWER_LEVEL equ $001E ! protocol level at lower boundary
CCT_LOWER_TYPE equ $001F ! type of interface at lower boundary
CCT_MODULE_ID equ $0020 ! module ID
CCT_MODULE_DS equ $0022 ! module data segment
CCT_SYSREQ equ $0024 ! far ptr to system request entry
CCT_SSC equ $0028 ! far ptr to service specific charact.
CCT_SSS equ $002C ! far ptr to service specific status
CCT_UDT equ $0030 ! far ptr to upper dispatch table
CCT_LDT equ $0034 ! far ptr to lower dispatch table
CCT_SIZE equ $0040 ! size of standard CCT structure
! Module function flags:
MODFUNC_UPPER_BIND equ $0001 ! binding at upper boundary supported
MODFUNC_LOWER_BIND equ $0002 ! binding at lower boundary supported
MODFUNC_DYN_BIND equ $0004 ! dynamic binding supported
! Protocol ID at upper/lower boundary level:
PROT_PHYS equ $00 ! physical layer
PROT_MAC equ $01 ! Media Access Control (network driver)
PROT_DATA_LINK equ $02 ! Data link protocol
PROT_NETWORK equ $03 ! Network protocol
PROT_TRANSPORT equ $04 ! Transport protocol
PROT_SESSION equ $05 ! Session protocol
PROT_UNDEF equ $FF ! undefined
! Type ID of interface at upper/lower boundary level:
TYPE_MAC equ $01 ! MAC interface
TYPE_NCB equ $01 ! NCB interface for session protocol
TYPE_PRIVATE equ $00 ! private interface for any protocol
!
!**************************************************************************
!
! Service Specific Characteristics (SSC) structure for MAC interface:
!
MACSSC_LENGTH equ $0000 ! length of MACSSC structure
MACSSC_TYPE_NAME equ $0002 ! type of MAC (ASCIZ, max. 16 bytes)
MACSSC_ADDR_LEN equ $0012 ! length of station address
MACSSC_PERM_ADDR equ $0014 ! permanent station address (16 bytes)
MACSSC_CUR_ADDR equ $0024 ! current station address (16 bytes)
MACSSC_FUNC_ADDR equ $0034 ! current functional address
MACSSC_MCAST_ADDR equ $0038 ! far ptr to multicast address list
MACSSC_LINK_SPEED equ $003C ! link speed (bits/sec)
MACSSC_SF_1 equ $0040 ! first service flags word
MACSSC_SF_2 equ $0042 ! second service flags word
MACSSC_FRAME_SIZE equ $0044 ! maximum frame size
MACSSC_TX_BUF equ $0046 ! total transmit buffer capacity
MACSSC_TX_ALLOC equ $004A ! transmit buffer allocation block size
MACSSC_RX_BUF equ $004C ! total reception buffer capacity
MACSSC_RX_ALLOC equ $0050 ! reception buffer allocation block size
MACSSC_IEEE_VEND equ $0052 ! IEEE vendor code
MACSSC_VEND_CODE equ $0055 ! vendor adapter code
MACSSC_VEND_DESC equ $0056 ! far ptr to vendor adapter description
MACSSC_IRQ_LEVEL equ $005A ! IRQ level
MACSSC_TX_DEPTH equ $005C ! transmit queue depth
MACSSC_MAX_DATA equ $005E ! max number of data blocks in buffers
MAXSSC_SIZE equ $0060 ! size of standard MACSSC structure
! MAC service flags:
MAC_SF1_BROADCAST equ $0001 ! broadcast supported
MAC_SF1_MULTICAST equ $0002 ! multicast supported
MAC_SF1_FUNC_ADDR equ $0004 ! functional/group addressing supported
MAC_SF1_PROMISCUOUS equ $0008 ! promiscuous mode supported
MAC_SF1_STAT_ADDR equ $0010 ! software settable station address
MAC_SF1_STAT_CUR equ $0020 ! statistics are always current
MAC_SF1_INIT_DIAG equ $0040 ! InitiateDiagnostics call supported
MAC_SF1_LOOPBACK equ $0080 ! loopback supported
MAC_SF1_RECEIVE equ $0100 ! MAC does primarily ReceiveChain
MAC_SF1_IBM_SOURCE equ $0200 ! IBM source routing supported
MAC_SF1_RESET_MAC equ $0400 ! ResetMac call supported
MAC_SF1_OPEN_CLOSE equ $0800 ! Open/Close calls supported
MAC_SF1_INTERRUPT equ $1000 ! interrupt request supported
MAC_SF1_SOURCE_BRIDGE equ $2000 ! source routing bridge supported
MAC_SF1_GDT_VIRT equ $4000 ! GDT virtual addresses supported
MAC_SF1_MULTIPLE equ $8000 ! multiple TransferDatas supported
MAC_SF2_FRAME_SIZE equ $0001 ! FrameSize = 0 supported in lookahead
!
!**************************************************************************
!
! Multicast address list:
!
MCAST_MAX_ADDR equ $0000 ! maximum number of multicast addresses
MCAST_CUR_ADDR equ $0002 ! current number of multicast addresses
MCAST_LIST equ $0004 ! first multicast address (16 bytes)
MCAST_ADDR_SIZE equ $0010 ! size of each multicast address
!
!**************************************************************************
!
! Service Specific Status (SSS) structure for MAC interface:
!
MACSSS_LENGTH equ $0000 ! length of status table
MACSSS_UPDATE_TIME equ $0002 ! date/time of last status update
MACSSS_STATUS equ $0006 ! MAC status
MACSSS_FILTER equ $000A ! current packet filter
MACSSS_MEDIA_STAT equ $000C ! far ptr to media specific statistics
MACSSS_CLEAR_TIME equ $0010 ! date/time of last statistics clear
MACSSS_RX_FRAMES equ $0014 ! total number of frames received
MACSSS_RX_CRC_FRAMES equ $0018 ! number of frames with CRC errors
MACSSS_RX_BYTES equ $001C ! total number of bytes received
MACSSS_RX_DISCARDED equ $0020 ! number of frames discarded
MACSSS_RX_F_MCAST equ $0024 ! multicast frames received
MACSSS_RX_F_BCAST equ $0028 ! broadcast frames received
MACSSS_RX_ERROR equ $002C ! frames received with errors
MACSSS_RX_MAXSIZE equ $0030 ! frames exceeding maximum size
MACSSS_RX_MINSIZE equ $0034 ! frames smaller than minimum size
MACSSS_RX_B_MCAST equ $0038 ! multicast bytes received
MACSSS_RX_B_BCAST equ $003C ! broadcast bytes received
MACSSS_RX_HARDWARE equ $0040 ! frames discarded due to hardware probs
MACSSS_TX_FRAMES equ $0044 ! total number of frames transmitted
MACSSS_TX_BYTES equ $0048 ! total number of bytes transmitted
MACSSS_TX_F_MCAST equ $004C ! multicast frames transmitted
MACSSS_TX_F_BCAST equ $0050 ! broadcast frames transmitted
MACSSS_TX_B_BCAST equ $0054 ! broadcast bytes transmitted
MACSSS_TX_B_MCAST equ $0058 ! multicast bytes transmitted
MACSSS_TX_TIMEOUT equ $005C ! frames with timeout errors
MACSSS_TX_HARDWARE equ $0060 ! frames discarded due to hardware probs
MACSSS_SIZE equ $0064 ! size of standard MACSSS structure
! MAC status flags:
MAC_STATUS_OPCODE equ $0007 ! status opcode bit mask
MAC_STATUS_BOUND equ $0008 ! MAC is bound
MAC_STATUS_OPEN equ $0010 ! MAC is open
MAC_STATUS_PROGRESS equ $0020 ! status update is in progress
MAC_OPCODE_INSTALL equ $00 ! hardware not installed
MAC_OPCODE_STARTUP equ $01 ! MAC failed startup diagnostics
MAC_OPCODE_CONFIG equ $02 ! MAC failed due to configuration error
MAC_OPCODE_HARDWARE equ $03 ! hardware error
MAC_OPCODE_SOFT equ $04 ! soft faults
MAC_OPCODE_OK equ $07 ! hardware fully operational
! MAC packet filter flags:
MAC_FILTER_DIRECT equ $0001 ! directed and multicast
MAC_FILTER_BROADCAST equ $0002 ! broadcast
MAC_FILTER_PROMISCUOUS equ $0004 ! promiscuous
MAC_FILTER_SOURCE equ $0008 ! all source routing
!
!**************************************************************************
!
! Upper Dispatch Table (UDT) for MAC interface:
!
MACUDT_CCT equ $0000 ! far back pointer to CCT
MACUDT_REQUEST equ $0004 ! far ptr to request entry point
MACUDT_TX_CHAIN equ $0008 ! far ptr to TransmitChain
MACUDT_TX_DATA equ $000C ! far ptr to TransmitData
MACUDT_RX_RELEASE equ $0010 ! far ptr to ReceiveRelease
MACUDT_IND_ON equ $0014 ! far ptr to IndicationOn
MACUDT_IND_OFF equ $0018 ! far ptr to IndicationOff
!
!**************************************************************************
!
! Lower Dispatch Table (LDT) for network protocol interface:
!
PROTLDT_CCT equ $0000 ! far back pointer to CCT
PROTLDT_FLAGS equ $0004 ! interface flags
PROTLDT_REQ_CONFIRM equ $0008 ! far ptr to RequestConfirm
PROTLDT_TX_CONFIRM equ $000C ! far ptr to TransmitConfirm
PROTLDT_RX_LAH equ $0010 ! far ptr to ReceiveLookAhead
PROTLDT_IND_COMPLETE equ $0014 ! far ptr to IndicationComplete
PROTLDT_RX_CHAIN equ $0018 ! far ptr to ReceiveChain
PROTLDT_STATUS equ $001C ! far ptr to status indication handler
! Interface flags:
PROT_IF_NON_LLC equ $0001 ! handles non-LLC frames
PROT_IF_LSAP_LLC equ $0002 ! handles specific-LSAP LLC frames
PROT_IF_NON_LSAP_LLC equ $0004 ! handles non-specific-LSAP LLC frames
!
!**************************************************************************
!
! Transmit buffer descriptors:
!
TXBUF_IMMED_LEN equ $0000 ! length of immediate data (max 64)
TXBUF_IMMED_PTR equ $0002 ! far ptr to immediate data buffer
TXBUF_DATA_COUNT equ $0006 ! number of remaining data blocks
TXBUF_DATA_BUFS equ $0008 ! first byte of data buffers
! Layout of each data buffer:
TXBUF_PTR_TYPE equ $0000 ! type of data pointer
TXBUF_DATA_LEN equ $0002 ! data length in buffer
TXBUF_DATA_PTR equ $0004 ! far ptr to data buffer
TXBUF_SIZE equ $0008 ! size of data buffer structure
TXBUF_MINSIZE equ $0010 ! minimum size of transmit buffer
! Data pointer types:
TXBUF_PTR_PHYSICAL equ $00 ! pointer is a physical far pointer
TXBUF_PTR_GDT equ $01 ! pointer uses a GDT entry
!
!**************************************************************************
!
! Receive data buffer descriptors:
!
RDBUF_DATA_COUNT equ $0000 ! number of remaining data blocks
RDBUF_DATA_BUFS equ $0002 ! first byte of data buffers
! Layout of each data buffer:
RDBUF_PTR_TYPE equ $0000 ! type of data pointer
RDBUF_DATA_LEN equ $0002 ! data length in buffer
RDBUF_DATA_PTR equ $0004 ! far ptr to data buffer
RDBUF_SIZE equ $0008 ! size of data buffer structure
RDBUF_MINSIZE equ $000A ! minimum size of transmit buffer
! Data pointer types:
RDBUF_PTR_PHYSICAL equ $00 ! pointer is a physical far pointer
RDBUF_PTR_GDT equ $01 ! pointer uses a GDT entry
!
!**************************************************************************
!
! Receive chain buffer descriptors:
!
RXBUF_DATA_COUNT equ $0000 ! number of received data buffers
RXBUF_DATA_BUFS equ $0002 ! first byte of data buffers
! Layout of each buffer:
RXBUF_DATA_LEN equ $0000 ! data length in buffer
RXBUF_DATA_PTR equ $0002 ! far ptr to data buffer
RXBUF_SIZE equ $0006 ! size of data buffer structure
RXBUF_MINSIZE equ $0008 ! minimum size of rxbuf descriptor
!
!**************************************************************************
!
! Definition of request block for protocol manager:
!
PMREQ_OPCODE equ $0000 ! offset to opcode
PMREQ_STATUS equ $0002 ! offset to return status
PMREQ_PTR1 equ $0004 ! offset to first far pointer
PMREQ_PTR2 equ $0008 ! offset to second far pointer
PMREQ_WORD1 equ $000C ! offset to first return word
PMREQ_SIZE equ $000E ! size of PM request block
PMREQ_GPMI equ 1 ! opcode: GetProtocolManagerInfo
PMREQ_RM equ 2 ! opcode: RegisterModule
PMREQ_BAS equ 3 ! opcode: BindAndStart
PMREQ_GPML equ 4 ! opcode: GetProtocolManagerLinkage
PMREQ_GPIP equ 5 ! opcode: GetProtocolIniPath
PMREQ_RPMI equ 6 ! opcode: RegisterProtocolManagerInfo
PMREQ_IAR equ 7 ! opcode: InitAndRegister
PMREQ_UAS equ 8 ! opcode: UnbindAndStop
PMREQ_BS equ 9 ! opcode: BindStatus
PMREQ_RS equ 10 ! opcode: RegisterStatus
PMREQ_MINFN equ 1 ! minimum opcode number
PMREQ_MAXFN equ 10 ! maximum opcode number
!
!**************************************************************************
!
#endif
syntax highlighted by Code2HTML, v. 0.9.1