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

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

?? sysenet.c

?? 這是一個(gè)在VxWorks系統(tǒng)實(shí)現(xiàn)CS網(wǎng)卡END驅(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.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
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲高清免费一级二级三级| 国产欧美一区二区精品仙草咪| 激情综合色综合久久| 中文字幕av免费专区久久| 欧美日韩精品免费| www.一区二区| 久久 天天综合| 五月综合激情婷婷六月色窝| 中文字幕在线一区免费| 日韩视频123| 在线视频一区二区免费| 大尺度一区二区| 美女视频网站黄色亚洲| 亚洲成人先锋电影| 一区二区三区免费网站| 国产精品久久久久影视| 久久综合色之久久综合| 欧美一区二区女人| 欧美在线观看你懂的| 99久久精品国产导航| 国产91富婆露脸刺激对白| 免费成人性网站| 日欧美一区二区| 亚洲国产成人av好男人在线观看| 自拍偷拍亚洲激情| 国产欧美一区二区精品忘忧草| 精品国产免费久久| 日韩一区二区免费高清| 7878成人国产在线观看| 欧美午夜片在线看| 欧美午夜电影网| 在线一区二区三区四区| 色老汉av一区二区三区| 91性感美女视频| 91小视频在线免费看| 色欧美88888久久久久久影院| 91免费版在线看| 色综合色综合色综合 | 一区二区激情视频| 亚洲日本中文字幕区| 亚洲欧洲国产日韩| 亚洲天天做日日做天天谢日日欢| 成人免费在线播放视频| 亚洲欧美另类小说视频| 亚洲激情综合网| 亚洲五码中文字幕| 日韩福利电影在线| 蜜桃av一区二区| 国产精品原创巨作av| 成人自拍视频在线| 91在线高清观看| 欧美无砖砖区免费| 日韩欧美国产电影| 久久久噜噜噜久久中文字幕色伊伊 | 日本少妇一区二区| 韩国精品在线观看| 成人激情文学综合网| 91激情五月电影| 欧美高清dvd| 久久这里只有精品6| 中文欧美字幕免费| 一区二区不卡在线播放| 日韩电影在线一区二区| 国内精品视频一区二区三区八戒| 国产精品18久久久久久久久| 91在线观看污| 在线成人免费视频| 久久久亚洲精华液精华液精华液| 国产精品久久久久一区二区三区| 亚洲精品乱码久久久久久久久| 日日摸夜夜添夜夜添精品视频| 国产在线观看一区二区| 99精品国产一区二区三区不卡| 欧美亚洲尤物久久| 精品少妇一区二区| 亚洲欧洲av一区二区三区久久| 亚洲成人午夜影院| 国产一区二区调教| 在线亚洲高清视频| 久久久精品国产99久久精品芒果| 亚洲裸体xxx| 久久成人羞羞网站| 色久综合一二码| 久久综合狠狠综合久久激情| 亚洲免费电影在线| 国模套图日韩精品一区二区| 色综合色狠狠综合色| 精品国产污污免费网站入口| 亚洲麻豆国产自偷在线| 狠狠色综合播放一区二区| 色婷婷综合久色| 久久久久久久综合| 亚洲自拍偷拍网站| 国产成人在线视频播放| 9191精品国产综合久久久久久| 国产精品久久久久久亚洲伦| 日韩av网站免费在线| 日本精品裸体写真集在线观看| 欧美精品一区在线观看| 亚洲成人先锋电影| 色综合视频在线观看| 久久久亚洲午夜电影| 日韩国产欧美视频| 色婷婷亚洲综合| 欧美激情在线一区二区三区| 美女视频一区二区| 欧美日韩三级一区二区| 国产精品视频麻豆| 国产在线视频一区二区三区| 4438x亚洲最大成人网| 亚洲免费视频成人| 91免费国产视频网站| 国产精品电影院| 国产成人av在线影院| 精品国产乱码久久久久久免费 | 国产亚洲短视频| 捆绑调教美女网站视频一区| 欧美视频精品在线| 亚洲图片你懂的| 成人福利视频网站| 国产欧美精品一区| 国产高清成人在线| 久久亚区不卡日本| 精品无码三级在线观看视频| 3d成人h动漫网站入口| 亚洲一区二区三区四区五区中文 | 亚洲国产成人午夜在线一区| 久久国产欧美日韩精品| 欧美理论片在线| 亚洲黄一区二区三区| 91在线观看美女| 亚洲三级在线免费观看| 色婷婷综合久久久中文字幕| 亚洲激情自拍偷拍| 欧美亚洲禁片免费| 亚洲妇女屁股眼交7| 欧美日韩综合色| 亚洲第一狼人社区| 51午夜精品国产| 蜜臀av一区二区在线观看| 日韩欧美国产电影| 久草中文综合在线| 2021久久国产精品不只是精品| 久久97超碰国产精品超碰| 国产亚洲精品7777| av欧美精品.com| 一区二区三区在线观看网站| 在线欧美日韩国产| 五月天亚洲精品| 日韩欧美黄色影院| 国产精品一区二区三区99| 国产三区在线成人av| 99久久亚洲一区二区三区青草| 亚洲精品中文在线影院| 欧美日韩一区成人| 久久国产尿小便嘘嘘尿| 国产欧美一区二区精品性色超碰| 99久久精品情趣| 爽爽淫人综合网网站| 精品国产伦一区二区三区观看方式| 国产成人综合在线观看| 自拍视频在线观看一区二区| 在线播放日韩导航| 国产一区在线观看视频| 中文字幕亚洲一区二区va在线| 欧美在线观看视频一区二区| 精品一区二区三区免费毛片爱| 欧美国产精品专区| 欧美视频自拍偷拍| 国产在线精品不卡| 亚洲愉拍自拍另类高清精品| 日韩午夜小视频| voyeur盗摄精品| 五月天亚洲精品| 国产精品麻豆久久久| 欧美亚洲精品一区| 国产精品亚洲成人| 午夜精品免费在线| 国产三级欧美三级| 欧美日韩免费电影| 懂色av一区二区三区免费观看| 亚洲一区二区三区小说| 久久免费看少妇高潮| 欧美性大战久久久| 成人激情综合网站| 久久精品国产99国产| 一级中文字幕一区二区| 欧美精品一区二区三区视频| 欧洲日韩一区二区三区| 韩国v欧美v亚洲v日本v| 亚洲一区二区三区在线播放| 国产午夜精品一区二区三区嫩草 | 欧美最猛黑人xxxxx猛交| 国产黑丝在线一区二区三区| 亚洲韩国精品一区| 国产精品网友自拍| 日韩欧美国产一区二区在线播放 | 天天操天天干天天综合网| 国产精品久久久久久久久免费丝袜 | 91污在线观看|