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

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

?? csend.c

?? cs8900在vxworks系統下的驅動
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* csEnd.c - Crystal Semiconductor CS8900 network interface driver          */
/*                                                                          */
/* Copyright 2000 Crystal Semiconductor Corp.                               */
/*                                                                          */
/*               Last release: v3.05a                                       */
/* Mod level for last release: 05a                                          */

/*
modification history
--------------------
v3.06a,11/02/01, kml
             - Added BYTE_SWAP() in writting to the multicast filter register.
			 - remove if (END_MULTI_LST_CNT(&pCS->end) > 0) {} in csConfig() so that
			   csAddrFilterSet() is always called.  csAddrFilterSet() will zero the
               MulticastTable and return if the last one in END_MULTI_LST has been deleted.

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.
             - Pass ETHERMTU to END_MIB_INIT() instead of 
			   ETHERMTU+SIZEOF_ETHERHEADER to fix the bug that pinging the 
			   target with a packet size larger than the MTU size would fail.
			 - Added INT_LOCK and INTUNLOCK in csTxNextFrame() to fixed the bug
			   that CS8900 stops Tx after Tx underrun errors occurs.
             
v3.04a,09May01, kml 
             -Added support for SH3.  ALIGMENT_32BIT needs to be defined for 
			  SH3, ARM, MIPS. 

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,07May99, kml    ported to the Enhanced Network Driver (END) model 
                       to support the MUX interface. 


01g.25nov97.jla  Added defs to help a page fault with hard resets.
                 HARD_RESET does hard chip resets
                 SOFT_RESET does a softer, kinder sort of reset
                 The routine csResetChip does one or the other based
                 on the define set in if_cs.h

01q,11apr97,rks  Implementd "early tx" support.  Required mods to csLoad
                 (initialization), csInitChip (early tx int enable),
                 csTxNextFrame, and csBufferEvent.

01p,09apr97,rks  Replaced common TX code in csStartOutput and csTransmitEvent
                 with a new routine csTxNextFrame().
                 Added conditional compile for a Tx Queue depth and max TX
                 Queue depth counter if CS_DEBUG_ENABLE defined.

01o,07apr97,rks  Changed queue routines (enqueue and deueue) to make the data
                 update prior to pointer update.  Removed the int lock/unlock
                 around the queue accesses in csEventHandler (no longer needed
                 with the new queue routines).
                 Moved the m_freem call to after the intUnlock in csStartOutput.

01n,01apr97,rks  Implemented a local queue for TX frames.  On csStartOuput call,
                 the interface's queue is drained.  Frames are then taken from
                 the local queue in csStartOutput and at ISR level for transmit
                 to ensure the interface's queue is manipulated only by routines
                 at the same context (csStartOuput and ether_output).

01m,30mar97,rks  Modified the csIntHandler.  Removed the chip int disables and
                 replaced with CLI/STI pairs only around queue manipulations.
                 Also, now use a "NetJobDepth" counter instead of an active flag
                 to determine if another csIntHandler needs to be queued.
                 Moved the netJobAdd logic to the bottom of the ISR and removed
                 it from all the ISR sub-routines.

01l,27mar97,rks  Bracketed mbuff routines in csProcessReceive with splnet/splx.

01k,28feb97,rks  Added circular queue manipulation routines to handle TX mbufs
                 to be freed and RX frames to be handled at the task level.
                 Created generic event handler (csEventHandler) to processe RX
                 frame processing and TX mbuff freeing at the task level.
                 Added a counter to ensure never more than 2 instances of the
                 event handler are queued for tNetTask processing.

01j,27feb97,rks  Added support for the collision counter. Moved support for Rx
                 miss counter to ISR (saves a function call).

01h,25feb97,rks  Modifications for MIPS suppport (prevent word reads from odd
                 addresses in csCopyTXFrame.  Debug macro to replace csError
                 routine. (Greg Rasche)

01g,07jan97,rks  Modified csLoad to remove parameter for specifying
                 Ethernet address.

01f,16dec96,rks  Divided the driver into two files, this file for
                 system-indendent routines and "sysEnet.c" containing
                 target-specific routines and macros for "IO mode" operations.
                 Added BYTE_SWAP macro for all non-constant io values
                 to the CS8900.  Replace pcX86-specific io routine
                 calls with SYS_IN/OUT macros.

01e,12dec96,rks  Moved the pTxFrameChain variable to the CS_END_DEVICE structure.
                 Moved the int disable in csStartOutput to immediately
                 before the Rdy4TxNow poll.  Mutex'd the call to
                 IF_DEQUEUE in csStartOutput with splnet/splx.

01d,05dec96,rks  Removed the processing of every RX miss and implemented
                 support for RX miss statistics using the RX miss counter
                 with RX Miss Counter Overflow interrupts instead.

01c,25nov96,rks  Added version number to statistics reported by csShow(),
                 Added support for TX on Rdy4Tx interrupts, Created
                 routine csFreeTxFrame() to move call of m_freem()
                 to task level Added statistic reported by csShow for
                 Rdy4Tx events

01b,16nov96,rks  Removed support for collision counter (AnyColliE) to
                 improve system perf.

01a,12jul96,q_s  Written.

*/



/*
DESCRIPTION
This module implements the Crystal Semiconductor CS8900 Ethernet network
interface driver.

This driver's structure is designed to facilitate porting to any architecture
supported by VxWorks.  The routines in this file are system independent.  A
library of system-dependent routines in the file "csSysEnd.c" must be provided
for the target system.  This driver supports only one CS8900 device per system
board.


SYSTEM DEPENDENT SUPPORT ROUTINES
This driver requires five system-dependent support routines.  These five
routines are defined in sysEnet.c.

* sysEnetGetConfig( CS_END_DEVICE *pCS )
This routine takes configuration parameters not specifed to csEndLoad(), if
any, from non-volatile storage (e.g. an attached EEPROM) and puts them in
the CS_END_DEVICE structure.

* sysEnetAddrGet( CS_END_DEVICE *pCS, unsigned char *pAddr )
This routine obtains the Ethernet MAC address from non-volatile storage or
from the "csEnetAddr" array in csSysEnd.c dependent on the
CS8900_ENET_ADDR_FROM_BOARD flag defined in csSysEnd.c and saves the
Ethernet address to 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.  


INCLUDE FILES: csEnd.h, csSysEnd.c
*/



/* INCLUDES */

#include "vxWorks.h"
#include "sysLib.h"
#include "intLib.h"
#include "logLib.h"
#include "netLib.h"
#include "etherLib.h"
#include "stdio.h"
#include "iv.h"
#include "ioctl.h"
#include "taskLib.h"
#include "net/if_subr.h"
#include "etherMultiLib.h"
#include "end.h"
#include "endLib.h"
#include "lstLib.h"

#include "csEnd.h"


/* ALIGMENT_32BIT needs to be defined for the processors that perform 32-bit
read/write, such as ARM, Strong ARM, SH3, SH4, and MIPS.
If the data buffer for transmission starts on an odd address boundary, copy it
to a temporary buffer that starts on an even address boundary, and write the
temporary buffer to the CS8900 Chip. */

#define ALIGMENT_32BIT 

 
/*********************** User Defines *******************************/

 /* this flag is used to turn DEBUG on or off */
#define CS_DEBUG_ENABLE

/*CS8900_INTERRUPT_REQUEST_PIN_NUM is used for non-Ix86 processors.
For the users of the Intel x86 processors, this define will NOT be used.  You can ignore it.
For the users of the non-Ix86 processors (eg. SHx, ARM, MIPS...), this define must be defined.
The CS8900 has four interrupt request output pins that can be connected directly 
to Processor. Only one interrupt output pin is connected to your processor.
CS8900_INTERRUPT_PIN_NUM defines which interrupt pin is used.
 0:  INTRQ0
 1:  INTRQ1
 2:  INTRQ2
 3:  INTRQ3
*/
#define CS8900_INTERRUPT_REQUEST_PIN_NUM     0 /* or other number: 0-3 */

/*********************** End of User Defines *******************************/
/*************************************************************************************/

#ifdef  CS_DEBUG_ENABLE
#undef LOCAL 
#define LOCAL
#endif



#include "csSysEnd.c" /* lib of BSP specific routines used by CS8900 driver */


/* DEFINES */

#define CS_DRIVER_VER "3.06a" /* Driver revsion number */
#define CS_NAME       "cs"    /* the device name used to locate the END driver*/
#define CS_NAME_LEN    3      /* the length of the CS_NAME + 1 */

/* Configuration items */
#define END_BUFSIZE      (SIZEOF_ETHERHEADER+ETHERMTU+6)/* 4-byte alignment*/
#define END_SPEED        10000000


/* A shortcut for getting the hardware address from the MIB II stuff. */
#define END_HADDR(pEnd)        \
                ((pEnd)->mib2Tbl.ifPhysAddress.phyAddress)

#define END_HADDR_LEN(pEnd) \
                ((pEnd)->mib2Tbl.ifPhysAddress.addrLength)

/*********************** end debug macro *******************************/
 


/* FORWARD DECLARATIONS */

/* This is the only externally visible interface. */
END_OBJ*         csEndLoad (char* initString);

void csShow(void); /* may be called from WindSh */


/*********** END required routines ****************/
LOCAL STATUS        csStart(END_OBJ  * pV);
LOCAL STATUS        csStop(END_OBJ  * pV);
LOCAL STATUS        csUnload(END_OBJ  * pV);
LOCAL int           csIoctl( END_OBJ  * pV, int Command, caddr_t data );
LOCAL STATUS        csSend (END_OBJ  * pV, M_BLK_ID pMBufChain);                          
LOCAL STATUS        csMCastAdd (END_OBJ  * pV, char* pAddress);
LOCAL STATUS        csMCastDel (END_OBJ  * pV, char* pAddress);
LOCAL STATUS        csMCastGet (END_OBJ  * pV, MULTI_TABLE* pTable);
LOCAL STATUS        csPollSend (END_OBJ  * pV, M_BLK_ID pMblk);
LOCAL STATUS        csPollRcv (END_OBJ  * pV, M_BLK_ID pMblk);
LOCAL STATUS        csPollStart (END_OBJ  * pV);
LOCAL STATUS        csPollStop (END_OBJ  * pV);



LOCAL CS_END_DEVICE *csParse( char *initString);
LOCAL STATUS        csInitRxBuff( CS_END_DEVICE *pCS );
LOCAL STATUS        csVerifyChip( CS_END_DEVICE *pCS );

STATUS        csInit( CS_END_DEVICE *pCS);
LOCAL void          csInitChip( CS_END_DEVICE *pCS );
void          csReset( CS_END_DEVICE *pCS);
LOCAL void          csConfig( CS_END_DEVICE *pCS);
LOCAL STATUS        csResetChip( CS_END_DEVICE *pCS );

LOCAL void csStartOutput( CS_END_DEVICE *pCS, M_BLK_ID pMbuf);
LOCAL void csCopyTxFrame( CS_END_DEVICE *pCS, M_BLK_ID pMbufChain );

LOCAL void csIntr( CS_END_DEVICE *pCS);
LOCAL void csEventHandler( CS_END_DEVICE *pCS );
LOCAL void csBufferEvent( CS_END_DEVICE *pCS, USHORT BuffEvent );
LOCAL void csTransmitEvent( CS_END_DEVICE *pCS, USHORT TxEvent );
LOCAL void csTxNextFrame( CS_END_DEVICE *pCS );
LOCAL void csReceiveEvent( CS_END_DEVICE *pCS, USHORT RxEvent );
LOCAL int  csCopyRxFrame( CS_END_DEVICE *pCS,char *pRxBuff );
LOCAL void csProcessReceive( CS_END_DEVICE *pCS, M_BLK_ID pRxBuff );

LOCAL USHORT csReadPacketPage( CS_END_DEVICE *pCS, USHORT Offset );
LOCAL void   csWritePacketPage( CS_END_DEVICE *pCS, USHORT Offset, USHORT Value );

LOCAL void   csInitQueue( CIR_QUEUE *Q );
LOCAL void   *csDequeue( CIR_QUEUE *Q );
LOCAL STATUS csEnqueue( CIR_QUEUE *Q, void *pBuff );
LOCAL BOOL   csQueueEmpty( CIR_QUEUE *Q );
UCHAR  calculateHashIndex(UCHAR *pMulticastAddr);
LOCAL void   updateCrc( USHORT bit );
LOCAL void   csAddrFilterSet(CS_END_DEVICE *pCS);
LOCAL void   csPurgeQs(CS_END_DEVICE *pCS);


extern void *        cacheDmaMalloc (size_t bytes);
extern int endMultiLstCnt( END_OBJ* pEnd);


/* used to calculate multicast hash index */
int CRC_Poly[] = {1,1,1,0,  1,1,0,1,
                  1,0,1,1,  1,0,0,0,
                  1,0,0,0,  0,0,1,1,
                  0,0,1,0,  0,0,0,0 };
int    CRC[33];

/*
 * Declare our function table.  This is static across all driver
 * instances.
 */

LOCAL NET_FUNCS endFuncTable =
    {
    (FUNCPTR) csStart,     /* Function to start the device. */
    (FUNCPTR) csStop,      /* Function to stop the device. */
    (FUNCPTR) csUnload,    /* Unloading function for the driver. */
    (FUNCPTR) csIoctl,     /* Ioctl function for the driver. */
    (FUNCPTR) csSend,      /* Send function for the driver. */
    (FUNCPTR) csMCastAdd,                /* Multicast address add function for the */
                                    /* driver. */
    (FUNCPTR) csMCastDel,                /* Multicast address delete function for */
                                    /* the driver. */
    (FUNCPTR) csMCastGet,                /* Multicast table retrieve function for */
                                    /* the driver. */
    (FUNCPTR) csPollSend,                /* Polling send function for the driver. */
    (FUNCPTR) csPollRcv,                /* Polling receive function for the driver. */
     endEtherAddressForm,        /* Put address info into a packet.  */
     endEtherPacketDataGet,      /* Get a pointer to packet data. */
     endEtherPacketAddrGet       /* Get packet addresses. */
    };



/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
 * OS Entry-point Routines                                                 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

/*******************************************************************************
*
* csEndLoad - initialize the driver and device
*
* This routine initializes the driver and the device to the operational state.
* All of the device specific parameters are passed in the initString.
*
* The string contains the target specific parameters like this:
*
* "Unit:IOAddr:IntLevel:MemAddr:MediaType:ConfigFlags"
*
* RETURNS: An END object pointer or NULL on error.
*/

END_OBJ* csEndLoad (
    char* initString                /* String to be parsed by the driver. */
    )
{
FAST CS_END_DEVICE *pCS;
STATUS status1, status2;

    if (initString == NULL)
        return (NULL);

        /*OS wants to get the END Ethernet device name if a null string is passed.*/
    if (initString[0] == NULL)
    {
        bcopy((char *)CS_NAME, initString, CS_NAME_LEN);
#ifdef CS_DEBUG_ENABLE
        logMsg("csEndLoad(): Returning CS8900 Device Name string...\n", 0, 0, 0,0, 0,0);
#endif
        return ((END_OBJ *)OK);
    }

   /* parse the init string, filling in the device structure */
   pCS=csParse (initString);
   if (pCS == NULL)
   {
#ifdef CS_DEBUG_ENABLE
      logMsg("csEndLoad(): Parser Error in initString.\n", 0, 0, 0 ,0, 0 ,0);
#endif
      return NULL;
   }

   /* Start out in IO mode */
   pCS->InMemoryMode = FALSE;

   /* Init TX in progress flag */
   pCS->TxInProgress = FALSE;

   /* Init the TX start command */
   pCS->TxStartCMD = CS_INITIAL_START_CMD;
   
   /* Set counters to zero */
   pCS->TxUnderruns      = 0;
   pCS->TotalTxUnderruns = 0;

   pCS->Collisions       = 0;
   pCS->MaxTxDepth       = 0;
   pCS->Rdy4TxInts       = 0;
   pCS->NetJobDepth      = 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品视频在线看| 一区精品在线播放| 99精品视频在线播放观看| 香蕉久久夜色精品国产使用方法 | 欧美高清视频一二三区 | 亚洲福利电影网| 久久久不卡网国产精品一区| 欧美亚洲综合色| 成人免费电影视频| 精品一区二区国语对白| 依依成人精品视频| 国产精品美女久久久久aⅴ国产馆| 欧美日韩亚洲高清一区二区| 成人免费视频视频| 激情另类小说区图片区视频区| 一区二区三区四区中文字幕| 国产亚洲午夜高清国产拍精品| 51精品久久久久久久蜜臀| 色狠狠色噜噜噜综合网| 国产成人av福利| 蜜桃视频在线一区| 亚洲成人先锋电影| 亚洲精品美国一| 亚洲欧美一区二区视频| 精品成人免费观看| 日韩三级伦理片妻子的秘密按摩| 欧美日韩在线电影| 欧美这里有精品| 色综合天天综合在线视频| 国产高清在线精品| 精品系列免费在线观看| 三级一区在线视频先锋| 亚洲已满18点击进入久久| 亚洲私人黄色宅男| 亚洲日本一区二区三区| 欧美激情一二三区| 国产欧美日韩在线看| 久久久九九九九| 久久精品一区二区| 欧美激情一区二区三区四区| 国产视频一区二区在线| 久久精品在线免费观看| 国产天堂亚洲国产碰碰| 国产日产亚洲精品系列| 国产色婷婷亚洲99精品小说| 久久久不卡网国产精品二区| 久久久久久久av麻豆果冻| 久久久久国产精品厨房| 中文av一区特黄| 亚洲欧洲性图库| 亚洲免费观看高清完整版在线观看| 亚洲丝袜美腿综合| 一区二区三区四区蜜桃 | 国产剧情一区在线| 国产大陆a不卡| av成人免费在线观看| 91麻豆福利精品推荐| 日本伦理一区二区| 欧美精品三级日韩久久| 91精品国产综合久久精品麻豆| 欧美一区国产二区| 久久久久久久久久久久久久久99| 国产精品久久久爽爽爽麻豆色哟哟| 中文字幕电影一区| 亚洲最大成人综合| 偷拍自拍另类欧美| 国产一区欧美二区| 99久久国产综合精品女不卡| 欧洲国内综合视频| 91精品国产91久久久久久一区二区| 精品理论电影在线| 国产精品你懂的| 五月天丁香久久| 狠狠色狠狠色综合| av午夜一区麻豆| 欧美日韩免费视频| 久久综合一区二区| 亚洲欧美一区二区三区极速播放| 亚洲一本大道在线| 国产精品一区二区男女羞羞无遮挡 | av在线播放不卡| 56国语精品自产拍在线观看| 精品国产乱码久久久久久免费| 日本一区二区三区久久久久久久久不 | 亚洲精品一区二区三区影院 | 精品国产精品一区二区夜夜嗨| 亚洲国产精品传媒在线观看| 亚洲一级电影视频| 精品亚洲成a人在线观看| www.av精品| 欧美成人一级视频| 亚洲精品免费看| 国产精品88av| 欧美一区二区三区免费视频| 中文字幕制服丝袜成人av | 日韩亚洲欧美成人一区| 国产精品久久久久天堂| 免费高清在线一区| 91小视频免费观看| 精品成人佐山爱一区二区| 亚洲一区中文在线| 成人一区二区三区视频在线观看| 777奇米成人网| 亚洲欧美日韩国产另类专区| 国产在线乱码一区二区三区| 欧美午夜在线一二页| 国产精品麻豆一区二区| 久久69国产一区二区蜜臀| 精品污污网站免费看| 自拍偷拍欧美激情| 国产高清成人在线| 精品国产一区久久| 丝袜美腿亚洲色图| 欧洲人成人精品| 亚洲男人天堂一区| 成人精品视频一区二区三区尤物| 欧美一级日韩一级| 视频在线观看91| 欧美视频一区二区三区四区| 亚洲卡通动漫在线| 成人高清在线视频| 欧美激情一二三区| 国产很黄免费观看久久| 精品99久久久久久| 美国十次综合导航| 欧美一区二区三区免费| 亚洲成人av电影在线| 欧美视频在线观看一区二区| 亚洲美腿欧美偷拍| 91色在线porny| 亚洲摸摸操操av| 91色九色蝌蚪| 亚洲综合丝袜美腿| 欧美日韩一区中文字幕| 亚洲成人午夜影院| 欧美日韩一本到| 日本欧美久久久久免费播放网| 欧美女孩性生活视频| 视频一区免费在线观看| 欧美精品 国产精品| 日韩精品色哟哟| 日韩无一区二区| 激情综合色播五月| 久久综合九色综合欧美98| 国产精品自拍毛片| 国产欧美日韩久久| 成人av电影在线| 夜夜操天天操亚洲| 欧美日韩成人激情| 看国产成人h片视频| 精品国产sm最大网站| 国产福利一区二区三区视频在线| 国产日韩欧美激情| 99re66热这里只有精品3直播| 亚洲精品国产视频| 欧美日韩mp4| 国产综合久久久久久鬼色| 日本一区二区三区dvd视频在线| www.亚洲在线| 亚洲一区二区三区四区不卡| 3d动漫精品啪啪一区二区竹菊| 久久国产精品无码网站| 日本一区二区三区在线观看| 91免费版在线| 蜜臀av一区二区在线观看| 久久精品人人做人人综合| 不卡的电视剧免费网站有什么| 一区二区三区.www| 精品少妇一区二区三区免费观看| 国产91对白在线观看九色| 亚洲欧美视频一区| 欧美一区午夜精品| 成人午夜激情影院| 天堂影院一区二区| 欧美国产激情一区二区三区蜜月| 91老师片黄在线观看| 免费在线观看不卡| 中文字幕中文字幕一区| 777亚洲妇女| 99久久婷婷国产综合精品电影| 日韩不卡一二三区| 国产精品久久久久久久久果冻传媒| 欧美日韩免费不卡视频一区二区三区| 麻豆高清免费国产一区| 亚洲欧美一区二区不卡| 精品国产露脸精彩对白| 在线日韩av片| 国产白丝精品91爽爽久久 | www.色精品| 蜜臀av一区二区在线免费观看| 中文字幕中文字幕一区| 日韩欧美色电影| 欧美专区亚洲专区| 国产99久久久国产精品| 天天综合色天天综合| 中文字幕一区av| 久久精品在线观看| 日韩欧美aaaaaa| 欧美日韩免费在线视频| 99精品久久久久久|