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

📄 drv_conf.h

📁 wm PNE 3.3 source code, running at more than vxworks6.x version.
💻 H
📖 第 1 页 / 共 4 页
字号:
/* @(#) pSOSystem: apps/inetutil/drv_conf.c (&U&) 1.1 00/01/19 16:15:15 *//* * Copyright (C) 1999-2004 Wind River Systems, Inc. * All rights reserved.  Provided under license only. * Distribution or other use of this software is only * permitted pursuant to the terms of a license agreement * from Wind River Systems (and is otherwise prohibited). * Refer to that license agreement for terms of use. *//* [clearcase]modification history-------------------*//***********************************************************************//*                                                                     *//*   MODULE:  drv_conf.c                                               *//*   DATE:    00/01/19                                                 *//*   PURPOSE: pSOSystem driver configuration and initialization        *//*                                                                     *//*            These are the functions in this file:                    *//*                                                                     *//*            SetUpDrivers  to setup drivers except for Network drivers*//*	      DrvSysStartCO to setup Initial Device Name Table         *//*            SetUpNI       to setup Network drivers                   *//*                                                                     *//*---------------------------------------------------------------------*//*                                                                     *//*           Copyright 1991 - 1999, Integrated Systems, Inc.           *//*                      ALL RIGHTS RESERVED                            *//*                                                                     *//*   Permission is hereby granted to licensees of Integrated Systems,  *//*   Inc. products to use or abstract this computer program for the    *//*   sole purpose of implementing a product based on Integrated        *//*   Systems, Inc. products.   No other rights to reproduce, use,      *//*   or disseminate this computer program, whether in part or in       *//*   whole, are granted.                                               *//*                                                                     *//*   Integrated Systems, Inc. makes no representation or warranties    *//*   with respect to the performance of this computer program, and     *//*   specifically disclaims any responsibility for any damages,        *//*   special or consequential, connected with the use of this program. *//*                                                                     *//*---------------------------------------------------------------------*//*                                                                     *//*                                                                     *//*                                                                     *//***********************************************************************/#include "sys_conf.h"#include "bsp.h"#include <bspfuncs.h>#include <configs.h>#include <sysvars.h>#include <pna.h>#if SC_DEV_SPI    #include "spi.h"#endif#if (SC_PSE)#include <psecfg.h>#include <sys/stream.h>#endif#if (SC_DEV_DLPI)#include <sys/enetdlpi.h>#endif#if (SC_DEV_NULL)extern void NullDevInit(struct ioparms *);extern void NullDevRead(struct ioparms *);extern void NullDevWrite(struct ioparms *);extern void NullDevCntrl(struct ioparms *);#endif#define NULLF (void *) ((void (*)(struct ioparms *)) 0)#if (SC_PNA || SC_PNET)static const char RarpErrTimeout[] =  "RARP request failed: Check for a RARP server";static const char RarpErrNet[] =  "RARP request failed: Network Error";#endif#if (SC_DEV_TFTP || SC_DEV_NTFTP)ULONG NumTftpChans = SC_MAX_TFTP_CHAN;#endif#if (SC_DEV_HTTP)ULONG NumHttpChans = SC_MAX_HTTP_CHAN;#endif#if (SC_DEV_PIPE)unsigned long   NumPipeChans = SC_MAX_PIPE_CHAN;#endif#if (SC_DEV_PSCONSOLE)ULONG    NumPsConsoleSharedChan = SC_PSCNSL_SHARED_CHAN;ULONG    NumPsConsolePrivateChan = SC_PSCNSL_PRIVATE_CHAN;ULONG    NumPsConsoleCustomModule = SC_PSCNSL_MAX_CUSTOM;#endif#if (defined(BSP_NEW_SERIAL) && !(BSP_NEW_SERIAL) && (BSP_SERIAL))extern UCHAR *CnslSetup(UCHAR *FreeMem, ULONG defbaud, USHORT defcons);#endif#if SC_PSOS || SC_PSOSM/***********************************************************************//* SetUpDrivers: installs drivers in PsosIO table via a call to        *//*               InstallDriver and then calls driver setup function if *//*               needed. NOTE: If the driver is to be part of the      *//*               Network Interface then it should be placed in the     *//*               SetUpNI function.                                     *//*                                                                     *//*       INPUT: FreeMemPtr = A pointer to unused memory that can be    *//*                           used to allocate space for a driver.      *//*                           NOTE: Be sure to advance FreeMemPtr if    *//*                           memory is allocates!                      *//*                                                                     *//*     RETURNS: The new address of free memory after the drivers have  *//*              allocated space.                                       *//*                                                                     *//*        NOTE: This function does many precompile checks so errors    *//*              can be found during compile-time rather then at run-   *//*              time.                                                  *//*                                                                     *//* To add a non-Network driver to pSOSystem, call InstallDriver().     *//* This adds a device driver to the PsosIO table.  InstallDriver()     *//* takes the following arguments:                                      *//*                                                                     *//*     unsigned short major_number    device major number              *//*     void (*dev_init)()             device init procedure            *//*     void (*dev_open)()             device open procedure            *//*     void (*dev_close)()            device close procedure           *//*     void (*dev_read)()             device read procedure            *//*     void (*dev_write)()            device write procedure           *//*     void (*dev_ioctl)()            device control procedure         *//*     unsigned long dev_param        Used for STREAMS modules         *//*     unsigned short rsvd2           reserved                         *//*     unsigned short flags           If set to IO_AUTOINIT pSOS will  *//*                                    automatically call the           *//*                                    drivers initialization           *//*                                    function. The SC_AUTOINIT        *//*                                    #define which is set in          *//*                                    sys_conf.h can be used to set    *//*                                    this element.                    *//*                                                                     *//* InstallDriver() does not return a value.  InstallDriver() assumes   *//* SC_DEVMAX is defined in sys_conf.h and is useful only before pSOS+  *//* has been initialized.                                               *//*                                                                     *//* If you are adding a driver that needs to be initialized before      *//* either pSOS+ is initialized or the driver's init function is        *//* called, then you can call a setup function (that you create) for    *//* the driver. If your initialization function needs to allocate       *//* memory, you may pass it the FreeMemPtr.  The function should return *//* a new FreeMemPtr which points to the end of the memory it has       *//* allocated.                                                          *//*                                                                     *//* When adding code to install a new driver, it is a good idea to add  *//* precompile checks so errors can be found during compile-time rather *//* then at run-time.  Precompile checks are used, for example, in the  *//* code that installs the pSOSystem serial device driver below.        *//*                                                                     *//***********************************************************************/UCHAR *SetUpDrivers(UCHAR *FreeMemPtr){extern ULONG PsosNumDntEnts;/*---------------------------------------------------------------------*//* Install the pSOSystem serial device driver.                         *//*---------------------------------------------------------------------*/#if (SC_DEV_SERIAL && BSP_SERIAL && BSP_NEW_SERIAL)    #if(SC_DEV_SERIAL > SC_DEVMAX)        #error "SC_DEV_SERIAL cannot be > SC_DEVMAX"    #endif    InstallDriver(SC_DEV_SERIAL, TermInit, TermOpen, TermClose,TermRead,                  TermWrite, TermIoctl, 0, 0, IO_CHAR_DEV | SC_AUTOINIT);    PsosNumDntEnts++;/*---------------------------------------------------------------------*//* This section is provided for backward compatibility only.           *//* It will be removed completely in the next version of pSOSystem.     *//*---------------------------------------------------------------------*/#elif (SC_DEV_SERIAL && BSP_SERIAL)    #if(SC_DEV_SERIAL > SC_DEVMAX)        #error "SC_DEV_SERIAL cannot be > SC_DEVMAX"    #endif    InstallDriver(SC_DEV_SERIAL, CnslInit, NULLF, NULLF,CnslRead,                  CnslWrite, CnslCntrl, 0, 0, IO_CHAR_DEV | SC_AUTOINIT);    FreeMemPtr = CnslSetup(FreeMemPtr, SysVars.DefBaud, SC_APP_CONSOLE);    PsosNumDntEnts++;#endif/*---------------------------------------------------------------------*//* Install the pSEUDO console driver                                   *//*---------------------------------------------------------------------*/#if (DEV_PSCONSOLE)    InstallDriver(SC_DEV_PSCONSOLE, NULLF, PsConsoleOpen,                  PsConsoleClose, PsConsoleRead, PsConsoleWrite,                  PsConsoleCntrl, 0, 0, IO_CHAR_DEV);    PsosNumDntEnts +=4;#endif/*--------------------------------------------------------------------*/ /* Install the Memory Log driver.                                     */ /*--------------------------------------------------------------------*/ #if SC_DEV_MEMLOG    InstallDriver(SC_DEV_MEMLOG, MemLogInit, NULLF,                  NULLF, MemLogRead, MemLogWrite,                  MemLogCntrl, 0, 0, IO_CHAR_DEV);    PsosNumDntEnts++;#endif/*--------------------------------------------------------------------*/ /* Install the Memory pROBE+ Remote debugger driver (RDIO).           */ /*--------------------------------------------------------------------*/ #if SC_DEV_RDIO    InstallDriver(SC_DEV_RDIO, NULLF, NULLF,                  NULLF, RdioRead, RdioWrite,                  0, 0, 0, IO_CHAR_DEV);    PsosNumDntEnts++;#endif/*--------------------------------------------------------------------*//* Setup pSOSystem PC console device driver                           *//*--------------------------------------------------------------------*/#if (SC_DEV_CONSOLE && BSP_CONSOLE)    #if (SC_DEV_CONSOLE >SC_DEVMAX)    #error "SC_DEV_CONSOLE cannot be > SC_DEVMAX"    #endif    InstallDriver(SC_DEV_CONSOLE, PcCnslInit, NULLF, NULLF,                  PcCnslRead, PcCnslWrite, PcCnslCntrl, 0, 0,                  IO_CHAR_DEV | SC_AUTOINIT);    PsosNumDntEnts++;#endif/*---------------------------------------------------------------------*//* Install the pSOSystem tick timer.                                   *//*---------------------------------------------------------------------*/#if SC_DEV_TIMER    #if(SC_DEV_TIMER > SC_DEVMAX)        #error "SC_DEV_TIMER cannot be > SC_DEVMAX"    #endif    #if (!SC_PSOS && !SC_PSOSM)        #error "Must have pSOS+ or pSOS+m in system to use tick timer!"    #endif    InstallDriver(SC_DEV_TIMER, RtcInit, NULLF, NULLF, NULLF, NULLF,                  NULLF, 0, 0, IO_CHAR_DEV | SC_AUTOINIT);    PsosNumDntEnts++;#endif/*---------------------------------------------------------------------*//* Install DevNull driver                                              *//* NOTE: This driver must be called from a task it cannot use the      *//*       auto initialization freature of pSOS+                         *//*---------------------------------------------------------------------*/#if (SC_DEV_NULL)    InstallDriver(SC_DEV_NULL, NullDevInit, NULLF, NULLF,NullDevRead,                  NullDevWrite, NullDevCntrl, 0, 0, IO_CHAR_DEV);    PsosNumDntEnts++;#endif/*---------------------------------------------------------------------*//* Install the pSOSystem ramdisk driver.                               *//* NOTE: This driver must be called from a task it cannot use the      *//*       auto initialization freature of pSOS+                         *//*---------------------------------------------------------------------*/#if SC_DEV_RAMDISK    #if(SC_DEV_RAMDISK > SC_DEVMAX)        #error "SC_DEV_RAMDISK cannot be > SC_DEVMAX"    #endif    InstallDriver(SC_DEV_RAMDISK, RdskInit, RdskOpen, RdskClose, RdskRead,                  RdskWrite, RdskCntrl, 0, 0, IO_BLOCK_DEV);    PsosNumDntEnts++;#endif/*---------------------------------------------------------------------*//* Install the pSOSystem PIPE driver.                                  *//* NOTE: This driver must be called from a task it cannot use the      *//*       auto initialization feature of pSOS+                          *//*---------------------------------------------------------------------*/#if SC_DEV_PIPE    #if(SC_DEV_PIPE > SC_DEVMAX)        #error "SC_DEV_PIPE cannot be > SC_DEVMAX"    #endif    InstallDriver(SC_DEV_PIPE, PipeInit, PipeOpen, PipeClose, PipeRead,                  PipeWrite, PipeCntl, 0, 0, IO_CHAR_DEV);    PsosNumDntEnts++;#endif/*---------------------------------------------------------------------*//* Install the pSOSystem SCSI driver.                                  *//* NOTE: This driver must be called from a task it cannot use the      *//*       auto initialization freature of pSOS+                         *//*---------------------------------------------------------------------*/#if (SC_DEV_SCSI && BSP_SCSI)    #if(SC_DEV_SCSI > SC_DEVMAX)        #error "SC_DEV_SCSI cannot be > SC_DEVMAX"    #endif    InstallDriver(SC_DEV_SCSI, SdrvInit, SdskOpen, SdskClose, SdskRead,                  SdskWrite, SdrvCntrl, 0, 0, IO_BLOCK_DEV);    PsosNumDntEnts++;#endif/*---------------------------------------------------------------------*//* Install the pSOSystem SCSI Tape driver.                             *//* NOTE: This driver must be called from a task it cannot use the      */

⌨️ 快捷键说明

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