⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syselt3c509end.c

📁 Vxworks 5.5.1的3C509网卡驱动程序
💻 C
字号:
/* sysElt3c509End.c - system configuration module for NE2000 END */ /* Copyright 1999 Wind River Systems, Inc. */ /*modification history--------------------01b,31mar99,sbs  corrected elt3c509ParamTemplate initialization.                 (SPR #26208)01a,09mar99,sbs  written sysNE2000End.c*//*DESCRIPTIONThis is the WRS-supplied configuration module for the VxWorks ELT 3C509 (elt) END driver.  It performs the dynamic parameterization of the elt3c509End driver.This technique of 'just-in-time' parameterization allows driverparameter values to be declared as any other defined constants rather than as static strings. */ /* includes */#include "vxWorks.h"#include "stdio.h"#include "stdlib.h"#include "string.h"#include "end.h"#include "config.h"#ifdef INCLUDE_ELT_3C509_END /* defines */#define ELT_ATTACHMENT_TYPE	0#define ELT_RX_FRAMES		64 /* imports */IMPORT END_OBJ * elt3c509Load (char *);/******************************************************************************** sysElt3c509EndLoad - load (create) ELT3c509 (elt) device** This routine loads the elt device with initial parameters specified by* values given in the BSP configuration files (config.h).** RETURNS: pointer to END object or ERROR.** SEE ALSO: elt3c509Load()*/ END_OBJ * sysElt3c509EndLoad    (    char * pParamStr,   /* ptr to initialization parameter string */    void * unused       /* unused optional argument */    )    {    /*     * The End driver END_LOAD_STRING should be:     * "<ioPort>:<intVec>:<intLevel>:<attachmentType>:<nRxFrames>"     *  Note that the unit number is prepended by mux.     */    char * cp; 			    char paramStr [END_INIT_STR_MAX];   /* from end.h */    static char elt3c509ParamTemplate [] = "%#x:%#x:%#x:%d:%d";    END_OBJ * pEnd;    if (strlen (pParamStr) == 0)        {        /*          * muxDevLoad() calls us twice.  If the string is         * zero length, then this is the first time through         * this routine, so we just return.         */        pEnd = elt3c509Load (pParamStr);        }    else	{        /*         * On the second pass though here, we actually create          * the initialization parameter string on the fly.            * Note that we will be handed our unit number on the          * second pass through and we need to preserve that information.         * So we use the unit number handed from the input string.         */        cp = strcpy (paramStr, pParamStr); /* cp points to paramStr */        /* Now, we advance cp, by finding the end the string */        cp += strlen (paramStr);                /* finish off the initialization parameter string */	sprintf (cp, elt3c509ParamTemplate,                  IO_ADRS_ELT,                  INT_VEC_ELT,                 INT_LVL_ELT,                  ELT_ATTACHMENT_TYPE,                  ELT_RX_FRAMES);        if ((pEnd = elt3c509Load (paramStr)) == (END_OBJ *)ERROR)	    {            printf ("Error: ELT 3C509 device failed elt3c509Load routine.\n");	    }	}    return (pEnd);    }/********************************************************************************* sysEltIntEnable - enable the board level interrupt** This routine enables the board level interrupt.** RETURNS: N/A** NOMANUAL*/void sysEltIntEnable    (    int intLevel        /* irq level */    )    {    sysIntEnablePIC (intLevel);    }/********************************************************************************* sysEltIntDisable - disable the board level interrupt** This routine disables the board level interrupt.** RETURNS: N/A** NOMANUAL*/void sysEltIntDisable    (    int intLevel        /* irq level */    )    {    sysIntDisablePIC (intLevel);    }#endif /* INCLUDE_ELT_3C509_END */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -