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

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

?? sysenet.c

?? vVxWorks_CS_BSD 網(wǎng)卡驅(qū)動(dòng)程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* sysEnet.c - pc386/486 system-dependent module for CS8900 Ethernet driver */
/*                                                                          */
/* Copyright 2000 Crystal Semiconductor Corp.                               */
/*                                                                          */
/*               Last release: v2.07a                                       */
/* Mod level for last release: 07a                                          */


/*
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
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
韩国欧美国产1区| 亚洲伦理在线精品| 欧美伦理视频网站| 91福利视频网站| 色综合欧美在线视频区| 99久久精品国产网站| 成人一级片在线观看| 高清国产一区二区| 国产精品资源在线| 成人美女视频在线观看| 91在线云播放| 欧美日韩大陆在线| 日韩一区二区三区免费看 | 91捆绑美女网站| 91女人视频在线观看| 欧美亚洲综合网| 欧美一区二区免费| 国产丝袜在线精品| 亚洲视频 欧洲视频| 亚洲成人av资源| 免费在线一区观看| 成人网男人的天堂| 欧美在线免费播放| 精品国产99国产精品| 国产精品女主播在线观看| 亚洲嫩草精品久久| 日韩va欧美va亚洲va久久| 国产精品正在播放| 99re亚洲国产精品| 91麻豆精品国产91久久久资源速度| 色噜噜偷拍精品综合在线| 欧美性猛交一区二区三区精品| 欧美自拍丝袜亚洲| 精品国产乱码久久| 亚洲免费观看在线观看| 美国十次综合导航| 91视频免费观看| 5月丁香婷婷综合| 日韩美女视频一区二区| 日本不卡在线视频| 91麻豆精品视频| 精品sm捆绑视频| 午夜在线成人av| 99久久99久久精品免费看蜜桃| 欧美一区二区三区色| 中文字幕制服丝袜一区二区三区 | 波多野结衣在线aⅴ中文字幕不卡| 欧美在线综合视频| 国产日韩欧美制服另类| 免费在线看一区| 欧美在线啊v一区| 国产精品视频在线看| 理论片日本一区| 欧美日韩的一区二区| 一区二区三区鲁丝不卡| 成人激情免费网站| 久久综合中文字幕| 美女视频黄 久久| 在线观看日韩精品| 亚洲人亚洲人成电影网站色| 国产毛片精品一区| www一区二区| 免费精品视频在线| 欧美日韩精品是欧美日韩精品| 中文字幕在线视频一区| 国产精品中文字幕日韩精品| 67194成人在线观看| 夜夜嗨av一区二区三区中文字幕 | 亚洲欧美在线视频| 成人性生交大片免费看在线播放 | 精品久久久久久久一区二区蜜臀| 亚洲午夜精品网| 色婷婷av一区| 樱花影视一区二区| 欧美在线视频全部完| 夜夜操天天操亚洲| 欧美三级日韩在线| 亚洲一级二级三级| 欧美日韩国产乱码电影| 亚洲成人在线免费| 91精品国产综合久久久蜜臀粉嫩 | jiyouzz国产精品久久| 国产精品国产自产拍高清av王其| 国产精品一区在线观看你懂的| 26uuu亚洲| 成人动漫在线一区| 亚洲女人****多毛耸耸8| 色视频成人在线观看免| 亚洲综合网站在线观看| 91.麻豆视频| 国内欧美视频一区二区| 中文字幕欧美日本乱码一线二线| 国产成人午夜视频| 最近日韩中文字幕| 欧美日韩国产系列| 极品少妇xxxx精品少妇| 亚洲精品一区二区三区福利| 成人自拍视频在线| 亚洲高清不卡在线观看| 精品久久久久一区| 91亚洲男人天堂| 日本不卡在线视频| 国产精品国产三级国产| 正在播放一区二区| 成人午夜在线免费| 视频一区二区国产| 日本一区二区三区免费乱视频| 色哟哟一区二区三区| 麻豆一区二区三| √…a在线天堂一区| 在线欧美小视频| 国产伦精品一区二区三区免费迷| 亚洲欧洲综合另类在线| 日韩一区二区三区在线观看| 99re成人精品视频| 激情欧美一区二区| 亚洲线精品一区二区三区| 久久久www成人免费毛片麻豆| 一本一本久久a久久精品综合麻豆| 毛片av一区二区三区| 亚洲另类一区二区| 国产三级精品三级| 欧美一区二区三区思思人| 91浏览器在线视频| 国产精品白丝av| 狂野欧美性猛交blacked| 伊人一区二区三区| 国产精品久久久久久久久动漫 | 国产精品嫩草99a| 日韩久久久精品| 欧美综合一区二区三区| 成人性生交大片免费| 国产在线精品一区二区三区不卡| 亚洲成av人片| 亚洲免费伊人电影| 亚洲欧美在线视频| 中文字幕乱码日本亚洲一区二区| 日韩欧美一卡二卡| 91精品国产91久久综合桃花| 色中色一区二区| 91免费看片在线观看| 波多野结衣中文一区| 国产成人在线视频免费播放| 麻豆精品在线播放| 日韩影院在线观看| 亚洲成av人综合在线观看| 亚洲欧美日韩系列| 中文字幕一区av| ...av二区三区久久精品| 国产精品视频线看| 国产精品大尺度| 亚洲精品国久久99热| 亚洲精品视频免费看| 亚洲人成网站色在线观看| 中文字幕综合网| 亚洲伊人色欲综合网| 亚洲午夜电影网| 亚洲亚洲人成综合网络| 三级不卡在线观看| 秋霞午夜av一区二区三区| 强制捆绑调教一区二区| 精品一区二区三区在线观看| 久久99久久久欧美国产| 国产精品资源网| 色综合久久久久综合99| 欧美日韩情趣电影| 日韩欧美综合一区| 国产欧美日韩不卡| 中文字幕日韩一区二区| 亚洲夂夂婷婷色拍ww47| 日韩高清中文字幕一区| 国产综合一区二区| 99久精品国产| 欧美日本在线播放| 久久综合成人精品亚洲另类欧美| 国产日韩视频一区二区三区| 亚洲欧美日韩国产综合| 日韩精品成人一区二区三区| 黄色资源网久久资源365| 岛国一区二区三区| 欧美伊人久久大香线蕉综合69| 日韩一区二区电影网| 国产精品久久久久四虎| 亚洲一区二区精品久久av| 国产一区91精品张津瑜| 色猫猫国产区一区二在线视频| 69堂国产成人免费视频| 国产精品久久三| 日韩高清一区在线| 91日韩一区二区三区| 精品国产免费一区二区三区四区 | 色老汉一区二区三区| 欧美www视频| 亚洲资源中文字幕| 国产高清精品在线| 欧美一卡2卡3卡4卡| 亚洲人成网站在线| 国产91对白在线观看九色| 欧美精品粉嫩高潮一区二区| 中文字幕一区视频|