📄 crys8900.h
字号:
/* * $QNXLicenseC: * Copyright 2007, QNX Software Systems. * * Licensed under the Apache License, Version 2.0 (the "License"). You * may not reproduce, modify or distribute this software except in * compliance with the License. You may obtain a copy of the License * at: http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OF ANY KIND, either express or implied. * * This file may contain contributions from others, either as * contributors under the License or as licensors under other terms. * Please review this entire file for other proprietary rights or license * notices, as well as the QNX Development Suite License Guide at * http://licensing.qnx.com/license-guide/ for other information. * $ */#ifndef NIC_CRYS8900_H_INCLUDED#define NIC_CRYS8900_H_INCLUDED#define NIC_TRUE 0x1#define NIC_FALSE 0x0#define NIC_PRIORITY 21#include <atomic.h>#include <ctype.h>#include <stdio.h>#include <errno.h>#include <unistd.h>#include <stddef.h>#include <stdlib.h>#include <string.h>#include <pthread.h>#include <gulliver.h>#include <sys/mman.h>#include <sys/types.h>#include <sys/siginfo.h>#include <sys/neutrino.h>#include <hw/inout.h>#include <net/if.h>#include <net/if_dl.h>#include <net/if_types.h>#include <sys/io-net.h>#include <sys/dcmd_io-net.h>#include <sys/slogcodes.h>#include <drvr/eth.h>#include <drvr/nicsupport.h>#define CS8900_IO 0x0000#define CS8900_DMA 0x0001#define CS8900_SHARED 0x0002/* port registers */#define CS8900_PORT_RXTX 0x0000#define CS8900_PORT_TXCMD 0x0004#define CS8900_PORT_TXLEN 0x0006#define CS8900_PORT_ISQ 0x0008#define CS8900_PORT_PKTPG 0x000a#define CS8900_PORT_PKTPG_DATA 0x000c#define CS8900_SIGNATURE 0x000a#define CS8900_PRODUCT_ID 0x0000#define CS8920_PRODUCT_ID 0x3000#define CS8900_EISA_ID 0x630e/* packet page registers */#define CS8900_PROD_ID 0x0000 /* offset 0h -> Corp -ID */#define CS8900_DEVICE_ID 0x0002 /* offset 2h -> Model/Product Number */ /* offset 3h -> Chip Revision Number */#define CS8900_ISAIOB 0x0020 /* IO base address */#define CS8900_ISAINT 0x0022 /* ISA interrupt select */#define CS8920_ISAINT 0x0370 /* ISA interrupt select */#define CS8900_ISADMA 0x0024 /* ISA Rec DMA channel */#define CS8920_ISADMA 0x0374 /* ISA Rec DMA channel */#define CS8900_DMA_OF 0x0026 /* ISA DMA offset */#define CS8900_DMA_FC 0x0028 /* ISA DMA Frame count */#define CS8900_DMA_BC 0x002A /* ISA DMA Byte count */#define CS8900_MEM_BASE 0x002C /* Memory base */#define CS8920_MEM_BASE 0x0348#define CS8900_ROM_BASE 0x0030 /* Boot Prom base */#define CS8900_ROM_MASK 0x0034 /* Boot Prom Mask *//* EEPROM data and command registers */#define CS8900_EEPROM_CMD 0x0040 /* NVR Interface Command register */#define CS8900_EEPROM_DATA 0x0042 /* NVR Interface Data Register */#define CS8900_DEBUG 0x0044 /* Debug Register */#define CS8900_RXCFG 0x0102 /* Rx Bus config */ #define RXCFG_EXTRADATA_IRQ 0x4000 #define RXCFG_RUNT_IRQ 0x2000 #define RXCFG_CRCERR_IRQ 0x1000 #define RXCFG_BUFCRC 0x0800 #define RXCFG_AUTORX_DMA 0x0400 #define RXCFG_DMA_ONLY 0x0200 #define RXCFG_RXOK_IRQ 0x0100 #define RXCFG_STREAM_TXFR 0x0080 #define RXCFG_SKIP_ONE 0x0040#define CS8900_RXCTL 0x0104 /* Receive Control Register */ #define RXCTL_EXTRADATA_OK 0x4000 #define RXCTL_RUNT_OK 0x2000 #define RXCTL_CRCERR_OK 0x1000 #define RXCTL_BRDCAST_OK 0x0800 #define RXCTL_IA_OK 0x0400 #define RXCTL_MULTI_OK 0x0200 #define RXCTL_RX_OK 0x0100 #define RXCTL_PROM_OK 0x0080 #define RXCTL_IAHASH_OK 0x0040#define CS8900_TXCFG 0x0106 /* Transmit Config Register */ #define TXCFG_MAXCOL_IRQ 0x8000 #define TXCFG_ANYCOL_IRQ 0x0800 #define TXCFG_JABBER_IRQ 0x0400 #define TXCFG_OOWCOL_IRQ 0x0200 #define TXCFG_TXOK_IRQ 0x0100 #define TXCFG_SQEERR_IRQ 0x0080 #define TXCFG_NOCAR_IRQ 0x0040#define CS8900_TXCMDST 0x0108 /* Transmit Command Status Register */ #define TXCMD_TXPAD_DIS 0x2000 #define TXCMD_INHIBIT_CRC 0x1000 #define TXCMD_ONECOLL_STOP 0x0200 #define TXCMD_FORCE 0x0100 #define TXCMD_TXSTART_MASK 0x00C0 #define TXCMD_AFTER_5 0x0000 #define TXCMD_AFTER_381 0x0040 #define TXCMD_AFTER_1021 0x0080 #define TXCMD_AFTER_ENTIRE 0x00c0#define CS8900_BUFCFG 0x010A /* Bus configuration Register */ #define BUFCFG_DSTMATCH_IRQ 0x8000 #define BUFCFG_MISSCTR_IRQ 0x2000 #define BUFCFG_COLCTR_IRQ 0x1000 #define BUFCFG_RX128_IRQ 0x0800 #define BUFCFG_RXMISS_IRQ 0x0400 #define BUFCFG_TXUNDER_IRQ 0x0200 #define BUFCFG_TXRDY_IRQ 0x0100 #define BUFCFG_RXDMA_IRQ 0x0080 #define BUFCFG_SWINTR_IRQ 0x0040#define CS8900_LINECTL 0x0112 /* Line Config Register */ #define LINECTL_LONGCABLE 0x4000 #define LINECTL_NO2PARTDEF 0x2000 #define LINECTL_NOPOLCORR 0x1000 #define LINECTL_MODBACKOFF 0x0800 #define LINECTL_AUI10BT 0x0200 #define LINECTL_AUIONLY 0x0100 #define LINECTL_TXON 0x0080 #define LINECTL_RXON 0x0040#define CS8900_SELFCTL 0x0114 /* Self Command Register */ #define SELFCTL_HC1 0x8000 /* turn on the Bus Access LED */ #define SELFCTL_HC0 0x4000 /* turn on the Link LED */ #define SELFCTL_HC1_ENABLE 0x2000 /* enable host control of Bus Access LED */ #define SELFCTL_HC0_ENABLE 0x1000 /* enable host control of the Link LED */ #define SELFCTL_HW_STANDBY 0x0400 #define SELFCTL_HW_SLEEP 0x0200 #define SELFCTL_SW_SUSPEND 0x0100 #define SELFCTL_RESET 0x0040#define CS8900_BUSCTL 0x0116 /* ISA bus control Register */ #define BUSCTL_ENBL_IRQ 0x8000 #define BUSCTL_RX_DMA_64K 0x2000 #define BUSCTL_IOCHRDY 0x1000 #define BUSCTL_DMA_BURST 0x0800 #define BUSCTL_ENBL_MEM 0x0400 #define BUSCTL_MEM_16MB 0x0200 #define BUSCTL_RST_RXDMA 0x0040#define CS8900_TESTCTL 0x0118 /* Test Register */ #define TESTCTL_FASTTEST 0x8000 #define TESTCTL_FDX 0x4000 #define TESTCTL_BACKOFF_DIS 0x0800 #define TESTCTL_AUILOOP 0x0400 #define TESTCTL_INTLOOPBACK 0x0200 #define TESTCTL_LINKTST_DIS 0x0080#define CS8900_AUTONEGCTL 0x011C /* Auto Negotiation Ctrl */ #define AUTONEGCTL_RENOW 0x0040 #define AUTONEGCTL_ALLOWFDX 0x0080 #define AUTONEGCTL_ENABLE 0x0100 #define AUTONEGCTL_NLP 0x0200 #define AUTONEGCTL_FORCEFDX 0x8000#define CS8900_ISQ 0x0120 /* Interrupt Status */ #define ISQ_EVENT_MASK 0x003f #define ISQ_RXEVENT 0x0004 #define ISQ_TXEVENT 0x0008 #define ISQ_BUFEVENT 0x000C #define ISQ_RXMISS 0x0010 #define ISQ_TXCOLL 0x0012#define CS8900_RXEVENT 0x0124 /* Rx Event Register */ #define RXEVENT_EXTRADATA 0x4000 #define RXEVENT_RUNT 0x2000 #define RXEVENT_CRCERR 0x1000 #define RXEVENT_BROADCAST 0x0800 #define RXEVENT_IA 0x0400 #define RXEVENT_HASHED 0x0200 #define RXEVENT_RXOK 0x0100 #define RXEVENT_DRIBBLE 0x0080 #define RXEVENT_IAHASH 0x0040#define CS8900_TXEVENT 0x0128 /* Tx Event Register */ #define TXEVENT_MAXCOL 0x8000 #define TXEVENT_COLCNT_MASK 0x7800 #define TXEVENT_COLCNT(a) ((a & TXEVENT_COLCNT_MASK) >> 11) #define TXEVENT_JABBER 0x0400 #define TXEVENT_OOWC 0x0200 #define TXEVENT_TXOK 0x0100 #define TXEVENT_SQEERR 0x0080 #define TXEVENT_NOCAR 0x0040#define CS8900_BUFEVENT 0x012C /* Bus Event Register */ #define BUFEVENT_RXDEST 0x8000 #define BUFEVENT_RX128 0x0800 #define BUFEVENT_RXMISS 0x0400 #define BUFEVENT_TXUNDERRUN 0x0200 #define BUFEVENT_RDY4TX 0x0100 #define BUFEVENT_RXDMA 0x0080 #define BUFEVENT_SWINTR 0x0040#define CS8900_RXMISS 0x0130 /* Receive Miss Count */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -