亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dec21140.c

?? 基于psos操作系統的dec21140驅動
?? C
?? 第 1 頁 / 共 5 頁
字號:
/***********************************************************************/
/*                                                                     */
/*   MODULE:  net/dec21140.c                                           */
/*   DATE:    98/11/19                                                 */
/*   PURPOSE: Ethernet driver for the DEC D21140                       */
/*                                                                     */
/*---------------------------------------------------------------------*/
/*                                                                     */
/*           Copyright 1991 - 1997, Integrated Systems, Inc.           */
/*                      ALL RIGHTS RESERVED                            */
/*                                                                     */
/*   Permission is hereby granted to licensees of Integrated Systems,  */
/*   Inc. products to use or abstract this computer program for the    */
/*   sole purpose of implementing a product based on Integrated        */
/*   Systems, Inc. products.   No other rights to reproduce, use,      */
/*   or disseminate this computer program, whether in part or in       */
/*   whole, are granted.                                               */
/*                                                                     */
/*   Integrated Systems, Inc. makes no representation or warranties    */
/*   with respect to the performance of this computer program, and     */
/*   specifically disclaims any responsibility for any damages,        */
/*   special or consequential, connected with the use of this program. */
/*                                                                     */
/***********************************************************************/
#include "dec21140.h"
#include <tm1/tmInterrupts.h>
#include <tm1/mmio.h>
#include <ops/custom_defs.h>
#include <pna.h>
#include <sys_conf.h>

/***********************************************************************/
/* General Definitions                                                 */
/***********************************************************************/
#define UCHAR  unsigned char
#define USHORT unsigned short
#define ULONG  unsigned long

#define  REG8(addr) *((volatile UCHAR  *) addr)
#define REG16(addr) *((volatile USHORT *) addr)
#define REG32(addr) *((volatile ULONG  *) addr)
#define LOOP_PER_NS 4
#define NSDELAY(nsec)   {\
			volatile int nx = 0;\
			volatile int loop = (int)(nsec*LOOP_PER_NS);\
			for (nx = 0; nx < loop; nx++);\
			}

/*---------------------------------------------------------------------*/
/* Defines for MII PHY access                                          */
/*---------------------------------------------------------------------*/
#define MII_REG_BMSR            0x1
#define MII_REG_PHYIDR1         0x2
#define MII_REG_ANLPAR          0x5
#define MII_REG_PAR             0x19
#define MII_WRITE       ((ULONG)(0x00002000))
#define MII_READ        ((ULONG)(0x00044000))
#define MII_WRITE_TS    ((ULONG)(0x00042000))
#define MII_CLOCK       ((ULONG)(0x00010000))
#define MII_DATA_IN     ((ULONG)(0x00080000))
#define MII_WRITE_DATA  ((ULONG)(0x00020000))
#define MII_READ_FRAME  ((ULONG)(0x60000000))
#define MII_PRE         ((ULONG)(0xFFFFFFFF))
#define MII_READ_DATA_MASK      MII_DATA_IN
#define MII_WRITE_DATA_POSITION 17
#define REG_ADDR_ALIGN          18
#define MII_DATA_IN_POSITION    19
#define PHY_ADDR_ALIGN          23
#define MII_LINK_STATUS         0x4

/*---------------------------------------------------------------------*/
/* Bit 3 of BMSR indicates PHYS is able to perform auto negotiation.   */
/*---------------------------------------------------------------------*/
#define MII_AUTO_NEGO_COMP      0x8

/*---------------------------------------------------------------------*/
/* After auto negotiation bit 8 (100BASE TX) and 6 (10BASE TX) of      */
/* ANLPAR indicates that remote link supports full duplex.             */
/*---------------------------------------------------------------------*/
#define MII_REMOTE_LINK_DUPLEX  0x140

/*---------------------------------------------------------------------*/
/* Bit 6 of PAR indicates current operational speed. 1==10, 0==100     */
/*---------------------------------------------------------------------*/
#define MII_LINK_SPD            0x40
#define MAX_LINK_TOUT           60    /* 6 second maximum link timeout */

/*---------------------------------------------------------------------*/
/* Possible lan speeds.                                                */
/*---------------------------------------------------------------------*/
#define MBPS10                  10000000
#define MBPS100                 100000000

#define lanType         DEC_21140_ID

/***********************************************************************/
/* Macro Definitions                                                   */
/***********************************************************************/
#define DN      8
#define WrPciCfg32(addr, val) pci_write_config_dword(0, DN, 0, addr, val)
#define WrPciCfg16(addr, val) pci_write_config_word(0, DN, 0, addr, val)
#define WrPciCfg8(addr, val)  pci_write_config_byte(0, DN, 0, addr, val)
#define RdPciCfg32(addr)      pci_read_config_dword(0, DN, 0, addr)
#define RdPciCfg16(addr)      pci_read_config_word(0, DN, 0, addr)
#define RdPciCfg8(addr)       pci_read_config_byte(0, DN, 0, addr)

/*---------------------------------------------------------------------*/
/* Ethernet hardware addr, and selection of whether to use 10BaseT     */
/* or AUI interface for the LAN.  Both of these variables are hardcoded*/
/* here, but when the same binary should run on a variety of machines  */
/* (each with e.g. their own hardware address), then their values      */
/* should be read from e.g a flash file at startup, in function        */
/* 'lanInit'.                                                          */
/*---------------------------------------------------------------------*/
static UCHAR EtherHwAddr[6] = {0x00, 0x40, 0x05, 0xA4, 0x6D, 0xF8 };
#define Lan10BaseT    1

/*---------------------------------------------------------------------*/
/* Symbol & Macro definitions                                          */
/*---------------------------------------------------------------------*/
#define LAN_IP              0x0800           /* IP type */
#define LAN_ARP             0x0806           /* ARP type */
#define LAN_RARP            0x8035           /* RARP type */

#define TRUE                     1
#define FALSE                    0
#ifndef NULL
#define NULL                     0
#endif

#define ALIGN(addr, bndry) (void *)((addr + bndry - 1) & ~(bndry - 1))

/*---------------------------------------------------------------------*/
/* Structure for accessing Ethernet address as both words and bytes.   */
/*---------------------------------------------------------------------*/
typedef union
{
  UCHAR byte[BSP_LAN1_HWALEN];
  struct
  {
    USHORT word1;
    USHORT word2;
    USHORT word3;
  } a;
} LAN_HWA;

#define word1   a.word1
#define word2   a.word2
#define word3   a.word3

/***********************************************************************/
/* Global Variable Definitions                                         */
/***********************************************************************/
/*---------------------------------------------------------------------*/
/*                         TRANSMIT HEADERS                            */
/*---------------------------------------------------------------------*/
/* When the driver is given a message to transmit, it must prepend an  */
/* Ethernet header (fields "daddr", "saddr", and "type"). The transmit */
/* header structure provides a place to put this information.  The     */
/* transmit header also contains a pointer to the msg block triplet    */
/* and a field indicating how many descriptors will be required to     */
/* transmit the frame.                                                 */
/*                                                                     */
/* When ni_send() is called, a transmit header is taken from the free  */
/* list (pointed to by TxHdrFreeHead), and filled in with the info for */
/* the frame.  Then it is put into a queue of headers awaiting         */
/* transmission.  TxHdrOutHead and TxHdrOutTail point to the head and  */
/* tail of this list.                                                  */
/*                                                                     */
/* TxFillDesc() takes the queued headers and sets up Lan buffer        */
/* descriptors to point to the actual data buffers.  A header will     */
/* only be placed in the transmit descriptor ring when there are       */
/* enough descriptors available to accomodate the entire message. This */
/* is to prevent partial frames from being sent.                       */
/*                                                                     */
/* TxNumHdrs holds the number of transmit headers.  It is set to be    */
/* the same as the number of transmit buffer descriptors.  Since an    */
/* outgoing message will always require at least 2 descriptors (1 for  */
/* the transmit header plus at least one for the message), there will  */
/* be enough headers to allow queueing messages even if the buffer     */
/* descriptor ring is full.                                            */
/*---------------------------------------------------------------------*/
typedef volatile struct TxHdr
{
  LAN_HWA daddr;            /* Ethernet destination address */
  LAN_HWA saddr;            /* Ethernet source address */
  USHORT  type;             /* IP, ARP, or RARP */
  UCHAR   fill[34];         /* fills struct to 64 bytes */
  mblk_t *msg_ptr;          /* ptr to rest of msg (triplet) */
  ULONG   num_desc;         /* # of descriptors required */
  ULONG   NoRetFlag;        /* TRUE: don't return *msg_ptr */
  volatile struct TxHdr *next;  /* ptr to next hdr in free list */
} LAN_TX_HDR;

/*---------------------------------------------------------------------*/
/* Define transmit headers & transmission related variables            */
/*---------------------------------------------------------------------*/
LAN_TX_HDR *TxHdrFreeHead;          /* free list of transmit headers*/
LAN_TX_HDR *TxHdrOutHead;           /* head of hdrs awaiting descs */
LAN_TX_HDR *TxHdrOutTail;           /* tail of hdrs awaiting descs */

/*---------------------------------------------------------------------*/
/* Define Transmit Descriptors                                         */
/*---------------------------------------------------------------------*/
static LAN_BUFF_DESC *TxNewBD;      /* ptr to next Tx desc to Xmit */
static LAN_BUFF_DESC *TxUsedBD;     /* ptr to next Tx desc to reclm */
static ULONG TxFreeDesc;            /* # free transmit descs */

static int enet_nis, enet_ais, enet_se,  enet_ri, enet_ti;
static int enet_rwt, enet_tjt, enet_unf, enet_ru, enet_rps;
static int SROM_programmed = 1;

/*---------------------------------------------------------------------*/
/*                      RECEIVE BUFFERS                                */
/*---------------------------------------------------------------------*/
/* The driver maintains a pool of buffers into which incoming Ethernet */
/* packets are placed.  The LAN's receive buffer descriptors are set   */
/* to point to a group of these, and extras are kept in a free list.   */
/* When a packet is received, a message block header is allocated from */
/* pNA and the receive buffer is taken from the LAN's circular list    */
/* and attached to the message block header.  Then the entire thing    */
/* is given to pNA via the "announce packet" call.  RxBufAttach()      */
/* replenishes the LAN's circular list with buffers from the free      */
/* list, if they are available.                                        */
/*                                                                     */
/* NOTE(1): Receive buffers are aligned on cache line boundaries.      */
/* NOTE(2): The order of the fields is fixed by the Lan chip.          */
/*---------------------------------------------------------------------*/
typedef volatile struct RxPkt
{
  LAN_HWA   daddr;              /* Ethernet destination address */
  LAN_HWA   saddr;              /* Ethernet source address */
  USHORT    type;               /* IP, ARP, or RARP */
  UCHAR     data[1500];         /* frame data */
  UCHAR     crc[4];             /* lan chip generated */
  UCHAR     fill[14];           /* fills struct to 1536 bytes */
  volatile struct RxPkt *next;
} LAN_RX_BUF;

/*---------------------------------------------------------------------*/
/* Define Receive Buffer headers and free list pointer                 */
/*---------------------------------------------------------------------*/
static LAN_RX_BUF *RxBufFreeHead;       /* head of free list */

/*---------------------------------------------------------------------*/
/* Define Receive Descriptors & receive related variables              */
/*---------------------------------------------------------------------*/
static LAN_BUFF_DESC *RxNextBD;   /* ptr to next Rx desc to be full */
static LAN_BUFF_DESC *RxUsedBD;   /* ptr to next Rx desc needing buf */

/*---------------------------------------------------------------------*/
/* Holds the number of transmit descriptors and headers.               */
/*---------------------------------------------------------------------*/
static ULONG TxNumDesc;
static LAN_BUFF_DESC *TxDesc;
static ULONG TxNumHdrs;
static LAN_TX_HDR *TxHeaders;

/*---------------------------------------------------------------------*/
/* Holds the number of receive descriptors and buffers.                */
/*---------------------------------------------------------------------*/
static int RxNumDesc;
static LAN_BUFF_DESC *RxDesc;
static int RxNumBufs;
static LAN_RX_BUF *RxBuffers;

/*---------------------------------------------------------------------*/
/* Miscellaneous Variables                                             */
/*---------------------------------------------------------------------*/
static ULONG MissedFrames;          /* # of receive frames missed */
static long IfNum;                  /* Interface # (pNA+ assigned) */
static LAN_HWA OurAddress;          /* Our Ethernet address */
static struct ni_funcs NiFuncs;     /* pNA+ func (esballoc,freemsg) */

/*---------------------------------------------------------------------*/
/* LAN speed, 10 or 100 Mbps. Default is 10.                           */
/*---------------------------------------------------------------------*/
static ULONG lan_spd = MBPS10;
static long (*Announce)(ULONG type, void *ptr, ULONG size, long if_num);
static UCHAR FlushFlag;     /* True if tx buff descs being flushed */

/*---------------------------------------------------------------------*/
/* MIB-Related Variables                                               */
/*---------------------------------------------------------------------*/
static long ifadminstatus;
static long InUnknownProtos;
static long InOctets, OutOctets;
static long InUcastPkts, OutUcastPkts;
static long innucastpkts, outnucastpkts;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产大陆a不卡| 国产女人18毛片水真多成人如厕| 欧美大片在线观看| 中文字幕一区二区三区av| 久久99精品久久久久婷婷| 色婷婷精品久久二区二区蜜臂av | 久久久精品免费网站| 一个色在线综合| 国产精品自拍三区| 欧美一卡二卡三卡| 亚洲午夜视频在线| 在线视频综合导航| 国产精品久线观看视频| 激情综合色综合久久综合| 欧美日韩精品综合在线| 亚洲精品国产精品乱码不99| 国产高清精品在线| 久久综合狠狠综合| 韩国成人在线视频| 日韩精品一区在线观看| 免费成人在线观看| 欧美一区二区大片| 日产国产高清一区二区三区| 欧美日韩亚洲国产综合| 亚洲午夜在线电影| 欧美日韩精品电影| 日本在线不卡视频一二三区| 欧美色综合网站| 亚洲一区二区三区国产| 在线精品国精品国产尤物884a| 亚洲欧美成人一区二区三区| 成人h动漫精品| 亚洲欧美在线视频观看| 91女人视频在线观看| 亚洲色图一区二区三区| 91美女福利视频| 亚洲午夜影视影院在线观看| 在线观看91精品国产麻豆| 五月婷婷另类国产| 日韩三级视频在线看| 久久福利资源站| 久久久精品2019中文字幕之3| 国产精品一二一区| 欧美国产一区二区在线观看| 成人av电影在线观看| 一区二区三区精品在线| 在线成人免费视频| 国模一区二区三区白浆| 国产性色一区二区| 91啪在线观看| 免费人成精品欧美精品| 精品少妇一区二区三区视频免付费| 国内精品久久久久影院薰衣草| 国产午夜亚洲精品午夜鲁丝片| 成人精品小蝌蚪| 亚洲高清免费视频| 欧美成人女星排行榜| 国产精品系列在线观看| 亚洲美女淫视频| 日韩午夜电影在线观看| 成人av在线播放网站| 亚洲成av人在线观看| 久久综合精品国产一区二区三区| hitomi一区二区三区精品| 午夜激情综合网| 久久久亚洲高清| 欧美性猛交一区二区三区精品| 另类小说综合欧美亚洲| 亚洲欧洲综合另类在线| 精品国产91亚洲一区二区三区婷婷| 成人h动漫精品| 久久99久久99| 中文字幕一区二区在线播放 | 五月天国产精品| 国产视频一区二区在线| 欧美色偷偷大香| 成人午夜av在线| 日本不卡视频在线观看| 亚洲欧美日韩国产中文在线| 久久综合久久99| 欧美年轻男男videosbes| 成人黄色片在线观看| 视频在线观看国产精品| 国产精品久久久久久一区二区三区| 日韩欧美一区二区视频| 欧美性大战久久| 99re这里只有精品6| 国产一区二区三区四| 日本强好片久久久久久aaa| 亚洲精品久久7777| 日本一区二区三区国色天香| 欧美一二三四区在线| 精品视频1区2区| 日本精品一级二级| 99亚偷拍自图区亚洲| 国产成人aaa| 国产精品88av| 久久电影网电视剧免费观看| 日日欢夜夜爽一区| 日韩一区精品视频| 亚洲成人黄色影院| 一区二区三区久久久| 亚洲欧美激情小说另类| 亚洲欧美在线观看| 日韩美女视频一区二区| 中文字幕一区二区三| 国产精品久久网站| 中文字幕日本不卡| 国产精品每日更新在线播放网址 | 欧美mv和日韩mv的网站| 91精品国产综合久久婷婷香蕉| 色婷婷久久久亚洲一区二区三区 | 亚洲一区av在线| 亚洲午夜在线视频| 无码av中文一区二区三区桃花岛| 亚洲自拍偷拍网站| 亚洲大片精品永久免费| 视频在线观看国产精品| 免费国产亚洲视频| 精品一区二区三区久久| 国产精品一卡二| 成人免费看视频| 色噜噜狠狠色综合欧洲selulu| 99精品欧美一区| 欧美影院一区二区| 欧美精品第一页| 日韩精品资源二区在线| 国产日本欧美一区二区| 中文字幕亚洲欧美在线不卡| 亚洲精品免费在线播放| 亚洲成a人在线观看| 精品伊人久久久久7777人| 国产精品夜夜嗨| 91丝袜美女网| 欧美美女一区二区| 精品福利在线导航| 国产精品天干天干在观线| 亚洲精品日韩综合观看成人91| 亚洲午夜羞羞片| 国产一区二区三区久久久| 97精品国产露脸对白| 欧美老肥妇做.爰bbww视频| 日韩精品一区二| 亚洲欧美日韩电影| 免费观看在线综合| 成人18视频日本| 欧美一区二区三区人| 国产欧美一区二区三区鸳鸯浴| 亚洲精品水蜜桃| 精品制服美女久久| 色综合欧美在线| 精品久久久久久无| 亚洲一区二区三区三| 国产一区二区三区美女| 欧美性猛交xxxxxxxx| 日本一区二区三区久久久久久久久不 | 国产盗摄精品一区二区三区在线| av中文字幕亚洲| 日韩三级免费观看| 亚洲色图丝袜美腿| 国产乱人伦偷精品视频免下载| 日本二三区不卡| 亚洲国产精品精华液ab| 日本伊人色综合网| 色诱视频网站一区| 久久精品人人做人人综合| 日韩电影网1区2区| 91成人在线精品| 国产精品三级av| 激情六月婷婷综合| 6080国产精品一区二区| 18成人在线观看| 成人一区二区三区中文字幕| 日韩三级伦理片妻子的秘密按摩| 亚洲愉拍自拍另类高清精品| 成人性生交大合| 精品免费视频.| 久久99精品久久久久久国产越南 | 亚洲成av人片在线观看无码| 91蝌蚪porny九色| 欧美国产97人人爽人人喊| 极品少妇xxxx偷拍精品少妇| 欧美剧情片在线观看| 亚洲一区在线免费观看| 色成人在线视频| 中文字幕综合网| 91天堂素人约啪| 亚洲视频一区二区在线观看| 成人黄页毛片网站| 中文字幕永久在线不卡| 国产91精品免费| 日本一区二区三区在线不卡 | 激情综合色播五月| 日韩免费在线观看| 激情文学综合网| 久久久综合视频| 粉嫩aⅴ一区二区三区四区| 国产婷婷色一区二区三区四区| 国产黑丝在线一区二区三区| 久久久久久久久岛国免费|