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

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

?? csend.c

?? VxWorks系統(tǒng)CS網(wǎng)卡END驅(qū)動(源碼).zip
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* csEnd.c - Crystal Semiconductor CS8900 network interface driver          */
/*                                                                          */
/* Copyright 2000 Crystal Semiconductor Corp.                               */
/*                                                                          */
/*               Last release: v3.04a                                       */
/* Mod level for last release: 04a                                          */

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


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

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

#ifdef  CS_DEBUG_ENABLE

#define LOGMSG logMsg

#undef LOCAL 
#define LOCAL

typedef struct {
  UINT32 arg1;
  UINT32 arg2;
  UINT32 arg3;
  UINT32 arg4;
} CS_HISTORY_TYPE;

#define CS_HISTORY_SIZE    100
CS_HISTORY_TYPE csHistory[ CS_HISTORY_SIZE ];
UINT32          csHistoryIndex;

/* function prototypes */
STATUS csHistoryInit( void );
STATUS csHistoryShow( void );
STATUS csHistoryAdd( UINT32 arg1, UINT32 arg2, UINT32 arg3, UINT32 arg4 );


#else
#define LOGMSG
#endif

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


/* DEFINES */

#define CS_DRIVER_VER "3.04a" /* 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 );

LOCAL STATUS        csInit( CS_END_DEVICE *pCS);
LOCAL void          csInitChip( CS_END_DEVICE *pCS );
LOCAL 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 );
LOCAL 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);
        LOGMSG("csEndLoad(): Returning CS8900 Device Name string...\n", 0, 0, 0,0, 0,0);
        return ((END_OBJ *)OK);
    }

   /* parse the init string, filling in the device structure */
   pCS=csParse (initString);
   if (pCS == NULL)
   {
      LOGMSG("csEndLoad(): Parser Error in initString.\n", 0, 0, 0 ,0, 0 ,0);
      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;

#ifdef CS_DEBUG_ENABLE
   pCS->TxQueueDepth    = 0;
   pCS->MaxTxQueueDepth = 0;
#endif

   /* Initialize local queues */
   pCS->pTxBuffFreeList = &TxBuffFreeList;
   pCS->pRxBuffProcessList = &RxBuffProcessList;
   pCS->pTxQueue = &TxQueue;
   csInitQueue( pCS->pTxBuffFreeList );
   csInitQueue( pCS->pRxBuffProcessList );
   csInitQueue( pCS->pTxQueue );
   
   /* Allocate the receive frame buffers */
   if ( csInitRxBuff(pCS) == ERROR )
   {
      LOGMSG("csEndLoad: CS_END_DEVICE %d Can not allocate receive buffers\n", 
              pCS->unit,0,0,0,0,0 );
      return NULL;
   }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩不卡一区二区三区| 国产综合色产在线精品 | 日韩欧美一二区| 懂色av一区二区三区免费看| 一区二区三区.www| 亚洲精品在线观看网站| 欧美午夜宅男影院| 不卡av电影在线播放| 麻豆精品一二三| 亚洲国产精品久久久男人的天堂| 国产亚洲精品福利| 欧美一级视频精品观看| 日本韩国精品一区二区在线观看| 国产成人综合精品三级| 免费观看在线色综合| 一区二区三区日韩欧美精品| 久久久国产午夜精品| 欧美大片一区二区| 欧美一区二区三区在| 91国产精品成人| 91色在线porny| 菠萝蜜视频在线观看一区| 国产毛片精品一区| 久久精品国产精品青草| 免播放器亚洲一区| 视频一区视频二区中文字幕| 亚洲一区二区三区视频在线| 亚洲视频香蕉人妖| 国产精品久久久久久久久免费樱桃 | 一区二区三区欧美亚洲| 国产精品女上位| 中文字幕av资源一区| 久久一日本道色综合| 欧美tickling挠脚心丨vk| 91精品国产一区二区三区| 欧美精品一二三| 欧美一区二区播放| 日韩欧美国产综合一区 | 成人不卡免费av| 粉嫩高潮美女一区二区三区| 国产精品一区二区久激情瑜伽 | 在线观看91精品国产入口| 色8久久精品久久久久久蜜| av电影在线观看一区| 成人av在线播放网址| 波多野结衣视频一区| av电影在线观看不卡| 91美女片黄在线观看91美女| 色伊人久久综合中文字幕| 91丝袜国产在线播放| 欧美性一区二区| 欧美一区二区国产| 国产亚洲欧美中文| 国产精品灌醉下药二区| 亚洲精品欧美激情| 亚洲成av人影院在线观看网| 日本美女一区二区三区视频| 久久国产精品99久久久久久老狼| 国产乱码一区二区三区| av高清不卡在线| 欧美日韩一区二区欧美激情 | 一区二区三区视频在线观看| 亚洲一级电影视频| 麻豆精品一区二区综合av| 黄页网站大全一区二区| 成人午夜看片网址| 在线观看日韩毛片| 精品毛片乱码1区2区3区| 中文字幕第一区| 亚洲成人免费电影| 狠狠色丁香久久婷婷综| 成人免费视频免费观看| 欧美区视频在线观看| 26uuu精品一区二区三区四区在线| 欧美国产日韩在线观看| 亚洲影院在线观看| 极品少妇一区二区三区精品视频| 高清成人在线观看| 欧美日本一区二区在线观看| 精品国产在天天线2019| 亚洲另类在线制服丝袜| 久久丁香综合五月国产三级网站| aaa亚洲精品| 日韩午夜精品视频| 亚洲黄色性网站| 国产一区日韩二区欧美三区| 色综合婷婷久久| 2020日本不卡一区二区视频| 亚洲精品国产a| 国产成人av一区二区三区在线观看| 91久久精品一区二区三| 欧美精品一区二区三区一线天视频| 亚洲男同1069视频| 国产精品亚洲成人| 51久久夜色精品国产麻豆| 亚洲男人的天堂网| 国产福利一区二区三区| 91麻豆精品国产自产在线| 亚洲啪啪综合av一区二区三区| 麻豆中文一区二区| 欧美日韩美少妇| 亚洲欧美在线视频观看| 国内精品久久久久影院薰衣草| 欧美三级三级三级| 18欧美亚洲精品| 国产成人免费av在线| 欧美一区二区免费观在线| 亚洲影院在线观看| 色综合久久精品| 国产精品污网站| 国产一区二区看久久| 欧美一区永久视频免费观看| 亚洲色图在线视频| 成人av片在线观看| 久久精品日韩一区二区三区| 琪琪一区二区三区| 欧美色网站导航| 一区二区三区四区精品在线视频| 成人国产精品免费观看| 国产欧美精品区一区二区三区| 久久国产综合精品| 日韩一区二区三区在线视频| 又紧又大又爽精品一区二区| 成人av网址在线| 国产精品久久久久久久久免费桃花| 国产精品资源在线看| 久久综合中文字幕| 国产一区欧美一区| www国产精品av| 国产一区二区三区四区五区入口| 欧美一二三四在线| 男女男精品视频网| 精品第一国产综合精品aⅴ| 另类综合日韩欧美亚洲| 日韩精品一区二区三区中文精品| 日韩国产精品久久久| 在线综合+亚洲+欧美中文字幕| 视频在线观看一区二区三区| 91精品国产色综合久久不卡蜜臀 | 国产精品午夜在线观看| 成人国产精品免费观看动漫| 国产精品久久三| 91国偷自产一区二区开放时间| 一区二区三区欧美视频| 在线观看不卡一区| 日韩电影一区二区三区四区| 日韩情涩欧美日韩视频| 国产永久精品大片wwwapp| 中文字幕国产精品一区二区| 91色porny在线视频| 亚洲成年人网站在线观看| 日韩无一区二区| 成人午夜电影小说| 一区二区中文视频| 欧美日韩不卡视频| 国内外成人在线| 国产精品免费久久久久| 色爱区综合激月婷婷| 日韩电影在线一区二区三区| 亚洲精品一区二区精华| 成人一区二区视频| 亚洲日本在线a| 欧美精品99久久久**| 久久99精品国产麻豆婷婷| 亚洲国产精品99久久久久久久久| av影院午夜一区| 日韩av中文字幕一区二区 | 中文字幕国产一区| 欧美色网站导航| 国产精品亚洲成人| 亚洲一区二区三区视频在线播放| 91精品国产福利| 成人爱爱电影网址| 青青草国产成人av片免费| 国产精品区一区二区三区 | 中文字幕一区二区三区四区| 在线观看国产91| 国产高清视频一区| 一区二区高清视频在线观看| 日韩美女一区二区三区| 色呦呦一区二区三区| 精品亚洲欧美一区| 一区二区欧美精品| 国产亚洲精品资源在线26u| 欧美丝袜丝交足nylons图片| 国产成人午夜片在线观看高清观看| 一区二区三区不卡在线观看| 久久久影院官网| 欧美日韩免费高清一区色橹橹 | 国产精品三级电影| 欧美成人精品二区三区99精品| 91色九色蝌蚪| 国产精品88av| 日韩高清在线不卡| 一区二区三区四区不卡在线| 国产亚洲成aⅴ人片在线观看| 欧美三级三级三级| 91在线视频在线| 精品一区二区三区的国产在线播放| 亚洲激情校园春色|