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

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

?? cssysend.c

?? s3c2410的vxworksBSP
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* csSysEnd.c - PCx86 or ARM system-dependent module for CS8900 Ethernet driver */
/*                                                                          */
/* Copyright 2000 Crystal Semiconductor Corp.                               */
/*                                                                          */
/*               Last release: v3.04a                                       */
/* Mod level for last release: 04a                                          */

/*
MODIFICATION HISTORY
--------------------

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   3 

#define rGPGCON    (*(volatile unsigned *)0x56000060) 
#define rEXTINT1   (*(volatile unsigned *)0x5600008c)
#define rEINTMASK  (*(volatile unsigned *)0x560000a4) 

/* BSP type supported by this driver */ 
#if CPU_FAMILY ==  ARM 
#define CS_BSP_TYPE	"ARM"
#elif  CPU_FAMILY ==  MIPS         
#define CS_BSP_TYPE	"MIPS"
#else
#define CS_BSP_TYPE	"i[3|4]86"
#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  0

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

/* 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*/
LOCAL STATUS cs8900a_pin_enable(void);
LOCAL STATUS cs8900a_pin_disable(void);
STATUS mask32_change_bsp(int* dist32, int num, int len, int src);


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

unsigned char SYS_ENET_IN_BYTE(unsigned long port)
{
    unsigned char inbyte;
    unsigned short *zhizhen;
    zhizhen=port;
    inbyte=*(zhizhen);
    return(inbyte); 
}
unsigned short SYS_ENET_IN_WORD(unsigned long port)
{
    unsigned short inword;
    unsigned short *zhizhen;
    zhizhen=port;
    inword=*(zhizhen);
    return(inword); 
}
void  SYS_ENET_OUT_WORD(unsigned long port, unsigned short value)
{
    unsigned short *zhizhen;
    zhizhen=port;
    *(zhizhen)=value;
}

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 CPU_FAMILY != ARM
   /* If the interrupt vector was not specified then derive it */
   if ( pCS->IntVector == 0 )
      pCS->IntVector = sysVectorIRQ0 + 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)))
      {
         LOGMSG("\ncs0 - EEPROM is missing or bad\n",0,0,0,0,0,0);
         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
*
* This routine uses global variables in the CS_END_DEVICE structure to configure the 
* adapter for the board-specific IO circuitry and media types supported.
*        
* RETURNS: Nothing
*         
*/

LOCAL void sysEnetHWInit( CS_END_DEVICE *pCS )
{
   USHORT BusCtl;
   USHORT SelfCtl;
   IOADDR DataPort;
   IOADDR AddrPort;

   DataPort=pCS->IOAddr + PORT_PKTPG_DATA;
   AddrPort=pCS->IOAddr + PORT_PKTPG_PTR;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区视频| 一本久久a久久精品亚洲| 正在播放一区二区| 午夜日韩在线观看| 欧美久久一二区| 久久狠狠亚洲综合| 欧美国产精品久久| 91免费在线视频观看| 夜夜嗨av一区二区三区| 欧美日本在线视频| 国内精品第一页| 中文字幕一区二区三区av| 欧美亚洲动漫精品| 青青草91视频| 欧美激情在线观看视频免费| 99re成人精品视频| 石原莉奈在线亚洲二区| 精品国产伦一区二区三区观看方式 | 欧美精品在欧美一区二区少妇| 天天影视色香欲综合网老头| 欧美一级一级性生活免费录像| 麻豆专区一区二区三区四区五区| 久久理论电影网| 色婷婷亚洲一区二区三区| 五月天婷婷综合| 国产清纯白嫩初高生在线观看91| 色哟哟日韩精品| 美女www一区二区| 亚洲视频在线一区| 精品免费一区二区三区| heyzo一本久久综合| 日本美女一区二区三区视频| 日本一区二区三区视频视频| 91年精品国产| 国产精品一区二区x88av| 国产成人免费xxxxxxxx| 夜夜精品视频一区二区| 久久久av毛片精品| 欧美日韩电影在线播放| a亚洲天堂av| 老司机一区二区| 亚洲人一二三区| 国产婷婷精品av在线| 欧美一区二区在线免费播放| 99re8在线精品视频免费播放| 精品一区二区av| 偷拍与自拍一区| 亚洲精品水蜜桃| 国产精品欧美一级免费| 久久色成人在线| 欧美一区日韩一区| 在线亚洲欧美专区二区| 国产伦精品一区二区三区免费迷| 亚洲欧美激情插 | 国产色91在线| 在线欧美日韩国产| 国产精品一品二品| 天天做天天摸天天爽国产一区| 国产午夜亚洲精品午夜鲁丝片| 欧美日韩一区中文字幕| 成人激情校园春色| 免费在线看成人av| 亚洲乱码日产精品bd| 国产欧美精品一区二区三区四区| 欧美日韩色综合| 91在线免费看| 国产福利精品导航| 精品一区二区三区久久久| 亚洲成人精品影院| 亚洲色图色小说| 国产视频视频一区| 3atv一区二区三区| 91精品欧美一区二区三区综合在| 色婷婷综合久久久| 国产电影一区在线| 国产精品羞羞答答xxdd| 久久aⅴ国产欧美74aaa| 五月综合激情日本mⅴ| 亚洲综合视频在线观看| 国产精品网友自拍| 中文字幕不卡在线| 欧美国产日本韩| 欧美国产成人精品| 国产婷婷一区二区| 欧美激情一区三区| 国产日韩欧美精品综合| 国产欧美日韩视频在线观看| 久久久久亚洲蜜桃| 日韩一区二区影院| 欧美精品第1页| 欧美裸体一区二区三区| 在线中文字幕一区二区| 欧洲精品视频在线观看| 在线观看亚洲a| 欧美日精品一区视频| 欧美日韩欧美一区二区| 欧美巨大另类极品videosbest | 不卡视频一二三四| 成人一区二区视频| 成人深夜在线观看| 国产成人av自拍| 成人sese在线| 97精品国产露脸对白| 91麻豆.com| 欧美少妇一区二区| 欧美高清你懂得| 精品999在线播放| 国产精品传媒入口麻豆| 亚洲女爱视频在线| 亚洲a一区二区| 免费av网站大全久久| 韩国成人在线视频| eeuss影院一区二区三区 | 一本久久a久久免费精品不卡| 欧美影片第一页| 欧美在线一二三| 欧美精品乱码久久久久久| 日韩欧美电影一区| 日本一区二区成人| 亚洲欧美激情一区二区| 偷拍一区二区三区四区| 国产裸体歌舞团一区二区| 91在线精品一区二区| 91精品久久久久久久91蜜桃| 精品久久国产字幕高潮| 欧美一区二区三区影视| 国产女同互慰高潮91漫画| 亚洲欧美另类在线| 日本午夜一区二区| 不卡一区中文字幕| 这里只有精品99re| 国产精品国产三级国产专播品爱网| 亚洲一区二区三区美女| 国产精品资源网站| 91天堂素人约啪| 久久精品亚洲麻豆av一区二区| 亚洲欧洲制服丝袜| 蜜臀av亚洲一区中文字幕| 粉嫩在线一区二区三区视频| 欧美色图免费看| 国产欧美精品一区| 欧美a级理论片| 色8久久人人97超碰香蕉987| 久久久国产午夜精品| 丝袜美腿一区二区三区| av电影在线观看完整版一区二区| 欧美日本在线视频| 最新国产の精品合集bt伙计| 韩国精品在线观看| 欧美一区二区免费视频| 一区二区三区四区在线播放 | 国产精品久久网站| 久久av中文字幕片| 欧美日韩国产不卡| 亚洲日本一区二区| 高清av一区二区| 精品国产亚洲在线| 青青草国产成人99久久| 欧美在线观看一二区| 国产精品美女www爽爽爽| 麻豆视频一区二区| 亚洲免费资源在线播放| 国产在线一区观看| 久久久久久99久久久精品网站| 视频一区视频二区在线观看| 色呦呦日韩精品| 国产精品乱码妇女bbbb| 国产伦精品一区二区三区视频青涩 | 天堂成人国产精品一区| 色综合久久中文字幕综合网| 国产欧美一区二区在线观看| 午夜电影一区二区| 欧美日韩一区二区在线观看| 18欧美亚洲精品| a在线播放不卡| 亚洲图片你懂的| 成人av电影在线播放| 欧美激情在线一区二区| 国产九九视频一区二区三区| 91.成人天堂一区| 亚洲成人1区2区| 欧美日韩国产电影| 天天色图综合网| 欧美电影在线免费观看| 日韩不卡一区二区| 日韩一区二区在线播放| 蓝色福利精品导航| 日韩视频不卡中文| 六月丁香婷婷久久| 欧美变态凌虐bdsm| 国产精品中文字幕欧美| 国产婷婷色一区二区三区在线| 高清在线观看日韩| 国产精品伦一区| 色悠悠久久综合| 天堂av在线一区| 久久先锋影音av| 成人精品gif动图一区| 国产欧美日韩亚州综合| 欧美日韩一区在线观看|