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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sysenet.c

?? CS8900A網(wǎng)絡(luò)芯片驅(qū)動(dòng)
?? C
?? 第 1 頁 / 共 2 頁
字號(hào):
/* sysEnet.c - pc386/486 system-dependent module for CS8900 Ethernet driver */
/*                                                                          */
/* Copyright 2000 Crystal Semiconductor Corp.                               */
/*                                                                          */
/*               Last release: v2.08a                                       */
/* Mod level for last release: 08a                                          */


/*
MODIFICATION HISTORY
--------------------
v2.07a,09Oct00, kml  -Padded 2 bytes in RxBuf to make IP header in the WORD boundary.
                     -Fixed the bug that if CPU type is MIPS, an extra byte is sent
					  when an odd-aligned buffer and odd length data are passed.
 
v2.04a,24Sep99, kml  -Take out IFF_MULTICAST in BSD43 mode because not supported.
                     -Change receiving buffer size from 32 to 64.
                     -Correction: If the memory address parameter is zero, the CS8900 operates in the
                      mode specified by EEPROM or the Config Flag parameter.

02a,31Mar99,kml  converted to BSD44 driver, merge from SENS

10f,11apr97,rks  Added variables for "early tx" support to CS_SOFTC structure
                 (TxUnderruns, TotalTxUnderruns, TxStartCMD, and TxLenght.

10e,05apr97,rks  Added CS_MAX_NET_JOBS and STRESS_TESTING defines.

10d,11mar97,rks  Moved some typedefs to this file so "config.h" could include
                 "if_cs.h" easily. 

01c,25feb97,rks  Changed SysEnetAddrGet parameters to Unit, IA addr pointer

01b,31jan97,rks  Modified sysEnetAddrGet to take Ethernet address from EEPROM
                 or from the csEnetAddr array based on the value of the 
                 GET_ENET_ADDR_FROM_BOARD flag.
		 
01a,16dec96,rks  Written (using routines originally written by q_s in "if_cs.c".
*/


/*
DESCRIPTION

This module provides pc386/pc486 board-specific routines and data types require
by the Crystal Semiconductor CS8900 Ethernet network interface driver.  It 
implements five routines called from the "if_cs.c" main driver module:

* sysEnetGetConfig( CS_SOFTC *pCS )
This routine takes configuration parameters not specifed to csAttach(), if any,
from non-volatile storage (e.g. an attached EEPROM) and puts them in the 
cs_softc structure. If all the parameters were specified to csAttach(), then 
this routine does not attempt to read the EEPROM.

* sysEnetAddrGet( int Unit, unsigned char *pAddr )
This routine obtains the Ethernet MAC address from non-volatile storage or from 
the "csEnetAddr" array defined in sysEnet.c and saves it in the arpcom 
structure.

* sysEnetHWInit( CS_SOFTC *pCS )
This routine uses global variables in the cs_softc structure to configure the 
adapter for the board-specific IO circuitry and supported media types.

* sysEnetIntEnable( CS_SOFTC *pCS )
This routine enables the interrupt used by the CS8900 at the system level. 
 
* sysEnetIntDisable( CS_SOFTC *pCS )
This routine disables the interrupt used by the CS8900 at the system level.  It 
is not currently used by this driver.

*/



/* DEFINES */

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
 * Driver Configuration Defines                                            *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

/* Maximum number of CS8900 chips supported */

#define CS_MAX_NUM_UNITS        1 


/* Maximum number of receive buffers */ 
     
#define CS_NUM_RX_BUFFERS       64


/* Maximum number of elements (pointers) in local TX and RX queues */

#define CS_MAX_QUEUE   320  /* MAX_MBUF (1500 - defined in mbuf.h) */



/* Set STRESS_TESTING TRUE to suppress excessive debug messages */

#define STRESS_TESTING 		TRUE


/* Initial TXStartCMD (number of bytes to buffer before CS8900 starts the TX */
/* Select one of: [TX_CMD_START_5 | TX_CMD_START_381 | TX_CMD_START_1021 | 
 * TX_CMD_START_ALL ] */

#define CS_INITIAL_START_CMD	TX_CMD_START_5


/* Number of underruns with current TXStartCMD before TXStartCMD is set to next value */

#define CS_TX_UNDRUN_TRHSHOLD   3 


/* BSP type supported by this driver */  

#define CS_BSP_TYPE	"i[3|4]86"          


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
 * Miscellaneous and BSP-specific defines                                  *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */


/* Define a unique cluster type */

#define MC_LOANED	5       


/* 
This flag determines if the Ethernet address is taked from EEPROM or from
the csEnetAddr array defined below.  Define as 0 to take the Ethernet address
from csEnetAddr.  WARNING! The Ethernet address must be unique for each Ethernet
device on the network.
*/

#define GET_ENET_ADDR_FROM_BOARD  1


/* 
These macros are used to communicate with the CS8900 in iX86 IO space.  For the 
pc386/pc486 BSPs, they just call system routines provided by VxWorks/PCX86 for 
IO space access.  They need to be replaced with system calls appropriate for 
VxWorks on other architectures. 
*/
 
/* Macros used to provide platform independence for IO accesses */
#define SYS_ENET_OUT_WORD(port, value)	        sysOutWord((port), (value))
#define SYS_ENET_IN_WORD(port)			sysInWord(port)
#define SYS_ENET_IN_BYTE(port)			sysInByte(port)





/* TYPEDEFS */

/* Individual Address (Ethernet Address) */
typedef struct
{
   USHORT word[3];
} IA, *PIA;


/* Receive Frame Buffer */
struct rxbuf
{
   struct rxbuf *pNext;
   UCHAR         Status;
   UCHAR         RefCount;
   USHORT        Length;
   USHORT        PAD_ME; /*IP header must be in the WORD boundary. */
   /* Ethernet header has 14 bytes. Pad 2 bytes to make IP header in the WORD boundary.*/ 
   UCHAR         Data[SIZEOF_ETHERHEADER+ETHERMTU];
};

typedef struct rxbuf RXBUF, *PRXBUF;
typedef struct mbuf TXBUF, *PTXBUF, *PMBUF;



typedef struct 
{
    void  *Queue[CS_MAX_QUEUE+1];
    int    Head;
    int    Tail;   

} CIR_QUEUE; 


typedef USHORT IOADDR;    /* IO space address is 16-bit */


/* Driver control structure for a single unit */

typedef struct
{
   struct     arpcom ArpCom;
   IOADDR     IOAddr;           /* This data type is platform dependent */
   USHORT     IntLevel;
   USHORT     IntVector;
   USHORT    *pPacketPage;      
   USHORT     MediaType;
   USHORT     ConfigFlags;
   PRXBUF     pFreeRxBuff;
   BOOL       InMemoryMode;
   BOOL       Resetting;
   USHORT     RxDepth;
   USHORT     MaxRxDepth;
   USHORT     MaxTxDepth;
   USHORT     TxQueueDepth;
   USHORT     MaxTxQueueDepth;
   UINT       LoanCount;
   UINT	      Rdy4TxInts;
   PTXBUF     pTxFrameChain;
   BOOL       TxInProgress;
   BOOL       InISR;
   CIR_QUEUE *pTxBuffFreeList;
   CIR_QUEUE *pRxBuffProcessList;
   CIR_QUEUE *pTxQueue;
   UINT	      NetJobDepth;
   USHORT     TxStartCMD;
   USHORT     TxUnderruns;
   UINT       TotalTxUnderruns;
   UINT       TxLength;
} CS_SOFTC;




/* EXTERNALS */

IMPORT UINT sysVectorIRQ0;           /* vector for IRQ0 */




/* LOCALS */

unsigned char csEnetAddr [6] = { 0x08, 0x00, 0x20, 0x74, 0x80, 0xa7 };

/* Instance variables */
LOCAL CS_SOFTC cs_softc[CS_MAX_NUM_UNITS];  
CIR_QUEUE TxBuffFreeList;
CIR_QUEUE RxBuffProcessList;
CIR_QUEUE TxQueue;





/* FORWARD DECLARATIONS */
LOCAL STATUS sysEnetGetConfig( CS_SOFTC *pCS );
LOCAL STATUS sysEnetAddrGet( int Unit, unsigned char *pAddr );
LOCAL void sysEnetHWInit( CS_SOFTC *pCS );
LOCAL STATUS sysEnetIntEnable( CS_SOFTC *pCS );
/* Not required for this BSP
LOCAL STATUS sysEnetIntDisable( CS_SOFTC *pCS );
*/

/* sub-routines for above functions */

LOCAL STATUS csGetUnspecifiedParms( CS_SOFTC *pCS );
LOCAL STATUS csValidateParms( CS_SOFTC *pCS );
LOCAL STATUS csReadEEPROM( CS_SOFTC *pCS, USHORT Offset, USHORT *pValue );

#ifdef TRUE
/* These routines defined in if_cs.c but available for use here. */
/* Ifdef FALSE if none are called from this module */
#define DECLARED_IN_SYS_ENET
LOCAL USHORT csReadPacketPage( CS_SOFTC *pCS, USHORT Offset );
LOCAL void csWritePacketPage( CS_SOFTC *pCS, USHORT Offset, USHORT Value );
#endif







/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
 * pc386/486 Board-specific routines                                       *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

#define MAXLOOP       0x8888  /* Delay loop counter  */        


/******************************************************************************
*
* sysEnetGetConfig - Get any CS8900 parameters not specifed to csAttach
*
* This routine gets parameters that were not specifed to csAttach() from an 
* EEPROM, if used, and puts them in the cs_softc structure.  If all the 
* parameters were specified to csAttach(), then this routine does not attempt 
* to read the EEPROM.
*
* RETURNS: OK or ERROR
*
*/

LOCAL STATUS sysEnetGetConfig( CS_SOFTC *pCS )
{
	/* Get parameters, which were not specified, from the EEPROM */
   if ( csGetUnspecifiedParms(pCS) == ERROR )
      return ERROR;

	/* Verify that parameters are valid */
   if ( csValidateParms(pCS) == ERROR )
      return ERROR;

   /* If memory address was specified but configuration flags were not */
   if ( pCS->pPacketPage !=0 )
      pCS->ConfigFlags |= CFGFLG_MEM_MODE;  /* Implictly set memory mode */

   /* If the interrupt vector was not specified then derive it */
   if ( pCS->IntVector == 0 )
      pCS->IntVector = sysVectorIRQ0 + pCS->IntLevel;

	return OK;

}




/*******************************************************************************
*
* sysEnetAddrGet - saves the Ethernet address to the arpcom structure
*
* If a pointer to an Ethernet address string was passed-in to the csAttach()
* routine, then this routine coverts the address string to an Ethernet address
* and saves it in the arpcom structure.  If an Ethernet address string was
* not passed-in, then the Ethernet address is read from the EEPROM and saved
* in the arpcom structure.
*
* RETURNS: OK or ERROR
*
*/

LOCAL STATUS sysEnetAddrGet( int Unit, unsigned char *pAddr )
{
   USHORT SelfStatus;
   PIA pIA;
   FAST CS_SOFTC *pCS;

   /* We only support one unit */
   if ( Unit >= CS_MAX_NUM_UNITS )
      return ERROR;

   pCS = &cs_softc[Unit];

   /* Setup pointer for the Ethernet address */
   pIA = (PIA)pAddr;

   /* If the Ethernet address in EEPROM */
   if ( GET_ENET_ADDR_FROM_BOARD )   /* defined in config.h */
   {
      /* Verify that the EEPROM is present and OK */
      SelfStatus = csReadPacketPage( pCS, PKTPG_SELF_ST );
      if ( !((SelfStatus & SELF_ST_EEP_PRES) && (SelfStatus & SELF_ST_EEP_OK)))
      {
         printf("\ncs0 - EEPROM is missing or bad\n");
         return ERROR;
      }

      /* Get Ethernet address from the EEPROM */
      if ( csReadEEPROM(pCS,EEPROM_IND_ADDR_H,&pIA->word[0]) == ERROR )
         return ERROR;
      if ( csReadEEPROM(pCS,EEPROM_IND_ADDR_M,&pIA->word[1]) == ERROR )
         return ERROR;
      if ( csReadEEPROM(pCS,EEPROM_IND_ADDR_L,&pIA->word[2]) == ERROR )
         return ERROR;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲bdsm女犯bdsm网站| 日本电影欧美片| 欧美午夜视频网站| 国产亚洲女人久久久久毛片| 亚洲一区自拍偷拍| 成人aa视频在线观看| 精品女同一区二区| 日日摸夜夜添夜夜添精品视频| 成人av网站免费| 久久久夜色精品亚洲| 日韩在线一二三区| 欧美日韩国产一区二区三区地区| 国产精品私人影院| 精品一区二区三区日韩| 欧美一区中文字幕| 亚洲香肠在线观看| 在线日韩一区二区| 一区二区三区四区不卡在线| 成人午夜私人影院| 国产欧美日韩精品一区| 国产精品99久久久久久久女警| 精品美女一区二区三区| 免费人成精品欧美精品| 日韩亚洲欧美在线| 美女网站色91| 欧美变态tickling挠脚心| 青椒成人免费视频| 欧美一区二区三区日韩视频| 亚洲成人777| 欧美精品精品一区| 秋霞影院一区二区| 欧美刺激脚交jootjob| 久久精品国产精品亚洲红杏| 26uuu亚洲| 国产精品香蕉一区二区三区| 亚洲国产精品99久久久久久久久 | 狂野欧美性猛交blacked| 欧美伦理电影网| 日本欧洲一区二区| 欧美精品一区二区三区高清aⅴ| 精品一区二区三区在线观看| 国产丝袜在线精品| 99精品国产91久久久久久| 亚洲免费观看高清完整版在线观看 | 欧美日韩一区精品| 午夜激情久久久| 日韩美女在线视频| 国产在线一区观看| 日韩一区中文字幕| 欧美视频一区二区三区| 青椒成人免费视频| 国产精品色哟哟网站| 日本国产一区二区| 久久丁香综合五月国产三级网站| 国产色91在线| 欧美在线观看一区| 久久99国产精品麻豆| 国产精品视频一区二区三区不卡| 91久久精品日日躁夜夜躁欧美| 亚洲最色的网站| 欧美电视剧在线观看完整版| 粉嫩aⅴ一区二区三区四区五区| 亚洲美女免费在线| 欧美v国产在线一区二区三区| 成人短视频下载| 日韩影院在线观看| 国产精品不卡一区| 欧美丰满一区二区免费视频| 久久精品999| 一区二区三区四区精品在线视频| 欧美电视剧在线观看完整版| 91啪九色porn原创视频在线观看| 免费人成在线不卡| 一区二区欧美在线观看| 久久综合成人精品亚洲另类欧美| 99视频一区二区三区| 卡一卡二国产精品| 亚洲国产成人av| 国产精品视频一二三| 日韩一区二区电影网| 91麻豆自制传媒国产之光| 精品亚洲aⅴ乱码一区二区三区| 一区二区三区在线免费播放| 国产女主播视频一区二区| 91精品国产综合久久久久| 色综合天天天天做夜夜夜夜做| 精品在线一区二区| 亚洲第一久久影院| 亚洲乱码国产乱码精品精98午夜| 久久精品夜色噜噜亚洲aⅴ| 91精品国产综合久久福利| 日本电影亚洲天堂一区| 成人美女在线观看| 国产成人免费在线视频| 另类小说图片综合网| 亚洲成人动漫av| 亚洲毛片av在线| 国产精品久久久99| 国产精品日日摸夜夜摸av| 久久综合九色欧美综合狠狠| 欧美不卡一二三| 日韩精品自拍偷拍| 日韩女优制服丝袜电影| 日韩欧美中文字幕公布| 欧美精品在线观看播放| 欧美日韩精品一区视频| 日本电影亚洲天堂一区| 91久久精品日日躁夜夜躁欧美| 99精品视频在线观看| 色综合天天在线| 在线视频你懂得一区二区三区| 91免费国产视频网站| 91麻豆免费观看| 在线精品视频小说1| 欧美性大战久久久久久久蜜臀| 色先锋aa成人| 欧美亚洲高清一区二区三区不卡| 色噜噜狠狠成人中文综合| 日本久久电影网| 这里只有精品99re| 久久综合丝袜日本网| 久久久久久久精| 国产精品美女久久久久久久久久久| 国产亚洲欧美日韩俺去了| 国产精品欧美一级免费| 亚洲人成精品久久久久久| 亚洲尤物在线视频观看| 日韩影院免费视频| 国产一区二区三区电影在线观看| 国内外精品视频| 粉嫩绯色av一区二区在线观看| 91亚洲永久精品| 精品视频一区三区九区| 欧美一二三区在线观看| 国产欧美一区二区精品仙草咪| 国产精品电影院| 亚洲成av人片观看| 狠狠久久亚洲欧美| 99久久婷婷国产| 欧美精品精品一区| 国产日产欧美一区二区三区| 亚洲与欧洲av电影| 激情六月婷婷综合| 97久久精品人人澡人人爽| 欧美日韩色一区| 国产日韩精品一区二区浪潮av| 伊人一区二区三区| 精品中文字幕一区二区小辣椒| 91香蕉视频污在线| 欧美一级片在线看| 中文字幕在线不卡| 另类的小说在线视频另类成人小视频在线| 精品亚洲国内自在自线福利| 91视频观看免费| 久久久一区二区三区捆绑**| 亚洲一卡二卡三卡四卡五卡| 久久69国产一区二区蜜臀| 91在线精品秘密一区二区| 日韩欧美在线123| 亚洲色图.com| 国产乱码精品1区2区3区| 在线视频国内一区二区| 久久九九影视网| 青青草国产精品97视觉盛宴 | 国产在线精品一区二区夜色| 在线一区二区三区做爰视频网站| 欧美videos中文字幕| 亚洲第一激情av| 99r精品视频| 欧美国产精品中文字幕| 蜜臀a∨国产成人精品| 在线观看亚洲一区| 国产精品久久毛片a| 国产一区免费电影| 日韩精品资源二区在线| 天天综合天天综合色| 色综合久久中文综合久久牛| 国产日韩欧美高清| 国产一区亚洲一区| 日韩精品在线看片z| 亚洲成av人片一区二区梦乃| 91啦中文在线观看| 中文字幕一区二区三区不卡| 国产麻豆精品theporn| 日韩一区二区在线观看视频| 亚洲韩国精品一区| 91福利精品视频| 亚洲免费观看高清| 色系网站成人免费| 伊人婷婷欧美激情| 在线看国产一区| 亚洲第一会所有码转帖| 欧美日高清视频| 午夜精品免费在线| 69久久夜色精品国产69蝌蚪网| 亚洲r级在线视频| 91精品国产全国免费观看| 日本欧美肥老太交大片| 日韩免费视频一区二区| 国产一区二区三区在线看麻豆|