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

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

?? cssysend.c

?? CS8900的Vxworks驅(qū)動(dòng)源代碼 1.0
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* csSysEnd.c - PCx86 or ARM system-dependent module for CS8900 Ethernet driver */
/*                                                                          */
/* Copyright 2000 Crystal Semiconductor Corp.                               */
/*                                                                          */
/*               Last release: v3.05a                                       */
/* Mod level for last release: 05a                                          */

/*
MODIFICATION HISTORY
--------------------
v3.05a,06/26/01, kml - Added Support for Interrupt Level and Interrupt Vector for 
                       Non-Ix86 processors. 
					 - Added CS8900_INTERRUPT_REQUEST_PIN_NUM for Non-Ix86 processors to 
					   write their interrupt pin number to InterruptNumber Register.
                     - Modified the code so that logMsg is used only when CS_DEBUG_ENABLE is
					   defined.  Thus, compiler warning mesages can be avoided if 
					   CS_DEBUG_ENABLE is not defined.
                     - Added "Define your BSP Type" for users to define their
					   CS_BSP_TYPE string.


v3.03a,10/02/00, kml -Merged for PCx86 and ARM.

   June 20000        -Modified for ARM 940 by Conexant Systems, Inc.                     

v3.02a,24Sep99, kml  -Set offset 2 to the receiving buffer pointer when copying received frames from chip
                      so that the IP header stars from the 17th bytes for 32-bits-Alignment.
                     -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.

v3.01a,07May, kml    ported to the Enhanced Network Driver (END) model 
                       to support the MUX interface:  


10f,11apr97,rks  Added variables for "early tx" support to CS_END_DEVICE 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 PCx86 and ARM board-specific routines and data types require
by the Crystal Semiconductor CS8900 Ethernet VxWorks END network interface driver.  
It implements five routines called from the "csEnd.c" main driver module:

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

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

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

* sysEnetIntEnable( CS_END_DEVICE *pCS )
This routine enables the interrupt used by the CS8900 at the system level. 
 
* sysEnetIntDisable( CS_END_DEVICE *pCS )
This routine disables the interrupt used by the CS8900 at the system level.  
*/



/* 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

/* Minimum bytes of first buffer for chain used by scattered transmission. */
#define CS_MIN_FBUF  5

/* Number of elements held by TX and RX queues */
#define CS_QUEUE_SIZE  200  /* @kml */


/* 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   2 

/* BSP type supported by this driver */ 
#if CPU_FAMILY ==  ARM 
#define CS_BSP_TYPE	"ARM"

#elif  CPU_FAMILY ==  MIPS         
#define CS_BSP_TYPE	"MIPS"

#elif  CPU_FAMILY == I80X86
#define CS_BSP_TYPE	"i[3|4]86"

#else
#define CS_BSP_TYPE	"Unknown BSP Type"
#endif

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

/* Define a unique cluster type */

/* 
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. These functions need to be supplied 
by syslib.c
*/
 
/* Macros used to provide platform independence for IO accesses */

#if CPU_FAMILY ==  ARM
#define SYS_ENET_OUT_WORD(port, value)	sysOutWord((int)(port), (value))
#define SYS_ENET_IN_WORD(port)			sysInWord((int)(port))
#define SYS_ENET_IN_BYTE(port)			sysInByte((int)(port))
#else
#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)
#endif

/* TYPEDEFS */

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



typedef struct 
{
    void  *Queue[CS_QUEUE_SIZE+1];
    int    Head;
    int    Tail;   
} CIR_QUEUE; 


#if CPU_FAMILY ==  ARM
typedef unsigned long IOADDR;    /* IO space address is 32-bit */
#else
typedef unsigned short IOADDR;    /* IO space address is 16-bit */
IMPORT UINT sysVectorIRQ0;           /* vector for IRQ0 */
#endif

/* Driver control structure for a single unit */

typedef struct
{
   END_OBJ    end;
   int        unit;
   UCHAR      enetAddr[6];
   IOADDR     IOAddr;
   USHORT     IntLevel;
   USHORT     IntVector;
   unsigned short    *pPacketPage;      
   USHORT     MediaType;
   USHORT     ConfigFlags;
   BOOL       InMemoryMode;
   BOOL       Resetting;
   USHORT     MaxTxDepth;
   USHORT     TxQueueDepth;
   USHORT     MaxTxQueueDepth;
   UINT	      Rdy4TxInts;
   M_BLK_ID   pTxFrameChain;
   BOOL       TxInProgress;
   BOOL       InISR;
   CIR_QUEUE *pTxBuffFreeList;
   CIR_QUEUE *pRxBuffProcessList;
   CIR_QUEUE *pTxQueue;
   UINT	      NetJobDepth;
   USHORT     TxStartCMD;
   USHORT     TxUnderruns;
   UINT       TotalTxUnderruns;
   UINT       TxLength;
   UINT       Collisions;
   CL_POOL_ID pClPoolId;
   USHORT     MulticastTable[4];
} CS_END_DEVICE;



/* Define GET_ENET_ADDR_FROM_BOARD as 0 to take the Ethernet address
from csEnetAddr.  */

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

/* Instance variables */
LOCAL CS_END_DEVICE cs_end[CS_MAX_NUM_UNITS];  
CIR_QUEUE TxBuffFreeList;
CIR_QUEUE RxBuffProcessList;
CIR_QUEUE TxQueue;



/* For ARM user only:   */
/* The following code is specific for Conexant IRD, ARM 940. You can take it as an
   example or ignore it. */

/* @Conexant ARM 940 specific code */ 
/*
#include "basetype.h"
#include "sabine.h"
#include "hwconfig.h"
#include "hwlib.h"
#include "retcodes.h"

extern  PFNISR  ethernetChainNode;  // ISR linked list node storage
extern  void csIntr(CS_END_DEVICE *arg);

CS_END_DEVICE *EndObject;

int ethernetIntHandler(unsigned int IntID, int FIQ, PFNISR *nextNode)
{

    csIntr(EndObject);
    *nextNode = ethernetChainNode;
    return(RC_ISR_NOTHANDLED);  // All PCI ints return this
}

void    init_cs8900(void)
{

   // Set the memory base address
   SYS_ENET_OUT_WORD(0x3150030a, 0x002c);
   SYS_ENET_OUT_WORD(0x3150030c, 0x0000);
   SYS_ENET_OUT_WORD(0x3150030a, 0x002e);
   SYS_ENET_OUT_WORD(0x3150030c, 0x0000);

   int_register_isr(INT_GPIO68, (PFNISR)ethernetIntHandler, FALSE, FALSE,
                   &ethernetChainNode);
   set_gpio_int_edge(68, POS_EDGE);
}    



int    sysCsIntAck(void)
{
    
    clear_pic_interrupt(PIC_GPIO, INT_GPIO68);
    return 1;
}
*/
/* end of Conexant IRD, ARM 940 */



/* Crystal Semiconductor supplied code */

/* FORWARD DECLARATIONS */
LOCAL STATUS sysEnetGetConfig( CS_END_DEVICE *pCS );
LOCAL STATUS sysEnetAddrGet( CS_END_DEVICE *pCS, unsigned char *pAddr ); /*@kml*/
LOCAL void   sysEnetHWInit( CS_END_DEVICE *pCS );
LOCAL STATUS sysEnetIntEnable( CS_END_DEVICE *pCS );
LOCAL STATUS sysEnetIntDisable( CS_END_DEVICE *pCS );  /*@kml*/


/* sub-routines for above functions */

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

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


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


/******************************************************************************
*
* sysEnetGetConfig - Get any CS8900 parameters not specifed to csLoad
*
* This routine gets parameters that were not specifed to csAttach() from an 
* EEPROM, if used, and puts them in the CS_END_DEVICE 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_END_DEVICE *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 ) {
#if CPU_FAMILY == I80X86
    pCS->IntVector = sysVectorIRQ0 + pCS->IntLevel;
#else
     pCS->IntVector = pCS->IntLevel;
#endif
   }
	return OK;
}


/*******************************************************************************
*
* sysEnetAddrGet - saves the Ethernet address to the CS_END_DEVICE structure
*
* The Ethernet address is taked from EEPROM or from the csEnetAddr array 
* then the Ethernet address was saved in the CS_END_DEVICE structure.
*
* pAddr: the pointer points to the array holding Ethernet Addr in CA_END_DEVICE
*
* RETURNS: OK or ERROR
*/

LOCAL STATUS sysEnetAddrGet( CS_END_DEVICE *pCS, unsigned char *pAddr )
{
   USHORT SelfStatus;
   PIA pIA;


   /* 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)))
      {
#ifdef CS_DEBUG_ENABLE
         logMsg("\ncs0 - EEPROM is missing or bad\n",0,0,0,0,0,0);
#endif
         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;
   }
   else  /* Use Ethernet Address defined in csEnetAddr */
      bcopyBytes ((char *) csEnetAddr, (char *) pIA, 6);

   return OK;
}


/*******************************************************************************
*
* sysEnetHWInit - configure the adapter for board-specific IO and media support

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲自拍另类综合| 日本不卡高清视频| 精品国产亚洲一区二区三区在线观看| 国产成人自拍在线| 日韩黄色免费网站| 一区二区三区不卡视频| 国产午夜精品久久久久久免费视| 欧美视频在线不卡| av影院午夜一区| 久久电影网电视剧免费观看| 亚洲电影中文字幕在线观看| 中文字幕av一区 二区| 日韩欧美国产精品一区| 欧洲色大大久久| 91免费小视频| 大陆成人av片| 国产精品系列在线播放| 免费久久99精品国产| 香蕉久久夜色精品国产使用方法| 亚洲欧美另类综合偷拍| 国产女人水真多18毛片18精品视频| 91精品国产91久久久久久一区二区| 欧美日韩中字一区| 99re视频精品| 不卡视频一二三| 成人激情免费网站| 成人丝袜高跟foot| 丁香婷婷综合五月| 国产成+人+日韩+欧美+亚洲| 国内精品写真在线观看| 韩国精品免费视频| 黄色日韩三级电影| 国产一区二区三区高清播放| 国产一区二区在线看| 久久国产日韩欧美精品| 老司机免费视频一区二区三区| 日日夜夜免费精品视频| 婷婷久久综合九色国产成人| 日日摸夜夜添夜夜添精品视频 | 一区二区三区在线视频播放| 自拍偷拍欧美精品| 伊人夜夜躁av伊人久久| 亚洲激情自拍视频| 性欧美疯狂xxxxbbbb| 日本成人在线不卡视频| 久久精品99国产精品| 国产自产视频一区二区三区| 国产精品自产自拍| 成人综合婷婷国产精品久久| eeuss鲁一区二区三区| 91久久精品午夜一区二区| 在线看不卡av| 在线播放视频一区| 精品日韩一区二区| 亚洲国产精品二十页| 樱花草国产18久久久久| 天天色综合成人网| 久久精品理论片| 成人免费黄色在线| 在线视频一区二区三区| 欧美一区二区三区成人| 久久精品免费在线观看| 中文字幕视频一区| 天堂蜜桃一区二区三区| 国产剧情一区在线| 色成年激情久久综合| 51精品久久久久久久蜜臀| 国产午夜精品在线观看| 亚洲一区国产视频| 久久99国内精品| 99精品久久只有精品| 91精品国产综合久久精品app| 久久综合久久综合亚洲| 亚洲女同一区二区| 蜜臀久久99精品久久久久久9 | 91精品久久久久久蜜臀| 久久精品欧美日韩精品 | 亚洲人成小说网站色在线| 亚洲午夜精品在线| 国产精品一级二级三级| 欧美日韩精品一区二区天天拍小说 | 欧美成人伊人久久综合网| 国产精品白丝在线| 蜜桃视频一区二区三区| 91在线一区二区| 欧美岛国在线观看| 亚洲永久免费视频| 国产高清在线精品| 欧美一区二区三区播放老司机| 亚洲美女淫视频| 国模少妇一区二区三区| 欧美综合久久久| 国产精品免费看片| 久久狠狠亚洲综合| 欧美视频在线一区| 1000部国产精品成人观看| 黄色小说综合网站| 欧美一区在线视频| 亚洲激情av在线| 丁香天五香天堂综合| 日韩一级片在线观看| 亚洲免费电影在线| 成人午夜激情视频| 精品成人免费观看| 婷婷久久综合九色综合绿巨人| 91色在线porny| 欧美激情在线看| 国产米奇在线777精品观看| 91精品国产免费| 亚洲高清不卡在线| 欧美中文字幕一区二区三区亚洲| 国产亚洲精品免费| 精品一区二区三区在线播放视频| 欧美亚洲动漫另类| 一区二区三区自拍| 色婷婷亚洲婷婷| 亚洲色欲色欲www| 成人爱爱电影网址| 中文字幕av免费专区久久| 国产精品一区久久久久| 精品99999| 久久精品噜噜噜成人88aⅴ| 日韩视频中午一区| 日韩精品五月天| 欧美高清hd18日本| 亚洲电影视频在线| 欧美天堂一区二区三区| 亚洲第一狼人社区| 欧美日韩视频专区在线播放| 一区二区日韩av| 欧美在线视频全部完| 亚洲国产精品麻豆| 欧美日韩成人综合在线一区二区 | 亚洲免费视频成人| av一区二区三区四区| 国产精品不卡视频| 91亚洲精品一区二区乱码| 自拍偷拍国产精品| 欧美艳星brazzers| 午夜精品福利久久久| 欧美一级二级三级蜜桃| 久久国产精品第一页| 国产亚洲欧美一级| 国产suv精品一区二区883| 国产精品卡一卡二| 日本高清不卡视频| 三级不卡在线观看| 久久夜色精品一区| 成人精品鲁一区一区二区| 最新久久zyz资源站| 欧美天天综合网| 久久精品国产色蜜蜜麻豆| 国产色一区二区| 一本大道久久a久久精二百| 亚洲成av人片在线| 亚洲精品在线观| 成人免费av网站| 亚洲成人高清在线| 精品免费视频一区二区| 不卡一区二区在线| 亚洲第一激情av| 精品国产凹凸成av人导航| 成人精品免费网站| 亚洲成人高清在线| 久久亚洲精华国产精华液| av不卡免费在线观看| 日韩在线一二三区| 国产欧美精品一区| 欧美日韩一区二区三区四区五区| 精品一区二区三区免费| 亚洲人成人一区二区在线观看 | 在线看国产日韩| 久久精品国产在热久久| 国产精品女同互慰在线看| 在线观看视频91| 国产一区二区在线看| 尤物视频一区二区| 精品国产髙清在线看国产毛片| proumb性欧美在线观看| 三级欧美在线一区| 中文字幕亚洲精品在线观看| 日韩西西人体444www| 99精品在线免费| 久久成人麻豆午夜电影| 亚洲精品国产成人久久av盗摄| 精品少妇一区二区三区在线播放| 99这里只有精品| 国内精品免费在线观看| 亚洲黄色尤物视频| 日本一区二区三区国色天香 | www久久精品| 欧洲精品一区二区三区在线观看| 国产精品影视网| 日韩在线一区二区| 有坂深雪av一区二区精品| 欧美韩国日本一区| 精品成人私密视频| 91精品在线免费观看| 日本高清不卡在线观看| 成人做爰69片免费看网站|